Next Article in Journal
Highly Selective Tilted Triangular Springs with Constant Force Reaction
Previous Article in Journal
BEC Defender: QR Code-Based Methodology for Prevention of Business Email Compromise (BEC) Attacks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Infrared Image Defect Detection Method for Steel Based on Regularized YOLO

Faculty of Information Engineering and Automation, Kunming University of Science and Technology, Kunming 650500, China
*
Author to whom correspondence should be addressed.
Sensors 2024, 24(5), 1674; https://doi.org/10.3390/s24051674
Submission received: 2 February 2024 / Revised: 29 February 2024 / Accepted: 29 February 2024 / Published: 5 March 2024
(This article belongs to the Section Fault Diagnosis & Sensors)

Abstract

:
Steel surfaces often display intricate texture patterns that can resemble defects, posing a challenge in accurately identifying actual defects. Therefore, it is crucial to develop a highly robust defect detection model. This study proposes a defect detection method for steel infrared images based on a Regularized YOLO framework. Firstly, the Coordinate Attention (CA) is embedded within the C2F framework, utilizing a lightweight attention module to enhance the feature extraction capability of the backbone network. Secondly, the neck part design incorporates the Bi-directional Feature Pyramid Network (BiFPN) for weighted fusion of multi-scale feature maps. This creates a model called BiFPN-Concat, which enhances feature fusion capability. Finally, the loss function of the model is regularized to improve the generalization performance of the model. The experimental results indicate that the model has only 3.03 M parameters, yet achieves a [email protected] of 80.77% on the NEU-DET dataset and 99.38% on the ECTI dataset. This represents an improvement of 2.3% and 1.6% over the baseline model, respectively. This method is well-suited for industrial detection applications involving non-destructive testing of steel using infrared imagery.

1. Introduction

During the process of steel production and application, the occurrence of surface defects is inevitable. These defects can have a significant impact on the performance and lifespan of the steel. Consequently, it is particularly urgent and necessary to conduct in-depth research and solve the problem of steel surface defect detection [1].
In the industrial production process, the detection of steel surface defects often relies on manual visual inspection. However, the product quality of this inspection is limited by the inspector’s experience, and while it consumes significant manpower, it also suffers from issues of missed and false detections. With the advancement of machine vision technology, image and vision processing methods have been increasingly utilized for surface defect detection. In 1983, Honeywell in the United States developed a CCD-based surface defect detection device, significantly contributing to the prominence of machine vision in this field [2]. Feature extraction is the core of the defect detection task. Guo et al. [3] proposed an edge detection algorithm combining Kirsch and Canny operators for defect feature extraction. This algorithm has been employed for detecting bubbles and pit defects on ceramic bowl surfaces. Nieniewski et al. [4] developed a rail defect feature extraction system based on morphology. Zhou Shiyang [5] proposed a method for steel plate surface defect image detection, leveraging visual saliency and sparse representation through the dual low-rank and sparse decomposition method. It is difficult for the design of traditional machine vision algorithms to meet the diverse needs of various defect detection scenarios. With the rapid development of deep learning, establishing defect detection models based on this technology has emerged as a current research hotspot.
This article proposes a Regularized YOLO defect detection model based on YOLOv8. The model integrates the position encoding attention mechanism with C2F in the backbone, creating a lightweight CA-C2F structure that effectively captures both local and global information in defect images. Moreover, BiFPN’s learnable weighted fusion is introduced to replace the original Concat structure, enhancing the model’s ability to fuse multi-scale feature information. Finally, the model’s loss function is subject to regularization constraints, and the model parameter values are compressed to enhance generalization performance. The main contributions of this study are as follows:
(1)
This study employs position-encoded attention to enhance feature information, creating a lightweight attention module with C2F that improves the feature extraction capabilities of the detection model’s backbone, particularly for steel defect edges and textures.
(2)
This study introduces BiFPN’s weighted fusion strategy for multi-scale feature maps, replacing the original Concat model with BiFPN-Concat, which more effectively integrates the rich semantic information of high-level feature maps and the detailed textures of low-level feature maps. This enhances the model’s ability to extract multi-dimensional feature information.
(3)
This study applies regularization constraints to the loss function and compresses model parameter values, aiding the model in learning a more concise representation and enhancing its generalization performance.
(4)
This study presents an eddy current infrared image dataset of steel defects and proposes a steel infrared image defect detection model based on Regularized YOLO, aiming to provide a reference for related research.
The paper is organized as follows: Section 2 introduces related target detection algorithms. Section 3 provides a detailed description of the proposed Regularized YOLO detection model. Section 4 verifies the model’s effectiveness through a series of experiments. Finally, Section 5 concludes the article.

2. Related Works

