A lightweight steel surface defect detection method and system based on KOMB-YOLO

By constructing a teacher-student detection model system and multi-scale feature transfer, and combining dynamic convolution and multi-dimensional attention, the detection accuracy and speed problems of the lightweight steel surface defect detection model in complex backgrounds are solved, and efficient and low-computation defect detection is achieved.

CN122265738APending Publication Date: 2026-06-23GUILIN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUILIN UNIVERSITY OF TECHNOLOGY
Filing Date
2026-05-07
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing lightweight steel surface defect detection models, while maintaining the model's lightweight nature, struggle to effectively improve their ability to detect multi-form, small-scale steel surface defects, and are prone to false detections and missed detections in complex environments.

Method used

A method for detecting surface defects in lightweight steel based on KOMB-YOLO is adopted. By constructing a teacher-student detection model system, multi-scale feature transfer and output transfer constraints are introduced. Combined with dynamic convolution mechanism, multi-dimensional attention and BiFPN feature fusion, knowledge transfer and loss are synergistically optimized.

Benefits of technology

With lower resource consumption, the model improves the detection accuracy of small-scale, irregular defects, reduces the false negative rate and the false positive rate, and is suitable for real-time detection needs in industrial sites.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122265738A_ABST
    Figure CN122265738A_ABST
Patent Text Reader

Abstract

The present application belongs to the field of steel surface defect detection and target detection, and discloses a kind of light steel surface defect detection method and system based on KOMB-YOLO, obtains steel surface defect image and constructs data set, establishes teacher detection model and student detection model, input image is sent into teacher detection model and student detection model respectively, corresponding multi-scale feature and detection head output are extracted;Multi-scale feature migration constraint is established between teacher detection model and student detection model, and output migration constraint is established at the output end, the student detection model is trained by joint detection loss, feature migration loss and output migration loss, and the light steel surface defect detection model is obtained.The present application migrates features from the teacher model to the student model, enabling the lightweight student model to maintain good detection performance while consuming less resources. Through systematic design, the practical deployment of steel surface defect detection tasks can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to, but is not limited to, the field of steel surface defect detection and target detection technology, and particularly relates to a lightweight steel surface defect detection method and system based on KOMB-YOLO. Background Technology

[0002] The surface quality of steel is a crucial factor in ensuring the structural integrity, service reliability, and safety of industrial products, playing a significant role in construction, transportation, and industrial manufacturing. During rolling, handling, and storage, steel is susceptible to various surface defects such as cracks, inclusions, scratches, pitting, and oxide scale due to mechanical stress, environmental corrosion, and process fluctuations. If these defects are not detected and identified in a timely manner, they may escalate into serious structural failures, resulting in substantial economic losses and even safety accidents. Therefore, achieving high-precision, real-time detection of steel surface defects is a key aspect of modern intelligent manufacturing systems.

[0003] Traditional methods for detecting surface defects in steel mainly include visual inspection, magnetic particle testing, and eddy current testing. While these methods have some application in practical industrial scenarios, they generally suffer from problems such as heavy reliance on human experience, susceptibility to fatigue, limited applicability, and difficulty in meeting the real-time inspection requirements of high-speed production lines. With the development of automated manufacturing and continuous steel production, traditional inspection methods can no longer simultaneously achieve a balance between inspection accuracy, inspection speed, and large-scale application.

[0004] In recent years, deep learning-based object detection methods have gradually become an important technical approach for industrial surface defect detection due to their strong feature representation and end-to-end inference capabilities. Among them, the YOLO series of single-stage object detection algorithms has achieved a good balance between detection speed and accuracy and has been widely used in real-time industrial inspection tasks. Despite the continuous development and evolution of the YOLO series models, steel surface defect detection still faces several challenges: First, the defect scale varies greatly; small targets such as small cracks and fine scratches occupy only a few pixels in high-resolution images and are easily submerged by background noise. Second, the defect morphology is irregular, and different defects differ significantly in spatial structure and texture distribution. Third, complex industrial backgrounds can interfere with defect feature representation, leading to false positives and false negatives. Fourth, industrial deployment scenarios place high demands on model lightweighting and real-time performance.

[0005] While existing lightweight detection models have improved inference efficiency to some extent, most still rely on fixed convolutional kernels and pre-defined multi-scale feature fusion paths, limiting their adaptability to irregular defect morphologies and complex backgrounds. Furthermore, simply increasing network depth or widening channels to improve detection performance significantly increases the number of parameters and computational load, hindering deployment on edge and embedded devices.

[0006] Therefore, how to improve the model's ability to detect multi-form, small-scale steel surface defects while maintaining lightweight design has become an urgent problem to be solved. Summary of the Invention

[0007] To address the problems existing in the prior art, this invention provides a method and system for detecting surface defects in lightweight steel based on KOMB-YOLO.

[0008] This invention is implemented as follows: a method for detecting surface defects in lightweight steel based on KOMB-YOLO, comprising the following steps:

[0009] S1: Collect a dataset of images of defects on the surface of steel, classify and label the defect targets in the images, and generate corresponding label files;

[0010] S2: Construct a teacher detection model and a student detection model, where the teacher detection model is used to provide high-quality feature information and the student detection model is used to obtain lightweight detection results;

[0011] S3: Input the surface defect images of the steel into the teacher detection model and the student detection model respectively to obtain the corresponding multi-scale feature output and detection head output;

[0012] S4: Establish multi-scale feature transfer constraints between the teacher detection model and the student detection model, so that the student detection model learns the feature representation of the teacher detection model;

[0013] S5: Establish output transfer constraints at the output ends of the detection heads of the teacher detection model and the student detection model;

[0014] S6: The detection loss, feature transfer loss, and output transfer loss are weighted and combined to train the student detection model;

[0015] S7: After training, the student detection model is used to detect defects in the surface image of the steel under test, and the defect category, location and confidence level are output.

[0016] Furthermore, the teacher detection model and the student detection model adopt the same detection topology structure, which is the improved KOMB-YOLO detection framework, including a backbone network, a neck network, and a detection head. The channel configuration of the teacher detection model is greater than that of the student detection model.

[0017] Furthermore, the backbone network introduces a Kernel-Weighted Convolution (KWConv) dynamic convolution mechanism, which divides the traditional convolution kernel into multiple sub-convolution units, as shown in the formula:

[0018]

[0019] in, This represents a convolution kernel repository composed of multiple sub-convolution kernel units. This represents the i-th sub-convolutional kernel unit, where m represents the number of sub-convolutional kernel units and i represents the index of the sub-convolutional kernel unit.

[0020] Dynamic convolutional kernels are generated by sub-convolutional units from the linear combination kernel repository, and their expression is shown in the formula:

[0021]

[0022] in, This represents a dynamically generated convolutional kernel that adapts to the input features. Indicates the first Subconvolutional kernel unit The corresponding dynamic weighting coefficients;

[0023] A contrastive attention function is introduced during the kernel selection process, and its expression is shown in the formula:

[0024]

[0025] in, This represents the attention map selected by the convolution kernel, A0 represents the input attention response, and M represents the initialization mask. Indicates the annealing coefficient. This represents the activation function. This indicates element-wise multiplication.

[0026] The C3k2-ODConv module is introduced into the backbone network to enhance the feature representation capability by multi-dimensionally weighting the convolutional kernel through spatial attention, input channel attention, output channel attention and convolutional kernel attention.

[0027] A Median-Enhanced Spatial-Channel Attention (MECS) module is introduced into the network. Different statistical information is obtained through average pooling, max pooling, and median pooling. Channel attention maps are generated through a shared multilayer perceptron, and their expression is shown in the formula:

[0028]

[0029] Where F represents the input feature map, F′ represents the channel attention-weighted feature map, AvgPool(F), MaxPool(F), and MedianPool(F) represent average pooling, max pooling, and median pooling of the input feature map F, respectively, and MLP represents a shared multilayer perceptron. ∠ represents the activation function, and ⊙ represents element-wise multiplication.

[0030] Spatial attention maps are generated through multi-scale depthwise convolution, and their expression is shown in the formula:

[0031]

[0032] Where F″ represents the output feature map after spatial attention enhancement, Let represent the depthwise convolution operation at the i-th scale, n represent the number of depthwise convolution branches, Conv1×1 represents the 1×1 convolution operation, and F′ represents the feature map after channel attention weighting.

