A method, apparatus, equipment and medium for detecting component defects

By using a pyramid-shaped defect detection model, combined with preprocessing and multi-level detection units, the accuracy and adaptability issues of component defect detection models were resolved, achieving efficient and accurate defect detection.

CN115471476BActive Publication Date: 2026-01-30YANTAI TRIAL RETAIL ENG CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211129045.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2026-01-30
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing component defect detection models have low accuracy, poor adaptability, and low detection efficiency. They are difficult to adapt to differences in component posture, defect shape, and size under different scenarios. In particular, feature extraction is easily lost in the detection of subtle visual defects, which affects the detection accuracy.

Method used

The defect detection model adopts a pyramid-shaped structure, including a first defect detection unit, a second defect detection unit, and a third defect detection unit, which are used to detect missing defects, target location defects, and surface defects, respectively. Through preprocessing, feature encoding, target detection, and image segmentation, multi-level defect detection is achieved.

Benefits of technology

It improves the accuracy and efficiency of component defect detection, enhances the robustness of the model, and can better adapt to defect detection needs in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115471476B_ABST
    Figure CN115471476B_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and medium for component defect detection. The method includes: acquiring an image of a component to be detected; performing defect detection at least at one level on the image of the component to be detected according to a pre-constructed defect detection model, and determining at least one type of defect detection result for the component to be detected; wherein the defect detection model includes a first defect detection unit, a second defect detection unit, and a third defect detection unit; the first defect detection unit is used to detect missing defects in the component to be detected; the second defect detection unit is used to detect defects at target locations in the component to be detected; and the third defect detection unit is used to detect surface defects in the component to be detected. This technical solution solves the problems of low detection accuracy, poor adaptability, and low detection efficiency of defect detection models, and can effectively improve detection efficiency and enhance model robustness while improving the accuracy of component defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision, and in particular to a component defect detection method, device, equipment and medium. BACKGROUND

[0002] At present, component defect detection is widely used in various industries, mainly relying on deep learning algorithms such as target detection and target segmentation to extract features of component images, and then judging whether the component has defects or locating the defect position of the component according to the defect features.

[0003] However, in different scenarios, different components are applied, and the posture, defect shape and defect size of the components also differ. It is difficult to train a model that can detect all types of defects through deep learning methods. Secondly, for subtle visual defects, feature loss may occur in the feature extraction process, thereby affecting the accuracy of detection. SUMMARY

[0004] The present application provides a component defect detection method, device, equipment and medium to solve the problems of low detection accuracy, poor adaptability and low detection efficiency of the defect detection model, which can improve the detection accuracy of component defects, effectively improve the detection efficiency, and enhance the robustness of the model.

[0005] According to an aspect of the present application, a component defect detection method is provided, which comprises:

[0006] obtaining a component image to be detected;

[0007] performing at least one level of defect detection on the component image to be detected according to a pre-constructed defect detection model to determine a defect detection result of at least one type of the component to be detected;

[0008] 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 to detect missing defects of the component to be detected; the second defect detection unit is used to detect target position defects of the component to be detected; and the third defect detection unit is used to detect surface defects of the component to be detected.

[0009] According to another aspect of the present application, a component defect detection device is provided, which comprises:

[0010] a component image acquisition module for acquiring a component image to be detected;

[0011] a detection result determination module for performing at least one level of defect detection on the component image to be detected according to a pre-constructed defect detection model to determine a defect detection result of at least one type of the component to be detected;

[0012] 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 a missing defect of the component to be detected; the second defect detection unit is used for detecting a target position defect of the component to be detected; and the third defect detection unit is used for detecting a surface defect of the component to be detected.

[0013] According to another aspect of the present application, an electronic device is provided, which comprises:

[0014] at least one processor; and

[0015] a memory connected to the at least one processor in communication; wherein

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the component defect detection method according to any one of the embodiments of the present application.

[0017] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to perform the component defect detection method according to any one of the embodiments of the present application when executed.