Infrared image defect detection is a method that uses infrared radiation emitted by objects for detection and analysis. It is especially suitable for discovering defects and anomalies in materials or structures. With the advancement of computer technology and the development of digital imaging technology, infrared imaging equipment has begun to incorporate more advanced image processing functions, greatly improving the accuracy and efficiency of defect detection. Today’s infrared thermography technology can provide high-resolution thermal maps for more precise detection and analysis of small temperature differences, which is essential for early detection of material defects. The introduction of deep learning and artificial intelligence has further enhanced the ability of infrared image defect detection, which can automatically identify complex defect types and improve detection efficiency and accuracy.
Target detection algorithms in deep learning can be broadly classified into two groups based on their structure: the two-stage algorithms, such as Faster R-CNN [6], and the one-stage algorithms, such as SSD (Single Shot Multi-Box Detector) [7] and YOLO (You Only Look Once) [8,9,10,11,12,13]. These algorithms are predominantly data-driven and are extensively applied in the field of defect detection.
(1)
Two-Stage Algorithms
A two-stage target detection algorithm exhibits higher accuracy but requires a longer processing time. It initially determines the position of the object and subsequently recognizes the position region, representing a target detection algorithm based on the candidate region. Xiang et al. [14] enhanced Faster R-CNN by substituting the coarse Region of Interest Pooling (ROI Pooling) with Region of Interest Align (ROI Align), thus achieving more accurate localization of aluminum surface defects. Cha et al. [15] proposed an enhanced Faster R-CNN to detect concrete and steel defects, modifying the structure of the Region Proposal Networks (RPNs) of ZFNet.
A two-stage algorithm demonstrates superior performance in targeting large objects and complex scenes, owing to its distinct candidate region stage that determines the object’s coordinate position. However, it necessitates computation across two network stages, leading to disadvantages such as large computational volume and slower running time.
(2)
One-Stage Algorithms
A one-stage target detection algorithm forgoes the separate candidate area screening stage, instead relying on direct grid regression for position coordinates and category probabilities. In small target detection, a one-stage algorithm tends to generate a high number of candidate frames, resulting in a high false detection rate and lower accuracy compared to a two-stage algorithm. Despite these drawbacks, its fast detection speed renders it suitable for real-time detection tasks in industrial production. At present, the YOLO series of algorithms is commonly used in industry to complete detection tasks.
In the actual infrared image collection process, affected by the camera and the environment, the infrared image will suffer from problems such as loss of details at the edge of the heat source and low spatial resolution. To solve the problem of accuracy loss caused by the loss of infrared image texture features, Bao et al. [16] proposed a Dual-YOLO model for infrared and visible light image fusion based on YOLOv7, which uses attention fusion and fusion shuffling design to obtain fusion information in feature extraction and reduce the impact of redundant information. Zhang et al. [17] proposed an infrared scene target detection model YOLO-infrared based on YOLOX, which uses the attention module to extract the positional relationship between distant pixels and enhance the feature extraction capability of the model. Mou et al. [18] proposed a YOLOv5 target detection algorithm based on feature resampling to reduce the feature loss that exists in the sampling process of infrared images, scaling the size of the feature map while maintaining the current amount of feature information, and achieving a mAP of 97.4% in the relevant dataset. Hao et al. [19] applied non-negative matrix factorization (NMF) to construct the feature space in the infrared domain. They calculated the cosine similarity with the visible sample space to facilitate domain transfer. Furthermore, they combined the shallow and deep features extracted using ASFF based on YOLOv5, achieving an accuracy of 98.6% in steel plate crack detection. Zhou et al. [20] proposed a wind turbine blade detection method that uses RGB and IR images for feature fusion. It can dynamically fuse RGB images and IR images, and use the complementary features of infrared and visible light domains to identify actual defects. Tao et al. [21] propose an attention multi-hierarchical feature fusion network (AMHNet) to identify defects, using a shared aggregation gate (SAG) that dynamically adjusts the input feature mapping to complete the selection of features at different levels. Zhao et al. [22] designed a dual-feature pyramid network (DFPN) to enhance the neck and generate a rich representation for the RDD-YOLO model, thereby deepening the entire network and emphasizing low-level features.
In summary, the application of deep learning algorithms in the field of infrared shows good application prospects, and this paper improves YOLOv8 and proposes a steel infrared image defect detection model based on Regularized YOLO, which has higher robustness in dealing with the task of steel infrared image defect detection compared with the baseline model.

3. Steel Infrared Image Defect Detection Model

Currently, there is limited research on defect detection in infrared images. Existing models have shown limited sensitivity in detecting small defects or subtle differences, and they also lack robustness. Specifically, in the eddy current thermography dataset of steel surface defects used in this study, the class scale of defects exhibits significant variation, and the quality of the defect images is compromised by thermal diffusion, posing the challenge of blurred edge features. When employing YOLOv8 as the baseline model for defect detection, it is observed that the accuracy for certain categories is low and the model exhibits insufficient generalization performance. Consequently, this study integrates the CA (Coordinate Attention) [23] into the backbone of YOLOv8, aiming to bolster the backbone’s capture of spatial information, and thus enhance the model’s ability to characterize defective features at critical edges. Simultaneously, the fusion strategy of BiFPN [24] is employed on the neck side, replacing the standard Concat operation to amplify the feature fusion of the network for multi-scale feature maps. Furthermore, regularization constraints are introduced into the loss function to improve the model’s generalization performance in defect detection. Figure 1 shows the network structure of the proposed infrared image defect detection model.