[0033] Furthermore, in the neck network, a Bidirectional Feature Pyramid Network (BiFPN) is introduced for multi-scale feature fusion. Learnable weights are used to weight and fuse features at different scales, as shown in the formula:

[0034]

[0035] Where F represents the fused output feature, This represents the i-th input scale feature. This represents the non-negative learnable fusion weight corresponding to the i-th input scale feature. This represents a stability constant used to avoid a denominator of 0.

[0036] Furthermore, the multi-scale feature transfer constraint is established between the three scale feature layers of P3 / 8, P4 / 16, and P5 / 32.

[0037] Furthermore, the feature transfer loss is constructed using a channel-level feature distribution constraint method.

[0038] Furthermore, the output transfer loss employs L2 norm loss to constrain the differences between the teacher detection model and the student detection model at the output of the detection head.

[0039] Furthermore, the weighted combination employs a dynamic decay strategy to adjust the feature migration loss weights and output migration loss weights.

[0040] Another objective of this invention is to provide a lightweight steel surface defect detection system based on KOMB-YOLO, comprising:

[0041] The data input module is used to import surface data of the steel to be inspected;

[0042] The parameter setting module is used to set the detection parameters;

[0043] The parameter verification module is used to verify the input data and detection parameters;

[0044] The model inference module is used to call the trained lightweight steel surface defect detection model to perform defect detection;

[0045] The results display module is used to display the test results;

[0046] The results saving module is used to save the test results.

[0047] Based on the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solution to be protected by this invention are as follows:

[0048] Compared to existing steel surface defect detection methods that mostly focus on network structure improvement, attention mechanisms, or lightweight convolution replacement, this invention constructs a cross-model, multi-scale, and multi-level knowledge transfer system. This system systematically guides the high-quality semantic information of the teacher model to the lightweight student model, achieving a synergistic improvement in detection accuracy and computational efficiency. This approach not only changes the traditional single-model optimization approach but also establishes transfer constraints simultaneously at the feature and output layers, forming a complete distillation loop. This enables the lightweight model to possess expressive capabilities approaching those of complex models. Therefore, this invention exhibits significant differences in its technical approach. Those skilled in the art would find it difficult to directly derive this combination of multi-level transfer and multi-loss collaborative optimization based on existing technologies, thus demonstrating outstanding substantive features and significant progress.

[0049] This invention achieves feature transfer from the teacher model to the student model, enabling the lightweight student model to maintain good detection performance with low resource consumption; it improves the model's ability to represent steel surface defects at different scales through multi-scale feature transfer; it makes the student model closer to the teacher model in both classification and localization through output transfer constraints; it balances the teacher's knowledge guidance and the student model's autonomous learning process through a dynamic decay strategy; and it enables the practical deployment of steel surface defect detection tasks through systematic design.

[0050] This invention utilizes multi-scale feature transfer and output transfer from a teacher model to a student model, enabling the lightweight student model to achieve superior defect classification and localization capabilities with lower resource consumption. By introducing the KWConv dynamic convolution mechanism, the C3k2-ODConv module, and the MECS module, the invention improves the model's feature extraction capabilities for small-scale, irregular, and low-contrast defects on steel surfaces and enhances its ability to suppress complex background noise. The adoption of a BiFPN bidirectional weighted feature fusion structure in the neck network improves the model's comprehensive detection capabilities for defects at different scales. A dynamic decay strategy balances teacher knowledge guidance with the student model's autonomous learning process, improving training stability and convergence. Through systematic design, this invention effectively balances detection accuracy, lightweight design, and real-time deployment requirements, making it suitable for practical industrial applications in steel surface defect detection.

[0051] (1) The expected benefits and commercial value of the technical solution of this invention after transformation are as follows:

[0052] This invention presents a lightweight steel surface defect detection method and system based on KOMB-YOLO, which effectively reduces the number of model parameters and computational load while maintaining high detection accuracy. It is suitable for deployment in edge devices of industrial production lines, embedded detection terminals, or resource-constrained online detection platforms. Compared with traditional manual visual inspection and conventional visual inspection solutions, this invention improves the automatic identification efficiency of defects such as cracks, scratches, inclusions, pitting, and oxide scale on steel surfaces, reduces the missed detection rate and false detection rate, and decreases the cost of manual re-inspection and downtime losses, demonstrating high industrial application value. This solution can be widely applied in steel metallurgy, metal material processing, plate and strip material inspection, and intelligent manufacturing visual inspection, showing promising market prospects.

[0053] (2) The technical solution of the present invention overcomes technical bias:

[0054] Existing technologies generally hold that improving defect detection accuracy often requires increasing network depth and width or introducing feature extraction structures with higher computational complexity. However, lightweight models often sacrifice the ability to detect small targets and robustness in complex scenarios, making it difficult to achieve both simultaneously. This invention breaks through the above-mentioned technical understanding. Through the collaborative design of dynamic convolution, multi-dimensional attention, multi-scale bidirectional feature fusion, and knowledge transfer constraints, the student model can still achieve superior defect detection results under conditions of lower resource consumption. This demonstrates that lightweight models do not necessarily lead to a significant decrease in detection performance, overcoming the technical bias in the field that lightweight and high accuracy are difficult to reconcile. Attached Figure Description

[0055] Figure 1 This is a flowchart of the method for detecting surface defects in lightweight steel based on KOMB-YOLO provided in this embodiment of the invention;

[0056] Figure 2 This is a framework diagram of a lightweight steel surface defect detection system based on KOMB-YOLO provided in an embodiment of the present invention;

[0057] Figure 3 This is a schematic diagram of the KOMB-YOLO network structure provided in an embodiment of the present invention;

[0058] Figure 4 This is a schematic diagram of the KernelWarehouse structure provided in an embodiment of the present invention;

[0059] Figure 5 This is a schematic diagram of the Bottleneck_OD module structure provided in an embodiment of the present invention;

[0060] Figure 6 This is a schematic diagram of the C3k2_OD module structure provided in an embodiment of the present invention;

[0061] Figure 7 This is a schematic diagram of the MECS module structure provided in an embodiment of the present invention;

[0062] Figure 8 These are schematic diagrams of pyramid structures with different features provided in embodiments of the present invention;

[0063] Figure 9 This is a schematic diagram of the steel surface defect dataset provided in an embodiment of the present invention;

[0064] Figure 10 This is a comparison chart of detection results provided in an embodiment of the present invention;

[0065] Figure 11 These are mAP50 histograms of different models provided in the embodiments of the present invention;

[0066] Figure 12 This is a schematic diagram of the interface and detection results of the steel surface defect detection system based on KOMB-YOLO provided in an embodiment of the present invention. Detailed Implementation

[0067] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0068] like Figure 1 As shown, this embodiment of the invention provides a method for detecting surface defects in lightweight steel based on KOMB-YOLO, which specifically includes:

[0069] S1: Collect a dataset of images of defects on the surface of steel, classify and label the defect targets in the images, and generate corresponding label files;

[0070] S2: Construct a teacher detection model and a student detection model, where the teacher detection model is used to provide high-quality feature information and the student detection model is used to obtain lightweight detection results;

[0071] S3: Input the surface defect images of the steel into the teacher detection model and the student detection model respectively to obtain the corresponding multi-scale feature output and detection head output;

[0072] S4: Establish multi-scale feature transfer constraints between the teacher detection model and the student detection model, so that the student detection model learns the feature representation of the teacher detection model;

[0073] S5: Establish output transfer constraints at the output ends of the detection heads of the teacher detection model and the student detection model;

[0074] S6: The detection loss, feature transfer loss, and output transfer loss are weighted and combined to train the student detection model;

[0075] S7: After training, the student detection model is used to detect defects in the surface image of the steel under test, and the defect category, location and confidence level are output.

