LED chip surface defect detection method and device based on improved YOLOv8

By improving the YOLOV8 model, combining the multi -scale fusion module of the hollow rate, feeling wild attention convolution, and global coordinate group shuffle module, the traditional YOLO algorithm is insufficient when detecting the surface defects of LED chips, achieving more efficient and accurate accuracy Deficiency detection.

CN119359620APending Publication Date: 2025-01-24YANCHENG INST OF TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411262531.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When traditional YOLO algorithms deal with complex backgrounds and multi-scale targets, it is difficult to accurately detect subtle scratch defects on LED chips and defects in Mesa layer, and the detection accuracy of gold-line defects is insufficient.

Method used

Improve the YOLOV8 model. By integrating the VMFM module and the C2F module to form a C2F-VMFM module, add the wild attention convolution RFACONV to the SPP module to form the SRFPP module, and add a global coordinate to the SRFPP module next to the SRFPP module. Group shuffle GCGS module.

Benefits of technology

It improves the accuracy and robustness of LED chip surface defect detection, especially in detecting scratch defects and Mesa defects, while adapting to complex industrial application environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359620A_ABST
    Figure CN119359620A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of defect detection, and provides an LED chip surface defect detection method and device based on improved YOLOv8. According to the method, on the basis of an original YOLOv8 model, a voidage multi-scale fusion module (VMFM) and a C2f module are fused to form a C2f-VMFM module, and the C2f-VMFM module is used for replacing the C2f module in a Head network in the original YOLOv8 model, so that the defects that interaction among channels is insufficient, space information processing and feature importance distinguishing capabilities are limited and the like of a traditional C2f module are overcome; the receptive field attention convolution RFAConv is added to an original SPPF module to form a new spatial receptive field pyramid pooling layer (SRFPP module), so that richer and more detailed feature representation is obtained; and a global coordinate grouping shuffling module (GCGS) is added to the next layer of the SRFPP module and is used for further performing global grouping coordinate attention processing on the multi-scale features, so that the expression of the features is more accurate and richer. Through the improvement on the YOLOv8 model, the efficient and accurate detection on the surface defects of the LED chip is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of defect detection technology, and in particular to a surface defect detection method, device, medium and electronic device for LED chips based on improved YOLOv8. Background Art

[0002] In the semiconductor manufacturing process, the surface defects of LED chips are the key factors affecting their performance and reliability. With the development of computer vision and deep learning technology, automated defect detection methods based on image recognition have gradually become a research hotspot. As an efficient target detection algorithm, the YOLO (You Only Look Once) series of algorithms have achieved good application results in identifying gold wire defects, electrode defects, and surface defects.

[0003] However, the traditional YOLO algorithm still has some shortcomings when dealing with complex backgrounds and multi-scale targets. For example, it is difficult to obtain accurate detection results for subtle scratch defects on LED chips and defects in the Mesa layer, and the detection accuracy of gold wire defects needs to be improved.

[0004] Therefore, it is necessary to provide an improved technical solution to address the above-mentioned deficiencies in the prior art. Summary of the invention

[0005] The purpose of this application is to provide a surface defect detection method, device, medium and electronic device for LED chips based on improved YOLOv8 to solve or alleviate the problems existing in the above-mentioned prior art.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] In a first aspect, the present application provides a surface defect detection method for LED chips based on improved YOLOv8, comprising:

[0008] Acquire a surface defect dataset containing LED chips;

[0009] Dividing the samples in the surface defect data set to obtain a training set, a validation set, and a test set;

[0010] Improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model;

[0011] Iteratively train the improved YOLOv8 model using the surface defect dataset until the model converges to obtain a trained model, and use the trained model as a surface defect detection model for LED chips;

[0012] Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

[0013] As an optional implementation, in the surface defect dataset, the labels of the surface defect images include the following five defect types: gold wire defect, electrode defect, surface defect, scratch defect, and Mesa defect.

[0014] As an optional implementation, the C2f-VMFM module has multiple,

[0015] The multiple C2f-VMFM modules are used to replace the C2f modules in the head network (Head) of the original YOLOv8 model;

[0016] Each of the C2f-VMFM modules includes a first convolutional layer, a first branch, and a second branch, the first convolutional layer is connected to the first branch and the second branch respectively, and the first branch and the second branch are arranged in parallel, and the VMFM module is embedded in the second branch;

[0017] The C2f-VMFM module receives the first feature maps from different levels of the head network (Head), and after being processed by the first convolution layer, inputs the first branch and the second branch respectively, performs group convolution through the first branch, and at the same time, the second branch performs channel attention and spatial attention processing in sequence, and then performs partial residual connection on the processing results of the two branches to obtain the output feature map of the C2f-VMFM module.

[0018] As an optional implementation, the SRFPP module receives a second feature map, where the second feature map is an output feature map of the last VMFM module of the backbone network;

[0019] The second feature map is processed by RFAConv as follows:

[0020] The second feature map is divided into non-overlapping sliding windows through block extraction method and fast group convolution, each sliding window represents a receptive field window, and its size is equal to the size of the convolution kernel;

[0021] Perform global average pooling on the spatial features of each receptive field window to obtain the global information of each feature and form a normalized attention map;

[0022] Multiplying the normalized attention map with the receptive field spatial feature after ReLU activation and normalization to generate a weighted feature map F;

[0023] The weighted feature map F is subjected to feature extraction through a convolution operation to obtain an output feature map Y.

[0024] As an optional implementation, the global coordinate grouping shuffling module receives a third feature map, and the third feature map is an output feature map of the SRFPP module;

[0025] The global coordinate grouping shuffling module processes the third feature map as follows:

[0026] Dividing the third feature map into a plurality of groups according to the number of channels through a grouping mechanism to obtain a feature map of each group;

[0027] The channel order of each group of feature maps is disrupted by a channel shuffling operation, and then the disrupted feature maps are restored to the original shape of the third feature map to obtain a fourth feature map;