3.1. Lightweight CA-C2F with Embedded Attention

Eddy current thermography utilizes the thermal effect generated by eddy currents to detect material defects. When the heat spreads from the heated area to the surroundings, the information on the edge region of the infrared defect image is easily lost, and there is the challenge of blurring in the edge features. Therefore, the goal is to compensate for the shortcomings of YOLOv8 in recognizing important information in defect images and to improve the targeting when it comes to spatial information. In this study, the CA attention mechanism is embedded in the layer 8 C2F (CSPDarknet53 to 2-Stage FPN) structure of the baseline model, so that the model obtains a lightweight attention module, which can significantly enhance the model’s ability to perceive the defect edges and improve the extraction efficiency of the texture information features.
The CA captures long-range spatial interactions with precise location information through the following two steps: embedding coordinate information and generating Coordinate Attention weights. As illustrated in Figure 2, the input undergoes initial average pooling, then the channels are encoded in the horizontal and vertical directions, respectively. The output z is indicative of the encoding result of the C-th channel with height H , and is formulated as:
z c h h = 1 W 0 i W x c ( h , i ) ,
The output z for the C-th channel with width W is expressed as:
z c w w = 1 H 0 j H x c ( j , w ) ,
Figure 2. The module structure of Coordinate Attention.
Figure 2. The module structure of Coordinate Attention.
Sensors 24 01674 g002
Subsequently, the generated feature maps are encoded into attention weight vectors for directional awareness and position sensitivity, respectively. These vectors are then applied to the input feature maps in a complementary manner to facilitate an enhanced representation of defect features. Finally, the output y c i , j of the CA is formulated as:
y c i , j = x c ( i , j ) × g c h ( i ) × g c w ( j ) ,
Among them, x c ( i , j ) represents the original input feature map, while g c h ( i ) and g c w ( j ) are the defect feature attention weight vectors obtained along the horizontal and vertical directions, respectively.
YOLOv8’s C2F structure is characterized by two forms. In the backbone’s C2F structure, the bottleneck includes skip connections, whereas in the neck’s C2F, these are absent. The primary function of C2F lies in fusing low-level feature maps with high-level feature maps. Low-level feature maps possess more detailed information but are deficient in rich semantic and contextual information. High-level feature maps are replete with semantic and contextual information but compromise detailed information. C2F effectively integrates the advantages of both low-level and high-level feature maps. Importantly, the 8th layer of C2F acts as the input for the spatial pyramid pooling layer. As shown in Figure 3, this study embeds the CA into the bottleneck of the 8th layer C2F, aiming to improve C2F’s edge perception of low-level feature maps and the texture information feature extraction capabilities of high-level feature maps. This approach not only highlights significant defect information but also bolsters the acquisition of feature map details and semantic information, thereby significantly enhancing the accuracy of target detection.
Figure 3. The module structure of CA-C2F.
Figure 3. The module structure of CA-C2F.
Sensors 24 01674 g003

3.2. Introducing BiFPN-Concat with Fusion Strategy

In order to cope with the challenges in steel surface defect detection, especially the diversity of these defects in terms of scale variation, the contribution of high-level feature maps and low-level feature maps to the model should be different, but the original Concat structure does not differentiate between the features. This paper introduces the weighted fusion strategy of BiFPN to create BiFPN-Concat. Different weight values are set to distinguish the fusion contribution of the feature maps, enhancing the fusion ability of the neck end to the defective features of different scales when splicing the feature information. This improves the accuracy and efficiency of the detection.
Traditional feature fusion approaches treat all input features equally, overlooking the contribution of feature images of different sizes to the fused output. BiFPN’s fusion strategy assigns an additional weight to each input, enabling the network to ascertain the importance of each input feature during training and to continuously adjust the fusion weights. The formula for adjusting the fusion weights method is as follows:
O = i w i · I i + j w j ,
where w i represents a learnable weight, with ReLU applied to ensure w i remains non-negative ( w i 0 ) , I i denotes the feature of the i-th layer, and a small constant (   =   0.0001 ) is introduced to avoid numerical instability.
This study introduces the weighted fusion strategy of BiFPN at the neck side of the model, replacing the original Concat module with BiFPN-Concat. This new module performs a weighted fusion of two input feature maps and adjusts channel numbers via a 1 × 1 convolutional layer, employing the Swish activation function. Compared with the previous Concat module, BiFPN-Concat offers a more advanced feature fusion and transformation mechanism, making it better suited for infrared image defect detection applications that necessitate precise control over the feature fusion process.

3.3. Cross-Entropy Loss Function with Regularization Constraints

