An improved YOLOv11 model-based industrial defect high-precision detection method and system

By improving the EB-MCAM module and selective pseudo-label distillation mechanism of the YOLOv11 model, the problem of low detection accuracy of small targets and weak texture defects in the existing technology is solved, and the detection performance is improved without increasing the inference burden, making it suitable for industrial defect detection.

CN122134610APending Publication Date: 2026-06-02GUANGDONG POLYTECHNIC NORMAL UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG POLYTECHNIC NORMAL UNIV
Filing Date
2025-11-29
Publication Date
2026-06-02

Smart Images

  • Figure CN122134610A_ABST
    Figure CN122134610A_ABST
Patent Text Reader

Abstract

This invention provides a high-precision industrial defect detection method and system based on an improved YOLOv11 model. The method includes: acquiring an industrial defect image dataset and preprocessing it; selecting the YOLOv11 model as the base model and improving it by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to construct an industrial defect detection model; iteratively training the industrial defect detection model using the preprocessed industrial defect image dataset to obtain a trained industrial defect detection model; acquiring an image of the industrial product to be detected, inputting the image of the industrial product to be detected into the trained industrial defect detection model, and obtaining the corresponding industrial defect detection result. This invention can significantly improve the detection rate and positioning accuracy of small industrial target defects without increasing the on-site inference burden.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and industrial defect detection technology, and more specifically, to a high-precision industrial defect detection method and system based on an improved YOLOv11 model. Background Technology

[0002] Target detection technology plays a crucial role in industrial visual quality inspection scenarios (such as defect detection, flaw identification, and production anomaly monitoring). Compared to general natural scenes, industrial defects often exhibit characteristics such as small size, elongated shape, low texture contrast, strong background periodicity, and uneven data distribution. Specifically, industrial vision needs to locate and classify scratches, cracks, holes / pinholes, burrs / flashes, indentations, stains / foreign objects, uneven coating, short circuits / bridging, missing welds, and misalignments, and, when necessary, output pixel-level contours and geometric measurements (length, width, area, spacing, offset, etc.) to support rejecting and grading.

[0003] In recent years, with the rapid development of deep learning (DL) and machine learning (ML) technologies, industrial visual quality inspection has gradually evolved from the early "explicit feature engineering" based on thresholds, template matching, and manual rules to an end-to-end intelligent inspection system driven by data. For common appearance defects in production lines (such as scratches, cracks, pitting, dirt, plating defects, and edge chipping) and various tasks such as printing, screen printing, assembly, and mixed parts assembly, DL / ML has been systematically applied in classification (good / bad / graded), detection (defect localization boxes), semantic / instance segmentation (pixel-level contours), key point / contour measurement, and anomaly detection (defect-free learning), achieving significant progress in demanding conditions such as high resolution, weak texture, small size, and slender targets.

[0004] While DL / ML technology has significantly improved the automation and accuracy of industrial vision quality inspection, in real production lines, the choice of industrial vision quality inspection algorithms is not solely determined by offline accuracy and performance. It is also influenced by multiple constraints such as cycle time, cost, and reliability. Common hard indicators include: the upper limit of end-to-end latency per workstation, minimum stable FPS, etc. To meet computing power limits, it is often required that the number of parameters and GGFLOPs remain basically unchanged, the peak memory usage does not increase, and the number of IO accesses and copies does not increase, in order to avoid one-time capital expenditures for hardware upgrades and heat dissipation modifications. Industrial lines are highly sensitive to MTBF / MTTR (Mean Time Between Failures / Mean Time to Repair) and maintainability. If non-standard custom plugins or complex branches are introduced rashly, it will increase the online debugging time and upgrade and maintenance costs, which may lead to unplanned downtime. Downtime is directly priced as a loss of production capacity, and even a minute-level downtime will cause significant economic losses. Some industries (such as pharmaceuticals, automotive, and electronics) also require version traceability and portability.

[0005] Under the constraints of demanding production line environments and multiple limitations such as cost, cycle time, and compliance, developing a technical solution that can significantly improve the high-threshold localization quality and stability of small, elongated, and weakly textured targets without altering the inference computation graph, introducing additional parameters and GGFLOPs, and maintaining deployment equivalence, while also considering hardware portability, engine compatibility, maintainability, and auditability, remains a key direction for current technological development and a core requirement for industrial implementation. This need has long existed in the process of industrial vision implementation, but existing methods generally struggle to simultaneously meet the aforementioned triple goals of accuracy, efficiency, and engineering. Summary of the Invention

[0006] To overcome the shortcomings of existing industrial defect visual detection technologies, such as poor accuracy and low efficiency, this invention provides a high-precision industrial defect detection method and system based on an improved YOLOv11 model. By introducing an equal-budget multi-branch convolutional attention enhancement module (EB-MCAM module) to improve the YOLOv11 model, the detection rate and positioning accuracy of small industrial target defects are significantly improved without increasing the on-site inference burden.

[0007] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:

[0008] A high-precision industrial defect detection method based on an improved YOLOv11 model includes the following steps:

[0009] S1: Acquire an industrial defect image dataset and preprocess it; the industrial defect image dataset includes several images of industrial products with different defect categories;

[0010] S2: Select the YOLOv11 model as the base model and improve the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model.

[0011] S3: Iteratively train the industrial defect detection model using the preprocessed industrial defect image dataset to obtain the trained industrial defect detection model;

[0012] S4: Obtain the image of the industrial product to be detected, input the image of the industrial product to be detected into the trained industrial defect detection model, and obtain the corresponding industrial defect detection result.

[0013] Preferably, in step S1, the preprocessing includes: standardizing the format and size of all industrial product images in the industrial defect image dataset, labeling the category and location of defects in each industrial product image using annotation software, and performing data augmentation processing.

[0014] Preferably, the industrial product image is a PCB image and / or a metal surface image;

[0015] For the PCB image, the defect categories include at least one or more of the following: copper foil residue, rodent bites, open circuits, pinholes, short circuits, burrs, and spikes; for the metal surface image, the defect categories include at least one or more of the following: fine scratches, localized wear, and abnormal structures.

[0016] The data augmentation process includes at least one or more of the following: random cropping and scaling, random rotation and flipping, mirroring, random occlusion, contrast perturbation and random color perturbation, noise injection, and MixUp and Mosaic combined enhancement.

[0017] Preferably, in step S2, the input features of the EB-MCAM module are passed in parallel through three depth-separable convolutional layers with different kernel sizes to obtain three intermediate features. After multi-scale aggregation of the three intermediate features, channel compression is performed through 1×1 convolution to obtain convolutional fusion features.

[0018] The convolutional fusion features are sequentially subjected to global average pooling, adaptive one-dimensional convolution or fully connected mapping, and Sigmoid function normalization to obtain channel attention weights.

