Method, device and equipment for detecting appearance defects of small target and storage medium

By using deep learning models and image processing technology, the problems of low accuracy and high false detection rate of AOI equipment in detecting small target appearance defects have been solved, achieving efficient and low-cost automated detection.

CN116188427BActive Publication Date: 2026-02-03SHENZHEN EVERWIN PRECISION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310162315.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2026-02-03
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

Existing AOI equipment has low accuracy and high false detection rate when detecting small target appearance defects, making it difficult to distinguish target defects from the background or similar targets, and thus failing to meet the requirements of industrial applications.

Method used

A deep learning model is used for small target appearance defect detection. Through model training, image acquisition, defect localization and binarization processing, combined with limit control and multi-point control, the detection accuracy is improved and the false detection rate is reduced.

Benefits of technology

It improves the speed and accuracy of AOI equipment in detecting small target appearance defects, reduces the false detection rate, replaces manual inspection, and reduces inspection costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116188427B_ABST
    Figure CN116188427B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of method, device, equipment and storage medium for detecting small target appearance defect, the method comprises: by model training, the deep learning model capable of identifying the small target appearance defect of product is obtained;Acquire the AOI detection image of product;AOI detection image is input into the deep learning model and is detected, the position where small target appearance defect is located is positioned, the defect region is framed out, and after identifying the type of small target appearance defect, output detection result image;After the detection result image is binarized and processed, within limit control and multi-point control are carried out.The present application, by deep learning model, can improve the detection speed of small target appearance defect, and keep good detection accuracy;By within limit control and multi-point control to binarized image, can reduce the overkill rate to acceptable range, realize the replacement of manpower to full-automatic AOI detection, greatly reduce detection cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automatic optical inspection technology, and relates to a method, apparatus, equipment and storage medium for detecting appearance defects of small targets. Background Technology

[0002] Most appearance defects in industrial products are small-target defects, meaning the size of the defect is very small compared to the original image size of the product, and the background of the product image is usually quite complex. Compared to appearance defects of regular size, small-target defects typically lack sufficient appearance feature information and are easily obscured by other objects in the image or even by the image background. AOI (Automated Optical Inspection) equipment struggles to distinguish these defects from the background or similar targets, resulting in poor detection accuracy and a high false detection rate. Therefore, there is an urgent need to address the problem of low accuracy in detecting small-target appearance defects using existing AOI equipment, which fails to meet the application requirements in the industrial field. Summary of the Invention

[0003] In view of the shortcomings of the prior art, the technical problem to be solved by the present invention is to provide a method, apparatus, device and storage medium for detecting appearance defects of small targets.

[0004] To achieve the above objectives, the present invention provides the following technical solution:

[0005] A method for detecting appearance defects in small targets includes the following steps:

[0006] S100: A deep learning model capable of identifying small-scale appearance defects in products is obtained through model training.

[0007] S200, Obtain the AOI inspection image of the product;

[0008] S300. Input the AOI detection image into the deep learning model for detection, locate the position of the small target appearance defect, outline the defect area, identify the type of small target appearance defect, and output the detection result image.

[0009] S400. The defects outlined in the detection result image are binarized to obtain a binarized image;

[0010] S500 performs limit control and multi-point control on binarized images.

[0011] Furthermore, step S100 includes the following sub-steps:

[0012] S110. Determine the deep learning framework;

[0013] S120. Obtain a large number of images of products with small target appearance defects as training input images, and draw the defect area on the training input images.

[0014] S130. Reclassify the types of small target appearance defects based on the features and locations of defects in the training input image;

[0015] S140. The detection result image is binarized to obtain a binarized image; the labeled image is then obtained.

[0016] S150. Input the labeled images into the deep learning framework for training to obtain a deep learning model that can identify small target appearance defects of the product.

[0017] Furthermore, in step S120, when acquiring the training input image, the product is divided into multiple components according to its structure, and light sources or combinations of light sources are selected to capture AOI detection images based on the position and shape characteristics of each component and the types of defects that may occur in each component.

[0018] In step S200, when acquiring the AOI detection image of the product, the same light source parameters as when acquiring the training input image are used to take pictures of each component of the product to acquire images of each component of the product.

