A wall-climbing robot metal work surface defect detection method based on improved YOLOv7

By improving the loss function of the YOLOv7 network and adding the DY-Block attention module detection head, the problem of low defect detection accuracy in metal facade images is solved, achieving high-precision and fast metal defect detection, which is suitable for automatic detection of wall-climbing robots.

CN116758035BActive Publication Date: 2026-02-03HEBEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310724385.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2026-02-03
Estimated Expiration
2043-06-19

AI Technical Summary

Technical Problem

The existing YOLOv7 target detection algorithm has low accuracy in detecting defects in metal facade images and the target position is not prominent enough, which cannot meet the requirements of real-time performance and accuracy.

Method used

An improved YOLOv7 network was adopted, which changed the loss function from CIou to Focal-EIoU and added the attention module DY-Block detection head and decoupling head to enhance the utilization of feature maps and the decoupling of output tasks. The metal defect model was trained and loaded onto the mobile device Jetson Nano for real-time detection.

Benefits of technology

It improves the accuracy and speed of metal surface defect detection, with short training time, high recognition accuracy, and strong generalization ability, meeting the accuracy and speed requirements of metal surface defect detection and reducing the risks of manual inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116758035B_ABST
    Figure CN116758035B_ABST
Patent Text Reader

Abstract

The application discloses a wall-climbing robot metal work surface defect detection method based on an improved YOLOv7, and the detection method comprises the following contents: collecting and constructing a metal defect data set; building an improved YOLOv7 network: taking a YOLOv7 model as a basic skeleton, changing a loss function of the YOLOv7 model from CIou to Focal-EIoU, and adding an attention module DY-Block detection head, decoupling output tasks by using a decoupling head, and obtaining the improved YOLOv7 network; and training the improved YOLOv7 network by using the metal defect data set to obtain a metal work surface defect model, which is used for metal defect position identification and positioning. The application has the advantages of short training time, high identification accuracy, fast reasoning speed, strong generalization ability and excellent comprehensive performance, and can meet the dual requirements of precision and speed of metal surface defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of metal working surface defect detection technology, specifically to a method for detecting metal working surface defects using a wall-climbing robot based on an improved YOLOv7. Background Technology

[0002] Wall-climbing robots are an important part of the future development of China's intelligent technology industry, capable of replacing humans in metal facade maintenance work in harsh environments. In the petrochemical industry, they are used for the regular inspection of tanks or pipelines for cracks, corrosion, failures, and welding defects, as well as for the cleaning and painting of ship hulls. The safety of large pressure vessels such as oil storage tanks relies on regular inspections. Regular inspections are crucial for ensuring the integrity and operational safety of such high-value equipment and are essential for protecting industry safety. However, before inspection, scaffolding needs to be erected inside and outside the tank, requiring inspectors to stand on the scaffolding and use handheld inspection equipment. This process is highly dangerous and time-consuming, thus urgently requiring an automated metal defect inspection method to reduce labor costs and operational hazards.

[0003] Early deep learning-based object detection algorithms, such as Fast R-CNN and Faster R-CNN, employed a two-stage process of generating candidate boxes and refining their positions. This resulted in higher accuracy than end-to-end single-stage methods like YOLO and SSD. However, these two-stage methods suffer from high parameter counts and poor real-time performance, making them unsuitable for defect detection. In recent years, researchers have continuously optimized the single-stage YOLO series of algorithms. The latest YOLOv7 algorithm now boasts higher accuracy than two-stage object detection algorithms, achieving a good balance between speed and accuracy. Its performance advantage over other versions of the detection model is significant.

[0004] However, the head network of the original YOLOv7 object detection algorithm does not make full use of the information in each dimension of the feature map, and the recognition accuracy is affected by factors such as target size and illumination, which cannot guarantee the accuracy and recall requirements of detection.