[0019] The convolutional fusion features are multiplied channel by channel by channel attention weights to obtain the output features of the EB-MCAM module.

[0020] Preferably, step S1 further includes:

[0021] Obtain a pre-trained teacher detection model, and use the pre-trained teacher detection model to perform offline inference on the industrial defect image dataset to generate an extended supervised label set;

[0022] In step S3, the industrial defect detection model is used as a student model. The industrial defect detection model is iteratively trained using the preprocessed industrial defect image dataset and the extended supervision label set to obtain the trained industrial defect detection model.

[0023] Preferably, the teacher detection model is the unmodified YOLOv11 model.

[0024] Preferably, in step S3, a total loss function is set. , used to supervise the iterative training of the industrial defect detection model;

[0025] The total loss function Represented as:

[0026]

[0027]

[0028] in, , and These are the bounding box regression loss, the target confidence loss, and the category prediction loss, respectively. This is due to distillation losses; These are the weighting coefficients.

[0029] Preferably, step S4 further includes: using a preset evaluation index to evaluate the performance of the trained industrial defect detection model.

[0030] Preferably, the evaluation metrics include at least one or more of the following: precision P, recall R, mean precision mAP, number of parameters Params, computational cost GFLOPs, and estimated inference time per image FPS.

[0031] This invention also provides a high-precision industrial defect detection system based on an improved YOLOv11 model, which, when applied using the above method, includes:

[0032] Preprocessing unit: used to acquire and preprocess industrial defect image datasets; the industrial defect image dataset includes several images of industrial products with different defect categories;

[0033] Model building unit: Used to select the YOLOv11 model as the base model and improve the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model.

[0034] Model training unit: used to iteratively train the industrial defect detection model using the preprocessed industrial defect image dataset, and obtain the trained industrial defect detection model;

[0035] Defect detection unit: used to acquire an image of the industrial product to be detected, input the image of the industrial product to be detected into the trained industrial defect detection model, and obtain the corresponding industrial defect detection result.

[0036] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:

[0037] This invention provides a high-precision industrial defect detection method and system based on an improved YOLOv11 model. First, an industrial defect image dataset is acquired and preprocessed. Then, the YOLOv11 model is selected as the base model, and improved by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to construct an industrial defect detection model. Next, the industrial defect detection model is iteratively trained using the preprocessed industrial defect image dataset to obtain a trained industrial defect detection model. Finally, an image of the industrial product to be detected is acquired and input into the trained industrial defect detection model to obtain the corresponding industrial defect detection result.

[0038] This invention improves the YOLOv11 model by introducing an equal-budget multi-branch convolutional attention enhancement module (EB-MCAM module), thereby significantly improving the detection rate and localization accuracy of small industrial target defects without increasing the on-site inference burden. In addition, this invention can introduce a teacher model for label expansion during the training phase, thereby further improving the model's feature representation and supervision density for small targets and weakly textured defects. This invention effectively solves the industrial problem of balancing detection performance and computing power constraints in resource-constrained scenarios. Attached Figure Description

[0039] Figure 1 This is a flowchart of a high-precision industrial defect detection method based on an improved YOLOv11 model, as provided in Example 1.

[0040] Figure 2 This is the data preprocessing flowchart provided in Example 2.

[0041] Figure 3 This is a structural diagram of the industrial defect detection model provided in Example 2.

[0042] Figure 4 This is a structural diagram of the EB-MCAM module provided in Example 2.

[0043] Figure 5 This is a schematic diagram of selective pseudo-label generation and dual threshold filtering provided in Example 2.

[0044] Figure 6 This is a flowchart comparing the training and deployment phases provided in Example 2.

[0045] Figure 7 This is a structural diagram of a high-precision industrial defect detection system based on an improved YOLOv11 model, as provided in Example 3. Detailed Implementation

[0046] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this application.

[0047] To better illustrate this embodiment, some parts in the accompanying drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions;

[0048] It will be understood by those skilled in the art that certain well-known structures and their descriptions may be omitted in the accompanying drawings.

[0049] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0050] Example 1

[0051] like Figure 1 As shown, this embodiment provides a high-precision industrial defect detection method based on an improved YOLOv11 model, including the following steps:

[0052] S1: Acquire an industrial defect image dataset and preprocess it; the industrial defect image dataset includes several images of industrial products with different defect categories;

[0053] S2: Select the YOLOv11 model as the base model and improve the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model.

[0054] S3: Iteratively train the industrial defect detection model using the preprocessed industrial defect image dataset to obtain the trained industrial defect detection model;

[0055] S4: Obtain the image of the industrial product to be detected, input the image of the industrial product to be detected into the trained industrial defect detection model, and obtain the corresponding industrial defect detection result.

[0056] In the specific implementation process, the original industrial defect image dataset is first acquired and preprocessed. In this embodiment, the dataset can come from typical industrial visual scenarios such as PCB defects, metal surface scratches, and coating peeling. The preprocessing includes unifying the image size, normalizing the color / brightness, converting the annotation format (converting to YOLO format center point coordinates + width and height + category), and dividing the data according to the ratio of training set, validation set, and test set. After that, data augmentation and data expansion steps can be performed according to actual business needs. For example, before loading the data into the model, random horizontal / vertical flipping, random cropping, random brightness / contrast perturbation, noise perturbation, and Mosaic multi-image stitching are performed in sequence according to a set probability to improve the diversity of small target and weak contrast defect samples and enhance the model's generalization ability in industrial scenarios.

[0057] Next, an industrial defect detection model is established. In this embodiment, the model structure mainly consists of three parts: The first part is the feature extraction backbone network on the student side, which is used to extract semantic features from the input industrial defect image layer by layer from shallow to deep and output multi-scale feature maps; The second part is the budget equivalent multi-branch convolutional attention module (EB-MCAM). Under the premise of maintaining the consistency of the input and output interface with the original feature convergence position and satisfying the preset budget constraints for parameter quantity and GFLOPs, this module uses a multi-branch depthwise separable convolutional PKI-Lite structure to perform multi-scale information aggregation, and connects lightweight channel attention ECCA to perform adaptive recalibration of sub-channels, thereby enhancing the representation of small defects and weak texture regions without increasing inference overhead; The third part is the multi-scale detection head, which receives features of different scales from the backbone network and the output of EB-MCAM, performs joint regression and classification prediction on the category and location of industrial defects, and outputs the detection results.