[0019] Furthermore, in step S130, the reclassification of defect types includes two methods: merging similar defects and splitting defects with the same name. The method of merging similar defects is to merge multiple defect types with similar AO I image features into one defect type. The method of splitting defects with the same name is to split the defect type into multiple defect types according to the difference in AO I image features when multiple appearance defects in the same defect type have obvious differences in AO I image features.

[0020] Furthermore, the deep learning framework employs single-stage detection, Mosai data augmentation, adaptive anchor box computation, adaptive image scaling, and multi-scale detection.

[0021] Furthermore, in step S300, the defects detected in the AO I inspection image are located using rectangular boxes, and the defect type and confidence level of each defect are identified and marked to obtain the inspection result image.

[0022] A confidence threshold is preset for each defect type. When performing step S400, defects in the detection result image with a confidence level less than the corresponding confidence threshold are first discarded, and then the remaining defects are binarized.

[0023] Furthermore, defect types are classified and merged according to their shape to obtain defect categories. Before implementing limit control and multi-point control, the defect categories are obtained based on the identified defect types, and each component of the product is divided into at least one grade zone, and the control parameters for each defect category in each grade zone are determined.

[0024] Furthermore, the major categories of defects include point defects, linear defects, and surface defects; the control parameters for point defects and surface defects include area, and the control parameters for linear defects include length and / or contrast.

[0025] Furthermore, the method for control within the specified limits is as follows:

[0026] First, set the within-limit and / or outside-limit standards for the control parameters of each defect category. If the value of the control parameter for each defect in the defect category is less than or equal to the within-limit standard, it is judged as OK, and / or

[0027] If the value of the control parameter of a defect in a defect category is greater than the limit standard, it is judged as NG.

[0028] Furthermore, the method for multi-point control is as follows:

[0029] The control parameters for each defect category in each level zone are divided into at least one multi-point control interval based on their values, and a point threshold is set for each multi-point control interval. If the number of defects within a multi-point control interval exceeds the corresponding point threshold, it is judged as NG, or...

[0030] Further judgment will be made through limited control and / or multi-point control;

[0031] If the number of defects within a multi-point control zone is less than or equal to the corresponding point threshold, it is considered OK.

[0032] Further judgment will be made through limited control and / or multi-point control.

[0033] A device for detecting appearance defects in small targets, comprising:

[0034] The model training module is used to acquire labeled images of aluminum shells with preset defect types, and input the labeled images into the deep learning framework for training to obtain a deep learning model.

[0035] The image acquisition module is used to acquire AOI detection images of each component of the product and send them to the deep learning model;

[0036] A deep learning model is used to detect input AOI (Area of ​​Interest) images, locate possible defects within the AOI images, outline defect regions, identify defect types, and output the detection result image; and

[0037] The post-processing module is used to binarize the detection result image to obtain a binarized image, and to perform limit control and multi-point control through the binarized image.

[0038] A device for detecting appearance defects of small targets includes: a processor coupled to a memory, the memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the device for detecting appearance defects of small targets to implement a method for detecting appearance defects of small targets.

[0039] A computer-readable storage medium having a computer program stored thereon, which, when loaded and executed by a processor, implements a method for detecting appearance defects of small targets.

[0040] In this invention, multiple light sources are used to capture images from multiple angles, which can more clearly outline the morphological features of defects. Defined defects are reclassified based on image feature details and their location, ensuring consistent defect features within the same defect type in AOI inspection images and differentiating defect features between different defect types. This improves the detection speed of AOI equipment for small target appearance defects while maintaining good detection accuracy and significantly reducing the false detection rate. By implementing limit-based and multi-point control over the binarized images, the over-detection rate (the actual workpiece is OK, but visual inspection judges it as NG, which is called over-detection; the over-detection rate is the number of incorrectly judged NG divided by the total number of inspections) can be reduced to an acceptable range, realizing the replacement of manual inspection by AOI inspection and greatly reducing inspection costs. Attached Figure Description

[0041] The accompanying drawings, which are included to provide a further understanding of this application and form an integral part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0042] Figure 1 This is a flowchart of a preferred embodiment of the method for detecting appearance defects of small targets according to the present invention.

[0043] Figure 2 This is a flowchart for training a deep learning model.

[0044] Figure 3 This is a schematic diagram for controlling point defects on a large surface.