[0076] The lightweight steel surface defect detection method based on KOMB-YOLO described in this invention can be understood as follows: Based on the traditional YOLO-like single-model detection framework, a teacher-student dual-model collaborative learning mechanism is introduced, and a balance between lightweight design and high accuracy is achieved through multi-level knowledge transfer. Specifically, in step S1, a standardized dataset of steel surface defects is constructed. Original images are collected, filtered, labeled, and preprocessed, and divided into training, validation, and test sets to form a standardized data input foundation. This step provides data support for subsequent teacher model training and student model distillation, enabling the models to learn the feature representations and spatial location information of various types of steel surface defects (such as cracks, inclusions, scratches, etc.) under a unified data distribution. Subsequently, in step S2, teacher and student models are constructed. The teacher model typically has a deeper network structure and stronger feature extraction capabilities to capture high-level semantic information in complex backgrounds, while the student model adopts a lightweight structure to reduce the number of parameters and computational complexity, thereby meeting the real-time detection needs of industrial sites. While existing technologies generally improve detection performance by modifying the YOLO structure, they still face the problem of balancing accuracy and speed.

[0077] In step S3, during the student training phase, the same input is fed into both the pre-trained / trained teacher model and the student model, respectively, outputting multi-scale feature maps and detection results. The multi-scale features are used to characterize the spatial information of defects of different sizes, which is one of the key issues in steel defect detection. Addressing the limitations of existing technologies that rely solely on single-model feature fusion, this invention introduces multi-scale feature transfer constraints in step S4, enabling the student model to align with the feature representation of the teacher model during training, thereby compensating for the insufficient expressive power of the lightweight model. Furthermore, in step S5, transfer constraints are applied to the detection head output, allowing the student model to learn from the teacher model not only at the intermediate feature level but also at the final classification and localization results level, achieving feature-decision two-layer knowledge distillation, further combining intermediate feature constraints and detection output constraints.

[0078] In step S6, the detection loss, feature transfer loss, and output transfer loss are weighted and fused to form a unified optimization objective, thereby synergistically optimizing detection performance and distillation effect, and improving the overall performance and training stability of the student model. This multi-loss collaborative optimization mechanism can effectively solve the problem of decreased accuracy in traditional lightweight models. Finally, in step S7, only the student model is retained for inference, achieving efficient and low-computational-cost defect detection output.

[0079] The teacher detection model and the student detection model use the same detection topology, which is an improved KOMB-YOLO detection framework, including a backbone network, a neck network, and a detection head. The teacher detection model has a larger channel configuration than the student detection model.

[0080] In the backbone network, a Kernel-Weighted Convolution (KWConv) dynamic convolution mechanism is introduced, which divides the traditional convolution kernel into multiple sub-convolution units, as shown in the formula:

[0081]

[0082] in, This represents a convolution kernel repository composed of multiple sub-convolution kernel units. This represents the i-th sub-convolutional kernel unit, where m represents the number of sub-convolutional kernel units and i represents the index of the sub-convolutional kernel unit.

[0083] Dynamic convolutional kernels are generated by sub-convolutional units from the linear combination kernel repository, and their expression is shown in the formula:

[0084]

[0085] in, This represents a dynamically generated convolutional kernel that adapts to the input features. Indicates the first Subconvolutional kernel unit The corresponding dynamic weighting coefficients;

[0086] A contrastive attention function is introduced during the kernel selection process, and its expression is shown in the formula:

[0087]

[0088] in, This represents the attention map selected by the convolution kernel, A0 represents the input attention response, and M represents the initialization mask. Indicates the annealing coefficient. This represents the activation function. This indicates element-wise multiplication.

[0089] The C3k2-ODConv module is introduced into the backbone network to enhance the feature representation capability by multi-dimensionally weighting the convolutional kernel through spatial attention, input channel attention, output channel attention and convolutional kernel attention.

[0090] A Median-Enhanced Spatial-Channel Attention (MECS) module is introduced into the network. Different statistical information is obtained through average pooling, max pooling, and median pooling. Channel attention maps are generated through a shared multilayer perceptron, and their expression is shown in the formula:

[0091]

[0092] Where F represents the input feature map, F′ represents the channel attention-weighted feature map, AvgPool(F), MaxPool(F), and MedianPool(F) represent average pooling, max pooling, and median pooling of the input feature map F, respectively, and MLP represents a shared multilayer perceptron. ∠ represents the activation function, and ⊙ represents element-wise multiplication.

[0093] Spatial attention maps are generated through multi-scale depthwise convolution, and their expression is shown in the formula:

[0094]