[0058] In industrial surface defect detection scenarios, defects often exhibit characteristics such as small size, low contrast, irregular shape, and dispersion across different areas of the inspected workpiece. Simultaneously, the background may contain strong interference patterns such as circuit traces, metal textures, and solder pad reflections. Therefore, computer-aided inspection requires a detection backbone capable of simultaneously preserving fine-grained spatial information and high-level semantic information. This method uses a lightweight target detection network (such as a hierarchical feature pyramid backbone like YOLOv11) as its basic structure, directly inputting a pre-processed, size-uniformed, and annotated industrial image. It employs a full-image input method rather than local cropping, aiming to allow the model to simultaneously perceive both the "defect itself" and the "contrast reference of normal areas" within the same image, thereby improving the ability to distinguish between weakly textured and small-sized defects. The main task of this part is to encode the original industrial images layer by layer into multi-scale feature maps. The shallow layers focus on fine structures such as edges, contours and weld points, while the deep layers focus on defect category differentiation and background suppression, providing semantically sufficient and appropriately resolution basic representations for subsequent feature enhancement modules and detection heads. The overall backbone is constructed using a phased downsampling, residual / cross-layer aggregation and multi-scale output method, which enables the network to maintain good convergence and generalization even when the amount of industrial data is not particularly large.

[0059] Meanwhile, considering that conventional detection networks often use fixed structures such as SPP / SPPF at high-level feature convergence points, their receptive field and channel modeling capabilities have limited effectiveness in improving very small defects, this method inserts an equal-budget feature enhancement unit at the backbone feature convergence position without changing the original input / output interface or exceeding the computational power and parameter budget on the deployment side. The core idea of ​​this unit is to use a multi-branch depthwise separable convolutional structure to perform multi-scale receptivity on the same feature map, then perform channel fusion through 1×1 convolution, and finally connect a lightweight channel attention branch at the end to adaptively weight the channels containing effective defect responses. In other words, the first half corresponds to our "equal-budget replacement" of SPPF, and the second half corresponds to the "lightweight recalibration" of important channels. Together, they constitute the EB-MCAM module of this invention. Since the input size, output size, and number of channels of this module are consistent with the replaced unit, it can be seamlessly embedded into the existing YOLO structure to achieve the effect of "stronger features during training, but unchanged budget during inference," making it more suitable for deployment on industrial lines.

[0060] Furthermore, industrial defect data often suffers from incomplete manual annotation, a limited number of similar defect samples, and the neglect of minor defects by annotators. Directly training with existing annotations results in sparse supervision signals and insensitivity of the model to small defects. To address this, this method introduces a high-performance teacher detection model, or one pre-trained in the same domain, during the training phase. This teacher performs offline inference on the training set and selectable unannotated industrial images, generating a rich pool of candidate defect boxes. Then, using set confidence and overlap thresholds, the candidate boxes are filtered, retaining only pseudo-labels with high confidence that complement or do not conflict with the manual annotations. These pseudo-labels are merged with the original annotations to form a denser "extended supervision set." The purpose of this is to incorporate defects that the teacher can see but the annotations don't explicitly state, allowing the student network to truly learn fine-grained, low-contrast defects that may occur in industrial scenarios during training, without needing to call the teacher model again during deployment.

[0061] Specifically, during the training phase, this embodiment also introduces a teacher detection model and a selective pseudo-label distillation mechanism. First, the teacher model is used to perform offline inference on the training set and optional unlabeled industrial images to obtain a set of candidate detection boxes containing location, category, and confidence. Then, the candidate boxes are screened using a dual gating system based on confidence and IoU thresholds, retaining only pseudo-labels with high confidence that do not conflict with or are complementary to the manual annotations. These pseudo-labels are then merged with the original manual annotations to form an extended supervision label set. Finally, the prediction results of the student model and the extended supervision label set are fed into a joint loss function for backpropagation and parameter updates. The joint loss includes bounding box regression loss, target loss, category prediction loss, and distillation loss weighted by pseudo-label confidence, thereby obtaining denser and more reliable supervision information than the original annotations during training.

[0062] Since industrial deployments are often limited by the low edge computing power of production lines, this method proactively disables auxiliary structures such as teacher inference paths, pseudo-label generation, and weighted control, which are only needed during the training phase, during the inference stage. Only the main detection path is retained, ensuring that the final model maintains consistency with the original YOLO baseline in terms of parameter count, GFLOPs, and operator set, or exhibits only minimal tolerance. Therefore, it can be deployed without additional modifications to the deployment environment. Overall, this method achieves the goal of improving industrial defect detection performance without increasing deployment costs by placing "model structure enhancement" in the training phase and "computational budget constraints" in the inference phase.

[0063] Specifically, during the inference and deployment phases, a zero-budget-constraint deployment strategy is invoked, which hides all teacher inference paths, pseudo-label generation and filtering paths used during training, and retains only the detection backbone containing EB-MCAM and multi-scale detection heads. This ensures that the final online detection model is consistent with the original baseline model in terms of parameter count, GFLOPs and inference latency, while achieving higher detection rates and localization accuracy for small targets and weakly textured industrial defects.

[0064] Example 2

[0065] This embodiment provides a high-precision industrial defect detection method based on an improved YOLOv11 model, including the following steps:

[0066] S1: Acquire an industrial defect image dataset and preprocess it; the industrial defect image dataset includes several images of industrial products with different defect categories;

[0067] S2: Select the YOLOv11 model as the base model and improve the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model.

[0068] S3: Iteratively train the industrial defect detection model using the preprocessed industrial defect image dataset to obtain the trained industrial defect detection model;

[0069] S4: Obtain an image of the industrial product to be detected, input the image of the industrial product to be detected into the trained industrial defect detection model, and obtain the corresponding industrial defect detection result;

[0070] In step S1, the preprocessing includes: standardizing the format and size of all industrial product images in the industrial defect image dataset, using annotation software to annotate the category and location of defects in each industrial product image, and performing data augmentation processing.

[0071] The industrial product images specifically refer to PCB images and / or metal surface images;

[0072] For the PCB image, the defect categories include at least one or more of the following: copper foil residue, rodent bites, open circuits, pinholes, short circuits, burrs, and spikes; for the metal surface image, the defect categories include at least one or more of the following: fine scratches, localized wear, and abnormal structures.

[0073] The data augmentation process includes at least one or more of the following: random cropping and scaling, random rotation and flipping, mirroring, random occlusion, contrast perturbation and random color perturbation, noise injection, and MixUp and Mosaic combined enhancement.

[0074] In step S2, the input features of the EB-MCAM module are passed in parallel through three depthwise separable convolutional layers with different kernel sizes to obtain three intermediate features. After multi-scale aggregation of the three intermediate features, channel compression is performed through 1×1 convolution to obtain convolutional fusion features.

[0075] The convolutional fusion features are sequentially subjected to global average pooling, adaptive one-dimensional convolution or fully connected mapping, and Sigmoid function normalization to obtain channel attention weights.

[0076] The convolutional fusion features are multiplied channel by channel by channel attention weights to obtain the output features of the EB-MCAM module;

[0077] Step S1 further includes:

[0078] Obtain a pre-trained teacher detection model, and use the pre-trained teacher detection model to perform offline inference on the industrial defect image dataset to generate an extended supervised label set;

[0079] In step S3, the industrial defect detection model is used as a student model. The industrial defect detection model is iteratively trained using the preprocessed industrial defect image dataset and the extended supervision label set to obtain the trained industrial defect detection model.

[0080] The teacher detection model is specifically the unmodified YOLOv11 model;

[0081] In step S3, the total loss function is set. , used to supervise the iterative training of the industrial defect detection model;

[0082] The total loss function Represented as:

[0083]

[0084]

[0085] in, , and These are the bounding box regression loss, the target confidence loss, and the category prediction loss, respectively. This is due to distillation losses; These are the weighting coefficients;

[0086] Step S4 further includes: using a preset evaluation index to evaluate the performance of the trained industrial defect detection model;

[0087] The evaluation metrics include at least one or more of the following: precision (P), recall (R), mean precision (mAP), number of parameters (Params), computational cost (GFLOPs), and estimated inference time per image (FPS).

[0088] In the specific implementation process, the dataset is first acquired and preprocessed:

[0089] The industrial defect image data used in this method mainly comes from publicly available printed circuit board defect datasets and metal surface defect datasets. Among them, the PCB data uses the publicly available DeepPCB dataset, which contains defect and non-defect image samples from real PCB inspection scenarios, covering a variety of typical PCB surface defect types such as copper residue, mouse bite, open circuit, pinhole, short circuit, and burr / spur. The original images have high resolution and complex backgrounds, which can better simulate the inspection output of actual online AOI equipment. The metal surface scratch data uses the Kolektor Surface Defect Detection Second Edition dataset (KSDD2), which mainly contains thin scratches, local wear, and a small number of abnormal structures on the surface of industrial components. It has the typical long-tail distribution characteristics of industry, where "most samples are normal and only a small number are defects".

[0090] Raw images directly exported from publicly available industrial defect datasets cannot be directly used for model training and comparative experiments. Firstly, DeepPCB, KSDD2, and data collected from enterprise sites often come from different production lines and different acquisition devices (online AOI, industrial cameras, laboratory scanners) with varying imaging conditions, resulting in differences in resolution, viewing angle, lighting, and even background texture. Secondly, the placement, rotation angle, and cropping position of the same PCB board or metal component during acquisition are not uniform, leading to significant differences in the position, scale, and aspect ratio of defects of the same category in the pixel coordinate system. Furthermore, the raw dataset may contain invalid background areas (such as redundant white borders, black fills, workstation QR codes and labels, and textureless areas around the image). These elements do not provide effective features for the detection task but instead increase I / O and computational overhead during training and affect the model's attention allocation to defect areas. Therefore, standardized preprocessing of raw industrial defect images is necessary. The main preprocessing steps are as follows: Figure 2 As shown, the main steps include:

[0091] 1) Defect Annotation Information Parsing: For each image, extract the corresponding defect region annotation information. This annotation information may be in the form of VOC (Pascal XML), COCO (JSON), or segmentation mask or difference map defined in KSDD2. The defect annotations are uniformly parsed into rectangular bounding boxes, i.e., obtaining the "category label" and "top-left corner coordinates" for each defect target. "and the coordinates of the lower right corner" Basic information such as these will be used as labels for subsequent training.

[0092] 2) Size Normalization and Input Format Standardization: All images will be processed uniformly using a strategy of "proportional scaling + edge padding". First, the image size is scaled by the largest side to maintain the aspect ratio of the defect target; then, symmetrical edge padding is applied to the scaled image to achieve the target input size (e.g., 640×640 or 1024×1024); the fill value for blank areas is the image mean or a specified constant (e.g., 128).

[0093] 3) Coordinate transformation and label format standardization: Normalize all bounding boxes in the image, converting the original pixel coordinates... Convert to YOLO format ,in This represents the normalized coordinates of the center point of the defect box on the image. This represents the normalized width and height, with all values ​​within the range [0,1]. This format conversion ensures consistency in image annotation across different sources, facilitating unified use in the training pipeline;

[0094] Following this, data augmentation operations are performed. Considering common issues in industrial defect images such as background texture interference, strong defect shape variability, and uneven distribution of class sample numbers, this invention introduces multiple data augmentation methods during the training phase to improve the detector's robustness to boundary blurring, defect scale changes, and occlusion. The specific data augmentation steps used are as follows:

[0095] 1) The image is randomly rotated (±10~15°) and flipped horizontally or vertically (p=0.5);

[0096] 2) Random cropping and scaling: cropping a portion of the image and then scaling it proportionally;

[0097] 3) Cutout Occlusion: Occlusion blocks (approximately 32×32 in size) are inserted at random positions to simulate defect interference;

[0098] 4) Contrast perturbation and color perturbation: Enhance the contrast between defects and the background to improve model perception;

[0099] 5) MixUp and Mosaic combination enhancement: Combine two images or stitch four images into one to increase sample complexity;

[0100] After all data preprocessing is completed, the data is randomly divided into training set, validation set and test set according to the official proportions.

[0101] Establishing an industrial defect detection model: An overview of this method's model is as follows Figure 3 As shown, the following sections will introduce the specific implementations of the feature extraction backbone network, the equal-budget multi-branch convolutional attention module (EB-MCAM), and the multi-scale detection head, and explain the Selective Pseudo-label Incorporation (SASA) mechanism introduced during the training phase. In this embodiment, the feature extraction backbone network is based on the YOLOv11 backbone structure and is used to extract multi-scale semantic and texture features of industrial defect images from the bottom up. The EB-MCAM module is deployed at the original YOLOv11 feature convergence SPPF location, consisting of a multi-branch depthwise separable convolutional PKI-Lite structure and a lightweight channel attention ECCA sequence. The method enhances multi-scale contextual representation while maintaining the input / output channels and spatial dimensions, achieving feature enhancement under equal budget conditions. The multi-scale detection head is responsible for feeding feature maps from different scales into the detection branch to complete the category discrimination and location regression of defect targets. Considering the high annotation cost and sparse distribution of defect samples in industrial scenarios, this method further introduces the SASA selective pseudo-labeling incorporation mechanism during the training phase. High-confidence candidate boxes are generated by the teacher detection model and incorporated into manual annotation after being filtered by dual thresholds of confidence and IoU, so as to improve the supervision density without changing the inference computation graph. The implementation methods of each part are described in turn below.

[0102] A. Feature extraction backbone network:

[0103] 1) Feature coarse extraction sub-network (stem):