[0045] Figure 4 This is a structural block diagram of a preferred embodiment of the device for detecting appearance defects of small targets according to the present invention. Detailed Implementation

[0046] The following specific examples illustrate the implementation of the present invention. The illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0047] like Figure 1 As shown, a preferred embodiment of the method for detecting appearance defects of small targets according to the present invention includes the following steps:

[0048] S100, a deep learning model capable of identifying small-scale appearance defects in products is obtained through model training. For example... Figure 2 As shown, the process of training a deep learning model may include the following sub-steps:

[0049] S110. Determine the deep learning framework. Before starting deep learning, it is necessary to determine a suitable deep learning framework. Choosing a suitable framework can achieve twice the result with half the effort. In this embodiment, the deep learning framework may employ techniques such as single-stage detection, Mosaic data augmentation, adaptive anchor box calculation, adaptive image scaling, and multi-scale detection. Single-stage detection treats detection as a regression problem, integrating target location prediction and class probability prediction into a single neural network, enabling end-to-end training and improving detection speed in practical applications. Mosaic data augmentation randomly scales, crops, and arranges the input before stitching it together, enriching the detection dataset, especially by adding many small targets, making the network structure more robust and improving the detection effect of small targets. Adaptive anchor box calculation obtains predicted boxes based on initial anchor boxes, compares them with the true boxes, calculates the difference, updates in reverse, iteratively updates the network structure parameters, and obtains the optimal anchor box value, improving detection speed while shortening training time. Multiple detection heads (three detection heads are used in this embodiment) are used, each detecting on three different scale feature maps, enabling the detection of targets at different scales. The three feature map scales can be (80,80), (40,40), and (20,20), respectively. The larger the feature map scale, the stronger the ability to detect small targets. By using multi-scale detection, the detection effect of small targets is improved.

[0050] S120. Acquire a large number of images of products with small-target appearance defects as training input images, and outline the defect areas on the training input images. When acquiring training input images, the product can be divided into multiple components based on its structure. For each component, appropriate light sources or combinations of light sources can be selected to capture images of all possible defect types to obtain AOI inspection images. For example, for three-dimensional shell products (such as aluminum display shells), the shell can be divided into multiple components such as large surfaces, long sides, short sides, retaining walls, pivot end faces, inner cavity surfaces, rotary-cut edges, pivot cylinders, and R-angles, so that the corresponding light source can be selected according to the position and shape characteristics of each component. During shooting, large surfaces can be captured using area array lighting; long sides, short sides, and retaining walls can be captured using positive stripe lighting; pivot end faces and inner cavity surfaces can be captured using area array lighting; R-angles can be captured using two-sided stripe lighting; rotary-cut edges can be captured using oblique stripe lighting; and pivot cylinders can be captured using short stripe lighting.

[0051] S130. Based on the features and locations of defects in the training input image, the types of small target appearance defects are reclassified to facilitate better differentiation of defect types during AOI image detection, ensuring consistency in the identified defect types. Since the current defect classification is based on features easily distinguishable by the human eye, and the features in the AOI image differ from those recognized by the human eye, it is necessary to reclassify the defect types based on the discriminative power of the features in the AOI image. Reclassification of defect types includes two methods: merging similar defects and segmenting defects with the same name.

[0052] The method for merging similar defects is as follows: multiple defect types with similar AOI image features are merged into one defect type; that is, two or more defect types that are currently classified as different defect types but are difficult to distinguish during AOI inspection are merged. For example, when observing the defect features of the AOI inspection image, it is found that the defined burr defect of the rotating cylinder is similar to the dent in the image features, so the burr and dent of the rotating cylinder are merged into the dent; the defined large-area acid dripping defect is similar to the discoloration defect in the image features, so the large-area acid dripping defect and discoloration defect are merged into the discoloration defect.

