Defect detection method and apparatus, and device and storage medium
By combining the object detection model and the unsupervised abnormality detection model, defect detection on the original image is solved, and the problem of missed defect detection in the prior art is achieved, and higher detection accuracy and less missed detection are achieved.
Patent Information
- Application Number
- PCT/CN2024/097802
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-05
- Filing Date
- 2024-06-06
- Publication Date
- 2025-06-12
AI Technical Summary
The prior art is prone to missed detection in defect detection, especially when facing large-area abnormal defects that have not appeared before, the supervised learning characteristics of the YOLOv5 model make the missed detection rate higher.
The method combining the object detection model and the unsupervised anomaly detection model is used to detect defects on the original image. First, the object detection model is used to predict whether there are the first type of learned defects. If not, the unsupervised anomaly detection model is used to detect whether there are the second type of learned defects and output relevant defect information.
By using the object detection model and the unsupervised abnormal detection model in turn, the accuracy of defect detection is significantly improved and the occurrence of defect missed detection is reduced.
Smart Images

Figure CN2024097802_12062025_PF_FP_ABST
Abstract
Description
Defect detection method, device, equipment and storage medium Technical Field
[0001] The present application relates to the technical field of defect detection and provides a defect detection method, apparatus, device and storage medium. Background Art
[0002] As we all know, defect detection is a very common and important task in existing industrial panel manufacturing production lines. Currently, in order to ensure product yield and improve the speed and accuracy of defect detection, "artificial neural networks" or "traditional computer vision" are often used in existing technologies to replace "manual" defect detection work. For example, convolutional neural networks are used to conduct large-scale training and modeling of panel defect data, and based on the trained model, panel defects in actual scenarios are further predicted and judged.
[0003] Currently, the YOLOv5 model is commonly used in industry for object detection in images, significantly improving the accuracy and recall of defect detection. However, this approach also has certain drawbacks. For example, when faced with large training sets, the YOLOv5 model must use a large model to ensure accuracy, which often results in a long training time. Furthermore, as a supervised learning model, the YOLOv5 model is prone to missing detections when faced with large, unusual defects that have never been seen before.
[0004] Therefore, how to avoid missed defects is an urgent problem to be solved.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a defect detection method, apparatus, device, and storage medium for solving the problem of missed defect detection.
[0007] In one aspect, a defect detection method is provided, the method comprising:
[0008] Inputting the original image into the trained target detection model to perform defect prediction, predicting whether the original image contains a first type of defect; wherein the first type of defect is a defect learned by the trained target detection model;
[0009] If it is determined that the original image does not contain the first type of defects, inputting the original image into the trained unsupervised anomaly detection model to perform abnormal defect detection to determine whether the original image contains the second type of defects; wherein the second type of defects are defects that have not been learned by the trained unsupervised anomaly detection model;
[0010] If it is determined that the second type of defect exists in the original image, the name and coordinate information of the second type of defect are output.
[0011] The beneficial effects of this application are: because defect detection is performed on the original image using the trained object detection model and the trained unsupervised anomaly detection model, the defect detection accuracy is greatly improved. In addition, because the trained unsupervised anomaly detection model can detect defects that it has not learned, this further improves the defect detection accuracy while significantly preventing the occurrence of missed defects.
[0012] In one implementation, after inputting the original image into the trained object detection model to perform defect prediction and predicting whether the original image contains the first type of defect, the method further includes:
[0013] If it is determined that the first type of defect exists in the original image, then calculating the confidence level of the first type of defect;
[0014] Determining whether the confidence level exceeds a preset confidence threshold;
[0015] If it is determined that the confidence exceeds a preset confidence threshold, the name and Bbox coordinates of the first type of defect are output.
[0016] The beneficial effect of the present application is that the confidence level of the first type of defects can be calculated to reduce the phenomenon of false detection, thereby improving the accuracy and reliability of defect detection.
[0017] In one implementation, after determining whether the confidence level exceeds a preset confidence level threshold, the method further includes:
[0018] If it is determined that the confidence level does not exceed the preset confidence level threshold, the process proceeds to the manual processing step.
[0019] The beneficial effect of this application is that when the confidence level does not exceed the preset confidence threshold, in order to further improve the accuracy of defect detection, the defect detection staff can make a judgment on the current defect by switching to a manual processing process.
[0020] In one implementation, if it is determined that the second type of defect exists in the original image, outputting the name and coordinate information of the second type of defect includes:
[0021] If it is determined that the second type of defect exists in the original image, determining the size of the second type of defect;
[0022] determining whether a size of the second type of defect exceeds a preset size threshold;
[0023] If it is determined that the size exceeds the preset size threshold, the name and Bbox coordinates of the second type of defect are output.
[0024] The beneficial effect of the present application is: in order to further improve the accuracy of defect detection, when determining that there are second-type defects in the original image, some smaller defects (falsely detected defects) can be further screened out by defect size to further improve the accuracy of defect detection.
[0025] In one implementation, after determining whether the size of the second-type defect exceeds a preset size threshold, the method includes:
[0026] If it is determined that the size of the second type of defect does not exceed a preset size threshold, the original image is determined to be a normal defect-free image, and the original image is output.
[0027] The beneficial effect of the present application is that when the defect size does not exceed the preset size threshold, that is, the defect can be ignored due to its small size, or when the small defect is within the allowable range, the original image can be directly judged as a normal defect-free image.
[0028] In one implementation, if it is determined that the original image does not contain the first type of defects, the original image is input into the trained unsupervised anomaly detection model for abnormal defect detection. After determining whether the original image contains the second type of defects, the method further includes:
[0029] If it is determined that the second type of defects do not exist in the original image, the original image is determined to be a normal image without defects, and the original image is output.
[0030] The beneficial effect of the present application is that when there is no second-type defect in the original image, that is, when there is neither first-type defect nor second-type defect in the original image, the original image can be directly judged as a normal defect-free image.
[0031] In one implementation, the target detection model is a YOLOv8 model.
[0032] The beneficial effect of this application is that when the target detection model is a YOLOv8 model, the detection accuracy and detection speed can be greatly improved.
[0033] In one implementation, before inputting the original image into the trained object detection model to perform defect prediction and predicting whether the original image contains the first type of defect, the method further includes:
[0034] Label multiple defective images collected in real time to form a defect image dataset;
[0035] Statistics are collected on multiple defect-free images in real time to form a normal image data set.
[0036] The beneficial effect of the present application is that since the images in the defect image dataset and the normal image dataset are collected in real time, the timeliness and effectiveness of the training dataset can be greatly guaranteed to further improve the accuracy of defect detection.
[0037] In one implementation, before inputting the original image into the trained object detection model to perform defect prediction and predicting whether the original image contains the first type of defect, the method further includes:
[0038] The defect image dataset is input into an initial target detection model for training to obtain a trained target detection model; wherein the trained target detection model is used to identify the first type of defects in the original image.
[0039] The beneficial effects of the present application are: since the initial target detection model is trained through a real-time defect image dataset, the timeliness and effectiveness of the trained target detection model can be greatly guaranteed, thereby further improving the accuracy of defect detection.
[0040] In one implementation, before inputting the original image into the trained object detection model to perform defect prediction and predicting whether the original image contains the first type of defect, the method further includes:
[0041] The normal image data set is input into an initial unsupervised anomaly detection model for training to obtain a trained unsupervised anomaly detection model; wherein the trained unsupervised anomaly detection model is used to identify the second type of defects.
[0042] The beneficial effects of the present application are: since the initial unsupervised anomaly detection model is trained through a real-time normal image dataset, the timeliness and effectiveness of the trained unsupervised anomaly detection model can be greatly guaranteed, thereby further improving the accuracy of defect detection.
[0043] In one aspect, a defect detection device is provided, comprising:
[0044] A defect prediction unit is configured to input an original image into a trained target detection model to perform defect prediction, and predict whether a first type of defect exists in the original image; wherein the first type of defect is a defect learned by the trained target detection model;
[0045] an abnormal defect detection unit, configured to, if it is determined that the original image does not contain the first type of defects, input the original image into the trained unsupervised abnormality detection model to perform abnormal defect detection to determine whether the original image contains the second type of defects; wherein the second type of defects are defects that have not been learned by the trained unsupervised abnormality detection model;
[0046] The output unit is configured to output the name and coordinate information of the second type of defect if it is determined that the second type of defect exists in the original image.
[0047] On the one hand, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the above methods when executing the computer program.
[0048] In one aspect, a computer storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, any of the above methods is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0050] FIG1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0051] FIG2 is a schematic diagram of a flow chart of a defect detection method provided in an embodiment of the present application;
[0052] FIG3 is a schematic diagram of a defect detection output result provided by an embodiment of the present application;
[0053] FIG4 is a schematic diagram of a defect detection device provided in an embodiment of the present application.
[0054] Markings in the figure: 10-defect detection equipment, 101-processor, 102-memory, 103-I / O interface, 104-database, 40-defect detection device, 401-defect prediction unit, 402-abnormal defect detection unit, 403-output unit, 404-manual processing unit, 405-dataset formation unit, 406-model training unit. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other in any way. In addition, although a logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0056] As we all know, defect detection is a very common and important task in existing industrial panel manufacturing production lines. Currently, in order to ensure product yield and improve the speed and accuracy of defect detection, "artificial neural networks" or "traditional computer vision" are often used in existing technologies to replace "manual" defect detection work. For example, convolutional neural networks are used to conduct large-scale training and modeling of panel defect data, and based on the trained model, panel defects in actual scenarios are further predicted and judged.
[0057] Currently, the YOLOv5 model is commonly used in industry for object detection in images, significantly improving the accuracy and recall of defect detection. However, this approach also has certain drawbacks. For example, when faced with large training sets, the YOLOv5 model must use a large model to ensure accuracy, which often results in a long training time. Furthermore, as a supervised learning model, the YOLOv5 model is prone to missing detections when faced with large, unusual defects that have never been seen before.
[0058] Based on this, an embodiment of the present application provides a defect detection method, in which, first, the original image can be input into the trained target detection model for defect prediction to predict whether the original image contains the first type of defects; then, if it is determined that the original image does not contain the first type of defects, the original image can be input into the trained unsupervised anomaly detection model for abnormal defect detection to determine whether the original image contains the second type of defects; finally, if it is determined that the original image contains the second type of defects, the name and coordinate information of the second type of defects can be output. Among them, the first type of defects are defects that have been learned by the trained target detection model, and the second type of defects are defects that have not been learned by the trained unsupervised anomaly detection model. Therefore, in the embodiment of the present application, since the original image is sequentially detected for defects by the trained target detection model and the trained unsupervised anomaly detection model, the defect detection accuracy is greatly improved. In addition, since the trained unsupervised anomaly detection model can detect defects that have not been learned, while further improving the defect detection accuracy, it can also greatly avoid the occurrence of defect omissions.
[0059] After introducing the design concepts of the embodiments of the present application, the following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limiting. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0060] As shown in FIG1 , a schematic diagram of an application scenario provided by an embodiment of the present application is shown, wherein the application scenario may include a defect detection device 10 .
[0061] The defect detection device 10 can be used to perform defect detection on industrial images, for example, it can be a personal computer (PC), a server, a laptop, etc. The defect detection device 10 may include one or more processors 101, a memory 102, an I / O interface 103, and a database 104. Specifically, the processor 101 may be a central processing unit (CPU), or a digital processing unit, etc. The memory 102 may be a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 102 may also be a non-volatile memory (non-volatile memory), such as a read-only memory, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or the memory 102 may be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 102 may be a combination of the above memories. Memory 102 may store some program instructions for the defect detection method provided in the embodiments of the present application. When executed by processor 101, these program instructions can be used to implement the steps of the defect detection method provided in the embodiments of the present application, thereby resolving the problem of missed defect detection in the prior art. Database 104 may be used to store data such as original images, defect image datasets, and normal image datasets involved in the solutions provided in the embodiments of the present application.
[0062] In the embodiment of the present application, the defect detection device 10 can obtain the original image to be inspected for defects through the I / O interface 103. Then, the processor 101 of the defect detection device 10 will solve the problem of missed defect detection in the prior art according to the program instructions of the defect detection method provided in the embodiment of the present application in the memory 102. In addition, data such as the original image, defect image dataset, and normal image dataset can be stored in the database 104.
[0063] Of course, the method provided in the embodiment of the present application is not limited to the application scenario shown in Figure 1, and can also be used in other possible application scenarios, and the embodiment of the present application is not limited thereto. The functions that can be implemented by each device in the application scenario shown in Figure 1 will be described in the subsequent method embodiments, and will not be described in detail here. Below, the method of the embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0064] As shown in FIG2 , a flow chart of a defect detection method provided in an embodiment of the present application is shown. The method can be executed by the defect detection device 10 in FIG1 . Specifically, the flow of the method is described as follows.
[0065] Step 201: Input the original image into the trained object detection model to perform defect prediction to predict whether the original image contains the first type of defect.
[0066] In this embodiment of the present application, the first type of defects may be defects learned by a trained object detection model. The original image may be an image captured of an industrial part, etc. Furthermore, to improve the speed and accuracy of defect detection, in this embodiment of the present application, the original image may be input into the trained object detection model for defect prediction to predict whether the original image contains the first type of defects.
[0067] Step 202: If it is determined that the original image does not contain the first type of defects, the original image is input into the trained unsupervised anomaly detection model to perform abnormal defect detection to determine whether the original image contains the second type of defects.
[0068] In an embodiment of the present application, the second type of defects may be defects that have not been learned by the trained unsupervised anomaly detection model. Furthermore, in order to solve the problem of missed defects caused by industrial defect detection using a single supervised model, in an embodiment of the present application, if it is determined that the original image does not contain the first type of defects, the original image can be input into the trained unsupervised anomaly detection model for abnormal defect detection to determine whether the original image contains the second type of defects, that is, to determine whether the industrial parts in the original image have the complete morphology and appearance of normal industrial parts.
[0069] Step 203: If it is determined that the second type of defect exists in the original image, the name and coordinate information of the second type of defect is output.
[0070] In the application embodiment, the coordinate information may be a Bbox coordinate. Specifically, if it is determined that there is a second type of defect in the original image, that is, the industrial parts in the original image do not have the complete appearance of a normal industrial part, the name and coordinate information of the second type of defect may be output. For example, as shown in FIG3 , which is a schematic diagram of the defect detection output result provided in the embodiment of the present application, the name and coordinate information of the second type of defect may be directly displayed on the defect image, wherein the name of the second type of defect may be “sand inclusion scar” and the coordinate information may be “(234,105)”, so that subsequent staff may perform secondary processing or scrapping of the defective parts.
[0071] In one possible implementation, in order to reduce false detections and further improve the accuracy and reliability of defect detection, in this embodiment of the present application, it is possible to further determine whether the original image is a defective image based on the "confidence of the first type of defect." Specifically, if it is determined that a first type of defect exists in the original image, the confidence of the first type of defect can be calculated; then, it can be determined whether the calculated confidence exceeds a preset confidence threshold; finally, if it is determined that the confidence exceeds the preset confidence threshold, the name and Bbox coordinates of the first type of defect can be output. In this embodiment of the application, the preset confidence threshold can be set to 0.5 or 0.7, etc.
[0072] In one possible implementation, to further improve the accuracy of defect detection, in this embodiment of the present application, if the calculated confidence level is determined to be less than a preset confidence threshold, the process can be switched to manual processing. The operator can then determine, based on the current situation, whether to classify the original image as a defective image or a normal, non-defective image, thereby avoiding missed defects.
[0073] In one possible implementation, in order to further improve the accuracy of defect detection, in an embodiment of the present application, it is possible to further determine whether the original image is a defect image based on the "size of the second type of defect". Specifically, if it is determined that there are second type defects in the original image, the size of the second type of defect can be determined; then, it can be determined whether the size of the second type of defect exceeds a preset size threshold; finally, if it is determined that the size exceeds the preset size threshold, the name and Bbox coordinates of the second type of defect can be output. Therefore, in an embodiment of the present application, some smaller defects (misdetected defects) can be further screened out by the defect size to further improve the accuracy of defect detection, thereby facilitating subsequent staff to perform secondary processing or scrapping of defective parts.
[0074] In one possible embodiment, if it is determined that the size of the second type of defect does not exceed a preset size threshold, that is, the defect can be ignored due to its small size, or the small defect is within an allowable range, then the original image can be determined to be a normal defect-free image, and the original image can be output for display to the staff.
[0075] In one possible implementation, if it is determined that there are no second-type defects in the original image, that is, the original image does not have either first-type defects or second-type defects, then the original image can be determined to be a normal, defect-free image, and the original image can be output for display to the staff.
[0076] In one possible implementation, in order to shorten the training time of the target detection model and improve the detection accuracy and detection speed, in an embodiment of the present application, the target detection model can be a YOLOv8 model. Specifically, the YOLOv8 model can also be an s model or an m model in the YOLOv8 model. Based on this, the training time of the target detection model can be greatly shortened while improving the detection accuracy and detection speed.
[0077] In one possible implementation, to ensure the timeliness and effectiveness of the training dataset and further improve the accuracy of defect detection, in this embodiment of the present application, "real-time acquired images" can be used as the dataset. Specifically, these real-time acquired images can first be classified into defect images and non-defect images. Then, multiple defective images acquired in real time can be annotated to form a defect image dataset, and multiple non-defective images acquired in real time can be statistically analyzed to form a normal image dataset.
[0078] In one possible implementation, in order to obtain a trained target detection model with higher accuracy, in an embodiment of the present application, the defect image dataset can be input into the initial target detection model for training to obtain model weights that can normally identify existing defects, thereby finally obtaining a trained target detection model; wherein, the trained target detection model is used to identify the first type of defects in the original image. Therefore, in an embodiment of the present application, since the initial target detection model is trained by a real-time defect image dataset, the timeliness and effectiveness of the trained target detection model can be greatly guaranteed to further improve the accuracy of defect detection.
[0079] In one possible implementation, in order to obtain a trained unsupervised anomaly detection model with higher accuracy, in an embodiment of the present application, a normal image dataset can be input into the initial unsupervised anomaly detection model for training. Since the initial unsupervised anomaly detection model does not require a label file, the normal image dataset can be directly trained to obtain model weights that can identify abnormal defects, thereby ultimately obtaining a trained unsupervised anomaly detection model; wherein the trained unsupervised anomaly detection model is used to identify the second type of defects. Therefore, in an embodiment of the present application, since the initial unsupervised anomaly detection model is trained using a real-time normal image dataset, the timeliness and effectiveness of the trained unsupervised anomaly detection model can be greatly guaranteed to further improve the accuracy of defect detection.
[0080] In summary, in the embodiments of the present application, defect detection is performed on the original image using a trained object detection model and then a trained unsupervised anomaly detection model, thereby significantly improving defect detection accuracy. Furthermore, because the trained unsupervised anomaly detection model can detect defects it has not learned, this not only further improves defect detection accuracy but also significantly reduces the risk of missed defects.
[0081] Based on the same inventive concept, an embodiment of the present application provides a defect detection device 40, as shown in FIG4 , the defect detection device 40 includes:
[0082] The defect prediction unit 401 is configured to input the original image into the trained target detection model to perform defect prediction and predict whether the original image contains a first type of defect; wherein the first type of defect is a defect learned by the trained target detection model;
[0083] The abnormal defect detection unit 402 is configured to input the original image into the trained unsupervised abnormal defect detection model to perform abnormal defect detection if it is determined that the original image does not contain the first type of defects, and determine whether the original image contains the second type of defects; wherein the second type of defects are defects that have not been learned by the trained unsupervised abnormal defect detection model;
[0084] The output unit 403 is configured to output the name and coordinate information of the second type of defect if it is determined that the second type of defect exists in the original image.
[0085] Optionally, the output unit 403 is further configured to:
[0086] If it is determined that the first type of defect exists in the original image, the confidence level of the first type of defect is calculated;
[0087] determining whether the confidence level exceeds a preset confidence threshold;
[0088] If the confidence level exceeds the preset confidence threshold, the name and Bbox coordinates of the first type of defect are output.
[0089] Optionally, the defect detection device 40 further includes a manual processing unit 404, which is configured to:
[0090] If it is determined that the confidence level does not exceed the preset confidence threshold, the process will be transferred to manual processing.
[0091] Optionally, the output unit 403 is further configured to:
[0092] If it is determined that the second type of defect exists in the original image, then the size of the second type of defect is determined;
[0093] determining whether a size of the second type of defect exceeds a preset size threshold;
[0094] If the size is determined to exceed the preset size threshold, the name and Bbox coordinates of the second type of defect are output.
[0095] Optionally, the output unit 403 is further configured to:
[0096] If it is determined that the size of the second type of defect does not exceed the preset size threshold, the original image is determined to be a normal defect-free image, and the original image is output.
[0097] Optionally, the output unit 403 is further configured to:
[0098] If it is determined that the second type of defects do not exist in the original image, the original image is determined to be a normal image without defects, and the original image is output.
[0099] Optionally, the defect detection device 40 further includes a data set forming unit 405, wherein the data set forming unit 405 is configured to:
[0100] Label multiple defective images collected in real time to form a defect image dataset;
[0101] Statistics are collected on multiple defect-free images in real time to form a normal image data set.
[0102] Optionally, the defect detection device 40 further includes a model training unit 406, wherein the model training unit 406 is configured to:
[0103] The defect image dataset is input into the initial target detection model for training to obtain a trained target detection model; wherein the trained target detection model is used to identify the first type of defects in the original image.
[0104] The optional model training unit 406 is further configured to:
[0105] The normal image dataset is input into the initial unsupervised anomaly detection model for training to obtain a trained unsupervised anomaly detection model; wherein the trained unsupervised anomaly detection model is used to identify the second type of defects.
[0106] The defect detection device 40 can be used to execute the method in the embodiment shown in Figures 2 and 3. Therefore, for the functions that can be implemented by each functional unit of the defect detection device 40, please refer to the description of the embodiment shown in Figures 2 and 3, and no further details will be given.
[0107] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the method according to the various exemplary implementations of the present application described above in this specification. For example, the computer device may execute the method in the embodiments shown in Figures 2-3.
[0108] Those skilled in the art will understand that all or part of the steps of the above-mentioned method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above-mentioned method embodiments. The aforementioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks. Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0109] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0110] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A defect detection method, characterized in that: The method comprises: Inputting the original image into the trained target detection model for defect prediction, predicting whether there is a first type of defect in the original image; wherein the first type of defect is a defect in an industrial panel learned by the trained target detection model; and the target detection model is a YOLOv8 model; If it is determined that there are no first-category defects in the original image, the original image is input into the trained unsupervised anomaly detection model for abnormal defect detection to determine whether there are second-category defects in the original image; wherein the second-category defects are defects in industrial panels that have not been learned by the trained unsupervised anomaly detection model; if it is determined that there are second-category defects in the original image, the name and coordinate information of the second-category defects are output; If it is determined that there is a first type of defect in the original image, the confidence of the first type of defect is calculated; whether the confidence exceeds a preset confidence threshold is determined; if it is determined that the confidence exceeds the preset confidence threshold, the name and Bbox coordinates of the first type of defect are output.
2. The method according to claim 1, characterized in that After determining whether the confidence exceeds a preset confidence threshold, the method further includes: If it is determined that the confidence level does not exceed the preset confidence level threshold, the manual processing flow is entered.
3. The method according to claim 1, characterized in that If it is determined that the second type of defect exists in the original image, the name and coordinate information of the second type of defect are output, including: If it is determined that the second type of defect exists in the original image, determining the size of the second type of defect; determining whether a size of the second type of defect exceeds a preset size threshold; If it is determined that the size exceeds a preset size threshold, the name and Bbox coordinates of the second type of defect are output.
4. The method according to claim 3, characterized in that After determining whether the size of the second type of defects exceeds a preset size threshold, the method includes: If it is determined that the size of the second type of defects does not exceed a preset size threshold, the original image is determined to be a normal defect-free image, and the original image is output.
5. The method according to claim 1, characterized in that If it is determined that the original image does not contain the first type of defects, the original image is input into the trained unsupervised anomaly detection model to perform abnormal defect detection, and after determining whether the original image contains the second type of defects, the method further includes: If it is determined that the second type of defects do not exist in the original image, the original image is determined to be a normal image without defects, and the original image is output.
6. The method according to claim 1, characterized in that Before inputting the original image into the trained target detection model to perform defect prediction and predicting whether the original image contains the first type of defect, the method further includes: Label multiple defective images collected in real time to form a defect image dataset; Statistics are collected on multiple defect-free images in real time to form a normal image data set.
7. The method according to claim 6, characterized in that Before inputting the original image into the trained target detection model to perform defect prediction and predicting whether the original image contains the first type of defect, the method further includes: The defect image data set is input into an initial target detection model for training to obtain a trained target detection model; wherein the trained target detection model is used to identify the first type of defects in the original image.
8. The method according to claim 6, characterized in that Before inputting the original image into the trained target detection model to perform defect prediction and predicting whether the original image contains the first type of defect, the method further includes: The normal image data set is input into an initial unsupervised anomaly detection model for training to obtain a trained unsupervised anomaly detection model; wherein the trained unsupervised anomaly detection model is used to identify the second type of defects.
9. A defect detection device, characterized in that: The device comprises: The defect prediction unit is used to input the original image into the trained target detection model to perform defect prediction and predict whether there is a first type of defect in the original image; wherein the first type of defect is the Defects in industrial panels learned by the trained target detection model; the target detection model is a YOLOv8 model; an abnormal defect detection unit, configured to input the original image into the trained unsupervised abnormal defect detection model for abnormal defect detection if it is determined that the original image does not contain the first type of defects, and determine whether the original image contains the second type of defects; wherein the second type of defects are defects in industrial panels that have not been learned by the trained unsupervised abnormal defect detection model; an output unit, configured to output the name and coordinate information of the second type of defect if it is determined that the second type of defect exists in the original image; The output unit is also used to calculate the confidence of the first type of defects if it is determined that the first type of defects exists in the original image; determine whether the confidence exceeds a preset confidence threshold; if it is determined that the confidence exceeds the preset confidence threshold, output the name and Bbox coordinates of the first type of defects.
10. An electronic device, characterized in that: The device comprises: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute any method according to claims 1-8 according to the obtained program instructions.
11. A storage medium, characterized in that: The storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute any one of the methods of claims 1-8.
Citation Information
Patent Citations
Defect detection method and device of display panel, storage medium and electronic equipment
CN115482189A
Panel defect detection method, system and device and medium
CN115661160A
Defect detection method and device, electronic equipment and computer readable storage medium
CN116258703A
Defect detection method, device and equipment and storage medium
CN117372424A
Method for automatically detecting defects in the components of a circuit board
WO2023006627A1