Generative artificial intelligence driven high-precision defect detection method and system
Through the generative artificial intelligence-driven defect detection method, combined with image preprocessing and AI recognition, the problems of insufficient accuracy and resource requirements of traditional detection methods in micro defect detection are solved, and efficient defect recognition is achieved.
Patent Information
- Application Number
- CN202511021351.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-07-24
AI Technical Summary
When traditional defect detection methods face small defects, hidden defects or new unknown defects, the detection accuracy is insufficient, the error detection rate and missed detection rate are high, and the resource demand is large and the speed is slow.
The defect detection method driven by generative artificial intelligence is adopted, and the image data is acquired for preprocessing, feature values are marked, base image and defect features are extracted, and the base image and defect features are combined into comprehensive features, simulated images are generated and input into AI, and defect recognition libraries are constructed, and detection is performed using a combination of pre-recognition and AI recognition.
It improves the identification ability and resource utilization rate of defect detection, reduces resource demand, and improves detection speed.
Smart Images

Figure CN120526291A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect visual detection technology, and specifically to a high-precision defect detection method and system driven by generative artificial intelligence. Background Art
[0002] Traditional defect detection mostly relies on rule-based image processing algorithms or discriminative deep learning models (such as convolutional neural networks (CNNs)). Their detection accuracy is easily limited by the comprehensiveness of data annotation, the diversity of defect morphology, and the scarcity of defect samples. Especially when facing tiny defects, hidden defects, or new unknown defects, traditional models lack generalization and robustness, resulting in high false detection and missed detection rates.
[0003] The advantages of the traditional defect detection method are also obvious. It is very efficient. After the convolution library is built, recognition can be performed directly locally, with low resource requirements and high efficiency. In the existing technology, the AI module has extremely strong recognition capabilities, but its resource requirements are large and the speed is very slow. Therefore, how to provide a comprehensive solution to improve recognition capabilities while ensuring recognition efficiency is the technical problem that the technical solution of the present invention wants to solve. Summary of the Invention
[0004] The purpose of the present invention is to provide a high-precision defect detection method and system driven by generative artificial intelligence to solve the problems raised in the above background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions: A high-precision defect detection method driven by generative artificial intelligence, the method comprising: Acquire image data of the object to be inspected, pre-process the image data, and mark the characteristic value of each position; the characteristic value is used to indicate the possibility that a certain position is a defect, and the larger the characteristic value, the greater the possibility that the position is a defect; Extracting a base image and defect features from the image data according to the feature values, and combining the extracted defect features to obtain a comprehensive feature; Combine the defect features and comprehensive features, insert them into the extracted reference image, and obtain a simulated image; Input the simulated image into AI, output the recognition result, count the simulated image and recognition result, and build a defect recognition library; When receiving an image to be identified, the image is pre-identified based on the defect recognition library. If the recognition fails, AI is applied for recognition.
[0006] As a further solution of the present invention, the steps of obtaining image data of the detected object, preprocessing the image data, and marking the feature values of each position include: Acquiring image data of the detected object; Perform channel segmentation on the image data to obtain layers of different channels; Perform gradient operations on layers of different channels to obtain gradient layers; Marking contour points according to the gradient layer, connecting the contour points to obtain each sub-area; For each position, all sub-regions containing the position are queried, the number of pixels in each sub-region is queried, and the feature value of the position is determined based on the number of pixels in each sub-region.
[0007] As a further solution of the present invention, the step of extracting the base image and defect features from the image data according to the feature values, and combining the extracted defect features to obtain a comprehensive feature includes: Calculating eigenvalue differences between adjacent pixels, and clustering the pixels based on the eigenvalue differences; Selecting the area with the largest number of pixels and performing image padding on the area to obtain a base image; wherein the image padding process is used to expand the area size to the standard image size of the object being detected; The area where the number of pixels is less than a preset threshold is regarded as a defect feature; Compare the contour similarity of the defect features. When the contour similarity reaches a preset similarity threshold, superimpose the defect features to obtain a comprehensive feature. The comprehensive feature contains a feature label for characterizing the defect features involved in the superposition.
[0008] As a further solution of the present invention: the step of combining the defect features and the comprehensive features and inserting them into the extracted reference image to obtain the simulated image includes: For any defect feature, query the total number of image data corresponding to it; Determining the probability of selecting a defect feature based on the total number; the greater the total number, the greater the probability of selection; For any comprehensive feature, query the selection probability of its corresponding defect feature, calculate the product of the selection probabilities, and use it as the selection probability of the comprehensive feature; Read the defect characteristics and comprehensive characteristics in sequence, generate a random number in the range of 0 to 1, and generate a selection instruction when the random number is less than the selection probability; After the selection instruction is generated, the corresponding feature is selected and inserted into the extracted reference image to obtain a simulated image; wherein the insertion position is a random position.
[0009] As a further solution of the present invention, the steps of inputting the simulated image into AI, outputting the recognition result, and statistically analyzing the simulated image and the recognition result to construct a defect recognition library include: Input the simulated image into AI and output the recognition results of each feature; Record the recognition results of each feature in real time and calculate the mode value of the recognition results; Count all features and their mode values to obtain the defect recognition library.
[0010] As a further solution of the present invention: when receiving an image to be identified, performing pre-identification on the image to be identified according to the defect identification library, and when the identification fails, applying AI for identification includes the following steps: When receiving the image to be identified, read the features in the defect identification library; Traversing the image to be identified based on the features and calculating the matching degree; When the matching degree reaches the preset matching threshold, the corresponding recognition result is read; When the matching degree of all features in the defect recognition library in the image to be recognized is less than the preset matching threshold, AI is applied to recognize the image to be recognized, and the defect recognition library is updated according to the recognition results.
[0011] The technical solution of the present invention also provides a high-precision defect detection system driven by generative artificial intelligence, the system comprising: The feature value marking module is used to obtain image data of the inspected object, pre-process the image data, and mark the feature value of each position; the feature value is used to indicate the possibility that a certain position is a defect, and the larger the feature value, the greater the possibility that the position is a defect; a feature combination module, configured to extract the base image and defect features from the image data according to the feature values, and combine the extracted defect features to obtain a comprehensive feature; The simulation image generation module is used to combine the defect features and the comprehensive features, insert the extracted reference image, and obtain the simulation image; The defect library construction module is used to input simulated images into AI, output recognition results, count simulated images and recognition results, and build a defect recognition library; The image recognition module is used to perform pre-recognition on the image to be recognized based on the defect recognition library when receiving the image to be recognized. When the recognition fails, AI is applied for recognition.
[0012] As a further solution of the present invention: the feature value marking module includes: An image acquisition unit, configured to acquire image data of the detected object; A layer extraction unit, configured to perform channel segmentation on the image data to obtain layers of different channels; The gradient layer generation unit is used to perform gradient operations on the layers of different channels to obtain gradient layers; A sub-region segmentation unit, configured to mark contour points according to the gradient layer and connect the contour points to obtain sub-regions; The characteristic value calculation unit is used to query all sub-areas containing each position, query the number of pixels in each sub-area, and determine the characteristic value of the position according to the number of pixels in each sub-area.
[0013] As a further solution of the present invention: the feature combination module includes: A point clustering unit, configured to calculate the difference in eigenvalues of adjacent pixels and cluster the pixels according to the difference in eigenvalues; A base image generation unit is used to select an area with the largest number of pixels and perform image padding on the area to obtain a base image; wherein the image padding process is used to expand the area size to the standard image size of the object being detected; A defect feature generating unit, configured to take an area where the number of pixels is less than a preset threshold as a defect feature; The comprehensive feature generation unit is used to compare the contour similarity of the defect features. When the contour similarity reaches a preset similarity threshold, the defect features are superimposed to obtain a comprehensive feature; wherein the comprehensive feature contains a feature label for characterizing the defect features involved in the superposition.
[0014] As a further solution of the present invention: the simulated image generation module includes: A total number query unit is used to query the total number of image data corresponding to any defect feature; a selection probability determination unit, configured to determine a selection probability of a defect feature according to the total number; the greater the total number, the greater the selection probability; The comprehensive probability determination unit is used to query the selection probability of the corresponding defect feature for any comprehensive feature, and calculate the product of the selection probabilities as the selection probability of the comprehensive feature; An instruction generation unit, used to instruct to sequentially read defect characteristics and comprehensive characteristics, generate a random number in the range of zero to one, and generate a selection instruction when the random number is less than the selection probability; The feature insertion unit is used to select the corresponding feature after generating the selection instruction, insert it into the extracted reference image, and obtain a simulated image; wherein the insertion position is a random position.
[0015] Compared with the existing technology, the beneficial effects of the present invention are: the present invention determines the defect features based on the acquired image of the inspected object, combines the defect features to generate a variety of new features, and then uses AI to pre-identify them to obtain recognition results, and counts all features and recognition results to obtain a convolution library with extremely large breadth. In the traditional recognition architecture, the convolution library is expanded and the recognition ability is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention.
[0017] Figure 1 A flowchart of the high-precision defect detection method driven by generative artificial intelligence.
[0018] Figure 2 This is the first sub-process block diagram of the high-precision defect detection method driven by generative artificial intelligence.
[0019] Figure 3 This is the second sub-process block diagram of the high-precision defect detection method driven by generative artificial intelligence.
[0020] Figure 4 This is the third sub-process block diagram of the high-precision defect detection method driven by generative artificial intelligence.
[0021] Figure 5 This is the fourth sub-process block diagram of the high-precision defect detection method driven by generative artificial intelligence.
[0022] Figure 6 This is the fifth sub-process block diagram of the high-precision defect detection method driven by generative artificial intelligence.
[0023] Figure 7 This is a structural block diagram of the high-precision defect detection system driven by generative artificial intelligence. DETAILED DESCRIPTION
[0024] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0025] Figure 1 This is a flowchart of a high-precision defect detection method driven by generative artificial intelligence. In an embodiment of the present invention, a high-precision defect detection method driven by generative artificial intelligence includes: Step S100: Acquire image data of the detected object, pre-process the image data, and mark the feature values of each position; Step S100 is a preprocessing process, which obtains image data of the object to be inspected. A lot of image data is needed. Each image is preprocessed and the eigenvalues at each position are calculated. The eigenvalues of the technical solution of the present invention are used to characterize the possibility that a certain position is a defect. The larger the eigenvalue, the greater the possibility that the position is a defect. The eigenvalue is generally determined by the pixel difference between the pixels.
[0026] Step S200: extracting a base image and defect features from the image data according to the feature values, and combining the extracted defect features to obtain a comprehensive feature; After the eigenvalues of each position are determined, different areas can be determined in the image based on the eigenvalues. The area with the largest area is selected, which is the main body of the object to be inspected. The overall situation of the object to be inspected is fitted based on the largest area to obtain the base image. Areas with smaller areas are regarded as defect features. The extracted defect features are combined and superimposed to obtain some comprehensive features. Most of these comprehensive features have no physical meaning, but a small part of them have physical meaning, indicating a state where two defects occur at the same time.
[0027] Step S300: combining the defect features and the comprehensive features, inserting the extracted reference image, and obtaining a simulated image; The comprehensive features themselves are generated features. On this basis, all defect features and generated comprehensive features are counted, these features are combined and inserted into the extracted reference image to obtain several simulated images, each of which contains a random variety of defect features or comprehensive features.
[0028] Step S400: Input the simulated image into AI, output the recognition result, count the simulated image and recognition result, and build a defect recognition library; The simulated image is input into AI, and the recognition result is output. The recognition result is generally multi-source data. The most common data structure is a coordinate set and some descriptive text, which can be completed by AI in the existing architecture. It is worth mentioning that if the performance is sufficient, the features of the image format can also be intercepted and retained. By counting the various defect features in each simulated image and their recognition results, a defect recognition library can be obtained. The defect recognition library includes two items, one is the defect feature item, and the other is the recognition result item.
[0029] Step S500: When receiving an image to be identified, pre-identify the image according to the defect identification library. If the identification fails, apply AI for identification. When an image to be identified is received, pre-identification is performed on the image according to the defect recognition library. If the identification fails, AI is applied for identification. The identification process of the defect recognition library can be performed locally, and the network resource and space resource requirements are relatively small. The recognition speed is also very fast. The disadvantage is that the recognition ability is limited and not as good as AI. After the identification process of the defect recognition library fails, AI is introduced. This hierarchical architecture greatly improves resource utilization.
[0030] Figure 2This is a block diagram of the first sub-process of the high-precision defect detection method driven by generative artificial intelligence. The steps of acquiring image data of the object to be inspected, preprocessing the image data, and marking the feature values of each position include: Step S101: Acquire image data of the detected object; Step S102: performing channel segmentation on the image data to obtain layers of different channels; Step S103: performing gradient operations on the layers of different channels to obtain gradient layers; Step S104: marking contour points according to the gradient layer, connecting the contour points to obtain each sub-area; Step S105: For each position, query all sub-regions containing the position, query the number of pixels in each sub-region, and determine the feature value of the position according to the number of pixels in each sub-region.
[0031] In an example of the technical solution of the present invention, the image data is preprocessed, and the processing method includes obtaining image data of the detected object, which is the original image, and performing channel segmentation on the image data to obtain layers of different channels. Generally, there are only three channels, such as RGB channels, and each channel has a layer. Gradient operations are performed on the layers of different channels to obtain gradient layers. It should be noted that the gradient layer is the gradient at each pixel point. Since the gradient is a gradient in a certain direction, it is necessary to preset some directions and obtain the gradient in the direction. Under normal conditions, the directions are generally selected from two mutually perpendicular directions, such as horizontal and vertical directions. In this way, each channel layer has two gradient layers. In summary, each image data has three layers, each layer has two gradient layers, and finally each image data corresponds to six gradient layers. Combined with the image data itself, there are a total of seven images.
[0032] By analyzing several gradient layers, we can obtain the difference between each pixel point (position) and its adjacent pixels, and then mark the pixels that may be contours, called contour points. In this way, the contour recognition of the image data is completed, and the contour points are connected to obtain each sub-area.
[0033] For each position in the image data, all sub-regions containing the position are queried, the number of pixels in each sub-region is queried, and the feature value of the position is determined based on the number of pixels in each sub-region.
[0034] Regarding the calculation process of eigenvalues, a feasible solution is: Where, represents the eigenvalue, is a preset constant, For the The total number of pixels in the sub-area, Indicates the total number of corresponding sub-areas.
[0035] Figure 3 This is a second sub-flow diagram of a high-precision defect detection method driven by generative artificial intelligence. The steps of extracting a base image and defect features from the image data based on the feature values, and combining the extracted defect features to obtain a comprehensive feature include: Step S201: Calculating eigenvalue differences between adjacent pixels, and clustering the pixels according to the eigenvalue differences; Step S202: Selecting a region with the largest number of pixels and performing image padding on the region to obtain a base image; wherein the image padding process is used to expand the region size to the standard image size of the object being detected; Step S203: taking the area where the number of pixels is less than a preset threshold as a defect feature; Step S204: comparing the contour similarities of the defect features. When the contour similarity reaches a preset similarity threshold, the defect features are superimposed to obtain a comprehensive feature. The comprehensive feature contains a feature label for characterizing the defect features involved in the superposition.
[0036] In an example of the technical solution of the present invention, the feature combination process is described, the eigenvalue difference of adjacent pixel points is calculated, the eigenvalue difference is used as the distance, and the pixels are clustered to obtain multiple areas; in the image data of the detected object, the main body is definitely the detected object, and the area with the largest number of pixels is selected, which corresponds to the detected object. The image is filled in the area to obtain a base image, wherein the image filling process is to fill in some missing parts based on the existing areas, and simulate the visual state of the detected object through the algorithm. This process is very common in existing image processing software, such as the clone stamp tool and the more accurate AI image restoration tool.
[0037] On this basis, the area where the number of pixels is less than the preset threshold is taken as the defect feature, and the contour similarity of the defect features is compared. When the contour similarity reaches the preset similarity threshold, it means that the shapes of the two defects are similar enough, and it is also considered that they may occur at the same time (not necessarily, but possible, such as pores + cracks). The defect features are superimposed to obtain a comprehensive feature.
[0038] Specifically, regarding the superposition process, whether the defect features can be directly added is actually questionable. It is generally a range. For example, two defect features are two images. When the two images are added, the color values are not simply added directly. This has no practical meaning. Taking grayscale as an example, when the two pixels are 128 respectively, the sum is 256, and the limit is 255, which is white, and 128 itself is gray. Two grays are superimposed on white, which is obviously inappropriate; therefore, the above superposition process generally adopts weighted superposition and maximum value superposition.
[0039] Figure 4 This is a block diagram of the third sub-process of the high-precision defect detection method driven by generative artificial intelligence. The steps of combining defect features and comprehensive features, inserting the extracted reference image, and obtaining a simulated image include: Step S301: for any defect feature, query the total number of image data corresponding to it; Step S302: determining the probability of selecting a defect feature based on the total number; the greater the total number, the greater the selection probability; Step S303: For any comprehensive feature, query the selection probability of the corresponding defect feature, calculate the product of the selection probabilities, and use it as the selection probability of the comprehensive feature; Step S304: Read the defect characteristics and comprehensive characteristics in sequence, generate a random number in the range of 0 to 1, and generate a selection instruction when the random number is less than the selection probability; Step S305: After the selection instruction is generated, the corresponding feature is selected and inserted into the extracted reference image to obtain a simulated image; wherein the insertion position is a random position.
[0040] For any defect feature, query the total number of image data corresponding to it. The larger the total number, the more frequently the defect feature appears. Determine the selection probability of the defect feature based on the total number. The larger the total number, the greater the selection probability. For any comprehensive feature, comprehensive features are actually relatively rare. Query the selection probability of the corresponding defect feature and calculate the product of the selection probabilities as the selection probability of the comprehensive feature. This direct product method may make the final probability very small. Therefore, some coefficients can be introduced. These coefficients are used to characterize the commonness of the simultaneous occurrence of two defects (which can be obtained based on records). If it is relatively easy, a larger coefficient can be set. On the contrary, if it is almost impossible, then a smaller coefficient is set, which will make the selection probability smaller. It should be noted that no matter what the selection probability is, once it reaches one, it is directly taken as one.
[0041] After the selection probability of each feature is determined, the defect features and comprehensive features are read in turn, and a random number is generated in the range of zero to one. When the random number is less than the selection probability, a selection instruction is generated. After the selection instruction is generated, the corresponding feature is selected and inserted into the extracted reference image to obtain a simulated image. The insertion position is a random position. In this way, there may be multiple features in a simulated image, and these features may have overlapped before, which also involves a superposition process.
[0042] It is worth mentioning that in the technical solution of the present invention, each feature has a selection probability. This selection probability will make the defect features that are difficult to occur more difficult to appear. Moreover, the comprehensive features in the technical solution of the present invention are superimposed, and it is very likely that they have no practical significance. However, the selection probability of the comprehensive features that have no practical significance is the product of a small coefficient and two selection probabilities, which is extremely small and will hardly appear. Even if they appear, there will be only a few, which can be ignored.
[0043] Figure 5 This is a block diagram of the fourth sub-process of the high-precision defect detection method driven by generative artificial intelligence. The steps of inputting simulated images into AI, outputting recognition results, counting simulated images and recognition results, and building a defect recognition library include: Step S401: Input the simulated image into AI and output the recognition result of each feature; Step S402: Record the recognition results of each feature in real time and calculate the mode value of the recognition results; Step S403: Count all features and their mode values to obtain a defect recognition library.
[0044] In an example of the technical solution of the present invention, the recognition process is explained, a simulated image is input into AI, the recognition result of each feature is output, the recognition result of each feature is recorded, the mode result of the recognition result is calculated, all features and their mode results are counted, and a defect recognition library is obtained; AI has a strong recognition ability, and features have many comprehensive features. Due to the random positions, multiple features will also be superimposed, which can obtain multiple features. These features are all generated by software and may not have practical significance, but their advantages are also very obvious. The defect recognition library obtained based on all features and recognition results is extremely broad (even including many comprehensive defects that almost do not exist in reality).
[0045] Figure 6 This is a fifth sub-flow diagram of a high-precision defect detection method driven by generative artificial intelligence. When receiving an image to be identified, pre-identification of the image to be identified is performed based on a defect recognition library. If the identification fails, applying AI for identification includes the following steps: Step S501: upon receiving an image to be identified, reading features from a defect identification library; Step S502: traverse the image to be identified based on the features and calculate the matching degree; Step S503: When the matching degree reaches a preset matching threshold, the corresponding recognition result is read; Step S504: When the matching degree of all features in the defect recognition library in the image to be recognized is less than a preset matching threshold, AI is applied to recognize the image to be recognized, and the defect recognition library is updated according to the recognition result.
[0046] In the actual application stage, when the image to be identified is received, the features are read in the defect recognition library, the image to be identified is traversed based on the features, and the matching degree is calculated. This process can be carried out using a conventional image traversal and comparison algorithm. When the matching degree reaches the preset matching threshold, the match is considered successful and the corresponding recognition result is read. If the matching degrees of all features in the defect recognition library in the image to be identified are less than the preset matching threshold, it means that special features have appeared, which should be very rare. At this time, AI is applied to identify the image to be identified, and the defect recognition library is updated according to the recognition results.
[0047] It is worth mentioning that the AI in the technical solution of the present invention can also be replaced by an artificial end, which is generally an artificial end with an AI module, and is identified by the auditor with the help of AI. For the technical solution of the present invention, it is only necessary to receive the data feedback from the artificial end and only execute the data transmission process.
[0048] Figure 7 The following is a structural block diagram of a high-precision defect detection system driven by generative artificial intelligence. In an embodiment of the present invention, a high-precision defect detection system driven by generative artificial intelligence is provided. The system 10 includes: The feature value marking module 11 is used to obtain image data of the inspected object, pre-process the image data, and mark the feature value of each position; the feature value is used to indicate the possibility that a certain position is a defect, and the larger the feature value, the greater the possibility that the position is a defect; A feature combination module 12 is used to extract the base image and defect features from the image data according to the feature values, and combine the extracted defect features to obtain a comprehensive feature; The simulation image generation module 13 is used to combine the defect features and the comprehensive features, insert the extracted reference image, and obtain a simulation image; The defect library construction module 14 is used to input the simulated image into the AI, output the recognition result, count the simulated image and the recognition result, and construct the defect recognition library; The image recognition module 15 is used to perform pre-recognition on the image to be recognized based on the defect recognition library when receiving the image to be recognized. When the recognition fails, AI is used for recognition.
[0049] Furthermore, the feature value marking module 11 includes: An image acquisition unit, configured to acquire image data of the detected object; A layer extraction unit, configured to perform channel segmentation on the image data to obtain layers of different channels; The gradient layer generation unit is used to perform gradient operations on the layers of different channels to obtain gradient layers; A sub-region segmentation unit, configured to mark contour points according to the gradient layer and connect the contour points to obtain sub-regions; The characteristic value calculation unit is used to query all sub-areas containing each position, query the number of pixels in each sub-area, and determine the characteristic value of the position according to the number of pixels in each sub-area.
[0050] Specifically, the feature combination module 12 includes: A point clustering unit, configured to calculate the difference in eigenvalues of adjacent pixels and cluster the pixels according to the difference in eigenvalues; A base image generation unit is used to select an area with the largest number of pixels and perform image padding on the area to obtain a base image; wherein the image padding process is used to expand the area size to the standard image size of the object being detected; A defect feature generating unit, configured to take an area where the number of pixels is less than a preset threshold as a defect feature; The comprehensive feature generation unit is used to compare the contour similarity of the defect features. When the contour similarity reaches a preset similarity threshold, the defect features are superimposed to obtain a comprehensive feature; wherein the comprehensive feature contains a feature label for characterizing the defect features involved in the superposition.
[0051] Furthermore, the simulation image generation module 13 includes: A total number query unit is used to query the total number of image data corresponding to any defect feature; a selection probability determination unit, configured to determine a selection probability of a defect feature according to the total number; the greater the total number, the greater the selection probability; The comprehensive probability determination unit is used to query the selection probability of the corresponding defect feature for any comprehensive feature, and calculate the product of the selection probabilities as the selection probability of the comprehensive feature; An instruction generation unit, used to instruct to sequentially read defect characteristics and comprehensive characteristics, generate a random number in the range of zero to one, and generate a selection instruction when the random number is less than the selection probability; The feature insertion unit is used to select the corresponding feature after generating the selection instruction, insert it into the extracted reference image, and obtain a simulated image; wherein the insertion position is a random position.
[0052] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A high-precision defect detection method driven by generative artificial intelligence, characterized in that: The method comprises: Acquire image data of the object to be inspected, pre-process the image data, and mark the characteristic value of each position; the characteristic value is used to indicate the possibility that a certain position is a defect, and the larger the characteristic value, the greater the possibility that the position is a defect; Extracting a base image and defect features from the image data according to the feature values, and combining the extracted defect features to obtain a comprehensive feature; Combine the defect features and comprehensive features, insert them into the extracted reference image, and obtain a simulated image; Input the simulated image into AI, output the recognition result, count the simulated image and recognition result, and build a defect recognition library; When receiving an image to be identified, the image is pre-identified based on the defect recognition library. If the recognition fails, AI is applied for recognition.
2. The high-precision defect detection method driven by generative artificial intelligence according to claim 1, characterized in that: The steps of acquiring image data of the detected object, preprocessing the image data, and marking the feature values of each position include: Acquiring image data of the detected object; Perform channel segmentation on the image data to obtain layers of different channels; Perform gradient operations on layers of different channels to obtain gradient layers; Marking contour points according to the gradient layer, connecting the contour points to obtain each sub-area; For each position, all sub-regions containing the position are queried, the number of pixels in each sub-region is queried, and the feature value of the position is determined based on the number of pixels in each sub-region.
3. The high-precision defect detection method driven by generative artificial intelligence according to claim 1, characterized in that: The step of extracting the base image and defect features from the image data according to the feature values, and combining the extracted defect features to obtain comprehensive features comprises: Calculating eigenvalue differences between adjacent pixels, and clustering the pixels based on the eigenvalue differences; Selecting the area with the largest number of pixels and performing image padding on the area to obtain a base image; wherein the image padding process is used to expand the area size to the standard image size of the object being detected; The area where the number of pixels is less than a preset threshold is regarded as a defect feature; Compare the contour similarity of the defect features. When the contour similarity reaches a preset similarity threshold, superimpose the defect features to obtain a comprehensive feature. The comprehensive feature contains a feature label for characterizing the defect features involved in the superposition.
4. The generative artificial intelligence driven high-precision defect detection method according to claim 1, characterized in that: The step of combining the defect features and the comprehensive features and inserting the extracted reference image to obtain the simulated image includes: For any defect feature, query the total number of image data corresponding to it; Determining the probability of selecting a defect feature based on the total number; the greater the total number, the greater the probability of selection; For any comprehensive feature, query the selection probability of its corresponding defect feature, calculate the product of the selection probabilities, and use it as the selection probability of the comprehensive feature; Read the defect characteristics and comprehensive characteristics in sequence, generate a random number in the range of 0 to 1, and generate a selection instruction when the random number is less than the selection probability; After the selection instruction is generated, the corresponding feature is selected and inserted into the extracted reference image to obtain a simulated image; wherein the insertion position is a random position.
5. The high-precision defect detection method driven by generative artificial intelligence according to claim 1, characterized in that: The steps of inputting the simulated image into AI, outputting the recognition result, and statistically analyzing the simulated image and the recognition result to construct a defect recognition library include: Input the simulated image into AI and output the recognition results of each feature; Record the recognition results of each feature in real time and calculate the mode value of the recognition results; Count all features and their mode values to obtain the defect recognition library.
6. The generative artificial intelligence driven high-precision defect detection method according to claim 1, characterized in that: When receiving an image to be identified, pre-identifying the image to be identified according to the defect identification library, and applying AI for identification when the identification fails, includes the following steps: When receiving the image to be identified, read the features in the defect identification library; Traversing the image to be identified based on the features and calculating the matching degree; When the matching degree reaches the preset matching threshold, the corresponding recognition result is read; When the matching degree of all features in the defect recognition library in the image to be recognized is less than the preset matching threshold, AI is applied to recognize the image to be recognized, and the defect recognition library is updated according to the recognition results.
7. A high-precision defect detection system driven by generative artificial intelligence, characterized in that: The system comprises: The feature value marking module is used to obtain image data of the inspected object, pre-process the image data, and mark the feature value of each position; the feature value is used to indicate the possibility that a certain position is a defect, and the larger the feature value, the greater the possibility that the position is a defect; a feature combination module, configured to extract the base image and defect features from the image data according to the feature values, and combine the extracted defect features to obtain a comprehensive feature; The simulation image generation module is used to combine the defect features and the comprehensive features, insert the extracted reference image, and obtain the simulation image; The defect library construction module is used to input simulated images into AI, output recognition results, count simulated images and recognition results, and build a defect recognition library; The image recognition module is used to perform pre-recognition on the image to be recognized based on the defect recognition library when receiving the image to be recognized. When the recognition fails, AI is applied for recognition.
8. The generative artificial intelligence driven high-precision defect detection system according to claim 7, characterized in that: The feature value marking module includes: An image acquisition unit, configured to acquire image data of the detected object; A layer extraction unit, configured to perform channel segmentation on the image data to obtain layers of different channels; The gradient layer generation unit is used to perform gradient operations on the layers of different channels to obtain gradient layers; A sub-region segmentation unit, configured to mark contour points according to the gradient layer and connect the contour points to obtain sub-regions; The characteristic value calculation unit is used to query all sub-areas containing each position, query the number of pixels in each sub-area, and determine the characteristic value of the position according to the number of pixels in each sub-area.
9. The generative artificial intelligence driven high-precision defect detection system according to claim 7, characterized in that: The feature combination module includes: A point clustering unit, configured to calculate the difference in eigenvalues of adjacent pixels and cluster the pixels according to the difference in eigenvalues; A base image generation unit is used to select an area with the largest number of pixels and perform image padding on the area to obtain a base image; wherein the image padding process is used to expand the area size to the standard image size of the object being detected; A defect feature generating unit, configured to take an area where the number of pixels is less than a preset threshold as a defect feature; The comprehensive feature generation unit is used to compare the contour similarity of the defect features. When the contour similarity reaches a preset similarity threshold, the defect features are superimposed to obtain a comprehensive feature; wherein the comprehensive feature contains a feature label for characterizing the defect features involved in the superposition.
10. The generative artificial intelligence driven high-precision defect detection system according to claim 7, characterized in that: The simulated image generation module includes: A total number query unit is used to query the total number of image data corresponding to any defect feature; a selection probability determination unit, configured to determine a selection probability of a defect feature according to the total number; the greater the total number, the greater the selection probability; The comprehensive probability determination unit is used to query the selection probability of the corresponding defect feature for any comprehensive feature, and calculate the product of the selection probabilities as the selection probability of the comprehensive feature; An instruction generation unit, used to instruct to sequentially read defect characteristics and comprehensive characteristics, generate a random number in the range of zero to one, and generate a selection instruction when the random number is less than the selection probability; The feature insertion unit is used to select the corresponding feature after generating the selection instruction, insert it into the extracted reference image, and obtain a simulated image; wherein the insertion position is a random position.
Citation Information
Patent Citations
Repeated image recognition method and device, computer device and storage medium
CN109886275A
Mechanical part stress corrosion detection method and system based on image processing
CN113689428A
Cable stranded wire quality detection method based on image features
CN116912234A
Heat exchanger welding quality visual detection method and system
CN119850605A
Rephotographed image recognition method and apparatus, computer device, and computer-readable storage medium
WO2020147445A1