[0053] The method for segmenting defects with the same name is as follows: When multiple appearance defects of the same defect type have obvious differences in AOI image features, the defect type is segmented into multiple defect types according to the differences in AOI image features; that is, defect types that are currently classified as the same defect type but are not easily identified as the same type during AOI inspection are split. For example: among the defined large-area discoloration defects, there is a black discoloration with image features that are wavy or flocculent, which is significantly different from the morphology of other discolorations. Therefore, this defect is separated from the discoloration defects and defined as a flow mark defect; among the defined large-area scratch defects, there is a scratch that appears differently from other scratches under the same light source. In images taken under light sources where other scratch defects can be clearly seen, this scratch is almost invisible. Therefore, this defect is separated from the scratch defects and defined as a soft scratch defect, and is photographed using a different light source.

[0054] For example, after optimizing the existing defect types using the above method, the defect types for large surfaces can include dents, scratches, white spots, corrosion spots, black spots, black lines, bright marks, flow marks, watermarks, discoloration, soft scratches, and fuzz; the defect types for long sides, short sides, and retaining walls can include dents, scratches, white spots, tool lines, corrosion spots, burn marks from fixtures, bright marks, fuzz, sand marks, watermarks, collapsed edges, discoloration, and vibration marks; the defect types for the shaft end face can include dents, scratches, and collapsed edges; the defect types for the inner cavity surface can include dents, scratches, tool lines, collapsed edges, white spots, bright marks, overmilling, black spots, and orange peel; the defect types for the R-angle can include dents, scratches, collapsed edges, and vibration marks; the defect types for the rotary-cut edge can include dents, scratches, tool lines, and collapsed edges; and the defect types for the shaft cylinder can include dents, scratches, and vibration marks.

[0055] Based on the reclassified defect types, the shooting light sources for each component of the product need to be adjusted accordingly when acquiring training input images. For example: For large surfaces, two shots can be taken sequentially using area array lighting (for shooting defects other than soft scratches) and area array lighting plus low-angle strip lighting (for shooting soft scratches). For long sides, short sides, and retaining wall edges, three shots can be taken sequentially using positive strip lighting (for shooting defects other than vibrating knife marks, knife lines, retaining wall dark lines, and burnt fixtures), vertical strip lighting (for shooting vibrating knife marks), and diagonal strip lighting (for shooting knife lines, retaining wall dark lines, and burnt fixtures). For the hinge end face and inner cavity surface, only area array lighting (for all defects on the hinge end face and inner cavity surface) can be used for shooting. For R-angles, three shots can be taken sequentially using two side strip lights (for shooting defects other than vibrating knife marks), left strip light, and right strip light (left and right strip lights are taken separately to shoot vibrating knife marks). For counter-rotating edge cutting, two separate shots can be taken, one using oblique light (for capturing defects other than collapsed edges) and the other using coaxial light (for capturing collapsed edges). For rotating cylinders, only short light (for capturing all defects on the rotating cylinder) can be used. By reclassifying defect types and selecting appropriate light sources based on defect location and type, the accuracy of small target appearance defect identification during AOI image inspection can be significantly improved.

[0056] S140. The defects in the training input image are labeled according to the reclassified defect types to obtain labeled images.

[0057] S150. Input the labeled images into the deep learning framework for training to obtain a deep learning model that can identify small target appearance defects of the product.

[0058] S200. Acquire AOI detection images of each component of the product under the same light source parameters as the training input image to obtain the AOI detection image of the product. When acquiring the AOI detection image of the product, using the same light source parameters as when acquiring the training input image to photograph each component of the product ensures the accuracy of the detection.

[0059] S300: Input the AOI detection image into the deep learning model for detection, locate the position of the small target appearance defect, outline the defect area, identify the type of small target appearance defect, and output the detection result image. The detection result image includes the outlined defect area and the defect type of each defect; of course, in order to reflect the accuracy of the detection result, in this embodiment, the defects detected in the AOI detection image are marked with rectangular boxes, and the defect type and confidence level of each defect are identified and marked to obtain the detection result image; the method for calculating the confidence level in the deep learning model can also be obtained through model training in step S100, and the specific method is existing technology, which will not be described in detail here.

[0060] S400. The detection result image with the defect area outlined is binarized to obtain a binarized image. Of course, when the detection result image includes the confidence level of the defect, a confidence threshold for each defect type can be preset. When performing this step, defects with a confidence level less than the corresponding confidence threshold in the detection result image are first discarded, and then the detection result image including the remaining defects is binarized.

[0061] S500 performs limit control and multi-point control on the binarized image. Then, the product's qualification can be determined based on the results of the limit control and multi-point control.