[0005] In summary, how to avoid the problems of low defect detection accuracy and insufficient target prominence in metal facade images remains a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] The purpose of this invention is to provide a method for detecting defects on the metal working surface of a wall-climbing robot based on an improved YOLOv7. This method has a short training time, high recognition accuracy, fast inference speed, and strong generalization ability, and can meet the accuracy and speed requirements for metal surface defect detection.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0008] In a first aspect, the present invention provides a method for detecting defects on the metal working surface of a wall-climbing robot based on an improved YOLOv7, characterized in that the detection method includes the following:

[0009] Collect and construct a metal defect dataset;

[0010] Build an improved YOLOv7 network: Using the YOLOv7 model as the basic skeleton, change the loss function of the YOLOv7 model from CIou to Focal-EIoU, add the attention module DY-Block detection head, and use the decoupling head to decouple the output task to obtain the improved YOLOv7 network.

[0011] An improved YOLOv7 network was trained using a metal defect dataset to obtain a metal working surface defect model, which was used for metal defect identification and localization.

[0012] Furthermore, the improved YOLOv7 network head network includes an attention module DY-Block detection head and a decoupling head. The attention module DY-Block detection head includes six DY-Block modules stacked in series. The first DY-Block module takes the feature maps output by the three RepConv modules in the YOLOv7 model as input. The output of the attention module DY-Block detection head is connected to the decoupling head. The decoupling head uses three convolutional branches with the same structure. Each convolutional branch includes a 1*1 convolutional layer and a 3*3 convolutional layer. First, a 1*1 convolutional layer is connected to two parallel 3*3 convolutional layers. Then, a 3*3 convolutional layer outputs Obj after passing through a 1*1 convolutional layer. Another 3*3 convolutional layer outputs Reg and Cls after passing through two parallel 1*1 convolutional layers.

[0013] Where Obj indicates whether the detection box contains a target or background, Cls represents the classification confidence of 8 target classes, and Reg represents the 4 corner points of the anchor.

[0014] The eight target categories include eight types of defects: scratches, pitting, patches, cracks, rolled oxide scale, inclusions, fissures, and rust.

[0015] Furthermore, the metal working surface defect model is loaded onto the Jetson Nano mobile device. The Jetson Nano mobile device is an embedded development board based on a GPU processor, running the Ubuntu 18.04LTS system, and includes a GPU runtime environment and corresponding calling interfaces. It can call the camera to acquire external images in real time and load them into the metal working surface defect model, and output the detection results in real time.

[0016] The DY-Block module includes feature hierarchy, spatial location, scale perception, spatial perception, and task perception components between output channels.

[0017] The penalty term expression for Focal EIoU is:

[0018]

[0019] Where IOU represents the intersection-union ratio of the predicted bounding box and the ground truth bounding box, γ is a parameter controlling the degree of outlier suppression, and b, b gt Let C represent the center points of the predicted bounding box and the ground truth bounding box, respectively. Let ρ represent the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. w C h Let ω and ω' represent the width and height of the rectangle where the ground truth bounding box and the predicted bounding box intersect, respectively. gt ,h,h gt L represents the width and height of the ground truth bounding box and the predicted bounding box, respectively; Focal-EIoU The Focal EIoU loss function.

[0020] The model accuracy of the metal working surface defect model shall not be less than 80%, and the speed shall not be less than 60 FPS.

[0021] Secondly, the present invention provides a mobile device, the mobile device including a processor, the processor executing the above-described detection method.

[0022] Compared with the prior art, the beneficial effects of the present invention are:

[0023] This invention presents a method for detecting metal surface defects on wall-climbing robots based on an improved YOLOv7 algorithm. The improved YOLOv7 algorithm is used to train the model. An attention module (DY-Block) is added to the YOLOv7 model, the CioU loss function is replaced with Focal EioU, and a decoupling head is added to decouple the classification and regression tasks in the output head. The acquired target images are input into the metal surface defect model, which is then embedded into a Jetson Nano mobile device for real-time detection and feedback of the metal defect category and location bounding box in the target image. This invention features short training time, high recognition accuracy, fast inference speed, and strong generalization ability, exhibiting excellent overall performance and meeting the dual requirements of accuracy and speed in metal surface defect detection.

[0024] This invention addresses the issue of YOLOv7's head network not fully utilizing multi-dimensional features. It redesigns the YOLOv7 head network by integrating the DY-Block module, a decoupling head, and a loss function. It performs cascaded attention calculations on three types of information—different scales, tasks, and spatial locations—from the extracted features, enhancing important features across different dimensions and suppressing redundant features. The decoupling head decouples the high-dimensional output features of DY-Block, decoupling them into three low-dimensional features used for background discrimination, confidence output, and location regression, respectively. This improves the inference speed during the model's detection phase, thereby increasing accuracy, reducing training overhead, and ensuring real-time performance. To improve the final training quality and further avoid the influence of low-quality samples in the network's sample collection on the final training results, a Focal-Eiou loss function is used. This focuses the regression process on high-quality anchor boxes, reducing the impact of low-quality samples on the loss value during backpropagation. The improved YOLOv7 network achieves a 6% improvement in accuracy (mAP) compared to the original YOLOv7 model, and a speed of up to 60.83 FPS, meeting real-time requirements. At the same time, the training convergence speed is nearly doubled compared to the original YOLOv7.

[0025] This invention embeds a trained and improved YOLOv7 network into a Jetson Nano mobile device. This mobile device has the advantages of small size and light weight, and can be loaded into a wall-climbing robot to complete automatic inspection tasks. It effectively reduces the uncertainty caused by manual inspection and improves the accuracy of defect detection, providing assistance for subsequent post-processing operations such as grinding and painting of defective areas, and has strong practicality.

[0026] This invention considers the intra-layer features of the spatial domain and the channel domain, enabling the detection of defects in corner regions. At the same time, it utilizes data augmentation processing for training, effectively avoiding the influence of natural factors such as lighting, improving the algorithm's adaptability under various conditions, and exhibiting high robustness. Attached Figure Description

[0027] Figure 1 This is a flowchart of the defect detection method for metal working surfaces of a wall-climbing robot based on the improved YOLOv7 of this invention.

[0028] Figure 2 This is a schematic diagram of the internal attention mechanism of the Dy-Block module (dynamic attention module).

[0029] Figure 3 This is a schematic diagram of the head network structure in this invention.

[0030] Figure 4 This diagram illustrates the trends of training and validation loss and validation accuracy during network training.

[0031] Figure 5A schematic diagram of the structure of the improved YOLOv7 network.

[0032] Figure 6 The diagram shows the results of metal defect detection tests. Figure (a) shows the recognition effect of a single type of defect target, and Figure (b) shows the recognition effect of multiple types of defect targets.

[0033] Figure 7 This is a comparison chart of the accuracy and convergence speed of the improved YOLOv7 network and the original YOLOv7 network during the network training phase. Detailed Implementation

[0034] The present invention will be further explained below with reference to the embodiments and accompanying drawings, but this is not intended to limit the scope of protection of this application.

[0035] Figure 1 This invention provides a flowchart of a defect detection method for a wall-climbing robot working surface based on an improved YOLOv7. It mainly includes:

[0036] 1) The camera captures the images to be inspected to achieve data acquisition. The acquired images include three types of metal working surface defect images: cracks, corrosion, and rolling chips. These images are integrated with the NEU dataset, and the images are labeled with defects to construct a metal working surface defect dataset.

[0037] 2) Image preprocessing: The labeled images are divided into training set, validation set and test set in a ratio of 8:1:1. The images in the training set are augmented by geometric cropping, brightness transformation and noise addition to obtain the augmented training set, which enhances the generalization and robustness of the model.

[0038] 3) Building an improved YOLOv7 network: Using the YOLOv7 model as the basic skeleton, the loss function of the YOLOv7 model is changed from CIou to Focal-EIoU, and an attention module DY-Block detection head is added. The output task is decoupled using a decoupling head to obtain an improved YOLOv7 network.

[0039] 4) Train and save the optimal model: Train the improved YOLOv7 network using the enhanced training set, and verify the effect using the validation set. Save the set of parameters with the highest verification accuracy as the optimal model, and use it as the final metal working surface defect model.

[0040] 5) Defect detection: After the images of the metal working surface defects to be detected in the test set are filtered and denoised in the host computer, they are input into the metal working surface defect model. The target category and location detection box are output to obtain the result image containing the defect category, confidence level and defect location.

[0041] 6) Model Deployment: Load the metal working surface defect model into the Jetson Nano mobile device to realize the automatic detection function on the mobile device.

[0042] Figure 2 This is a schematic diagram of the internal attention mechanism of the DY-Block module, π. S For the spatial location-level attention calculation process, the 2D offset of the sampling points in the convolution kernel is learned through 3*3 deformable convolution. The 2D offset is added to the feature map after the convolution is activated by the Sigmoid activation function to obtain the feature map after the deformable convolution, which indirectly obtains the attention weight parameters at the spatial location. The output feature map is used as the input of the scale-aware attention calculation module.

[0043] π L The calculation process for attention at the feature level is as follows: First, the channels and spatial dimensions are normalized by an average pooling layer. Then, a linear transformation is performed by a 1*1 convolution to learn the attention weight parameters corresponding to different feature layers. The degree of non-linearity is increased by LeakyReLU and hard-sigmoid activation functions to facilitate backpropagation. Finally, the feature map output by the scale-aware attention calculation module is used as the input of the task-aware attention calculation module.

[0044] π c For the task-level attention computation process, firstly, flat pooling is performed on different scales and spatial dimensions, and then attention weight parameters for each channel are learned through fully connected layers, LeakyReLU activation function, fully connected layers, and normalization layers. Finally, a feature map with three-dimensional attention weight parameters of scale-aware attention, spatial-aware attention, and task-aware attention is output.

[0045] Figure 3 This is a schematic diagram of the head network structure in this invention. The head network includes an attention module (DY-Block detection head) and a decoupling head. The three branches are: Obj (representing whether the detection box contains a target or background), Cls (representing the classification confidence of eight target categories: scratches, pitting, patches, cracks, rolled oxide scale, inclusions, fissures, and rust), and Reg (representing the four corner points of the anchor). The original YOLOv7 model's three detection heads output 28*28*39, 14*14*39, and 7*7*39 respectively, exhibiting high dimensionality and a large number of parameters, with information in a coupled state. Taking the first detection head as an example, the 28*28*39 output is decoupled into 28*28*1, 28*28*4, and 28*28*8 through the three branches. This not only reduces the number of parameters at the output end but also extracts the target position and category information, thereby improving detection accuracy.

[0046] Example 1

[0047] This embodiment is based on an improved YOLOv7 method for detecting defects on the metal working surface of a wall-climbing robot, and includes the following steps:

[0048] 1. Data Acquisition: Images of metal facade defects are acquired using image acquisition equipment as the data to be processed. These defects include three types: cracks, corrosion, and rolling mill chips. Data formats include images and videos. Image data is used to divide the network into training, validation, and test sets. The training and validation sets are used to train and validate the network parameters, while the test set is used to calculate the model's accuracy. Video data is used to test the network's generalization ability; however, video data simulates real-time effects and is not included in the accuracy calculation.

[0049] 2. Dataset Construction and Augmentation: The collected data was integrated with the NEU dataset, which was released by Northeastern University in 2011 and includes six types of metal defects: scratches, pitting, patches, cracks, rolling scale, and inclusions. The images were labeled in YOLO format using Labelimg software to complete the construction of the metal defect dataset. The labeled images were then divided into training, validation, and test sets in an 8:1:1 ratio. Taking into account the robot's operating environment, simulating the work site, and noise interference, the images in the training set were augmented through geometric cropping, brightness transformation, and noise addition.

[0050] 3. Construct an improved YOLOv7 network, such as... Figure 5 As shown, the DY-Block attention module is integrated into the head network of the YOLOv7 model. The first DY-Block module takes the feature maps output from layers 102, 103, and 104 (i.e., the three RepConv modules) of the YOLOv7 model as input, and performs spatial-aware attention, scale-aware attention, and task-aware attention operations sequentially on each independent dimension of the feature maps output by the three RepConv modules. The six DY-Block modules are concatenated and stacked in sequence, repeating the above attention operations six times to accurately obtain the task attention weights of each feature map. The generalized dynamic attention in each DY-Block module can be described as follows:

[0051] W(F) = π c (π s (π L (F)·F)·F)·F

[0052] In the formula: F∈R L×S×c π represents the feature tensor output by the three RepConv modules. S, π L , π c , representing spatial awareness attention, scale awareness attention, and task awareness attention, respectively.

[0053] like Figure 2 As shown, the spatial awareness attention π is calculated in the DY-Block module. S The first stage uses variable convolution to learn sparsity. It learns the 2D offset of the sampling points in the convolution kernel through 3*3 deformable convolution to obtain the attention weight parameters in the spatial location. Then, it aggregates features across lelves in a unified spatial location.

[0054] Scale perception attention π L In this stage, we first use AdaptiveAvgPool2d to perform global average pooling in the channel and spatial dimensions, then use 1*1 convolution to complete the linearization operation in the channel dimension, learn the attention weight parameters corresponding to different feature layers, and finally increase the degree of nonlinearity through LeakyRelu and hard-sigmoid activation functions to facilitate backward gradient update.

[0055] Task-aware attention π C The stage first performs global pooling along the L*S dimension, then outputs using two fully connected layers and one normalization layer. The scale-aware attention, spatial-aware attention, and task-aware attention expressions can be described as follows:

[0056]

[0057]

[0058] π C (F)·F=max(α 1 (F)·F c +β 1 (F), α 2 (F)·F c +β 2 (F))

[0059] In the formula: F∈R L×S×C Let L represent the feature tensors output by the three RepConv modules, where L represents the feature level dimension, S represents the spatial position dimension, and C represents the output channel dimension. S , π L , π C Let represent spatial awareness attention, scale awareness attention, and task awareness attention, respectively; σ be the hard-sigmoid function; f(·) denote the linear transformation; K be the number of coefficient sampling locations; and p k +Δp kTo offset the position and focus on the region of favorable discrimination, Δm k For position p k The learnable importance metric. [α] 1 ,β 1 α 2 ,β 2 ] is a hyperfunction used to learn and control the activation threshold, F c This represents the features in the channel dimension.

[0060] 4. Focal EIoU is used instead of CIoU as the new loss function, where the expression for the penalty term of EIoU is:

[0061]

[0062] Where IOU represents the intersection-union ratio between the predicted bounding box and the ground truth bounding box, and 1-IOU represents the overlap loss. Indicates the center distance loss. Indicates width and height loss, b, b gt Let C represent the center points of the predicted bounding box and the ground truth bounding box, respectively. Let ρ represent the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. w C h Let ω represent the width and height of the rectangle where the ground truth bounding box and the predicted bounding box intersect, respectively. gt ,h,h gt These represent the width and height of the ground truth bounding box and the predicted bounding box, respectively.

[0063] Adding IOU with Focal Loss γ The weighted expression remeasures the EIOU to form the Focal EIOU, which is expressed as follows:

[0064]

[0065] Where γ is a parameter controlling the degree of outlier suppression, and IOU γ The weight expression indicates that the higher the intersection-union ratio (IUU) between the predicted and ground truth boxes, the higher the loss. This allows the network to focus more on high-quality anchor boxes during convergence, solving the problem of uneven sample quality and accelerating model convergence.

[0066] A decoupling header structure was reimplanted for YOLOv7, such as Figure 3 As shown, the decoupling head takes the output of the DY-Block attention module detection head as input and uses three convolutional branches to process the feature map. The three convolutional branches have the same structure, including a 1*1 convolutional layer and a 3*3 convolutional layer. One 1*1 convolutional layer is connected to two parallel 3*3 convolutional layers. One 3*3 convolutional layer outputs Obj after passing through a 1*1 convolutional layer. The other 3*3 convolutional layer outputs Reg and Cls after passing through two parallel 1*1 convolutional layers.

[0067] The three convolutional branches decouple the classification and regression tasks in the output head. Here, Obj indicates whether the detection box contains an object or background, Cls represents the classification confidence for eight object classes, and Reg represents the four corner points of the anchor, indicating the location of the detection box in the image. This decoupling head balances the representational power of relevant operators with the computational overhead of hardware, reducing the number of parameters and computational complexity while maintaining accuracy. Furthermore, this lightweight decoupling head alleviates the additional latency overhead caused by convolutional operations compared to other decoupling heads.

[0068] 5. Model Training: The model training optimizes the neural network parameters through forward and backward propagation. Backpropagation calculates the gradient of the loss function with respect to each parameter using the chain rule of derivatives, and updates the parameters according to gradient descent, thereby completing the optimization of the network model. Specifically, an improved YOLOv7 model is built using the PyTorch framework. The image input size is set to 224*224, and the initial hyperparameters are set as follows: 300 training iterations (epochs), a learning rate of 0.001, which decays to 0.1 times the original value every 200 epochs to facilitate faster model convergence and stabilize the loss value after multiple iterations. After each training epoch, the network automatically loads a validation set to verify network accuracy and outputs the model's mAP after each training iteration. After 300 epochs, the network automatically saves the set of parameters with the highest mAP as the final training result. The model training loss descent process and the validation accuracy increase are described below. Figure 4 As shown. Figure 4 This is a graph showing the changing trends of training loss, validation loss, and validation accuracy in each iteration (epoch) during the training process of the improved YOLOv7 network in this invention. As can be seen from the graph, the network loss decreases steadily, while the accuracy increases steadily with the number of training iterations and eventually converges.

[0069] 6. Model testing: Input the image or video to be detected into the trained improved YOLOv7 network (i.e., the metal working surface defect model) for testing and recognition, and finally obtain the metal defect category and location.

[0070] 7. Load the metal surface defect model onto the Jetson Nano mobile device. This mobile device is an embedded development board based on a GPU processor, running Ubuntu 18.04LTS, and includes a GPU runtime environment such as OpenGL and OpenCV, along with corresponding APIs. It can use a camera to capture external images in real time and load them into the metal surface defect model, outputting the detection results in real time. Figure 6The diagram shows the results of metal defect detection test on the metal working surface. (a) shows the recognition effect of a single type of defect target, and (b) shows the recognition effect of a multi-type defect target, which includes the category information of the detected target, confidence score, and detection box position, such as rolled-in scale, inclusion, and scratches.

[0071] Table 1 shows the ablation experiment results for different models. As can be seen from the figure, using Focal EIoU (Improve1), DY-Block (Improve2), and the decoupling head (Improve3) alone for model optimization did not significantly improve the model's test accuracy. While Improve4, using both Focal EIoU and DY-Block, improved the model accuracy by 3.6%, the computational cost was too high, reducing the model inference speed by 55.15%. By fusing the three improvements and redesigning the YOLOv7 head network structure, the model accuracy improved by 6.0%, while the speed remained at 60.83 FPS, meeting real-time requirements.

[0072] Table 1. Model Improvement Ablation Experiments

[0073]

[0074] Depend on Figure 7 It can be seen that the original YOLOv7 requires 200 training iterations to converge, and the validation accuracy curve oscillates wildly during training, indicating poor training stability. In contrast, the improved YOLOv7 network (Improve5) in this application achieves smoother validation accuracy fluctuations and convergence after only 100 training iterations, with a convergence speed nearly doubled. Furthermore, the curve fluctuates less during training, demonstrating better model optimization stability.

[0075] The experimental data above shows that the improved YOLOv7 network proposed in this application creatively integrates the DY-Block module, decoupling head, and loss function to achieve target defect detection in metal working surface scenarios of wall-climbing robots. While ensuring the real-time requirements of the detection algorithm, it improves the detection accuracy (mAP) of defects while maintaining real-time performance (FPS). The detection accuracy mAP reaches over 80%, and the speed can reach over 60.83 FPS.

[0076] Any aspects not covered in this invention are applicable to existing technologies.

Claims

1. A method for detecting defects on the metal working surface of a wall-climbing robot based on an improved YOLOv7, characterized in that, The detection method includes the following: Collect and construct a metal defect dataset; Build an improved YOLOv7 network: Using the YOLOv7 model as the basic skeleton, change the loss function of the YOLOv7 model from CIou to Focal-EIoU, add the attention module DY-Block detection head, and use the decoupling head to decouple the output task to obtain the improved YOLOv7 network. An improved YOLOv7 network was trained using a metal defect dataset to obtain a metal working surface defect model for metal defect identification and localization. The attention module DY-Block detection head includes six DY-Block modules that are sequentially connected in series. The first DY-Block module takes the feature maps output by the three RepConv modules in the YOLOv7 model as input, and the output of the attention module DY-Block detection head is connected to the decoupling head.

2. The detection method according to claim 1, characterized in that, The improved YOLOv7 network head network includes an attention module DY-Block detection head and a decoupling head. The decoupling head uses three structurally identical convolutional branches. Each convolutional branch includes a 1*1 convolutional layer and a 3*3 convolutional layer. First, a 1*1 convolutional layer is connected to two parallel 3*3 convolutional layers. Then, a 3*3 convolutional layer outputs Obj after passing through a 1*1 convolutional layer. Another 3*3 convolutional layer outputs Reg and Cls after passing through two parallel 1*1 convolutional layers. Where Obj indicates whether the detection box contains a target or background, Cls represents the classification confidence of 8 target classes, and Reg represents the 4 corner points of the anchor.

3. The detection method according to claim 2, characterized in that, The eight target categories include eight types of defects: scratches, pitting, patches, cracks, rolled oxide scale, inclusions, fissures, and rust.

4. The detection method according to claim 1, characterized in that, The metal working surface defect model is loaded onto the Jetson Nano mobile device. The Jetson Nano mobile device is an embedded development board based on a GPU processor, running the Ubuntu 18.04LTS system. It also includes a GPU runtime environment and corresponding calling interfaces, which can call the camera to acquire external images in real time and load them into the metal working surface defect model, and output the detection results in real time.

5. The detection method according to claim 2, characterized in that, The DY-Block module includes feature hierarchy, spatial location, scale perception, spatial perception, and task perception components between output channels.

6. The detection method according to claim 1, characterized in that, The expression for the penalty term of Focal-EIoU is: Where IOU represents the intersection-union ratio of the predicted bounding box and the ground truth bounding box, γ is a parameter controlling the degree of outlier suppression, and b,b gt Let C represent the center points of the predicted bounding box and the ground truth bounding box, respectively. Let ρ represent the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. w C h Let represent the width and height of the rectangle where the ground truth bounding box and the predicted bounding box intersect, respectively, and ω and h represent the width and height of the predicted bounding box, respectively. gt ,h gt L represents the width and height of the actual bounding box, respectively; Focal-EIoU The Focal-EIoU loss function.

7. The detection method according to claim 1, characterized in that, The model accuracy of the metal working surface defect model shall not be less than 80%, and the speed shall not be less than 60 FPS.

8. A mobile terminal device, characterized in that, The mobile device includes a processor that executes the detection method according to any one of claims 1-7.

Citation Information

Patent Citations

  • YOLOv4 target detection method based on Focal-EIOU

    CN114548269A

  • Transformer substation personnel safety helmet wearing detection method and system

    CN114998830A