[0018] The technical scheme of the embodiments of the present application determines at least one type of defect detection result of the component to be detected by performing at least one level of defect detection on the image of the component to be detected by using the defect detection model of the pyramid structure constructed in advance. The present scheme solves the problems of low detection accuracy, poor adaptability and low detection efficiency of the defect detection model, and can improve the detection efficiency while improving the component defect detection accuracy and enhancing the robustness of the model.

[0019] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0021] Figure 1 is a flowchart of a component defect detection method according to the first embodiment of the present application;

[0022] Figure 2 is a flow chart of a component defect detection method according to Embodiment Two of the present application;

[0023] Figure 3 is a structural schematic diagram of a component defect detection device according to Embodiment Three of the present application;

[0024] Figure 4 is a structural schematic diagram of an electronic device implementing a component defect detection method according to the present application. DETAILED DESCRIPTION

[0025] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, device, product, or apparatus that includes a series of steps or units does not necessarily have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to the process, method, product, or apparatus. The acquisition, storage, use, processing, etc. of data in the technical solutions of the present application all comply with the relevant provisions of national laws and regulations.

[0027] Embodiment One

[0028] Figure 1 A flow chart of a component defect detection method according to Embodiment One of the present application is provided, and the present embodiment can be applicable to defect detection scenarios of industrial parts, devices, etc. The method can be executed by a component defect detection device, which can be implemented in the form of hardware and / or software, and the device can be configured in an electronic device. As shown in the figure, the method comprises: Figure 1

[0029] S110, acquiring a component image to be detected.

[0030] ​The scheme can be executed by a component defect detection system, which can include one or more visual sensors, such as a camera, an infrared imager, etc., for acquiring images of a component to be detected. The component defect detection system can configure multiple visual sensors to capture images of the component to be detected from different angles to achieve omnidirectional detection of the component to be detected. In some scenarios, the component to be detected has been deployed in a device, or the component to be detected is connected to other components and cannot be detached, etc. The component defect detection system can acquire an image of a combined structure in which the component to be detected is located through the visual sensor, and extract the image of the component to be detected through a pre-trained target detection model. After obtaining the image of the component to be detected, the component defect detection system can perform image enhancement, color correction, image denoising, and other preprocessing operations on the image of the component to be detected to improve the image quality and thus achieve good detection results.

[0031] S120, performing at least one level of defect detection on the image of the component to be detected according to a pre-constructed defect detection model to determine at least one type of defect detection result of the component to be detected.

[0032] The defect detection model can include a first defect detection unit, a second defect detection unit, and a third defect detection unit. The first defect detection unit, the second defect detection unit, and the third defect detection unit can be sequentially connected. The first defect detection unit can be used to detect a missing defect of the component to be detected; the second defect detection unit can be used to detect a target position defect of the component to be detected; and the third defect detection unit can be used to detect a surface defect of the component to be detected. Correspondingly, the defect detection result can include a missing defect detection result, a target position defect detection result, and a surface defect detection result.

[0033] It is easy to understand that missing defects usually have significant impact on the functionality of the component and there is obvious difference in the appearance of the component. Compared with the target position defects and the surface defects, the missing defects of the component are easier to detect and judge, and therefore, the component defect detection system can first perform missing defect detection on the image of the component to be detected. The first defect detection unit can be constructed based on a target segmentation model, and by performing component to be detected segmentation on the image of the component to be detected, the contour of the component to be detected is drawn, and the missing of the component is easily judged by using feature comparison and the like, and the missing defect detection result of the component to be detected is determined. The missing defect detection result can include whether the component to be detected has missing defects, and can also include the distribution position of the missing defects. If the component to be detected has missing defects, the component defect detection system can sort the defective components, and there is no need to perform subsequent defect detection. After the missing defects are repaired, the component is used as a new component to be detected to start defect detection again. If the component to be detected does not have missing defects, target position defect detection is continued. The component defect detection system can also not sort the components with missing defects, but record the components with missing defects, continue to perform subsequent defect detection on the component to be detected, and after all defect detection is completed, generate a defect detection report for each component with defects.