[0062] Defect types are classified and merged according to their shape to obtain major defect categories. Before implementing limit control and multi-point control, the major defect categories are first obtained based on the identified defect types. These major defect categories can include point defects, linear defects, and surface defects. Each component of the product is divided into at least one grade zone according to the importance of each area in its appearance, and control parameters for each major defect category in each grade zone are determined. When the importance of different areas of a product component in its appearance is similar, the component can be considered as a single grade zone; if the importance of different areas of a product component in its appearance differs significantly, the component can be divided into two or more grade zones. The control parameters for point defects and surface defects can be area, and the control parameters for linear defects can be length and contrast. For example, point defects such as white spots, black spots, and corrosion spots, and surface defects such as dents, scratches, and watermarks, must have an area greater than a preset area standard to be considered NG (Not Acceptable). Linear defects such as black lines must have both length and blackness exceeding preset standards to be considered NG.

[0063] The method for dividing the grade zones is as follows:

[0064] Because product photography involves stitching together images of each component taken by multiple cameras, with each area captured by a camera considered a sub-region of the image, if a particular component was captured by three cameras in four shots, then the image of that component would comprise 12 sub-regions. These sub-regions are then ranked according to their importance in the visual presentation, and sub-regions of the same rank are merged into a single rank zone. Alternatively, other methods can be used to divide a component of the product into at least one rank zone based on its importance in the visual presentation.

[0065] The method for control within the specified limits is as follows:

[0066] Pre-set the lower and / or upper limits of the control parameters for each defect category. The lower and upper limits for different grade areas of the same component of the product will differ to reflect the importance of each grade area. If the value of the control parameter for each defect in a defect category is less than or equal to the lower limit, it is considered OK; and / or if the value of the control parameter for any defect in a defect category is greater than the upper limit, it is considered NG. That is, within-limit control can be implemented using only the lower or upper limit, or both.

[0067] When areas exist outside the lower and upper limits of the acceptable limit, and control within the limit fails to yield a judgment, further judgment through multi-point control is required. For example, if the control parameters for a defect are all less than or equal to the upper limit, and the control parameters for a defect are greater than the lower limit, a judgment cannot be made temporarily, and further judgment through multi-point control is necessary. The method for multi-point control is as follows:

[0068] The control parameters for each defect category in each level zone are divided into at least one multi-point control interval based on their values, and a point threshold is set for each multi-point control interval. If the number of defects within a multi-point control interval exceeds the corresponding point threshold, it can be directly judged as NG. Of course, at this time, no judgment can be made initially, and further subdivision can be carried out through limit control and / or multi-point control before judgment is made, until an OK or NG judgment result is obtained. If the number of defects within a multi-point control interval is less than or equal to the corresponding point threshold, it can be directly judged as OK. Of course, further judgment can also be carried out through limit control and / or multi-point control.

[0069] The following example illustrates the process of controlling point defects (including all point-like forms such as white spots, black spots, and corrosion spots) on the large surface of an aluminum casing, demonstrating the control within limits and the control of multiple points.

[0070] like Figure 3 As shown, the large surface is first divided into two levels of zones: AA zone (high importance) and A zone (or non-AA zone, moderate importance) according to the importance of each area in the appearance display, and the two levels of zones are controlled separately; the control parameter is area.

[0071] For defects in the AA area, the lower limit standard is predetermined to be an area less than or equal to 0.02 mm. 2 The upper limit standard within the limit is an area greater than 0.08 mm. 2 First, control is implemented within limits. The area of ​​all point defects in area AA is less than or equal to 0.02 mm. 2 If at least one point defect in area AA has an area greater than 0.08 mm, it is considered OK. 2 If the area of ​​all point defects in area AA is less than or equal to 0.08 mm, it is considered NG. 2 And at least one point defect has an area greater than 0.02 mm. 2 If the limited control measures cannot determine the result, then multi-point control measures should be used to make a further determination.

[0072] Areas larger than 0.02 mm 2 And less than or equal to 0.08mm 2 Point defects are classified as having an area greater than 0.05 mm. 2 and areas less than or equal to 0.05 mm 2 Two multi-point control zones are controlled separately. Areas larger than 0.05mm are set. 2 The threshold for the number of points in a region is 1, meaning that point defects in region AA with an area greater than 0.05 mm are considered to be present. 2 And less than 0.08mm 2 If the number of point defects is less than or equal to 1, it is judged as OK; if it is greater than 1, it is judged as NG.

