Lightweight industrial surface defect detection method

CN122989533APending Publication Date: 2026-10-27GUANGXI UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610878427.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

本发明的方法在显著压缩网络结构的同时大幅提升了模型在工业复杂背景下的质检表现。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989533A_ABST
    Figure CN122989533A_ABST
Patent Text Reader

Abstract

The present application aims to provide a kind of light industrial surface defect detection method, comprising the following steps: A, construct improved RT-DETR network model, improved RT-DETR network model includes: Backbone network, Encoder network, Decoder network;B, the improved RT-DETR network model is trained, and the trained RT-DETR network model is obtained;C, the image to be detected is input into the trained RT-DETR network model, first into Backbone network and is handled, and the processing result obtained is input into Encoder network;D, after input result is encoded by Encoder network, it is handled by Decoder network, and the detection result containing defect category and position is output.The present application can significantly reduce the amount of calculation and parameter at the same time, and comprehensively enhance the feature modeling and characterization ability under the condition of micro defect and complex background.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer technology and industrial image inspection technology, and specifically to a lightweight industrial surface defect detection method. Background Technology

[0002] In the context of the rapid development of intelligent manufacturing, quality monitoring of industrial products has always been a major challenge in production. Taking the electronics manufacturing industry as an example, the quality of printed circuit boards (PCBs) directly affects the final performance of electronic products. However, in actual working conditions, PCB surface defects such as rodent bites, open circuits, short circuits, and burrs, as well as metal surface defects such as steel, are usually small in size, highly variable in shape, and have extremely low contrast with the complex industrial background, which brings huge bottlenecks to the management of traditional inspection methods.

[0003] Traditional manual visual inspection methods are inefficient in large-scale production and are highly susceptible to human error or missed detection due to fatigue and subjective factors. While the introduction of traditional image processing and machine learning algorithms (such as image differencing, SIFT-based methods, or texture feature encoding) has alleviated some of the limitations imposed by manual methods, significant challenges remain in practical applications. These traditional algorithms typically have extremely high environmental requirements for industrial lighting and image preprocessing, and the setting of core operator parameters is highly dependent on expert experience, severely limiting the algorithm's flexibility, robustness, and generalization ability.

[0004] In recent years, thanks to breakthroughs in neural network and computer vision technologies, object detection methods using convolutional neural networks (CNNs) and Transformers have been widely applied in industrial surface defect identification. Object detection methods can be broadly categorized into two types based on processing steps: two-stage (e.g., Faster R-CNN) and single-stage (e.g., YOLO series, RT-DETR, and other end-to-end real-time detection frameworks) algorithms. Two-stage algorithms offer high accuracy but suffer from excessive computational complexity and slow speed, making them unsuitable for real-time industrial applications. While traditional single-stage algorithms offer significant speed advantages, when processing high-resolution industrial images with frequent downsampling, the local high-frequency features of minute defects are easily lost in deep feature networks or submerged by low-frequency background semantics, leading to severe ambiguity in small target localization and missed detections.

[0005] Furthermore, most existing deep learning improvement schemes tend to unilaterally increase model complexity and depth to improve defect detection accuracy, severely neglecting issues such as model real-time performance, computational overhead, and parameter redundancy. How to significantly reduce computational resource consumption while ensuring extremely high defect detection accuracy and improving the generalization and verification capabilities for small-sized and irregular defects is a pressing constraint in the field of automated quality inspection in industrial settings. Summary of the Invention

[0006] The present invention aims to provide a lightweight industrial surface defect detection method, which can significantly reduce the amount of computation and parameters while comprehensively enhancing the feature modeling and characterization capabilities of small defects and complex backgrounds.

[0007] The lightweight industrial surface defect detection method includes the following steps: A. Construct an improved RT-DETR network model, which includes: Backbone network, Encoder network, and Decoder network; B. Train the improved RT-DETR network model to obtain the trained RT-DETR network model; C. Input the image to be detected into the trained RT-DETR network model, and first process it in the Backbone network. The processing procedure in the Backbone network is as follows: The image to be detected is processed sequentially through convolution, convolution, feature extraction module CSPRBNELAN, Adown operator, feature extraction module CSPRBNELAN, Adown operator, feature extraction module CSPRBNELAN, Adown operator, and feature extraction module CSPRBNELAN. The resulting processing is then input into the Encoder network. The feature extraction module CSPRBNELAN incorporates a reparameterization mechanism. D. The Encoder network encodes the input results and then inputs them into the Decoder network for processing, outputting detection results that include defect category and location.