[0028] Using a bidirectional attention mechanism, global feature extraction and attention calculation are performed on the fourth feature map in the H direction and the W direction at the same time to obtain a fifth feature map in the H direction and a sixth feature map in the W direction;

[0029] Using a multi-stage shared convolutional layer to process the fifth feature map and the sixth feature map, and generate attention weights accordingly;

[0030] The attention weight is multiplied by the third feature map to obtain an output feature map of the global coordinate grouping shuffling module.

[0031] As an optional implementation, the multi-stage shared convolutional layer includes a first convolutional layer, a first batch of normalization layers, a first activation layer, a second convolutional layer, a Dropout layer, a third convolutional layer, a second batch of normalization layers, a second activation layer, and a fourth convolutional layer connected in sequence;

[0032] After the fifth feature map and the sixth feature map are input into the multi-stage shared convolutional layer, they are processed in sequence by the first convolutional layer, the first batch normalization layer, the first activation layer, the second convolutional layer, the Dropout layer, the third convolutional layer, the second batch normalization layer, the second activation layer, and the fourth convolutional layer to generate the attention weights corresponding to the fifth feature map and the sixth feature map.

[0033] As an optional implementation, the improved YOLOv8 model further includes:

[0034] A VMFM module is linearly connected after the C2f module of the backbone network in the original YOLOv8 model. The input feature map is linearly processed by the C2f module and the VMFM module in turn to obtain the output feature map.

[0035] In a second aspect, this embodiment provides a surface defect detection device for an LED chip based on an improved YOLOv8, comprising:

[0036] A data acquisition unit configured to acquire a surface defect dataset containing LED chips;

[0037] A sample division unit, configured to divide the samples in the surface defect data set into a training set, a validation set and a test set;

[0038] A model improvement unit, configured to improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model;

[0039] A model application unit is configured to iteratively train the improved YOLOv8 model using the surface defect data set until the model converges, obtain a trained model, and use the trained model as a LED chip surface defect detection model;

[0040] Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

[0041] In a third aspect, this embodiment provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method described in any of the above embodiments is implemented.

[0042] In a fourth aspect, this embodiment provides an electronic device, comprising: a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the method described in any of the above embodiments when executing the program.

[0043] Beneficial effects:

[0044] The surface defect detection method, device, medium and electronic device of the LED chip based on the improved YOLOv8 provided in this embodiment, on the basis of the original YOLOv8 model, combines the void multi-scale fusion module (Void Multi-scale Fusion Module, VMFM module) with C2f (Cross Stage Partial Fusion The C2f-VMFM module is formed by fusing the SPPF module with the C2f-VMFM module to replace the C2f module in the head network (Head) of the original YOLOv8 model, so as to make up for the shortcomings of the traditional C2f module in terms of insufficient channel interaction, limited spatial information processing and feature importance discrimination capabilities; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called the SRFPP module, to obtain richer and more detailed feature representation; a global coordinate grouping shuffle module (GCGS) is added to the next layer of the SRFPP module to further perform global grouping coordinate attention processing on multi-scale features, so that the feature expression is more accurate and rich. Through the above improvements to the original YOLOv8 model, efficient and accurate detection of surface defects of LED chips is achieved. This method can not only effectively improve the accuracy and robustness of detection, but also adapt to complex industrial application environments and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic flow chart of a method for detecting surface defects of LED chips based on improved YOLOv8 according to some embodiments of the present application.

[0046] Figure 2 A schematic diagram of an improved YOLOv8 model structure provided according to some embodiments of the present application.

[0047] Figure 3 A schematic diagram of the structure of a void ratio multi-scale fusion module (VMFM) provided according to some embodiments of the present application.

[0048] Figure 4 Schematic diagram of the structural comparison between SPPF and SRFPP provided according to some embodiments of the present application.

[0049] Figure 5 A schematic diagram of the structure of a global coordinate group shuffling module (GCGS) provided according to some embodiments of the present application.

[0050] Figure 6 Schematic diagram of some defect detection effects.

[0051] Figure 7The figure is a comparison diagram of the Precision-Recall Curve (precision-recall rate curve) detected by the original YOLOv8 network and the improved YOLOv8 network.

[0052] Figure 8 This is a schematic diagram of the structure of the surface defect detection system of LED chips based on improved YOLOv8. DETAILED DESCRIPTION

[0053] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments.

[0054] Method Embodiment

[0055] This embodiment provides a surface defect detection method for LED chips based on improved YOLOv8. Figure 1 As shown, the method includes steps S101 to S104, which are specifically as follows:

[0056] Step S101: Acquire a surface defect dataset containing LED chips.

[0057] Preferably, in the surface defect dataset, the labels of the surface defect images include the following five defect types: gold wire defect, electrode defect, surface defect, scratch defect, and Mesa defect.

[0058] Step S102: Divide the samples in the surface defect data set into a training set, a validation set and a test set.

[0059] Step S103: improving the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model.

[0060] Step S104: iteratively train the improved YOLOv8 model using the surface defect dataset until the model converges, obtain a trained model, and use it as a LED chip surface defect detection model.

[0061] Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

[0062] The model of this embodiment is improved based on the YOLOv8 model of the YOLO series. As a newer version, the YOLOv8 model further improves the accuracy and real-time performance of target detection by improving the network structure and optimizing the algorithm. However, for the specific defect detection needs on the surface of LED chips, the existing YOLOv8 is still difficult to adapt to the diversity and complexity of defects on the surface of LED chips. Specifically, the defects on the surface of LED chips mainly include gold wire defects, electrode defects, surface defects, scratch defects and Mesa defects. These defects have large differences in morphology, size and distribution. The existing YOLOv8 is difficult to accurately detect gold wire defects, scratch defects and Mesa defects. Therefore, it is necessary to further optimize and improve YOLOv8.

[0063] In this embodiment, the purpose of step S101 is to capture the surface defects of the LED chip using a camera and construct a high-quality surface defect data set.

[0064] For example, a Motic microscope can be used in conjunction with a Hikvision robot industrial camera (MV-CA050-12UC) to collect chip surface images of LED chips, and defects in each image can be annotated to construct a defect target detection data set. In order to obtain diverse samples, artificial augmentation of data can be achieved by applying geometric transformation technology. In order to fit practical applications, the collected images are randomly rotated, flipped, translated, denoised, deblurred, and subjected to a series of image processing. After the above processing, the resolution of a single chip is about 450×1200, and the number of chips in the LED data set is 3160, including 2212 training samples and 948 test samples.

[0065] The preprocessing of the LED chip surface image specifically includes:

[0066] A. Filter the images in the data set;

[0067] B. Use labels to mark the defect types in the image; there are 5 types of defects in total: 1. Gold wire defect (GoldwireDefect) 2. Electrode damage (Electrode Damage) 3. Surface (Substrate, also known as substrate defect) 4. Scratch defect (Scratch) 5. Mesa defect.

[0068] C. Perform data enhancement on the images in the dataset to expand the data samples; data enhancement operations include random rotation, scaling, flipping, color brightness adjustment, etc. to increase the generalization ability of the model;

[0069] D. Standardize or normalize the images in the dataset to ensure that the pixel values ​​of the images are within the same scale range.

[0070] In step S102, the preprocessed surface defect data set is divided into three independent subsets: a training set, a validation set, and a test set. The specific division ratio may be 7:2:1. Of course, it may also be divided according to a ratio of 6:2:2, which is not limited in this embodiment.

[0071] The purpose of step S103 is to improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model.

[0072] Figure 2 Schematic diagram of the improved YOLOv8 model structure provided according to some embodiments of the present application. Figure 2 As shown, the YOLOv8 model includes three parts: a backbone network (Backbone), a head network (Head) and a prediction part (Prediction), wherein the Backbone part is used to extract the features of the input image, the Head part is responsible for further processing the feature map output by the Backbone, and the Prediction part is responsible for target detection on feature maps of different scales to generate the final detection result. This embodiment makes the following improvements to the original YOLOv8 model: the hole rate multi-scale fusion VMFM module is fused with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called the SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

[0073] Among them, the C2f-VMFM module and the GCGS module are used to enhance feature expression. Receptive field attention convolution (RFAConv) is a new convolution operation that combines receptive field spatial features and attention mechanism. Its core idea is to dynamically generate receptive field spatial features and use attention mechanism to give these features different importance, thereby effectively solving the problem of convolution kernel parameter sharing. In this embodiment, the receptive field attention convolution RFAConv is added to the original SPPF module to form the SRFPP module. Figure 4 Schematic diagram of the structure comparison between SPPF and SRFPP provided according to some embodiments of the present application. Figure 4As shown in the figure, compared with the traditional SPPF module, the SRFPP module adds three receptive field attention convolution RFAConv blocks. After the output feature map (second feature map) of the last VMFM module of the backbone network enters the SRFPP module, it is divided into two branches. One branch is subjected to feature extraction by two RFAConv blocks and then input into three maximum pooling layers (13×13, 9×9, 5×5) respectively. Then, the outputs of the three maximum pooling layers are concatenated, and an intermediate feature map to be concatenated is obtained after two convolutions. In the other branch, the second feature map is directly processed by the RFAConv block to obtain another intermediate feature map to be concatenated. The final output feature map is obtained by concatenating the two intermediate feature maps to be concatenated and convolving them again. The introduction of average pooling, additional pooling layers and RFAConv helps to capture more types of features and focus on the key parts of the input, which can improve performance in various defect detection tasks.

[0074] It should be noted that the above-mentioned SRFPP module is proposed for scratch defects in LED chips. Specifically, scratch defects usually appear as narrow and localized features, which are not very noticeable in most backgrounds. This embodiment adds the RFAConv receptive field convolution to the traditional SPPF module to form a new spatial receptive field pyramid pooling layer (SRFPP). By utilizing the adaptive convolution kernel weight distribution of RFAConv, the characteristics of the convolution operation can be adjusted according to the input data, so that the channel attention mechanism can adaptively enhance the small but critical features in the scratch defects, thereby making the model pay more attention to specific channel features that may be related to scratches, extracting more refined and effective features, and improving the detection capability of narrow scratches in complex backgrounds.

[0075] The purpose of step S104 is to train the model to obtain the final LED chip surface defect detection model.

[0076] In this embodiment, the environment settings for model training are as follows: PC is selected as the image recognition processing end, configured with an Intel Core i5-12600KF CPU processor, a 64-bit Windows 11 operating system, and a GPU configured as NVIDIA RTX 3060 12GB.

[0077] After iterative training and model convergence, the final LED chip surface defect detection model is obtained. The above improvements enhance the expression of features and improve the accuracy of LED chip surface defect detection, especially the detection capabilities of scratch defects and Mesa defects. At the same time, the enhancement of feature extraction and expression capabilities enables this method to effectively detect complex backgrounds and multi-scale targets, improving the accuracy and robustness of detection.

[0078] In some optional embodiments, the improved YOLOv8 model further includes: a VMFM module is linearly connected after the C2f module of the backbone network (Backbone) in the original YOLOv8 model, and the input feature map is linearly processed by the C2f module and the VMFM module in turn to obtain an output feature map. By designing the C2f module and the VMFM module to be linearly connected, the efficient calculation of C2f and the multi-scale fusion capability of VMFM can be combined, so that the network can capture richer feature representations, especially more refined processing of targets of different sizes, and enhanced feature extraction capabilities.

[0079] In the surface defect detection of LED chips, the gold wire in the gold wire defect is usually a thin and long structure with a specific texture, which is easily disturbed by background noise or other similar textures, resulting in insufficient detection accuracy of the traditional model. To this end, this embodiment introduces multiple C2f-VMFM modules, which are used to replace the C2f modules in the head network (Head) in the original YOLOv8 model to achieve precise positioning of small areas and improve the detection capability of gold wire defects.

[0080] Specifically, each of the C2f-VMFM modules includes a first convolutional layer, a first branch, and a second branch. The first convolutional layer is connected to the first branch and the second branch, respectively, and the first branch and the second branch are arranged in parallel, and the VMFM module is embedded in the second branch; the C2f-VMFM module receives the first feature maps of different levels from the head network (Head), and after being processed by the first convolutional layer, they are respectively input into the first branch and the second branch, and group convolution is performed through the first branch. At the same time, the second branch performs channel attention and spatial attention processing in sequence, and then the processing results of the two branches are partially residually connected to obtain the output feature map of the C2f-VMFM module.

[0081] It should be noted that the C2f module in the original YOLOv8 model is a module for feature extraction and fusion, which has strong feature expression capabilities. However, this module has the following shortcomings:

[0082] 1. Lack of attention to global information: The traditional C2f module mainly relies on local convolution operations and may not be able to fully capture the global information.

[0083] 2. Insufficient interaction between channels: When processing high-dimensional features, the interaction between channels is not sufficient, resulting in less than ideal feature fusion.

[0084] 3. Limited spatial information processing: Convolution operations are mainly concentrated in the local space and may not be able to effectively process global spatial relationships.

[0085] 4. Limited ability to discern the importance of features: Traditional convolution operations have limited ability to discern the importance of features and cannot adaptively enhance important features.

[0086] To address the above shortcomings, this embodiment integrates the void rate multi-scale fusion module (VMFM) into the C2f module, and the specific implementation method is as follows:

[0087] After the first convolutional layer of the C2f module, the feature map is evenly divided into two parts in the channel dimension and input into two parallel branches, namely the first branch and the second branch, and the VMFM module is embedded in the second branch instead of being directly passed to the Bottlenet module.

[0088] Specifically, the input feature map is processed by the first convolution layer of the C2f module and divided by channels, and then input to the first branch and the second branch respectively. The first branch performs group convolution, while the second branch performs channel attention and spatial attention processing in sequence. Then, the processing results of the two branches are partially residually connected to obtain the output feature map. In the above processing, the first branch directly processes and retains the initial information. The second branch performs multi-scale hole attention convolution and attention processing in sequence, and then the results of the two branches are fused to better capture feature information of different scales.

[0089] Figure 3 FIG. 1 is a schematic diagram of the structure of a void ratio multi-scale fusion module (VMFM) provided according to some embodiments of the present application, wherein the VMFM module is embedded in the second branch. Figure 3 As shown in the figure, the VMFM module includes a first part and a second part. The first part is used to perform multi-scale hole attention convolution, which includes at least two scales with hole rates of 6 and 12. The second part is used to perform channel attention and spatial attention processing. The upper part of the figure shows the channel attention processing process, and the lower part shows the spatial attention processing process with channel shuffle. The results of channel attention and spatial attention are summed to obtain the output features.

[0090] This embodiment uses spatial attention with channel shuffling operation to rearrange feature channels and enhance the interaction between channels. This operation breaks the independence between channels, increases the interaction between different channels, and helps the model extract more discriminative features from different channels, which is particularly helpful for dealing with defects with complex structures (such as gold wires). At the same time, channel shuffling helps the model fuse detail information from different convolution kernels, thereby more accurately depicting the contour and texture of the gold wire.

[0091] Furthermore, the channel attention mechanism in the C2f-VMFM module is implemented as follows:

[0092] First, implement channel attention according to the following expression:

[0093] Channel Attention(X)=σ(W2(ReLU(W1(X)))) (1)

[0094] Where X is the input feature map, W1 and W2 are two linear layers, and σ is the Sigmoid activation function. Through the channel attention mechanism, the C2f-VMFM module can capture global information and adaptively adjust the weight of each channel to enhance the expression of important features.

[0095] Then, the channel attention weight α is calculated as follows c :

[0096] α c =σ(FC2(ReLU(FC1(FAP(X))))) (2)

[0097] In the formula, GAP(.) is the global average pooling, FC1 and FC2 are two fully connected layers.

[0098] Through the above weight calculation, the weights of different channels can be adaptively adjusted to enhance the interaction between channels and make the feature fusion more complete. Through the above channel attention mechanism, the weight of each channel is adaptively adjusted, so that the model can pay more attention to the feature channels related to gold wire defects, so that the model can more effectively highlight the subtle features of the gold wire, suppress the background channels unrelated to the gold wire, and significantly improve the model's sensitivity to gold wire defects, thereby improving the detection accuracy.

[0099] Furthermore, the spatial attention mechanism in the C2f-VMFM module is implemented as follows:

[0100] First, the spatial attention calculation formula is as follows:

[0101] Spatial Attention(X)=σ(Conv7(BN(ReLU(Conv7(X))))) (3)

[0102] Where Conv7(.) is a 7×7 convolutional layer and BN(.) is a batch normalization layer.

[0103] Through the spatial attention mechanism, the C2f-VMFM module can effectively process spatial relationships, focus on important spatial areas, and suppress unimportant areas. Since gold wire defects usually occur in specific small areas, the spatial attention mechanism in the C2f-VMFM module can better focus on these areas by capturing a wide range of spatial context information through 7×7 convolution kernels, so that spatial attention can help the model to more effectively distinguish the subtle differences between gold wires and backgrounds, enhancing the model's gold wire defect detection capabilities under complex backgrounds. In addition, the addition of spatial attention enables the model to more accurately locate defect locations when processing slender and position-specific gold wires, thereby reducing missed detections and false detections.

[0104] The final attention-weighted output is:

[0105] Y=X×Spatial Attention(X)×Channel Attention(X) (4)

[0106] Through the attention mechanism (channel + spatial attention), the C2f-VMFM module can adaptively enhance important features, suppress irrelevant features, and improve the discriminative ability of feature expression.

[0107] This embodiment uses the C2f-VMFM module to better capture important features, enhance the interaction between channels, and improve the diversity of features. Through channel compression and expansion of the convolutional layer, the amount of calculation is reduced, the feature expression ability and computing efficiency of the model are enhanced, and thus the detection performance is improved.

[0108] In order to obtain richer and more detailed feature representation, in some embodiments, a spatial receptive field pyramid pooling layer (SRFPP) is added to the Backbone network part of YOLOv8 to replace the traditional fast spatial pyramid SPPF module, and the SRFPP module is used to receive the second feature map, which is the output feature map of the last C2f-VMFM module of the backbone network; the second feature map is processed as follows by RFAConv: the second feature map is divided into non-overlapping sliding windows by the block extraction (Unfold) method and the fast group convolution (Group Convolution), each sliding window represents a receptive field window, and its size is equal to the size of the convolution kernel; the spatial features of each receptive field window are globally averaged pooled to obtain the global information of each feature and form a normalized attention map; the normalized attention map is multiplied with the receptive field spatial features after ReLU activation and normalization to generate a weighted feature map F; the weighted feature map F is feature extracted by the convolution operation to obtain the output feature map.

[0109] Exemplarily, the above steps can be described in detail as follows:

[0110] First, the input feature map is divided into non-overlapping sliding windows. The size of each sliding window is equal to the size of the convolution kernel (for example, 3×3), which can be achieved through the block extraction (Unfold) method and fast group convolution (GroupConvolution).

[0111] Among them, the Unfold method transforms the input feature map X into a new shape, in which each sliding window is a separate feature. Assume that the shape of the input feature map is R C×H×W , where C is the number of channels, H is the height, and W is the width. The Unfold method converts it to a shape of R (k×k×C)×(H·W) feature map, k×k is the size of the sliding window.

[0112] Group Convolution maps the original features to new features by quickly extracting receptive field features. For example, a 3×3 convolution kernel is used to extract features, and each 3×3 window represents a receptive field sliding window. After the receptive field features are extracted using the fast Group Convolution method, the original features are mapped to new features. This method is faster and more efficient.

[0113] In order to generate the attention map, it is necessary to perform global average pooling (AvgPool) on the spatial features of each receptive field window to obtain the global information of each feature and form a normalized attention map, which is expressed as:

[0114] A rf =Softmax(g 1×1 (AvgPool(X))) (5)

[0115] In the formula, A rf is the normalized attention map, AvgPool(.) is the global average pooling operation, Softmax(.) is the activation operation, and g 1×1 It is a 1×1 convolution operation.

[0116] Next, the normalized attention map is combined with the receptive field spatial feature F after ReLU activation and normalization. rf Multiply them together to generate the final weighted feature map F, and the corresponding expression is:

[0117] F rf =ReLU(Norm(g k×k (X unfold )))

[0118] F=A rf ×F rf (6)

[0119] In the formula, g k×k is a k×k convolution operation, Norm(.) is the normalization process, X unfold It is the feature map output by the Unfold method.

[0120] Finally, the final weighted feature map F is subjected to feature extraction through a k×k convolution operation, which is expressed as:

[0121] Y=g k×k,stride=k (F) (7)

[0122] Further, in order to deal with the problem that the SRFPP module may introduce some unnecessary noise or redundant information after the convolution and pooling operations, in some embodiments, a GCGS module is added after the SRFPP module, and the global coordinate grouping shuffling module (GCGS) receives the third feature map, which is the output feature map of the SRFPP module; the global coordinate grouping shuffling module processes the third feature map as follows: the third feature map is divided into multiple groups according to the number of channels through a grouping mechanism to obtain feature maps of each group; the channel order within the feature map of each group is disrupted through a channel shuffling operation, and then the disrupted feature map is restored to the original shape of the third feature map to obtain a fourth feature map; a bidirectional attention mechanism is used to simultaneously perform global feature extraction and attention calculation on the fourth feature map in the H direction and the W direction to obtain a fifth feature map in the H direction and a sixth feature map in the W direction; a multi-stage shared convolutional layer is used to process the fifth feature map and the sixth feature map, and corresponding attention weights are generated; the attention weight is multiplied by the third feature map to obtain the output feature map of the global coordinate grouping shuffling module.

[0123] Specifically, the multi-stage shared convolutional layer includes a first convolutional layer, a first normalization layer, a first activation layer, a second convolutional layer, a Dropout layer, a third convolutional layer, a second batch of normalization layer, a second activation layer, and a fourth convolutional layer connected in sequence; after the fifth feature map and the sixth feature map are input into the multi-stage shared convolutional layer, they are processed in sequence by the first convolutional layer, the first batch of normalization layer, the first activation layer, the second convolutional layer, the Dropout layer, the third convolutional layer, the second batch of normalization layer, the second activation layer, and the fourth convolutional layer to generate the attention weights corresponding to the fifth feature map and the sixth feature map.

[0124] Figure 5 Schematic diagram of the structure of the global coordinate group shuffling module (GCGS) provided according to some embodiments of the present application. Figure 5As shown in the figure, the output feature map of the SRFPP module is input into the GCGS module as the third feature map, whose size is H×W×C. It is divided into G groups according to the number of channels, then the number of feature map channels of each group becomes C / G, and then the channel order of the feature maps of each group is disrupted, and then bidirectional attention extraction is performed.

[0125] In detail, the grouping mechanism and channel shuffling group the input feature maps by the number of channels, and each group of feature maps is processed separately. Assume that the shape of the input feature map (the third feature map) is X = (B, C, H, W), where B is the batch size. The grouping mechanism divides the feature map into G groups, and the number of channels in each group is C / G. Then the channel shuffling operation enhances the interaction between channels by disrupting the order of channels in the group, and then restores the original shape. The expression is as follows:

[0126]

[0127] In the formula, X 4 is the fourth feature map, and reshape(.) restores the shuffled feature map to its original shape. The above operation ensures that each channel can interact with the channels of other groups, thereby improving the feature representation capability.

[0128] The bidirectional attention mechanism extracts global features by performing global feature extraction and attention calculation in the H direction and W direction of each set of feature maps respectively, thereby effectively improving the representation ability of feature maps.

[0129] Specifically, global average pooling and maximum pooling are performed in the H direction and W direction of each set of feature maps. For the H direction:

[0130] X h_avg =AdaptiveAvgPool2d((H,1))(X 4 ),

[0131] X h_max =AdaptiveAvgPool2d((H,1))(X 4 ) (9)

[0132] In the formula, X h_avg , X h_max Collectively referred to as the fifth characteristic graph.

[0133] For W direction:

[0134] X w_avg =AdaptiveAvgPool2d((1,W))(X 4 ),

[0135] X w_max =AdaptiveMaxPool2d((1,W))(X4 ) (10)

[0136] In the formula, X w_avg , X w_max Collectively referred to as the sixth characteristic graph.

[0137] Then, the pooled features (i.e., the fifth feature map and the sixth feature map) are processed using a multi-stage shared convolution layer to generate attention weights. The multi-stage shared convolution layer can reduce the number of parameters and improve computational efficiency while maintaining effective processing of features.

[0138] The multi-stage shared convolutional layer consists of multiple parts: the convolutional layer (the first convolutional layer and the second convolutional layer) is responsible for reducing the number of channels of the input features, thereby reducing the number of parameters; the batch normalization layer (the first normalization layer and the second batch normalization layer) normalizes the features after dimensionality reduction to ensure the stability of the training process; the activation layer (the first activation layer and the second activation layer) applies the ReLU activation function to increase the nonlinear ability; the Dropout layer randomly discards a part of neurons during the training process to prevent overfitting and enhance the generalization ability of the model; finally, the second convolutional layer restores the original number of channels of the features to maintain the integrity of the features.

[0139] The processing expression of the multi-stage shared convolutional layer is as follows:

[0140] y h_avg =share_conv(x h_avg ),

[0141] y h_max =share_conv(x h_max ),

[0142] y w_avg =share_conv(x w_avg ),

[0143] y w_max =share_conv(x w_max ) (11)

[0144] The final attention weight is generated by the Sigmoid function:

[0145] att h =σ(y h_avg +y h_max ),

[0146] att w =σ(y w_avg +y w_max ) (12)

[0147] In the formula, att h,att w are the attention weights in the H direction and the W direction respectively, and σ(.) is the Sigmoid function.

[0148] The attention weight is applied to the input feature map, and the expression is as follows:

[0149] out=x×att h ×att w (13)

[0150] Finally, the Dropout layer performs further processing, and the formula is as follows:

[0151] Dropout1(out)=out×mask×(1-p), (14)

[0152] In the formula, mask is a binary mask with the same shape as the input out, which is randomly generated with probability p. The Dropout layer effectively reduces the risk of overfitting and improves the generalization ability and computational efficiency of the model.

[0153] The GCGS module provided in this embodiment has the ability to adapt to defects of different sizes. That is, the GCGS module can capture defect features at different scales through global pooling and multi-stage shared convolutional layers, thereby effectively coping with large and small size variations of defects. In other words, no matter whether the defect is a large area defect or a small point-like flaw, the GCGS module can capture it well.

[0154] It should be noted that, from the perspective of the overall structure of the model, in the method of this embodiment, since the SRFPP module extracts features from different scales through multiple convolution, pooling and feature fusion operations, these features contain important information of different scales, and then the GCGS module is added below the SRFPP module. The combination of the two can further perform global grouping coordinate attention processing on these multi-scale features, making the expression of features more accurate and rich, and strengthening the fusion of multi-scale features. At the same time, the GCGS module can refine the features through the attention mechanism, enhance the expression of useful information, reduce the interference of useless information, thereby improving the quality of feature representation, and the combination of the two can significantly improve the feature expression ability and overall performance of the model.

[0155] The SRFPP module achieves the above effects through three mechanisms: First, the grouping mechanism and channel shuffling: by grouping and shuffling channels, full interaction between channels is achieved, and the feature expression capability is enhanced. Secondly, the bidirectional attention mechanism: global feature extraction and attention calculation are performed in the H direction and the W direction at the same time, which can capture global features in different directions. This is effective for detecting defects, because defects may be more obvious in one direction of the image, which effectively improves the representation capability of the feature map. Finally, the multi-stage shared convolution layer: the pooled features are processed using a multi-stage shared convolution layer, that is, applied separately in the H direction and the W direction, ensuring that the feature processing in each direction is coordinated and consistent, further improving the model's sensitivity to different shapes. Dropout technology is added to prevent overfitting of neural networks, increase robustness, reduce the number of parameters, and improve computational efficiency.

[0156] As an example, the sequence of model training is as follows:

[0157] First, the number of classifications and the scaling ratio of the model are defined, and the YOLOv8 backbone network is constructed. The features are gradually extracted through the convolutional layer (Conv) and the C2f module, and the global coordinate group shuffle module (GCGS) and the spatial receptive field pyramid pooling layer (SRFPP) are added to improve the feature representation capability. At different levels of the backbone network, the initial features are extracted from the input image in turn, and the depth of the features is gradually increased through the convolutional layer and the C2f module. Subsequently, the GCGS module and the deeper C2f module are added to the P3 / 8, P4 / 16, and P5 / 32 levels to extract deeper features. Next, the YOLOv8 detection head is constructed, and the features are upsampled and fused using the upsampling layer and the C2f-VMFM module, and the features of different levels in the backbone network are spliced ​​to form a multi-scale feature map. Finally, the feature maps of different scales are input to the Detect layer for target detection, and the detection results of each defect category are output. In the training and evaluation phase, the model is trained using the preprocessed defect dataset, the model parameters are optimized, and the performance of the model is evaluated through the validation set and the test set. The model structure and parameters are adjusted to achieve the best detection effect. The performance evaluation is carried out through indicators such as Precision, Recall, AP, and mAP. The detection performance of the improved YOLOv8 model is compared with that of the original model to verify the improvement effect. Finally, the trained model is applied to the detection of surface defects of LED chips, and the detection results are output and the location and type of each defect are marked.

[0158] The performance of the improved YOLOv8 model is evaluated using the test set. Once the set performance index is reached, it is determined as the LED chip surface defect detection model. The LED chip surface defect detection model is then used to conduct a final test on the test set.

[0159] Figure 6 This is a schematic diagram of some defect detection effects. Figure 6 It can be seen that the improved YOLOv8 network has superior accuracy in surface defect detection of LED chips.

[0160] The indicators for evaluating superiority specifically include: Precision (precision rate / accuracy rate), Recall (recall rate / recall rate). The calculation formulas of the indicators for evaluating superiority can be found in the prior art, and will not be described in detail in this embodiment.

[0161] Figure 7 The following is a comparison diagram of the Precision-Recall Curve (precision-recall rate curve) of the original YOLOv8 network and the improved YOLOv8 network. Figure 7 As shown, the left figure (a) is the precision-recall curve of the original YOLOv8, and the right figure (b) is the precision-recall curve of the improved YOLOv8. It can be seen from the figure that the improved YOLOv8 shown in the right figure (b) generally performs better than the original YOLOv8 in the left figure (a) for various types of defects, indicating that after the improvement of the model, the overall accuracy of all defect types is improved.

[0162] In addition, in order to further verify the effect of improving YOLOv8, we also conducted comparative experiments on different modules and models using the same defect type. The experimental results are as follows:

[0163]

[0164] As can be seen from the above table, the overall performance of the method provided in this embodiment is as follows: Map is 0.778, which is significantly higher than the official Yolov8n's 0.704 and the official unweighted 0.693, showing superiority in overall detection performance. In terms of FPS (frame rate), the performance of the method provided in this embodiment is 96.76FPS, which is lower than the official Yolov8n's 133.32FPS, but significantly higher than the 75.08FPS without SRFPP, indicating that the model has achieved a good balance between accuracy and speed.

[0165] From the perspective of the accuracy of various defect detection, the method provided in this embodiment has a detection accuracy of 0.663 for gold wire defects (GoldenWire), which is higher than most comparison models, showing its advantage in gold wire defect detection. The method provided in this embodiment has an accuracy of 0.757 for electrode defects (Electrode), which is slightly lower than the official unweighted 0.879, but still performs well compared with other models. The method provided in this embodiment has a detection performance of 0.78 for substrate defects (Substrate), close to the highest value of 0.808 (Yolov6), showing its powerful ability in substrate defect detection. The method provided in this embodiment has outstanding performance on scratch defects (Scratch), reaching 0.875, significantly exceeding other models, especially compared with not using C2f-VMFM and not using SRFPP, showing the importance of these modules in scratch detection. The method provided in this embodiment has a detection accuracy of 0.815 for Mesa defects, which is slightly lower than the official Yolov8n's 0.902, but still maintains a high detection performance.

[0166] Furthermore, the contribution of each module is analyzed based on the data in the above table, as follows:

[0167] After removing the C2f-VMFM module, the accuracy of scratch detection dropped significantly, indicating that this module played a key role in improving the accuracy of scratch detection. After removing the GCGS module, the detection accuracy of multiple categories dropped, especially the gold wire and electrode defects, indicating the importance of this module in improving the overall detection capability.

[0168] In terms of comprehensive superiority, the method provided in this embodiment maintains a high frame rate while ensuring high detection accuracy. This shows that although some modules increase the computational complexity, the method provided in this embodiment achieves a balance between processing speed and detection accuracy, and may have better practicality in practical application scenarios.

[0169] In general, the surface defect detection method of LED chips based on improved YOLOv8 provided in the embodiments of the present application shows superior accuracy in multi-category defect detection, especially in the detection of complex defects such as scratches, substrates, Mesa, etc., while maintaining a high level of computational efficiency.

[0170] System Example

[0171] This embodiment provides a surface defect detection system for LED chips based on improved YOLOv8. Figure 8 As shown, the system includes: a data acquisition unit 201, a sample division unit 202, a model improvement unit 203 and a model application unit 204. Among them:

[0172] A data acquisition unit 201 is configured to acquire a surface defect dataset containing LED chips;

[0173] A sample division unit 202 is configured to divide the samples in the surface defect data set into a training set, a validation set and a test set;

[0174] A model improvement unit 203 is configured to improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model;

[0175] The model application unit 204 is configured to iteratively train the improved YOLOv8 model using the surface defect data set until the model converges, obtain a trained model, and use the trained model as a LED chip surface defect detection model;

[0176] Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called the SRFPP module; and a global coordinate group shuffling module (GCGS) is added to the next layer of the SRFPP module.

[0177] The surface defect detection system for LED chips based on improved YOLOv8 provided in this embodiment can implement the steps and processes of the surface defect detection method for LED chips based on improved YOLOv8 provided in any of the above embodiments, and achieve the same technical effects, which will not be described one by one here.

[0178] Exemplary Devices

[0179] This embodiment provides an electronic device, the electronic device comprising:

[0180] one or more processors;

[0181] The computer-readable storage medium may be configured to store one or more programs, and when one or more processors execute the one or more programs, the following steps are implemented:

[0182] Acquire a surface defect dataset containing LED chips;

[0183] Dividing the samples in the surface defect data set to obtain a training set, a validation set, and a test set;

[0184] Improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model;

[0185] Iteratively train the improved YOLOv8 model using the surface defect dataset until the model converges to obtain a trained model, and use the trained model as a surface defect detection model for LED chips;

[0186] Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

[0187] This embodiment further provides an electronic device, the hardware structure of which may include: a processor, a communication interface, a computer-readable storage medium (also referred to as a memory), and a communication bus.

[0188] The processor, the communication interface, and the computer-readable storage medium communicate with each other via a communication bus.

[0189] A computer-readable storage medium may be configured to store one or more programs.

[0190] Optionally, the communication interface may be an interface of a communication module, such as an interface of a GSM module.

[0191] The processor executes one or more programs, which implement the following steps:

[0192] Acquire a surface defect dataset containing LED chips;

[0193] Dividing the samples in the surface defect data set to obtain a training set, a validation set, and a test set;

[0194] Improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model;

[0195] Iteratively train the improved YOLOv8 model using the surface defect dataset until the model converges to obtain a trained model, and use the trained model as a surface defect detection model for LED chips;

[0196] Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

[0197] The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0198] The electronic device of the embodiment of the present application exists in various forms, including but not limited to:

[0199] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (e.g., iPhone), multimedia phones, functional phones, and low-end phones.

[0200] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.

[0201] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0202] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0203] (5) Other electronic devices with data interaction functions.

[0204] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0205] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A surface defect detection method for LED chips based on improved YOLOv8, characterized in that: include: Acquire a surface defect dataset containing LED chips; Dividing the samples in the surface defect data set to obtain a training set, a validation set, and a test set; Improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model; Iteratively train the improved YOLOv8 model using the surface defect dataset until the model converges to obtain a trained model, and use the trained model as a surface defect detection model for LED chips; Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

2. The surface defect detection method of LED chip based on improved YOLOv8 according to claim 1, characterized in that: In the surface defect dataset, the labels of the surface defect images include the following five defect types: gold wire defect, electrode defect, surface defect, scratch defect, and Mesa defect.

3. The surface defect detection method of LED chip based on improved YOLOv8 according to claim 1, characterized in that: The C2f-VMFM module has multiple, The multiple C2f-VMFM modules are used to replace the C2f modules in the head network (Head) of the original YOLOv8 model; Each of the C2f-VMFM modules includes a first convolutional layer, a first branch, and a second branch, the first convolutional layer is connected to the first branch and the second branch respectively, and the first branch and the second branch are arranged in parallel, and the VMFM module is embedded in the second branch; The C2f-VMFM module receives the first feature maps from different levels of the head network (Head), and after being processed by the first convolution layer, inputs the first branch and the second branch respectively, performs group convolution through the first branch, and at the same time, the second branch performs channel attention and spatial attention processing in sequence, and then performs partial residual connection on the processing results of the two branches to obtain the output feature map of the C2f-VMFM module.

