Glass bead defect detection method based on improved Yolov11

By improving the YOLOv11 model, using the feature feedback layer and the Wastherstein distance loss function, the problem of insufficient detection accuracy of small targets in glass spheres is solved, and high-precision and robust defect detection are achieved.

CN119904679AActive Publication Date: 2025-04-29JIANGXI GAORUI OPTOELECTRONICS CO LTD

Patent Information

Application Number
CN202411946399.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-29
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

In the detection of glass ball defects, especially the identification of small targets, may be disturbed by complex backgrounds, resulting in insufficient detection accuracy.

Method used

Using the improved YOLOv11 model, the network structure is optimized to enhance the feature expression ability and boundary accuracy of small targets by connecting the feature feedback layer at the input end of the Detect module and introducing the Wastherstan distance loss function.

Benefits of technology

It improves the detection accuracy and robustness of small target defects in glass balls, and can effectively identify small defects in complex industrial environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904679A_ABST
    Figure CN119904679A_ABST
Patent Text Reader

Abstract

The invention discloses a glass bead defect detection method based on improved Yolov11, and the method comprises the steps: S1, data collection: obtaining a plurality of images of different glass beads, and carrying out the classification marking of defects in the images to form a data set; s2, model construction: establishing an improved YOLOv11 model; s3, pre-processing and defect detection: S31, pre-processing: sequentially carrying out ROI region extraction, brightness correction and noise removal on each image; and S32, defect detection: adopting an improved YOLOv11 model to respectively detect all the preprocessed images of the single glass bead, and when at least one unqualified prediction frame exists in all the images of the single glass bead, considering that the glass bead is an unqualified product, otherwise, considering that the glass bead is a qualified product. The method can efficiently and accurately identify the target defect in the glass bead, is good in robustness, and especially has remarkable advantages for small-target glass bead defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of optical defect detection, and in particular relates to a glass ball defect detection method based on improved Yolov11. Background Art

[0002] With the continuous development of industrial automation and intelligent manufacturing, the application of target detection technology in quality control and defect detection is becoming increasingly important. Especially in the production process of glass beads, common defects such as scratches, mesh damage, pits and dirt on the surface significantly affect the performance and use of the product. Although manual inspection can identify these defects, it is often inefficient and easily affected by fatigue and attention fluctuations of the inspector.

[0003] The rapid development of visual machine technology has provided new ideas for solving this problem. Object detection algorithms based on deep learning, especially the YOLO (You Only Look Once) series of models, have high speed and high precision, and have gradually become the mainstream choice for industrial defect detection. In particular, Yolov11 adopts advanced network structure and training strategy, which can significantly improve the detection ability of objects in complex scenes. However, since the defective objects in glass beads, such as dirt and pits, are small and have weak features, Yolov11 still faces the challenge of insufficient detection accuracy in some aspects, especially in complex backgrounds, the recognition of small targets may be disturbed. Therefore, it is necessary to propose a high-precision, high-efficiency and high-robustness glass ball defect detection method for small targets to ensure the effective identification of target defects in glass beads in complex industrial environments. Summary of the invention

[0004] The purpose of the present invention is to address the above problems and propose a glass ball defect detection method based on improved Yolov11, which can efficiently and accurately identify target defects in glass balls and has good robustness, especially has significant advantages in glass ball defect detection for small targets.

