Defect detection method, flaw detection equipment and storage medium
By performing two image acquisitions and defect detection on the product to be tested, combining cleaning treatment to distinguish substantial defects from surface dirt, the misjudgment problem in the existing technology is solved, the detection accuracy is improved and the cost is reduced.
Patent Information
- Application Number
- CN202311287786.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-07
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art can easily misjudged the dirt on the product surface as a defect in product defect detection, resulting in a decrease in detection accuracy.
By obtaining the first image and defect detection results of the product to be tested, the second image and defect detection results are obtained after cleaning, and the final defect detection results are determined based on the results of the two, thereby distinguishing between substantial defects and surface dirt.
It effectively avoids misjudging surface dirtyness as a defect, improves the accuracy of product defect detection, and reduces the detection cost.
Smart Images

Figure CN119827498A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of product detection, and in particular to a defect detection method, a defect detection device and a storage medium. Background Art
[0002] Surface defects of products not only destroy the beauty and comfort of the products, but may also cause serious damage to the performance of the products. In the related art, when performing defect detection based on product images, dirt on the surface of the product may be misjudged as a defect, resulting in a decrease in the accuracy of product defect detection. Summary of the invention
[0003] In view of the above, it is necessary to propose a defect detection method, a defect detection device and a storage medium, which can solve the problem of reduced accuracy of product defect detection due to dirt on the product surface.
[0004] An embodiment of the present application provides a defect detection method, which includes: obtaining a first image of a product to be inspected and a first defect detection result of the first image; cleaning the product to be inspected and obtaining a second image of the cleaned product to be inspected and a second defect detection result of the second image; and determining a third defect detection result of the product to be inspected based on the first defect detection result and the second defect detection result.
[0005] In one embodiment, the method for obtaining the first defect detection result includes: performing defect detection on the first image using a pre-trained defect detection model to obtain the first defect detection result.
[0006] In one embodiment, the method further includes: when the first defect detection result indicates that a first defect exists in the first image, determining a first position where the first defect is located; when the second defect detection result indicates that a second defect exists in the second image, determining a second position where the second defect is located.
[0007] In one embodiment, the cleaning of the product to be detected includes: determining a cleaning process corresponding to a production process of the product to be detected, and cleaning the product to be detected according to the cleaning process.
[0008] In one embodiment, determining the third defect detection result of the product to be inspected based on the first defect detection result and the second defect detection result includes: when the first defect exists and the second defect does not exist, determining that the first defect is surface dirt, and determining that the third defect detection result is that there is no substantial defect; or when the first position and the second position are not in the same position, determining that both the first defect and the second defect are surface dirt, and determining that the third defect detection result is that there is no substantial defect; or when the first position and the second position are in the same position, determining that the third defect detection result is that there is a substantial defect; or when the first defect does not exist and the second defect exists, determining that the second defect is surface dirt, and determining that the third defect detection result is that there is no substantial defect.
[0009] In one embodiment, the defect detection model includes a segmentation network-based defect detection model, and the model structure of the segmentation network-based defect detection model includes a two-stage network structure consisting of a segmentation network and a decision network.
[0010] In one embodiment, the defect detection model further includes one or more of a defect detection model based on a fully convolutional neural network and a defect detection model based on an encoder and a decoder.
[0011] An embodiment of the present application provides a defect detection device, which includes: an acquisition module, used to acquire a first image of a product to be inspected and a first defect detection result of the first image; a cleaning module, used to clean the product to be inspected and acquire a second image of the product to be inspected after cleaning and a second defect detection result of the second image; and a determination module, used to determine a third defect detection result of the product to be inspected based on the first defect detection result and the second defect detection result.
[0012] An embodiment of the present application provides a defect detection device, which includes: at least one camera device for capturing images of a product to be inspected; a cleaning device for cleaning the product to be inspected; a processor and a memory, wherein the processor is used to implement the defect detection method when executing a computer program stored in the memory.
[0013] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the defect detection method is implemented.
[0014] To summarize, the defect detection method described in the present application first obtains a first image of the product to be inspected and a first defect detection result of the first image; then, in order to determine whether the defect existing in the first defect detection result is surface dirt, the product to be inspected is cleaned to obtain a second image of the product to be inspected and a second defect detection result of the second image; then, based on the first defect detection result and the second defect detection result, a third defect detection result of the product to be inspected is determined, which can avoid misjudging the dirt on the product surface as a product defect and improve the accuracy of product defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a structural diagram of a defect detection device provided in one embodiment of the present application.
[0016] Figure 2 It is a flow chart of a defect detection method provided in one embodiment of the present application.
[0017] Figure 3 This is an example diagram of a transmission environment of a product between devices provided by an embodiment of the present application.
[0018] Figure 4 This is an example diagram of the first position provided in an embodiment of the present application.
[0019] Figure 5 This is an example diagram of a first defect detection result and a second defect detection result provided in an embodiment of the present application.
[0020] Figure 6 This is an example diagram of a first defect detection result and a second defect detection result provided in another embodiment of the present application.
[0021] Figure 7 This is an example diagram of a first defect detection result and a second defect detection result provided by another embodiment of the present application.
[0022] Figure 8 This is an example diagram of a first defect detection result and a second defect detection result provided in yet another embodiment of the present application.
[0023] Fig. 9 It is a structural diagram of a defect detection device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing the embodiments in one embodiment and are not intended to limit this application.
[0026] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0027] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. The following embodiments and features in the embodiments may be combined with each other without conflict.
[0028] In one embodiment, the surface defects of the product not only destroy the beauty and comfort of the product, but may also cause serious damage to the performance of the product. In the related art, when performing defect detection based on product images, dirt on the surface of the product may be misjudged as a defect, resulting in a decrease in the accuracy of product defect detection.
[0029] To solve the above problem, an embodiment of the present application provides a defect detection method, which first obtains a first image of a product to be inspected and a first defect detection result of the first image; then, in order to determine whether the defect existing in the first defect detection result is surface dirt, the product to be inspected is cleaned to obtain a second image of the product to be inspected and a second defect detection result of the second image; then, based on the first defect detection result and the second defect detection result, a third defect detection result of the product to be inspected is determined, which can avoid misjudging the dirt on the product surface as a product defect and improve the accuracy of product defect detection.
[0030] Figure 1 This is a schematic diagram of the structure of a defect detection device provided in an embodiment of the present application. The embodiment of the present application does not impose any limitation on the specific type of the defect detection device.
[0031] like Figure 1As shown, the defect detection device 10 may include a communication module 101, a memory 102, a processor 103, an input / output (I / O) interface 104 and a bus 105. The processor 103 is coupled to the communication interface 101, the memory 102, the I / O interface 104, at least one camera 106, a cleaning device 107, and a conveying device 108 through the bus 105.
[0032] The communication module 101 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as universal serial bus (USB), controller area network bus (CAN, Controller Area Network). The wireless communication module may provide one or more wireless communication solutions such as wireless fidelity (wireless fidelity, Wi-Fi), bluetooth (bluetooth, BT), mobile communication network, frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR), etc.
[0033] The memory 102 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 103, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.
[0034] The non-volatile memory may also store executable programs and user and application data, etc., and may be pre-loaded into the random access memory for direct reading and writing by the processor 110. The non-volatile memory may include a disk storage device and a flash memory.
[0035] The memory 102 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 103. The one or more computer programs include a plurality of instructions, and when the plurality of instructions are executed by the processor 103, the defect detection method executed on the defect detection device 10 can be implemented.
[0036] In other embodiments, the defect detection device 10 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the defect detection device 10 .
[0037] The processor 103 may include one or more processing units, for example, the processor 103 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0038] The processor 103 provides computing and control capabilities. For example, the processor 103 is used to execute a computer program stored in the memory 102 to implement the above-mentioned defect detection method.
[0039] The I / O interface 104 is used to provide a channel for user input or output. For example, the I / O interface 104 can be used to connect various input and output devices, such as a mouse, keyboard, touch device, display screen, etc., so that the user can enter information or visualize information.
[0040] The bus 105 is at least used to provide a channel for mutual communication among the communication module 101 , the memory 102 , the processor 103 , the I / O interface 104 , the camera device 106 , the cleaning device 107 , and the transmission device 108 in the defect detection device 10 .
[0041] The camera device 106 is used to capture images of products; the cleaning device 107 is used to clean products. For example, the cleaning device 107 may include cleaning processes corresponding to various production processes (such as an electrostatic brush, a high-pressure air gun, etc.); the conveying device 108 is used to move the product between the position where the camera device 106 is located and the position where the cleaning device 107 is located. For example, the conveying device 108 may include but is not limited to a conveyor belt, a robotic arm, etc.
[0042] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the defect detection device 10. In other embodiments of the present application, the defect detection device 10 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0043] Figure 2 is a flow chart of a defect detection method provided by an embodiment of the present application. The defect detection method is applied to a defect detection device, for example Figure 1 The defect detection device 10 specifically includes the following steps. According to different requirements, the order of the steps in the flowchart can be changed and some can be omitted.
[0044] S21, obtaining a first image of the product to be inspected and a first defect detection result of the first image.
[0045] In one embodiment, the product to be detected can be any product produced by a factory that is to be inspected for defects. For example, the product to be detected can be a cosmetic instruction manual containing text or images, a metal plate, etc. The defects of the product to be detected can include multiple categories, such as incomplete text, surface scratches, surface cracks, etc. In addition, since vacuum cannot be achieved during the production process of the product, the surface of the product may be attached with dirt (such as dust, lint) floating in the production environment, resulting in the defects of the product to be detected including surface dirt on the product. Since surface dirt is a defect that can be removed by cleaning, surface dirt can be regarded as a non-substantial defect, and non-surface dirt can be regarded as a substantial defect, that is, the defects of the product to be detected can include two major categories, namely, non-substantial defects and substantial defects.
[0046] In one embodiment, a conveyor device (e.g. Figure 1 The camera device 108 shown in the figure transmits the product to be inspected to the camera device (eg Figure 1 The camera device 106 is located at the position where the product to be inspected is photographed using the camera device to obtain a first image of the product to be inspected.
[0047] For example Figure 3As shown, the conveying device can be a conveyor belt, and multiple sensors (such as pressure sensors, infrared sensors, etc.) can be installed on both sides of the conveyor belt; when the sensor detects that the product to be inspected has been placed on the conveyor belt, the defect detection device controls the conveyor belt to convey the product to be inspected to the camera device (such as Figure 3 The first camera device is located at the position where the first camera device is located, and the camera device is used to photograph the product to be inspected to obtain the first image.
[0048] In one embodiment, in order to improve the accuracy of defect detection on the first image, before performing defect detection on the first image, the method also includes: preprocessing the first image, and the preprocessing includes but is not limited to: resizing, for example, adjusting the size of the first image to the size required for input of the defect detection model; image optimization, for example, improving the texture clarity of the first image based on an interpolation algorithm (for example, a bilinear interpolation algorithm); grayscale processing, for example, converting the first image into a grayscale image using a weighted averaging method; filtering processing, for example, using a preset filter (for example, a mean filter, a median filter, etc.) to smooth the first image to remove noise.
[0049] In one embodiment, the method for obtaining the first defect detection result includes: performing defect detection on the first image using a pre-trained defect detection model to obtain the first defect detection result. The first defect detection result may include whether the first defect exists in the first image and the defect category of the first defect when the first defect exists in the first image.
[0050] In one embodiment, the defect detection model may be a deep learning network model based on a semantic segmentation algorithm.
[0051] In one example, the defect detection model includes a defect detection model based on a fully convolutional neural network (FCN). Specifically, in a common convolutional neural network (CNN), a convolution layer is used to extract image features of an input image, a pooling layer is used to downsample the image features extracted by the convolution layer to retain important features and reduce data dimensions, and a fully connected layer is used to activate the outputs of the convolution layer and the pooling layer using an activation function (e.g., sigmoid, softmax, etc.) to obtain a classification result of the image features. Compared with CNN, FCN replaces the fully connected layer at the end of CNN with a convolution layer. FCN can accept a first image of any size and output a first feature map of the same size as the input first image. Each pixel in the first feature map has a corresponding semantic segmentation defect detection result, thereby obtaining a first defect detection result of the first image. Among them, the defect detection result of a pixel point may include whether it belongs to a defective pixel point and the corresponding defect category. For example, the defect detection result of a certain pixel point may be that it belongs to a defective pixel point, and the defect category corresponding to the defective pixel point is a surface scratch defect. When there are defective pixels in the first image, the first defect detection result of the first image is determined to be defective; when there are no defective pixels in the first image, the first defect detection result of the first image is determined to be defectless.
[0052] In another example, the defect detection model also includes an encoder / decoder-based defect detection model. Specifically, the defect detection model based on the encoder and decoder includes: extracting low-dimensional features of the first image using multiple convolutional layers and pooling layers alternately distributed in the encoder; using the decoder to perform deconvolution and upsampling on the low-dimensional features, restoring the low-dimensional features to the same size as the first image, and obtaining a first defect detection result of the first image. Among them, the network structure of the decoder includes multiple convolutional layers and pooling layers alternately distributed opposite to the network structure of the encoder. The U-Net structure can also be used to apply the size results generated in the encoding process of the encoder to the decoding process of the decoder to improve the stability of the decoding process.
[0053] In another example, the defect detection model also includes a defect detection model based on a segmentation network (Segmentation Network), and the model structure of the defect detection model based on the segmentation network includes a two-segment network structure consisting of a segmentation network and a decision network. Specifically, the front network structure of the segmentation network is similar to the structure of the ordinary CNN mentioned above. In the last convolution layer, a convolution kernel of a preset size (for example, 1×1×1024) is used to reduce the higher dimensional feature extraction results of the penultimate convolution layer (for example, 1024 groups of feature extraction results) to one dimension, so as to obtain a feature image (for example, a mask image) of the defect features in the first image. Thereafter, the segmentation network uses a pooling layer to fuse and reduce the dimensionality of the feature image output by the convolution layer to obtain a more concise feature representation; the decision network receives the output result of the segmentation network and performs global maximum pooling (MaxPooling) and average pooling (Average Pooling) processing on it, wherein the global maximum pooling extracts the most likely area with defects in the first image, and the average pooling can obtain the average defect probability of each pixel in the first image, and the results of the global maximum pooling and average pooling processing are merged through the fully connected layer to calculate the first defect detection result of the first image.
[0054] In other examples, a skip connection mechanism can be used to directly connect the outputs of different layers of the defect detection model, thereby allowing information to flow more freely in the network of the defect detection model to help the network better learn and understand the characteristics of the input data and solve the gradient vanishing and gradient exploding problems in long sequence data processing. For example, the skip connection mechanism can include but is not limited to a residual connection or a long short-term memory (LSTM) structure.
[0055] In one embodiment, taking a defect detection model based on a segmentation network as an example, a training method for the defect detection model includes: obtaining a sample set, wherein the sample set includes defect segmentation training data, defect decision training data, and test data; using the defect segmentation training data to train an initial segmentation model to obtain a segmentation model for identifying and segmenting defects in an image; using the defect decision training data to train an initial decision model to obtain a decision model for classifying defects according to their characteristics; combining the defect segmentation model and the defect decision model into a defect detection model; using test data and a preset loss function to test the trained defect detection model to verify the accuracy and precision of the trained defect detection model; if the accuracy and precision do not exceed a preset threshold, adjusting model parameters (such as a learning rate, an optimizer, a loss function, etc.) and repeating the above process until a trained defect detection model whose accuracy and precision do not exceed a preset threshold is obtained.
[0056] In one embodiment, the method further includes: when the first defect detection result indicates that the first image has a first defect, determining a first position where the first defect is located. Specifically, a first rectangular bounding box (e.g. Figure 4 As shown), use the position of any corner point or center point of the first rectangular bounding box as the first position of the first defect (for example Figure 4 shown).
[0057] In one embodiment, a first coordinate system can also be established with the lower left corner of the first image as the coordinate origin. The first coordinate system uses the straight line where the long side of the first image is located as the horizontal axis and the straight line where the wide side of the first image is located as the vertical axis. The size of a pixel can be used as the unit length to determine the first coordinate of the first position in the first coordinate system.
[0058] Step S22, cleaning the product to be inspected, and acquiring a second image of the product to be inspected after cleaning and a second defect detection result of the second image.
[0059] In one embodiment, in order to determine whether the defect indicated by the first defect detection result is a substantial defect, the product to be detected may be cleaned. The cleaning of the product to be detected includes: determining a cleaning process corresponding to the production process of the product to be detected, and cleaning the product to be detected according to the cleaning process. For example, when there is dust in the environment of the production process of the product to be detected, a high-pressure air gun may be selected as the cleaning process, and when there is lint and dust in the environment of the production process of the product to be detected, an electrostatic brush may be selected as the cleaning process.
[0060] In one embodiment, for example Figure 3 As shown, a conveying device can be used to transfer the product to be inspected from the camera device (eg Figure 3 The position of the first camera device shown in the figure is transferred to the position of the corresponding cleaning device. After the cleaning is completed, the conveying device is used to transfer the product to be inspected from the position of the cleaning device to the camera device (for example Figure 3 The second camera device is located at the position where the cleaned product to be inspected is photographed using the camera device to obtain a second image of the product to be inspected.
[0061] In one embodiment, before performing defect detection on the second image, the method further includes preprocessing the second image as described in step S21, and the preprocessed second image is the same size as the preprocessed first image, and the product to be inspected after cleaning in the preprocessed second image is consistent in size and position in the image with the product to be inspected before cleaning in the preprocessed first image.
[0062] In one embodiment, the method for obtaining a second defect detection result of a second image includes: performing defect detection on the second image using the defect detection model as described in step S21 to obtain the second defect detection result.
[0063] In one embodiment, the method further includes: when the second defect detection result indicates that the second defect exists in the second image, determining the second position where the second defect is located. Specifically, a second rectangular enclosing frame of the second defect can be generated, and the position of any corner point or center point of the second rectangular enclosing frame is used as the second position where the second defect is located. The second position is selected in the same manner as the first position. For example, if the first position uses the center point of the first rectangular enclosing frame, the second position uses the center point of the second rectangular enclosing frame; or, if the first position uses the upper left corner point of the first rectangular enclosing frame, the second position uses the upper left corner point of the second rectangular enclosing frame. For example, a second coordinate system is established with the lower left corner of the second image as the coordinate origin. The second coordinate system uses the straight line where the long side of the second image is located as the horizontal axis and the straight line where the wide side of the second image is located as the vertical axis. The size of a pixel can be used as the unit length to determine the second coordinate of the second position in the second coordinate system.
[0064] Step S23: determining a third defect detection result of the product to be detected based on the first defect detection result and the second defect detection result.
[0065] In one embodiment, determining a third defect detection result of the product to be detected based on the first defect detection result and the second defect detection result includes:
[0066] When the first defect exists and the second defect does not exist, the first defect is determined to be surface dirt, and the third defect detection result is determined to be that there is no substantial defect (for example Figure 5 shown); or
[0067] When the first position and the second position are not at the same position, it is determined that the first defect and the second defect are both surface dirt, and the third defect detection result is determined to be that there is no substantial defect (for example Figure 6 shown); or
[0068] When the first position and the second position are at the same position, the third defect detection result is determined to be a substantial defect (eg Figure 7 shown); or
[0069] When the first defect does not exist and the second defect exists, the second defect is determined to be surface dirt, and the third defect detection result is determined to be that there is no substantial defect (for example Figure 8 shown).
[0070] In one embodiment, when the first defect does not exist and the second defect does not exist, the third defect detection result is determined as the absence of a substantial defect.
[0071] In one embodiment, when determining whether the first position and the second position are in the same position, the Euclidean distance between the first coordinate and the second coordinate can be calculated. When the Euclidean distance is equal to 0, it is determined that the first position and the second position are in the same position; or when the Euclidean distance is not equal to 0, it is determined that the first position and the second position are not in the same position.
[0072] In one embodiment, after determining the third defect detection result of the product to be inspected, the method may further include: sending the first image, the second image, the first defect detection result, the second defect detection result, and the third defect detection result of the product to be inspected to the user responsible for the product to be inspected, and receiving the user's re-inspection result of the product to be inspected, the re-inspection result including a determination result of whether the third defect detection result is accurate.
[0073] In one embodiment, the defect detection method provided by the embodiment of the present application utilizes the characteristic that non-substantial defects can move under the action of external forces, and takes images of the product twice, without any cleaning treatment before the first image, and performs the first defect determination and cleans the product after the first image; based on the defect position determined by the first defect determination, take a second image of the defective area and perform a second defect determination; compare the results of the two defect determinations, if the defect position determined by the second defect determination is displaced or disappears compared to the defect position determined by the first defect determination, then these defects can be determined as non-substantial defects of surface dirt, thereby avoiding misjudgment and improving the accuracy of defect detection. In addition, it is possible to clean the product without using expensive cleaning devices such as negative pressure chamber equipment before performing defect detection on the product, reducing the cost of defect detection.
[0074] Fig. 9 It is a structural diagram of a defect detection device provided in one embodiment of the present application.
[0075] In some embodiments, the defect detection device 40 may include a plurality of functional modules composed of computer program segments. The computer programs of the various program segments in the defect detection device 40 may be stored in a memory of the defect detection device and executed by at least one processor to perform (see Figure 2 Description) Function of defect detection.
[0076] In this embodiment, the defect detection device 40 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an acquisition module 401, a cleaning module 402, and a determination module 403. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functional implementation of each module in the defect detection device 40 can refer to the above definition of the defect detection method, and will not be repeated here.
[0077] The acquisition module 401 is used to acquire a first image of the product to be inspected and a first defect detection result of the first image.
[0078] The cleaning module 402 is used to clean the product to be inspected and obtain a second image of the product to be inspected after cleaning and a second defect detection result of the second image.
[0079] The cleaning module 403 is configured to determine a third defect detection result of the product to be detected based on the first defect detection result and the second defect detection result.
[0080] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the methods in the above-mentioned embodiments of the present application.
[0081] The computer-readable storage medium may be an internal memory of the defect detection device described in the above embodiment, such as a hard disk or memory of the defect detection device. The computer-readable storage medium may also be an external storage device of the defect detection device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the defect detection device.
[0082] In some embodiments, the computer-readable storage medium may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the defect detection device, etc.
[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0085] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0086] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0087] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A defect detection method, characterized in that: The method comprises: Acquire a first image of a product to be inspected and a first defect detection result of the first image; Cleaning the product to be inspected, and acquiring a second image of the product to be inspected after cleaning and a second defect detection result of the second image; A third defect detection result of the product to be inspected is determined based on the first defect detection result and the second defect detection result.
2. The defect detection method according to claim 1, characterized in that: The method for obtaining the first defect detection result includes: performing defect detection on the first image using a pre-trained defect detection model to obtain the first defect detection result.
3. The defect detection method according to claim 1, characterized in that: The method further comprises: When the first defect detection result indicates that a first defect exists in the first image, determining a first position where the first defect is located; When the second defect detection result indicates that a second defect exists in the second image, a second position of the second defect is determined.
4. The defect detection method according to claim 1, characterized in that: The cleaning of the product to be detected comprises: A cleaning process corresponding to the production process of the product to be detected is determined, and the product to be detected is cleaned according to the cleaning process.
5. The defect detection method according to claim 3, characterized in that: The determining, based on the first defect detection result and the second defect detection result, a third defect detection result of the product to be detected includes: When the first defect exists and the second defect does not exist, determining that the first defect is surface dirt, and determining that the third defect detection result is that there is no substantial defect; or When the first position and the second position are not at the same position, determining that both the first defect and the second defect are surface dirt, and determining that the third defect detection result is that there is no substantial defect; or When the first position and the second position are at the same position, determining the third defect detection result as the presence of a substantial defect; or When the first defect does not exist and the second defect exists, the second defect is determined to be surface dirt, and the third defect detection result is determined to be that there is no substantial defect.
6. The defect detection method according to claim 2, characterized in that: The defect detection model includes a segmentation network-based defect detection model, and the model structure of the segmentation network-based defect detection model includes a two-stage network structure consisting of a segmentation network and a decision network.
7. The defect detection method according to claim 2, characterized in that: The defect detection model also includes one or more of a defect detection model based on a fully convolutional neural network and a defect detection model based on an encoder and a decoder.
8. A defect detection device, characterized in that: The defect detection device comprises: At least one camera device, used to capture images of the product to be inspected; A cleaning device, used for cleaning the product to be tested; A processor and a memory, wherein the processor is configured to implement the defect detection method according to any one of claims 1 to 7 when executing a computer program stored in the memory.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the defect detection method according to any one of claims 1 to 7 is implemented.