[0095] Where F″ represents the output feature map after spatial attention enhancement, Let represent the depthwise convolution operation at the i-th scale, n represent the number of depthwise convolution branches, Conv1×1 represents the 1×1 convolution operation, and F′ represents the feature map after channel attention weighting.

[0096] In the neck network, a Bidirectional Feature Pyramid Network (BiFPN) is introduced for multi-scale feature fusion. Learnable weights are used to weight and fuse features at different scales, as shown in the formula:

[0097]

[0098] Where F represents the fused output feature, This represents the i-th input scale feature. This represents the non-negative learnable fusion weight corresponding to the i-th input scale feature. This represents a stability constant used to avoid a denominator of 0.

[0099] Let the teacher detection model be... The student detection model is The input image is The outputs of the two are represented as follows:

[0100]

[0101] in, This represents the output of the detection head obtained by the teacher detection model T for the input image x. This represents the detection head output obtained by the student detection model S for the input image x. The detection head output includes bounding box regression results, defect category probability, and confidence level.

[0102] In the feature transfer stage, multi-scale feature layers corresponding to the teacher and student models are selected to establish transfer relationships. Let the first... Teacher and student characteristics at each scale are as follows: and The feature transfer loss is then expressed as:

[0103]

[0104] in, denoted as feature transfer loss, l represents the feature scale index, with values ​​corresponding to P3 / 8, P4 / 16, and P5 / 32, and D represents the channel-level feature distribution difference measurement function between teacher features and student features.

[0105] During the output transfer phase, constraints are applied to the differences between the teacher model and the student model at the detector head output, and the output transfer loss is expressed as:

[0106]

[0107] in, Indicates the output migration loss. Denotes the squared L2 norm. and These represent the detection head outputs of the teacher model and the student model, respectively.

[0108] The total loss function of the student model is expressed as:

[0109]

[0110] in, This represents the total loss of the student model. Indicates the original detection loss, Indicates the feature transfer loss weights. This represents the transfer loss at the feature level. Indicates the weights of the output migration loss. This represents the migration loss of the output layer.

[0111] To improve training effectiveness, this invention employs a dynamic decay strategy to adjust the transfer loss weights. In a preferred embodiment, cosine annealing is used, expressed as:

[0112]

[0113] in, Indicates the first The transfer loss weights corresponding to each training time (or iteration step); These are the initial weights; It is a cosine function; Indicates the current training step number (or epoch); This represents the total number of training steps (or the maximum number of epochs). This strategy causes the transfer loss weights to change from their initial values. The value gradually decreases during the training process and decays to near zero at the end of training, thereby strengthening the knowledge transfer constraint in the early stage of training and focusing more on optimizing the model's own task loss in the later stage.

[0114] like Figure 2 As shown in the figure, the lightweight steel surface defect detection system based on KOMB-YOLO provided in this embodiment of the invention specifically includes:

[0115] The data input module is used to import surface data of the steel to be inspected;

[0116] The parameter setting module is used to set the detection parameters;

[0117] The parameter verification module is used to verify the input data and detection parameters;

[0118] The model inference module is used to call the trained lightweight steel surface defect detection model to perform defect detection;

[0119] The results display module is used to display the test results;

[0120] The results saving module is used to save the test results.

[0121] like Figure 12 As shown, this invention can be applied to fields such as steel metallurgy, plate and strip processing, cold / hot rolling production lines, surface quality inspection of metal materials, and intelligent manufacturing visual inspection. It is particularly suitable for the automatic detection of surface defects in steel products such as steel plates, strips, coils, and sections during production, sorting, re-inspection, and final quality inspection. It is integrated into online steel surface inspection equipment, industrial visual inspection terminals, edge computing quality inspection equipment, automatic inspection workstations on steel plant production lines, or steel surface defect detection software platforms.

[0122] This invention provides a method for detecting surface defects in steel based on KOMB-YOLO, the specific implementation of which is as follows:

[0123] (1) Constructing a steel surface defect dataset. The NEU-DET public dataset was used for experiments. The dataset contains six types of steel surface defects: Crazing, Patches, Inclusion, Pitted-Surface, Scratches, and Rolled-in-Scale. Each type contains 300 grayscale images with a resolution of 200×200, for a total of 1800 samples. The dataset was divided into training, validation, and test sets in an 8:1:1 ratio, with 1440 images in the training set, 180 images in the validation set, and 180 images in the test set.