[0034] In the present scheme, the target position can be a position affecting the functionality of the component to be detected, such as a connection of the component, a stress point, etc. The target positions are distributed on the component with certain rules, and it is difficult to achieve accurate detection by using the whole image of the component to be detected. The second defect detection unit can first extract the target position image of the image of the component to be detected, and then perform corresponding defect comparison on each target position image to determine the target position defects and generate the target position defect detection result. The target position defect detection result can include whether the component to be detected has target position defects, the number of target position defects, and the defect position of the target position defects. If the component to be detected has target position defects, the component defect detection system can sort the defective components, and there is no need to perform surface defect detection. After the target position defects are repaired, the component is used as a new component to be detected to start defect detection again. If the component to be detected does not have target position defects, surface defect detection is continued. Similar to the missing defect detection, the component defect detection system can also not immediately sort the components with target position defects, but record the components with target position defects, continue to perform surface defect detection on the component to be detected, and after all defect detection is completed, generate a defect detection report for each component with defects.

[0035] After the target position defect detection, the component defect detection system can realize surface defect detection of the to-be-detected component through a third defect detection unit. The surface defect can be a surface texture abnormality of the component, such as scratches, depressions, protrusions, or pits on the surface of the component. The third defect detection unit can be based on a target detection algorithm to locate the surface defect. The third defect detection unit can also determine the surface defect distribution boundary based on a target segmentation algorithm, and then accurately depict the surface defect area. According to the output result of the third defect detection unit, the component defect detection system can determine the surface defect detection result. The surface defect detection result can include whether the to-be-detected component has a surface defect, the surface defect distribution position, and the proportion of the surface defect distribution area in the to-be-detected component image. Similar to the missing defect detection, the component defect detection system can not immediately sort the target position defect component, but record the component with the target position defect, continue to detect the surface defect of the to-be-detected component, and generate a defect detection report for each component with a defect after all defect detection is completed.

[0036] The technical solution constructs a pyramid structure defect detection model in advance, detects at least one level of the to-be-detected component image, and determines at least one type of defect detection result of the to-be-detected component. The solution solves the problems of low detection accuracy, poor adaptability, and low detection efficiency of the defect detection model, can improve the detection efficiency while improving the component defect detection accuracy, and enhances the robustness of the model.

[0037] Embodiment Two

[0038] Figure 2 A flowchart of a component defect detection method is provided for the second embodiment of the application, which is based on the above-mentioned embodiments. As shown in the figure, the method comprises: Figure 2

[0039] S210, obtaining a to-be-detected component image.

[0040] In the solution, the first defect detection unit can include an encoder and a pre-determined normal component feature set; the second defect detection unit can include a target position detector and a classifier; and the third defect detection unit can include a surface defect detector and a segmenter.

[0041] S220, using the encoder to perform feature encoding on the to-be-detected component image, and outputting at least one feature vector.

[0042] It can be understood that the encoder can be a feature extractor constructed based on a convolutional neural network, used for feature extraction of the to-be-detected component image, and outputting a feature vector of a preset dimension.

[0043] ​The component defect detection system can construct a normal component feature set based on normal component images. The component defect detection system can screen representative normal component images, such as images of normal components at various preset angles. The component defect detection system can encode features of each normal component image using an encoder to generate features of the same dimension as the feature vector, and group features according to each feature to form the normal component feature set.

[0044] The component defect detection system can also select a large number of normal component images, and after feature extraction of each normal component image, perform clustering using each feature extracted by the feature extraction, and determine each cluster center as a feature in the normal component feature set.

[0045] S230, calculate the distance between each feature in the normal component feature set and the feature vector, and determine the target feature matching the feature vector according to the distance.

[0046] The component defect detection system can take each feature in the normal component feature set as a reference to calculate the distance between each feature and the feature vector extracted from the component image to be detected. The distance can be Euclidean distance, cosine distance, etc. The distance can be used to represent the similarity between the feature vector and each feature. The greater the distance, the smaller the similarity, and the smaller the distance, the greater the similarity. The component defect detection system can sort each distance calculated to determine the feature corresponding to the smallest distance as the target feature.

[0047] S240, determine the missing defect detection result according to the target feature and the feature vector.

[0048] The component defect detection system can determine whether the component to be detected represented by the feature vector has a missing defect according to the distance of the target feature in the normal component feature set that is most similar to the feature vector.

[0049] Specifically, the missing defect detection result includes a missing determination result.

[0050] The determination of the missing defect detection result according to the target feature and the feature vector includes:

[0051] If the distance between the target feature and the feature vector is greater than a preset distance threshold, it is determined that the component to be detected has a missing defect.

[0052] If the distance is greater than the preset distance threshold, it means that the component image to be detected represented by the feature vector and the normal component image represented by the target feature have a large difference, i.e. the component to be detected is not a normal component, and it is determined that the component to be detected has a missing defect.

[0053] The scheme can quickly and accurately determine the missing defect of the to-be-detected component by calculating the distance between the feature vector and the normal component feature.

[0054] In one possible scheme, the first defect detection unit further comprises a decoder; and the missing defect detection result further comprises a defect candidate region.

[0055] The missing defect detection result is determined according to the target feature and the feature vector, comprising:

[0056] The target feature and the feature vector are input into the decoder to determine the target pixel of the to-be-detected component image.

[0057] The defect candidate region is determined according to the target pixel.

[0058] The decoder can restore the input feature code to the component image, which is opposite to the encoder. The decoder can also be constructed based on the convolutional neural network. The encoder and the decoder based on the convolutional neural network can have a symmetrical network structure. The component defect detection system can input the target feature and the feature vector into the decoder, and output the normal component image and the to-be-detected component image. According to the difference elements of the target feature and the feature vector, the component defect detection system can determine the difference pixels of the normal component image and the to-be-detected component image, and take the difference pixels as the target pixels. The component defect detection system can take the connected region composed of the target pixels as the defect candidate region for refined detection. In order to facilitate subsequent image comparison, the component defect detection system can standardize the connected region composed of the target pixels, for example, based on the circumscribed regular figure of the connected region, and take the region marked in the to-be-detected component image as the defect candidate region.

[0059] The scheme can mark the defect candidate region while detecting the missing defect of the to-be-detected component image, which is beneficial to ensure the reliability of image detection and avoid missing of defect detection.

[0060] S250, if it is determined that the to-be-detected component does not have a missing defect, target position detection is performed on the to-be-detected component image according to at least one target position set in advance by using a target position detector to determine a target position image.

[0061] If it is determined according to the missing defect detection result that the to-be-detected component does not have a missing defect, the component defect detection system can continue to perform target position defect detection on the to-be-detected component image. The component defect detection system can locate the target position in the to-be-detected component image by using a pre-trained target position detector to generate a target position detection result. The target position detection result can include bounding box information, and the bounding box information can include a bounding box position and a bounding box range. According to the bounding box position and the bounding box range, the component defect detection system can extract a target position image. The target position detector can be a model constructed based on a one-stage target detection algorithm such as YOLO or SSD, or a model constructed based on a two-stage target detection algorithm such as Faster R-CNN.

[0062] S260, classifying each target position image by using the classifier to output a target position defect first detection result.

[0063] After obtaining the target position image, the component defect detection system can perform binary classification on each target position image by using a pre-trained classifier, that is, determine whether the target position image detects a target position defect. The component defect detection system can take the binary classification result output by the classifier as the target position defect first detection result.

[0064] In a preferred scheme, after determining the target position image, the method further includes:

[0065] According to the defect candidate region and the target position image, determine a target position defect second detection result.