[0005] To achieve the above object, the technical solution adopted by the present invention is: The present invention proposes a glass ball defect detection method based on improved Yolov11, comprising the following steps: S1. Data collection: Obtain several images of different glass beads, at least one image of each glass bead, and classify and annotate the defects in the images to form a data set; S2. Model construction: Establish an improved YOLOv11 model. The improved YOLOv11 model is to connect the feature feedback layer in series at the input end of each Detect module of the YOLOv11 model and introduce the Wasserstein distance loss function in the Detect module to perform network optimization to form an improved Detect module, wherein: The feature feedback layer performs the following operations: The input features of the feature feedback layer are sequentially passed through the LN normalization layer, the depthwise separable convolution, the linear layer and the split channel splitting layer to obtain the first extracted feature map; The first extracted feature map is sequentially subjected to dimension conversion, depthwise separable convolution and MSCA module to obtain a second extracted feature map; Multiply the first extracted feature map and the second extracted feature map element by element to obtain a second fused feature map; The second fused feature map is passed through the linear layer and then added element by element to the input feature of the feature feedback layer to obtain the final feedforward feature, which is the output feature of the feature feedback layer. The MSCA module performs the following operations: Extract the spatial feature map of the input features of the MSCA module through depth-wise separable convolution; The spatial feature map is respectively passed through three parallel depth-wise separable convolution modules of different scales to obtain a corresponding third extracted feature map, and all the third extracted feature maps and the spatial feature map are element-wise added to obtain a first fused feature map, where the depth-wise separable convolution module includes two depth-wise separable convolutions connected in series; The first fused feature map is passed through the convolution layer and then multiplied element by element with the input feature of the MSCA module to obtain a second extracted feature map; S3, Pre-processing and defect detection: S31, pre-processing is to extract ROI area, correct brightness and remove noise for each image in turn; S32, defect detection is to use the improved YOLOv11 model to detect all pre-processed images of a single glass ball respectively. When there is at least one unqualified prediction box in all images of a single glass ball, the glass ball is considered to be an unqualified product, otherwise, the glass ball is considered to be a qualified product.

[0006] Preferably, the image of each glass ball is acquired by rotating the glass ball, taking an image at each β angle, and taking M images in total, where β and M are both natural numbers; the defects in the image are classified and labeled using the wizard labeling assistant.

[0007] Preferably, the ROI region is extracted by cropping the image to obtain the glass ball region; Brightness correction is to adjust the brightness and contrast of the cropped image; Noise removal is to use fuzzy processing method to remove noise or interference in the brightness corrected image.

[0008] Preferably, the glass ball defect detection method based on the improved Yolov11 also includes the following steps: The classified and annotated images are split into training set, validation set and test set in the ratio of 8:1:1. The training set, validation set and test set are input into the improved YOLOv11 model to obtain the final improved YOLOv11 model. The final improved YOLOv11 model is used for defect detection.

[0009] Preferably, the improved Detect module performs the following operations: The output features of the corresponding feature feedback layer are respectively passed through the parallel first extraction module, the second extraction module, and the third extraction module to obtain the first output feature, the second output feature, and the third output feature. The first extraction module includes a series of convolutional layers, convolutional layers, convolutional layers, and output layers. The second extraction module includes a series of depth-separable convolutions, convolutional layers, convolutional layers, convolutional layers, and output layers. The third extraction module includes a series of convolutional layers, convolutional layers, convolutional layers, and output layers. The first output feature is the prediction box information, the second output feature is the confidence and defect category, and the third extraction module uses the Wasserstein distance loss function for network optimization.

[0010] Preferably, the Wasserstein distance loss function is as follows: ; ; in, is the Wasserstein distance loss function, is the Wasserstein distance of the i-th image in the dataset, i=1~N, N is the number of images in the dataset, W [f,g] is the Wasserstein distance of a single image, inf is the minimization loss, and r is a single prediction box in a single image and real frame The matching pairs of Γ[f,g] is all the predicted boxes for a single image and real frame The joint distribution of For the prediction box and real frame The matching coordinate differentials between , and , is the abscissa differential of the central coordinate, is the abscissa differential of the central coordinate, is the differential of the width, is the length differential, is the horizontal coordinate of the center coordinate of the prediction box, is the ordinate of the center coordinate of the prediction box, is the width of the prediction box, is the length of the prediction box, is the central horizontal coordinate of the real frame, is the center ordinate of the real frame, is the width of the real frame, is the length of the ground-truth box, and [•] is the Euclidean distance.

[0011] Preferably, the types of marking include six categories: dirt, broken edge, mesh damage, pits, scratches and crescents.

[0012] Preferably, the eligibility criteria for the prediction box are as follows: According to the prediction box information, confidence and defect category output by the improved YOLOv11 model, the number of defect categories is counted and confidence filtering is performed on each defect category. Prediction boxes with a confidence threshold less than the confidence threshold are marked as qualified, and prediction boxes with a confidence threshold greater than or equal to the confidence threshold are marked as pending. The prediction box information includes length, width and center coordinates; Perform the following operations on the pending prediction box: If the defect category is a scratch, determine whether the length or width of the predicted box is greater than the preset size. If so, mark the predicted box as unqualified; otherwise, mark the predicted box as qualified. If the defect category is other, extract the image in the prediction box and convert it into a grayscale image, use the findContours function to find the defect contour and calculate the number of pixels of the defect contour. If the number of pixels of the defect contour is greater than the first preset number, mark the prediction box as unqualified, or if the number of pixels of the defect contour is greater than the second preset number and the number of the current defect category exceeds the third preset number, mark the prediction box as unqualified, otherwise, mark the prediction box as qualified, and the second preset number is less than the first preset number.