[0124] (2) Constructing the KOMB-YOLO detection framework. Using YOLOv11n as the base network, the KWConv dynamic convolution mechanism is introduced into the backbone network to enhance the adaptability of the convolution kernel to different defect structures; ODConv is embedded in the C3k2 module to construct the C3k2-ODConv module to enhance the joint feature modeling capability of spatial dimension, channel dimension and convolution kernel dimension; the MECS module is introduced in the feature extraction process to strengthen key defect features and suppress background noise; and BiFPN structure is used in the neck network for bidirectional multi-scale feature fusion.

[0125] (3) The model training environment is as follows: On a 64-bit Windows platform, the experiment was conducted using Python and the PyTorch framework. The processor was an Intel Core i5-12400F CPU, the graphics card was an NVIDIA GeForce RTX 4060 Ti GPU, and the video memory was 16GB. During training, the input image size was set to 640×640, the initial learning rate was set to 0.01, the momentum was set to 0.937, the weight decay was set to 0.0005, the number of training rounds was set to 400, and the batch size was set to 32.

[0126] (4) Defect detection is performed on steel surface images using the trained KOMB-YOLO model. The detection head adopts a decoupled structure, including a classification branch and a regression branch, which are used to output the defect category, bounding box position and corresponding confidence level.

[0127]

[0128]

[0129] (5) The average precision (AP), mean average precision (mAP), number of parameters, model size, GFLOPs, and inference speed (FPS) were used as evaluation metrics to assess the model performance. Experimental results show that on the NEU-DET dataset, after distillation, the model improved mAP@0.5 by 2.8%, reduced the number of parameters by 53.1%, reduced the computational cost by 55.6%, and achieved an inference speed of 268 FPS compared to the baseline model YOLOv11n. On the GC10-DET dataset, the improved model's mAP increased to 74.7%, demonstrating good generalization ability and adaptability to complex industrial scenarios.

[0130] The KOMB-YOLO method improves the model's ability to detect small-scale, irregular steel surface defects through a joint design of dynamic convolution, multidimensional dynamic attention, median enhanced attention, and bidirectional weighted feature fusion, while also taking into account the need for lightweight deployment, making it suitable for online inspection scenarios of actual industrial steel surfaces.

[0131] It should be noted that embodiments of the present invention can be implemented in hardware, software, or a combination of both. The hardware portion can be implemented using dedicated logic; the software portion can be stored in memory and executed by a suitable instruction execution system, such as a microprocessor or dedicated-design hardware. Those skilled in the art will understand that the above-described devices and methods can be implemented using computer-executable instructions and / or included in processor control code, for example, such code provided on a carrier medium such as a disk, CD, or DVD-ROM, a programmable memory such as read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuitry such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field-programmable gate arrays, programmable logic devices, etc., or by software executed by various types of processors, or by a combination of the above-described hardware circuitry and software, such as firmware.

[0132] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting surface defects in lightweight steel based on KOMB-YOLO, characterized in that, Includes the following steps: S1: Collect a dataset of images of defects on the surface of steel, classify and label the defect targets in the images, and generate corresponding label files; S2: Construct a teacher detection model and a student detection model, where the teacher detection model is used to provide high-quality feature information and the student detection model is used to obtain lightweight detection results; S3: Input the surface defect images of the steel into the teacher detection model and the student detection model respectively to obtain the corresponding multi-scale feature output and detection head output; S4: Establish multi-scale feature transfer constraints between the teacher detection model and the student detection model, so that the student detection model learns the feature representation of the teacher detection model; S5: Establish output transfer constraints at the output ends of the detection heads of the teacher detection model and the student detection model; S6: The detection loss, feature transfer loss, and output transfer loss are weighted and combined to train the student detection model; S7: After training, the student detection model is used to detect defects in the surface image of the steel under test, and the defect category, location and confidence level are output.