[0066] After obtaining the target position image, the component defect detection system can determine whether there is an overlapping area between the defect candidate region and the target position image according to the position and range of the defect candidate region and the bounding box position and bounding box range associated with the target position image. If there is an overlapping area between the defect candidate region and the target position image, the component defect detection system can calculate the intersection-over-union of the defect candidate region and the target position image, and then determine the target position defect second detection result according to the intersection-over-union. Specifically, the intersection-over-union calculation formula can be as follows:

[0067]

[0068] Wherein, W represents the intersection-over-union, A represents the defect candidate region, and B represents the bounding box coverage area associated with the target position image.

[0069] If the intersection-over-union is greater than a preset proportion threshold, it is determined that the target position image of the to-be-detected component indicates an area with a target position defect. If the intersection-over-union is less than or equal to the preset proportion threshold, it is determined that the target position image of the to-be-detected component indicates an area without a target position defect.

[0070] The component defect detection system can integrate the target position defect first detection result and the target position defect second detection result, combine the detection results of the same target position defect, and generate a target position defect detection result. For example, the union of the first detection result and the second detection result of the same target position defect is taken. Assuming that the first detection result of position A is that there is a defect, and the second detection result is that there is no defect, it is determined that the detection result of position A is that there is a defect.

[0071] S270, if it is determined according to the target position defect first detection result and the target position defect second detection result that the component to be detected does not have a target position defect, performing surface defect detection on the component to be detected image by using the surface defect detector to determine a surface defect image.

[0072] If the component to be detected does not have a target position defect, the component defect detection system can perform surface defect detection on the component to be detected image. Specifically, the component defect detection system can use a pre-trained surface defect detector to determine a surface defect image. Similar to the target position detector, the surface defect detector can be a model constructed based on a one-stage target detection algorithm such as YOLO or SSD, or a model constructed based on a two-stage target detection algorithm such as Faster R-CNN. It should be noted that the training data of the target position detector and the surface defect detector are different, so the learning content of the two detectors is different, and the objects that can be detected are also different.

[0073] S280, performing image segmentation on the surface defect image by using the segmenter to determine a surface defect detection result.

[0074] In order to realize fine surface defect detection, after obtaining the surface defect image, the component defect detection system can input the surface defect image to the segmenter, and determine the surface defect detection result according to the output of the segmenter. The segmenter can be a target segmentation model based on a convolutional neural network, such as FCN, U-Net, etc. It can be understood that compared with target detection, target segmentation can more accurately depict the outline of the target, obtain more accurate surface defect distribution, and thus facilitate the rapid repair of surface defects.

[0075] The component defect detection system can convert the area output by the segmenter into pixels, and determine the surface defect detection result according to the comparison result of the number of pixels and the preset number threshold. Specifically, if the number of pixels is greater than or equal to the number threshold, it is determined that the component to be detected has a surface defect in the surface defect image area. If the number of pixels is less than the number threshold, it is determined that the component to be detected does not have a surface defect in the surface defect image area.

[0076] The technical scheme is characterized in that a defect detection model of a pyramid structure is constructed in advance, at least one level of defect detection is performed on a component image to be detected, and at least one type of defect detection result of the component to be detected is determined.

[0077] Embodiment three

[0078] Figure 3 A structural schematic diagram of a component defect detection device provided for the third embodiment of the present application is shown in FIG. 3. Figure 3 As shown in the figure, the device comprises:

[0079] A component image acquisition module 310 is configured to acquire a component image to be detected.

[0080] A detection result determination module 320 is configured to perform at least one level of defect detection on the component image to be detected according to a defect detection model constructed in advance, and determine at least one type of defect detection result of the component to be detected.

[0081] 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 configured to detect a missing defect of the component to be detected. The second defect detection unit is configured to detect a target position defect of the component to be detected. The third defect detection unit is configured to detect a surface defect of the component to be detected.

[0082] In the present scheme, optionally, the first defect detection unit comprises an encoder and a pre-determined normal component feature set.

[0083] The detection result determination module 320 comprises:

[0084] A feature vector output unit is configured to perform feature encoding on the component image to be detected by using the encoder, and output at least one feature vector.

[0085] A target feature determination unit is configured to calculate the distance between each feature in the normal component feature set and the feature vector, and determine a target feature matched with the feature vector according to the distance.

[0086] A missing defect detection result determination unit is configured to determine a missing defect detection result according to the target feature and the feature vector.

[0087] On the basis of the above scheme, optionally, the missing defect detection result comprises a missing judgment result.

[0088] The missing defect detection result determination unit is specifically configured to:

[0089] If the distance between the target feature and the feature vector is greater than a preset distance threshold, it is determined that the to-be-detected component has a missing defect.

[0090] In one possible implementation, the second defect detection unit includes a target position detector and a classifier.

[0091] The detection result determination module 320 includes:

[0092] A target position image determination unit is configured to, if it is determined that the to-be-detected component does not have a missing defect, perform target position detection on the to-be-detected component image by using the target position detector according to at least one target position that is preset, and determine a target position image.

[0093] A target position defect first detection result output unit is configured to perform classification on each target position image by using the classifier, and output a target position defect first detection result.

[0094] Based on the above solution, optionally, the first defect detection unit further includes a decoder; and the missing defect detection result further includes a defect candidate region.

[0095] The missing defect detection result determination unit is further configured to:

[0096] input the target feature and the feature vector into the decoder, and determine a target pixel of the to-be-detected component image;

[0097] determine a defect candidate region according to the target pixel.

[0098] In this solution, optionally, the detection result determination module 320 further includes:

[0099] A target position defect second detection result determination unit is configured to determine a target position defect second detection result according to the defect candidate region and the target position image.

[0100] In one preferred solution, the third defect detection unit includes a surface defect detector and a segmenter; and the detection result determination module 320 includes:

[0101] A surface defect image determination unit is configured to, if it is determined that the to-be-detected component does not have a target position defect according to the target position defect first detection result and the target position defect second detection result, perform surface defect detection on the to-be-detected component image by using the surface defect detector, and determine a surface defect image.

[0102] The surface defect detection result determination unit is configured to determine a surface defect detection result by performing image segmentation on the surface defect image by using the segmenter.

[0103] The component defect detection device provided in the embodiments of the present application can perform the component defect detection method provided in any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of performing the method.

[0104] Embodiment four

[0105] Figure 4 A structural diagram of an electronic device 410 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.

[0106] As shown in Figure 4 The electronic device 410 includes at least one processor 411, and a memory, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., connected to the at least one processor 411 in communication, where the memory stores a computer program executable by the at least one processor. The processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or loaded into the random access memory (RAM) 413 from the storage unit 418. In the RAM 413, various programs and data required 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 the bus 414.

[0107] The 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, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a magnetic disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. 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 telecommunications networks.

[0108] The processor 411 can be various general-purpose and / or special-purpose processing components having processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, and the like. The processor 411 performs various methods and processes described above, such as the component defect detection method.

[0109] In some embodiments, the component defect detection method can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded onto the RAM 413 and executed by the processor 411, one or more steps of the component defect detection method described above can be performed. Alternatively, in other embodiments, the processor 411 can be configured to perform the component defect detection method by any other appropriate means, such as by means of firmware.

[0110] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0111] Computer programs used to implement the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0112] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store computer programs for use by or in connection with an instruction execution system, apparatus, or device. Computer-readable storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0113] 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 the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; 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 can be received in any form, including acoustic, speech, or tactile input.

[0114] 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 a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0115] The computing system can 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 known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0116] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, and this is not limited herein.