[0008] The processing procedure in the feature extraction module CSPDRNELAN is as follows: The input result is processed by the Split function and divided into two equal features in the channel dimension. One of the equal features is processed by the CSPRBN module, 3×3 convolution, and CSPRBN module in sequence to obtain the first equal processed feature. After the first equal-division feature is processed by a 3×3 convolution, the result is concatenated with the first equal-division feature, another equal-division feature, and the input result by the Concat function. The result is then processed by a 1×1 convolution to obtain the output result.

[0009] The processing procedure in the CSPDRBN module is as follows: The input result is divided into two branches. The first branch is processed by 1×1 convolution and multiple DRBNBottleneck modules to obtain the first branch result. The second branch is processed by 1×1 convolution to obtain the second branch result. The first branch result and the second branch result are concatenated by the Concat function and then processed by 1×1 convolution to obtain the output result.

[0010] The processing procedure in the DRBNBottleneck module is as follows: The input results are processed sequentially by the DReparamBlock operator, the resulting results are then processed by a 1×1 convolution, and the resulting results are added to the input results to obtain the output results. The calculation process in the DReparamBlock operator is as follows: The input results are divided into four paths. The first path is processed by a 7×7 dilated convolution with a dilation factor of 1 and a BN function to obtain the first path result. The second path is processed by a 5×5 dilated convolution with a dilation factor of 1 and a BN function to obtain the second path result. The third path is processed by a 3×3 dilated convolution with a dilation factor of 2 and a BN function to obtain the third path result. The fourth path is processed by a 3×3 dilated convolution with a dilation factor of 3 and a BN function to obtain the fourth path result. The first, second, third, and fourth results are added pixel-by-pixel along the channel dimension to obtain the output result.

[0011] The processing procedure in the Encoder network is as follows: The input result is processed by the AIFI module, and the result is then convolved to obtain the first convolution result. This first convolution result is upsampled, concatenated with the input result using the Concat function, and then processed by the RepC3 module to obtain the first RepC3 module processing result. The first RepC3 module processing result is then convolved to obtain the second convolution result. This second convolution result is upsampled, concatenated with the input result using the Concat function, and then processed by the RepC3 module to obtain the second RepC3 module processing result. The second RepC3 module processing result is then processed by the MBRD module, concatenated with the second convolution result using the Concat function, and then processed by the RepC3 module to obtain the third RepC3 module processing result. The third RepC3 module processing result is then processed by the MBRD module, concatenated with the first convolution result using the Concat function, and then processed by the RepC3 module to obtain the fourth RepC3 module processing result. The input result is processed by a 1×1 convolution to obtain the third convolution result; the third convolution result and the result processed by the second RepC3 module are input into the HLFI module for processing to obtain the first HLFI module processing result; the third convolution result and the result processed by the third RepC3 module are input into the HLFI module for processing to obtain the second HLFI module processing result; the third convolution result and the result processed by the fourth RepC3 module are input into the HLFI module for processing to obtain the third HLFI module processing result. The results from the first, second, and third HLFI modules are concatenated using the Concat function to obtain the output, which is then input into the Decoder module.