4. The surface defect detection method of LED chip based on improved YOLOv8 according to claim 3 is characterized in that: The SRFPP module receives a second feature map, where the second feature map is an output feature map of the last VMFM module of the backbone network; The second feature map is processed by RFAConv as follows: The second feature map is divided into non-overlapping sliding windows through block extraction method and fast group convolution, each sliding window represents a receptive field window, and its size is equal to the size of the convolution kernel; Perform global average pooling on the spatial features of each receptive field window to obtain the global information of each feature and form a normalized attention map; Multiplying the normalized attention map with the receptive field spatial feature after ReLU activation and normalization to generate a weighted feature map F; The weighted feature map F is subjected to feature extraction through a convolution operation to obtain an output feature map Y.

5. The surface defect detection method of LED chip based on improved YOLOv8 according to claim 4 is characterized in that: The global coordinate grouping shuffling module receives a third feature map, where the third feature map is an output feature map of the SRFPP module; The global coordinate grouping shuffling module processes the third feature map as follows: Dividing the third feature map into a plurality of groups according to the number of channels through a grouping mechanism to obtain a feature map of each group; The channel order of each group of feature maps is disrupted by a channel shuffling operation, and then the disrupted feature maps are restored to the original shape of the third feature map to obtain a fourth feature map; Using a bidirectional attention mechanism, global feature extraction and attention calculation are performed on the fourth feature map in the H direction and the W direction at the same time to obtain a fifth feature map in the H direction and a sixth feature map in the W direction; Using a multi-stage shared convolutional layer to process the fifth feature map and the sixth feature map, and generate attention weights accordingly; The attention weight is multiplied by the third feature map to obtain an output feature map of the global coordinate grouping shuffling module.

