CN115471476A - Method, device, equipment and medium for detecting component defects - Google Patents
Method, device, equipment and medium for detecting component defects Download PDFInfo
- Publication number
- CN115471476A CN115471476A CN202211129045.XA CN202211129045A CN115471476A CN 115471476 A CN115471476 A CN 115471476A CN 202211129045 A CN202211129045 A CN 202211129045A CN 115471476 A CN115471476 A CN 115471476A
- Authority
- CN
- China
- Prior art keywords
- defect detection
- defect
- detected
- image
- determining
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000007547 defect Effects 0.000 title claims abstract description 393
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000001514 detection method Methods 0.000 claims abstract description 286
- 239000013598 vector Substances 0.000 claims description 33
- 238000004590 computer program Methods 0.000 claims description 16
- 238000003709 image segmentation Methods 0.000 claims description 3
- 238000004422 calculation algorithm Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 8
- 238000013527 convolutional neural network Methods 0.000 description 6
- 230000002950 deficient Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000011218 segmentation Effects 0.000 description 5
- 238000000605 extraction Methods 0.000 description 4
- 238000007689 inspection Methods 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
Landscapes
- Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a method, a device, equipment and a medium for detecting a part defect. The method comprises the following steps: acquiring an image of a component to be detected; performing at least one grade of defect detection on the image of the part to be detected according to a defect detection model which is constructed in advance, and determining at least one type of defect detection result of the part to be detected; the defect detection model comprises a first defect detection unit, a second defect detection unit and a third defect detection unit; the first defect detection unit is used for detecting the missing defect of the part to be detected; the second defect detection unit is used for detecting the target position defect of the part to be detected; the third defect detection unit is used for detecting surface defects of the part to be detected. The technical scheme solves the problems of low detection accuracy, poor adaptability and low detection efficiency of the defect detection model, can effectively improve the detection efficiency and enhance the robustness of the model while improving the accuracy of the part defect detection.
Description
Technical Field
The invention relates to the technical field of computer vision, in particular to a method, a device, equipment and a medium for detecting defects of a component.
Background
At present, component defect detection is widely applied to various industries, and mainly depends on deep learning algorithms such as target detection, target segmentation and the like to extract features of a component image, so as to judge whether a component has defects or position the defect position of the component according to the defect features.
However, in different scenes, components are applied differently, and the attitude, the defect shape, the defect size, and the like of the components are also different. It is difficult to train a model capable of detecting various defects by a deep learning method. Secondly, for the visual tiny defects, the characteristics are easy to lose in the characteristic extraction process, and the detection accuracy is further influenced.
Disclosure of Invention
The invention provides a method, a device, equipment and a medium for detecting a part defect, which are used for solving the problems of low detection accuracy, poor adaptability and low detection efficiency of a defect detection model, and can effectively improve the detection efficiency and enhance the robustness of the model while improving the detection accuracy of the part defect.
According to an aspect of the present invention, there is provided a component defect detection method, the method comprising:
acquiring an image of a component to be detected;
performing at least one level of defect detection on the image of the part to be detected according to a pre-constructed defect detection model, and determining at least one type of defect detection result of the part to be detected;
the defect detection model comprises a first defect detection unit, a second defect detection unit and a third defect detection unit; the first defect detection unit is used for detecting the missing defects of the part to be detected; the second defect detection unit is used for detecting the target position defect of the part to be detected; the third defect detection unit is used for detecting surface defects of the part to be detected.
According to another aspect of the present invention, there is provided a component defect detecting apparatus, including:
the component image acquisition module is used for acquiring an image of a component to be detected;
the detection result determining module is used for carrying out at least one level of defect detection on the image of the part to be detected according to a defect detection model which is constructed in advance, and determining at least one type of defect detection result of the part to be detected;
the defect detection model comprises a first defect detection unit, a second defect detection unit and a third defect detection unit; the first defect detection unit is used for detecting the missing defect of the part to be detected; the second defect detection unit is used for detecting the target position defect of the part to be detected; the third defect detection unit is used for detecting surface defects of the part to be detected.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the method of component defect detection according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the component defect detection method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, at least one grade of defect detection is carried out on the image of the part to be detected through the defect detection model with the pyramid structure which is constructed in advance, and at least one type of defect detection result of the part to be detected is determined. The defect detection method and the defect detection device solve the problems of low detection accuracy, poor adaptability and low detection efficiency of the defect detection model, can effectively improve the detection efficiency and enhance the robustness of the model while improving the accuracy of the defect detection of the part.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method for detecting a defect in a component according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for detecting defects in a component according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a component defect detection apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing the component defect detection method according to the embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. According to the technical scheme, the data acquisition, storage, use, processing and the like meet the relevant regulations of national laws and regulations.
Example one
Fig. 1 is a flowchart of a method for detecting a defect of a component according to an embodiment of the present invention, where the method is applicable to a defect detection scenario of industrial parts, devices, and the like, and the method can be executed by a component defect detection apparatus, which can be implemented in the form of hardware and/or software, and the apparatus can be configured in an electronic device. As shown in fig. 1, the method includes:
and S110, acquiring an image of the part to be detected.
The present solution may be performed by a component defect detection system, which may include one or more vision sensors, such as a camera, an infrared imager, etc., for acquiring an image of a component to be detected. The part defect detection system can be provided with a plurality of visual sensors to shoot images of the part to be detected at different angles so as to realize the omnibearing detection of the part to be detected. In some scenes, the situation that the component to be detected is deployed in the equipment or the component to be detected is not connected with other components and cannot be detached exists, the component defect detection system can acquire the combined structure image where the component to be detected is located through the visual sensor, and the image of the component to be detected is extracted through a pre-trained target detection model. After the part image to be detected is obtained, the part defect detection system can perform preprocessing operations such as image enhancement, color correction and image denoising on the part image to be detected so as to improve the image quality and further achieve a good detection effect.
S120, performing at least one level of defect detection on the image of the part to be detected according to a pre-constructed defect detection model, and determining at least one type of defect detection result of the part to be detected.
The defect detection model may include a first defect detection unit, a second defect detection unit, and a third defect detection unit. The first defect detecting unit, the second defect detecting unit, and the third defect detecting unit may be sequentially connected. The first defect detecting unit may be configured to detect a missing defect of the part to be detected; the second defect detection unit can be used for detecting the target position defect of the part to be detected; the third defect detecting unit may be configured to detect surface defects of the part to be inspected. Accordingly, the defect detection results may include a missing defect detection result, a target position defect detection result, and a surface defect detection result.
As can be readily appreciated, the absence of defects typically has a significant effect on the functionality of the part, and there is a significant difference in the appearance of the part. The missing defects of the component are easier to detect and judge than the target position defects and the surface defects, and therefore, the component defect detection system can perform the missing defect detection on the image of the component to be detected first. The first defect detection unit can be constructed based on a target segmentation model, and is used for segmenting the to-be-detected part through the to-be-detected part image, describing the outline of the to-be-detected part, easily judging the part missing by means of feature comparison and the like, and determining the missing defect detection result of the to-be-detected part. The missing defect detection result may include whether the part to be detected has a missing defect, and may also include a missing defect distribution position. If the part to be detected has the defect, the part defect detection system can sort the defect part without subsequent defect detection, and the part to be detected is used as a new part to be detected to restart the defect detection after the defect is repaired. And if the part to be detected has no missing defect, continuing to detect the target position defect. The part defect detection system can also record the parts with the missing defects without sorting the missing defective parts, continue to perform subsequent defect detection on the parts to be detected, and generate a defect detection report for each part with the defects after all the defect detections are completed.
In this solution, the target position may be a position that affects the function of the component to be detected, such as a joint, a stress point, etc. of the component. The target positions are distributed on the part with a certain rule, and accurate detection is difficult to realize through the whole image of the part to be detected. The second defect detection unit may first extract a target position image of the component to be detected, and then perform corresponding defect comparison on each target position image to determine a target position defect, thereby generating a target position defect detection result. The target position defect detection result may include whether the part to be detected has a target position defect, may also include the number of target position defects, and may also include a defect position of the target position defect. If the target position defect exists in the part to be detected, the part defect detection system can sort the defective part without performing surface defect detection, and the defect detection is restarted as a new part to be detected after the target position defect is repaired. And if the target position defect does not exist in the part to be detected, continuing to detect the surface defect. Similar to the defect detection, the part defect detection system may record the parts with the defects at the target positions without immediately sorting the defective parts at the target positions, continue to detect the surface defects of the parts to be detected, and generate a defect detection report for each of the defective parts after all the defects are detected.
After the target position defect detection, the part defect detection system can realize the surface defect detection of the part to be detected through the third defect detection unit. The surface defect may be a surface texture abnormality of the component, such as scratches, depressions, protrusions, or pits on the surface of the component. The third defect detecting unit may be a target detection algorithm based positioning of the surface defect. The third defect detection unit can also determine the distribution boundary of the surface defects based on a target segmentation algorithm, so as to realize the accurate depiction of the surface defect area. Based on the output of the third defect detection unit, the component defect detection system can determine a surface defect detection result. The surface defect detection result may include whether the part to be detected has a surface defect, a distribution position of the surface defect, a ratio of a distribution area of the surface defect in the image of the part to be detected, and the like. Similar to the defect detection, the part defect detection system may record the parts with the defects at the target positions without immediately sorting the defective parts at the target positions, continue to detect the surface defects of the parts to be detected, and generate a defect detection report for each of the defective parts after all the defects are detected.
According to the technical scheme, at least one grade of defect detection is carried out on the image of the part to be detected through a pre-constructed defect detection model with the pyramid structure, and at least one type of defect detection result of the part to be detected is determined. The method and the device solve the problems of low detection accuracy, poor adaptability and low detection efficiency of the defect detection model, can effectively improve the detection efficiency and enhance the robustness of the model while improving the accuracy of the part defect detection.
Example two
Fig. 2 is a flowchart of a method for detecting a defect of a component according to a second embodiment of the present invention, which is detailed based on the second embodiment. As shown in fig. 2, the method includes:
s210, acquiring an image of the part to be detected.
In this scheme, the first defect detection unit may include an encoder and a predetermined normal component feature set; the second defect detection unit may include a target position detector and a classifier; the third defect detecting unit may include a surface defect detector and a divider.
S220, performing feature coding on the image of the component to be detected by using the encoder, and outputting at least one feature vector.
It can be understood that the encoder may be a feature extractor constructed based on a convolutional neural network, and configured to perform feature extraction on the image of the component to be detected and output a feature vector of a preset dimension.
The component defect detection system may construct a normal component feature set based on the normal component image. The part defect inspection system may screen representative images of normal parts, such as captured images of normal parts at various preset angles. The component defect detection system can utilize the encoder to perform feature encoding on each normal component image, generate features with the same dimension as the feature vectors, and establish a normal component feature set according to each feature.
The component defect detection system can also select a large number of normal component images, after feature extraction is carried out on each normal component image, each feature obtained by feature extraction is used for clustering, and each determined clustering center is used as a feature in a normal component feature set.
And S230, calculating the distance between each feature in the normal component feature set and the feature vector, and determining the target feature matched with the feature vector according to each distance.
The part defect detection system can take each feature in the normal part feature set as a reference, and calculate the distance between each feature and a feature vector extracted from the image of the part to be detected. Wherein the distance may be a euclidean distance, a cosine distance, or the like. The distance may be used to represent the similarity between the feature vector and each feature, and a larger distance indicates a smaller similarity, and a smaller distance indicates a larger similarity. The part defect detection system may sort the calculated distances and determine the feature corresponding to the minimum distance as the target feature.
And S240, determining a missing defect detection result according to the target feature and the feature vector.
The part defect detection system can determine whether the part to be detected represented by the feature vector has the missing defect or not according to the distance between the normal part feature set and the target feature with the maximum similarity of the feature vector.
Specifically, the missing defect detection result includes a missing determination result;
the determining a missing defect detection result according to the target feature and the feature vector comprises:
and if the distance between the target feature and the feature vector is larger than a preset distance threshold, determining that the part to be detected has a missing defect.
If the distance is larger than the preset distance threshold, the fact that the image of the part to be detected represented by the characteristic vector is greatly different from the image of the normal part represented by the target characteristic is shown, namely the part to be detected does not belong to the normal part, and the fact that the part to be detected has the defect of missing is judged.
According to the scheme, the distance between the feature vector and the features of the normal part is calculated, so that the missing defect of the part to be detected can be rapidly and accurately determined.
In one possible implementation, the first defect detecting unit further includes a decoder; the missing defect detection result further comprises a defect candidate region;
determining a missing defect detection result according to the target feature and the feature vector, including:
inputting the target feature and the feature vector into the decoder, and determining a target pixel of the image of the component to be detected;
and determining a defect candidate area according to the target pixel.
In contrast to the encoder, the decoder may encode the features of the input back into the component image. The decoder can also be constructed based on a convolutional neural network, and an encoder and a decoder to be constructed based on the convolutional neural network can have a symmetrical network structure. The component defect detection system can input the target features and the feature vectors into a decoder respectively and correspondingly output a normal component image and a component image to be detected. According to the difference elements of the target feature and the feature vector, the part defect detection system can determine the difference pixels of the normal part image and the part image to be detected, and the difference pixels are used as target pixels. The component defect detection system may use the connected regions formed by the target pixels as defect candidate regions for detailed detection. In order to facilitate subsequent image comparison, the part defect detection system may normalize a connected region formed by the target pixels, for example, circumscribe a regular pattern based on the connected region, and use a region defined by the regular pattern in the image of the part to be detected as a defect candidate region.
According to the scheme, the defect candidate area can be marked while the image of the part to be detected is subjected to the missing defect detection, so that the reliability of image detection is ensured, and the omission of defect detection is avoided.
And S250, if the part to be detected is determined to have no missing defect, detecting the target position of the image of the part to be detected by using a target position detector according to at least one preset target position, and determining a target position image.
If the component to be detected is determined to have no missing defect according to the missing defect detection result, the component defect detection system can continue to detect the target position defect of the image of the component to be detected. The partial defect detection system can utilize a pre-trained target position detector to position a target position in an image of the component to be detected and generate a target position detection result. The target position detection result may include detection frame information, and the detection frame information may include a detection frame position and a detection frame range. Based on the inspection box position and the inspection box range, the part defect inspection system can extract the target position image. The target position detector may be a model constructed based on a one-stage target detection algorithm such as YOLO and SSD, or a model constructed based on a two-stage target detection algorithm such as Faster R-CNN.
And S260, classifying the target position images by using the classifier, and outputting a first detection result of the target position defect.
After obtaining the target position images, the component defect detection system may use a pre-trained classifier to perform two classifications on each target position image, i.e., determine whether each target position image detects a target position defect. The part defect detection system may take the two classification results output by the classifier as a target position defect first detection result.
In a preferred aspect, after determining the target position image, the method further comprises:
and determining a second detection result of the target position defect according to the defect candidate area and the target position image.
After obtaining the target location image, the component defect detection system may determine whether there is an overlapping region between the defect candidate region and the target location image based on the location and range of the defect candidate region and the location and range of the detection frame associated with the target location image. If the defect candidate area and the target position image have an overlapping area, the part defect detection system can calculate the intersection ratio of the defect candidate area and the target position image, and further determine a second detection result of the target position defect according to the intersection ratio. Specifically, the intersection-to-parallel ratio calculation formula can be as follows:
where W denotes an intersection ratio, a denotes a defect candidate region, and B denotes a detection frame coverage region associated with the target position image.
And if the intersection ratio is larger than a preset ratio threshold value, determining that the target position defect exists in the indicated area of the target position image of the part to be detected. And if the intersection ratio is smaller than or equal to the preset ratio threshold, determining that the target position defect does not exist in the area indicated by the target position image of the part to be detected.
The part defect detection system can integrate the first detection result of the target position defect and the second detection result of the target position defect, and combine the detection results of the same target position defect to generate a target position defect detection result. For example, a union of a first detection result and a second detection result of the defect at the same target position is taken, and if the first detection result at the position a is a defect and the second detection result is a defect, the detection result at the position a is determined to be a defect.
S270, if the target position defect does not exist in the part to be detected according to the first detection result of the target position defect and the second detection result of the target position defect, performing surface defect detection on the image of the part to be detected by using the surface defect detector, and determining a surface defect image.
If the part to be detected has no target position defect, the part defect detection system can detect the surface defect of the image of the part to be detected. In particular, the component defect detection system may utilize a pre-trained surface defect detector to determine a surface defect image. Similar to the target position detector, the surface defect detector may be a model constructed based on a one-stage target detection algorithm such as YOLO and SSD, or a model constructed based on a two-stage target detection algorithm such as fast R-CNN. Since the training data of the target position detector and the training data of the surface defect detector are different, the learning contents of the two detectors are different, and the objects that can be detected are also different.
S280, performing image segmentation on the surface defect image by using the segmenter, and determining a surface defect detection result.
To achieve refined surface defect detection, after obtaining the surface defect image, the component defect detection system may input the surface defect image to a segmenter, and determine a surface defect detection result according to an output of the segmenter. Wherein the segmenter may be a convolutional neural network based target segmentation model, such as FCN, U-Net, etc. Compared with target detection, the target segmentation can delicately depict the outline of the target to obtain more accurate surface defect distribution, and further is beneficial to quick repair of the surface defects.
The part defect detection system can convert the area output by the divider into pixels, and determine the surface defect detection result according to the comparison result of the number of pixels and a preset number threshold. Specifically, if the number of pixels is greater than or equal to the number threshold, it is determined that the part to be inspected has a surface defect in the surface defect image region. And if the number of pixels is less than the number threshold, determining that the part to be detected does not have a surface defect in the surface defect image area.
According to the technical scheme, at least one grade of defect detection is carried out on the image of the part to be detected through a pre-constructed defect detection model with the pyramid structure, and at least one type of defect detection result of the part to be detected is determined. The defect detection method and the defect detection device solve the problems of low detection accuracy, poor adaptability and low detection efficiency of the defect detection model, can effectively improve the detection efficiency and enhance the robustness of the model while improving the accuracy of the defect detection of the part.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a device for detecting a defect of a component according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes:
a component image obtaining module 310, configured to obtain an image of a component to be detected;
the detection result determining module 320 is configured to perform at least one level of defect detection on the image of the component to be detected according to a defect detection model that is constructed in advance, and determine at least one type of defect detection result of the component to be detected;
the defect detection model comprises a first defect detection unit, a second defect detection unit and a third defect detection unit; the first defect detection unit is used for detecting the missing defect of the part to be detected; the second defect detection unit is used for detecting the target position defect of the part to be detected; the third defect detection unit is used for detecting surface defects of the part to be detected.
In this scheme, optionally, the first defect detection unit includes an encoder and a predetermined normal component feature set;
the detection result determining module 320 includes:
the characteristic vector output unit is used for carrying out characteristic coding on the image of the part to be detected by utilizing the encoder and outputting at least one characteristic vector;
the target feature determining unit is used for calculating the distance between each feature in the normal component feature set and the feature vector and determining a target feature matched with the feature vector according to each distance;
and the missing defect detection result determining unit is used for determining the missing defect detection result according to the target feature and the feature vector.
On the basis of the above scheme, optionally, the missing defect detection result includes a missing determination result;
the missing defect detection result determining unit is specifically configured to:
and if the distance between the target feature and the feature vector is larger than a preset distance threshold, determining that the part to be detected has a missing defect.
In one possible approach, the second defect detection unit includes a target position detector and a classifier;
the detection result determining module 320 includes:
the target position image determining unit is used for detecting the target position of the image of the part to be detected by using a target position detector according to at least one preset target position and determining a target position image if the part to be detected is determined to have no missing defect;
and the target position defect first detection result output unit is used for classifying each target position image by using the classifier and outputting a target position defect first detection result.
On the basis of the above solution, optionally, the first defect detecting unit further includes a decoder; the missing defect detection result further comprises a defect candidate region;
the missing defect detection result determining unit is further configured to:
inputting the target feature and the feature vector into the decoder, and determining a target pixel of the image of the component to be detected;
and determining a defect candidate area according to the target pixel.
In this embodiment, optionally, the detection result determining module 320 further includes:
and the target position defect second detection result determining unit is used for determining a target position defect second detection result according to the defect candidate area and the target position image.
In a preferred aspect, the third defect detecting unit includes a surface defect detector and a divider; the detection result determining module 320 includes:
the surface defect image determining unit is used for detecting the surface defects of the image of the part to be detected by using the surface defect detector and determining a surface defect image if the part to be detected is determined to have no target position defects according to the first detection result of the target position defects and the second detection result of the target position defects;
and the surface defect detection result determining unit is used for carrying out image segmentation on the surface defect image by using the segmenter and determining a surface defect detection result.
The component defect detection device provided by the embodiment of the invention can execute the component defect detection method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
FIG. 4 shows a schematic block diagram of an electronic device 410 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 410 includes at least one processor 411, and a memory communicatively connected to the at least one processor 411, such as a Read Only Memory (ROM) 412, a Random Access Memory (RAM) 413, and the like, wherein the memory stores computer programs executable by the at least one processor, and the processor 411 may perform various appropriate actions and processes according to the computer programs stored in the Read Only Memory (ROM) 412 or the computer programs loaded from the storage unit 418 into the Random Access Memory (RAM) 413. In the RAM 413, various programs and data necessary for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other through a bus 414. An input/output (I/O) interface 415 is also connected to bus 414.
Various components in the electronic device 410 are connected to the I/O interface 415, including: an input unit 416 such as a keyboard, a mouse, or the like; an output unit 417 such as various types of displays, speakers, and the like; a storage unit 418, such as a magnetic disk, optical disk, or the like; and a communication unit 419 such as a network card, modem, wireless communication transceiver, or the like. The communication unit 419 allows the electronic device 410 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
In some embodiments, the component defect detection method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and/or installed onto electronic device 410 via ROM 412 and/or communications unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the component defect detection method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to perform the component defect detection method in any other suitable manner (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for component defect detection, the method comprising:
acquiring an image of a component to be detected;
performing at least one level of defect detection on the image of the part to be detected according to a pre-constructed defect detection model, and determining at least one type of defect detection result of the part to be detected;
the defect detection model comprises a first defect detection unit, a second defect detection unit and a third defect detection unit; the first defect detection unit is used for detecting the missing defect of the part to be detected; the second defect detection unit is used for detecting the target position defect of the part to be detected; the third defect detection unit is used for detecting surface defects of the part to be detected.
2. The method of claim 1, wherein the first defect detection unit comprises an encoder and a predetermined set of normal component features;
the method for detecting the defects of the parts to be detected comprises the following steps of performing at least one level of defect detection on the images of the parts to be detected according to a defect detection model which is constructed in advance, and determining at least one type of defect detection results of the parts to be detected, wherein the method comprises the following steps:
performing feature coding on the image of the part to be detected by using the encoder, and outputting at least one feature vector;
calculating the distance between each feature in the normal component feature set and the feature vector, and determining a target feature matched with the feature vector according to each distance;
and determining a missing defect detection result according to the target feature and the feature vector.
3. The method of claim 2, wherein the missing defect detection result comprises a missing decision result;
determining a missing defect detection result according to the target feature and the feature vector, including:
and if the distance between the target feature and the feature vector is larger than a preset distance threshold, determining that the part to be detected has a missing defect.
4. The method of claim 3, wherein the second defect detection unit comprises a target position detector and a classifier;
the method for detecting the defects of the parts to be detected comprises the following steps of performing at least one level of defect detection on the images of the parts to be detected according to a defect detection model which is constructed in advance, and determining at least one type of defect detection results of the parts to be detected, wherein the method comprises the following steps:
if the component to be detected is determined to have no missing defect, performing target position detection on the image of the component to be detected by using a target position detector according to at least one preset target position, and determining a target position image;
and classifying the images of all target positions by using the classifier, and outputting a first detection result of the defects of the target positions.
5. The method of claim 3, wherein the first defect detection unit further comprises a decoder; the missing defect detection result further comprises a defect candidate region;
the determining a missing defect detection result according to the target feature and the feature vector comprises:
inputting the target feature and the feature vector into the decoder, and determining a target pixel of the image of the component to be detected;
and determining a defect candidate area according to the target pixel.
6. The method of claim 5, wherein after determining the target location image, the method further comprises:
and determining a second detection result of the target position defect according to the defect candidate area and the target position image.
7. The method of claim 6, wherein the third defect detection unit comprises a surface defect detector and a segmenter;
the method for detecting the defects of the parts to be detected comprises the following steps of performing at least one level of defect detection on the images of the parts to be detected according to a defect detection model which is constructed in advance, and determining at least one type of defect detection results of the parts to be detected, wherein the method comprises the following steps:
if the target position defect does not exist in the part to be detected according to the first detection result of the target position defect and the second detection result of the target position defect, performing surface defect detection on the image of the part to be detected by using the surface defect detector to determine a surface defect image;
and carrying out image segmentation on the surface defect image by using the segmenter, and determining a surface defect detection result.
8. A component defect detection apparatus, the apparatus comprising:
the component image acquisition module is used for acquiring an image of a component to be detected;
the detection result determining module is used for carrying out at least one level of defect detection on the image of the part to be detected according to a defect detection model which is constructed in advance, and determining at least one type of defect detection result of the part to be detected;
the defect detection model comprises a first defect detection unit, a second defect detection unit and a third defect detection unit; the first defect detection unit is used for detecting the missing defect of the part to be detected; the second defect detection unit is used for detecting the target position defect of the part to be detected; the third defect detection unit is used for detecting surface defects of the part to be detected.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the component defect detection method of any one of claims 1-7.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the method of component defect detection of any one of claims 1-7 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211129045.XA CN115471476A (en) | 2022-09-16 | 2022-09-16 | Method, device, equipment and medium for detecting component defects |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211129045.XA CN115471476A (en) | 2022-09-16 | 2022-09-16 | Method, device, equipment and medium for detecting component defects |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115471476A true CN115471476A (en) | 2022-12-13 |
Family
ID=84333334
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211129045.XA Pending CN115471476A (en) | 2022-09-16 | 2022-09-16 | Method, device, equipment and medium for detecting component defects |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115471476A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116051558A (en) * | 2023-03-31 | 2023-05-02 | 菲特(天津)检测技术有限公司 | Defect image labeling method, device, equipment and medium |
CN116703925A (en) * | 2023-08-08 | 2023-09-05 | 菲特(天津)检测技术有限公司 | Bearing defect detection method and device, electronic equipment and storage medium |
-
2022
- 2022-09-16 CN CN202211129045.XA patent/CN115471476A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116051558A (en) * | 2023-03-31 | 2023-05-02 | 菲特(天津)检测技术有限公司 | Defect image labeling method, device, equipment and medium |
CN116051558B (en) * | 2023-03-31 | 2023-06-16 | 菲特(天津)检测技术有限公司 | Defect image labeling method, device, equipment and medium |
CN116703925A (en) * | 2023-08-08 | 2023-09-05 | 菲特(天津)检测技术有限公司 | Bearing defect detection method and device, electronic equipment and storage medium |
CN116703925B (en) * | 2023-08-08 | 2023-10-31 | 菲特(天津)检测技术有限公司 | Bearing defect detection method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111833306B (en) | Defect detection method and model training method for defect detection | |
CN112581463B (en) | Image defect detection method and device, electronic equipment, storage medium and product | |
CN111833303B (en) | Product detection method and device, electronic equipment and storage medium | |
CN110148130B (en) | Method and device for detecting part defects | |
CN112597837B (en) | Image detection method, apparatus, device, storage medium, and computer program product | |
WO2024002187A1 (en) | Defect detection method, defect detection device, and storage medium | |
TWI765442B (en) | Method for defect level determination and computer readable storage medium thereof | |
CN114419035B (en) | Product identification method, model training device and electronic equipment | |
CN116952958B (en) | Defect detection method, device, electronic equipment and storage medium | |
CN113378969B (en) | Fusion method, device, equipment and medium of target detection results | |
CN115471476A (en) | Method, device, equipment and medium for detecting component defects | |
CN115294332B (en) | Image processing method, device, equipment and storage medium | |
CN115830004A (en) | Surface defect detection method, device, computer equipment and storage medium | |
CN115908988B (en) | Defect detection model generation method, device, equipment and storage medium | |
CN116559177A (en) | Defect detection method, device, equipment and storage medium | |
CN114677348A (en) | IC chip defect detection method and system based on vision and storage medium | |
CN116703925B (en) | Bearing defect detection method and device, electronic equipment and storage medium | |
CN116046790B (en) | Defect detection method, device, system, electronic equipment and storage medium | |
CN117557777A (en) | Sample image determining method and device, electronic equipment and storage medium | |
CN117274361A (en) | Material surface area measurement method and device, electronic equipment and medium | |
CN115700758A (en) | Sperm activity detection method, device, equipment and storage medium | |
CN117689660B (en) | Vacuum cup temperature quality inspection method based on machine vision | |
CN116823924B (en) | Determination method and device for defect area, electronic equipment and storage medium | |
CN116503407B (en) | Method and device for detecting foreign object region in image and electronic equipment | |
CN115436899B (en) | Millimeter wave radar detection data processing method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |