High-reflection and high-transmittance material surface flaw detection method based on improved YOLOv11

By improving the YOLOv11 network, DySnakeConv and ContextAggregation modules were introduced, combined with the cross-region area weight allocation strategy, the accuracy and real-time problems in surface defect detection of high-inverse and high-transparency materials were solved, and high-precision and real-time defect detection and equipment fault diagnosis were achieved.

CN120580221AActive Publication Date: 2025-09-02ANHUI AGRICULTURAL UNIVERSITY

Patent Information

Application Number
CN202510917786.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-03
Publication Date
2025-09-02
Estimated Expiration
2045-07-03

AI Technical Summary

Technical Problem

In the detection of surface defects of high-reverse and high-permeability materials, the existing technology has problems such as insufficient detection accuracy of micro defects, high misjudgment rate of dense defects, and lack of defect quantification and traceability, which cannot meet the inspection requirements of industry standard GB/T36259-2018.

Method used

The improved YOLOv11 network is adopted, the DySnakeConv module and the ContextAggregation module are introduced, combined with the cross-region area weight allocation strategy, and the pixel-physical dimension mapping model is built, and the micro defect recognition ability is enhanced through the dynamic deformable convolution module, and combined with lightweight network structure and hardware acceleration optimization to achieve real-time detection.

Benefits of technology

It realizes high-precision detection of surface defects of high-reverse and high-transparent materials, with a detection error of ≤±0.05mm, meets the requirements of real-time detection speed, provides an efficient and reliable defect detection solution, and supports the accurate diagnosis of equipment failures and defect quantification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120580221A_ABST
    Figure CN120580221A_ABST
Patent Text Reader

Abstract

The invention discloses an improved YOLOv11-based high-reflection and high-transmittance material surface defect detection method, which comprises the following steps: S1, acquiring a mobile phone screen surface defect image, preprocessing and labeling, and generating a training data set containing three defects of scratches, edge breakage and cracks; s2, constructing a defect detection model; s3, averagely dividing an input image into four independent detection regions, adopting a bounding box overlapping area weight distribution strategy for cross-region defects, and performing partition counting on the image by using a defect detection model; s4, constructing a surface defect detection network meeting the real-time requirement of the industrial production line, and outputting a detection result and a processing frame rate; s5, pixel-level mask segmentation is carried out on the scratch defect, and contour coordinates and geometric features are extracted; and S6, fitting the actual damage size of the scratch defect on the surface of the high-reflection and high-transmittance material according to the segmentation result. According to the method, the detection speed is high under the condition that the accuracy is ensured, and a reliable solution is provided for surface flaw detection of the high-reflection and high-transmittance material.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence machine vision detection technology, and in particular relates to a method for detecting surface defects of high-reflective and high-transmittance materials based on an improved YOLOv11. Background Art

[0002] High-reflectivity and high-transmittance materials, key materials in high-end manufacturing, are widely used in the production of precision components such as mobile phone screens, automotive glass, and optical lenses. However, their surfaces are susceptible to mechanical friction or environmental stress during processing, cleaning, and transportation, resulting in microscopic defects such as scratches, chipping, and cracks. These defects not only affect the product's appearance but also reduce optical performance and even cause structural failure. For example, minute scratches on the surface of a mobile phone screen can reduce touch sensitivity, while chipping defects on automotive glass can cause stress concentration and reduce impact resistance. Therefore, achieving high-precision and efficient surface defect detection during the production process is crucial.

[0003] In recent years, deep learning-based machine vision technology has made significant progress in surface defect detection. By extracting defect features using convolutional neural networks (CNNs) and training models using large-scale defect datasets, existing technologies can now automatically classify most defects. To further enhance detection robustness, researchers have introduced multimodal data fusion methods, such as overlaying infrared and visible light images to enhance defect contrast, or using thermal imaging to capture differences in material stress distribution.

[0004] While these methods can improve recognition rates in complex backgrounds, they still have limitations: insufficient accuracy for detecting small defects, a high rate of misjudgment of densely packed defects, and a lack of defect quantification and traceability. This fails to meet the inspection rules for various defects in touch screen inspection reports, as specified in the current industry standard GB / T36259-2018, "High-aluminum-silicon Glass for Touch Screen Covers."

[0005] To this end, the present invention proposes a surface defect detection method for high-reflective and high-transmittance materials based on improved YOLOv11. Summary of the Invention

[0006] In response to the problems existing in the above-mentioned prior art, the purpose of the present invention is to propose a surface defect detection method for high-reflective and high-transmittance materials based on an improved YOLOv11. This method enhances the ability to identify tiny defects through a dynamic deformable convolution module, combines a cross-regional area weight distribution strategy to achieve accurate defect tracing, and constructs a pixel-physical size mapping model to make the scratch length detection error ≤±0.05mm, while meeting the real-time detection speed requirements (≥200FPS), providing an efficient and reliable solution for surface quality inspection of highly reflective materials.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] A first aspect of the present invention provides a method for detecting surface defects of high-reflective and high-transmittance materials based on an improved YOLOv11, comprising the following steps:

[0009] S1. Collect surface defect images of mobile phone screens from industrial production lines to construct a dataset of original surface defect images. Preprocess and annotate the dataset to generate a training dataset containing three types of defects: scratches, chipping, and cracks.

[0010] S2. Build and train the improved YOLOv11 network model to construct a defect detection model;

[0011] S3. Divide the input image into four independent detection areas on average, adopt the bounding box overlap area weight distribution strategy for cross-region defects, and use the defect detection model to count the image partitions;

[0012] S4. Through lightweight network structure adjustment and hardware acceleration optimization, a surface defect detection network that meets the real-time requirements of industrial production lines is built, and the detection results and processing frame rate are output;

[0013] S5. Perform pixel-level mask segmentation on the scratch defect to extract contour coordinates and geometric features;

[0014] S6. Fit the actual damage size of the scratch defect on the surface of the high-reflective and high-transmittance material based on the segmentation results.

[0015] Preferably, in step S1, the steps of collecting original mobile phone screen surface defect images, constructing a surface defect dataset, preprocessing and annotating the original surface defect image dataset, and generating a training dataset containing three types of defects: scratches, chipping, and cracks, specifically include:

[0016] S11. In a darkroom environment, the relative spatial parameters of the mobile camera and the mobile phone screen to be tested are fixed. The camera is vertically mounted on the top of the platform, and the mobile phone screen is horizontally placed on a black background and fixed to the bottom of the platform. The device is wrapped with black light-blocking velvet to eliminate interference from ambient stray light. Multiple strip light sources are evenly arranged at 45° above the circumference of the screen for directional oblique lighting. Images of mobile phone screen surface defects from multiple angles are collected to construct an original surface defect image dataset.

[0017] S12, preprocessing the original surface defect image dataset, including format unification, size normalization, and random rotation, flipping, and brightness adjustment operations, to generate an enhanced defect sample library;

[0018] S13. Perform bounding box annotation on the defect targets in the enhanced dataset, and define three types of defect labels: scratches, chipping, and cracks. Generate an annotation file containing the three types of defects, including scratches, chipping, and cracks, and in accordance with the PASCAL VOC format, as a training dataset.

[0019] Preferably, in step S2, the building of the improved YOLOv11 network model includes the steps of:

[0020] S21. The DySnakeConv dynamic deformable convolution module replaces the C3K2 standard convolution layer in the original Bottleneck structure of the YOLOv11 network. By introducing illumination invariance preprocessing to suppress high reflective interference, it provides stable input for subsequent feature extraction. The dynamic deformable convolution kernel relies on an adaptive deformation mechanism to accurately fit the defect edge shape, enhancing the ability to capture tiny defect edges and texture features.

[0021] S22. Integrate the ContextAggregation module at the output of the 11th layer C2PSA feature in the YOLOv11 network to build a local-global collaborative multi-scale feature mechanism, which simultaneously solves the problems of small defect feature loss and large defect context information deficiency. It also fuses shallow detail information with deep semantic features through a cross-level feature pyramid aggregation mechanism to suppress complex background noise interference.

[0022] S221. To address the problem that the existing YOLOv11 design does not fully consider the contextual association differences of defects of different scales, this paper introduces a local-global context branch. For small defects with a size of <5×5 pixels, local window attention (with a window space radius of r=5) is used to capture fine-grained features. For large defects with a size of >20×20 pixels, a global multi-head attention mechanism is used to model long-range dependencies. Branch fusion achieves adaptive control through a dynamic weight mapping function, which is defined as:

[0023] α=σ(MLP(||x||2))

[0024] Where x is the feature vector of the branch output, and ||x||2 calculates its L2 norm to measure feature significance; the multi-layer perceptron MLP performs nonlinear transformation on the norm result; the Sigmoid function σ compresses the output to the interval (0,1) and generates the weight α that controls the local-global branch fusion ratio;

[0025] In particular, to address the pain points of scenarios where the surface of highly reflective and highly transparent materials is prone to reflective interference and defects are densely overlapping, this module relies on the local-global branch to accurately capture fine-grained and long-range features, and the dynamic weights to adaptively control the fusion of complex features. It can effectively distinguish the boundaries of overlapping defects and suppress reflective noise, showing unique advantages in accurate identification and anti-interference in the detection of densely overlapping defects.

[0026] S23. Use the depthwise separable convolution (DSConv) module to replace the standard convolution layer of the Neck part, reducing the computational complexity while maintaining detection accuracy and optimizing and improving the model inference speed.

[0027] Preferably, in step S2, the training and improving the YOLOv11 network model comprises the steps of:

[0028] S24. Use random stratified sampling to divide the surface defect dataset into training set, validation set, and test set in a ratio of 7:2:1 to ensure a balanced distribution of each defect category;

[0029] S25, based on the YOLOv11 network weights pre-trained on the COCO dataset, initialize the model parameters, freeze the first 50 training cycles of the backbone network, and set the initial learning rate to 1×10 -4 , the decay rate is 0.96; after 50 cycles, the backbone network is unfrozen and the learning rate is adjusted to 1×10 -5 The decay rate was kept at 0.96, and the Adam optimizer was used for iterative training up to 150 cycles.

[0030] S26. Use the validation set to verify the trained improved YOLOv11 network model, calculate the average precision, recall rate and false positive rate indicators through the validation set, select the optimal weights and save them to the test set for final performance evaluation.

[0031] Preferably, in step S3, the input image is evenly divided into four independent detection areas, a bounding box overlapping area weight distribution strategy is adopted for cross-region defects, and the image is partitioned and counted using a defect detection model. The specific steps include:

[0032] S31. Divide the input image into four independent detection areas: upper left, lower left, upper right, and lower right. For defect targets distributed across regions, determine their assigned partition based on the maximum weight distribution strategy between the bounding box and the overlapping area of ​​each region. The calculation formula is as follows:

[0033] A k =Area(B∩R k )

[0034] Among them, A k Represents the bounding box B and partition R k The overlapping area, B=(x min ,y min , x max ,y max ) is the bounding box coordinate parameter, R k ∈{TL, TR, BL, BR} represents the four partitions of upper left, lower left, upper right, and lower right, R * Indicates the partition to which the defect ultimately belongs;

[0035] S32, through the root mean square error RMSE, mean absolute error MAE, determination coefficient R 2The statistical differences between defect detection results and actual measurement data are compared using residual analysis methods to verify the accuracy of partition counting.

[0036] Preferably, in step S4, the construction of a surface defect detection network that meets the real-time requirements of industrial production lines through lightweight network structure adjustment and hardware acceleration optimization includes the following steps:

[0037] Based on the improved YOLOv11 defect detection model, network layer fusion and INT8 quantization processing are performed through the TensorRT framework to reduce the model's computational complexity. Depthwise separable convolution is used to replace the standard convolution layer in the Neck part, and channel pruning technology is combined to remove redundant parameters, reducing the number of model parameters and building a surface defect detection network that meets the real-time requirements of industrial production lines.

[0038] Preferably, in step S5, the pixel-level mask segmentation of the scratch defect comprises the steps of:

[0039] S51. Based on the labeled scratch defect samples, generate multi-scale segmentation training data through random rotation, affine transformation and brightness perturbation;

[0040] S52. Label the outlines of the mobile phone screen glass defects using Labelme software. After generating a mask file in JSON format, convert it into a TXT file in YOLO format according to the COCO dataset specification. Each record contains the defect category number, normalized center coordinates, and bounding box size.

[0041] S53, call the batch reasoning interface of the defect detection model, detect the segmented image and output the structured detection results, save each record in the text file containing the coordinates of the defect center point (x C ,y C ), bounding box size (w, h) and confidence p, whose value range satisfies x C 、y C ∈[0,1], w, h∈(0,1], p≥0.5.

[0042] Preferably, in step S6, the actual damage size of the scratch defect on the surface of the high-reflective and high-transmittance material is fitted according to the segmentation result, and the specific steps include:

[0043] S61. Calculate the total length of the scratch using the Euclidean distance accumulation algorithm based on the contour point set output by the segmentation mask. The calculation formula is as follows:

[0044]

[0045] Among them, L is the scratch length based on pixel coordinates, n is the total number of contour points, k is the index variable of the contour point set, and x is the number of contour points. k 、yk represents the pixel coordinates of the kth contour point extracted from the mask, x k+1 、y k+1 Represents the pixel coordinates of the k+1th contour point adjacent to point k;

[0046] S62. Evaluation is performed by comparing the differences between the results detected in the defect range and the actual measured data. Evaluation methods include root mean square error, mean absolute error, coefficient of determination, and residual analysis. The actual physical dimensions are mapped in combination with calibration parameters to generate a defect quantification report that complies with the GB / T36259-2018 standard.

[0047] The present invention also provides a computer device, including a memory and a processor; the memory is used to store a computer program and the execution logic of the above-mentioned high-reflection and high-transmittance material surface defect detection method based on the improved YOLOv11.

[0048] The present invention has the following beneficial effects:

[0049] (1) The present invention provides a surface defect detection method for high-reflective and high-transmittance materials based on YOLOv11, which uses the YOLOv11 network framework as the basic framework and introduces the DySnakeConv module to replace the standard convolution operation in C3K2. By introducing illumination invariance preprocessing, high-reflective interference is suppressed to provide stable input for subsequent feature extraction. The dynamic deformable convolution kernel relies on the adaptive deformation mechanism to accurately fit the defect edge morphology, effectively enhancing the model's ability to capture defect edge and texture features. A ContextAggregation module is also added at an appropriate position in the YOLOv11 network framework, and its cross-level feature aggregation mechanism is used to strengthen the global context information modeling. A local-global context branch is introduced, and a local window attention (setting the window space radius r=5) is used to capture fine-grained features for small defects with a size of <5×5 pixels. A global multi-head attention mechanism is used to model long-range dependencies for large defects with a size of >20×20 pixels, thereby improving the recognition robustness under complex background interference. The present invention has a faster detection speed while ensuring accuracy, is suitable for detecting images containing a large number of defects, and provides a reliable solution for detecting surface defects on highly reflective and highly transparent materials.

[0050] (2) In the present invention, a defect statistics method based on image division is also proposed. By establishing an accurate defect location and traceability mechanism, accurate diagnosis of production equipment failures is achieved. Specifically, the method first divides each image to be detected into four detection areas: upper left, lower left, upper right, and lower right. For defect targets distributed across regions, the principle of maximizing the overlapping area of ​​the bounding box is used to determine the attribution, that is, by calculating the overlapping area between the defect bounding box and each detection area, the defect is classified into the corresponding area with the largest overlapping area. This allocation strategy based on geometric features effectively solves the attribution determination problem of traditional methods in cross-region defect statistics. Furthermore, by continuously monitoring the dynamic changes of defect counts in each region, when a specific region has a defect number significantly higher than the threshold within a continuous detection cycle, the system can automatically generate an equipment failure warning, providing an accurate spatial positioning reference for production line maintenance. In order to verify the reliability of the method, the manually labeled true value counts and model detection values ​​are compared and analyzed. By calculating quantitative indicators such as the mean absolute error and the coefficient of determination, the detection performance of the system is evaluated from multiple dimensions to ensure that the detection results meet the requirements of industrial-grade quality control. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0052] Figure 1 This is a flow chart of a method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 in the present invention;

[0053] Figure 2 To improve the network structure diagram of YOLOv11;

[0054] Figure 3 Schematic diagram of different types of defects;

[0055] Figure 4 This is the convolution operation flow chart of DySnakeConv;

[0056] Figure 5 It is the ContextAggregation aggregation flow chart;

[0057] Figure 6 This is a graph showing the detection results of the surface defects to be detected by the improved YOLOv11 model in Example 1;

[0058] Figure 7 This is the result graph of counting analysis after partition counting. DETAILED DESCRIPTION

[0059] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

[0060] Example 1

[0061] Reference Figure 1-7 The present invention provides a method for detecting surface defects of high-reflective and high-transmittance materials based on an improved YOLOv11, comprising the following steps:

[0062] S1. Collect surface defect images of mobile phone screens from industrial production lines to construct a dataset of original surface defect images. Preprocess and annotate the dataset to generate a training dataset containing three types of defects: scratches, chipping, and cracks.

[0063] Specifically, the method includes the following steps:

[0064] S11. Use a high-precision mobile industrial camera to acquire images of surface defects on mobile phone screens in a standardized acquisition environment. The camera resolution is 1920×1080 pixels. The relative spatial parameters between the mobile camera and the mobile phone screen under test are fixed in a darkroom environment. The camera is mounted vertically on the top of the platform, and the mobile phone screen is placed horizontally on a black background plate and fixed to the bottom of the platform. The device is wrapped with black light-blocking velvet to eliminate ambient stray light interference. Multiple strip light sources are evenly arranged at a 45° angle above the circumference of the screen for directional oblique lighting. Images of mobile phone screen surface defects are acquired from multiple angles, with a total of 452 original images collected. In view of the imaging characteristics of highly reflective and highly transparent materials, a black light-absorbing background plate is set to eliminate ambient light interference, and multi-angle strip light sources are configured for directional fill lighting, effectively suppressing surface reflections and edge exposure on the screen, ensuring that defect features are clearly visible.

[0065] S12, performing data cleaning, data enhancement and other preprocessing on the original surface defect image dataset, including format unification, size normalization, and random rotation, flipping, and brightness adjustment operations, to generate an enhanced defect sample library;

[0066] S13. Use Labelimg software to annotate the bounding boxes of the defect targets in the enhanced defect dataset, divide it into training set, validation set and test set according to 7:2:1, and define three types of defect labels: Crack, Scratch and Chipping. Figure 3As shown in the figure, a annotation file containing three types of defects, namely scratches, chipping and cracks, is generated and conforms to the PASCAL VOC format.

[0067] S2. Improve on the basis of YOLOv11, build and improve the YOLOv11 network model, train and optimize parameters, and build a defect detection model;

[0068] Specifically, the YOLOv11 network structure is improved. The YOLOv11 network structure mainly consists of three parts: Backbone, Neck and Head.

[0069] The backbone is responsible for feature extraction and uses a series of convolutional and deconvolutional layers combined with residual connections and a bottleneck structure to reduce network size and improve performance. This part uses the C3K2 module as its basic building block.

[0070] The Neck part is responsible for multi-scale feature fusion, which integrates feature maps from different stages of Backbone to enhance feature expression capabilities.

[0071] Specifically, the Neck part of YOLOv11 includes the following components:

[0072] SPPF module (Spatial Pyramid Pooling Fast): performs pooling operations at different scales, concatenating feature maps of different scales to improve the detection capability of objects of different sizes.

[0073] C2PSA module (Convolutional module with parallel spatial attention): Enhances the expressiveness of feature maps through the parallel spatial attention mechanism.

[0074] The head part is responsible for the final target detection and classification tasks, including a detection head and a classification head:

[0075] Detection head: Contains a series of convolutional layers and deconvolutional layers to generate detection results.

[0076] Classification head: Global Average Pooling is used to classify each feature map, and the probability distribution of each category is output by reducing the dimension of the feature map.

[0077] Aiming at the problem of small target detection and similar object confusion on the mobile phone screen surface, this paper introduces the DySnakeConv module, ContextAggregation module and DSConv lightweight module on the basis of YOLOv11 to construct a network model, in which:

[0078] The DySnakeConv module introduces illumination invariance preprocessing to suppress high-reflectivity interference, providing stable input for subsequent feature extraction. The dynamically deformable convolution kernel leverages an adaptive deformation mechanism to precisely conform to defect edges, enhancing the ability to capture subtle defect edges and texture features. Furthermore, a learnable offset is introduced to dynamically adjust the convolution kernel shape to better adapt to different image features, resolving the difficulty in distinguishing between similar objects and confusing categories.

[0079] ContextAggregation module: integrates context information through multi-scale feature fusion and feature recalibration to enhance the distinguishability of target features. Figure 5 .

[0080] DSConv module: It uses depthwise separable convolution to achieve model lightweighting and improve the model's inference speed.

[0081] The DySnakeConv dynamic deformable convolution module replaces the C3K2 standard convolution layer in the original Bottleneck structure of the YOLOv11 network. By introducing illumination invariance preprocessing, it suppresses high reflective interference and provides stable input for subsequent feature extraction. The dynamic deformable convolution kernel relies on an adaptive deformation mechanism to accurately fit the edge shape of the defect, enhancing the ability to capture the edges and texture features of tiny defects.

[0082] The Context Aggregation module is integrated into the output of the 11th layer C2PSA feature in the YOLOv11 network to build a local-global collaborative multi-scale feature mechanism. This solves the problems of feature loss for small defects and insufficient contextual information for large defects. Furthermore, a cross-level feature pyramid aggregation mechanism is used to fuse shallow detail information with deep semantic features to suppress interference from complex background noise.

[0083] To address the problem that the existing YOLOv11 design does not fully consider the contextual association differences of defects of different scales, this paper introduces a local-global context branch. For small defects with a size of <5×5 pixels, local window attention (with a window space radius of r=5) is used to capture fine-grained features. For large defects with a size of >20×20 pixels, a global multi-head attention mechanism is used to model long-range dependencies. Branch fusion achieves adaptive control through a dynamic weight mapping function, which is defined as:

[0084] α=σ(MLP(||x||2))

[0085] Where x is the feature vector output by the branch, and ||x||2 calculates its L2 norm to measure the feature significance. The multi-layer perceptron (MLP) performs a nonlinear transformation on the norm result. The Sigmoid function σ compresses the output to the (0, 1) interval and generates a weight α that controls the local-global branch fusion ratio.

[0086] In particular, to address the pain points of scenarios where the surface of highly reflective and highly transparent materials is prone to reflective interference and defects are densely overlapping, this module relies on the local-global branch to accurately capture fine-grained and long-range features, and the dynamic weights to adaptively control the fusion of complex features. It can effectively distinguish the boundaries of overlapping defects and suppress reflective noise, showing unique advantages in accurate identification and anti-interference in the detection of densely overlapping defects.

[0087] Specifically, the pre-trained network weights were used as the initial weights, and the transfer learning method was adopted to train the training dataset. The pre-trained weights were iterated for 100 epochs, the learning rate was set to 0.01, the size of the input image was 640×640, and the validation set was used to verify the trained improved YOLOv11 network model.

[0088] S3. Divide the input image into four independent detection areas on average, adopt the bounding box overlap area weight distribution strategy for cross-region defects, and use the defect detection model to count the image partitions;

[0089] Specifically, the method includes the following steps:

[0090] S31. Divide the input image into four independent detection areas: upper left, lower left, upper right, and lower right. For defect targets distributed across regions, determine their assigned partition based on the maximum weight distribution strategy between the bounding box and the overlapping area of ​​each region. The calculation formula is as follows:

[0091] A k =Area(B∩R k )

[0092]

[0093] Among them, A k Represents the bounding box B and partition R k The overlapping area, B=(x min ,y min , x max ,y max ) is the bounding box coordinate parameter, R k ∈{TL, TR, BL, BR} represents the four partitions of upper left, lower left, upper right, and lower right, R * Indicates the partition to which the defect ultimately belongs;

[0094] S32, through the root mean square error RMSE, mean absolute error MAE, determination coefficient R 2 The statistical differences between defect detection results and actual measurement data are compared using residual analysis methods to verify the accuracy of partition counting.

[0095] S4. Through lightweight network structure adjustment and hardware acceleration optimization, a surface defect detection network that meets the real-time requirements of industrial production lines is built.

[0096] Specifically, based on the defect detection model, network layer fusion and INT8 quantization processing are performed through the TensorRT framework to reduce the computational complexity of the model; depthwise separable convolution is used to replace the standard convolution layer of the Neck part, and channel pruning technology is combined to remove redundant parameters, reduce the number of model parameters, and build a surface defect detection network that meets the real-time requirements of industrial production lines.

[0097] S5. Perform pixel-level mask segmentation on the scratch defect to extract contour coordinates and geometric features;

[0098] Specifically, the method includes the following steps:

[0099] S51. Based on the labeled scratch defect samples, generate multi-scale segmentation training data through random rotation, affine transformation and brightness perturbation;

[0100] S52. Construct a scratch defect dataset. Use Labelme software to annotate the outlines of mobile phone screen glass defects, generate a mask file in JSON format, and convert it into a TXT file in YOLO format according to the COCO dataset specification. Each record contains the defect category number, normalized center coordinates, and bounding box size.

[0101] S53. Detect all segmented images using the batch detection function in the defect detection model, and save the segmented image detection results to text. The text records the center point coordinates of the detection box of the defect in the segmented image, the length and width of the detection box, and the confidence level.

[0102] S6. Fit the actual damage size of the scratch defect on the surface of the high-reflective and high-transmittance material based on the segmentation results.

[0103] Specifically, the method includes the following steps:

[0104] S61. Calculate the total length of the scratch using the Euclidean distance accumulation algorithm based on the contour point set output by the segmentation mask. The calculation formula is as follows:

[0105]

[0106] Among them, L is the scratch length based on pixel coordinates, n is the total number of contour points, k is the index variable of the contour point set, and x is the number of contour points. k 、yk represents the pixel coordinates of the kth contour point extracted from the mask, x k+1 、y k+1 Represents the pixel coordinates of the k+1th contour point adjacent to point k.

[0107] S62. Evaluation is performed by comparing the difference between the data detected in the defect range and the actual measured data. The evaluation methods include root mean square error, mean absolute error, coefficient of determination and residual analysis. The actual physical dimensions are mapped in combination with calibration parameters to generate a defect quantification report that complies with the GB / T36259-2018 standard.

[0108] verify:

[0109] To verify the effectiveness of this method in detecting surface defects on highly reflective and highly transparent materials, we used the resulting weight file to test surface defects in the test set. Furthermore, to evaluate the superiority and effectiveness of the proposed detection algorithm compared to currently popular target detection models, we selected YOLOv5n, YOLOv8n, YOLOv11n, SSD, and Faster R-CNN algorithms and conducted experimental comparisons using the same configuration and dataset.

[0110] To further verify the effectiveness of the improved modules, we used the original YOLOv11n model as a baseline, selected the DySnakeConv module, the ContextAggregation module, and the DSConv module, and conducted ablation experiments using different combinations of the improved modules. We used two data sets for experimental verification: a standard dataset of mobile phone screen surface defects published by the Peking University Intelligent Robotics Open Laboratory, named D1; and a dataset of actual defects on mobile phone screens from industrial production lines, independently collected by the present invention, named D2. Using these two datasets with different data distribution characteristics, combined with cross-dataset generalization experiments, we comprehensively evaluated the algorithm's performance. The experimental results are shown in Table 1.

[0111] Table 1 Comparison results of the improved models of the present invention and other improved methods of YOLOv11n

[0112]

[0113] The results in Table 1 show that when the dataset complexity is high, the improved network has significant improvements in various detection indicators compared with other methods, demonstrating its superiority in detecting surface defects on mobile phone screens.

[0114] In summary, the present invention is suitable for the efficient and accurate detection of surface defect characteristics of highly reflective and highly transparent materials. It can perform partitioned detection of defects to trace the source of devices that are prone to defects, and can also fit the actual damage size of scratch defects on the surface of highly reflective and highly transparent materials. In addition, it should be noted that the application of deep learning in the field of industrial inspection is not limited to mobile phone screen defect detection, but can also be applied to surface defect detection of other industrial products, such as metal parts, plastic products, etc. Therefore, the present invention can also be applied to surface defect detection of other industrial products.

[0115] The present invention is not limited to the above-mentioned specific implementation methods. Various changes made by ordinary technicians in this field based on the above-mentioned concept without creative work are all within the scope of protection of the present invention.

Claims

1. A method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11, characterized in that: The following steps are involved: S1. Collect surface defect images of mobile phone screens from industrial production lines to construct a dataset of original surface defect images. Preprocess and annotate the dataset to generate a training dataset containing three types of defects: scratches, chipping, and cracks. S2. Build an improved YOLOv11 network model and train and optimize parameters to build a defect detection model; S3. Divide the input image into four independent detection areas on average, adopt the bounding box overlap area weight distribution strategy for cross-region defects, and use the defect detection model to count the image partitions; S4. Through lightweight network structure adjustment and hardware acceleration optimization, a surface defect detection network that meets the real-time requirements of industrial production lines is built, and the detection results and processing frame rate are output; S5. Perform pixel-level mask segmentation on the scratch defect to extract contour coordinates and geometric features; S6. Fit the actual damage size of the scratch defect on the surface of the high-reflective and high-transmittance material based on the segmentation results.

2. The method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 according to claim 1, characterized in that: In step S1, the original mobile phone screen surface defect images are collected to construct a surface defect dataset, and the original surface defect image dataset is preprocessed and annotated to generate a training dataset containing three types of defects: scratches, chipping, and cracks. The specific steps include: S11. Fix the relative spatial parameters of the mobile camera and the mobile phone screen under test in a darkroom environment, where the camera is vertically mounted on the top of the platform, the mobile phone screen is horizontally placed on a black background and fixed to the bottom of the platform, and the device is wrapped with black light-blocking velvet to eliminate ambient stray light interference. Multiple strip light sources are evenly arranged at 45° above the circumference of the screen for directional oblique lighting. Surface defect images of the mobile phone screen are collected from multiple angles to construct an original surface defect image dataset. S12, preprocessing the original surface defect image dataset, including format unification, size normalization, and random rotation, flipping, and brightness adjustment operations, to generate an enhanced defect sample library; S13. Perform bounding box annotation on the defect targets in the enhanced defect dataset, define three types of defect labels: scratches, chipping, and cracks, and generate an annotation file that contains the three types of defects, namely scratches, chipping, and cracks, and complies with the PASCAL VOC format.

3. The method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 according to claim 1, characterized in that: In step S2, the building of the improved YOLOv11 network model includes the following steps: S21. The DySnakeConv dynamic deformable convolution module replaces the C3K2 standard convolution layer in the original Bottleneck structure of the YOLOv11 network. By introducing illumination invariance preprocessing to suppress high reflective interference, it provides stable input for subsequent feature extraction. The dynamic deformable convolution kernel relies on an adaptive deformation mechanism to accurately fit the defect edge shape, enhancing the ability to capture tiny defect edges and texture features. S22. Integrate the ContextAggregation module at the output of the 11th layer C2PSA feature in the YOLOv11 network to build a local-global collaborative multi-scale feature mechanism, which simultaneously solves the problems of small defect feature loss and large defect context information deficiency. It also fuses shallow detail information with deep semantic features through a cross-level feature pyramid aggregation mechanism to suppress complex background noise interference. S221 introduces a local-global context branch. For small defects with a size of <5×5 pixels, local window attention (with a window space radius of r=5) is used to capture fine-grained features. For large defects with a size of >20×20 pixels, a global multi-head attention mechanism is used to model long-range dependencies. Branch fusion achieves adaptive control through a dynamic weight mapping function, which is defined as: α=σ(MLP(‖X‖2)) Where x is the feature vector of the branch output, ‖X‖2 calculates its L2 norm to measure the feature significance; the multi-layer perceptron MLP performs nonlinear transformation on the norm result; the Sigmoid function σ compresses the output to the (0,1) interval and generates the weight α that controls the local-global branch fusion ratio; Addressing the pain points of highly reflective and highly transparent materials prone to reflective interference and densely overlapping defects, this module leverages local-global branching to accurately capture fine-grained and long-range features, and adaptively adjusts dynamic weights to fuse complex features. This module effectively distinguishes overlapping defect boundaries and suppresses reflective noise, demonstrating unique advantages in precise identification and interference resistance in densely overlapping defect detection. S23. Use the depthwise separable convolution module to replace the standard convolution layer of the Neck part, reducing the computational complexity while maintaining detection accuracy, and optimizing and improving the model inference speed.