[0073] Set the area to be less than or equal to 0.05mm 2 The threshold for the number of points in a region is 2, meaning that point defects in region AA with an area less than or equal to 0.05 mm are considered to be present. 2 And greater than 0.02mm 2 If the number of point defects is less than or equal to 2, it is considered OK; if it is greater than 2, it is considered NG. In this case, if there is one point defect with an area greater than 0.05 mm... 2 And less than 0.08mm 2 For point-like defects, those with an area less than or equal to 0.05 mm can also be included. 2 And greater than 0.02mm 2 The number of defects is calculated together with the area of ​​point defects. That is, when area AA has one point defect with an area greater than 0.05 mm... 2And less than 0.08mm 2 Point defects, two defects with an area less than or equal to 0.05 mm 2 And greater than 0.02mm 2 For point defects, when the area is less than or equal to 0.05 mm 2 The multi-point control zone will count 3 point defects, and thus determine it as NG.

[0074] For defects in area A, the predetermined lower limit standard is an area less than or equal to 0.08 mm. 2 The upper limit standard within the limit is an area greater than 0.2 mm. 2 First, implement limit control: when the area of ​​all point defects in area A is less than or equal to 0.08 mm. 2 If at least one point defect in area A has an area greater than 0.2 mm, it is considered OK. 2 If the area of ​​all point defects in region A is less than or equal to 0.2 mm, it is considered NG. 2 And at least one point defect has an area greater than 0.08 mm. 2 If the limited control measures cannot determine the result, then multi-point control measures should be used to make a further determination.

[0075] Areas larger than 0.08 mm 2 And less than or equal to 0.2mm 2 Point defects are initially managed as a single multi-point control zone. A point threshold of 4 is set; if the area of ​​a point defect in zone A is greater than 0.08 mm... 2 And less than or equal to 0.2mm 2 If the number of defects is greater than 4, it is judged as NG; if it is less than or equal to 4, it is judged after further subdivision using limit control and multi-point control.

[0076] At this point, limit-based control can be adopted first, and the lower limit standard within the limit can be redefined as an area less than or equal to 0.10 mm. 2 When the area is greater than 0.08 mm 2 And less than or equal to 0.2mm 2 The area of ​​all point defects is less than or equal to 0.10 mm. 2 When the area of ​​region A is greater than 0.08 mm, it is considered OK. 2 And less than or equal to 0.10 mm 2 Among the point-like defects, there are those with an area greater than 0.10 mm. 2 When point defects are found, multi-point control should continue to be adopted.

[0077] Areas larger than 0.10 mm 2 And less than or equal to 0.2mm 2Point defects are managed as a whole as a multi-point control zone, with a point count threshold of 1. When the area of ​​a point defect in zone A is greater than 0.10 mm... 2 And less than or equal to 0.2mm 2 If the number of defects is less than or equal to 1, it is judged as OK; if it is greater than 1, it is judged as NG. Through the above process, the control of point defects on a large surface is completed.

[0078] In this embodiment, AOI equipment can be used to offline acquire labeled images of the aluminum shell, and LabelImg software is used to label the labeled images. These labeled images are then used for model training. The AOI equipment performs image detection on the aluminum shell. After the aluminum shell enters the AOI equipment, the AOI equipment sequentially takes pictures of different positions on the aluminum shell using corresponding light sources according to a preset program. The obtained images are used to locate the Region of Interest (ROI), resulting in images of each position on the aluminum shell. These images are then input into a trained deep learning model for detection, and the detection result image is output. The detection result image is then binarized to obtain a binarized image of the defects within the bounding box. Using this binarized image, each defect category of each component of the product is subject to limit control and multi-point control. Images where all defects meet both limit control and multi-point control are judged as OK images (i.e., the product is qualified), while images with defects that do not meet these standards are judged as NG images (i.e., the product is unqualified). The AOI detection method for small target appearance defects in this embodiment can be implemented in a computer device. The AOI equipment and the computer device can be interconnected via a MySQL database and HTTPS protocol.

