Industrial surface defect detection method under complex background

By constructing the LE-Net network model and combining the lightweight downsampling operator SCADown, the feature enhancement module MKCA, and the lightweight detection head SC-Head, the accuracy and real-time performance issues of small target detection in complex backgrounds are solved, and efficient industrial surface defect detection is achieved.

CN121921301APending Publication Date: 2026-04-24GUANGXI UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGXI UNIVERSITY OF TECHNOLOGY
Filing Date
2026-02-11
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient accuracy in detecting small targets in complex backgrounds, high computational resource consumption, and difficulties in identification due to the diversity and uncertainty of defects. In particular, false detections and missed detections are serious in high-resolution image and fine-grained defect detection scenarios. Furthermore, existing methods are inadequate in terms of real-time performance and generalization ability.

Method used

The LE-Net network model is constructed, which includes the lightweight downsampling operator SCADown, the feature enhancement module MKCA, and the lightweight detection head SC-Head. The network feature extraction is optimized through multi-branch design and innovative attention mechanism, reducing the number of model parameters and complexity, and improving robustness and detection capability.

Benefits of technology

It achieves high-precision detection of small targets in complex backgrounds, reduces computational resource consumption, improves the model's real-time performance and generalization ability, and is suitable for industrial sites with limited computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921301A_ABST
    Figure CN121921301A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer technology and industrial image analysis, and discloses an industrial surface defect detection method under a complex background, comprising the following steps: constructing an LE-Net network model, the LE-Net network model sequentially comprising a Backbone network for feature extraction, a Neck network for feature fusion and a Head network for prediction; wherein a lightweight downsampling operator SCADDown is embedded in the Backbone network and the Neck network, a feature enhancement module MKCA is embedded in the Backbone network, and the Head network is a lightweight detection head SC-Head; acquiring an industrial surface defect image data set, preprocessing the data set, dividing the data set into a training set, a verification set and a test set, and training and verifying the LE-Net network model by using the training set and the verification set to obtain a trained network model weight; and inputting a to-be-detected industrial defect image into the trained LE-Net network model, and outputting a detection result containing the defect category and position, the invention provides the industrial surface defect detection method under the complex background, and the detection capability can be enhanced.
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 analysis technology, and in particular to a method for detecting industrial surface defects under complex backgrounds. Background Technology

[0002] With the rapid development of intelligent manufacturing, the productivity of factories and enterprises has been greatly improved, leading to a corresponding expansion in the scale of manufactured products. The application of intelligent technologies has not only accelerated the automation process of production lines but also significantly shortened the product manufacturing cycle. However, product quality monitoring has always been a major challenge in manufacturing. This is because product quality is easily affected by raw materials and existing production technologies, and surface defects are the most obvious and easily detected. Traditional manual inspection methods are inefficient and prone to human error when facing large-scale production. As the number of production batches increases, ensuring the quality stability and consistency of each batch has become a key issue that enterprises must address while maintaining production efficiency.

[0003] To address this issue, with the rapid development of machine vision technology and convolutional neural networks, object detection methods have achieved many breakthroughs. Among them, automated optical inspection technology has gradually become a focus of industrial and enterprise applications, especially intelligent inspection systems based on computer vision and deep learning. Object detection methods can be broadly categorized into two types based on processing steps: two-stage and single-stage algorithms. Two-stage algorithms (such as R-CNN, FastR-CNN, and FasterR-CNN) first generate candidate regions in the image, then classify and regress each candidate box. These methods offer high accuracy but are computationally complex and slow. In contrast, single-stage algorithms, such as the YOLO series, perform end-to-end prediction directly on the original image, resulting in a simpler and faster detection process, thus gaining widespread application in industrial scenarios. It is important to note that while single-stage methods offer a significant speed advantage, they typically perform worse than two-stage algorithms in detecting small objects. Therefore, in practical applications, a trade-off between speed and accuracy is often necessary.

[0004] Early object detection methods employed an anchor-based design, where anchors, with predefined shapes and sizes, were used for object localization prediction. These methods predicted the object's position and size by generating multiple anchors for each region of the image. While anchor-based methods achieved some success in early object detection tasks, in practical applications, the spacing between objects can be very small, or multiple objects may overlap. Traditional anchor-based methods struggle to effectively distinguish objects in such situations, especially against complex backgrounds. Anchor-based designs often fail to handle high-density, small objects or occlusion issues. For industrial defect detection, these are not the best choices.

[0005] Researchers have proposed numerous methods by combining object detection frameworks with industrial defects. One approach transforms object detection into a sequence prediction problem, employing the Transformer architecture to abandon traditional anchor-based methods and utilizes a self-attention mechanism for global modeling. Another approach introduces a dynamic sample allocation mechanism, eliminating the constraint of fixed anchor points and allowing the model to more flexibly select positive and negative samples during training, thus improving its adaptability to different types of targets. Many researchers have subsequently proposed methods for small targets with complex backgrounds. However, while these methods have addressed the detection challenges of small targets and complex backgrounds to some extent, they still face some challenges in the following aspects:

[0006] Localization accuracy for small targets: In practical applications, especially in high-resolution images and fine-grained defect detection scenarios, significant false positives and false negatives still exist. Particularly when the target size is extremely small or the contrast with the background is low, the localization accuracy of existing methods still falls short of ideal levels.

[0007] Computational resources and real-time performance issues: With the increasing complexity of models, especially deep learning-based object detection methods, this remains a limiting factor for real-time defect detection applications in industrial settings. How to reduce computational overhead and improve the real-time performance of models while ensuring detection accuracy is a challenge that many methods have failed to fully address.

[0008] The diversity and uncertainty of defects: In actual industrial defect detection, defects exhibit a high degree of diversity and uncertainty in terms of morphology, color, texture, etc. Many existing methods are rather rigid and lack generalization when faced with this diversity, especially when dealing with novel or minor defects that have never been seen before, and they are still prone to identification difficulties. Summary of the Invention

[0009] To address the aforementioned technical problems, this invention provides a method for detecting industrial surface defects in complex environments, which enhances detection capabilities.

[0010] This invention provides a method for detecting industrial surface defects under complex backgrounds, comprising the following steps: The LE-Net network model is constructed, which consists of a Backbone network for feature extraction, a Neck network for feature fusion, and a Head network for prediction. The lightweight downsampling operator SCADown is embedded in the Backbone and Neck networks, the feature enhancement module MKCA is embedded in the Backbone network, and the Head network is a lightweight detection head SC-Head. A dataset of industrial surface defect images is obtained, the dataset is preprocessed and divided into training set, validation set and test set. The LE-Net network model is trained and validated using the training set and validation set to obtain the weights of the trained network model. The LE-Net network model is tested using the data in the test set to obtain the trained LE-Net network model. The industrial defect image to be detected is input into the trained LE-Net network model, which is then processed by the Backbone network, Neck network, and SC-Head to output the detection results containing the defect category and location.

[0011] Furthermore, the Backbone network processing steps are as follows: The input image is processed sequentially through two Conv convolutions and a C3k2 module to obtain the first result. The first result is then processed sequentially through an SCADown convolution to obtain the second result. The second result is processed through a C3k2 module to obtain the third result. The third result is processed through an SCADown convolution to obtain the fourth result. The fourth result is then processed sequentially through a C3k2 module, an SCADown convolution, a C3k2 module, and an SPPF module to obtain the fifth result. The fifth result is then processed through an MKCA module to obtain the sixth result. The first, second, third, fourth, fifth, and sixth results are then input into the Neck network.

[0012] Furthermore, the processing procedure in the Neck network is as follows: The sixth result, after being upsampled, is concatenated with the fourth result, and then passed through the C3k2 module to obtain the first C3k2 processing result. The first C3k2 processing result, after being upsampled, is concatenated with the third processing result, and then passed through the C3k2 module to obtain the second C3k2 processing result, which is then input into the Head network. The second C3k2 processing result after SCADown processing is concatenated with the first C3k2 processing result, and then passed through the C3k2 module to obtain the third C3k2 processing result, which is then input into the Head network. The third C3k2 processing result after SCADown processing is concatenated with the output of the MKCA module, and then passed through the C3k2 module to obtain the fourth C3k2 processing result, which is then input into the Head network.

[0013] Furthermore, the processing steps of the SCADown operator include: Perform average pooling on the input feature map; The pooled feature map is divided into a first part and a second part along the channel dimension; The first part is processed sequentially through a 3×3 convolutional layer and an attention mechanism module to obtain the first branch features; The second part is processed sequentially through a max pooling layer and a 1×1 convolutional layer to obtain the second branch features; The first branch features and the second branch features are concatenated along the channel dimension to obtain the output feature map.