[0013] Preferably, the convolution kernel sizes of the two depth-wise separable convolutions of the depth-wise separable convolution module are 1×M and M×1 respectively, where M is a positive integer.

[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: the method first collects images of glass beads to ensure high-resolution and high-quality image input, and adopts an improved Yolov11 model. By connecting feature feedback layers in series at the input end of each Detect module, the detailed features of small targets of different scales can be aggregated to enhance the feature expression ability of small targets; at the same time, the Wasserstein distance loss function is adopted to make the model pay more attention to the boundary accuracy of small targets, and optimize the target boundary more finely, so that the model can more accurately capture the edge details of tiny defects in glass beads, and further improve the detection performance of small targets; and the collected images are pre-processed to extract regions of interest, correct brightness and remove noise in turn to improve the acquisition of high-quality images, lay a foundation for subsequent model detection, and help adopt the improved Yolov11 model for detection. The target defects in glass beads can be efficiently and accurately identified, and the robustness is good, especially the defect detection of glass beads for small targets has significant advantages. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of the glass ball defect detection method based on the improved Yolov11 of the present invention; Figure 2 This is a schematic diagram of the structure of the improved Yolov11 model of the present invention; Figure 3 It is a structural schematic diagram of the characteristic feedback layer of the present invention; Figure 4 Schematic diagram of ROI regions (a) and corresponding detection results (b) of different images of the present invention. DETAILED DESCRIPTION

[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0017] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the technical field of this application. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0018] like Figure 1-Figure 4 As shown, a glass ball defect detection method based on improved Yolov11 includes the following steps: S1. Data collection: Obtain several images of different glass beads, at least one image of each glass bead, and classify and annotate the defects in the images to form a data set.

[0019] In one embodiment, the image of each glass ball is acquired by rotating the glass ball, taking an image at every β angle, and taking M images in total, where β and M are both natural numbers; the defects in the image are classified and labeled using the wizard labeling assistant.

[0020] In one embodiment, the types of marking include six categories: dirt, broken edge, mesh damage, pits, scratches and crescents.

[0021] Specifically, a high-definition camera is used to capture images of different glass balls. For each glass ball, its position is rotated, and an image is captured every 30°, with a total of 12 images captured for each glass ball. After the image is captured, target detection and annotation software, such as the Elf Annotation Assistant, or other annotation software familiar to those skilled in the art can be used to classify and annotate the defects of the glass balls in the image. The annotation type can be adjusted according to actual needs, such as dirt, broken edges, mesh damage, pits, scratches and crescents, for a total of 6 categories. Finally, the images with labels (including real frame information and defect classification information, etc.) are formed into a data set, and can be split into a training set, a validation set, and a test set in a ratio of 8:1:1 for subsequent improvement of YOLOv11 model training and testing.

[0022] S2. Model construction: Establish an improved YOLOv11 model. The improved YOLOv11 model is to connect the feature feedback layer in series at the input end of each Detect module of the YOLOv11 model and introduce the Wasserstein distance loss function in the Detect module to perform network optimization to form an improved Detect module, wherein: The feature feedback layer performs the following operations: The input features of the feature feedback layer are sequentially passed through the LN normalization layer, the depthwise separable convolution, the linear layer and the split channel splitting layer to obtain the first extracted feature map; The first extracted feature map is sequentially subjected to dimension conversion, depthwise separable convolution and MSCA module to obtain a second extracted feature map; Multiply the first extracted feature map and the second extracted feature map element by element to obtain a second fused feature map; The second fused feature map is passed through the linear layer and then added element by element to the input feature of the feature feedback layer to obtain the final feedforward feature, which is the output feature of the feature feedback layer. The MSCA module performs the following operations: Extract the spatial feature map of the input features of the MSCA module through depth-wise separable convolution; The spatial feature map is respectively passed through three parallel depth-wise separable convolution modules of different scales to obtain a corresponding third extracted feature map, and all the third extracted feature maps and the spatial feature map are element-wise added to obtain a first fused feature map, where the depth-wise separable convolution module includes two depth-wise separable convolutions connected in series; The first fused feature map is passed through the convolution layer and then multiplied element by element with the input feature of the MSCA module to obtain the second extracted feature map.