[0012] The processing procedure in the MBRD module is as follows: The input result is divided into four branches. The first branch is processed by a 3×3 depth separable convolutional layer, and then processed by a 3×3 grouped dilated convolution with a dilation rate of 2 to obtain the result of the first branch. The second branch is divided into two branches. The first branch is processed by 2×2 average pooling, and the second branch is processed by 2×2 max pooling. The results of the two branches are concatenated by the Concat function and then processed by pointwise convolution and BN function in sequence to obtain the result of the second branch. The third branch is divided into four initial sub-feature maps (top right, bottom right, top left, and bottom left) using a 2×2 grid. Each sub-feature map includes four positional features (top left, bottom left, top right, and bottom right). The corresponding positional features of each sub-feature map are extracted and concatenated according to the positional order of the initial sub-feature maps to form four new sub-feature maps. After the four new sub-feature maps are concatenated using the Concat function, they are processed by pointwise convolution to obtain the result of the third branch. The fourth branch is processed by a 3×3 convolution with a stride of 2 to obtain the result of the fourth branch. The results of the first, second, and third branches are concatenated using the Concat function, and then weights are generated by the first weight generator. These weights are adaptively weighted and multiplied with the results of the first, second, and third branches, respectively. The three fused results are then added together and processed through pointwise convolution. The resulting result is then added to the result of the fourth branch and processed by the GELU function to obtain the output result.

[0013] The processing procedure in the first weight generator is as follows: The input result is processed sequentially through global average pooling, two layers of point convolution, and the Softmax function to obtain the output result.

