Deep learning defect detection method and system for MLCC
By designing the ADS-YOLO model for MLCC, combining specific architectures and structures, the contradiction between MLCCs detection accuracy and speed in the existing technology is solved, efficient and accurate defect detection is achieved, and the needs of industrial real-time detection are met.
Patent Information
- Application Number
- CN202411490417.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The existing deep learning-based object detection methods have contradictions in detection accuracy and speed in MLCCs detection, which cannot meet the needs of industrial real-time detection.
A deep learning defect detection method for MLCC was designed, using the ADS-YOLO model, combining the CSP-Dsrknet53 architecture, A2PAN structure and bilateral residual structure, and using the SSIL loss function to optimize the model.
It improves the detection accuracy and speed of the object detection algorithm, simplifies the network structure, reduces the number of model parameters, improves the positioning accuracy and inference efficiency of the model, and meets the requirements of real-time detection.
Smart Images

Figure CN119444692A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision image processing, and more specifically, to a deep learning defect detection method and system for MLCC. Background Art
[0002] As one of the common components in electronic circuits, SMD multilayer ceramic capacitors (MLCCs) are responsible for energy storage and filtering and are widely used in various electronic devices. Due to the complexity of the process and the characteristics of the materials, different defects may appear on the surface of the later products. These surface defects may directly affect the performance and reliability of the capacitors. Therefore, in the production process of SMD multilayer ceramic capacitors, it is very important to realize accurate and efficient automatic detection of MLCC surface defects, which has become a crucial link to ensure its production quality.
[0003] In recent years, deep learning has gradually become a research hotspot due to its powerful feature learning and pattern recognition capabilities. Many scholars have conducted in-depth research on computer vision detection based on deep learning, especially in the field of target detection. These methods effectively reduce the subjectivity and human errors associated with traditional methods and improve detection efficiency. However, the target detection method based on deep learning still has certain limitations and cannot meet the detection needs of MLCCs:
[0004] (1) The model structure with relatively high detection accuracy is too complex, with high hardware requirements and slow real-time detection speed, which is not suitable for industrial quality control scenarios with high-speed real-time detection;
[0005] (2) Although lightweight models with high portability meet the requirements in terms of detection speed, they have low detection accuracy for complex defects and poor model generalization performance;
[0006] (3) The defect detection method based on generative network needs to rely on a large amount of high-quality data sets to ensure the stability of the model, so it is not very suitable for industrial inspection scenarios where defect samples are difficult to collect. Summary of the invention
[0007] In view of the deficiencies in the prior art, the object of the present invention is to provide a deep learning defect detection method and system for MLCC to solve the above problems.
[0008] The above technical objectives of the present invention are achieved through the following technical solutions: a deep learning defect detection method for MLCC, comprising the following steps:
[0009] S1. Build an image defect detection system to collect and filter images and generate defect data sets;
[0010] S2. Build an ADS-YOLO model, input the defect data set into the ADS-YOLO model for training, and evaluate and save the optimal weight;
[0011] S3. Use the ADS-YOLO model with the optimal weights to perform target detection on the test samples and output the detection results.
[0012] In one embodiment, the S1 further comprises the following steps:
[0013] S11, fixing a fixture, placing a camera and a ring light source on the fixture, wherein the camera is connected to a lens, and a rotating platform is installed below the lens, and a laser sensor is placed on one side of the rotating platform and electrically connected to the camera, which is recorded as an image acquisition unit;
[0014] S12, installing a computer, a rotating platform controller and a light source controller, so that the computer is electrically connected to the camera, the rotating platform controller is electrically connected to the rotating platform, and the light source controller is electrically connected to the annular light source, which is recorded as a control imaging unit.
[0015] In one embodiment, the S2 further comprises the following steps:
[0016] S21. Design the Backbone module using the CSP-Dsrknet53 architecture to extract deep features;
[0017] S22, the Neck module is designed using the A2PAN structure, and self-attention mechanism and deep convolution are introduced for bidirectional multi-level fusion;
[0018] S23, introduce bilateral residual structure to optimize the Head module;
[0019] S24. Design a loss function SSIL to optimize the ADS-YOLO model.
[0020] In one embodiment, the S21 further includes the following steps: inputting the image into the Backbone module, sequentially down-sampling layer by layer using the CBS module consisting of convolution, batch normalization and silu activation function, and after sampling, the C2f module performs feature fusion and sorting.
[0021] In one embodiment, the S22 comprises the following steps:
[0022] S221, bottom-up fusion: introduce the CSP-SA module with self-attention mechanism to optimize deep feature expression;
[0023] S222, top-down fusion: downsampling is performed using deep convolution to reduce overfitting of the ADS-YOLO model.
[0024] In one embodiment, the S221 is specifically:
[0025] Input X, first pass through the convolution module to obtain the feature map T, then split into T' and Y0 through the segmentation operation, Y0 passes through the recursive operation of the Bottleneck module i times and outputs Y i , T' is combined with Y through the Concat operation i After concatenation, the output result Y of the CSP-SA module is obtained through the convolution module, which is expressed as:
[0026] Y i = Bottleneck(Y i-1 )
[0027] Y=CBS 1×1 (Concat(T',Y0,Y1,...,Y n ))
[0028] Where i=1,2,...,n.
[0029] In one embodiment, the operation steps of the Bottleneck module are:
[0030] Use convolutional modules to connect multi-head self-attention modules;
[0031] In the multi-head self-attention module, 1×1 convolution is used to map to h groups of Q, K and V matrices, where h is the number of heads;
[0032] Then the content attention score is obtained by the dot product of Q and K;
[0033] Add relative position encoding and obtain the position attention score through the dot product with Q;
[0034] The content attention score and the position attention score are added to obtain the total attention weight, which is expressed as:
[0035]
[0036] Among them, R w and R h are the hyperparameters to be learned, which represent the relative position relationship of the feature map in the height and width dimensions respectively;
[0037] The total attention weight is obtained by softmax operation to obtain the complete attention weight, and multiplied by V to obtain the output x out , expressed as:
[0038] x out =Vsoftmax(score)
[0039] The output of the Bottleneck module is expressed as:
[0040] Y i =MHSA(Conv 1×1 (Y i-1 )).
[0041] In one embodiment, the S23 comprises the following steps:
[0042] Input feature map X, perform 1×1 convolution module and 3×3 convolution module operations in parallel, and generate regression feature maps F respectively. r (X) and classification feature map F c (X);
[0043] In the regression path, the feature map F r (X) After a residual module R r And a 1×1 independent convolution to obtain the regression output B, expressed as:
[0044] B=Conv 1×1 (R r (F r (X))+F r (X)
[0045] The classification output C of the other branch is expressed as:
[0046] C=Conv 1×1 (R r (F c (X))+F c (X)
[0047] The regression output B converts the anchor point into a bounding box through a regression function, and the classification output C is activated by softmax and then concatenated to obtain the detection result.
[0048] In one embodiment, the S24 comprises the following steps:
[0049] The loss function SSIL includes a loss function SIOU and a loss function sDFL;
[0050] The loss function SIOU is used to optimize the metric of the intersection-over-union ratio between the true label box and the predicted target box, expressed as:
[0051]
[0052] Among them, IoU represents the intersection-over-union ratio of the real label box and the predicted target box, ρ represents the distance between the center points of the two, c is the diagonal length of the minimum rectangle surrounding the predicted box and the target box, λ is a balancing parameter used to adjust the penalty term ν of the target box shape, and Cost Distance and Cost shape The differences in position and shape between the predicted box and the target box are measured respectively, expressed as:
[0053] Cost Distance =2-exp(γρ x )-exp(γρ y )
[0054] Cost shape =(1-exp(-ω w )) 4 +(1-exp(-ω h )) 4
[0055] Among them, ρ x and ρ y Respectively represent the distance ratio between the prediction box and the target box in the horizontal and vertical directions, ω w and ω h Indicates the ratio difference between width and height;
[0056] The loss function sDFL is used to adjust the weights on the left and right boundaries to achieve a smoother loss distribution, expressed as:
[0057]
[0058] Where CE(p,t) represents the cross entropy loss between the predicted distribution p and the target value t, ω l and ω r Respectively represent the weights of the target positions on the left and right, which are adjusted by the scaling factor α, expressed as:
[0059] ω l =α·(r+1-t),ω r =(1-α)·(1-ω l )
[0060] Among them, r is the left neighbor number of the target value t;
[0061] Finally, the loss function SILL is expressed as:
[0062] Loss SSIL =Loss SIOU +Loss sDFL .
[0063] A deep learning defect detection system for MLCC, including a ring light source, a rotating platform, a laser sensor, a camera, a fixture, a rotating platform controller, a light source controller, a computer and a lens;
[0064] Wherein, the camera is arranged on the fixture and is electrically connected to the computer;
[0065] The lens is connected to the camera;
[0066] The rotating platform is disposed below the lens and is electrically connected to the rotating platform controller;
[0067] The annular light source is arranged on the fixture and is electrically connected to the light source controller;
[0068] The laser sensor is arranged corresponding to the rotating platform and is electrically connected to the camera.
[0069] The above-mentioned deep learning defect detection method and system for MLCC has the following beneficial effects:
[0070] First, the deep learning detection network ADS-YOLO for MLCC is designed, which has the advantages of improving the detection accuracy and speed of the target detection algorithm and simplifying the network structure;
[0071] Second, we designed the A2PAN structure to improve the model's attention to complex defects and the relative positions of defects while lightening the network structure. We also designed a residual detection head to effectively reduce the number of model parameters without sacrificing model performance, improve model reasoning efficiency, and design the SSIL loss function to improve the positioning accuracy of the model, so that the model can converge to the optimal solution more quickly.
[0072] Third, an image defect detection system was designed, and a large number of MLCCs images were collected for training and testing to ensure the efficiency and scientificity of data collection and the richness of experimental data. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 Schematic diagram of the steps of the detection method in this embodiment;
[0074] Figure 2 Schematic diagram of the structure of the detection system in this embodiment;
[0075] Figure 3 is a sample schematic diagram of the capacitor defect type in this embodiment;
[0076] Figure 4 Schematic diagram of the structure of the ADS-YOLO network model in this embodiment;
[0077] Figure 5Schematic diagram of the structure of CSP-SA in this embodiment;
[0078] Figure 6 is a schematic diagram of the structure of DRH in this embodiment;
[0079] Figure 7 is a comparison diagram of the effects of different target detection networks in this embodiment;
[0080] Figure 8 This is a data comparison chart of the detection effects of different models on different types of defects in this embodiment.
[0081] In the figure: 1. fixture; 2. camera; 3. ring light source; 4. rotating platform; 5. laser sensor; 6. computer; 7. rotating platform controller; 8. light source controller; 9. lens. DETAILED DESCRIPTION
[0082] The present invention is described in detail below in conjunction with the accompanying drawings and embodiments.
[0083] The hardware configuration of the experiment conducted by the present invention includes an AMD Ryzen 7 5800X 8-core processor; an Nvidia GeForce RTX 4070Ti graphics card with 12g video memory. The software environment is a Windows 10 Professional 64-bit operating system, using the Pytorch framework, Python 3.8.12 as the programming language, CUDA 11.1 as the GPU computing platform, and CUDNN 10.1 deep learning to achieve GPU acceleration. When training the network model, the Adam optimizer is used, the learning rate is 0.001, the batch size is set to 4, and the training epoch is 500.
[0084] Based on the above configuration, this embodiment provides a deep learning defect detection method for MLCC, such as Figure 1 As shown, the following steps are included:
[0085] S1. Build an image defect detection system to collect and filter images and generate defect data sets;
[0086] Among them, Figure 2 As shown, S1 also includes the following steps:
[0087] S11, fix the fixture 1, set the camera 2 and the ring light source 3 on the fixture 1, the camera 2 is connected to the lens 9, and the rotating platform 4 is installed below the lens 9, the laser sensor 5 is placed on one side of the rotating platform 4 and is electrically connected to the camera 2, which is recorded as an image acquisition unit (ISU);
[0088] S12, install the computer 6, the rotating platform controller 7 and the light source controller 8, so that the computer 6 is electrically connected to the camera 2, the rotating platform controller 7 is electrically connected to the rotating platform 4, and the light source controller 8 is electrically connected to the ring light source 3, which is recorded as a control imaging unit (CMU).
[0089] In the image acquisition unit, the annular light source 3 is a 45° annular white light source; the camera 2 is a CMOS camera with 1.6 million pixels and a resolution of 1440*1080, and is used in conjunction with a telecentric lens with a magnification of 1.5, an object distance of 110 mm, and a depth of field of 1.8 mm; the visible red semiconductor laser wavelength of the laser sensor 5 is 660 nm;
[0090] In the control imaging unit, the light source controller 8 sets the intensity of the ring light source 3 to 255; the relevant parameters of the camera 2 are set to the acquisition frame rate of 250fps, the exposure time of 5500us, and the gamma correction magnification of 0.7, and continuous photography is performed in a hard triggering manner; the rotating platform controller 7 sets the rotation speed of the rotating platform 4 to 30r / s;
[0091] The capacitor is placed on the edge of the rotating platform 4 and moves with it. The position of the camera 2, lens 9 and ring light source 3 are adjusted by the fixture 1 and then fixed to ensure clear imaging. When the laser sensor 5 detects the capacitor passing by, it triggers the camera 2 to automatically take pictures. The collected image is transmitted to the computer 6 by the data line for further processing. Controlling the imaging unit can effectively control the image collection effect and further process the collected image data. Thus, a deep learning defect detection system for MLCC is constructed.
[0092] Through this system, a large number of MLCCs images are collected and screened, and the capacitor data that can be used for training and testing are labeled and classified for defects. In this embodiment, a total of 1789 valid defect images were collected, with a resolution of 1440×1080, including 5 types of defects: broken ends, exposed copper ends, deformities, porcelain impurities, and porcelain contamination. Different types of chip defects have different types of color, shape, scale, and texture features. The representative sample images are as follows: Figure 3 As shown, the dataset is divided into training set and test set in a ratio of 9:1.
[0093] The distribution of the number of samples of each category (i.e., MLCCs defect sample data set) is shown in Table 1:
[0094] Defect Type Collapse end Copper end deformity Porcelain impurities Porcelain pollution Training set 493 191 273 166 446 Test Set 191 41 48 25 37 sum 684 232 321 191 483
[0095] Table 1
[0096] S2. Build the ADS-YOLO model, input the defect data set into the ADS-YOLO model for training, evaluate and save the optimal weight;
[0097] Among them, Figure 4 As shown, S2 also includes the following steps:
[0098] S21. Design the Backbone module using the CSP-Dsrknet53 architecture to extract deep features;
[0099] Specifically, S21 is: input the image into the Backbone module, perform downsampling layer by layer in the CBS module composed of convolution, batch normalization and silu activation function, and fuse the features with the C2f module.
[0100] S22. The A2PAN structure is used to design the Neck module, and the self-attention mechanism and deep convolution are introduced for bidirectional multi-level fusion to improve the feature fusion strategy, help the model maintain high-precision detection capabilities when facing complex multi-scale defects, and reduce the number of network parameters.
[0101] Specifically, S221 is: bottom-up fusion, introducing the CSP-SA module with self-attention mechanism to optimize deep feature expression;
[0102] Among them, the structure of the CSP-SA module is as follows Figure 5 As shown in the figure, the input X is first mapped to a higher dimensional space through a 1×1 convolution module to obtain an intermediate feature map T, and then split into T' and Y0 through a segmentation operation. Y0 is recursively operated through the i-th Bottleneck module and outputs Y i , T' is combined with Y through the Concat operation i After concatenation, the output result Y of the CSP-SA module is obtained through a 1×1 convolution module, which is expressed as:
[0103] Y i = Bottleneck(Y i-1 )
[0104] Y=CBS 1×1 (Concat(T',Y0,Y1,...,Y n ))
[0105] Where i=1,2,...,n.
[0106] like Figure 5 As shown, in the Bottleneck module, the running steps are:
[0107] A 1×1 convolutional module is used to connect the residual structure of the multi-head self-attention (MHSA). By using MHSA to calculate the similarity between different positions in the input feature map, the dependencies between long distances can be captured, which is very beneficial for the detection of defect types associated with the generation location.
[0108] In the multi-head self-attention module, 1×1 convolution is used to map to h groups of Q, K and V matrices, where h is the number of heads. In this embodiment, it is set to 4.
[0109] Then the content attention score is obtained by the dot product of Q and K;
[0110] At the same time, by adding relative position encoding, the position attention score of the spatial position relationship is obtained through the dot product with Q;
[0111] The content attention score and the position attention score are added together to obtain the total attention weight score, which is expressed as:
[0112]
[0113] Among them, R w and R h are the hyperparameters to be learned, which represent the relative position relationship of the feature map in the height and width dimensions respectively;
[0114] The total attention weight is obtained by softmax operation, and multiplied by V to obtain the output x out , expressed as:
[0115] x out =Vsoftmax(score)
[0116] The output of the entire Bottleneck module is expressed as:
[0117] Y i =MHSA(Conv 1×1 (Y i-1 )).
[0118] Specifically, S222 is: top-down fusion, using deep convolution (DCBS) for downsampling, the convolution kernel of the deep convolution only operates independently on each input channel, so that the model pays more attention to different types of local detail features. Suppose the size of the ordinary convolution kernel is C in ×C out ×k h ×k w , and the size of the depthwise convolution is C in ×1×k h ×k w , the number of parameters is much smaller than that of ordinary convolution. Fewer parameters means that the complexity of the model is relatively low, thus reducing the risk of overfitting.
[0119] S23. Introduce bilateral residual structure to optimize the Head (detection head) module. Add bilateral residual structure to alleviate the gradient vanishing problem and reduce model complexity, thereby improving the real-time monitoring speed of the model. Compared with the traditional decoupled detection head, the residual structure can retain more original information and reduce unnecessary parameter redundancy.
[0120] Specifically, Figure 6 As shown, S23 is: input feature map X, perform 1×1 convolution module and 3×3 convolution module operations in parallel, and generate regression feature maps F respectively. r (X) and classification feature map F c (X);
[0121] In the regression path, the feature map F r (X) After a residual module R r And a 1×1 independent convolution to obtain the bounding box regression output B, expressed as:
[0122] B=Conv 1×1 (R r (F r (X))+F r (X)
[0123] Similarly, the classification output C of another branch is expressed as:
[0124] C=Conv 1×1 (R r (F c (X))+F c (X)
[0125] The regression output B converts the anchor point into a bounding box through the regression function, and the classification output C is activated by softmax and then spliced to obtain the detection result.
[0126] S24. Design the loss function SSIL to optimize the ADS-YOLO model. During the training process, use the predicted values obtained by DRH and the true values of the data to calculate the loss function to guide the model to optimize in a better direction.
[0127] Specifically, S24 is: The loss function SSIL includes the loss function SIOU and the loss function sDFL. SSIL can significantly improve the localization and detection capabilities of the model in complex defect scenarios.
[0128] The loss function SIOU adds the adjustment of the detection box angle on the basis of the traditional CIOU to optimize the IOU metric, so that the model can more accurately align asymmetric and complex-shaped targets, and optimize the metric of the intersection-over-union ratio of the true label box and the predicted target box, which is expressed as:
[0129]
[0130] Among them, IoU represents the intersection-over-union ratio of the real label box and the predicted target box, ρ represents the distance between the center points of the two, c is the diagonal length of the minimum rectangle surrounding the predicted box and the target box, λ is a balancing parameter used to adjust the penalty term ν of the target box shape, and Cost Distance and Cost shape The differences in position and shape between the predicted box and the target box are measured respectively, expressed as:
[0131] Cost Distance =2-exp(γρ x )-exp(γρ y )
[0132] Cost shape =(1-exp(-ω w )) 4 +(1-exp(-ω h )) 4
[0133] Among them, ρ x and ρ y Respectively represent the distance ratio between the prediction box and the target box in the horizontal and vertical directions, ω w and ω h Indicates the ratio difference between width and height.
[0134] The main function of DFL is to improve the model's regression accuracy of the target bounding box by finely distributing weights to adjacent positions during target positioning. In particular, in multi-scale target detection tasks, it can better cope with the challenges brought by changes in target size. However, in small sample data sets and defective scenes with blurred edges in industrial scenarios, the original DFL may over-focus on specific details or even the background in the training samples, resulting in overfitting of the training. A scaling factor is introduced on the basis of DFL to obtain the loss function sDFL to adjust the weights of the left and right boundaries to achieve a smoother loss distribution, which is expressed as:
[0135]
[0136] Where CE(p,t) represents the cross entropy loss between the predicted distribution p and the target value t, ω l and ω r They represent the weights of the target positions on the left and right, respectively, and are adjusted by the scaling factor α. In this embodiment, α is set to 0.8, which is expressed as:
[0137] ω l =α·(r+1-t),ω r =(1-α)·(1-ω l)
[0138] Among them, r is the left neighbor number of the target value t;
[0139] Finally, the loss function SILL can be expressed as:
[0140] Loss SSIL =Loss SIOU +Loss sDFL .
[0141] S3. Use the ADS-YOLO model with the optimal weights to perform target detection on the test samples and output the detection results.
[0142] This paper selects several representative target detection models and conducts comparative experiments on the MLCCs dataset. The results are as follows: Figure 7 As shown in the figure, due to the addition of the multi-head self-attention mechanism, the ADS-YOLO proposed in the present invention can focus more on the defect location and improve the positioning capability of complex multi-scale defects (e.g., exposed copper at the end, deformity). It can be seen from the test results that the ADS-YOLO proposed in the present invention effectively suppresses missed detection, wrong detection, and repeated detection of a single defect.
[0143] The evaluation indicators of the comparison network are shown in Table 2:
[0144] Model Backbone P% R% mAP% Paras(M) GFLOPS FPS Faster R-CNN ResNet-50 83.5 75.0 80.2 41.6 355.3 16.3 SSD VGG-16 80.0 74.0 80.6 13.6 30.6 35.2 RetinaNet ResNet-50 80.1 74.0 79.6 32.3 348.9 15.2 EfficientDet EfficientDet-D3 67.5 61.0 66.6 11.9 24.1 11.6 YOLOv5s CSPDarkNet-53 81.5 78.0 81.8 7.0 15.8 42.4 YOLOv8s CSPDarkNet-53 79.5 79.2 82.4 11.1 28.4 57.8 ADS-YOLO CSPDarkNet-53 84.4 83.8 86.5 8.7 22.8 62.1
[0145] Table 2
[0146] As shown in Table 2. It can be seen that although SSD, Faster R-CNN and RetinaNet have similar performance in terms of precision and recall, they either show a higher number of parameters and computational requirements, or have a lower detection speed while maintaining accuracy. In contrast, the ADS-YOLO model of the present invention outperforms the comparison models in terms of accuracy, recall, mAP% and inference time, proving the effectiveness of the present invention in balancing accuracy and efficiency. Although the parameters of the ADS-YOLO model of the present invention have increased by 24.3% and GFLOPS (giga floating point operations per second, an indicator for measuring computational complexity) have increased by 44.3% compared to YOLOv5s, its performance is still higher in most evaluation criteria, exceeding the baseline model YOLOv8s. The trade-off between slightly increased computational load and improved detection performance makes the ADS-YOLO model an effective solution in practical applications. In terms of detection speed, it is still better than other advanced detectors and meets the requirements of real-time detection.
[0147] Figure 8This further highlights the robustness of the ADS-YOLO model across different defect categories. Deformation, exposed copper on the end, and body impurity defects are challenging to detect due to their small number of instances and large scale variations. These defect types are particularly detrimental to the overall performance of the model, especially in the case of low-contrast edges and irregular shapes. Despite this, the ADS-YOLO model showed consistent average precision improvements across these challenging categories, outperforming other models in both accuracy and stability.
[0148] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A deep learning defect detection method for MLCC, characterized in that: The following steps are involved: S1. Build an image defect detection system to collect and filter images and generate defect data sets; S2. Build an ADS-YOLO model, input the defect data set into the ADS-YOLO model for training, and evaluate and save the optimal weight; S3. Use the ADS-YOLO model with the optimal weights to perform target detection on the test samples and output the detection results.
2. According to the deep learning defect detection method for MLCC according to claim 1, the S1 further comprises the following steps: S11, fixing a fixture, placing a camera and a ring light source on the fixture, wherein the camera is connected to a lens, and a rotating platform is installed below the lens, and a laser sensor is placed on one side of the rotating platform and electrically connected to the camera, which is recorded as an image acquisition unit; S12, installing a computer, a rotating platform controller and a light source controller, so that the computer is electrically connected to the camera, the rotating platform controller is electrically connected to the rotating platform, and the light source controller is electrically connected to the annular light source, which is recorded as a control imaging unit.
3. According to the deep learning defect detection method for MLCC according to claim 1, S2 further includes the following steps: S21. Design the Backbone module using the CSP-Dsrknet53 architecture to extract deep features; S22, the Neck module is designed using the A2PAN structure, and self-attention mechanism and deep convolution are introduced for bidirectional multi-level fusion; S23, introduce bilateral residual structure to optimize the Head module; S24. Design a loss function SSIL to optimize the ADS-YOLO model.
4. A deep learning defect detection method for MLCC according to claim 3, characterized in that: The S21 also includes the following steps: inputting the image into the Backbone module, sequentially down-sampling the image layer by layer using the CBS module composed of convolution, batch normalization and silu activation function, and performing feature fusion and sorting by the C2f module after sampling.
5. The deep learning defect detection method for MLCC according to claim 3, characterized in that: The S22 comprises the following steps: S221, bottom-up fusion: introduce the CSP-SA module with self-attention mechanism to optimize deep feature expression; S222, top-down fusion: downsampling is performed using deep convolution to reduce overfitting of the ADS-YOLO model.
6. A deep learning defect detection method for MLCC according to claim 5, characterized in that: The S221 is specifically: Input X, first pass through the convolution module to obtain the feature map T, then split into T' and Y0 through the segmentation operation, Y0 passes through the recursive operation of the Bottleneck module i times and outputs Y i , T' is combined with Y through the Concat operation i After concatenation, the output result Y of the CSP-SA module is obtained through the convolution module, which is expressed as: Y i =Bottleneck(Y i-1 ) Y=CBS 1×1 (Concat(T',Y0,Y1,...,Y n )) Where i=1,2,...,n.
7. A deep learning defect detection method for MLCC according to claim 6, characterized in that: The operating steps of the Bottleneck module are: Use convolutional modules to connect multi-head self-attention modules; In the multi-head self-attention module, 1×1 convolution is used to map to h groups of Q, K and V matrices, where h is the number of heads; Then the content attention score is obtained by the dot product of Q and K; Add relative position encoding and obtain the position attention score through the dot product with Q; The content attention score and the position attention score are added to obtain the total attention weight, which is expressed as: Among them, R w and R h are the hyperparameters to be learned, which represent the relative position relationship of the feature map in the height and width dimensions respectively; The total attention weight is obtained by softmax operation to obtain the complete attention weight, and multiplied by V to obtain the output x out , expressed as: x out =Vsoftmax(score) The output of the Bottleneck module is expressed as: AND i MHSA(Conv) 1×1 (AND i-1 ))。 8. The deep learning defect detection method for MLCC according to claim 3, characterized in that: The S23 comprises the following steps: Input feature map X, perform 1×1 convolution module and 3×3 convolution module operations in parallel, and generate regression feature maps F respectively. r (X) and classification feature map F c (X); In the regression path, the feature map F r (X) After a residual module R r And a 1×1 independent convolution to obtain the regression output B, expressed as: B=Conv 1×1 (R r (F r (X))+F r (X)) The classification output C of the other branch is expressed as: C=Conv 1×1 (R r (F c (X))+F c (X)) The regression output B converts the anchor point into a bounding box through a regression function, and the classification output C is activated by softmax and then concatenated to obtain the detection result.
9. The deep learning defect detection method for MLCC according to claim 3, characterized in that: The S24 comprises the following steps: The loss function SSIL includes a loss function SIOU and a loss function sDFL; The loss function SIOU is used to optimize the metric of the intersection-over-union ratio between the true label box and the predicted target box, expressed as: Among them, IoU represents the intersection-over-union ratio of the real label box and the predicted target box, ρ represents the distance between the center points of the two, c is the diagonal length of the minimum rectangle surrounding the predicted box and the target box, λ is a balancing parameter used to adjust the penalty term ν of the target box shape, and Cost Distance Cost shape The differences in position and shape between the predicted box and the target box are measured respectively, expressed as: Cost Distance =2-exp(g x )-exp(g y ) Cost shape =(1-exp(-ω w )) 4 +(1-exp(-ω h )) 4 Among them, ρ x and ρ y Respectively represent the distance ratio between the prediction box and the target box in the horizontal and vertical directions, ω w and ω h Indicates the ratio difference between width and height; The loss function sDFL is used to adjust the weights on the left and right boundaries to achieve a smoother loss distribution, expressed as: Where CE(p,t) represents the cross entropy loss between the predicted distribution p and the target value t, ω l and ω r Respectively represent the weights of the target positions on the left and right, which are adjusted by the scaling factor α, expressed as: oh l =α·(r+1-t),ω r =(1-a)·(1-ω) l ) Among them, r is the left neighbor number of the target value t; Finally, the loss function SILL is expressed as: Loss SSIL =Loss SIOU +Loss sDFL 。 10. A deep learning defect detection system for MLCC, characterized by: It includes a ring light source, a rotating platform, a laser sensor, a camera, a fixture, a rotating platform controller, a light source controller, a computer and a lens; Wherein, the camera is arranged on the fixture and is electrically connected to the computer; The lens is connected to the camera; The rotating platform is disposed below the lens and is electrically connected to the rotating platform controller; The annular light source is arranged on the fixture and is electrically connected to the light source controller; The laser sensor is arranged corresponding to the rotating platform and is electrically connected to the camera.
Citation Information
Patent Citations
Micro LED chip defect detection method based on MLTT-YOLO
CN115908344A
MLCC multi-type defect rapid detection method based on machine vision
CN118096659A