Conventional algorithm improvements inevitably increase model complexity and often ignore the generalization performance requirements of the model. In the current deep learning model design, how to balance the complexity and generalization ability of the model is an important challenge. Although complex model structures often achieve high accuracy on specific training datasets, their excessive complexity can also result in overfitting. To ameliorate this problem and improve the generalization performance of the model on various types of defect detection, an effective strategy is to introduce regularization constraints in the loss function to control the complexity of the model and improve the generalization ability. In this study, a key adjustment is made to the loss function of the benchmark model: regularization constraints on the structural parameters of the model are added to the cross-entropy loss.
YOLOv8’s loss function comprises a weighted sum of Classification Loss and Bounding Box Loss, with the specific formula being:
L o s s t o t a l = ω 1 B C E + ω 2 C I O U + ω 3 D F L ,
where the BCE (Binary Cross-Entropy) is used for classification loss, while border regression loss encompasses CIOU (Complete-IOU) and DFL (Distribution Focal Loss).
BCE is widely used in machine learning and deep learning, especially when dealing with binary classification problems, which measures the difference between the actual labels and the model predictions. In this study, we consider adding regularization constraints based on model structural parameters to the binary cross-entropy loss function, constituting the Regularized Binary Cross-Entropy (RBCE) loss to improve the generalization performance. The RBCE loss function is defined as follows:
R B C E l o s s = 1 N i = 1 N y i · log p i + 1 y i · log 1 p i + λ 2 w i 2 ,
The first part of this formula represents the standard binary cross-entropy, followed by the regularization constraint term. w i denotes the model’s weight parameter, trained using YOLO’s pre-training weights in this study, w i is the weight parameter of the model structure therein, and λ is a hyper-parameter that controls the degree of regularization.
By incorporating penalty terms, the values of the weight parameters are compressed, potentially reducing them to values near zero, thereby decreasing the model’s spatial complexity. This avoids over-reliance of the model on specific features in the training data and results in a more concise and universally applicable feature representation during the learning process. This method not only aims to reduce prediction errors in the training data but also places greater emphasis on controlling the model’s spatial complexity. It is hoped that the compressed parameters will eliminate unnecessary focus by the model, thereby optimizing its overall performance.

4. Datasets and Experiments

4.1. Related Experimental Datasets

This study used the eddy current thermal imaging (ECTI) dataset of steel surface defects and the public dataset NEU-DET to train and verify the model. Eddy current thermal imaging, a non-destructive testing method, effectively detects defects like cracks, voids, and interlayers within materials or on less visible surfaces. In the infrared scenario, defect images are influenced by temperature variations, often leading to blurred defect edges and, consequently, issues with inaccurate feature extraction and recognition.
The experimental platform of the ECTI dataset is shown in Figure 4. The maximum voltage generated by the eddy current excitation device in the experimental platform was 50 V, the maximum current was 60 A, and the excitation frequency was 60–70 kHz. The spiral excitation coil, constructed by winding six turns of highly conductive hollow copper tubes (0.8 cm in diameter), was positioned parallel and approximately 5 cm above the test piece. An infrared thermal imaging camera was used to capture infrared images and create an ECTI dataset, which enables qualitative and quantitative detection of defects by analyzing the difference in eddy current density distribution presented on the defective and intact steel surfaces.
The NEU-DET dataset contains 1800 images of six typical visible-light metal surface defects, including Crazing (Cr), Inclusion (In), Patches (Pa), Pitted Surface (Ps), Rolled-in Scale (RS), and Scratches (Sc). The ECTI dataset comprises 1280 images featuring three distinct sizes of eddy current thermal imaging steel crack defects. Table 1 displays the crack parameters for each of the three sizes. The dataset focuses on detecting steel surface defects with varying crack lengths but consistent width and depth. Figure 5 displays some of the crack defect samples included in the dataset.

4.2. Evaluation Indicators and Experimental Settings

This experiment uses the metrics of mean Average Precision (mAP0.5), Precision (P), Recall (R), F1 Score, Floating Point Operations (FLOPs), and Parameter (Params) to evaluate the model performance.
Precision indicates the probability of a sample that is actually positive among all samples that are predicted to be positive. The recall represents the probability of a sample that is actually positive among samples that are predicted to be positive. The F1 score is a balance point between precision and recall. Their formulas are as follows:
P = T P T P + F P ,
R = T P T P + F N ,
F 1 = 2 · P r e c i s i o n · R e c a l l P r e c i s i o n + R e c a l l ,
where True Positive (TP) represents the number of defects correctly identified by the model, False Positive (FP) refers to the instances of non-defective surfaces incorrectly classified as defective, and False Negative (FN) signifies the instances of defects that the model failed to detect.
The experimental environment of this study was a Windows 11 operating system with 90 GB of RAM, CPU was AMD EPYC 7T83, and GPU was NVIDIA GeForce RTX4090 (24 GB). The deep learning framework was Pytorch2.0.0, python3.8 (ubuntu20.04), Pycharm2023, and Cuda version 11.8. The training set to validation set ratio was 8:2, and the number of training rounds was set to 300 with a batch size of 32.

4.3. Regularisation Constraint Experiments

This section examines the effect of introducing regularization constraints into the loss function upon the model. The effect of adding the regularization term to the model is verified by adjusting the degree of regularization and recording the trend of other parameters. The experimental data in this section are based on the publicly available dataset NEU-DET. As illustrated in Figure 6, when the degree of regularization is initially low, the various metrics of the model, such as the precision, the recall, and the F1 score, exhibit minor fluctuations on the basis of the original model. However, as the degree of regularization gradually increases, the model’s performance starts to be influenced by parameter compression, resulting in a gradual decline in the indicators. This indicates that the introduced regularization terms limit the complexity of the model to a certain extent and prevent overfitting, but excessive regularization results in a decline in model performance on the training data.
The model parameters were monitored by setting a threshold of 0.0001. As shown in Figure 6, the number of parameters with values less than 0.0001 tended to increase with higher degrees of regularization. At the initial stage, when the degree of regularization is low, the model parameters tend to have larger values overall, which can lead to overfitting the training data. As the degree of regularization increases, the model incurs stronger penalties and the parameters become more compressed, tending towards smaller values. This enhances the model’s robustness against input data and reduces its sensitivity to noise and outliers, thus improving the model’s generalization performance. This implies that regularized binary cross-entropy not only suppresses model complexity, but also encourages the model to learn a more concise representation. Given the correlation between model performance metrics and the acquisition of a more succinct representation, striking a balance between the model’s capacity to fit and generalize is achievable by implementing a lower degree of regularization.

4.4. Ablation Experiments

In order to verify the effectiveness of each improvement in practical applications, improvement effectiveness experiments were conducted on two datasets, NEU-DET and ECTI, respectively, to observe the trend of the model’s performance indicators.

4.4.1. Ablation Experiments on ECTI

Table 2 presents the results of the progressive ablation experiments on ECTI. It is evident that the C2F-embedded CA based on the baseline has almost no increase in computation and parameters, while improving all performance indicators, particularly [email protected] and [email protected]. This indicates a significant improvement in model accuracy at high IOU thresholds. This improvement demonstrates that embedding the CA enhances the model’s accuracy in locating objects within the backbone. However, a decrease in the recall was observed. Preliminary analysis suggests that the infrared image is affected by the ‘blurring effect’ of heat transfer, resulting in edge blurring problems, and the lightweight attention module CA-C2F does not fully account for the defective characteristics of blurred edges, resulting in missed positive samples. This performance degradation is related to the scarcity and uncertainty of fuzzy defect features in the dataset. In future research, a pre-processing step of edge enhancement for infrared images should be considered.
Upon further substituting the Concat module on the neck side of the model with BiFPN-Concat, as evidenced by the ECTI dataset performance, the introduction of BiFPN-Concat improved various model performance indicators, with the recall and F1 Score reaching the optimal 98.38% and 0.98. BiFPN-Concat’s weighted multi-scale fusion of feature maps not only combines contextual information and detailed texture information, but also enhances the model’s ability to detect inconspicuous blur edge features at the original feature level. The enhancements in [email protected] and [email protected] reflect BiFPN-Concat’s enhanced model performance across different IOU thresholds. It is also observed that the addition of BiFPN-Concat resulted in an increase in FLOPs from 8.2 G to 8.3 G and Params from 3.01 M to 3.03 M. Although this increase in computational and spatial complexity is marginal, to mitigate the risk of overfitting arising from model complexity, the further incorporation of regularization constraints is considered to enhance generalization performance.
The purpose of introducing the regularization term is to optimize the model’s performance and generalization ability while maintaining computational and low parameter complexity. Experimental results demonstrate that, after adding regularization constraints, the model’s accuracy reached 97.23%, with [email protected] and [email protected] achieving an optimal performance of 99.38% and 79.41%, respectively. These improvements indicate that the regularization term achieves a balance between improving model prediction accuracy and overall performance in industrial defect detection scenarios with limited computational resources when high performance is required. The model weight parameters are gradually compressed to near-zero values by adding regularization terms to the binary cross-entropy loss function. Although these near-zero parameters are still used in the computation, their main purpose is to reduce the impact of unimportant model parameters on overall model performance. The regularization term improves the model’s generalization ability and reduces the risk of overfitting, but it also results in the model being less sensitive to certain positive examples.

4.4.2. Ablation Experiments on NEU-DET

Table 3 presents the results of the progressive ablation experiments on ECTI. The first improvement to the model showed a consistent trend of performance enhancement in the ECTI dataset, where it continued to perform excellently at higher IOU thresholds. Specifically, the [email protected] increased by 1.33%, [email protected] increased by 0.73%, and accuracy improved by 0.78%. This indicates that the CA-C2F lightweight module constructed in this paper indeed has a positive effect on enhancing the model’s performance.
The second improvement of the model lies in the weighted fusion of features at different levels by BiFPN-Concat. According to the experimental results, the accuracy increased from 78.26% to 81.27%, indicating that the improved model is more accurate in predicting positive classes. The differentiation in the contribution of multi-scale features to fusion indeed can enhance the model’s performance. Moreover, it achieved the highest value in the more stringent metric of [email protected] in the table, reaching 47.82%. Although the F1 score had a slight improvement over YOLOv8n, this increase was not as significant as other metrics, which might be due to a slight decrease in the recall rate, dropping by 0.5% compared to before.
The third improvement of the model involves the introduction of a regularization term in the loss function. According to the experimental results, the model showed improvements across multiple key performance indicators, especially in Precision, Recall, [email protected], and F1 metrics. Moreover, the addition of the regularization term seems to offset the decrease in recall rate caused by BiFPN to some extent, while maintaining its advantages in accuracy and mAP. Although [email protected] was slightly decreased by 0.2%, this is usually desirable in practical applications because regularization makes the model more prone to generalization rather than optimization for specific scenarios. Figure 7 shows the [email protected] of the baseline model and the proposed Regularized YOLO across different defect categories in the dataset. The mAP values for Cr and Rs defect categories show significant improvements, and except for a 0.5% decrease in Pa, the other five categories have improved, enhancing the model’s generalization performance across all categories of defects.
In summary, the three improvements discussed in this study have led to enhancements across various performance metrics. The final Regularized YOLO model demonstrated in this research shows a 4.1% increase in accuracy and a 2.3% increase in [email protected] in the NEU-DET dataset compared to the baseline model. In the ECTI dataset, it achieved an accuracy of 97.2% and a 1.6% increase in [email protected]. These results meet the performance requirements for detecting defects in steel, confirming the advanced nature of the proposed Regularized YOLO model.

4.5. Comparison with the Other Model

To verify the performance of the model among similar algorithms, this section shows the results of comparative experiments with current mainstream detection algorithms. As shown in Table 4, the [email protected] of Regularized YOLO proposed in this study reached 80.77% in the NEU-DET dataset. Compared with the one-stage algorithm SSD (VGG16), the two-stage algorithm Faster R-CNN (Resnet50), YOLOv5n, YOLOv7tiny (1 × 1), YOLOv7tiny (0.33 × 0.25), it increased by 6.8%, 4.2%, 2.6%, 10.7%, 3.9%, and 2.3%, respectively. The Precision–Recall (PR) curve of the Regularized YOLO in the NEU-DET dataset is illustrated in Figure 8.
As indicated in Table 5, the [email protected] of Regularized YOLO introduced in this study achieved the highest value of 99.38% in the ECTI dataset. In comparison with YOLOv5n, YOLOv7tiny, and others, Regularized YOLO demonstrated improvements of 1.65%, 0.68%, 0.49%, and 1.53%, respectively. Additionally, the [email protected] for each defect category reached its peak. Figure 9 shows the detection results of the baseline model and Regularized YOLO on a subset of the ECTI dataset.
In the task of detecting steel surface defects in infrared domain scenarios, Regularized YOLO outperforms other models in terms of comprehensive performance. It combines the advantages of a low number of parameters and high performance, achieving a good balance between precision and recall, with higher computational efficiency. Therefore, it is fully applicable to steel surface defect detection.

5. Conclusions

Although conventional cameras can detect surface defects in some scenarios, eddy current thermal imaging technology is much more sensitive to changes in material temperature. This technology can detect even minute temperature differences, revealing deeper subsurface defects. This high sensitivity characteristic displayed by infrared images makes it more suitable for identifying early-stage defects in steel and preventing potential faults.
This article introduces a Regularized YOLO defect detection model for steel infrared images. It integrates the CA into the C2F module of the backbone, creating a lightweight CA-C2F, and replaces the neck’s Concat with BiFPN-Concat, thus enhancing the network. Finally, regularization constraints are infused into the model’s loss function, resulting in an optimized YOLO defect detection model. The results show that:
(1)
The lightweight CA-C2F model focuses on the flow of defect features, aiding the backbone in extracting more nuanced features.
(2)
The BiFPN-Concat assigns extra weights to inputs, improving the fusion of multi-scale feature maps with diverse informational focus. This strengthens the link between contextual and detailed information, boosting feature fusion capabilities.
(3)
The addition of regularization constraints to the cross-entropy loss simplifies the model structure and enhances the generalization performance of the steel surface defect detection model.
In the ablation experiments, the proposed Regularized YOLO model, compared to the baseline model, achieved an improvement in accuracy with a relatively minor increase in the number of model parameters. Specifically, the parameter count increased from 3.01 M to 3.03 M, while the [email protected] improved from 78.41% to 80.77% in the NEU-DET dataset and increased from 97.85% to 99.38% in the ECTI dataset, meeting the accuracy and deployment requirements for steel surface defect detection.
Although the Regularized YOLO model has achieved significant improvements for Cr and Rs types of defects, these improvements are relative, and there remains considerable room for enhancing the model’s performance for these two types of defects. Additionally, the challenge of background interference persists in the task of detecting small targets in the infrared domain.