[0014] The processing procedure in the HLFI module is as follows: The third convolution result from the two input results is used as a low-frequency feature, and the other input result is used as a high-frequency feature. After high-frequency and low-frequency features are concatenated using the Concat function, they are processed by global average pooling, global max pooling, and local average pooling modules, respectively. The results of these three pooling processes are then concatenated again using the Concat function and passed to a second weight generator to generate weights. These weights are then adaptively weighted and multiplied with both high-frequency and low-frequency features for fusion. The fused high-frequency feature result is then added to the low-frequency feature result to obtain the first sum; the fused low-frequency feature result is then added to the high-frequency feature result to obtain the second sum. These two sums are concatenated using the Concat function, and the resulting result is processed by a hybrid attention module, followed by a Sigmoid function to obtain the composite gated weights. ; The first summation result and the weight (1- Adaptive weighted multiplication and fusion, the second summation result and the weights Adaptive weighted multiplication fusion: the two fusion results are added together to obtain the output result.

[0015] The processing procedure in the local average pooling module is as follows: the input result is processed sequentially through the average pooling module and the depthwise separable convolution to obtain the output result; The second weight generator processes the input result as follows: the input result is processed by two pointwise convolutions and a sigmoid function to obtain the output result. The processing procedure in the hybrid attention module is as follows: the input result is processed by pointwise convolution, and after the number of channels is reduced to 1 / 2 of the input result, it is processed in two paths. After the first path undergoes pointwise convolution to reduce the number of channels to 1 / r, it undergoes another pointwise convolution to restore the number of channels to the original number of channels when the first path was input, thus obtaining the first path processing result; where r is 2, 4, 8, or 16; The second path is processed by global average pooling and two pointwise convolutions in sequence to obtain the second path result; The output result is obtained by multiplying the result of the first processing path with the result of the second processing path.

[0016] In step B, the training process of the improved RT-DETR network model includes the following steps: Images of different industrial surface defects were obtained from the defect dataset. The images were preprocessed with multi-dimensional geometric transformation data augmentation. The images were then randomly divided into training set, validation set and test set in a ratio of 7:1:2. The improved RT-DETR network model was trained and hyperparameters were tuned using data from the training and validation sets to obtain the weights of the trained improved RT-DETR network model. The improved RT-DETR network model was tested using data from the test set, and the results were evaluated using multiple metrics.

[0017] The beneficial effects of this invention are as follows: The method of this invention significantly improves the quality inspection performance of the model in complex industrial environments while significantly compressing the network structure.

[0018] The improved RT-DETR network model designed in this invention employs the CSPDRNELAN module and the DReparamBlock operator. Utilizing reparameterization technology, it successfully simulates multi-scale information representation with a large receptive field. While ensuring sufficient integration of shallow details and deep semantics, it significantly reduces model redundancy and computational time during the inference stage. This network model also proposes a downsampling module, MBRD, which overturns the traditional stride convolution dimensionality reduction method. By deconstructing three complementary paths—extremum perception, hybrid pooling, and cut pixel slicing—it successfully solves the defects of permanent loss of small defect features and aliasing during high spatial compression, enabling the network to accurately locate the discrimination information of ultra-small targets even in noisy environments.

[0019] The HLFI module proposed in the improved RT-DETR network model of this invention establishes a cross-dimensional frequency interaction gating mechanism, which effectively curbs the phenomenon that high-frequency edge textures are permanently buried by low-frequency background semantics. By using adaptive spatial and channel calibration, it accurately improves the model's feature separation and generalization transfer capabilities for low-contrast defects, irregularly shaped defects, and cross-domain road defects, providing a new lightweight and efficient solution for deploying a high-precision automated defect quality inspection system on resource-constrained embedded edge devices.

[0020] The method of this invention significantly improves the quality inspection performance of the model in complex industrial environments while greatly compressing the network structure, and has good application prospects. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the structure of the improved RT-DETR network model in Example 1; Figure 2 This is a schematic diagram of the feature extraction module CSPDRBNELAN from Example 1. Figure 3 This is a schematic diagram of the CSPDRBN module in Example 1; Figure 4 This is a schematic diagram of the MBRD module in Example 1; Figure 5 This is a schematic diagram of the HLFI module in Example 1; Figure 6A comparison of different defect detection results between the method of the present invention and the prior art in Example 2. Figure 1 ; Figure 7 A comparison of different defect detection results between the method of the present invention and the prior art in Example 2. Figure 2 . Detailed Implementation

[0022] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. Example 1

[0023] The lightweight industrial surface defect detection method of this embodiment includes the following steps: A. Construct an improved RT-DETR network model, such as Figure 1 As shown, the improved RT-DETR network model includes: Backbone network, Encoder network, and Decoder network; B. Train the improved RT-DETR network model to obtain the trained RT-DETR network model; C. Input the image to be detected into the trained RT-DETR network model, and first process it in the Backbone network. The processing procedure in the Backbone network is as follows: The image to be detected is processed sequentially through convolution, convolution, feature extraction module CSPRBNELAN, Adown operator, feature extraction module CSPRBNELAN, Adown operator, feature extraction module CSPRBNELAN, Adown operator, and feature extraction module CSPRBNELAN. The resulting processing is then input into the Encoder network. The feature extraction module CSPRBNELAN incorporates a reparameterization mechanism. like Figure 2 As shown, the processing procedure in the feature extraction module CSPDRNELAN is as follows: The input result is processed by the Split function and divided into two equal features in the channel dimension. One of the equal features is processed by the CSPRBN module, 3×3 convolution, and CSPRBN module in sequence to obtain the first equal processed feature. After the first equal-division feature is processed by a 3×3 convolution, the result is concatenated with the first equal-division feature, another equal-division feature, and the input result by the Concat function. The result is then processed by a 1×1 convolution to obtain the output result.

[0024] like Figure 3 As shown, the processing procedure in the CSPDRBN module is as follows: The input result is divided into two branches. The first branch is processed by 1×1 convolution and multiple DRBNBottleneck modules to obtain the first branch result. The second branch is processed by 1×1 convolution to obtain the second branch result. The first branch result and the second branch result are concatenated by the Concat function and then processed by 1×1 convolution to obtain the output result.

[0025] The processing procedure in the DRBNBottleneck module is as follows: The input results are processed sequentially by the DReparamBlock operator, the resulting results are then processed by a 1×1 convolution, and the resulting results are added to the input results to obtain the output results. The calculation process in the DReparamBlock operator is as follows: The input results are divided into four paths. The first path is processed by a 7×7 dilated convolution with a dilation factor of 1 and a BN function to obtain the first path result. The second path is processed by a 5×5 dilated convolution with a dilation factor of 1 and a BN function to obtain the second path result. The third path is processed by a 3×3 dilated convolution with a dilation factor of 2 and a BN function to obtain the third path result. The fourth path is processed by a 3×3 dilated convolution with a dilation factor of 3 and a BN function to obtain the fourth path result. The first, second, third, and fourth results are added pixel-by-pixel along the channel dimension to obtain the output result.

[0026] D. The Encoder network encodes the input results and then inputs them into the Decoder network for processing, outputting detection results that include defect category and location.

[0027] The processing procedure in the Encoder network is as follows: The input result is processed by the AIFI module, and the result is then convolved to obtain the first convolution result. This first convolution result is upsampled, concatenated with the input result using the Concat function, and then processed by the RepC3 module to obtain the first RepC3 module processing result. The first RepC3 module processing result is then convolved to obtain the second convolution result. This second convolution result is upsampled, concatenated with the input result using the Concat function, and then processed by the RepC3 module to obtain the second RepC3 module processing result. The second RepC3 module processing result is then processed by the MBRD module, concatenated with the second convolution result using the Concat function, and then processed by the RepC3 module to obtain the third RepC3 module processing result. The third RepC3 module processing result is then processed by the MBRD module, concatenated with the first convolution result using the Concat function, and then processed by the RepC3 module to obtain the fourth RepC3 module processing result. The input result is processed by a 1×1 convolution to obtain the third convolution result; the third convolution result and the result processed by the second RepC3 module are input into the HLFI module for processing to obtain the first HLFI module processing result; the third convolution result and the result processed by the third RepC3 module are input into the HLFI module for processing to obtain the second HLFI module processing result; the third convolution result and the result processed by the fourth RepC3 module are input into the HLFI module for processing to obtain the third HLFI module processing result. The results from the first, second, and third HLFI modules are concatenated using the Concat function to obtain the output, which is then input into the Decoder module.

[0028] like Figure 4 As shown, the processing procedure in the MBRD module is as follows: The input result is divided into four branches. The first branch is processed by a 3×3 depth separable convolutional layer, and then processed by a 3×3 grouped dilated convolution with a dilation rate of 2 to obtain the result of the first branch. The second branch is divided into two branches. The first branch is processed by 2×2 average pooling, and the second branch is processed by 2×2 max pooling. The results of the two branches are concatenated by the Concat function and then processed by pointwise convolution and BN function in sequence to obtain the result of the second branch. The third branch is divided into four initial sub-feature maps (top right, bottom right, top left, and bottom left) using a 2×2 grid. Each sub-feature map includes four positional features (top left, bottom left, top right, and bottom right). The corresponding positional features of each sub-feature map are extracted and concatenated according to the positional order of the initial sub-feature maps to form four new sub-feature maps. After the four new sub-feature maps are concatenated using the Concat function, they are processed by pointwise convolution to obtain the result of the third branch. The fourth branch is processed by a 3×3 convolution with a stride of 2 to obtain the result of the fourth branch. The results of the first, second, and third branches are concatenated using the Concat function, and then weights are generated by the first weight generator. These weights are adaptively weighted and multiplied with the results of the first, second, and third branches, respectively. The three fused results are then added together and processed through pointwise convolution. The resulting result is then added to the result of the fourth branch and processed by the GELU function to obtain the output result.

[0029] The processing procedure in the first weight generator is as follows: The input result is processed sequentially through global average pooling, two layers of point convolution, and the Softmax function to obtain the output result.

[0030] like Figure 5 As shown, the processing procedure in the HLFI module is as follows: The third convolution result from the two input results is used as a low-frequency feature, and the other input result is used as a high-frequency feature. After high-frequency and low-frequency features are concatenated using the Concat function, they are processed by global average pooling, global max pooling, and local average pooling modules, respectively. The results of these three pooling processes are then concatenated again using the Concat function and passed to a second weight generator to generate weights. These weights are then adaptively weighted and multiplied with both high-frequency and low-frequency features for fusion. The fused high-frequency feature result is then added to the low-frequency feature result to obtain the first sum; the fused low-frequency feature result is then added to the high-frequency feature result to obtain the second sum. These two sums are concatenated using the Concat function, and the resulting result is processed by a hybrid attention module, followed by a Sigmoid function to obtain the composite gated weights. ; The first summation result and the weight (1- Adaptive weighted multiplication and fusion, the second summation result and the weights Adaptive weighted multiplication fusion: the two fusion results are added together to obtain the output result.

[0031] The processing procedure in the local average pooling module is as follows: the input result is processed sequentially through the average pooling module and the depthwise separable convolution to obtain the output result; The second weight generator processes the input result as follows: the input result is processed by two pointwise convolutions and a sigmoid function to obtain the output result. The processing procedure in the hybrid attention module is as follows: the input result is processed by pointwise convolution, and after the number of channels is reduced to 1 / 2 of the input result, it is processed in two paths. After the first path undergoes pointwise convolution to reduce the number of channels to 1 / r, it undergoes another pointwise convolution to restore the number of channels to the original number of channels at the input of the first path, thus obtaining the processing result of the first path; where r is 4; The second path is processed by global average pooling and two pointwise convolutions in sequence to obtain the second path result; The output result is obtained by multiplying the result of the first processing path with the result of the second processing path.

[0032] In step B, the training process of the improved RT-DETR network model includes the following steps: P acquired images of various industrial surface defects from the PKU-Market-PCB dataset. The acquired images underwent multi-dimensional geometric transformation data augmentation preprocessing, and were randomly divided into training, validation, and test sets in a 7:1:2 ratio. The KU-Market-PCB public dataset contains 6569 images in JPG format, categorized into six classes based on defect type (including missing holes, rodent bites, open circuits, short circuits, burrs, and false copper). Label data is provided by the dataset and requires no additional annotation. The improved RT-DETR network model was trained and hyperparameters were tuned using data from the training and validation sets to obtain the weights of the trained improved RT-DETR network model. The improved RT-DETR network model was tested using data from the test set, and the results were evaluated using multiple metrics. Example 2

[0033] The industrial surface defect detection algorithm studied in complex contexts is mainly applied in high-end manufacturing and automated production fields, which have high requirements for the real-time performance and accuracy of the algorithm. Therefore, the existing RT-DETR algorithm is compared with the algorithm of Embodiment 1 of this invention (i.e., "our" in the figure and table) under the same conditions. The algorithm selected for comparison in this invention is the most representative single-stage evolved real-time target detection network and the two-stage classic network in the current industry and academia, and the horizontal performance comparison is carried out at the same order of magnitude.

[0034] This embodiment compares Faster R-CNN, RT-DETR-R18, YOLOv5m, YOLOv8m, YOLOv10m, YOLOv11m, YOLOv12m, YOLOv26m, DAB-DETR, and SDD-RTDETR with the MDMF-RTDETR network algorithm of Embodiment 1 of this invention under the same dataset and experimental parameters.

[0035]

[0036] As shown in Table 1, the method of Embodiment 1 of this invention exhibits superior performance across all evaluation metrics. The model of Embodiment 1 achieves the highest precision (97.1%), recall (97.5%), and F1 score (97.3%), significantly outperforming all other comparative models. Furthermore, the method of Embodiment 1 also achieves the highest performance in the core object detection metric mAP50 (98.4%), with mAP50 exceeding that of the suboptimal algorithm (RT-DETR-R18) by 0.6%. This superior precision is achieved while reducing computational complexity. The model of Embodiment 1 requires only 17.74M parameters and has a computational complexity of 48.4 GFLOPs, the lowest among all comparative methods. Compared to the suboptimal model (RT-DETR-R18), this represents a 10.8% reduction in parameters and a 15.1% reduction in computational complexity. Experimental results strongly demonstrate that the method of this invention successfully achieves a balance between precision, recall, and accuracy, and is implemented in an extremely lightweight and efficient architecture, which is very suitable for real-world application scenarios with limited computing resources.

[0037] from Figure 6 and Figure 7 It can be seen that the method of Embodiment 1 of the present invention performs very well on various defect datasets, and the verification on multiple datasets also demonstrates the generalizability and robustness of the method of the present invention.

[0038] The above-disclosed content is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Therefore, all equivalent technical changes made based on the description and drawings of the present invention are included within the scope of protection of the present invention. Furthermore, the elements therein can be updated as technology develops. The above units are merely examples, and those skilled in the art can adopt corresponding units according to actual needs when implementing this solution.

Claims

1. A method for detecting surface defects in lightweight industrial products, characterized in that, Includes the following steps: A. Construct an improved RT-DETR network model, which includes: Backbone network, Encoder network, and Decoder network; B. Train the improved RT-DETR network model to obtain the trained RT-DETR network model; C. Input the image to be detected into the trained RT-DETR network model, and first process it in the Backbone network. The processing procedure in the Backbone network is as follows: The image to be detected is processed sequentially through convolution, convolution, feature extraction module CSPRBNELAN, Adown operator, feature extraction module CSPRBNELAN, Adown operator, feature extraction module CSPRBNELAN, Adown operator, and feature extraction module CSPRBNELAN. The resulting processing is then input into the Encoder network. The feature extraction module CSPRBNELAN incorporates a reparameterization mechanism. D. The Encoder network encodes the input results and then inputs them into the Decoder network for processing, outputting detection results that include defect category and location.

2. The lightweight industrial surface defect detection method as described in claim 1, characterized in that: The processing procedure in the feature extraction module CSPDRNELAN is as follows: The input result is processed by the Split function and divided into two equal features in the channel dimension. One of the equal features is processed by the CSPRBN module, 3×3 convolution, and CSPRBN module in sequence to obtain the first equal processed feature. After the first equal-division feature is processed by a 3×3 convolution, the result is concatenated with the first equal-division feature, another equal-division feature, and the input result by the Concat function. The result is then processed by a 1×1 convolution to obtain the output result.

3. The lightweight industrial surface defect detection method as described in claim 2, characterized in that: The processing procedure in the CSPDRBN module is as follows: The input result is divided into two branches. The first branch is processed by 1×1 convolution and multiple DRBNBottleneck modules to obtain the first branch result. The second branch is processed by 1×1 convolution to obtain the second branch result. The first branch result and the second branch result are concatenated by the Concat function and then processed by 1×1 convolution to obtain the output result.

4. The lightweight industrial surface defect detection method as described in claim 3, characterized in that: The processing procedure in the DRBNBottleneck module is as follows: The input results are processed sequentially by the DReparamBlock operator, the resulting results are then processed by a 1×1 convolution, and the resulting results are added to the input results to obtain the output results. The calculation process in the DReparamBlock operator is as follows: The input results are divided into four paths. The first path is processed by a 7×7 dilated convolution with a dilation factor of 1 and a BN function to obtain the first path result. The second path is processed by a 5×5 dilated convolution with a dilation factor of 1 and a BN function to obtain the second path result. The third path is processed by a 3×3 dilated convolution with a dilation factor of 2 and a BN function to obtain the third path result. The fourth path is processed sequentially by a 3×3 dilated convolution with an inflation factor of 3 and a BN function to obtain the fourth path result; The first, second, third, and fourth results are added pixel-by-pixel along the channel dimension to obtain the output result.

5. The lightweight industrial surface defect detection method as described in claim 1, characterized in that: The processing procedure in the Encoder network is as follows: After the input result is processed by the AIFI module, the result is convolved to obtain the first convolution result; after upsampling, the first convolution result is concatenated with the input result by the Concat function, and then processed by the RepC3 module to obtain the first RepC3 module processing result. The result processed by the first RepC3 module is convolved to obtain the second convolution result; the second convolution result is then processed by the above method and concatenated with the input result using the Concat function, and then processed by the RepC3 module to obtain the second RepC3 module processing result. The result of the second RepC3 module is processed by the MBRD module. The result is then concatenated with the second convolution result using the Concat function, and then processed by the RepC3 module to obtain the result of the third RepC3 module. The result of the third RepC3 module is processed by the MBRD module. The result is concatenated with the first convolution result by the Concat function, and then processed by the RepC3 module to obtain the result of the fourth RepC3 module. The input result is processed by a 1×1 convolution to obtain the third convolution result; the third convolution result and the result processed by the second RepC3 module are input into the HLFI module for processing to obtain the first HLFI module processing result; the third convolution result and the result processed by the third RepC3 module are input into the HLFI module for processing to obtain the second HLFI module processing result; the third convolution result and the result processed by the fourth RepC3 module are input into the HLFI module for processing to obtain the third HLFI module processing result. The results from the first, second, and third HLFI modules are concatenated using the Concat function to obtain the output, which is then input into the Decoder module.

6. The lightweight industrial surface defect detection method as described in claim 5, characterized in that: The processing procedure in the MBRD module is as follows: The input result is divided into four branches. The first branch is processed by a 3×3 depth separable convolutional layer, and then processed by a 3×3 grouped dilated convolution with a dilation rate of 2 to obtain the result of the first branch. The second branch is divided into two branches. The first branch is processed by 2×2 average pooling, and the second branch is processed by 2×2 max pooling. The results of the two branches are concatenated by the Concat function and then processed by pointwise convolution and BN function in sequence to obtain the result of the second branch. The third branch is divided into four initial sub-feature maps (top right, bottom right, top left, and bottom left) using a 2×2 grid. Each sub-feature map includes four positional features (top left, bottom left, top right, and bottom right). The corresponding positional features of each sub-feature map are extracted and concatenated according to the positional order of the initial sub-feature maps to form four new sub-feature maps. After the four new sub-feature maps are concatenated using the Concat function, they are processed by pointwise convolution to obtain the result of the third branch. The fourth branch is processed by a 3×3 convolution with a stride of 2 to obtain the result of the fourth branch. The results of the first, second, and third branches are concatenated using the Concat function, and then weights are generated by the first weight generator. These weights are adaptively weighted and multiplied with the results of the first, second, and third branches, respectively. The three fused results are then added together and processed through pointwise convolution. The resulting result is then added to the result of the fourth branch and processed by the GELU function to obtain the output result.

7. The lightweight industrial surface defect detection method as described in claim 6, characterized in that: The processing procedure in the first weight generator is as follows: The input result is processed sequentially through global average pooling, two layers of point convolution, and the Softmax function to obtain the output result.

8. The lightweight industrial surface defect detection method as described in claim 5, characterized in that: The processing procedure in the HLFI module is as follows: The third convolution result from the two input results is used as a low-frequency feature, and the other input result is used as a high-frequency feature. After high-frequency and low-frequency features are concatenated by the Concat function, they are processed by global average pooling, global max pooling, and local average pooling modules, respectively. The results of the three pooling processes are concatenated by the Concat function and then processed by the second weight generator to generate weights. The weights are adaptively weighted and multiplied with the high-frequency and low-frequency features and fused. Then the high-frequency feature fusion result is added to the low-frequency feature to obtain the first addition result. The low-frequency feature fusion result is added to the high-frequency feature to obtain a second summed result; the two summed results are concatenated using the Concat function, and the resulting result is processed by a hybrid attention module, and then by the Sigmoid function to obtain the composite gating weights. ; The first summation result and the weight (1- Adaptive weighted multiplication and fusion, the second summation result and the weights Adaptive weighted multiplication fusion: the two fusion results are added together to obtain the output result.

9. The lightweight industrial surface defect detection method as described in claim 8, characterized in that: The processing procedure in the local average pooling module is as follows: the input result is processed sequentially through the average pooling module and the depthwise separable convolution to obtain the output result; The second weight generator processes the input result as follows: the input result is processed by two pointwise convolutions and a sigmoid function to obtain the output result. The processing procedure in the hybrid attention module is as follows: the input result is processed by pointwise convolution, and after the number of channels is reduced to 1 / 2 of the input result, it is processed in two paths. After the first path undergoes pointwise convolution to reduce the number of channels to 1 / r, it undergoes another pointwise convolution to restore the number of channels to the original number of channels when the first path was input, thus obtaining the first path processing result; where r is 2, 4, 8, or 16; The second path is processed by global average pooling and two pointwise convolutions in sequence to obtain the second path result; The output result is obtained by multiplying the result of the first processing path with the result of the second processing path.

10. The lightweight industrial surface defect detection method as described in claim 1, characterized in that: In step B, the training process of the improved RT-DETR network model includes the following steps: Images of different industrial surface defects were obtained from the defect dataset. The images were preprocessed with multi-dimensional geometric transformation data augmentation. The images were then randomly divided into training set, validation set and test set in a ratio of 7:1:

2. The improved RT-DETR network model was trained and hyperparameters were tuned using data from the training and validation sets to obtain the weights of the trained improved RT-DETR network model. The improved RT-DETR network model was tested using data from the test set, and the results were evaluated using multiple metrics.