[0014] Furthermore, the attention mechanism module is the SEAM module.

[0015] Furthermore, the processing procedure of the MKCA module includes: The input features are sequentially passed through the first 1×1 convolutional layer, the batch normalization layer, and the activation function layer for dimensionality reduction and preprocessing; The preprocessed features are input into multiple parallel, depth-separable convolutional layers with different kernel sizes to extract multi-scale features; The output features of separable convolutional layers at different depths are added and fused together. The fused features are passed through a second 1×1 convolutional layer to restore the channel dimension, and then added to the input features through a residual connection. The summed result is enhanced using a coordinate attention mechanism to output the final feature.

[0016] Furthermore, the SC-Head processing procedure includes: Multiple processing results from the Neck network are initially processed using separate groups of convolutional layers. Using depthwise separable convolutional layers with shared weights, and point convolutional layers, lightweight feature extraction is performed on the pre-processed features. The extracted features are processed through parallel branches to predict the bounding box distribution and class probability of the target, respectively. During the inference phase, prediction results at multiple scales are concatenated and decoded, and the precise bounding box position is calculated using the Distributed Focus Loss (DFL) mechanism. The final output is a result that integrates spatially adjusted detection boxes and class confidence scores.

[0017] The technical solution provided by this invention has the following advantages compared with the prior art: This invention provides a novel lightweight industrial surface defect detection network model under complex backgrounds, possessing rapid learning and rapid identification and detection capabilities. It effectively solves the problems of complex backgrounds, small targets, and varied shapes in industrial defects. The innovative modules SCADown, MKCA, and SC-Head are introduced into the framework to achieve the effectiveness and superiority of the proposed model. A lightweight multi-branch downsampling module, SCADown, is proposed. By introducing a multi-branch design and an innovative attention SEAM, the network feature extraction process is optimized. SCADown significantly reduces the number of model parameters and complexity, while effectively improving the network's robustness to small targets and complex backgrounds. A lightweight feature enhancement module, MKCA, is proposed. This module uses multi-kernel convolution to capture features from different receptive fields, enhancing the multi-level representation ability of high-level features for global information. A lightweight detection head, SC-Head, is proposed. By introducing a shared convolution mechanism, the number of model parameters and complexity are significantly reduced while enhancing the model's detection capability under multi-scale targets. Attached Figure Description

[0018] Figure 1 A flowchart for industrial surface defect detection; Figure 2 This is a schematic diagram of the overall structure of the LE-Net network model; Figure 3 This is a diagram of the SPPF module structure. Figure 4 This is a schematic diagram of the SCADown downsampling operator. Figure 5 This is a schematic diagram of the SEAM module structure; Figure 6 This is a schematic diagram of the MKCA module. Figure 7 This is a schematic diagram of the SC-Head structure; Figure 8 Comparison chart of different defect detection results; Figure 9 Visual comparison charts for different defect detection methods. Detailed Implementation

[0019] The following detailed description of a specific embodiment of the present invention is provided in conjunction with the accompanying drawings. However, it should be understood that the scope of protection of the present invention is not limited to the specific embodiment.

[0020] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the technical solution of this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0021] The present invention will now be described through several specific embodiments. To keep the following description of the embodiments clear and concise, detailed descriptions of known functions and components may be omitted. When any component of an embodiment of the present invention appears in more than one drawing, that component may be represented by the same reference numerals in each drawing.

[0022] Figure 1 This is a flowchart for industrial surface defect detection. Figure 2 This is a schematic diagram of the overall structure of the LE-Net network model. Figure 3 This is a diagram of the SPPF module structure. Figure 4 This is a schematic diagram of the SCADown downsampling operator. Figure 5 This is a schematic diagram of the SEAM module structure. Figure 6 This is a structural diagram of the MKCA module. Figure 7 This is a schematic diagram of the SC-Head structure. Figure 8 This is a comparison chart of detection results for different defects. Figure 9 Visual comparison charts for different defect detection methods.

[0023] like Figure 1 and Figure 2As shown, this embodiment of the invention provides a method for detecting industrial surface defects in complex backgrounds, comprising the following steps: constructing an LE-Net network model, wherein the LE-Net network model sequentially includes a Backbone network for feature extraction, a Neck network for feature fusion, and a Head network for prediction; wherein a lightweight downsampling operator SCADown is embedded in the Backbone network and the Neck network, a feature enhancement module MKCA is embedded in the Backbone network, and the Head network is a lightweight detection head SC-Head; acquiring an industrial surface defect image dataset, preprocessing the dataset and dividing it into a training set, a validation set, and a test set, using the training set and the validation set to train and validate the LE-Net network model, obtaining the weights of the trained network model; inputting the industrial defect image to be detected into the trained LE-Net network model, which is then processed by the Backbone network, the Neck network, and the SC-Head, outputting detection results containing defect category and location.

[0024] Specifically, constructing such Figure 1 The LE-Net network model shown comprises a Backbone network, a Neck network, and a Head network. The Backbone network serves as the backbone. The Backbone and Neck networks incorporate the SCADown lightweight downsampling operator and the MKCA feature enhancement module, and the Head network is replaced with a lightweight detection head, SC-Head. The LE-Net network model is trained to obtain the trained model weights. Images of different industrial defects to be detected are input into the trained LE-Net neural network model and processed sequentially through the Backbone, Neck, and Head networks to obtain the detected images.

[0025] Furthermore, the training process for the LE-Net network model is as follows: Images of various industrial surface defects are acquired from a public dataset. These images are preprocessed, and image enhancement techniques are used to augment the original images, including flipping, translating, and cropping. The images are then divided into training, validation, and test sets. The LE-Net network model is trained using the training and validation sets to obtain the trained model. Finally, the trained LE-Net network model is tested using the test set data to obtain the test results.

[0026] Specifically, in one embodiment, the public dataset is the PKU-Market-PCB dataset. PCB defect images are obtained from this dataset, preprocessed, and divided into training, validation, and test sets. The LE-Net network model is trained using the data from the training and validation sets to obtain the trained LE-Net network model. This embodiment of the invention uses the PKU-Market-PCB public dataset proposed by Peking University. The PKU-Market-PCB public dataset contains 6569 images, stored in JPG format, and categorized into six types based on defect type (including missing holes, rodent bites, open circuits, short circuits, burrs, and fake copper).

[0027] Furthermore, the ratio of the training set, validation set, and test set is 7:1:2.

[0028] Specifically, the image data in the dataset is randomly divided into a training set, a validation set, and a test set, with the ratio of images in each set being 7:1:2. Label data is provided by the dataset and requires no additional annotation.

[0029] The 7:1:2 ratio of training, validation, and test sets adopted in this invention fully considers the high cost and limited sample size of industrial defect data acquisition, forming an optimized data strategy for practical deployment. The large-scale training set (70%) ensures that the LE-Net network model can fully learn the diversity of defect features and the complexity of background interference in complex environments, providing ample learning samples for the feature preservation capability of the SCADown operator and the multi-scale perception capability of the MKCA module. The 10% validation set, while ensuring the representativeness of data distribution, enables efficient hyperparameter tuning and training monitoring, effectively supporting the fine calibration of the SC-Head lightweight structure and the implementation of early stopping strategies. The 20% test set provides a final performance evaluation with high statistical confidence, rigorously testing the model's generalization ability to rare defect variants and new scenarios. This ratio achieves the best balance between data utilization efficiency and evaluation reliability, laying a solid data foundation for the model to achieve high-precision and robust defect detection in real industrial environments.

[0030] Furthermore, the Backbone network processing steps are as follows: the input image is processed sequentially through two Conv convolutional layers and a C3k2 module to obtain the first result; the first result is processed through an SCADown convolution to obtain the second result; the second result is processed through a C3k2 module to obtain the third result; the third result is processed through an SCADown convolution to obtain the fourth result; the fourth result is processed sequentially through a C3k2 module, an SCADown convolution, a C3k2 module, and an SPPF module to obtain the fifth result; simultaneously, the fifth result is processed through an MKCA module to obtain the sixth result; the first, second, third, fourth, fifth, and sixth results are all input into the Neck network.

[0031] Specifically, the structure of an SPPF module is as follows: Figure 3 As shown, the SPPF module is a highly efficient and fast spatial pyramid pooling structure. It simulates multi-scale pooling by concatenating multiple max-pooling layers with the same kernel size, quickly constructing multi-level receptive fields. Then, it concatenates the pooling outputs at different scales with the original input feature map to fuse rich multi-scale contextual information. Finally, a 1×1 convolution is used to perform channel fusion and dimensionality reduction on the concatenated features. This module can significantly enhance the model's ability to perceive targets at different scales while maintaining extremely high computational efficiency.

[0032] Furthermore, such as Figure 4 As shown, the processing procedure of the Neck network is as follows: The sixth result is upsampled and concatenated with the fourth result, then processed by a C3k2 module to obtain the first C3k2 processing result; the first C3k2 processing result is upsampled and concatenated with the third result, then processed by a C3k2 module to obtain the second C3k2 processing result, which is input into the Head network; the second C3k2 processing result is processed by SCADown and concatenated with the first C3k2 processing result, then processed by a C3k2 module to obtain the third C3k2 processing result, which is input into the Head network; the third C3k2 processing result is processed by SCADown and concatenated with the output of the MKCA module (i.e., the sixth result), then processed by a C3k2 module to obtain the fourth C3k2 processing result, which is input into the Head network.

[0033] Specifically, such as Figure 7As shown, the SC-Head processing procedure includes: performing preliminary processing on multiple processing results from the Neck network through independent groups of convolutional layers; using depthwise separable convolutional layers and point convolutional layers with shared weights to perform lightweight feature extraction on the preliminary processed features; processing the extracted features through parallel branches to predict the bounding box distribution and class probability of the target respectively; in the inference stage, concatenating and decoding the prediction results at multiple scales, and using the distributed focus loss (DFL) mechanism to calculate the precise bounding box position, and finally outputting the result that fuses the spatially adjusted detection box and class confidence.

[0034] Furthermore, the SCADown operator's processing steps include: performing average pooling on the input feature map; dividing the pooled feature map into a first part and a second part in the channel dimension; processing the first part sequentially through a 3×3 convolutional layer and an attention mechanism module to obtain the first branch feature; processing the second part sequentially through a max pooling layer and a 1×1 convolutional layer to obtain the second branch feature; and concatenating the first branch feature and the second branch feature in the channel dimension to obtain the output feature map.

[0035] Furthermore, the attention mechanism module is a SEAM module.

[0036] Furthermore, the SEAM structure is as follows: Figure 5 As shown, SEAM is a hybrid attention mechanism that innovatively combines the parameter-free spatial-channel weighting mechanism of SimAM with the channel dependency modeling capability of the classic Squeeze-and-Excitation (SE) structure. For input features F, SimAM evaluates the importance of neurons by minimizing the linear separability between neuron t and its surrounding neurons x, and uses a simplified form of its core energy function e(t, x) to calculate the weights of the spatial and channel dimensions, as shown in the following equation:

[0037] Where u and These are the mean and variance of the feature map F in the spatial dimension, respectively. It is a very small constant. It is the Sigmoid activation function.

[0038] SEAM also integrates a lightweight channel attention structure for explicitly modeling dependencies between channels: in, For average pooling operation, It is a 1*1 convolution. To modify the activation function of the linear unit.

[0039] SEAM fuses these two attention weights through element-wise multiplication and embeds them into the residual connections with a learnable scaling parameter ⋎, ultimately outputting the enhanced features. : SEAM not only inherits the parameterless and high-performance characteristics of SimAM, but also enhances the perception of global channel dependence through channel attention, enabling the network to adaptively focus on the subtle features of defective regions while effectively suppressing interference from complex backgrounds.

[0040] Furthermore, such as Figure 6 As shown, the MKCA module's processing steps include: input features sequentially passing through a first 1×1 convolutional layer, a batch normalization layer, and an activation function layer for dimensionality reduction and preprocessing; inputting the preprocessed features into multiple parallel depthwise separable convolutional layers with different kernel sizes to extract multi-scale features; adding and fusing the output features of each depthwise separable convolutional layer; restoring the channel dimension of the fused features through a second 1×1 convolutional layer and adding them to the input features via residual connections; and enhancing the result of the addition through a coordinate attention mechanism to output the final features.

[0041] Specifically, the module first performs dimensionality reduction and preprocessing on the input features through a 1×1 convolutional layer, followed by batch normalization and ReLU activation. Then, it uses multiple depthwise separable convolutions with different kernel sizes to extract multi-scale features in parallel and adds their outputs together. After that, it restores the channel dimension through another 1×1 convolution and adds it to the input residual. Finally, it further enhances the spatial location sensitivity of the features through a coordinate attention mechanism, and finally outputs the enhanced features.