[0079] In this embodiment, during image capture, multiple light sources are used for multi-angle shooting, which can more clearly outline the morphological features of defects. Defect types are redefined, and existing defects defined in the production process are reclassified based on image feature details and their location. This ensures that defect features within the same defect type are consistent in AOI inspection images, and that defect features of different defect types are distinguishable. This improves the detection speed of AOI equipment for small target appearance defects while maintaining good detection accuracy and significantly reducing the false detection rate. By implementing limit-based and multi-point control of the binarized image, the over-detection rate can be reduced to an acceptable range, achieving fully automated AOI inspection that replaces manual labor and significantly reduces inspection costs.

[0080] like Figure 4 As shown, the present invention also discloses an apparatus for detecting appearance defects of small targets. A preferred embodiment of the apparatus for detecting appearance defects of small targets includes a model training module, an image acquisition module, a deep learning model, and a post-processing module.

[0081] The model training module is used to acquire labeled images of aluminum shells with preset defect types, and input the labeled images into a deep learning framework for training to obtain a deep learning model.

[0082] The image acquisition module is used to acquire AOI detection images of each component of the product and send them to the deep learning model.

[0083] The deep learning model is used to detect input AOI detection images, locate possible defect locations in the AOI detection images, outline defect areas, identify defect types, and output detection result images.

[0084] The post-processing module is used to binarize the detection result image that outlines the defect area to obtain a binarized image, and then use the binarized image for limit control and multi-point control.

[0085] It is understood that the model training module can be used to execute step S100 in the embodiment, the image acquisition module can be used to execute step S200 in the embodiment, the deep learning model can be used to execute step S300 in the embodiment, and the post-processing model can be used to execute steps S400 and S500 in the embodiment. Those skilled in the art should understand that the above modules or steps can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by the computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. This invention is not limited to any specific hardware and software combination.

[0086] The present invention also discloses a device for detecting appearance defects of small targets. A preferred embodiment of the device for detecting appearance defects of small targets includes a processor coupled to a memory. The memory stores at least one program instruction or code, which is loaded and executed by the processor to enable the device for detecting appearance defects of small targets to implement the method for detecting appearance defects of small targets in any of the above embodiments.

[0087] In this embodiment, the processor may be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to execute the methods in the above embodiments. The methods implemented when the computer program running on the processor is executed can be referred to the specific embodiments of the methods provided in the foregoing embodiments of this invention, and will not be repeated here.

[0088] The present invention also discloses a computer-readable storage medium, a preferred embodiment of which stores a computer program that, when loaded and executed by a processor, implements the method for detecting appearance defects of small targets according to any of the above embodiments.

[0089] In this embodiment, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The details of the method are described in the foregoing embodiments and will not be repeated here.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting appearance defects in small targets, characterized in that, Includes the following steps: S100. A deep learning model capable of identifying small-scale appearance defects in products is obtained through model training. This step includes the following sub-steps: S110. Determine the deep learning framework; S120. Acquire a large number of images of products with small target appearance defects as training input images, and outline the defect areas on the training input images; when acquiring training input images, divide the product into multiple components according to the product structure, and select light sources or combinations of light sources to take pictures according to the position and shape characteristics of each component and the types of defects that may be generated in each component to obtain AOI detection images. S130. Reclassify the types of small target appearance defects based on the features and locations of defects in the training input image; S140. The defects in the training input image are labeled according to the reclassified defect types to obtain labeled images; S150. Input the labeled images into the deep learning framework for training to obtain a deep learning model that can identify small target appearance defects of the product. S200. Acquire AOI detection images of the product; When acquiring AOI detection images of the product, use the same light source parameters as when acquiring training input images to take pictures of each component of the product separately, and acquire images of each component of the product. S300. Input the AOI detection image into the deep learning model for detection, locate the position of the small target appearance defect, outline the defect area, identify the type of small target appearance defect, and output the detection result image. S400. The detection result image is binarized to obtain a binarized image; S500 performs limit control and multi-point control on binarized images.

2. The method for detecting appearance defects of small targets according to claim 1, characterized in that: In step S130, the reclassification of defect types includes two methods: merging similar defects and splitting defects with the same name. The method of merging similar defects is to merge multiple defect types with similar AOI image features into one defect type. The method of splitting defects with the same name is to split the defect type into multiple defect types according to the difference in AOI image features when multiple appearance defects in the same defect type have obvious differences in AOI image features.