Author Contributions

Conceptualization, Y.Z. and Y.F.; methodology, Y.Z.; software, Y.Z.; validation, Y.Z. and Y.F.; formal analysis, Y.Z.; investigation, Y.Z.; resources, Y.F.; data curation, Y.Z.; writing—original draft preparation, Y.Z. and Y.F.; writing—review and editing, Y.F.; visualization, Y.Z. and Y.F.; supervision, Y.F.; project administration, Y.F.; funding acquisition, Y.F. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Open Research Project of the State Key Laboratory of Industrial Control Technology, Zhejiang University, China (No. ICT2022B06).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Xian, T.; Wei, H.; De, X. A Survey of Surface Defect Detection Methods Based on Deep Learning. Acta Autom. Sin. 2021, 47, 1017–1034. [Google Scholar]
  2. Suresh, B.R.; Fundakowski, R.A.; Levitt, T.S.; Overland, J.E. A Real-time Automated Visual Inspection System for Hot Steel Slabs. IEEE Trans. Pattern Anal. Mach. Intell. 1983, PAMI-5, 563–572. [Google Scholar] [CrossRef] [PubMed]
  3. Meng, G.; Liaolin, H.; Jiangtao, Z. Surface Defect Detection Method of Ceramic Bowl Based on Kirsch and Canny Operator. Acta Opt. Sin. 2016, 36, 27–33. [Google Scholar]
  4. Nieniewski, M. Morphological Detection and Extraction of Rail Surface Defects. IEEE Trans. Instrum. Meas. 2020, 69, 6870–6879. [Google Scholar] [CrossRef]
  5. Shiyang, Z. Research on Method for Image of Surface Detect of Steel Sheet Based on Visual Saliency and Sparse Representation. Ph.D. Thesis, Huazhong University of Science & Technology, Wuhan, China, 2017. [Google Scholar]
  6. Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
  7. Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. Ssd: Single Shot Multibox Detector. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 11–14 October 2016; pp. 21–37. [Google Scholar]
  8. Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 779–788. [Google Scholar]
  9. Redmon, J.; Farhadi, A. YOLO9000: Better, Faster, Stronger. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 October 2017; pp. 7263–7271. [Google Scholar]
  10. Redmon, J.; Farhadi, A. Yolov3: An Incremental Improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
  11. Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
  12. Ge, Z.; Liu, S.; Wang, F.; Li, Z.; Sun, J. YOLOX: Exceeding YOLO Series in 2021. arXiv 2021, arXiv:2107.08430. [Google Scholar]
  13. Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable Bag-of-freebies Sets New State-of-the-art for Real-time Object Detectors. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar]
  14. Xiang, K.; Li, S.S.; Luan, M.H.; Yang, Y.; He, H.M. Aluminum Product Surface Defect Detection Method Based on Improved Faster RCNN. Chin. J. Sci. Instrum. 2021, 42, 191–198. [Google Scholar]
  15. Cha, Y.; Choi, W.; Suh, G.; Mahmoudkhani, S.; Büyüköztürk, O. Autonomous Structural Visual Inspection Using Region-based Deep Learning for Detecting Multiple Damage Types. Comput. Civ. Infrastruct. Eng. 2018, 33, 731–747. [Google Scholar] [CrossRef]
  16. Bao, C.; Cao, J.; Hao, Q.; Cheng, Y.; Ning, Y.; Zhao, T. Dual-YOLO Architecture from Infrared and Visible Images for Object Detection. Sensors 2023, 23, 2934. [Google Scholar] [CrossRef] [PubMed]
  17. Zhang, Y.; Shen, K.J.; He, Z.F.; Pan, Z. YOLO-infrared: Enhancing YOLOX for Infrared Scene. J. Phys. Conf. Ser. 2022, 2405, 012015. [Google Scholar] [CrossRef]
  18. Mou, X.; Lei, S.; Zhou, X. YOLO-FR: A YOLOv5 Infrared Small Target Detection Algorithm Based on Feature Reassembly Sampling Method. Sensors 2023, 23, 2710. [Google Scholar] [CrossRef] [PubMed]
  19. Baiqiao, H.; Yugang, F.; Zhihuan, S. Deep Transfer Learning-Based Pulsed Eddy Current Thermography for Crack Defect Detection. Acta Opt. Sin. 2023, 43, 0415002. [Google Scholar]
  20. Zhou, W.; Wang, Z.; Zhang, M.; Wang, L. Wind Turbine Actual Defects Detection Based on Visible and Infrared Image Fusion. IEEE Trans. Instrum. Meas. 2023, 72, 1–8. [Google Scholar] [CrossRef]
  21. Tao, H.; Lu, M.; Hu, Z.; An, J. A Gated Multi-Hierarchical Feature Fusion Network for Recognizing Steel Plate Surface Defects. Multimed. Syst. 2023, 29, 1347–1360. [Google Scholar] [CrossRef]
  22. Zhao, C.; Shu, X.; Yan, X.; Zuo, X.; Zhu, F. RDD-YOLO: A Modified YOLO for Detection of Steel Surface Defects. Measurement 2023, 214, 112776. [Google Scholar] [CrossRef]
  23. Hou, Q.; Zhou, D.; Feng, J. Coordinate Attention for Efficient Mobile Network Design. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 13708–13717. [Google Scholar]
  24. Tan, M.; Pang, R.; Le, Q.V. EfficientDet: Scalable and Efficient Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 10778–10787. [Google Scholar]