[0117] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method of component defect detection, characterized by, The method comprises: acquiring a component image to be detected; performing at least one level of defect detection on the component image to be detected according to a pre-constructed defect detection model to determine at least one type of defect detection result of the component to be detected; wherein the defect detection model comprises sequentially connected first, second and third defect detection units; the first defect detection unit is used to detect missing defects of the component to be detected; the second defect detection unit is used to detect target position defects of the component to be detected; the third defect detection unit is used to detect surface defects of the component to be detected; the target position is a position affecting the function of the component to be detected; wherein the first defect detection unit comprises an encoder and a pre-determined normal component feature set; the normal component feature set comprises features determined based on the shooting images of the normal component at each preset angle; the performing at least one level of defect detection on the component image to be detected according to the pre-constructed defect detection model to determine at least one type of defect detection result of the component to be detected comprises: performing feature encoding on the component image to be detected by using the encoder to output at least one feature vector; calculating the distance between each feature in the normal component feature set and the feature vector, and taking the feature with the smallest distance in the normal component feature set as the target feature matched with the feature vector; determining a missing defect detection result according to the target feature and the feature vector.

2. The method of claim 1, wherein, The missing defect detection result comprises a missing judgment result. The determining a missing defect detection result according to the target feature and the feature vector comprises: if the distance between the target feature and the feature vector is greater than a preset distance threshold, it is determined that the component to be detected has a missing defect.

3. The method of claim 2, wherein, The second defect detection unit comprises a target position detector and a classifier. The performing at least one level of defect detection on the component image to be detected according to the pre-constructed defect detection model to determine at least one type of defect detection result of the component to be detected comprises: if it is determined that the component to be detected does not have a missing defect, performing target position detection on the component image to be detected according to at least one pre-set target position by using the target position detector to determine a target position image; performing classification on each target position image by using the classifier to output a target position defect first detection result.

4. The method of claim 2, wherein, The first defect detection unit further comprises a decoder; and 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 to determine a target pixel of the component image to be detected; determining a defect candidate region according to the target pixel.

5. The method of claim 4, wherein, After the target position image is determined, the method further comprises: determining a target position defect second detection result according to the defect candidate region and the target position image.

6. The method of claim 5, wherein, The third defect detection unit comprises a surface defect detector and a segmenter; The method comprises the following steps: If it is determined that the component to be detected does not have the target position defect according to the first detection result of the target position defect and the second detection result of the target position defect, a surface defect detector is used to detect the surface defect of the component to be detected according to the component image to obtain a surface defect image; The component image acquisition module is configured to acquire a component image to be detected.

7. A component defect detection apparatus characterized by comprising: The detection result determination module is configured to determine at least one type of defect detection result of the component to be detected by performing at least one level of defect detection on the component image to be detected according to a pre-constructed defect detection model. The defect detection model comprises a first defect detection unit, a second defect detection unit and a third defect detection unit connected in sequence; the first defect detection unit is configured to detect a missing defect of the component to be detected; the second defect detection unit is configured to detect a target position defect of the component to be detected; the third defect detection unit is configured to detect a surface defect of the component to be detected; and the target position is a position affecting the function of the component to be detected. The first defect detection unit comprises an encoder and a pre-determined normal component feature set; and the normal component feature set comprises features determined based on the shooting images of the normal component at each preset angle. The detection result determination module comprises: The feature vector output unit is configured to perform feature encoding on the component image to be detected by using the encoder to output at least one feature vector; The target feature determination unit is configured to calculate the distance between each feature in the normal component feature set and the feature vector, and determine the feature in the normal component feature set with the smallest distance as the target feature matched with the feature vector; The missing defect detection result determination unit is configured to determine the missing defect detection result according to the target feature and the feature vector. The electronic device comprises: at least one processor; and 8. An electronic device, comprising: a memory connected in communication with the at least one processor; wherein The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the component defect detection method in any one of claims 1-6. The computer readable storage medium stores computer instructions for enabling the processor to execute the component defect detection method in any one of claims 1-6 when executed. ​ 9. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Cigarette case defect detection method, device, equipment and medium

    CN114708214A