3. The method for detecting appearance defects of small targets according to claim 1, characterized in that: The deep learning framework employs single-stage detection, Mosaic data augmentation, adaptive anchor box calculation, adaptive image scaling, and multi-scale detection.

4. The method for detecting appearance defects of small targets according to claim 1, characterized in that: In step S300, the defects detected in the AOI inspection image are located using rectangular boxes, and the defect type and confidence level of each defect are identified and marked to obtain the inspection result image. A confidence threshold is preset for each defect type. When performing step S400, defects in the detection result image with a confidence level less than the corresponding confidence threshold are first discarded, and then the remaining defects are binarized.

5. The method for detecting appearance defects of small targets according to any one of claims 1-4, characterized in that: Defect types are classified and merged according to their shape to obtain major defect categories. Before implementing limit control and multi-point control, the major defect categories are obtained based on the identified defect types, and each component of the product is divided into at least one level zone. The control parameters for each major defect category in each level zone are then determined.

6. The method for detecting appearance defects of small targets according to claim 5, characterized in that: The defect categories include point defects, linear defects, and surface defects; the control parameters for point defects and surface defects include area, and the control parameters for linear defects include length and / or contrast.

7. The method for detecting appearance defects of small targets according to claim 6, characterized in that, The method for control within the specified limits is as follows: First, set the within-limit and / or outside-limit standards for the control parameters of each defect category. If the value of the control parameter for each defect in the defect category is less than or equal to the within-limit standard, it is judged as OK, and / or If the value of the control parameter of a defect in a defect category is greater than the limit standard, it is judged as NG.

8. The method for detecting appearance defects of small targets according to claim 7, characterized in that, The method for multi-point control is as follows: The control parameters for each defect category in each level zone are divided into at least one multi-point control interval based on their values, and a point threshold is set for each multi-point control interval. If the number of defects within a multi-point control interval exceeds the corresponding point threshold, it is judged as NG, or... Further judgment will be made through limited control and / or multi-point control; If the number of defects within a multi-point control zone is less than or equal to the corresponding point threshold, it is considered OK. Further judgment will be made through limited control and / or multi-point control.

9. A device for detecting appearance defects of small targets, characterized in that: include The model training module is used to acquire labeled images of aluminum shells with preset defect types, and input the labeled images into the deep learning framework for training to obtain a deep learning model. An image acquisition module is used to acquire AOI detection images of each component of the product and send them to the deep learning model. When acquiring AOI detection images of the product, the image acquisition module uses the same light source parameters as when acquiring training input images to take pictures of each component of the product. A deep learning model is used to detect input AOI detection images, locate possible defect locations in the AOI detection images, outline defect areas, identify defect types, and output detection result images. as well as The post-processing module is used to binarize the detection result image to obtain a binarized image, and to perform limit control and multi-point control through the binarized image; The deep learning model is trained through the model training module, which includes the following sub-steps: S110. Determine the deep learning framework; S120. Acquire a large number of images of products with small target appearance defects as training input images, and outline the defect areas on the training input images; when acquiring training input images, divide the product into multiple components according to the product structure, and select light sources or combinations of light sources to take pictures according to the position and shape characteristics of each component and the types of defects that may be generated in each component to obtain AOI detection images. S130. Reclassify the types of small target appearance defects based on the features and locations of defects in the training input image; S140. The defects in the training input image are labeled according to the reclassified defect types to obtain labeled images; S150. Input the labeled images into the deep learning framework for training to obtain a deep learning model that can identify small target appearance defects of the product.

10. A device for detecting appearance defects in small targets, characterized in that, include: A processor coupled to a memory storing at least one program instruction or code, the at least one program instruction or code being loaded and executed by the processor to enable the device for detecting small target appearance defects to implement the method for detecting small target appearance defects as described in any one of claims 1-8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is loaded and executed by the processor, it implements the method for detecting appearance defects of small targets as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Glass surface defect detection method based on deep learning

    CN111652883A

  • AOI detection image processing method and device, storage medium and computer equipment

    CN113591965A