[0104] like Figure 3 As shown, the preprocessed industrial defect image is input into the detection model of this embodiment. The industrial defect image has been scaled and normalized to ensure uniform size and aspect ratio during the preprocessing stage, and transformed to a preset input resolution of 640*640. Before entering the backbone network, the input image is first aggregated with low-level texture and edge information through a shallow feature extraction sub-network.

[0105] First, the input image is fed into a standard Conv+BN+SiLU module with a kernel size of 3×3, a stride of 2, and an output channel of C1. Figure 3 The term CBS is used to complete one downsampling and obtain the initial feature map.

[0106] Secondly, the initial feature map is fed into a second CBS or a lightweight C3k2 residual block to stabilize the distribution of subsequent deep features and suppress interference from large background areas in industrial images, thus obtaining the output feature P1 of the first stage.

[0107] 2) Staged downsampling and C3k2 feature aggregation:

[0108] To adapt to the characteristics of industrial defects, such as "large target size range, high proportion of small targets, and sensitivity to edge / trace continuity", the backbone network of this embodiment adopts a hierarchical downsampling method consistent with the YOLOv11 structure, and sequentially obtains semantic features at four scales: P2, P3, P4, and P5. Through the above-mentioned layer-by-layer downsampling and C3k2 stacking, a set of multi-scale features {P3, P4, P5} that meet the requirements of top-down fusion can be obtained, providing inputs with different spatial resolutions for the subsequent neck network and head.

[0109] 3) Equal-budget multi-branch convolutional attention module (EB-MCAM):

[0110] To improve the perception capability of high-level semantic features for minute, weakly textured industrial defects without increasing the number of parameters and computational cost in the inference stage, this embodiment replaces the SPPF in the original YOLOv11 backbone network with an equal-budget multi-branch convolutional attention module (EB-MCAM), such as... Figure 4 As shown, this module consists of a "multi-branch depthwise separable convolutional PKI-Lite core" and a "lightweight channel attention ECCA" concatenated together. Its input / output dimensions and number of channels remain consistent with the original SPPF, thus meeting the zero-budget constraint during deployment. The module structure is as follows:

[0111] 3.1) Multi-branch depthwise separable convolution (PKI-Lite core):

[0112] Assume the input features from the previous layer are First of all Three depthwise separable convolutional branches are fed in parallel, with kernel sizes of 3×3, 5×5, and 7×7, respectively, to simultaneously sense defect regions of different scales and obtain three intermediate features:

[0113]

[0114] DWConv represents depthwise separable convolution, used to expand the receptive field without significantly increasing the number of parameters. Subsequently, the three features are concatenated or added together along the channel dimension to obtain multi-scale aggregated features. Channel compression and linear combination are performed using a 1×1 convolution:

[0115]

[0116] This allows for the introduction of parallel convolutions with multiple kernel sizes while maintaining the same input-output scale as SPPF, enabling high-level semantic features to simultaneously perceive both large defects (such as large areas of copper exposure) and extremely small defects (such as pin-holes and spurs).

[0117] 3.2) Lightweight Channel Attention ECCA:

[0118] Considering the high proportion of background areas and sparse effective defect areas in industrial defect images, this embodiment introduces a lightweight channel attention branch after the PKI-Lite core to further weight the convolutionally fused features. Specifically, for Perform global average pooling in the spatial dimension to obtain the channel description vector:

[0119]

[0120] Then Feed the input into an adaptive one-dimensional convolutional or fully connected mapping to generate channel weights. And normalized by the Sigmoid function:

[0121]

[0122] Finally, this weight is multiplied by the feature channel by channel to obtain the channel-selective enhanced feature. :

[0123]

[0124] in This indicates channel-by-channel multiplication. Since ECCA only performs minimal recalibration at the channel level, its parameters and FLOPs overhead can be kept within the same order of magnitude as the original SPPF.

[0125] B. Feature output and neck network connection:

[0126] The highest-level features output by the backbone network after EB-MCAM enhancement correspond to the original P5 scale and are fed into the neck network via lateral connections. Simultaneously, features from the intermediate P3 and P4 scales are also input into the neck via a top-down path, achieving multi-scale feature fusion and upsampling. Since the output size of EB-MCAM remains consistent with the original SPPF, the structure of the neck and subsequent detector heads can directly reuse YOLOv11's feature fusion and three detector heads without modification, ensuring the compatibility of this method with existing YOLO deployments during the inference phase.

[0127] This embodiment introduces a selective pseudo-label incorporation mechanism during the training phase, such as... Figure 5 As shown, to increase the supervision density during the training phase without increasing the computational overhead of the inference phase, this method introduces a teacher inference path that is only enabled during offline training. The teacher detection model can be a YOLOv11n baseline model with the same architecture as the student model but which has fully converged on the target dataset, or it can be a larger-capacity detection model from the same series. Its output format is consistent with that of the student model (category score, bounding box position and size, target confidence). In actual deployment, it is preferable to directly load the baseline weights that have been trained and validated to have better performance as the teacher model T to avoid additional training overhead.

[0128] In each training iteration or pre-offline phase, the preprocessed industrial defect image (which may contain manually labeled and unlabeled samples) is input into the teacher detection model T to obtain a set of candidate detection results corresponding to the image, denoted as:

[0129]

[0130] in, Represents the bounding box coordinates of the i-th candidate box (center coordinates + width and height or top left corner + bottom right corner). Indicates its category prediction, This represents the confidence score of the teacher model for the target. Since there are easily confused areas such as board textures, pads, and traces in industrial scenarios, directly using all candidate boxes as pseudo-labels will introduce high noise, so a subsequent selective screening step is required.

[0131] To ensure the quality of data incorporated from student supervision, this method employs a dual-gating rule of "confidence score + IoU" for selective pseudo-labeling of teacher candidate boxes. First, a confidence score threshold is set. Only retain those that meet the requirements. High-confidence candidate boxes are used to filter out uncertain detection results from the teacher model. Furthermore, to avoid overlap and conflict with existing manually labeled boxes in the image, this method sets an IoU threshold. This sets the teacher candidate bounding boxes to the manually labeled bounding boxes of the current image. Calculate the intersection-union ratio one by one:

[0132]

[0133] If the IoU between the candidate bounding box and any manually annotated bounding box is higher than 100%, then the candidate If the candidate bounding box is found to conflict with or be redundant with manually labeled bounding boxes, the strategy can be adjusted to either "skip and merge" or "replace the poor-quality manually labeled bounding box with the teacher's bounding box"; if the IoU between the candidate bounding box and all manually labeled bounding boxes is lower than 1, the candidate bounding box is considered to have conflict with or be redundant with manually labeled bounding boxes. If the candidate box is identified as a "new defect not covered by manual annotations but with high confidence from teachers," it can be safely added; thus, a high-quality set of pseudo-labels is obtained after filtering.