[0023] In one embodiment, the improved Detect module performs the following operations: The output features of the corresponding feature feedback layer are respectively passed through the parallel first extraction module, the second extraction module, and the third extraction module to obtain the first output feature, the second output feature, and the third output feature. The first extraction module includes a series of convolutional layers, convolutional layers, convolutional layers, and output layers. The second extraction module includes a series of depth-separable convolutions, convolutional layers, convolutional layers, convolutional layers, and output layers. The third extraction module includes a series of convolutional layers, convolutional layers, convolutional layers, and output layers. The first output feature is the prediction box information, the second output feature is the confidence and defect category, and the third extraction module uses the Wasserstein distance loss function for network optimization.

[0024] In one embodiment, the convolution kernel sizes of the two depth-wise separable convolutions of the depth-wise separable convolution module are 1×M and M×1 respectively, where M is a positive integer.

[0025] In one embodiment, the Wasserstein distance loss function is as follows: ; ; in, is the Wasserstein distance loss function, is the Wasserstein distance of the i-th image in the dataset, i=1~N, N is the number of images in the dataset, W [f,g] is the Wasserstein distance of a single image, inf is the minimization loss, and r is a single prediction box in a single image and real frame The matching pairs of Γ[f,g] is all the predicted boxes for a single image and real frame The joint distribution of For the prediction box and real frame The matching coordinate differentials between , and , is the abscissa differential of the central coordinate, is the abscissa differential of the central coordinate, is the differential of the width, is the length differential, is the horizontal coordinate of the center coordinate of the prediction box, is the ordinate of the center coordinate of the prediction box, is the width of the prediction box, is the length of the prediction box, is the central horizontal coordinate of the real frame, is the center ordinate of the real frame, is the width of the real frame, is the length of the ground-truth box, and [•] is the Euclidean distance.

[0026] Specifically, the network structure of the YOLOv11 model is improved as follows Figure 2 The main improvements include: connecting the feature feedback layer (FFL) in series at the input end of each Detect module to enhance the feature expression ability of small targets by aggregating the detailed features of small targets of different scales; at the same time, using the Wasserstein distance loss function to further improve the detection performance of small targets.

[0027] Among them, except for the feature feedback layer (FFL) and the Detect module, the Conv (convolutional layer), C3k2 module, SPPF module, C2PSA module, Concat module, and Upsample module in other structures are module structures and connection methods in the existing YOLOv11 model that are well known to those skilled in the art. Figure 3 As shown in the figure. First, the input features of the feature feedback layer are passed through the LN normalization layer, the depth-wise separable convolution and the linear layer to extract deeper features; then, the channel is divided into two parts through the split channel splitting layer, one part of the features is sequentially transformed through dimension, depth-wise separable convolution and MSCA module to extract multi-scale deep information, and then multiplied element-by-element with the other part of the features to obtain deep features of different scales; finally, after passing through the linear layer, the input features of the feature feedback layer are added element-by-element to obtain the final feedforward features.

[0028] Specifically, the MSCA module performs the following operations: 1. Extract spatial feature maps through 3×3 depth-separable convolution : The 3×3 depth-wise separable convolution can effectively extract spatial features while reducing computational complexity. The calculation formula is as follows: =DSC(X); Among them, X is the input feature of the MSCA module, and DSC is the depth-wise separable convolution.

[0029] 2. Spatial feature map The multi-scale features are obtained through three depth-wise separable convolution modules and combined with the spatial feature map Add element by element to get the first fusion feature map : Using multi-scale convolution to capture information of different scales and adding and fusing features element by element can enhance information expression. The calculation formula is as follows: ( , ); in, represents the mth third extracted feature map, that is, the spatial information of the mth scale.