[0042] Furthermore, such as Figure 7 As shown, the SC-Head processing procedure includes: performing preliminary processing on multiple processing results from the Neck network through independent groups of convolutional layers; using depthwise separable convolutional layers and point convolutional layers with shared weights to perform lightweight feature extraction on the preliminary processed features; processing the extracted features through parallel branches to predict the bounding box distribution and class probability of the target respectively; in the inference stage, concatenating and decoding the prediction results at multiple scales, and using the Distributed Focal Loss (DFL) mechanism to calculate the precise bounding box position, finally outputting a result that integrates the spatially adjusted detection boxes and class confidence.

[0043] Specifically, the detection head first processes multi-scale input features through independent convolutional layer groups, and then uses shared depthwise separable convolutions and point convolutions for lightweight feature extraction. After that, it predicts the bounding box distribution (adjusted by scale) and class probability through parallel branches, and directly returns multi-layer features during training. During inference, it concatenates and decodes the multi-layer prediction results, and uses the distributed focus loss (DFL) mechanism to accurately calculate the bounding box position. Finally, it outputs a result that integrates spatially adjusted detection boxes and class confidence.

[0044] The front-end processing is achieved by adapting multi-scale input features to independent lightweight convolutional groups. Subsequently, shared depthwise separable convolutions are used for cross-scale standardized feature extraction, significantly reducing the number of parameters. Bounding box prediction is transformed from traditional coordinate point estimation to discrete probability distribution modeling, optimized using distributed focus loss (DFL). This enables the model to accurately capture the blurred boundaries and sub-pixel-level positional changes of defects, improving localization robustness in complex backgrounds. During training, this structure directly returns multi-layer features for loss calculation, achieving efficient gradient backflow and fast convergence. During inference, the semantic and detailed information at different levels is fused through the concatenation and unified decoding of multi-scale prediction results. This significant lightweight effect, while ensuring detection accuracy, is a key architectural innovation of LE-Net for achieving high-precision real-time defect detection.

[0045] In a specific embodiment, the industrial surface defect detection algorithm studied under complex backgrounds is mainly applied in high-end manufacturing and automated production fields, which have high requirements for the algorithm's real-time performance and accuracy. Therefore, a single-stage algorithm is used to compare its performance with the algorithm of this invention under the same conditions. The single-stage algorithm is mainly based on the YOLO series algorithms, and the algorithm selected for comparison in this invention is a detection network of the same magnitude as the YOLO series.

[0046] This embodiment compares YOLOv3, YOLOv5, YOLOv6, YOLOv8, YOLOv10, YOLOv11, YOLOv12, WSS-YOLO, and Hsd-YOLO with the LE-Net network model of this invention under the same dataset and experimental parameters.

[0047] Table 1. Comparison Experiment Results of PKU-Market-PCB Dataset As shown in Table 1, the method of this invention exhibits superior performance across all evaluation metrics. The model of this invention achieves the highest recall rate (92.3%) and the highest F1 score (0.944), significantly outperforming all other comparative models. Furthermore, the method of this invention also achieves the highest performance in the core object detection metrics mAP50 (96.4%) and mAP50-95 (58.0%). Specifically, the mAP50 metric is 1.6% higher than the suboptimal algorithm (WSS-YOLO), and the mAP50-95 metric is 1.8% higher than the suboptimal algorithm (YOLOv3). This superior accuracy is achieved with a significant reduction in computational complexity. The model of this invention requires only 1.53M parameters and has a computational complexity of 3.8 GFLOPs, the lowest among all comparative methods. Compared to the suboptimal model (WSS-YOLO), this represents a 26.8% reduction in parameters and a 29.6% 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.

[0048] from Figure 8 and Figure 9 As can be seen, the method of the present invention performs very well on a variety of defect datasets, and the validation on multiple datasets also demonstrates the generalizability and robustness of the method of the present invention.

[0049] The above inventions are merely a few specific embodiments of the present invention. However, the embodiments of the present invention are not limited thereto, and any variations that can be conceived by those skilled in the art should fall within the protection scope of the present invention.

Claims

