Method for detecting electro-corrosion of ADSS (all dielectric self-supporting) optical cable based on improved YOLOv5

By improving the YOLOv5 neural network model, introducing the ECA attention mechanism and the BiFPN weighted bidirectional feature pyramid network, the problem of low accuracy in ADSS optical cable electrical corrosion detection is solved, and real-time and efficient electrical corrosion detection is achieved.

CN120689259APending Publication Date: 2025-09-23STATE GRID JIANGSU ELECTRIC POWER CO LTD NANJING POWER SUPPLY COMPANY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410320116.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-20
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the existing technology, the accuracy of ADSS optical cable electrical corrosion detection is not high, and the early electrical corrosion characteristics are not obvious, resulting in missed detection or false detection, which affects the detection results.

Method used

An improved YOLOv5 neural network model is adopted, the ECA attention mechanism and BiFPN weighted bidirectional feature pyramid network are introduced, the loss function is modified to EIOU, and data enhancement technology is combined to improve the accuracy of electrical corrosion detection.

Benefits of technology

It realizes real-time and high-precision detection of ADSS optical cable electrical corrosion, reduces manual inspection costs, expands the detection range and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689259A_ABST
    Figure CN120689259A_ABST
Patent Text Reader

Abstract

The invention relates to an improved YOLOv5-based ADSS optical cable electro-corrosion detection method. The method comprises the steps of establishing an electro-corrosion data set, establishing and improving a YOLOv5 neural network model, training the neural network model, putting the neural network model into actual detection and the like. According to the improved YOLOv5-based ADSS optical cable electro-corrosion detection method provided by the invention, an attention mechanism is introduced according to the idea of YOLOv5 to reduce the attention on irrelevant information and improve the electro-corrosion detection; the recognition of irregular shapes in the electrocorrosion phenomenon is improved by changing a loss function; a weighted directional pyramid network is adopted to replace an original feature fusion network for bidirectional flow, a high layer and a shallow layer are fully fused, the feature fusion capability of the network for a to-be-detected target is improved to a large extent, and therefore the detection precision of the network is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention and a method for detecting electrical corrosion of an ADSS optical cable based on an improved YOLOv5 belong to the technical field of computer vision. Background Art

[0002] Over the past decade, grid operators have extensively used ADSS optical cables in newly constructed power and telecommunications networks, providing strong support for grid operations. However, ADSS cables are often used attached to high-voltage lines, exposing them to induced electric fields and posing safety risks. Statistical analysis of cable failures revealed that while the outer sheath of ADSS cables possesses a degree of resistance to electrical corrosion, environmental constraints prevent the cables from being installed parallel to high-voltage transmission lines on the same towers, preventing an infinite distance between them. As ADSS cables age, electrical traces accumulate, rainwater and contaminants accumulate, and local discharge (PD) can easily cause the outer sheath to heat, deform, and become damaged. This accelerated corrosion process is the primary cause of cable breakages.

[0003] Currently, visual inspection is rarely used for electrical corrosion detection in ADSS optical cable monitoring. Therefore, installing cameras in optical cable channels to monitor the cables in real time is crucial for preventing cable breakage and reducing inspection costs. However, in the early stages of electrical corrosion, its characteristics are less obvious, and the corrosion on the cable becomes blurred. This can lead to missed or incorrect detections by the corrosion detection algorithm, affecting the inspection results. Summary of the Invention

[0004] In order to overcome the problems in the prior art, and to address the problems that electrical corrosion on ADSS cables is difficult to monitor and the original YOLOv5 algorithm has low accuracy in detecting electrical corrosion of optical cables, the present invention provides a method for detecting electrical corrosion of optical cables based on an improved YOLOv5, which is used to perform real-time detection of whether electrical corrosion exists on ADSS optical cables.

[0005] In order to solve the above technical problems, the first technical solution proposed in the present invention is: a method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5, comprising the following steps:

[0006] Step 1: Create an electrical corrosion dataset. Use a camera in the optical cable channel to capture images of the optical cable and perform data enhancement on the images with electrical corrosion to obtain a self-built image dataset. The image dataset can be divided into several subsets, including a training set and a validation set.

[0007] Step 2: Build and improve the YOLOv5 neural network model;

[0008] Build a YOLOv5 neural network model;

[0009] Improve the YOLOv5 neural network model and introduce the ECA attention mechanism to the output position of the CSP layer of the backbone network; replace the neck structure with the BiFPN weighted bidirectional feature golden network; modify the CIOU loss function in the original network model and introduce the EIOU loss function;

[0010] Step 3: Input the images in the training set into the improved YOLOv5 neural network model to train the neural network model;

[0011] The data-enhanced electrical corrosion image is input into the neural network model. The deviation between the prior box and the labeled box is used to learn the model parameters according to the SGD stochastic gradient descent method to obtain the optimal neural network model.

[0012] Step 4: After completing the model training, save the optimal model weights and set the format to pt format; by inputting the image of the ADSS optical cable, the optimal neural network model can identify the electrical corrosion content therein and realize real-time detection of electrical corrosion of the ADSS optical cable.

[0013] A further improvement of the above scheme is that in step 4, the images of the validation set are first input into the optimal neural network model for detection.

[0014] The above solution is further improved in that: the step 1 specifically includes:

[0015] Step 1a: Use a camera to capture images of optical cables, including images of cables with electrical corrosion and images of normal cables; classify the electrical corrosion in the images with electrical corrosion into categories such as spot, radial, and fracture.

[0016] Step 1b: Perform data enhancement on the image with electrical corrosion. The data enhancement methods include horizontal and vertical flipping of the image, adding Gaussian noise and color temperature change, and using local histogram equalization technology. The formula is: Where L is the number of gray levels, mn is the total number of pixels in the local area, P(x,y,i,j) represents the probability of the pixel at (x+i,y+j) in the local area, and I(x+i,y+j) represents the gray value of the pixel at (x+i,y+j) in the original image. This parameter is used in the formula to multiply the corresponding probability P to calculate the cumulative value of the weighted gray level, thereby obtaining a new gray value and calculating the new pixel value J(x,y).

[0017] The above solution is further improved in that: the step 2 specifically includes:

[0018] Step 2a: Build a YOLOv5 neural network model; adjust and configure parameters through preliminary pre-training;

[0019] Step 2b: Introduce the ECA attention mechanism and add it to the output position of the CSP layer of the backbone network;

[0020] Step 2c: Replace the neck structure with the BiFPN weighted bidirectional feature golden network;

[0021] Step 2d: Modify the CIOU loss function in the original network and introduce the EIOU loss function. The EIOU loss function can be expressed as; Among them, C ω 2 、C h 2 They represent the height and width of the minimum closure area that can cover both the predicted box and the real box. ω and h are the width and height of the actual box, respectively. gt 、h gt are the width and height of the prediction box, b and b respectively. gt Represents the center point of the actual box and the predicted box respectively, c is the diagonal length of the minimum closure area, and symbol ρ 2 (·) represents the square of the distance between two points, and IOU represents the degree of overlap between the predicted box and the true box L EIOU represents the overlap loss between the predicted box and the true box, L IOU represents the loss based on IOU, L dis Represents the distance loss between the center point of the predicted box and the real box, L asp Represents the width and height loss between the predicted box and the true box.

[0022] The above solution is further improved in that: Step 2b specifically includes: performing a global average pooling operation on the feature map output by the backbone network CSP layer, and the feature map output by the backbone network CSP layer is denoted as M, and the output after the global average pooling operation is denoted as Mgap; then using a 1×1 convolution kernel to perform multi-channel processing on the pooled features, assuming that the learning weight of the 1×1 convolution kernel is W1, then the result after the convolution operation is W1·M gap ; Then introduce the activation function δ and calculate the attention weight W of each channel through the Sigmoid function σ c And normalized to between 0 and 1, assuming the learning weight of the activation function is W2, the calculation formula for the above operation is: W c =σ(W2·δ(W1·M gap )).

[0023] The above solution is further improved in that: Step 2c specifically includes: BiFPN introduces bidirectional connection and weighting, and the formula is as follows: , P i ′=P i +upsample(P i+1 ′), P i =P i +upsample(P i-1 ″), where upsample represents an upsampling operation; Represents the fused feature map of the i-th layer after the k-th iteration; represent the feature maps of the i-th layer at the k-th iteration of the top-down and bottom-up paths, respectively; φ(·) is a weighted operation used to balance the contributions of feature maps from different paths; P i ′=P i +upsample(P i+1 ′) represents the process of fusion of the feature map from the top to the bottom path with the feature map of the current layer through upsampling; P i =P i +upsample(P i-1 ″) represents the process of upsampling the feature map from the bottom-up path and fusing it with the feature map of the current layer.

[0024] A further improvement to the above scheme is that: step 3 specifically includes putting the training set into the improved neural network model for training, wherein the training rounds are set to 300, the batch_size is set to 36, and the deviation between the prior box and the labeled box is used to learn the model parameters according to the SGD stochastic gradient descent method. When the loss function converges and remains near a certain value, the training is stopped. At this time, the model training obtains the optimal weight.

[0025] The present invention provides a method for detecting electrical corrosion of ADSS optical cables based on an improved YOLOv5. According to the concept of YOLOv5, an attention mechanism is introduced to reduce attention to irrelevant information and improve the detection of electrical corrosion. The recognition of irregular shapes in electrical corrosion phenomena is improved by changing the loss function. A weighted pyramid network is used to replace the original feature fusion network for bidirectional flow, fully integrating high-level and shallow layers, greatly improving the network's feature fusion capability for the target to be detected, thereby improving the network's detection accuracy. The improved model is deployed on equipment on the optical cable, and the cost required is lower than that of manual scheduled inspections. The detection method of the present invention can simultaneously detect multiple electrical corrosion phenomena in the image, that is, the monitoring range is expanded and the monitoring efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The present invention will be further described below with reference to the accompanying drawings.

[0027] Figure 1 is a flow chart of an embodiment of the present invention.

[0028] Figure 2 This is an example of an image in which the electrical corrosion features are relatively shallow in one embodiment of the present invention.

[0029] Figure 3 yes Figure 2 Example of an image after local histogram equalization.

[0030] Figure 4 It is a schematic diagram of the principle structure of the attention module ECA in one embodiment of the present invention.

[0031] Figure 5 It is a schematic diagram of the principle structure of a weighted bidirectional pyramid network BiFPN in one embodiment of the present invention. DETAILED DESCRIPTION

[0032] Example: The method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5 in this embodiment is as follows: Figure 1 As shown, specifically including:

[0033] Step 1: Establish an electrical corrosion dataset; collect images through the camera of the optical cable channel, remove the images of intact optical cables, and classify the images of optical cables with electrical corrosion according to the type of electrical corrosion, that is, spot-shaped, radial, and broken states, and perform data enhancement on the images of optical cables with electrical corrosion to obtain a self-built dataset; use Labelimg software to annotate the images, first mark the location of the cable, then mark the location of the electrical corrosion, and generate the corresponding XML file; convert the generated XML file into a txt file that can be used for YOLOv5 model training, and randomly divide the file into a training set and a validation set in a ratio of 6:2:2 for model training.

[0034] The specific execution method of step 1 is:

[0035] Step 1a: Use a camera to capture images of the optical cable, including images of the optical cable with electrical corrosion and images of the normal optical cable, where the electrical corrosion image is as follows: Figure 2 shown.

[0036] Step 1b: Perform data augmentation on the image data to enhance the robustness of the training effect. The enhanced effect is as follows Figure 3 shown.

[0037] Since electrical corrosion is not obvious in its early stages, it is easy to miss detection. This embodiment uses image enhancement technology and local histogram equalization technology to process the image. The transformation function is designed based on the grayscale distribution of each pixel neighborhood in the image to increase the contrast and make the image clear, thereby achieving the purpose of enhancing the training effect. The formula is: Where L is the number of grayscale levels. For a standard 24-bit RGB color image, each color channel (red, green, and blue) is 8 bits, and the number of grayscale levels per channel, L, is also 256. mn is the total number of pixels in the local region, and P(x, y, i, j) represents the probability of the pixel being located at (x+i, y+j) in the local region. The process of obtaining the equalized image J locally enhances the image's contrast, facilitating the network's ability to recognize less obvious objects.

[0038] Step 2: Build and improve the YOLO neural network model; build the YOLO v5 neural network model: adjust and configure parameters through preliminary pre-training.

[0039] Improve the neural network model of YOLO v5: introduce the ECA attention mechanism and add it to the output position of the CSP layer of the backbone network; replace the neck structure with the BiFPN weighted bidirectional feature golden network; modify the CIOU loss function in the original network and introduce the EIOU loss function.

[0040] The specific execution method of step 2 is:

[0041] Step 2a: Build the YOLOv5 network model.

[0042] Step 2b: Figure 4 As shown in the figure, first, a global average pooling (GAP) operation is performed on the feature map output by the CSP layer to simplify the model parameters and reduce the computational complexity. If the feature map output by the CSP layer is M, the output after the GAP operation is recorded as Mgap; next, a 1×1 convolution kernel is used to perform multi-channel processing on the pooled features to achieve local cross-channel interaction. Assuming that the 1×1 convolution learning weight is W1, the result after the convolution operation is W1·M gap , this process determines the dependencies between different channels through learning and enhances the representation ability of the model; then introduces a specific activation function δ to increase the nonlinear representation ability of the model, and uses the Sigmoid function σ to dynamically calculate the attention weight of each channel and standardize it to between 0 and 1, which can be expressed as the following formula: W c =σ(W2·δ(W1·M gap )). This part is based on the calculated attention weight W c Multiply each channel of the original CSP layer output feature map M, adjust the feature strength of each channel, strengthen the features of important channels, suppress the features of unimportant channels, and achieve feature recalibration.

[0043] Step 2c: Figure 5As shown, the neck structure is replaced with a Bi-directional Feature Pyramid Network (BiFPN) to more comprehensively and efficiently integrate and disseminate information. BiFPN (Bi-directional Feature Pyramid Network) is a feature pyramid network structure used for object detection, designed to improve the expressiveness of multi-scale features. BiFPN introduces bidirectional connections and weighting, and the formula is as follows: P i ′=P i +upsample(P i+1 ′), P i =P i +upsample(P i-1 ″), where upsample represents an upsampling operation; It represents the fused feature map of layer i after iteration k. This is the result of fusing information from the top feature map and the bottom feature map through bidirectional connection and weighting. Represent the feature maps of the i-th layer at the k-th iteration of the path from top to bottom and from bottom to top respectively. These two feature maps represent the information flow in different directions; φ(·) is a weighting operation used to balance the contribution of feature maps from different paths. Through this operation, the model can automatically adjust the weights of different feature maps according to the importance of the features, so that the fused feature map More effectively includes information that is important to the current task. i ′=P i +upsample(P i+1 ′) represents the process of fusing the feature map from the top to the bottom path with the feature map of the current layer through upsampling. Upsampling is to increase the resolution of the feature map so that it matches the size of the feature map of the current layer so that it can be directly added. This step strengthens the transmission of high-level semantic information in the low-level feature map. i =P i +upsample(P i-1 ″) describes the process of upsampling the feature map from the bottom-up path and fusing it with the feature map of the current layer. Similarly, the upsampling operation ensures the consistency of the spatial size of the feature map, facilitating the fusion of information. This step strengthens the transmission of detailed information from the lower layer to the higher layer.

[0044] Step 2d: The original YOLOv5s loss function uses CIOU. Although this adds loss to the detection box scale and also increases loss to length and width, it is relatively vague in terms of aspect ratio and does not consider the balance between easy and difficult samples. Therefore, EIOU Loss is used instead of the original function. This is because EIOU calculates the difference between width and height separately on top of CIOU, replacing the aspect ratio. It also introduces Focal to address the imbalance between easy and difficult samples. This loss function can be expressed as: Among them, C ω 2 、C h 2 They represent the height and width of the minimum closure area that can cover both the predicted box and the real box, ω and g are the width and height of the actual box, respectively, and w gt 、h gt are the width and height of the prediction box, b and b respectively. gt Represent the center points of the actual box and the predicted box respectively. EIOU represents the overlap loss between the predicted box and the true box; L dis Represents the distance loss between the center point of the predicted box and the real box, and the calculation formula is L asp Represents the width and height loss of the predicted box and the real box, and the calculation formula is IOU is a standard method for evaluating the performance of object detection algorithms. It measures the degree of overlap between the predicted bounding box and the true bounding box, i.e. Its range is between 0 and 1; L IOU Represents the loss based on IOU. In the target detection task, we define a loss function by subtracting the IOU value from 1. IOU =1-IOU, and we hope to maximize IOU to optimize the model.

[0045] Step 3: Input the images in the training set into the YOLOv5 network model and train the YOLOv5 model. After the images are input into the network, they are first extracted through the Backbone network. The extracted information enters the Neck network and then input into the Head end to output feature maps of three scales for detection:

[0046] Three data-augmented electrical corrosion images of spot, radial, and fracture states were input into the YOLOv5 model. The training set was trained using the improved YOLOv5 algorithm network. The training rounds were set to 300 and the batch_size was set to 36. The deviation between the prior box and the labeled box was used to learn the model parameters according to the SGD stochastic gradient descent method. When the loss function converged and remained near a certain value, the training was stopped. At this time, the model training obtained the optimal weight.

[0047] Step 4: After completing model training, save the optimal model weights and set the format to pt. At this time, the network optimization performance is the best; input the images of the validation set into the improved optimal YOLOv5 network model in S3 for detection. After that, real-time detection of electrical corrosion of ADSS optical cables can be achieved.

[0048] The present invention is not limited to the above embodiments, and any technical solutions formed by equivalent replacements fall within the protection scope required by the present invention.

Claims

1. A method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5, characterized in that: The steps include: Step 1: Create an electrical corrosion dataset. Use a camera in the optical cable channel to capture images of the optical cable and perform data enhancement on the images with electrical corrosion to obtain a self-built image dataset. The image dataset can be divided into several subsets, including a training set and a validation set. Step 2: Build and improve the YOLOv5 neural network model; Build a YOLOv5 neural network model; Improve the YOLOv5 neural network model and introduce the ECA attention mechanism to the output position of the CSP layer of the backbone network; replace the neck structure with the BiFPN weighted bidirectional feature golden network; modify the CIOU loss function in the original network model and introduce the EIOU loss function; Step 3: Input the images in the training set into the improved YOLOv5 neural network model to train the neural network model; The data-enhanced electrical corrosion image is input into the neural network model. The deviation between the prior box and the labeled box is used to learn the model parameters according to the SGD stochastic gradient descent method to obtain the optimal neural network model. Step 4: After completing the model training, save the optimal model weights and set the format to pt format; by inputting the image of the ADSS optical cable, the optimal neural network model can identify the electrical corrosion content therein and realize real-time detection of electrical corrosion of the ADSS optical cable.

2. The method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5 according to claim 1, wherein: In step 4, the images of the validation set are first input into the optimal neural network model for detection.

3. The method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5 according to claim 1, wherein: The step 1 specifically includes: Step 1a: Use a camera to capture images of optical cables, including images of cables with electrical corrosion and images of normal cables; classify the electrical corrosion in the images with electrical corrosion into categories such as spot, radial, and fracture. Step 1b: Perform data enhancement on the image with electrical corrosion. The data enhancement methods include horizontal and vertical flipping of the image, adding Gaussian noise and color temperature change, and using local histogram equalization technology. The formula is: Where L is the number of gray levels, mn is the total number of pixels in the local area, P(x,y,i,j) represents the probability of the pixel at (x+i,y+j) in the local area, and I(x+i,y+j) represents the gray value of the pixel at (x+i,y+j) in the original image. This parameter is used in the formula to multiply the corresponding probability P to calculate the cumulative value of the weighted gray level, thereby obtaining a new gray value and calculating the new pixel value J(x,y).

4. The method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5 according to claim 3, wherein: The step 2 specifically includes: Step 2a: Build a YOLOv5 neural network model; adjust and configure parameters through preliminary pre-training; Step 2b: Introduce the ECA attention mechanism and add it to the output position of the CSP layer of the backbone network; Step 2c: Replace the neck structure with the BiFPN weighted bidirectional feature golden network; Step 2d: Modify the CIOU loss function in the original network and introduce the EIOU loss function. The EIOU loss function can be expressed as; Among them, C ω 2 、C h 2 They represent the height and width of the minimum closure area that can cover both the predicted box and the real box. ω and h are the width and height of the actual box, respectively. gt 、h gt are the width and height of the prediction box, b and b respectively. gt Represents the center point of the actual box and the predicted box respectively, c is the diagonal length of the minimum closure area, and symbol ρ 2 (·) represents the square of the distance between two points, and IOU represents the degree of overlap between the predicted box and the true box L EIOU represents the overlap loss between the predicted box and the true box, L IOU represents the loss based on IOU, L dis Represents the distance loss between the center point of the predicted box and the real box, L asp Represents the width and height loss between the predicted box and the true box.

5. The method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5 according to claim 4, wherein step 2b specifically comprises: Perform a global average pooling operation on the feature map output by the backbone network CSP layer. The feature map output by the backbone network CSP layer is denoted as M, and the output after the global average pooling operation is denoted as Mgap. Next, use a 1×1 convolution kernel to perform multi-channel processing on the pooled features. Assume that the learning weight of the 1×1 convolution kernel is W1, and the result after the convolution operation is W1·M gap ; Then introduce the activation function δ and calculate the attention weight W of each channel through the Sigmoid function σ c And normalized to between 0 and 1, assuming the learning weight of the activation function is W2, the calculation formula for the above operation is: W c =σ(W2·δ(W1·M gap )).

6. The method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5 according to claim 5, characterized in that: The step 2c specifically includes: BiFPN introduces bidirectional connection and weighting, and the formula is as follows: i (k) =φ(P i ' (k) ,P i ″ (k) ), P i ′=P i +upsample(P i+1 ′), P i =P i +upsample(P i-1 ″), where upsample represents an upsampling operation; P i (k) represents the fused feature map of the i-th layer after the k-th iteration; P i ' (k) ,P i ″ (k) represent the feature maps of the i-th layer at the k-th iteration of the top-down and bottom-up paths, respectively; φ(·) is a weighted operation used to balance the contributions of feature maps from different paths; P i ′=P i +upsample(P i+1 ′) represents the process of fusion of the feature map from the top to the bottom path with the feature map of the current layer through upsampling; P i =P i +upsample(P i-1 ″) represents the process of upsampling the feature map from the bottom-up path and fusing it with the feature map of the current layer.

7. The method for detecting electrical corrosion of ADSS optical cables based on improved YOLOv5 according to claim 6, characterized in that: The step 3 specifically includes placing the training set into the improved neural network model for training, wherein the training rounds are set to 300 and the batch_size is set to 36, and the deviation between the prior box and the labeled box is used to learn the model parameters according to the SGD stochastic gradient descent method. When the loss function converges and remains near a certain value, the training is stopped. At this time, the model training obtains the optimal weight.