[0030] 3. First fusion feature map The second extracted feature map is obtained by multiplying the input feature of the MSCA module after the 1×1 convolution layer. : 1×1 convolution adjusts the channel relationship and multiplies it with the original features to achieve effective fusion of multi-scale information. The calculation formula is as follows: X; in, It is a 1×1 convolution layer. Adjusting the channel relationship through 1×1 convolution is conducive to the effective fusion of multi-scale information. is element-wise multiplication.

[0031] Detect module such as Figure 2 As shown, Conv represents a convolutional layer (ordinary convolution), DWConv represents a depth-separable convolution, Bbox, Cls, and WD correspond to the output layers representing the first output feature, the second output feature, and the third output feature, respectively. The first output feature and the second output feature can use the loss function of the Detect module in the existing YOLOv11 model, and the third output feature uses the Wasserstein distance loss function.

[0032] Wasserstein Distance Loss is used to measure the distance between the predicted prediction box and the true prediction box, so as to optimize the position of small objects more accurately. Specifically, Wasserstein distance calculates the difference between the center position of the prediction box and the defect size, and incorporates the translation and scaling differences into the loss, so that the model pays more attention to the boundary accuracy of small objects. Compared with the traditional IoU loss, Wasserstein Distance Loss can handle the box offset error more smoothly and has better optimization effect on the prediction box of small objects.

[0033] S3, Pre-processing and defect detection: S31, pre-processing is to extract ROI area, correct brightness and remove noise for each image in turn; S32, defect detection is to use the improved YOLOv11 model to detect all pre-processed images of a single glass ball respectively. When there is at least one unqualified prediction box in all images of a single glass ball, the glass ball is considered to be an unqualified product, otherwise, the glass ball is considered to be a qualified product.

[0034] In one embodiment, the ROI region extraction is to crop the image to obtain the glass ball region; Brightness correction is to adjust the brightness and contrast of the cropped image; Noise removal is to use fuzzy processing method to remove noise or interference in the brightness corrected image.

[0035] In one embodiment, the glass ball defect detection method based on the improved Yolov11 further includes the following steps: The classified and annotated images are split into training set, validation set and test set in the ratio of 8:1:1. The training set, validation set and test set are input into the improved YOLOv11 model to obtain the final improved YOLOv11 model. The final improved YOLOv11 model is used for defect detection.

[0036] In one embodiment, the eligibility criteria for the prediction box are as follows: According to the prediction box information, confidence and defect category output by the improved YOLOv11 model, the number of defect categories is counted and confidence filtering is performed on each defect category. Prediction boxes with a confidence threshold less than the confidence threshold are marked as qualified, and prediction boxes with a confidence threshold greater than or equal to the confidence threshold are marked as pending. The prediction box information includes length, width and center coordinates; Perform the following operations on the pending prediction box: If the defect category is a scratch, determine whether the length or width of the predicted box is greater than the preset size. If so, mark the predicted box as unqualified; otherwise, mark the predicted box as qualified. If the defect category is other, extract the image in the prediction box and convert it into a grayscale image, use the findContours function to find the defect contour and calculate the number of pixels of the defect contour. If the number of pixels of the defect contour is greater than the first preset number, mark the prediction box as unqualified, or if the number of pixels of the defect contour is greater than the second preset number and the number of the current defect category exceeds the third preset number, mark the prediction box as unqualified, otherwise, mark the prediction box as qualified, and the second preset number is less than the first preset number.

[0037] Specifically, Figure 1 As shown, the pre-processing steps are as follows: Extracting the region of interest (ROI): First, crop the image of the glass ball, extract the region of interest, and remove irrelevant parts of the image so that you can focus more on the surface area of ​​the glass ball later. The extracted ROI area is as follows: Figure 4 (a) shown.

[0038] Brightness correction: Perform brightness correction on the cropped image to adjust the brightness and contrast of the image, improve the visibility of the target, make the image details clearer, and facilitate subsequent processing.

[0039] Noise removal: Mainly used to detect and clean up stains in images. By smoothing each detection area in the image, significant noise or interference is found and erased using a fuzzy processing method, so that the stain area has a smooth transition and the impact of noise on subsequent detection is reduced.

[0040] The defect detection operation steps are as follows: After image preprocessing, the improved YOLOv11 model was used to detect 12 images of a single glass ball. The prediction box information, confidence, and defect category detected by the improved YOLOv11 model were collected, and the number of defect categories was counted. The prediction box information included length, width, and center coordinates. For each defect category, confidence threshold filtering was performed: the confidence threshold was set to 0.45, and the prediction boxes with a confidence threshold less than 0.45 were marked as OK (qualified); the prediction boxes with a confidence threshold greater than the confidence threshold were subjected to the following operations:

[0041] 1) Scratch defect: Set the preset size to 10 pixels. If the length or width of the prediction box is greater than 10 pixels, the prediction box is marked as NG (unqualified); otherwise, the prediction box is marked as OK (qualified).

[0042] 2) Other defects: Extract the image in the prediction box and convert it into a grayscale image. Use the findContours function in OpenCV to find the defect contour and filter out the largest defect contour. If the number of pixels (area) of the largest defect contour is greater than 1000 pixels, mark the prediction box as NG; if the area is greater than 220 pixels and the number of current defect categories exceeds two, it is also marked as NG. The rest are marked as OK.

[0043] Among the detection results of the 12 images taken by the above glass balls, if there is an image with a prediction box of NG, the glass ball is judged to be NG. The detection effect is as follows Figure 4 As shown in (b), the red box represents an NG defect, and the yellow box represents a defect identified by the improved YOLOv11 model but filtered by the threshold, which represents an OK defect. It is easy to understand that the above preset parameters can be adjusted according to actual needs.

[0044] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0045] The above-described embodiments only express the more specific and detailed embodiments described in this application, but they cannot be understood as limiting the scope of the patent application. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this application, which all belong to the protection scope of this application. Therefore, the protection scope of the patent application shall be based on the attached claims.

Claims

1. A glass ball defect detection method based on improved Yolov11, characterized in that: The glass ball defect detection method based on improved Yolov11 comprises the following steps: S1. Data collection: Obtain several images of different glass beads, at least one image of each glass bead, and classify and annotate the defects in the images to form a data set; S2. Model construction: Establish an improved YOLOv11 model, wherein the improved YOLOv11 model is formed by connecting a feature feedback layer in series at the input end of each Detect module of the YOLOv11 model and introducing a Wasserstein distance loss function in the Detect module to perform network optimization, wherein: The feature feedback layer performs the following operations: The input features of the feature feedback layer are sequentially passed through the LN normalization layer, the depthwise separable convolution, the linear layer and the split channel splitting layer to obtain the first extracted feature map; The first extracted feature map is sequentially subjected to dimension conversion, depthwise separable convolution and MSCA module to obtain a second extracted feature map; Multiply the first extracted feature map and the second extracted feature map element by element to obtain a second fused feature map; The second fused feature map is passed through the linear layer and then added element by element to the input feature of the feature feedback layer to obtain the final feedforward feature, which is the output feature of the feature feedback layer. The MSCA module performs the following operations: Extract the spatial feature map of the input features of the MSCA module through depth-wise separable convolution; The spatial feature map is respectively passed through three parallel depth-separable convolution modules of different scales to obtain a corresponding third extracted feature map, and all the third extracted feature maps and the spatial feature map are element-by-element added to obtain a first fused feature map, wherein the depth-separable convolution module includes two depth-separable convolutions connected in series; The first fused feature map is passed through the convolution layer and then multiplied element by element with the input feature of the MSCA module to obtain a second extracted feature map; S3, Pre-processing and defect detection: S31, the pre-processing is to extract ROI area, correct brightness and remove noise for each image in sequence; S32, the defect detection is to use the improved YOLOv11 model to detect all pre-processed images of a single glass ball respectively. When there is at least one unqualified prediction box in all images of a single glass ball, the glass ball is considered to be an unqualified product, otherwise, the glass ball is considered to be a qualified product.

2. The glass ball defect detection method based on improved Yolov11 as claimed in claim 1, characterized in that: The image acquisition method of each glass ball is to rotate the glass ball, take an image at every β angle, and take M images in total, where β and M are both natural numbers; the classification and labeling of defects in the image is achieved by using the wizard labeling assistant.

3. The glass ball defect detection method based on improved Yolov11 as claimed in claim 1, characterized in that: The ROI region extraction is to crop the image to obtain the glass ball region; The brightness correction is to adjust the brightness and contrast of the cropped image; The noise removal is to remove the noise or interference in the image after brightness correction by using a fuzzy processing method.

4. The glass ball defect detection method based on improved Yolov11 as claimed in claim 1, characterized in that: The glass ball defect detection method based on improved Yolov11 also includes the following steps: The classified and annotated images are split into training set, validation set and test set in the ratio of 8:1:

1. The training set, validation set and test set are input into the improved YOLOv11 model to obtain the final improved YOLOv11 model. The final improved YOLOv11 model is used for defect detection.

5. The glass ball defect detection method based on improved Yolov11 as claimed in claim 1, characterized in that: The improved Detect module performs the following operations: The output features of the corresponding feature feedback layer are respectively passed through a parallel first extraction module, a second extraction module, and a third extraction module to obtain a first output feature, a second output feature, and a third output feature. The first extraction module includes a series of convolutional layers, convolutional layers, convolutional layers, and output layers. The second extraction module includes a series of depth-separable convolutions, convolutional layers, convolutional layers, convolutional layers, and output layers. The third extraction module includes a series of convolutional layers, convolutional layers, convolutional layers, and output layers. The first output feature is prediction box information, and the second output feature is confidence and defect category. The third extraction module uses a Wasserstein distance loss function for network optimization.

6. The glass ball defect detection method based on improved Yolov11 as claimed in claim 1, characterized in that: The Wasserstein distance loss function is formulated as follows: ; ; in, is the Wasserstein distance loss function, is the Wasserstein distance of the i-th image in the dataset, i=1~N, N is the number of images in the dataset, is the Wasserstein distance of a single image, inf is the minimization loss, and r is a single prediction box in a single image and real frame The matching pairs of is all the predicted boxes for a single image and real frame The joint distribution of For the prediction box and real frame The matching coordinates between are differentiated, and , is the abscissa differential of the central coordinate, is the abscissa differential of the central coordinate, is the differential of the width, is the length differential, is the horizontal coordinate of the center coordinate of the prediction box, is the ordinate of the center coordinate of the prediction box, is the width of the prediction box, is the length of the prediction box, is the central horizontal coordinate of the real frame, is the center ordinate of the real frame, is the width of the real frame, is the length of the ground-truth box, and [•] is the Euclidean distance.

7. The glass ball defect detection method based on improved Yolov11 as claimed in claim 1, characterized in that: The types of markings include six categories: dirt, broken edges, mesh damage, pits, scratches and crescents.

8. The glass ball defect detection method based on improved Yolov11 as claimed in claim 7, characterized in that: The eligibility criteria for the prediction box are as follows: According to the prediction box information, confidence and defect category output by the improved YOLOv11 model, the number of each defect category is counted and confidence filtering is performed on each defect category. The prediction box with a value less than the confidence threshold is marked as qualified, and the prediction box with a value greater than or equal to the confidence threshold is marked as pending. The prediction box information includes length, width and center coordinates; Perform the following operations on the pending prediction box: If the defect category is a scratch, determine whether the length or width of the predicted box is greater than the preset size. If so, mark the predicted box as unqualified; otherwise, mark the predicted box as qualified. If the defect category is other, extract the image in the prediction box and convert it into a grayscale image, use the findContours function to find the defect contour and calculate the number of pixels of the defect contour. If the number of pixels of the defect contour is greater than the first preset number, mark the prediction box as unqualified, or if the number of pixels of the defect contour is greater than the second preset number and the number of the current defect category exceeds the third preset number, mark the prediction box as unqualified, otherwise, mark the prediction box as qualified, and the second preset number is less than the first preset number.

9. The glass ball defect detection method based on improved Yolov11 as claimed in claim 1, characterized in that: The convolution kernel sizes of the two depth-wise separable convolutions of the depth-wise separable convolution module are 1×M and M×1 respectively, where M is a positive integer.

Citation Information

Patent Citations

  • Optical glass anomaly detection method and device

    CN113870204A

  • Device and method for detecting spherical degree of automotive glass

    CN115937571A

  • Glass bead surface appearance defect detection method based on deep learning

    CN116342491A

  • Glass bead defect detection algorithm based on Ghostnet and attention mechanism

    CN117173133A

  • Traffic cone and traffic column recognition algorithm for aided driving

    CN118470686A

Cited By

  • Multi-mode teenager idiopathic scoliosis screening method based on back RGB-D image

    CN120543912A

  • Quartz fiber glass bead defect detection method and system based on microscopic imaging

    CN121147103A