1. A method for detecting industrial surface defects under complex backgrounds, characterized in that, Includes the following steps: A LE-Net network model is constructed, which sequentially includes a Backbone network for feature extraction, a Neck network for feature fusion, and a Head network for prediction. The lightweight downsampling operator SCADown is embedded in the Backbone network and the Neck network, the feature enhancement module MKCA is embedded in the Backbone network, and the Head network is a lightweight detection head SC-Head. A dataset of industrial surface defect images is acquired, the dataset is preprocessed and divided into a training set, a validation set and a test set, the LE-Net network model is trained and validated using the training set and the validation set to obtain the weights of the trained network model, and the LE-Net network model is tested using the data of the test set to obtain the trained LE-Net network model. The image of the industrial defect to be detected is input into the trained LE-Net network model, and after processing by the Backbone network, Neck network and SC-Head, the detection result containing the defect category and location is output.

2. The method for detecting industrial surface defects under complex backgrounds as described in claim 1, characterized in that, The Backbone network processing steps are as follows: The input image is processed sequentially through two Conv convolutions and a C3k2 module to obtain the first result. The first result is processed sequentially through an SCADown convolution to obtain the second result. The second result is processed through a C3k2 module to obtain the third result. The third result is processed through an SCADown convolution to obtain the fourth result. The fourth result is processed sequentially through a C3k2 module, an SCADown convolution, a C3k2 module, and an SPPF module to obtain the fifth result. The fifth result is processed by the MKCA module to obtain the sixth result; the first, second, third, fourth, fifth and sixth results are input into the Neck network respectively.

3. The method for detecting industrial surface defects under complex backgrounds as described in claim 2, characterized in that, The processing procedure in the Neck network is as follows: The sixth result, after being upsampled, is concatenated with the fourth result and then passed through the C3k2 module to obtain the first C3k2 processing result. The first C3k2 processing result, after being upsampled, is concatenated with the third processing result and then passed through the C3k2 module to obtain the second C3k2 processing result, which is then input into the Head network. The second C3k2 processing result after SCADown processing is concatenated with the first C3k2 processing result and then passed through the C3k2 module to obtain the third C3k2 processing result, which is then input into the Head network. The third C3k2 processing result after SCADown processing is concatenated with the output of the MKCA module and then passed through the C3k2 module to obtain the fourth C3k2 processing result, which is then input into the Head network.

4. The method for detecting industrial surface defects under complex backgrounds as described in claim 3, characterized in that, The processing procedure of the sampling operator SCADown includes: Perform average pooling on the input feature map; The pooled feature map is divided into a first part and a second part along the channel dimension; The first part is processed sequentially through a 3×3 convolutional layer and an attention mechanism module to obtain the first branch features; The second part is processed sequentially through a max pooling layer and a 1×1 convolutional layer to obtain the second branch features; The first branch features and the second branch features are concatenated along the channel dimension to obtain the output feature map.

5. The method for detecting industrial surface defects under complex backgrounds as described in claim 4, characterized in that, The attention mechanism module is the SEAM module.

6. The method for detecting industrial surface defects under complex backgrounds as described in claim 1, characterized in that, The processing procedure of the MKCA module includes: The input features are sequentially passed through the first 1×1 convolutional layer, the batch normalization layer, and the activation function layer for dimensionality reduction and preprocessing; The preprocessed features are input into multiple parallel, depth-separable convolutional layers with different kernel sizes to extract multi-scale features; The output features of separable convolutional layers at different depths are added and fused together. The fused features are passed through a second 1×1 convolutional layer to restore the channel dimension, and then added to the input features via a residual connection. The summed result is enhanced using a coordinate attention mechanism to output the final feature.

7. The method for detecting industrial surface defects under complex backgrounds as described in claim 1, characterized in that, The processing procedure of the SC-Head includes: Multiple processing results from the Neck network are initially processed through independent groups of convolutional layers; Lightweight feature extraction is performed on the pre-processed features using depthwise separable convolutional layers and point convolutional layers with shared weights. The extracted features are processed through parallel branches to predict the bounding box distribution and class probability of the target, respectively. During the inference phase, prediction results at multiple scales are spliced ​​and decoded, and the precise bounding box position is calculated using the Distributed Focus Loss (DFL) mechanism. The final output is a result that integrates spatially adjusted detection boxes and class confidence scores.