4. The method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 according to claim 3, characterized in that: In step S2, the training improves the YOLOv11 network model, including the steps of: S24. Use random stratified sampling to divide the surface defect dataset into training set, validation set, and test set in a ratio of 7:2:1 to ensure a balanced distribution of each defect category; S25, based on the YOLOv11 network weights pre-trained on the COCO dataset, initialize the model parameters, freeze the first 50 training cycles of the backbone network, and set the initial learning rate to 1×10 -4 , the decay rate is 0.96; after 50 cycles, the backbone network is unfrozen and the learning rate is adjusted to 1×10 -5 The decay rate was kept at 0.96, and the Adam optimizer was used for iterative training up to 150 cycles. S26. Use the validation set to verify the trained improved YOLOv11 network model, calculate the average precision, recall rate and false positive rate indicators through the validation set, select the optimal weights and save them to the test set for final performance evaluation.

5. The method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 according to claim 1, characterized in that: In step S3, the input image is evenly divided into four independent detection areas, a bounding box overlapping area weight distribution strategy is adopted for cross-region defects, and the image is partitioned and counted using a defect detection model. The specific steps include: S31. Divide the input image into four independent detection areas: upper left, lower left, upper right, and lower right. For defect targets distributed across regions, determine their assigned partition based on the maximum weight distribution strategy between the bounding box and the overlapping area of ​​each region. The calculation formula is as follows: A k =Area(B∩R k ) Among them, A k Represents the bounding box B and partition R k The overlapping area, B=(x min ,y min ,x max ,y max ) is the bounding box coordinate parameter, R k ∈{TL, TR, BL, BR} represents the four partitions of upper left, lower left, upper right, and lower right, R * Indicates the partition to which the defect ultimately belongs; S32, through the root mean square error RMSE, mean absolute error MAE, determination coefficient R 2 The statistical differences between defect detection results and actual measurement data are compared using residual analysis methods to verify the accuracy of partition counting.

6. The method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 according to claim 1, characterized in that: In step S4, the surface defect detection network that meets the real-time requirements of industrial production lines is constructed through lightweight network structure adjustment and hardware acceleration optimization, including the following steps: Based on the defect detection model, network layer fusion and INT8 quantization processing are performed through the TensorRT framework to reduce the model's computational complexity. Depthwise separable convolution is used to replace the standard convolution layer in the Neck part, and channel pruning technology is combined to remove redundant parameters, reduce the number of model parameters, and build a surface defect detection network that meets the real-time requirements of industrial production lines.

7. The method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 according to claim 1, characterized in that: In step S5, the pixel-level mask segmentation of the scratch defect includes the following steps: S51. Based on the labeled scratch defect samples, generate multi-scale segmentation training data through random rotation, affine transformation and brightness perturbation; S52. Label the outlines of the mobile phone screen glass defects using Labelme software. After generating a mask file in JSON format, convert it into a TXT file in YOLO format according to the COCO dataset specification. Each record contains the defect category number, normalized center coordinates, and bounding box size. S53, call the batch reasoning interface of the defect detection model, detect the segmented image and output the structured detection results, save each record in the text file containing the coordinates of the defect center point (x C ,y C ), bounding box size (w, h) and confidence p, whose value range satisfies x C 、y C ∈[0,1], w, h∈(0,1], p≥0.

5.

8. The method for detecting surface defects of high-reflective and high-transmittance materials based on improved YOLOv11 according to claim 1, characterized in that: In step S6, the actual damage size of the scratch defect on the surface of the high-reflective and high-transmittance material is fitted according to the segmentation result. The specific steps include: S61. Calculate the total length of the scratch using the Euclidean distance accumulation algorithm based on the contour point set output by the segmentation mask. The calculation formula is as follows: Among them, L is the scratch length based on pixel coordinates, n is the total number of contour points, k is the index variable of the contour point set, and x is the number of contour points. k 、y k represents the pixel coordinates of the kth contour point extracted from the mask, x k+1 、y k+1 Represents the pixel coordinates of the k+1th contour point adjacent to point k; S62. Evaluation is performed by comparing the differences between the results detected in the defect range and the actual measured data. Evaluation methods include root mean square error, mean absolute error, coefficient of determination, and residual analysis. The actual physical dimensions are mapped in combination with calibration parameters to generate a defect quantification report that complies with the GB / T36259-2018 standard.

Citation Information

Patent Citations

  • Robot vision image scene analysis method for graphic focus transfer

    CN111209802A

  • Automobile clutch main cylinder groove surface defect detection method based on deep learning

    CN112419237A

  • Product edge defect detection method

    CN113450307A

  • Fabric defect analysis and detection system and analysis and detection method based on deep learning

    CN117994257A

  • Mobile phone screen glass defect detection method based on improved YOLOv8

    CN119273992A

Cited By

  • Industrial machine tool circuit wiring detection method and equipment suitable for industrial machine tool circuit wiring detection method

    CN120823609A

  • Detection method and system based on intelligent vision, electronic equipment and storage medium

    CN120953290A

  • Stainless steel tube surface defect detection method and system

    CN121095233A

  • Intelligent labeling quality detection method and system for multiple materials

    CN121170771A

  • Drug packaging defect detection method and device based on improved YOLOv11 model

    CN121190437A