2. The method for detecting surface defects in lightweight steel based on KOMB-YOLO as described in claim 1, characterized in that, The teacher detection model and the student detection model use the same detection topology, which is an improved KOMB-YOLO detection framework, including a backbone network, a neck network, and a detection head. The teacher detection model has a larger channel configuration than the student detection model.

3. The method for detecting surface defects in lightweight steel based on KOMB-YOLO as described in claim 1, characterized in that, In the backbone network, a Kernel-Weighted Convolution dynamic convolution mechanism is adopted, which divides the traditional convolution kernel into multiple sub-convolution units, as expressed in the following formula: ; in, This represents a convolution kernel repository composed of multiple sub-convolution kernel units. This represents the i-th sub-convolutional kernel unit, where m represents the number of sub-convolutional kernel units and i represents the index of the sub-convolutional kernel unit. Dynamic convolutional kernels are generated from sub-convolutional units in the linear combination kernel repository, and their expression is as follows: ; in, This represents a dynamically generated convolutional kernel that adapts to the input features. Indicates the first Subconvolutional kernel unit The corresponding dynamic weighting coefficients; A contrastive attention function is introduced during the kernel selection process, and its expression is shown in the formula: ; in, This represents the attention map selected by the convolution kernel, A0 represents the input attention response, and M represents the initialization mask. Indicates the annealing coefficient. This represents the activation function. This indicates element-wise multiplication; The C3k2-ODConv module is introduced into the backbone network to enhance the feature representation capability by multi-dimensionally weighting the convolutional kernel through spatial attention, input channel attention, output channel attention and convolutional kernel attention. A Median-Enhanced Spatial-Channel Attention (MECS) module is introduced into the network. Different statistical information is obtained through average pooling, max pooling, and median pooling. A channel attention map is generated using a shared multilayer perceptron, expressed as follows: ; Where F represents the input feature map, F′ represents the channel attention-weighted feature map, AvgPool(F), MaxPool(F), and MedianPool(F) represent average pooling, max pooling, and median pooling of the input feature map F, respectively, and MLP represents a shared multilayer perceptron. represents the activation function, and ⊙ represents element-wise multiplication; Spatial attention maps are generated through multi-scale depthwise convolution, and their expression is as follows: ; Where F″ represents the output feature map after spatial attention enhancement, Let represent the depthwise convolution operation at the i-th scale, n represent the number of depthwise convolution branches, Conv1×1 represents the 1×1 convolution operation, and F′ represents the feature map after channel attention weighting.

4. The method for detecting surface defects in lightweight steel based on KOMB-YOLO as described in claim 1, characterized in that, In the neck network, a Bidirectional Feature Pyramid Network (BiFPN) is introduced for multi-scale feature fusion. Learnable weights are used to weight and fuse features at different scales, as expressed in the following formula: ; Where F represents the fused output feature, This represents the i-th input scale feature. This represents the non-negative learnable fusion weight corresponding to the i-th input scale feature. This represents a stability constant used to avoid a denominator of 0.

5. The method for detecting surface defects in lightweight steel based on KOMB-YOLO as described in claim 1, characterized in that, The multi-scale feature transfer constraints are established between the three scale feature layers: P3 / 8, P4 / 16, and P5 / 32.

6. The method for detecting surface defects in lightweight steel based on KOMB-YOLO as described in claim 1, characterized in that, The feature transfer loss is constructed using a channel-level feature distribution constraint method.

7. The method for detecting surface defects in lightweight steel based on KOMB-YOLO as described in claim 1, characterized in that, The output transfer loss uses L2 norm loss to constrain the differences between the teacher detection model and the student detection model at the output of the detection head.

8. The method for detecting surface defects in lightweight steel based on KOMB-YOLO as described in claim 1, characterized in that, The weighted combination employs a dynamic decay strategy to adjust the feature transfer loss weights and output transfer loss weights.

9. A lightweight steel surface defect detection system based on KOMB-YOLO according to any one of claims 1-8, characterized in that, include: The data input module is used to import surface data of the steel to be inspected; The parameter setting module is used to set the detection parameters; The parameter verification module is used to verify the input data and detection parameters; The model inference module is used to call the trained lightweight steel surface defect detection model to perform defect detection; The results display module is used to display the test results; The results saving module is used to save the test results.