Steel wire rope flaw detection method based on YOLOv5 improved network

Through the wire rope flaw detection detection method based on YOLOv5, the problems of low detection efficiency, high cost and major influences of environmental factors in the prior art are solved, and real-time, accurate and robust flaw detection detection effects are achieved.

CN119850543APending Publication Date: 2025-04-18贵州装备制造职业学院
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411909063.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The existing wire rope flaw detection detection methods have problems such as low detection efficiency, high cost, and great influence from environmental factors.

Method used

The wire rope flaw detection detection method based on YOLOv5 improved network is adopted. By collecting wire rope images and pre-processing, it is input to the YOLOv5 network of attention mechanism for detection and positioning, and outputting defect position information and classification results.

Benefits of technology

Real-time and accurate wire rope flaw detection detection is achieved, with the advantages of high efficiency, low cost and robustness to environmental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850543A_ABST
    Figure CN119850543A_ABST
Patent Text Reader

Abstract

The invention discloses a steel wire rope flaw detection method based on a YOLOv5 improved network, and belongs to the technical field of steel wire rope flaw detection. Inputting the preprocessed steel wire rope image into a YOLOv5 network of an attention mechanism, and detecting and positioning defects on the steel wire rope through the YOLOv5 network of the attention mechanism; and outputting position information and classification results of the defects. The flaw detection condition of the steel wire rope can be accurately detected in real time through the deep learning network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wire rope flaw detection, and more particularly to a wire rope flaw detection method based on an improved YOLOv5 network. Background Art

[0002] Currently, wire rope flaw detection primarily relies on traditional physical testing methods, such as magnetic particle inspection and ultrasonic testing. However, these methods suffer from low efficiency, high cost, and significant susceptibility to environmental factors. In recent years, with the development of computer vision technology, deep learning-based object detection technology has been gradually applied to industrial inspection, providing new possibilities for improving wire rope flaw detection efficiency.

[0003] Therefore, how to provide a wire rope flaw detection method based on the improved YOLOv5 network is a problem that those skilled in the art urgently need to solve. Summary of the Invention

[0004] In view of this, the present invention provides a wire rope flaw detection method based on the improved YOLOv5 network, which can detect the wire rope flaw detection status in real time and accurately.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A wire rope flaw detection method based on an improved YOLOv5 network includes the following steps:

[0007] Collect wire rope images and perform preprocessing;

[0008] Inputting the preprocessed wire rope image into the YOLOv5 network with an attention mechanism, and detecting and locating defects on the wire rope through the YOLOv5 network with the attention mechanism;

[0009] Output defect location information and classification results.

[0010] Preferably, the YOLOv5 network of the attention mechanism includes a backbone network and a head network;

[0011] The backbone network includes the first convolutional layer, the second convolutional layer, the first C3 module, the third convolutional layer, the second C3 module, the fourth convolutional layer, the third C3 module, the fifth convolutional layer, the fourth C3 module, the SPPF module and the PSA module in sequence;

[0012] The head network includes the sixth convolutional layer, the first upsampling layer, the first splicing layer, the fifth C3 module, the seventh convolutional layer, the second upsampling layer, the second splicing layer, the sixth C3 module, the eighth convolutional layer, the third splicing layer, the seventh C3 module, the ninth convolutional layer, the fourth splicing layer and the eighth C3 module.

[0013] The second C3 module is connected to the second splicing layer, the third C3 module is connected to the first splicing layer, the PSA module is connected to the sixth convolutional layer, the sixth convolutional layer is connected to the fourth splicing layer, and the seventh convolutional layer is connected to the third splicing layer.

[0014] Preferably, the preprocessed wire rope image is input into a YOLOv5 network with an attention mechanism, and defects on the wire rope are detected and located by the YOLOv5 network with the attention mechanism, specifically including:

[0015] The wire rope image sequentially passes through the first convolutional layer, the second convolutional layer, the first C3 module, the third convolutional layer, and the second C3 module to output an initial feature map;

[0016] The initial feature map sequentially passes through the fourth convolutional layer, the third C3 module, the fifth convolutional layer, the fourth C3 module, the SPPF module and the PSA module to output an attention feature map;

[0017] The feature map output after the attention feature map passes through the sixth convolutional layer and the first upsampling layer in sequence, and the feature map output after the third C3 module are spliced ​​through the first splicing layer. After splicing, the feature map output after passing through the fifth C3 module, the seventh convolutional layer and the second upsampling layer in sequence and the initial feature map are spliced ​​through the second splicing layer. After splicing, the feature map output after passing through the sixth C3 module and the eighth convolutional layer and the feature map output after passing through the seventh convolutional layer are spliced ​​through the third splicing layer. Then, the feature map output through the seventh C3 module and the ninth convolutional layer and the feature map output through the sixth convolutional layer are spliced ​​through the fourth splicing layer. After splicing, the defect detection feature map is output through the eighth C3 module.

[0018] Preferably, the PSA module includes an SPC module, an SE module and a softmax function;

[0019] The input feature map is passed through the SPC module to obtain a spatial multi-scale feature map;

[0020] The spatial-level multi-scale feature map extracts multi-scale target features through the SE module to obtain a spatial-level visual attention vector feature map;

[0021] The spatial-level visual attention vector feature map is assigned a feature map weight vector by the softmax function;

[0022] The weight vector is element-wise multiplied with the spatial multi-scale feature map.

[0023] Preferably, the specific processing flow of the SPC module is:

[0024] The input feature map is divided into four branches, each of which undergoes different convolution and group convolution processing;

[0025] The outputs of the four branches are spliced ​​together.

[0026] Preferably, the SPPF module includes a tenth convolutional layer, the tenth convolutional layer is connected to three maximum pooling layers, the three maximum pooling layers and the tenth convolutional layer are spliced ​​and connected to a fifth splicing layer, and the fifth splicing layer is connected to an eleventh convolutional layer;

[0027] The input feature map passes through the tenth convolutional layer and the feature map output by the three maximum pooling layers, and the feature map output by the tenth convolutional layer is spliced ​​through the fifth splicing layer, and the spliced ​​feature map is then convolved through the eleventh convolutional layer.

[0028] Preferably, the C3 module includes a twelfth convolutional layer, the twelfth convolutional layer is respectively connected to a thirteenth convolutional layer and a Bottleneck layer, the thirteenth convolutional layer and the Bottleneck layer are spliced ​​and connected to a sixth splicing layer, and the sixth splicing layer is connected to a fourteenth convolutional layer;

[0029] The input feature map is spliced ​​through the feature map output by the twelfth convolutional layer and the Bottleneck layer, and the feature map output after processing by the twelfth convolutional layer and the thirteenth convolutional layer is spliced ​​through the sixth splicing layer, and the spliced ​​feature map is convolved through the fourteenth convolutional layer.

[0030] Preferably, the first convolutional layer to the fourteenth convolutional layer all include convolution, batch normalization and activation functions.

[0031] Preferably, the preprocessing specifically includes filtering and image enhancement.

[0032] It can be seen from the above technical solution that compared with the prior art, the present invention discloses a wire rope flaw detection method based on the improved YOLOv5 network, which has the following effects:

[0033] Real-time: Even in complex scenes, real-time detection can be achieved through YOLOv5.

[0034] Accuracy: The YOLOv5 series of models have high accuracy in object detection tasks and perform well in wire rope flaw detection.

[0035] Robustness: The YOLOv5 model is highly robust to factors such as illumination changes and background interference, which is very important for wire rope flaw detection because various interference factors may exist in the actual environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0037] Figure 1 This is a flow chart of a wire rope flaw detection method based on an improved YOLOv5 network provided by the present invention.

[0038] Figure 2 YOLOv5 network structure diagram of the attention mechanism provided by the present invention.

[0039] Figure 3 This is a structural diagram of the PSA module provided by the present invention.

[0040] Figure 4 This is a structural diagram of the SPC module provided by the present invention.

[0041] Figure 5 This is the SPPF module structure diagram provided by the present invention.

[0042] Figure 6 This is the structural diagram of the C3 module provided by the present invention. DETAILED DESCRIPTION

[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0044] The embodiment of the present invention discloses a wire rope flaw detection method based on an improved YOLOv5 network, such as Figure 1 As shown, including:

[0045] Collect wire rope images and perform preprocessing;

[0046] The preprocessed wire rope image is input into the YOLOv5 network with attention mechanism, and the defects on the wire rope are detected and located by the YOLOv5 network with attention mechanism.

[0047] Output defect location information and classification results.

[0048] Among them, preprocessing can include image scaling to adapt it to network input requirements;

[0049] Noise removal, using filtering technology to remove noise from images and improve image quality;

[0050] Image enhancement increases image diversity and improves model robustness through methods such as rotation and flipping.

[0051] In this embodiment, if Figure 2 As shown, the YOLOv5 network of the attention mechanism includes a backbone network and a head network;

[0052] The backbone network includes the first convolutional layer, the second convolutional layer, the first C3 module, the third convolutional layer, the second C3 module, the fourth convolutional layer, the third C3 module, the fifth convolutional layer, the fourth C3 module, the SPPF module and the PSA module in sequence;

[0053] The head network includes the sixth convolutional layer, the first upsampling layer, the first splicing layer, the fifth C3 module, the seventh convolutional layer, the second upsampling layer, the second splicing layer, the sixth C3 module, the eighth convolutional layer, the third splicing layer, the seventh C3 module, the ninth convolutional layer, the fourth splicing layer and the eighth C3 module.

[0054] The second C3 module is connected to the second splicing layer, the third C3 module is connected to the first splicing layer, the PSA module is connected to the sixth convolutional layer, the sixth convolutional layer is connected to the fourth splicing layer, and the seventh convolutional layer is connected to the third splicing layer.

[0055] The preprocessed wire rope image is input into the YOLOv5 network with attention mechanism. The YOLOv5 network with attention mechanism detects and locates defects on the wire rope, including:

[0056] The wire rope image sequentially passes through the first convolutional layer, the second convolutional layer, the first C3 module, the third convolutional layer, and the second C3 module to output the initial feature map;

[0057] The initial feature map passes through the fourth convolutional layer, the third C3 module, the fifth convolutional layer, the fourth C3 module, the SPPF module and the PSA module in sequence to output the attention feature map;

[0058] The feature map output after the attention feature map passes through the sixth convolutional layer and the first upsampling layer in sequence, and the feature map output after the third C3 module are spliced ​​together through the first splicing layer. After splicing, the feature map output after the fifth C3 module, the seventh convolutional layer and the second upsampling layer and the initial feature map are spliced ​​together through the second splicing layer. After splicing, the feature map output after the sixth C3 module and the eighth convolutional layer and the feature map output after the seventh convolutional layer are spliced ​​together through the third splicing layer. The feature map output after the seventh C3 module and the ninth convolutional layer and the feature map output after the sixth convolutional layer are spliced ​​together through the fourth splicing layer. After splicing, the defect detection feature map is output through the eighth C3 module.

[0059] This paper enhances feature representation through multi-scale feature fusion and an attention mechanism. It first extracts basic features through a convolutional layer, then restores the scale and fused features through upsampling and concatenation. Finally, it makes predictions through an attention mechanism and a detect layer. This design enables the network to process input images at different scales and focus on key areas within the image.

[0060] In this embodiment, if Figure 3 As shown in Figure 1, the PSA module (Pyramid Split Attention) includes the SPC module (Split and Concat), the SE module (SEWeight), and the softmax function.

[0061] The input feature map is passed through the SPC module to obtain a spatial multi-scale feature map. Specifically, the input data block is split into S sub-blocks in the width (W) direction, and each sub-block is processed independently. Finally, these processed sub-blocks are recombined to form the output data block.

[0062] The spatial multi-scale feature map is extracted through the SE module to obtain the spatial visual attention vector feature map. Specifically, feature statistics are extracted from the input data through global average pooling. A nonlinear activation function (such as ReLU and sigmoid) is then applied to generate a weight vector. These weights are used to adjust the channel importance in the original input data.

[0063] The spatial-level visual attention vector feature map is assigned a feature map weight vector through a softmax function; the softmax function is used to normalize the weight vector so that the sum of all elements is 1 and each element is in the range of [0,1], which helps ensure that the weight vector can be interpreted as a probability distribution.

[0064] The weight vector is element-wise multiplied with the spatial multi-scale feature map. The softmax-normalized weight vector is element-wise multiplied with the original input data to achieve channel attention.

[0065] This attention mechanism allows the model to focus on important channels. In wire rope flaw detection, this approach can help the network focus on important features and ignore irrelevant noise, thereby improving detection accuracy.

[0066] In this embodiment, if Figure 4 As shown, the specific processing flow of the SPC module is:

[0067] The input feature map is divided into four branches, each of which undergoes different convolution and group convolution processing;

[0068] The outputs of the four branches are spliced ​​together.

[0069] K0, K1, K2, and K3 are different convolution kernel parameters (can be 3, 5, 7, and 9, respectively). G0, G1, G2, and G3 are group convolution parameters (can be 1, 4, 8, and 16, respectively). Group convolution layers allow the network to operate in parallel on different channel subsets, reducing computational cost while increasing feature diversity. Overall, the model can be seen as using different convolution kernels to extract multi-scale target features and using the concat operation to combine multi-scale features from different receptive fields.

[0070] In this embodiment, if Figure 5 As shown, the SPPF module includes the tenth convolutional layer, the tenth convolutional layer is connected to three maximum pooling layers, the three maximum pooling layers and the tenth convolutional layer are spliced ​​and connected to the fifth splicing layer, and the fifth splicing layer is connected to the eleventh convolutional layer;

[0071] The input feature map passes through the tenth convolution layer and the feature map output by the three maximum pooling layers, and the feature map output by the tenth convolution layer is spliced ​​through the fifth splicing layer, and the spliced ​​feature map is then convolved through the eleventh convolution layer.

[0072] The present invention uses the SPPF module to first extract basic features through the tenth convolutional layer, then obtain features of different scales through the maximum pooling layer, and finally integrate these features through the eleventh convolutional layer to form the final feature representation. This design enables the network to better handle objects of different sizes and shapes.

[0073] In this embodiment, if Figure 6 As shown, the C3 module includes a twelfth convolutional layer, the twelfth convolutional layer is connected to the thirteenth convolutional layer and the Bottleneck layer respectively, the thirteenth convolutional layer and the Bottleneck layer are spliced ​​and connected to the sixth splicing layer, and the sixth splicing layer is connected to the fourteenth convolutional layer;

[0074] The input feature map is spliced ​​through the feature map output by the twelfth convolutional layer and the Bottleneck layer, and the feature map output after processing by the twelfth convolutional layer and the thirteenth convolutional layer is spliced ​​through the sixth splicing layer, and the spliced ​​feature map is convolved through the fourteenth convolutional layer.

[0075] The present invention performs a convolution operation on the twelfth convolutional layer and then passes it through a bottleneck layer to reduce the dimension of the input, so as to reduce the amount of calculation and memory requirements while maintaining a certain feature expression capability. The output of the bottleneck layer and the output of the thirteenth convolutional layer are spliced ​​together by the sixth splicing layer, which means that the outputs of these two layers will be spliced ​​together along the channel direction to form a new feature map, allowing the network to access the original uncompressed features and the compressed features at the same time, thereby increasing the learning and generalization capabilities of the network.

[0076] In this embodiment, the first to fourteenth convolutional layers all include convolution, batch normalization, and activation functions.

[0077] The present invention introduces the PSA module into the YOLOv5 network. This attention mechanism allows the model to focus on important channels. In wire rope flaw detection, this method can help the network focus on important features and ignore irrelevant noise, thereby improving detection accuracy.

[0078] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0079] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A wire rope flaw detection method based on the improved YOLOv5 network, characterized in that: The following steps are involved: Collect wire rope images and perform preprocessing; The preprocessed wire rope image is input into the YOLOv5 network with attention mechanism, and the defects on the wire rope are detected and located through the YOLOv5 network with attention mechanism; Output defect location information and classification results.

2. According to the method for flaw detection of steel wire rope based on the improved YOLOv5 network of claim 1, it is characterized in that: The YOLOv5 network with attention mechanism includes backbone network and head network; The backbone network includes the first convolution layer, the second convolution layer, the first C3 module, the third convolution layer, the second C3 module, the fourth convolution layer, the third C3 module, the fifth convolution layer, the fourth C3 module, the SPPF module and the PSA module in sequence; The head network includes the sixth convolutional layer, the first upsampling layer, the first splicing layer, the fifth C3 module, the seventh convolutional layer, the second upsampling layer, the second splicing layer, the sixth C3 module, the eighth convolutional layer, the third splicing layer, the seventh C3 module, the ninth convolutional layer, the fourth splicing layer and the eighth C3 module in sequence; The second C3 module is connected to the second splicing layer, the third C3 module is connected to the first splicing layer, the PSA module is connected to the sixth convolutional layer, the sixth convolutional layer is connected to the fourth splicing layer, and the seventh convolutional layer is connected to the third splicing layer.

3. According to claim 2, a wire rope flaw detection method based on the improved YOLOv5 network is characterized in that: The preprocessed wire rope image is input into the YOLOv5 network with attention mechanism, and the defects on the wire rope are detected and located by the YOLOv5 network with attention mechanism, specifically including: The wire rope image sequentially passes through the first convolution layer, the second convolution layer, the first C3 module, the third convolution layer and the second C3 module to output an initial feature map; The initial feature map sequentially passes through the fourth convolutional layer, the third C3 module, the fifth convolutional layer, the fourth C3 module, the SPPF module and the PSA module to output an attention feature map; The feature map output after the attention feature map passes through the sixth convolution layer and the first upsampling layer in sequence and the feature map output after the third C3 module are spliced ​​through the first splicing layer. After splicing, the feature map output after passing through the fifth C3 module, the seventh convolution layer and the second upsampling layer in sequence and the initial feature map are spliced ​​through the second splicing layer. After splicing, the feature map output after passing through the sixth C3 module and the eighth convolution layer and the feature map output after passing through the seventh convolution layer are spliced ​​through the third splicing layer, and then the feature map output through the seventh C3 module and the ninth convolution layer and the feature map output through the sixth convolution layer are spliced ​​through the fourth splicing layer. After splicing, the defect detection feature map is output through the eighth C3 module.

4. A wire rope flaw detection method based on the YOLOv5 improved network according to claim 3, characterized in that: The PSA module includes an SPC module, a SE module and a softmax function; The input feature map is passed through the SPC module to obtain a spatial multi-scale feature map; The spatial-level multi-scale feature map extracts multi-scale target features through the SE module to obtain a spatial-level visual attention vector feature map; The spatial level visual attention vector feature map is assigned a feature map weight vector by the softmax function; The weight vector is element-wise multiplied with the spatial multi-scale feature map.

5. A wire rope flaw detection method based on the YOLOv5 improved network according to claim 4, characterized in that: The specific processing flow of the SPC module is as follows: The input feature map is divided into four branches, each of which undergoes different convolution and group convolution processing; Concatenate the outputs of the four branches.

6. A wire rope flaw detection method based on the improved YOLOv5 network according to claim 5, characterized in that: The SPPF module includes a tenth convolutional layer, the tenth convolutional layer is connected to three maximum pooling layers, the three maximum pooling layers and the tenth convolutional layer are spliced ​​and connected to a fifth splicing layer, and the fifth splicing layer is connected to an eleventh convolutional layer; The input feature map passes through the tenth convolution layer and the feature maps output by the three maximum pooling layers, and the feature map output by the tenth convolution layer is spliced ​​through the fifth splicing layer, and the spliced ​​feature map is then convolved through the eleventh convolution layer.

7. A wire rope flaw detection method based on the improved YOLOv5 network according to claim 6, characterized in that: The C3 module includes a twelfth convolutional layer, the twelfth convolutional layer is respectively connected to a thirteenth convolutional layer and a Bottleneck layer, the thirteenth convolutional layer and the Bottleneck layer are spliced ​​and connected to a sixth splicing layer, and the sixth splicing layer is connected to a fourteenth convolutional layer; The feature map output by the twelfth convolutional layer and the Bottleneck layer and the feature map output after being processed by the twelfth convolutional layer and the thirteenth convolutional layer are spliced ​​through the sixth splicing layer, and the spliced ​​feature map is convolved through the fourteenth convolutional layer.

8. A wire rope flaw detection method based on the improved YOLOv5 network according to claim 7, characterized in that: The first convolutional layer to the fourteenth convolutional layer all include convolution, batch normalization and activation functions.

9. The wire rope flaw detection method based on the YOLOv5 improved network according to claim 1 is characterized in that: Preprocessing specifically includes filtering and image enhancement.

Citation Information

Cited By

  • Steel wire rope defect detection method, steel wire rope defect detection device, medium and equipment

    CN121033003A