Figure 1. The network structure of infrared image defect detection model.
Figure 1. The network structure of infrared image defect detection model.
Sensors 24 01674 g001
Figure 4. Pulse eddy current testing device.
Figure 4. Pulse eddy current testing device.
Sensors 24 01674 g004
Figure 5. Some steel defect samples in ECTI.
Figure 5. Some steel defect samples in ECTI.
Sensors 24 01674 g005
Figure 6. Model performance at different degrees of regularization.
Figure 6. Model performance at different degrees of regularization.
Sensors 24 01674 g006
Figure 7. The [email protected] of Regularized YOLO compared with YOLOv8n.
Figure 7. The [email protected] of Regularized YOLO compared with YOLOv8n.
Sensors 24 01674 g007
Figure 8. The PR curve of Regularized YOLO on NEU-DET.
Figure 8. The PR curve of Regularized YOLO on NEU-DET.
Sensors 24 01674 g008
Figure 9. Detection plot of partial ECTI.
Figure 9. Detection plot of partial ECTI.
Sensors 24 01674 g009
Table 1. The crack parameters on ECTI.
Table 1. The crack parameters on ECTI.
Type of CrackLength (mm)Width (mm)Depth (mm)
Large201.51, 2, 3, 4
Medium8 and 101.51, 2, 3, 4
Short41.51, 2, 3, 4
Table 2. The ablation experiments on ECTI.
Table 2. The ablation experiments on ECTI.
ModelPR[email protected][email protected]F1FLOPsParams
v8n96.3897.5997.8577.930.978.2 G3.01 M
v8n+ca-c2f96.6696.7998.8278.270.978.2 G3.01 M
v8n+ca-c2f+bifpn96.7798.3899.3278.810.988.3 G3.03 M
v8n+ca-c2f+bifpn+l297.2397.4699.3879.410.978.3 G3.03 M
Table 3. The ablation experiments on NEU-DET.
Table 3. The ablation experiments on NEU-DET.
ModelPR[email protected][email protected]F1FLOPsParams
v8n77.4873.1078.4146.660.758.2 G3.01 M
v8n+ca-c2f78.2673.7279.7447.390.768.2 G3.01 M
v8n+ca-c2f+bifpn81.2773.2280.7347.820.768.3 G3.03 M
v8n+ca-c2f+bifpn+l281.5774.8780.7747.620.788.3 G3.03 M
Table 4. Comparisons with other methods on NEU-DET.
Table 4. Comparisons with other methods on NEU-DET.
Model[email protected]InCrPaPsRsSc[email protected]FLOPsParams
SSD [6]73.9683.646.492.484.561.874.8--61.25 G24.28 M
Faster R-CNN [7]76.5781.347.492.579.063.395.7--369.84 G136.79 M
YOLOV5n78.0983.242.392.587.169.194.645.004.2 G1.77 M
V7tiny (1 × 1) [13]76.8083.538.192.085.167.794.443.3013.2 G6.02 M
V7tiny (0.33 × 0.25) [13]70.0676.730.887.687.350.487.534.313.4 G1.51 M
YOLOV8n78.4182.047.993.183.366.997.146.668.2 G3.01 M
Regularized YOLO80.7784.050.693.488.671.296.947.628.3 G3.03 M
Table 5. Comparisons with other methods on ECTI.
Table 5. Comparisons with other methods on ECTI.
Model[email protected]LMS[email protected]FLOPsParams
YOLOv5n97.7397.895.999.575.994.2 G1.77 M
V7tiny (1 × 1) [13]98.7098.897.999.570.6513.2 G6.02 M
V7tiny (0.33 × 0.25) [13]98.8998.998.499.571.473.4 G1.51 M
YOLOv8n97.8598.495.799.577.938.2 G3.01 M
Regularized YOLO99.3899.599.199.579.418.3 G3.03 M
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zou, Y.; Fan, Y. An Infrared Image Defect Detection Method for Steel Based on Regularized YOLO. Sensors 2024, 24, 1674. https://doi.org/10.3390/s24051674

AMA Style

Zou Y, Fan Y. An Infrared Image Defect Detection Method for Steel Based on Regularized YOLO. Sensors. 2024; 24(5):1674. https://doi.org/10.3390/s24051674

Chicago/Turabian Style

Zou, Yongqiang, and Yugang Fan. 2024. "An Infrared Image Defect Detection Method for Steel Based on Regularized YOLO" Sensors 24, no. 5: 1674. https://doi.org/10.3390/s24051674

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop