Light-weight steel surface defect detection method combined with phantom convolution

By combining the lightweight design of Ghost hybrid attention module, SPPF-DLKA module and GSCSP module, deep learning solves the problems of large computing resource occupation and information loss in steel surface defect detection, and achieves efficient and accurate defect detection.

CN120451091APending Publication Date: 2025-08-08CHONGQING UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510536509.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

The existing deep learning methods have defects such as large computing resource occupancy, sensitivity to complex background and lighting changes, difficulty in dealing with diverse morphology and blurred features in steel surface defect detection, and lack the ability to model dynamic context information of different targets, resulting in insufficient detection accuracy and real-time.

Method used

The Ghost hybrid attention module, SPPF-DLKA module and GSCSP module are adopted to design a lightweight encoder decoder structure through a linear bottleneck inverse residual structure, deformable large-core convolution and hybrid attention mechanism, combined with expanded convolution and deformable convolution, to enhance the model's attention ability to focus on spatial location and channel characteristics, and alleviate information loss and calculation complexity.

Benefits of technology

It significantly reduces memory usage, improves the accuracy and robustness of defect detection, can effectively identify defects in large size and complex shapes, and improves the detection efficiency and generalization capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451091A_ABST
    Figure CN120451091A_ABST
Patent Text Reader

Abstract

The invention discloses a light-weight steel surface defect detection method combined with phantom convolution, and relates to the technical field of industrial image processing. According to the method, the steel surface defects can be detected robustly through an encoder and decoder structure, the Ghost mixed attention module is utilized, the memory occupation is greatly reduced, the attention capability of the network on the spatial position information and channel feature relationship is enhanced, and the module remarkably improves the performance of extracting defect features; meanwhile, an SPPF-DLKA module is designed, the receptive field is expanded through expansion convolution, the recognition capacity of the model for large-size defects can be effectively improved, the high-level semantic information loss is effectively relieved through the finally designed GSCSP, a large number of experiments are carried out, results show that compared with other methods, the method is effective, and the method is suitable for large-scale popularization and application. And an excellent effect is achieved on a plurality of data sets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial image processing, and in particular to a lightweight steel surface defect detection method combined with phantom convolution. Background Art

[0002] As global economic competition intensifies, intelligent manufacturing has gradually become a core theme in global industrial development. As a key foundational material in the modern industrial system, steel, with its excellent mechanical properties and wide range of applications, plays an irreplaceable role in national economic development. However, during steel production and processing, various surface defects such as scratches, bubbles, cracks, spots, and corrosion are easily generated due to factors such as aging equipment, unstable environments, and process fluctuations. These defects not only affect the steel's appearance but also significantly reduce its mechanical properties, such as tensile strength, toughness, and corrosion resistance. In severe cases, they can even cause safety accidents. In the early stages of steel quality inspection technology, the identification of surface defects relied primarily on visual inspection by human operators. While this method is intuitive, manual inspection is time-consuming and labor-intensive, failing to meet the demands of modern high-speed production lines. To overcome these issues, automated inspection technologies have gradually replaced manual inspection and become a vital component of industrial production. Machine vision technology uses cameras to capture image information and analyze it with algorithms, enabling non-contact, online, and real-time inspection. However, its algorithms are designed specifically for each defect type, resulting in limited flexibility. Furthermore, it is sensitive to complex backgrounds and lighting variations, making it difficult to detect defects with diverse morphologies and ambiguous features. Compared with traditional methods, the innovative application of deep learning in the field of computer vision has brought new solutions to steel surface defect detection.

[0003] Many excellent methods have emerged, demonstrating the promising potential of deep learning. However, the low-contrast nature of industrial images makes defect outlines more blurred and hidden, and defect features are easily drowned out by background noise, posing a challenge for accurately extracting defect information in complex environments. Furthermore, most defect detection models consume significant computing resources, making them difficult to deploy on edge devices. Early research primarily relied on handcrafted feature-based image processing and shallow machine learning techniques to extract stable defect signatures. However, these methods have limitations when faced with unclear features or noise interference of varying intensities.

[0004] In recent years, with the development of deep learning, data-driven methods have gradually become a new trend. There are two main methods for dealing with noise interference and small target defects. One is to use a two-stage network. This scheme first generates potential defect regions through a region proposal network, and then finely classifies these candidate regions, thereby effectively alleviating the problem of regional misalignment and significantly improving detection accuracy. However, this method still has problems such as slow detection speed and difficulty in meeting real-time detection requirements. The other method is based on a single-stage detection strategy, which unifies the positioning and classification tasks into a regression problem. Although this method compromises detection accuracy, it significantly improves the real-time performance of the system. Although this method improves the defect detection effect by increasing the path of information flow and improving the efficiency of feature transmission, it still has problems such as a relatively large number of parameters, a lack of modeling ability for dynamic context information of different targets, and an inability to fully capture key local features in defects. In summary, previous work still has shortcomings in reducing noise interference and effectively reducing model parameters.

[0005] Therefore, a new solution to the above problems needs to be proposed. Summary of the Invention

[0006] The object of the present invention is to provide a lightweight steel surface defect detection method combined with phantom convolution to solve the technical problems raised in the background technology.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a lightweight steel surface defect detection method combined with phantom convolution, comprising at least the following steps:

[0008] S1: Build a model, which includes at least a Ghost hybrid attention module, an SPPF-DLKA module, and a GSCSP module; the Ghost hybrid attention module, namely the GHAM module, uses an inverted residual structure with a linear bottleneck to alleviate the accuracy loss problem caused by network lightweighting; the SPPF-DLKA module uses a deformable large-kernel convolutional attention module to expand the receptive field while helping to retain key information and avoid detail loss due to excessive pooling; the GSCSP module is used to address the problem of target information loss during high-level information transmission in the network;

[0009] S2: In the training phase, the data in the public defect dataset is preprocessed and then fed into the model built in S1. The datasets used include the NEU-DET dataset and the GC10-DET dataset.

[0010] S3: Model optimization and update, by designing a loss function for learning to optimize and update the model;

[0011] S4: Send the processed data set to the model processed by the loss function for training, and save the weight with the best training effect. That is, set the model optimizer and batch size parameters and select an appropriate learning rate strategy. Then select the data set for training and save the weight of each round, and record the weight of the round with the best effect.

[0012] S5: After the model training is completed, the model is tested and the effectiveness of the model is verified using public evaluation indicators. The verified model is used for lightweight steel surface defect detection.

[0013] Furthermore, the GHAM module includes two cascaded Ghost units and a depth-wise separable convolutional layer, and embeds a hybrid attention mechanism in the residual path to effectively improve feature selection capabilities;

[0014] The first Ghost unit is used as an expansion layer to increase the number of feature channels, while the second Ghost unit is responsible for reducing the channel dimension and establishing residual connections to enhance the nonlinear expression ability of the model;

[0015] The first Ghost unit is used as an expansion layer to increase the number of feature channels, and the second Ghost unit is responsible for reducing the channel dimension and establishing a residual connection;

[0016] The hybrid attention mechanism can better enhance the channel features rich in effective information, suppress the channel features with redundant or poor information, and alleviate the accuracy loss caused by network lightweighting;

[0017] By combining channel attention with spatial attention, the model equipped with the GHAM module can more efficiently utilize information at different levels in the feature map, thereby significantly improving its representation ability. The fusion mechanism of the GHAM module realizes the adaptive refinement of the feature map, enabling the model to focus on key areas more accurately.

[0018] Further, the SPPF-DLKA module includes an SPPF block and a DLKA block;

[0019] By further designing a deformable large kernel convolutional attention module, namely the DLKA module, in the SPPF fast layer, it helps retain key information while expanding the receptive field and avoids detail loss caused by over-pooling.

[0020] To further improve detection accuracy while controlling the model parameter size and computational complexity, the DLKA block combines large convolution kernels with deformable convolution. The large convolution kernels are implemented by dilating depthwise separable convolutions, which combines the advantages of large receptive field and efficient computation.

[0021] The convolution method adopted by the DLKA block expands the receptive field by introducing a dilation rate without adding additional parameters, enabling the model to capture more contextual information and is particularly suitable for identifying large-scale defects. In addition, the deformable convolution further enhances the model's adaptability to irregular shapes and complex texture defects by dynamically adjusting the convolution sampling position.

[0022] Furthermore, the large kernel convolution has a receptive field similar to the self-attention mechanism. By using depthwise convolution, depthwise dilated convolution, and 1×1 convolution, a large convolution kernel with fewer parameters and less computation is constructed. However, using large kernel convolution alone still has problems. For irregular targets, the traditional rectangular convolution kernel has low efficiency and information loss problems, and it is difficult to effectively handle complex deformed targets.

[0023] The use of deformable convolution significantly improves the network's feature extraction ability for complex-shaped targets. Compared with conventional convolution, deformable convolution enables the convolution kernel to dynamically adjust its shape by learning an adaptive offset for each sampling point in the convolution kernel, better adapting to the geometric characteristics of the target.

[0024] The deformable large kernel convolutional attention module can further extract multi-scale contextual information based on SPPF, which is particularly important for identifying various small defects or extremely irregular defects on the steel surface. It also effectively enhances the model's perception of fine-grained and large-scale defects.

[0025] Through the DLKA block, the model can not only effectively focus on potential defect areas in the image, but also suppress irrelevant background noise, further improving the accuracy and robustness of defect detection. In order to improve computational efficiency, the large kernel convolution is further split, and the original K×K convolution kernel is split into 1×K and K×1 continuous convolution operations. The split operation further reduces the computational complexity of the model.

[0026] Furthermore, the GSCSP module includes a one-time aggregation strategy to design an efficient cross-stage partial network module, that is, the GSCSP module includes a GSconv module, which uses a shuffle operation to infiltrate the features generated by conventional convolution into each part of the features generated by the depthwise separable convolution, so that the information from the conventional convolution is completely mixed into the output of the depthwise separable convolution. In this way, the texture features are highly similar to the texture features extracted by the conventional convolution;

[0027] The GSCSP module reduces the number of input channels through the first convolutional layer to reduce the computational complexity of subsequent convolutional layers. The GSconv module then performs a convolution operation on the reduced-dimensional feature map to extract features, and finally restores it to the output dimension through a convolutional layer for subsequent calculations.

[0028] Furthermore, the data preprocessing of S2 includes at least the following steps:

[0029] The Mosaic data augmentation method uses four images to perform random scaling and cropping and then shuffle them into a new image for operation. This is equivalent to increasing the batch size during training, which not only optimizes the training effect but also reduces the consumption of graphics card memory.

[0030] After using Mosaic data augmentation, traversing each image is equivalent to traversing four images at the same time. The number of target defects also increases, and the positive and negative samples for network learning become richer.

[0031] Furthermore, the loss function in S3 is the EIOU loss function and the NWD loss function, which accelerates the convergence speed of the model and improves the performance of the model;

[0032]

[0033] Among them, L EIOU is the EIOU loss function; IOU is a standard intersection-over-union metric that measures the degree of overlap between the predicted box and the true box; ρ 2 (b,b g ) is the square of the center point distance between the predicted box and the real box, which measures the difference in their relative positions; w c and h c is the width and height of the prediction box; w g and h g is the width and height of the ground truth box; ρ 2 (w,w g ) and ρ 2 (h,h g ) measure the difference between the predicted box and the real box in width and height respectively;

[0034]

[0035] in, Is the Wasserstein-2 distance, which measures the distribution of the model prediction box N B and ground-truth box distribution The difference between ;τ is a temperature parameter that controls the scaling of the loss;

[0036] L boa =λL Eiou +(1-λ)L NWD

[0037] Among them, λ is the weight coefficient that controls the balance between the two losses.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] The present invention can robustly detect steel surface defects through the encoder-decoder structure. The Ghost hybrid attention module is used to greatly reduce memory usage and enhance the network's ability to pay attention to the relationship between spatial position information and channel features. This module significantly improves the performance of extracting defect features. At the same time, the SPPF-DLKA module is designed to expand the receptive field by dilated convolution, which can effectively improve the model's recognition ability for large-scale defects. Finally, the designed GSCSP effectively alleviates the loss of high-level semantic information. The present invention has conducted a large number of experiments, and the results show that compared with other methods, the proposed method is effective and has achieved excellent results on multiple data sets. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 Schematic diagram of the model of the present invention;

[0042] Figure 2 Schematic diagram of the Ghost hybrid attention module of the present invention;

[0043] Figure 3 This is a schematic diagram of the SPPF-DLKA module of the present invention;

[0044] Figure 4 This is a schematic diagram of the GSCSP module of the present invention;

[0045] Figure 5 This is a flow chart of the system of the present invention;

[0046] Figure 6 It is the main interface of the system of the present invention;

[0047] Figure 7 Visualization of defect detection results for the NEU-DET dataset. DETAILED DESCRIPTION

[0048] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0049] Example 1:

[0050] This embodiment specifically discloses a lightweight steel surface defect detection method combined with phantom convolution;

[0051] The current deep learning framework has difficulty in effectively processing defects with diverse shapes and fuzzy features when faced with large variations in light intensity. In addition, the layer-by-layer feature transmission operation may lead to information loss, especially for detailed structural and texture features. These situations will lead to the current network structure's insufficient feature extraction capability for target defects. In addition, deep learning networks usually require a large amount of computing resources, which limits the application of the algorithm in edge computing and embedded devices. In order to be compatible with more low-computing power production equipment and break through the limitations of high computational complexity, the lightweight defect detection method proposed in the present invention can effectively handle these problems. First, in response to the large amount of memory occupied and high computational complexity of convolution, the present invention proposes a Ghost hybrid attention module to reduce the number of model parameters and enhance the network's ability to characterize defect features. At the same time, the present invention designs the SPPF-DLKA module to further enhance the model's adaptability to irregular shapes and complex texture defects. Finally, the present invention proposes the GSCSP module to improve the ability to transmit texture information in high-level semantics. This method can effectively extract defect features.

[0052] The specific steps are as follows:

[0053] S1: Build a model, which includes at least the Ghost Hybrid Attention Module, the SPPF-DLKA Module, and the GSCSP Module. The Ghost Hybrid Attention Module, also known as the GHAM Module, uses a linear bottleneck inverted residual structure design to alleviate the accuracy loss caused by network lightweighting. The SPPF-DLKA Module uses a deformable large kernel convolutional attention module to expand the receptive field while helping to retain key information and avoid detail loss due to over-pooling. The GSCSP Module is used to address the problem of target information loss during high-level information transmission in the network.

[0054] S2: In the training phase, the data in the public defect dataset is preprocessed and then fed into the model built in S1. The datasets used include the NEU-DET dataset and the GC10-DET dataset.

[0055] S3: Model optimization and update, by designing a loss function for learning to optimize and update the model;

[0056] S4: Send the processed data set to the model processed by the loss function for training, and save the weight with the best training effect. That is, set the model optimizer and batch size parameters and select an appropriate learning rate strategy. Then select the data set for training and save the weight of each round, and record the weight of the round with the best effect.

[0057] S5: After the model training is completed, the model is tested and the effectiveness of the model is verified using public evaluation indicators. The verified model is used for lightweight steel surface defect detection.

[0058] The preprocessing in S2 involves randomly scaling and cropping four images using the Mosaic data augmentation method, then combining them in a random order to create a new image. This effectively increases the batch size during training, optimizing training results while reducing graphics card memory consumption. After using Mosaic data augmentation, each image is traversed simultaneously, effectively traversing four images. This increases the number of target defects and enriches the network's learning pool of positive and negative examples.

[0059] The three modules in S1 are as follows: The Ghost hybrid attention module is mainly composed of cascaded Ghost units and a hybrid attention mechanism. The first Ghost unit is used as an expansion layer to increase the number of feature channels, while the second Ghost unit is responsible for reducing the channel dimension and establishing a residual connection. The hybrid attention module can better enhance the channel features rich in effective information and suppress the channel features with redundant or poor information. SPPF-DLKA consists of the SPPF block and the DLKA module. DLKA mainly adopts the idea of combining large convolution kernels with deformable convolutions, taking into account the advantages of large receptive field and efficient calculation. The GSCSP module is an efficient cross-stage partial network module designed with a one-time aggregation strategy.

[0060] The specific loss function in S3 is as follows: the cross entropy loss function and the CIOU loss function are open and recognized effective loss functions in this field. According to the supervision method mentioned in the present invention, the detection results and the original ground truth are supervised.

[0061] The loss functions in S3 are EIOU loss function and NWD loss function, which accelerate the convergence speed of the model and improve the performance of the model;

[0062]

[0063] Among them, L EIOU is the EIOU loss function; IOU is a standard intersection-over-union metric that measures the degree of overlap between the predicted box and the true box; ρ 2 (b,b g ) is the square of the center point distance between the predicted box and the real box, which measures the difference in their relative positions; w c and h c is the width and height of the prediction box; w g and h g is the width and height of the ground truth box; ρ 2 (w,w g) and ρ 2 (h,h g ) measure the difference between the predicted box and the real box in width and height respectively;

[0064]

[0065] in, Is the Wasserstein-2 distance, which measures the distribution of the model prediction box N B and ground-truth box distribution The difference between ;τ is a temperature parameter that controls the scaling of the loss;

[0066] L boa =λL Eiou +(1-λ)L NWD

[0067] Among them, λ is the weight coefficient that controls the balance between the two losses.

[0068] The specific steps for training pre-processed data in S4 are: set the model optimizer and batch size parameters and choose an appropriate learning rate strategy, then select a dataset for training and save the weights of each round. The weight of the round with the best performance is recorded.

[0069] The specific method for verifying the effectiveness of the model in S5 is to use the round parameters with the best training results and feed the test portion of the dataset into the model to obtain defect detection data. The defect detection performance of the model is verified using three publicly available evaluation metrics. The following evaluation metrics are required:

[0070] Precision

[0071]

[0072] Average Precision (AP)

[0073]

[0074] Mean Average Precision (mAP)

[0075]

[0076] Example 2:

[0077] This embodiment proposes a specific lightweight steel surface defect detection network model combined with phantom convolution based on the above embodiment 1;

[0078] A specific lightweight steel surface defect detection network model combined with phantom convolution is as follows Figure 1As shown, the present invention includes three main modules: Ghost hybrid attention module, SPPF-DLKA module and GSCSP module. Among them, the Ghost hybrid attention module is composed of stacked Ghost units and integrated attention mechanism through the inverted residual structure of linear bottleneck, thereby alleviating the problem of accuracy loss caused by network lightweighting. SPPF-DLKA adopts a deformable large-kernel convolution attention module, which helps to retain key information while expanding the receptive field and avoids detail loss due to excessive pooling. The present invention also observes that there is a problem of target information loss in the process of high-level information transmission in the network. For this reason, the present invention designs GSCSP to alleviate this problem.

[0079] Ghost Attention Module

[0080] Deep learning networks consist of numerous convolutional operations, which consume a large amount of memory and computation, placing high demands on hardware performance and detection speed. GhostNet was designed to reduce the high redundancy of intermediate feature maps. It replaces conventional convolutional operations with a series of simple linear operations between similar feature map pairs to generate more feature maps. This reduces the computational cost of conventional convolutional layers while maintaining similar recognition performance.

[0081] The Ghost module uses 1×1 convolution to reduce the number of channels of the original feature map as the intrinsic feature map, and performs linear operations on the intrinsic feature map to generate the Ghost feature map. Then, the intrinsic feature map and the Ghost feature map are fused into the output feature map through Concat. Assume that the input feature map is h×w×c and the output feature map is h′×w′×n. First, the convolution kernel size of the original convolution is c×k×k×m to generate m intrinsic feature maps. Afterwards, in order to further obtain the required feature map, a series of linear operations are performed on each intrinsic feature to generate s Ghost features according to the following function

[0082]

[0083] where y i ′ is the i-th intrinsic feature map of the input, and the above function Is to generate the jth ghost feature map y i,j The j-th (except the last) linear operation of . It is an identity mapping that preserves the intrinsic feature map. Finally, n = m × s feature maps are obtained.

[0084] Taking advantage of the lightweight advantage of the Ghost module, GHAM (Ghost Hybrid Attention Module) was designed in the backbone network design. Figure 2As shown in Figure 2, the module adopts an inverted residual structure with a linear bottleneck, which consists of stacked Ghost units and an integrated attention mechanism.

[0085] Specifically, the module consists of two cascaded Ghost units and a depthwise separable convolutional layer, with a hybrid attention mechanism embedded in the residual path. The first Ghost unit serves as an expansion layer to increase the number of feature channels, while the second Ghost unit is responsible for reducing the channel dimension and establishing residual connections, thereby enhancing the model's nonlinear expressiveness. To mitigate the accuracy loss caused by network lightweighting, a hybrid attention mechanism was designed and integrated into the residual path of the Ghost module, effectively improving feature selection capabilities.

[0086] The hybrid attention module can better enhance the effective information-rich channel features and suppress the information-redundant or poor channel features.

[0087] By combining channel attention with spatial attention, the model can more efficiently utilize information from different levels in the feature map, significantly improving its representational capabilities. This fusion mechanism enables adaptive refinement of the feature map, allowing the model to focus more accurately on key areas.

[0088] SPPF-DLKA module

[0089] In traditional SPPF, the model extracts multi-scale features through multiple pooling operations. However, due to its stacked fixed-scale pooling operation, it lacks the ability to model the dynamic contextual information of different objects, making it unable to fully capture key local features in defects. Furthermore, the repeated pooling operations can cause detailed features to be compressed or even lost. To further expand the model's receptive field and further enhance its ability to extract contextual information, this paper further designs a deformable large-kernel convolutional attention module (DLKA) within SPPF. This module not only expands the receptive field but also helps preserve key information, avoiding the loss of detail caused by excessive pooling. To further improve detection accuracy while controlling model parameter size and computational complexity, DLKA primarily utilizes a combination of large convolutional kernels and deformable convolutions. Large convolutional kernels are implemented through dilated depthwise separable convolutions, balancing the advantages of a large receptive field with efficient computation. This convolution approach introduces a dilation rate to expand the receptive field without adding additional parameters, enabling the model to capture more contextual information and making it particularly suitable for detecting large-scale defects. In addition, the deformable convolution further enhances the model's adaptability to irregular shapes and complex texture defects by dynamically adjusting the convolution sampling position. Its module structure is as follows Figure 3 shown

[0090] There are two key components in DLKA: large kernel convolution and deformable convolution. Large kernel convolution has a receptive field similar to the self-attention mechanism. By using depthwise convolution, depthwise dilated convolution, and 1×1 convolution, large convolution kernels with fewer parameters and computational complexity are constructed. Traditional rectangular convolution kernels suffer from inefficiency and information loss for irregular targets, and are difficult to effectively handle complex deformable targets. Given this, this study further employs deformable convolution, significantly improving the network's feature extraction capabilities for complex-shaped targets. Compared to conventional convolution, deformable convolution learns an adaptive offset for each sample point in the convolution kernel, enabling the convolution kernel to dynamically adjust its shape to better adapt to the target's geometric characteristics. The deformable large kernel convolution attention module further extracts multi-scale contextual information based on the SPPF. This is particularly important for identifying various small or extremely irregular defects on the surface of steel, and it effectively enhances the model's perception of fine-grained and large-scale defects. By using a deformable large-kernel convolution attention module, the model not only effectively focuses on potential defect areas in the image but also suppresses irrelevant background noise, further improving the accuracy and robustness of defect detection. To improve computational efficiency, this paper further splits the large-kernel convolution, separating the original K×K convolution kernel into 1×K and K×1 continuous convolution operations, further reducing the model's computational complexity.

[0091] GSCSP module

[0092] Depthwise separable convolutions are widely adopted in current lightweight designs, significantly reducing model size. However, the channel-wise separation operation causes the convolutional network to lose some information when extracting semantic information, resulting in lower feature representation capabilities than conventional convolutions. While there are some solutions, MobileNets uses a large number of 1×1 dense convolutions to fuse independently computed channel information; ShuffleNets uses "Channel Shuffle" to achieve channel information interaction; and GhostNet uses linear operations to generate more features. GSconv employs a hybrid strategy that blends the characteristics of conventional convolution and depthwise separable convolution, making the output of depthwise separable convolution as close to that of conventional convolution as possible. In the backbone network, the input image is spatially compressed and expanded in the same dimension to transform the feature representation. However, the downsampling operation in this transformation process can easily lead to loss of spatial information, and the channel expansion process can also introduce redundant information. Dense convolutions can achieve maximum information preservation through full channel connections, but this is computationally expensive. Sparse convolutions improve computational efficiency by cutting channel connections. GSConv optimizes information flow by better balancing connection density, maintaining computational efficiency.

[0093] The Shuffle operation is used to infiltrate the features generated by conventional convolution into every part of the features generated by depthwise separable convolution, so that the information from conventional convolution is completely mixed into the output of depthwise separable convolution. In this way, the texture features of GSConv are highly similar to those extracted by conventional convolution.

[0094] In GSCSP, we use the one-time aggregation strategy to design an efficient cross-stage partial network module. The first convolution layer reduces the number of input channels to reduce the computational complexity of subsequent convolution layers. The GSconv module then performs a convolution operation on the reduced-dimensional feature map to extract features. Finally, a convolution layer restores it to the output dimension for subsequent computation. The module structure is shown in the figure. Figure 4 shown.

[0095] Example 3:

[0096] This embodiment proposes a defect detection system based on the above two embodiments. Figure 5 and Figure 6 .

[0097] In order to better serve the production line, the present invention adopts PyQT technology combined with the defect detection model to realize the steel surface defect detection system. Through this system, users can easily select different detection modes and pre-trained weights of the inference-end detection model, infer the original defect image or video, and give the defect location and related information. Among them, the steel surface defect detection system needs to accurately detect defects of different industrial products, and needs to provide different detection models to deal with different defective products. Therefore, the model needs to design a model weight selection function to meet the different needs of users; after the user determines the type of defective product and selects the model weight, it is necessary to provide a detection mode function so that the user can independently select image detection, video detection or camera detection. After completing the image detection, it is necessary to analyze the detection results and visualize the detection results. When performing video detection, it is necessary to display the detection results of each frame. When all detections are completed, it is necessary to automatically save the results, generate corresponding pictures and txt files, etc. The system flow chart is as follows. Figure 5 The developed system consists of four areas: test result area, test mode selection area, result analysis area and operation area, as shown in Figure 6 shown.

[0098] Based on the above-mentioned Example 1 and Example 2, the following verification is proposed:

[0099] The present invention was tested on NEU-DET and GC10-DET respectively. The NEU-DET dataset has 1,800 images, including six typical surface defect types, namely oxide scale, surface plaque, crack, pitting, inclusions and scratches. The GC10-DET dataset contains ten types of surface defects collected in real industry, including punching, weld line, crescent gap, water spot, oil spot, silk spot, inclusion (in), curl pit, crease and waist fold, etc. These two datasets contain complex and different defect scenes, which can effectively test the performance of the model. The evaluation indicators we use are Mean Average Precision (mAP) and parameter quantity (Params), which are widely used to measure defect detection accuracy and model size.

[0100] The method proposed in this invention is compared with many excellent defect detection methods. The comparison results on the NEU-DET dataset are shown in Table 1, and the comparison results on the GC10-DET dataset are shown in Table 2. The representative defect detection results on the NEU-DET dataset are visualized as shown in Figure 7 . The results show that compared with other methods, the model we proposed shows significant performance improvements in several indicators, including mAP, Param, and Gfolps. Compared with the mainstream lightweight backbone network in terms of the two data, the performance gain shown by our model is particularly outstanding, indicating that our method can handle different defects in complex scenarios very efficiently while being lightweight. The test results on multiple defect categories of the GC10-DET dataset prove that our model shows high expressiveness in different defect scenarios, thereby verifying the strong generalization ability of the model. Through visual comparison, our method can effectively avoid interference in detecting targets when the defect features are not obvious, indicating that the proposed hybrid attention has a certain anti-interference ability. The improvement effect is obvious when facing simple types of defects such as plaques and scratches. Compared with other methods, it can better enhance effective information and help the model achieve more accurate target positioning capabilities.

[0101] Table 1 Experimental comparison results with advanced methods on the NUE-DET dataset (bold represents the best)

[0102]

[0103] Table 2 Experimental comparison results with advanced methods on the GC10-DET dataset (bold represents the best)

[0104]

[0105] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.

Claims

1. A lightweight steel surface defect detection method combined with phantom convolution, characterized by: At least the following steps are included: S1: Build a model, which includes at least a Ghost hybrid attention module, an SPPF-DLKA module, and a GSCSP module; the Ghost hybrid attention module, namely the GHAM module, uses an inverted residual structure with a linear bottleneck to alleviate the accuracy loss problem caused by network lightweighting; the SPPF-DLKA module uses a deformable large-kernel convolutional attention module to expand the receptive field while helping to retain key information and avoid detail loss due to excessive pooling; the GSCSP module is used to address the problem of target information loss during high-level information transmission in the network; S2: In the training phase, the data in the public defect dataset is preprocessed and then fed into the model built in S1. The datasets used include the NEU-DET dataset and the GC10-DET dataset. S3: Model optimization and update, by designing a loss function for learning to optimize and update the model; S4: Send the processed data set to the model processed by the loss function for training, and save the weight with the best training effect. That is, set the model optimizer and batch size parameters and select the appropriate learning rate strategy, then select the data set for training and save the weight of each round, and record the weight of the round with the best effect; S5: After the model training is completed, the model is tested and the effectiveness of the model is verified using public evaluation indicators. The verified model is used for lightweight steel surface defect detection.

2. The method for detecting lightweight steel surface defects using phantom convolution according to claim 1, characterized in that: The GHAM module consists of two cascaded Ghost units and a depth-wise separable convolutional layer, and embeds a hybrid attention mechanism in the residual path to effectively improve feature selection capabilities; The first Ghost unit is used as an expansion layer to increase the number of feature channels, while the second Ghost unit is responsible for reducing the channel dimension and establishing residual connections to enhance the nonlinear expression ability of the model; The first Ghost unit is used as an expansion layer to increase the number of feature channels, and the second Ghost unit is responsible for reducing the channel dimension and establishing a residual connection; The hybrid attention mechanism can better enhance the channel features rich in effective information, suppress the channel features with redundant or poor information, and alleviate the accuracy loss caused by network lightweighting; By combining channel attention with spatial attention, the model equipped with the GHAM module can more efficiently utilize information at different levels in the feature map, thereby significantly improving its representation ability. The fusion mechanism of the GHAM module realizes the adaptive refinement of the feature map, enabling the model to focus on key areas more accurately.

3. The method for detecting lightweight steel surface defects in combination with phantom convolution according to claim 2, characterized in that: The SPPF-DLKA module includes an SPPF block and a DLKA block; By further designing a deformable large kernel convolutional attention module, namely the DLKA module, in the SPPF fast layer, it helps retain key information while expanding the receptive field and avoids detail loss caused by over-pooling. To further improve detection accuracy while controlling the model parameter size and computational complexity, the DLKA block combines large convolution kernels with deformable convolution. The large convolution kernels are implemented by dilating depthwise separable convolutions, which combines the advantages of large receptive field and efficient computation. The convolution method adopted by the DLKA block expands the receptive field by introducing a dilation rate without adding additional parameters, enabling the model to capture more contextual information and is particularly suitable for identifying large-scale defects. In addition, the deformable convolution further enhances the model's adaptability to irregular shapes and complex texture defects by dynamically adjusting the convolution sampling position.

4. The method for detecting lightweight steel surface defects using phantom convolution according to claim 3, wherein: The large kernel convolution has a similar receptive field to the self-attention mechanism. By using depthwise convolution, depthwise dilated convolution, and 1×1 convolution, a large convolution kernel with fewer parameters and less computation is constructed. However, using large kernel convolution alone still has problems. The use of deformable convolution significantly improves the network's feature extraction ability for complex-shaped targets. Compared with conventional convolution, deformable convolution enables the convolution kernel to dynamically adjust its shape by learning an adaptive offset for each sampling point in the convolution kernel, better adapting to the geometric characteristics of the target. The deformable large kernel convolutional attention module can further extract multi-scale contextual information based on SPPF, which is particularly important for identifying various small defects or extremely irregular defects on the steel surface. It also effectively enhances the model's perception of fine-grained and large-scale defects. Through the DLKA block, the model can not only effectively focus on potential defect areas in the image, but also suppress irrelevant background noise, further improving the accuracy and robustness of defect detection. In order to improve computational efficiency, the large kernel convolution is further split, and the original K×K convolution kernel is split into 1×K and K×1 continuous convolution operations. The split operation further reduces the computational complexity of the model.

5. The method for detecting lightweight steel surface defects in combination with phantom convolution according to claim 1, characterized in that: The GSCSP module includes a one-time aggregation strategy to design an efficient cross-stage partial network module, that is, the GSCSP module includes a GSconv module, which uses a shuffle operation to infiltrate the features generated by conventional convolution into each part of the features generated by depthwise separable convolution, so that the information from the conventional convolution is completely mixed into the output of the depthwise separable convolution. In this way, the texture features are highly similar to the texture features extracted by conventional convolution; The GSCSP module reduces the number of input channels through the first convolutional layer to reduce the computational complexity of subsequent convolutional layers. The GSconv module then performs a convolution operation on the reduced-dimensional feature map to extract features, and finally restores it to the output dimension through a convolutional layer for subsequent calculations.

6. The method for detecting lightweight steel surface defects in combination with phantom convolution according to claim 1, characterized in that: The data preprocessing of S2 includes at least the following steps: The Mosaic data augmentation method uses four images to perform random scaling and cropping and then shuffle them into a new image for operation. This is equivalent to increasing the batch size during training, which not only optimizes the training effect but also reduces the consumption of graphics card memory. After using Mosaic data augmentation, traversing each image is equivalent to traversing four images at the same time. The number of target defects also increases, and the positive and negative samples for network learning become richer.

7. The method for detecting lightweight steel surface defects in combination with phantom convolution according to claim 1, characterized in that: The loss functions in S3 are EIOU loss function and NWD loss function, which accelerate the convergence speed of the model and improve the performance of the model; Among them, L EIOU is the EIOU loss function; IOU is a standard intersection-over-union metric that measures the degree of overlap between the predicted box and the true box; ρ 2 (b,b g ) is the square of the center point distance between the predicted box and the real box, which measures the difference in their relative positions; w c and h c is the width and height of the prediction box; w g and h g is the width and height of the ground truth box; ρ 2 (w,w g ) and ρ 2 (h,h g ) measure the difference between the predicted box and the real box in width and height respectively; Among them, W2(N B ,N Bg ) is the Wasserstein-2 distance, which measures the distribution of the model prediction box N B and the ground-truth box distribution N Bg The difference between ;τ is a temperature parameter that controls the scaling of the loss; THE boa =λL Eiou +(1-λ)L NWD Among them, λ is the weight coefficient that controls the balance between the two losses.

Citation Information

Cited By

  • Steel surface defect detection method and device, computer equipment and storage medium

    CN120726028A