6. The surface defect detection method of LED chip based on improved YOLOv8 according to claim 5, characterized in that: The multi-stage shared convolutional layer includes a first convolutional layer, a first batch of normalization layers, a first activation layer, a second convolutional layer, a Dropout layer, a third convolutional layer, a second batch of normalization layers, a second activation layer, and a fourth convolutional layer connected in sequence; After the fifth feature map and the sixth feature map are input into the multi-stage shared convolutional layer, they are processed in sequence by the first convolutional layer, the first batch normalization layer, the first activation layer, the second convolutional layer, the Dropout layer, the third convolutional layer, the second batch normalization layer, the second activation layer, and the fourth convolutional layer to generate the attention weights corresponding to the fifth feature map and the sixth feature map.

7. The surface defect detection method of LED chip based on improved YOLOv8 according to claim 1, characterized in that: The improved YOLOv8 model also includes: A VMFM module is linearly connected after the C2f module of the backbone network in the original YOLOv8 model. The input feature map is linearly processed by the C2f module and the VMFM module in turn to obtain the output feature map.

8. A surface defect detection device for LED chips based on improved YOLOv8, characterized in that: include: A data acquisition unit configured to acquire a surface defect dataset containing LED chips; A sample division unit, configured to divide the samples in the surface defect data set into a training set, a validation set and a test set; A model improvement unit, configured to improve the structure of the YOLOv8 network architecture to obtain an improved YOLOv8 model; A model application unit is configured to iteratively train the improved YOLOv8 model using the surface defect data set until the model converges, obtain a trained model, and use the trained model as a LED chip surface defect detection model; Among them, the improved YOLOv8 model includes at least the following improvements: the void rate multi-scale fusion VMFM module is integrated with the C2f module to form a C2f-VMFM module to replace the C2f module in the head network of the original YOLOv8 model; the receptive field attention convolution RFAConv is added to the original SPPF module to form a new spatial receptive field pyramid pooling layer, called SRFPP module; and a global coordinate grouping shuffle GCGS module is added to the next layer of the SRFPP module.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: A memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program.

Citation Information

Cited By

  • Defect detection method and device based on improved YOLO model

    CN121169795A

  • A defect detection method and device based on an improved YOLO model

    CN121169795B

  • Water surface target detection method based on dynamic characteristic modulation

    CN122090043A