[0134]

[0135] The above high-quality pseudo-tag set Compared with the original manually labeled set Perform a union operation to form the extended supervision label set used in the current training batch:

[0136]

[0137] in, This ensured the accuracy of manually labeled samples. It provides additional potential defect regions discovered by the teacher detection model, and the combination of the two can alleviate the problem of sparse labeling of industrial defect samples and the omission of some small targets.

[0138] Considering that even after double-threshold screening, pseudo-labels may still have a small amount of uncertainty, this method introduces a confidence weighting factor for samples from pseudo-labels in the detection loss, allowing high-confidence pseudo-labels to contribute more to the loss while suppressing the influence of low-confidence pseudo-labels. Specifically, the detection loss of the student model on the current sample is composed of bounding box regression loss, target confidence loss, and category prediction loss.

[0139]

[0140] For the k-th sample from the teacher pseudo-label, its weight is defined as:

[0141]

[0142] The detection loss described above can be written as:

[0143]

[0144] This embodiment simultaneously performs distillation alignment on student and teacher features, adding a distillation loss in addition to the aforementioned losses. and with coefficients By controlling their weights, we obtain the final total loss:

[0145]

[0146] in, The value can be selected between 0.1 and 1.0 depending on the quality of the pseudo-labels and the size of the dataset.

[0147] To ensure that the "teacher detection model" introduced during the training phase does not impose additional computational and storage overhead on online detection, this scheme employs a zero-budget constraint strategy during model export and deployment. Figure 6 Specifically, it includes the following steps:

[0148] 1) Trimming and fixing the deployment computation graph:

[0149] After training, the exported online detection model retains only the main pathway and backbone network of the student side; the teacher detection model T, pseudo-label generation module, dual threshold screening module, and extended supervision label set construction logic temporarily introduced during the training phase are not written into the final computation graph.

[0150] 2) Fixing the location of the budget structure:

[0151] Since this method replaces the SPPF module in the original YOLOv11 backbone network with an equal-budget multi-branch convolutional attention module (EB-MCAM), the tensor size, number of channels, stride, and connection method with the subsequent Neck are completely consistent with the original SPPF, and there is no need to dynamically select branches or load external parameters during inference.

[0152] 3) Teacherless path reasoning:

[0153] During deployment, the teacher detection model T is no longer invoked, nor is the operation of "inferring again to generate pseudo-labels" on the input image performed. This path is completely blocked during the deployment phase.

[0154] 4) Optional lightweight and trimming options:

[0155] In scenarios where computing power is more limited at the edge or where detection speed is the priority, this embodiment also allows channel compression or branch pruning of the replaced EB-MCAM: for example, only the 3×3 and 5×5 DWConv branches are retained, and the 7×7 branch is pruned.

[0156] Through the synergy of the above components, this method achieves the following: during the training period, it can "calculate more and see more comprehensively," while during the inference period, it still "runs according to the original budget," thus meeting the technical goal of "adaptive enhancement during the training period and zero budget constraint during the inference period" proposed by this method, while maintaining good deployment feasibility.

[0157] Next, experimental verification was conducted. The experimental equipment was a computer running Ubuntu 22.04, with Python 3.10.18, PyTorch 2.8.0, and the Ultralytics YOLO 8.3.203 framework installed. It was also equipped with an NVIDIA GeForce RTX 3090 graphics card. All training and verification processes were completed in this environment. The datasets used were the DeepPCB dataset and the KSDD2 dataset mentioned above, which were randomly divided into training and test sets according to their respective official recommended ratios.

[0158] The training strategy is as follows: the number of training rounds is set to 100, the batch size is set to 8, and the optimizer used has a momentum factor of 0.937 and a weight decay coefficient of 5 × 10⁻⁻. 4 The SGD optimizer is used; the initial learning rate is set to 0.01, and a Cosine learning rate decay strategy is adopted. Linear warmup is performed in the first 3 rounds to improve training stability. To enhance the robustness of the model, the default Mosaic and MixUp data augmentation methods are introduced, and random rotation, scaling and color perturbation are performed.

[0159] In model performance evaluation, the main evaluation metrics used include: Precision (P), representing the proportion of samples detected as defects that are actually defects; Recall (R), representing the proportion of all true defects that are successfully detected; mAP@0.5, which is the average AP for each class when the IoU threshold is 0.5; mAP@0.5:0.95, which is the average AP calculated at multiple thresholds with IoU thresholds [0.5, 0.95] and step size of 0.05, used to more rigorously measure detection and localization performance; in speed and overhead evaluation, the model's number of parameters, computational cost (GGFLOPs), and estimated single-frame inference time (FPS) are also recorded; these metrics are defined as:

[0160]

[0161]

[0162]

[0163]

[0164]

[0165]

[0166] Where TP represents correctly detected instances of this type of defect, FP represents instances where background or other categories are falsely identified as this type, and FN represents instances of this type of defect that are not correctly covered by any predictions. It is the time for a single inference.

[0167] To verify the ability of the lightweight industrial defect detection method proposed in this embodiment to improve detection accuracy while maintaining detection speed, as shown in Table 1, all models were trained using the same training strategy, data partitioning method, and optimizer settings. Their performance metrics were uniformly evaluated using four common evaluation metrics: Precision (P), Recall (R), mAP@0.5, and mAP@0.5:0.95. Furthermore, the model's Params, GFLOPs, end-to-end inference latency (ms / image) per image, and FPS were recorded to assess its practical deployment value.

[0168] Table 1 compares the performance of the proposed model and the benchmark model on the industrial defect detection data test set.

[0169]

[0170] Experimental results on the DeepPCB dataset show that, with a slight reduction in the number of parameters from 2.58M to 2.56M, the proposed "YOLOv11n + EB-MCAM + SASA" method achieves a comprehensive improvement in accuracy: precision (P) increases from 94.4% to 95.8%, recall (R) from 90.6% to 91.4%, mAP@0.5 from 95.5% to 96.3%, and mAP@0.5:0.95 from 52.1% to 56.3%, with the mAP@0.5:0.95 improvement reaching 4.2 percentage points, significantly outperforming the baseline model. Simultaneously, in terms of inference speed, this method reduces the end-to-end latency per image from 10.7ms to 9.7ms, and increases the average FPS from 93.46 to 103.09, indicating that this method improves accuracy without introducing additional latency burden, and instead enhances hardware friendliness.

[0171] Consistent performance gains were also observed on the KSDD2 dataset. Our method outperformed the baseline model across all accuracy metrics: P increased from 94.4% to 95.8%, R from 90.6% to 91.4%, mAP@0.5 from 95.5% to 96.3%, and mAP@0.5:0.95 from 52.1% to 56.3%. In terms of speed, end-to-end latency was reduced from 11.3ms to 9.8ms, and the frame rate increased from 90.09 to 102 FPS. In summary, this embodiment demonstrates that the solution improves both detection accuracy and inference speed while maintaining a lightweight model, making it highly valuable for industrial deployment.

[0172] To demonstrate the significant performance of the model, this embodiment selects several mainstream lightweight object detection networks as comparison methods. The selected methods cover representative evolutions of different versions of the YOLO architecture, including different optimization paths such as Neck structure innovation, introduction of attention mechanisms, and detection head improvements. As shown in Table 2, the comparison models include five categories: YOLOv8n, YOLOv9t, YOLOv10n, YOLOv11n, and YOLOv12n. The selected comparison methods are briefly described below:

[0173] Among them, YOLOv8n introduced a lighter C2f module structure for the first time, and adopted an anchor-free detection head design, which improved detection accuracy while maintaining model inference speed, and showed a good performance balance in multiple general detection tasks. YOLOv9t was the first in the YOLO series to introduce the Visual Transformer (ViT) structure into a lightweight object detection framework. By replacing part of the backbone convolution structure with Transformer modules and combining C2f-DP modules with a lightweight attention mechanism, it enhanced the model's context modeling ability and semantic information capture ability. YOLOv10n further unified the design of the backbone and detection head in terms of architecture, and introduced an efficient RepConv (reparameterized convolution) module, which effectively reduced redundant computation and improved inference efficiency. It is an important step for the YOLO architecture towards unified design and inference acceleration. YOLOv12n explored model compression and robustness, combined with a multi-scale feature reconstruction module to improve the detection ability of small objects, and further enhanced the model's adaptability and generalization ability in data-constrained environments.

[0174] To ensure fairness in the comparison, this embodiment only compares the performance of the above models on two industrial defect detection datasets: DeepPCB and KSDD2. To maintain consistency, all models were trained and tested under the same training configuration and data partitioning conditions. Performance metrics were evaluated using four indicators: Precision (P), Recall (R), mAP@0.5, and mAP@0.5:0.95. As shown in Table 2, this method achieved optimal performance on both datasets. Specifically, it achieved 96.3% mAP@0.5 and 56.3% mAP@0.5:0.95 on the DeepPCB dataset, and 66.3% and 30.9% respectively on the KSDD2 dataset.

[0175] Table 2 compares the performance of the proposed model with other models on the industrial defect detection dataset.

[0176]

[0177] First, compared with lightweight networks such as YOLOv8n, YOLOv9t, YOLOv10n, and YOLOv12n, this method significantly improves detection accuracy while maintaining low inference cost. This is due to the introduction of equal-budget multi-branch convolution and channel recalibration at the feature convergence position in the EB-MCAM module, which enables the network to obtain more comprehensive multi-scale representation capabilities without increasing inference overhead, thus forming a clearer feature expression for small-sized and weakly textured industrial defects. Second, the addition of SASA selective pseudo-labels effectively increases the density of high-quality supervision samples, enabling the model to obtain more stable detection results when facing small targets and complex background defects, demonstrating better supervised generalization and robustness. By integrating EB MCAM and SASA mechanisms on this basis, this method achieves joint modeling of global context and spatially sensitive regions, thus achieving comprehensive leadership across multiple datasets and multiple dimensional metrics.

[0178] To verify the effectiveness of the improved strategy proposed in this embodiment, a series of ablation experiments were conducted on the YOLOv11n baseline model, and the results are shown in Table 3:

[0179] Table 3 Ablation Experiment Results

[0180]

[0181] The PCBDep dataset shows that, compared to the baseline, introducing EB-MCAM on the structural side alone resulted in varying degrees of decrease in P, R, and mAP@0.5 (P decreased from 94.4% to 86.3%, R from 90.6% to 82.0%, and mAP@0.5 from 95.5% to 89.5%). This indicates that replacing the feature convergence location while maintaining the same budget will perturb the discrimination distribution of the detection head, and structural replacement alone is insufficient to fully realize its potential.

[0182] When SASA is introduced separately on the training side, the performance degradation is more significant (P drops to 83.3%, R drops to 64.6%, and mAP@0.5 drops to 69.7%). This indicates that if only the pseudo-labels generated by the teacher are incorporated without improving the feature representation of the backbone, the student model will be more sensitive to the noise of the pseudo-labels.

[0183] When EB-MCAM + SASA (i.e., Ours) are enabled simultaneously, performance not only recovers but also exceeds the baseline: P on PCBDep increases to 95.8%, R increases to 91.4%, mAP@0.5 increases to 96.3%, and mAP@0.5:0.95 also increases to 56.3%;

[0184] The results on the KSDD2 dataset are consistent with the above conclusions: using EB-MCAM alone or SASA alone, the metrics are very close to the baseline or even fluctuate slightly; however, when the two are combined, P increases from 70.6% to 73.1%, and mAP@0.5 increases from 64.2% to 66.3%.

[0185] Ablation experiments on the two datasets above demonstrate that the proposed approach of "structural budget replacement + selective pseudolabel incorporation during training" is complementary: the former improves the representation of small target / weak texture features, while the latter provides denser and higher-confidence supervision. The combined effect of the two can offset the performance fluctuations caused by their individual use. The approach exhibits transferability and stable gain effects on different industrial defect datasets, verifying the effectiveness of the overall design of "enhancement during training and zero / near-zero overhead during inference" proposed in this method.

[0186] This method proposes an industrial defect detection model based on adaptive enhancement during training and zero-budget constraints during inference. In this model, YOLOv11n is used as the student backbone, and the SPPF at the original high-level feature convergence location is replaced with an equal-budget multi-branch convolutional attention module (EB-MCAM). Through the fusion of PKI-Lite's multi-scale depthwise separable convolution and ECCA lightweight channel recalibration, feature enhancement for weakly textured and small-target defects is achieved without increasing the number of parameters or FLOPs. Simultaneously, combining the original PAN / FPN-style multi-scale feature fusion allows for the full reuse of features at each level (P3, P4, P5), further improving the robustness of detecting industrial defects at different scales. Secondly, a Selective Pseudo-Label Incorporation (SASA) mechanism, which exists only offline, is introduced during the training phase. This mechanism utilizes teacher model inference, confidence, and I... By employing dual-threshold oU filtering and loss weighting, and incorporating high-quality pseudo-labels into manual annotation, this method significantly improves supervision density and addresses the performance limitations caused by scarce and missed annotations in industrial scenarios. Simultaneously, it completely blocks the teacher-side and pseudo-label generation paths during model export and deployment, retaining only the backbone, thus ensuring that the number of parameters and computational loads in the online detection phase remain consistent with the original YOLOv11. In summary, this method forms a complete technical chain of "structure-side budget enhancement + selective pseudo-label incorporation on the training side + zero overhead on the deployment side." Experimental results on typical industrial defect datasets such as PCBDep and KSDD2 demonstrate that, compared to the original YOLOv11n and current mainstream lightweight networks, this method achieves higher detection accuracy and recall without increasing inference costs, exhibiting good engineering applicability and patent application value.

[0187] Example 3

[0188] like Figure 7 As shown, this embodiment provides a high-precision industrial defect detection system based on an improved YOLOv11 model, applying the method described in embodiment 1 or 2, including:

[0189] Preprocessing unit 301: used to acquire and preprocess an industrial defect image dataset; the industrial defect image dataset includes several images of industrial products with different defect categories;

[0190] Model building unit 302: Used to select the YOLOv11 model as the base model and improve the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model.

[0191] Model training unit 303: used to iteratively train the industrial defect detection model using the preprocessed industrial defect image dataset, and obtain the trained industrial defect detection model;

[0192] Defect detection unit 304: used to acquire an image of an industrial product to be detected, input the image of the industrial product to be detected into the trained industrial defect detection model, and obtain the corresponding industrial defect detection result.

[0193] In the specific implementation process, firstly, the preprocessing unit 301 acquires and preprocesses the industrial defect image dataset; then, the model building unit 302 selects the YOLOv11 model as the base model and improves the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model; then, the model training unit 303 iteratively trains the industrial defect detection model using the preprocessed industrial defect image dataset to obtain the trained industrial defect detection model; finally, the defect detection unit 304 acquires the industrial product image to be detected, inputs the industrial product image to be detected into the trained industrial defect detection model, and obtains the corresponding industrial defect detection result.

[0194] This system improves the YOLOv11 model by introducing an equal-budget multi-branch convolutional attention enhancement module (EB-MCAM module), thereby significantly improving the detection rate and positioning accuracy of small industrial target defects without increasing the on-site inference burden.

[0195] The same or similar labels correspond to the same or similar parts;

[0196] The terms used to describe positional relationships in the accompanying drawings are for illustrative purposes only and should not be construed as limiting this application.

[0197] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.

Claims

1. A high-precision industrial defect detection method based on an improved YOLOv11 model, characterized in that, Includes the following steps: S1: Acquire an industrial defect image dataset and preprocess it; the industrial defect image dataset includes several images of industrial products with different defect categories; S2: Select the YOLOv11 model as the base model and improve the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model. S3: Iteratively train the industrial defect detection model using the preprocessed industrial defect image dataset to obtain the trained industrial defect detection model; S4: Obtain the image of the industrial product to be detected, input the image of the industrial product to be detected into the trained industrial defect detection model, and obtain the corresponding industrial defect detection result.

2. The high-precision industrial defect detection method based on the improved YOLOv11 model according to claim 1, characterized in that, In step S1, the preprocessing includes: standardizing the format and size of all industrial product images in the industrial defect image dataset, labeling the category and location of defects in each industrial product image using annotation software, and performing data augmentation processing.

3. The high-precision industrial defect detection method based on the improved YOLOv11 model according to claim 2, characterized in that, The industrial product images specifically refer to PCB images and / or metal surface images; For the PCB image, the defect categories include at least one or more of the following: copper foil residue, rodent bites, open circuits, pinholes, short circuits, burrs, and spikes; for the metal surface image, the defect categories include at least one or more of the following: fine scratches, localized wear, and abnormal structures. The data augmentation process includes at least one or more of the following: random cropping and scaling, random rotation and flipping, mirroring, random occlusion, contrast perturbation and random color perturbation, noise injection, and MixUp and Mosaic combined enhancement.

4. The high-precision industrial defect detection method based on the improved YOLOv11 model according to claim 1, characterized in that, In step S2, the input features of the EB-MCAM module are passed in parallel through three depthwise separable convolutional layers with different kernel sizes to obtain three intermediate features. After multi-scale aggregation of the three intermediate features, channel compression is performed through 1×1 convolution to obtain convolutional fusion features. The convolutional fusion features are sequentially subjected to global average pooling, adaptive one-dimensional convolution or fully connected mapping, and Sigmoid function normalization to obtain channel attention weights. The convolutional fusion features are multiplied channel by channel by channel attention weights to obtain the output features of the EB-MCAM module.

5. The high-precision industrial defect detection method based on the improved YOLOv11 model according to claim 1, characterized in that, Step S1 further includes: Obtain a pre-trained teacher detection model, and use the pre-trained teacher detection model to perform offline inference on the industrial defect image dataset to generate an extended supervised label set; In step S3, the industrial defect detection model is used as a student model. The industrial defect detection model is iteratively trained using the preprocessed industrial defect image dataset and the extended supervision label set to obtain the trained industrial defect detection model.

6. The high-precision industrial defect detection method based on the improved YOLOv11 model according to claim 5, characterized in that, The teacher detection model is specifically the unmodified YOLOv11 model.

7. The high-precision industrial defect detection method based on the improved YOLOv11 model according to claim 5, characterized in that, In step S3, the total loss function is set. , used to supervise the iterative training of the industrial defect detection model; The total loss function Represented as: in, , and These are the bounding box regression loss, the target confidence loss, and the category prediction loss, respectively. This is due to distillation losses; These are the weighting coefficients.

8. A high-precision industrial defect detection method based on an improved YOLOv11 model according to any one of claims 1 to 7, characterized in that, Step S4 further includes: using a preset evaluation index to evaluate the performance of the trained industrial defect detection model.

9. The high-precision industrial defect detection method based on the improved YOLOv11 model according to claim 8, characterized in that, The evaluation metrics include at least one or more of the following: precision (P), recall (R), mean precision (mAP), number of parameters (Params), computational cost (GFLOPs), and estimated inference time per image (FPS).

10. A high-precision industrial defect detection system based on an improved YOLOv11 model, employing the method described in any one of claims 1 to 9, characterized in that, include: Preprocessing unit: used to acquire and preprocess industrial defect image datasets; the industrial defect image dataset includes several images of industrial products with different defect categories; Model building unit: Used to select the YOLOv11 model as the base model and improve the YOLOv11 model by replacing the SPPF module of the YOLOv11 model backbone network with the EB-MCAM module to build an industrial defect detection model. Model training unit: used to iteratively train the industrial defect detection model using the preprocessed industrial defect image dataset, and obtain the trained industrial defect detection model; Defect detection unit: used to acquire an image of the industrial product to be detected, input the image of the industrial product to be detected into the trained industrial defect detection model, and obtain the corresponding industrial defect detection result.