Distribution network component defect-oriented detection method and device and readable storage medium
By improving the structure and training method of the YOLOv9 network, and utilizing a multi-convolutional perceptual framework and attention enhancement techniques, the problem of low accuracy in the detection of defects in distribution network components by traditional convolutional neural networks is solved, and efficient detection is achieved for complex environments and imbalanced datasets.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID JIANGSU ELECTRIC POWER CO ZHENJIANG POWER SUPPLY CO
- Filing Date
- 2026-01-13
- Publication Date
- 2026-05-08
AI Technical Summary
Existing methods for detecting defects in power distribution network components based on traditional convolutional neural networks cannot effectively capture the image features of power distribution network components, resulting in low detection accuracy. In particular, when distinguishing defects that are similar in appearance but different in nature, subtle defects are easily missed and categories are confused.
By employing the YOLOv9 network combined with a programmable gradient information network, SPPELAN module, and MHSENet module, and through a multi-convolutional perceptual framework and MHSEBlock dual-path structural unit, local features are extracted layer by layer and attention enhancement is performed. The model training is optimized by combining a weighted intersection-union loss function to improve the detection accuracy of different types of defects.
It effectively enhances the model's detection accuracy for defects in distribution network components, avoids missing subtle defects and category confusion, and improves the detection capability in complex environments, especially the ability to identify low-frequency and difficult samples.
Smart Images

Figure CN121998922A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power distribution network defect detection technology, and in particular to a method, apparatus and computer-readable storage medium for detecting defects in power distribution network components. Background Technology
[0002] With the continuous expansion of power systems, the structure of distribution networks is becoming increasingly complex, and the safety and stability of their operation directly affect the reliability of power supply. Distribution network equipment is exposed to the outdoor environment for extended periods, making it susceptible to various defects such as missing binding wires, transformer oil leaks, spontaneous explosion of glass insulators, lightning flashover of porcelain insulators, broken porcelain insulators, loose guy wires, and bird nests and vine entanglement. If these defects are not detected and addressed promptly, they can lead to electrical short circuits, equipment damage, or even line tripping, posing a serious threat to the safe operation of the power grid. Therefore, the automated detection and identification of defects in distribution network components has significant engineering implications.
[0003] With the development of deep learning and computer vision technologies, object detection algorithms based on convolutional neural networks have been widely applied to defect detection in power distribution network components. Currently, researchers generally use mainstream detection frameworks such as Faster R-CNN and SSD to extract features and identify defects in images of power distribution network components. For example, existing technologies have proposed an improved SSD object detection algorithm for identifying abnormal power equipment during power line inspections. Furthermore, an improved regional convolutional neural network algorithm architecture, combined with a pre-trained VGG16 (Visual Geometry Group 16-layer model) deep convolutional network to construct a feature extraction module, has achieved breakthrough progress in the field of intelligent diagnostics of power fittings. Regarding surface damage and flashover phenomena on insulators, existing technologies have proposed a surface defect recognition algorithm based on YOLOv8, which can effectively detect small target defects in complex backgrounds, improving the accuracy and practicality of power line inspections of insulators. However, due to the high inter-class similarity of defects in distribution network components, existing convolutional neural networks mainly rely on local receptive fields for feature extraction, making it difficult to effectively capture long-range dependencies and channel weight differences in feature maps. This results in the model having a weak ability to distinguish between defects that are similar in appearance but different in nature (such as broken porcelain insulators and spontaneous explosion of glass insulators), and is prone to missing subtle defects and class confusion.
[0004] In summary, existing methods for detecting defects in power distribution network components based on traditional convolutional neural networks suffer from the inability to effectively capture image features of these components, resulting in low detection accuracy. Summary of the Invention
[0005] Therefore, the technical problem to be solved by the present invention is to overcome the problem that the existing methods for detecting defects in distribution network components based on traditional convolutional neural networks cannot effectively capture the image features of distribution network components, resulting in low detection accuracy.
[0006] To address the aforementioned technical problems, this invention provides a method for detecting defects in distribution network components, comprising: The image of the distribution network component to be detected is input into the programmable gradient information network of the YOLOv9 network, and the auxiliary feature map extracted by the programmable gradient information network is input into the first head network of the YOLOv9 network. The image of the distribution network component to be detected is input into the backbone network of the YOLOv9 network, and a three-layer feature map is output. The third-layer feature map is input into the SPPELAN module for multi-scale pooling and aggregation, and the target third-layer feature map is output. The first-layer feature map, the second-layer feature map, and the target third-layer feature map are respectively input into the first RepNCSPELAN4 module, the second RepNCSPELAN4 module, and the MHSENet module in the neck network of the YOLOv9 network for feature fusion, and the fused feature map is output. The fused feature map is then input into the second head network of the YOLOv9 network. Specifically, the feature fusion of the target third-layer feature map into the MHSENet module includes: The local features of the third layer feature map of the target are extracted layer by layer using a multi-convolutional perceptual framework; We utilize the MHSEBlock dual-path structural unit to enhance the attention of local features extracted by the multi-convolutional perceptual framework; Based on the prediction results output by the first head network and the second head network, the defect identification and classification results of the distribution network components to be detected are obtained.
[0007] Preferably, the multi-convolutional sensing framework includes a first convolutional combination unit, a channel cutting unit, a second convolutional combination unit, a third convolutional combination unit, and a convolutional unit; The MHSEBlock dual-path structure unit includes a first MHSEBlock unit and a second MHSEBlock unit.
[0008] Preferably, local features of the third-layer feature map of the target are extracted layer by layer using a multi-convolutional perceptual framework; attention enhancement is performed on the local features extracted by the multi-convolutional perceptual framework using MHSEBlock dual-path structural units, including: The target third-layer feature map is input into the first convolutional combination unit, and the first depth feature map is output. The first depth feature map is input into the channel segmentation unit for channel dimension segmentation; The first depth feature map after segmentation is input into the first MHSEBlock unit for attention enhancement, and the first depth feature map of the target is output. The first feature map of the target depth is input into the second convolutional combination unit, and the second depth feature map is output. The second depth feature map is input into the second MHSEBlock unit for attention enhancement, and the target second depth feature map is output. The second depth feature map of the target is input into the third convolutional combination unit, and the third depth feature map is output. The first, second, and third depth feature maps are element-wise summed and then input into a convolutional unit. The output of the convolutional unit is used as the output of the MHSENet module.
[0009] Preferably, the MHSEBlock unit performs attention enhancement on the input deep feature map, including: The depth feature map is input into the parallel first convolutional combination subunit and the second convolutional combination subunit, and the first target feature map and the second target feature map are output. The first target feature map is input into the feature extraction subunit, and the third target feature map is output. The second and third target feature maps are element-wise summed and then input into the third convolutional combination subunit to output the target depth feature map.
[0010] Preferably, the feature extraction subunit includes a first feature extraction network and a second feature extraction network in parallel, and the outputs of the first feature extraction network and the second feature extraction network are concatenated and superimposed to obtain a third target feature map; Alternatively, the feature extraction subunit includes a first feature extraction network and a second feature extraction network connected in series, and a third target feature map is obtained based on the output of the second feature extraction network.
[0011] Preferably, the output of the first feature extraction network is represented as: , in, Indicates the first feature extraction network The output; This represents the feature map input to the first feature extraction network; This represents the output of the first 1x1 convolutional block after convolving the depth feature map. This represents the output of the second 1x1 convolutional block after convolving the depth feature map; This represents the output of the third 1x1 convolutional block after convolving the depth feature map; Indicates transpose; This indicates a normalization operation; The output of the second feature extraction network is represented as follows: , in, Indicates the second feature extraction network The output; This represents the feature map input to the second feature extraction network; Indicates average pooling; Indicates a fully connected layer; Represents the ReLU activation function; This represents the Sigmoid activation function.
[0012] Preferably, before inputting the image of the distribution network component to be detected into the YOLOv9 network, the method further includes iteratively training the YOLOv9 network using image samples of the distribution network component. The process of constructing the loss function during iterative training includes: Based on the predicted bounding boxes output by the YOLOv9 network and the true bounding boxes of the image samples of the power distribution network components, the cross-union ratio loss and the weighted cross-union ratio weight coefficient are calculated. The first weighted cross-union ratio loss is obtained by multiplying the weighted cross-union ratio weight coefficients by the cross-union ratio loss. Based on the crossover ratio loss and its moving average, the gradient gain of the first weighted crossover ratio loss is constructed; based on the product of the first weighted crossover ratio loss and its gradient gain, the second weighted crossover ratio loss is obtained, so that the convergence speed of the YOLOv9 network gradually increases with the increase of the number of training iterations. Based on the ratio of the crossover ratio loss to its moving average, a dynamic outlier factor is obtained. Based on the dynamic outlier factor, a non-monotonic focusing coefficient of the first weighted crossover ratio loss is constructed. Based on the product of the first weighted crossover ratio loss and its non-monotonic focusing coefficient, a third weighted crossover ratio loss is obtained, so that as the number of training iterations increases, the convergence speed of the YOLOv9 network is proportional to the accuracy of its output predicted target boxes. The loss function is obtained by weighting the first weighted cross-union ratio loss, the second weighted cross-union ratio loss, and the third weighted cross-union ratio loss.
[0013] Preferably, the weighted intersection-union ratio (IUU) weighting coefficients The calculation formula is: , in, This indicates the width and height of the predicted target bounding box; Represents the width and height of the actual target bounding box; This represents the width and height of the bounding box obtained by combining the predicted bounding box and the ground truth bounding box; ; First weighted average loss Represented as: , in, Indicates the crossover and union ratio loss; ; Second weighted intersection and comparison loss Represented as: , in, Indicates gradient gain; The moving average represents the crossover ratio loss; Indicates the exponential hyperparameter; Third weighted intersection and comparison loss Represented as: , in, Indicates the non-monotonic focusing coefficient; Represents the dynamic outlier factor. , This indicates an adjustable parameter.
[0014] The present invention also provides a detection device for defects in distribution network components, comprising: The first prediction module is used to input the image of the distribution network component to be detected into the programmable gradient information network of the YOLOv9 network, and to input the auxiliary feature map extracted by the programmable gradient information network into the first head network of the YOLOv9 network. The feature map extraction module is used to input the image of the distribution network component to be detected into the backbone network of the YOLOv9 network and output a three-layer feature map; the third-layer feature map is input into the SPPELAN module for multi-scale pooling and aggregation, and the target third-layer feature map is output. The second prediction module is used to input the first layer feature map, the second layer feature map, and the target third layer feature map into the first RepNCSPELAN4 module, the second RepNCSPELAN4 module, and the MHSENet module in the neck network of the YOLOv9 network for feature fusion, and output a fused feature map; and input the fused feature map into the second head network of the YOLOv9 network; wherein, inputting the target third layer feature map into the MHSENet module for feature fusion includes: The local feature extraction submodule is used to extract local features of the third-layer feature map of the target layer by layer using a multi-convolutional perceptual framework; The attention enhancement submodule is used to enhance the attention of local features extracted by the multi-convolutional perceptual framework using the MHSEBlock dual-path structural unit; The detection result acquisition module is used to obtain the defect identification and classification results of the distribution network components to be detected based on the prediction results output by the first head network and the second head network.
[0015] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for detecting defects in distribution network components.
[0016] The detection method for defects in power distribution network components provided in this application has the following advantages: 1. Defect detection is performed using the YOLOv9 network. The programmable gradient information network in the YOLOv9 network effectively mitigates the loss of defect features in power distribution components caused by complex environments, providing auxiliary information for the backbone network and the neck network. At the same time, the SPPELAN module is connected in series in the backbone network to perform pooling and fusion of multi-scale feature maps, and the MHSENet module is introduced in the neck network to perform feature fusion of the highest-level feature map output by the backbone network. The multi-convolutional perceptual framework in the MHSENet module can extract local features of the third-layer feature map of the target layer by layer. The MHSEBlock dual-path structure unit further enhances the attention of the local features extracted by the multi-convolutional perceptual framework. The two efficiently capture the long-range dependencies of the input feature maps and learn the importance weights of the feature channels, effectively enhancing the model's ability to extract features of different categories of defects, thereby improving the model's detection accuracy for various power distribution component defects. 2. Each MHSEBlock unit in the dual-path structure unit is composed of two feature extraction networks. The two feature extraction networks can simultaneously model spatial and channel dimension features, thereby effectively distinguishing distribution network defects with similar shapes and avoiding the problems of missing subtle defects and category confusion. 3. When training the YOLOv9 network, a weighted intersection-over-union loss is designed to dynamically adjust the loss contribution of different categories of samples by measuring the similarity between the model's predicted target box and the real target box for each sample. This allows the model to focus on difficult samples and low-frequency samples that are hard to identify or have ambiguous boundaries, thereby strengthening the model's learning ability for low-frequency defects and difficult samples. This effectively improves the training effect of the model on imbalanced datasets and enhances the detection accuracy of defects in various power distribution network components. Attached Figure Description
[0017] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 A flowchart of the detection method for defects in distribution network components provided in this application; Figure 2 This is a schematic diagram of the YOLOv9 network structure provided in this application; Figure 3 This is a schematic diagram of the MHSENet module structure provided in this application; Figure 4 This application provides a schematic diagram of the feature extraction subunit structure; wherein, Figure 4 (a) in the diagram is a schematic diagram of the first type of feature extraction subunit structure. Figure 4 (b) in the diagram is a schematic diagram of the second type of feature extraction subunit structure; Figure 5 A schematic diagram illustrating the detection results of defects in the distribution network components provided in this application; wherein, Figure 5 (a) in the diagram is a schematic diagram of the detection results of defects in the first distribution network component. Figure 5 (b) in the diagram is a schematic diagram of the detection results of defects in the second distribution network component. Figure 5 (c) in the diagram is a schematic diagram of the detection results of defects in the third distribution network component. Figure 5 (d) in the diagram is a schematic diagram of the detection results of defects in the fourth distribution network component. Figure 5 (e) in the diagram is a schematic diagram of the detection results of defects in the fifth distribution network component. Detailed Implementation
[0018] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0019] Please refer to the following: Figure 1 and Figure 2 , Figure 1 This is a flowchart of the detection method for defects in distribution network components provided in this application. Figure 2 A schematic diagram of the YOLOv9 network structure provided in this application.
[0020] It should be noted that the existing YOLOv9 network includes a programmable gradient information network, a backbone network, a neck network, and two head networks. The two head networks are connected to the programmable gradient information network and the neck network, respectively. The backbone and neck networks adopt the GELAN generalized efficient layer aggregation network. The programmable gradient information network consists of two parts: an auxiliary invertible branch network and a multi-level auxiliary information network. The auxiliary invertible branch avoids learning forward features that are irrelevant to the target by providing mapping information from data to the target, thereby solving the problem of information bottleneck caused by the depth of neural networks and the problem of the loss function failing to generate reliable gradients. The multi-level auxiliary information network can effectively handle the error accumulation problem caused by deep supervision. By introducing multi-level auxiliary information, the features of the feature pyramid hierarchy of the main branch will not be dominated by information of certain specific objects. The programmable gradient information network can effectively alleviate the loss of defect features of power distribution components caused by complex environments. The input of the YOLOv9 head network includes not only the output of the neck part of the main branch network, but also the feature map output mapped by the programmable gradient information network.
[0021] The detection method for defects in distribution network components provided in this application specifically includes S10~S40: S10: Input the image of the distribution network component to be detected into the programmable gradient information network of the YOLOv9 network, and input the auxiliary feature map extracted by the programmable gradient information network into the first head network of the YOLOv9 network.
[0022] S20: Input the image of the distribution network component to be detected into the backbone network of the YOLOv9 network and output a three-layer feature map; input the third-layer feature map into the SPPELAN module for multi-scale pooling and aggregation, and output the target third-layer feature map.
[0023] S30: Input the first layer feature map, the second layer feature map, and the target third layer feature map into the first RepNCSPELAN4 module, the second RepNCSPELAN4 module, and the MHSENet module in the neck network of the YOLOv9 network respectively for feature fusion and output the fused feature map; input the fused feature map into the second head network of the YOLOv9 network.
[0024] The process of inputting the target's third-layer feature map into the MHSENet module for feature fusion includes steps 1-1 to 1-2: Step 1-1: Use a multi-convolutional perceptual framework to extract local features from the third layer feature map of the target layer by layer.
[0025] Step 1-2: Use MHSEBlock dual-path structural units to enhance the attention of local features extracted by the multi-convolutional perceptual framework.
[0026] S40: Based on the prediction results output by the first head network and the second head network, the defect identification and classification results of the distribution network components to be detected are obtained.
[0027] Specifically, the YOLOv9 network of this application adopts a programmable gradient information network architecture in the prior art, such as... Figure 2 As shown, the upper part of the Silence replication segmentation module is a programmable gradient information network, and the CBLiner module is a multi-level auxiliary information network. The output of the programmable gradient information network is connected to the first head network. The lower part of the Silence replication segmentation module is the improved backbone network and neck network of this application. The output of the neck network is connected to the second head network. It should be noted that the improvement of the backbone network in this application is that the SPPELAN module is connected in series after the last output module of the backbone network in the prior art. The improvement of the neck network is that the third RepNCSPELAN4 module in the neck network is replaced by the innovatively designed MHSENet module.
[0028] Specifically, such as Figure 3 As shown, the MHSENet module designed in this application consists of a multi-convolutional sensing framework and a dual-path structure unit. The multi-convolutional sensing framework includes a first convolutional combination unit, a channel cutting unit (chunk), a second convolutional combination unit, a third convolutional combination unit, and a convolutional unit.
[0029] The MHSEBlock dual-path structure unit includes a first MHSEBlock unit and a second MHSEBlock unit.
[0030] Furthermore, local features of the third-layer feature map of the target are extracted layer by layer using a multi-convolutional perceptual framework; attention enhancement is performed on the local features extracted by the multi-convolutional perceptual framework using MHSEBlock dual-path structural units, including steps 2-1 to 2-7: Step 2-1: Input the target third layer feature map into the first convolutional combination unit and output the first depth feature map.
[0031] Step 2-2: Input the first depth feature map into the channel cutting unit to perform channel dimension cutting.
[0032] Steps 2-3: Input the cut first depth feature map into the first MHSEBlock unit for attention enhancement, and output the target first depth feature map.
[0033] Steps 2-4: Input the first feature map of the target depth into the second convolutional combination unit and output the second depth feature map.
[0034] Steps 2-5: Input the second depth feature map into the second MHSEBlock unit for attention enhancement, and output the target second depth feature map.
[0035] Steps 2-6: Input the target's second depth feature map into the third convolutional combination unit and output the third depth feature map.
[0036] Steps 2-7: Element-wise summation of the first, second, and third depth feature maps is input into the convolutional unit, and the output of the convolutional unit is used as the output of the MHSENet module.
[0037] Specifically, the multi-convolutional perceptual framework designed in this application can extract local features in an image layer by layer. Shallow convolutions extract low-level features (such as edges and textures), while deep convolutions extract more abstract high-level semantic features. The connection relationship between each MHSEBlock unit and the convolution combination unit ensures that gradient information can be backpropagated through the residual branch. This multi-level feature extraction and connection can capture various details of the power distribution network components, thereby improving the accuracy of defect detection.
[0038] Furthermore, the MHSEBlock unit performs attention enhancement on the input deep feature map, including steps 3-1 to 3-3: Step 3-1: Input the depth feature map into the parallel first convolutional combination sub-unit and the second convolutional combination sub-unit, and output the first target feature map and the second target feature map.
[0039] Step 3-2: Input the first target feature map into the feature extraction subunit and output the third target feature map.
[0040] Step 3-3: Add the second target feature map and the third target feature map element by element and input them into the third convolutional combination sub-unit to output the target depth feature map.
[0041] Specifically, such as Figure 4 As shown, the MHSEBlock unit designed in this application consists of two basic feature extraction networks, such as... Figure 4 As shown in (a), the feature extraction subunit includes a first feature extraction network and a second feature extraction network in parallel. The outputs of the first feature extraction network and the second feature extraction network are cascaded and superimposed to obtain the third target feature map.
[0042] In other embodiments, such as Figure 4 As shown in (b), the feature extraction subunit includes a first feature extraction network and a second feature extraction network connected in series, and a third target feature map is obtained based on the output of the second feature extraction network.
[0043] For example, Figure 3The diagram illustrates the structures of the first and second feature extraction networks. The first feature extraction network allows for full interaction of parameters in different regions of the feature map, extracting the correlation and semantic information between different regions in the image. It establishes long-range dependencies in multiple defect target regions of the power distribution component defect image, capturing the overall defect distribution pattern. This is beneficial for improving the model's ability to identify power distribution network defect types that require comprehensive global contextual information. The second feature extraction network assigns different weights to the channels in the feature map, giving higher weights to channels related to foreground objects and lower weights to channels related to the background. This enhances the convolution operation of channels related to foreground objects, automatically learns the importance weights of each feature channel of the power distribution component defect, suppresses background features, effectively enhances the recognizability of fine texture features such as surface scratches and defects, thereby improving the model's feature representation ability and detection accuracy.
[0044] Specifically, the output of the first feature extraction network is represented as: , in, Indicates the first feature extraction network The output; This represents the feature map input to the first feature extraction network. , , , They represent Height, width, and number of channels; This represents the output of the first 1x1 convolutional block after convolving the depth feature map. This represents the output of the second 1x1 convolutional block after convolving the depth feature map; This represents the output of the third 1x1 convolutional block after convolving the depth feature map; Indicates transpose; This indicates a normalization operation.
[0045] The output of the second feature extraction network is represented as follows: , in, Indicates the second feature extraction network The output; This represents the feature map input to the second feature extraction network; Indicates average pooling; Indicates a fully connected layer; Represents the ReLU activation function; This represents the Sigmoid activation function.
[0046] It is worth noting that this application utilizes a YOLOv9 network formed by MHSEBlock units based on two different structures for defect detection. The detection results show that the YOLOv9 network formed by MHSEBlock units with two feature extraction networks connected in parallel has higher detection accuracy. This is because the parallel connection of the two feature extraction networks can simultaneously model the importance of spatial and channel dimensions, avoiding the limitations of a single attention mechanism, and also avoiding the increased depth of serial stacking, thereby reducing the risk of information loss. Furthermore, the MHSENet module designed in this application combines a network structure that effectively extracts target spatial and semantic information, and integrates two feature extraction networks and a multi-convolutional perceptual framework. This allows for the simultaneous realization of correlation and semantic information interaction between different regions of the feature map, as well as improving the model's feature representation capability and effectively distinguishing between foreground and background.
[0047] Furthermore, before inputting the image of the distribution network component to be detected into the YOLOv9 network, the process includes iterative training of the YOLOv9 network using image samples of the distribution network component. The construction process of the loss function during iterative training includes steps 4-1 to 4-5: Step 4-1: Based on the predicted target boxes output by the YOLOv9 network and the real target boxes of the image samples of the power distribution network components, calculate the cross-union ratio loss and the weighted cross-union ratio weight coefficient.
[0048] Specifically, the weighted intersection-union ratio weighting coefficients The calculation formula is: , in, This indicates the width and height of the predicted target bounding box; Represents the width and height of the actual target bounding box; This represents the width and height of the bounding box obtained by combining the predicted bounding box and the ground truth bounding box; .
[0049] Step 4-2: Based on the product of the weighted cross-union ratio (CUNR) weight coefficient and the CUNR loss, obtain the first weighted CUNR loss.
[0050] Specifically, the first weighted intersection and comparison loss Represented as: , in, Indicates the crossover and union ratio loss; .
[0051] Specifically, It can amplify the cross-union ratio loss value of ordinary mass anchor frames, and at the same time, It can also reduce the weighted cross-union ratio (CUI) coefficient of high-quality anchor boxes and reduce the attention of the loss function to the distance between their center points when the predicted target box and the real target box coincide, so that the final first weighted CUI loss can achieve attention-based bounding box loss and weaken the penalty of geometric metrics when the anchor box and the target box coincide.
[0052] Step 4-3: Construct the gradient gain of the first weighted crossover ratio loss based on its moving average; Based on the product of the first weighted crossover ratio loss and its gradient gain, obtain the second weighted crossover ratio loss, so that the convergence speed of the YOLOv9 network gradually increases with the increase of the number of training iterations.
[0053] Specifically, the second weighted intersection loss Represented as: , in, Indicates gradient gain; The moving average represents the crossover ratio loss; This represents the exponential hyperparameter.
[0054] Since penalizing the reduction of geometric metrics when the anchor box coincides with the target box does not enable the model to focus on and effectively learn the features of hard samples, this application constructs a second weighted intersection-union loss. Dynamic updates can keep the gradient gain within a high parameter range, which can effectively alleviate the problem of slow convergence speed in later training stages. At the same time, it can effectively reduce the contribution of simple samples to the loss regression (the cross-union ratio loss of simple samples is small, so the gradient gain is small, and the second weighted cross-union ratio loss is also small), so that the model can focus on difficult samples while ensuring convergence speed.
[0055] Step 4-4: Based on the ratio of the crossover ratio loss to its moving average, obtain the dynamic outlier factor. Construct the non-monotonic focusing coefficient of the first weighted crossover ratio loss based on the dynamic outlier factor. Based on the product of the first weighted crossover ratio loss and its non-monotonic focusing coefficient, obtain the third weighted crossover ratio loss, so that as the number of training iterations increases, the convergence speed of the YOLOv9 network is proportional to the accuracy of its output predicted target boxes.
[0056] Specifically, the third weighted intersection loss Represented as: , in, Indicates the non-monotonic focusing coefficient; Represents the dynamic outlier factor. , This indicates an adjustable parameter.
[0057] Unlike the second weighted cross-union ratio (CUNR) loss, this application also constructs a dynamic outlier factor to measure the quality of anchor boxes. When the dynamic outlier factor is small, it means that the anchor box quality is high, and when the dynamic outlier factor is large, it means that the anchor box quality is low. Furthermore, a non-monotonic focusing coefficient is constructed. Since the CUNR loss is dynamic, the quality classification standard of the anchor boxes is also dynamic. The detection difficulty of the sample is measured based on the anchor box quality of the current sample, thereby calculating the third weighted CUNR loss of the current sample. This enables the model to make a loss allocation strategy that conforms to the learning difficulty of the current sample features at each time step.
[0058] Steps 4-5: Obtain the loss function based on the weighted sum of the first weighted cross-union ratio loss, the second weighted cross-union ratio loss, and the third weighted cross-union ratio loss.
[0059] Specifically, in the actual collected defect data of distribution network components, the number of samples for different defect categories varies greatly. For example, there are many samples of defects such as missing binding wires and entangled vines, while the number of samples of defects such as transformer oil leakage and lightning flashover is scarce. If the commonly used CIuU (Intersection over Union) loss is directly used to train the model, the model will not pay enough attention to difficult and low-frequency samples, resulting in poor detection performance of the model on rare defect categories. To solve this problem, the weighted intersection over union loss designed in this application measures the similarity between the model's predicted target box and the real target box for each sample, and dynamically adjusts the loss contribution of different categories of samples. This allows the model to focus on difficult and low-frequency samples that are hard to identify or have ambiguous boundaries, strengthening the model's learning ability for low-frequency defects and difficult samples. This effectively improves the training effect of the model on imbalanced datasets and enhances the detection accuracy of various distribution network component defects.
[0060] Based on the above embodiments of the method for detecting defects in distribution network components, this application also provides a device for detecting defects in distribution network components, which specifically includes: The first prediction module is used to input the image of the distribution network component to be detected into the programmable gradient information network of the YOLOv9 network, and to input the auxiliary feature map extracted by the programmable gradient information network into the first head network of the YOLOv9 network. The feature map extraction module is used to input the image of the distribution network component to be detected into the backbone network of the YOLOv9 network and output a three-layer feature map; the third-layer feature map is input into the SPPELAN module for multi-scale pooling and aggregation, and the target third-layer feature map is output. The second prediction module is used to input the first layer feature map, the second layer feature map, and the target third layer feature map into the first RepNCSPELAN4 module, the second RepNCSPELAN4 module, and the MHSENet module in the neck network of the YOLOv9 network for feature fusion, and output a fused feature map; and input the fused feature map into the second head network of the YOLOv9 network; wherein, inputting the target third layer feature map into the MHSENet module for feature fusion includes: The local feature extraction submodule is used to extract local features of the third-layer feature map of the target layer by layer using a multi-convolutional perceptual framework; The attention enhancement submodule is used to enhance the attention of local features extracted by the multi-convolutional perceptual framework using the MHSEBlock dual-path structural unit; The detection result acquisition module is used to obtain the defect identification and classification results of the distribution network components to be detected based on the prediction results output by the first head network and the second head network.
[0061] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method for detecting defects in distribution network components.
[0062] To verify the effectiveness of the above method, this application used the above method to perform a series of distribution network component defect detections. In this embodiment, the YOLOv9 network was trained using a dataset containing 8 defect types. The 8 defect types are missing binding wire, transformer oil leakage, glass insulator spontaneous explosion, porcelain insulator lightning flashover, porcelain insulator damage, guy wire slack, crossing, and vine entanglement.
[0063] The images in the dataset were divided into training and testing sets in a 3:1 ratio, resulting in 6939 training images and 2501 testing images. The descriptions and number of images for each defect category are shown in Table 1. Table 1
[0064] like Figure 5 The diagram shown illustrates the defect detection results of images of different distribution network components using a trained YOLOv9 network in this embodiment. Figure 5 (a) in the diagram is a schematic diagram of the detection results of defects in the first distribution network component. Figure 5 (b) in the diagram is a schematic diagram of the detection results of defects in the second distribution network component. Figure 5 (c) in the diagram is a schematic diagram of the detection results of defects in the third distribution network component. Figure 5 (d) in the diagram is a schematic diagram of the detection results of defects in the fourth distribution network component. Figure 5(e) in the diagram is a schematic representation of the detection results of defects in the fifth distribution network component. Figure 5 As can be seen from this, the YOLOv9 network trained in this embodiment can accurately identify the defect areas and defect categories of different distribution network components.
[0065] In summary, this application embeds an MHSENet module after the SPPELAN module. The MHSENet module adopts a multi-convolutional perceptual framework, which can extract multi-scale features from local texture to high-level semantics layer by layer. In its dual-path unit structure, the first feature extraction network is used to capture long-range dependencies in the feature map, and the second feature extraction network is used to learn the importance weights of each channel feature. The parallel structure of the two can simultaneously model spatial and channel-dimensional features, thereby effectively distinguishing distribution network defects with similar morphologies (such as porcelain insulator damage and glass insulator spontaneous explosion, loose and broken binding wires, etc.), avoiding the problem of missing subtle defects and class confusion, and significantly improving the model's feature extraction and expression capabilities. At the same time, a weighted cross-comparison (CIoU) loss function is introduced into the detection head network to replace the traditional CIoU. By using dynamic focusing coefficients to reduce the loss contribution of simple samples, the model focuses on difficult-to-identify samples, such as low-frequency transformer oil leakage and lightning flashover of porcelain insulators. While ensuring training stability and convergence speed, this effectively alleviates the problem of low detection accuracy of rare defects caused by class imbalance, thereby improving the model's robustness and generalization performance in detecting various distribution network defects.
[0066] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0067] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0068] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0069] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0070] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for detecting defects in power distribution network components, characterized in that, include: The image of the distribution network component to be detected is input into the programmable gradient information network of the YOLOv9 network, and the auxiliary feature map extracted by the programmable gradient information network is input into the first head network of the YOLOv9 network. The image of the distribution network component to be detected is input into the backbone network of the YOLOv9 network, and a three-layer feature map is output. The third-layer feature map is input into the SPPELAN module for multi-scale pooling and aggregation, and the target third-layer feature map is output. The first layer feature map, the second layer feature map, and the target third layer feature map are respectively input into the first RepNCSPELAN4 module, the second RepNCSPELAN4 module, and the MHSENet module in the neck network of the YOLOv9 network for feature fusion, and the fused feature map is output. The fused feature map is input into the second head network of the YOLOv9 network; wherein, the third layer feature map of the target is input into the MHSENet module for feature fusion includes: The local features of the third layer feature map of the target are extracted layer by layer using a multi-convolutional perceptual framework; We utilize the MHSEBlock dual-path structural unit to enhance the attention of local features extracted by the multi-convolutional perceptual framework; Based on the prediction results output by the first head network and the second head network, the defect identification and classification results of the distribution network components to be detected are obtained.
2. The method for detecting defects in distribution network components according to claim 1, characterized in that, The multi-convolutional sensing framework includes a first convolutional combination unit, a channel cutting unit, a second convolutional combination unit, a third convolutional combination unit, and a convolutional unit; The MHSEBlock dual-path structure unit includes a first MHSEBlock unit and a second MHSEBlock unit.
3. The method for detecting defects in distribution network components according to claim 2, characterized in that, The local features of the third layer feature map of the target are extracted layer by layer using a multi-convolutional perceptual framework; Attention enhancement is performed on local features extracted by the multi-convolutional perceptual framework using the MHSEBlock dual-path structural unit, including: The target third-layer feature map is input into the first convolutional combination unit, and the first depth feature map is output. The first depth feature map is input into the channel segmentation unit for channel dimension segmentation; The first depth feature map after segmentation is input into the first MHSEBlock unit for attention enhancement, and the first depth feature map of the target is output. The first feature map of the target depth is input into the second convolutional combination unit, and the second depth feature map is output. The second depth feature map is input into the second MHSEBlock unit for attention enhancement, and the target second depth feature map is output. The second depth feature map of the target is input into the third convolutional combination unit, and the third depth feature map is output. The first, second, and third depth feature maps are element-wise summed and then input into a convolutional unit. The output of the convolutional unit is used as the output of the MHSENet module.
4. The method for detecting defects in distribution network components according to claim 3, characterized in that, The MHSEBlock unit performs attention enhancement on the input deep feature map, including: The depth feature map is input into the parallel first convolutional combination subunit and the second convolutional combination subunit, and the first target feature map and the second target feature map are output. The first target feature map is input into the feature extraction subunit, and the third target feature map is output. The second and third target feature maps are element-wise summed and then input into the third convolutional combination subunit to output the target depth feature map.
5. The method for detecting defects in distribution network components according to claim 4, characterized in that, The feature extraction subunit includes a first feature extraction network and a second feature extraction network in parallel. The outputs of the first feature extraction network and the second feature extraction network are concatenated and superimposed to obtain a third target feature map. Alternatively, the feature extraction subunit includes a first feature extraction network and a second feature extraction network connected in series, and a third target feature map is obtained based on the output of the second feature extraction network.
6. The method for detecting defects in distribution network components according to claim 5, characterized in that, The output of the first feature extraction network is represented as follows: , in, Indicates the first feature extraction network The output; This represents the feature map input to the first feature extraction network; This represents the output of the first 1x1 convolutional block after convolving the depth feature map. This represents the output of the second 1x1 convolutional block after convolving the depth feature map; This represents the output of the third 1x1 convolutional block after convolving the depth feature map; Indicates transpose; This indicates a normalization operation; The output of the second feature extraction network is represented as follows: , in, Indicates the second feature extraction network The output; This represents the feature map input to the second feature extraction network; Indicates average pooling; Indicates a fully connected layer; Represents the ReLU activation function; This represents the Sigmoid activation function.
7. The method for detecting defects in distribution network components according to claim 1, characterized in that, Before inputting the images of the distribution network components to be detected into the YOLOv9 network, the process includes iterative training of the YOLOv9 network using image samples of the distribution network components. The construction process of the loss function during iterative training includes: Based on the predicted bounding boxes output by the YOLOv9 network and the true bounding boxes of the image samples of the power distribution network components, the cross-union ratio loss and the weighted cross-union ratio weight coefficient are calculated. The first weighted cross-union ratio loss is obtained by multiplying the weighted cross-union ratio weight coefficients by the cross-union ratio loss. Based on the crossover ratio loss and its moving average, the gradient gain of the first weighted crossover ratio loss is constructed; based on the product of the first weighted crossover ratio loss and its gradient gain, the second weighted crossover ratio loss is obtained, so that the convergence speed of the YOLOv9 network gradually increases with the increase of the number of training iterations. Based on the ratio of the crossover ratio loss to its moving average, a dynamic outlier factor is obtained. Based on the dynamic outlier factor, a non-monotonic focusing coefficient of the first weighted crossover ratio loss is constructed. Based on the product of the first weighted crossover ratio loss and its non-monotonic focusing coefficient, a third weighted crossover ratio loss is obtained, so that as the number of training iterations increases, the convergence speed of the YOLOv9 network is proportional to the accuracy of its output predicted target boxes. The loss function is obtained by weighting the first weighted cross-union ratio loss, the second weighted cross-union ratio loss, and the third weighted cross-union ratio loss.
8. The method for detecting defects in distribution network components according to claim 7, characterized in that, Weighted intersection-union ratio weighting coefficients The calculation formula is: , in, This indicates the width and height of the predicted target bounding box; Represents the width and height of the actual target bounding box; This represents the width and height of the bounding box obtained by combining the predicted bounding box and the ground truth bounding box; ; First weighted intersection and comparison loss Represented as: , in, Indicates the crossover and union ratio loss; ; Second weighted intersection and comparison loss Represented as: , in, Indicates gradient gain; The moving average represents the crossover ratio loss; Indicates the exponential hyperparameter; Third weighted intersection and comparison loss Represented as: , in, Indicates the non-monotonic focusing coefficient; Represents the dynamic outlier factor. , This indicates an adjustable parameter.
9. A detection device for defects in power distribution network components, characterized in that, include: The first prediction module is used to input the image of the distribution network component to be detected into the programmable gradient information network of the YOLOv9 network, and to input the auxiliary feature map extracted by the programmable gradient information network into the first head network of the YOLOv9 network. The feature map extraction module is used to input the image of the distribution network component to be detected into the backbone network of the YOLOv9 network and output a three-layer feature map; the third-layer feature map is input into the SPPELAN module for multi-scale pooling and aggregation, and the target third-layer feature map is output. The second prediction module is used to input the first layer feature map, the second layer feature map, and the target third layer feature map into the first RepNCSPELAN4 module, the second RepNCSPELAN4 module, and the MHSENet module in the neck network of the YOLOv9 network for feature fusion, and output a fused feature map; and input the fused feature map into the second head network of the YOLOv9 network; wherein, inputting the target third layer feature map into the MHSENet module for feature fusion includes: The local feature extraction submodule is used to extract local features of the third-layer feature map of the target layer by layer using a multi-convolutional perceptual framework; The attention enhancement submodule is used to enhance the attention of local features extracted by the multi-convolutional perceptual framework using the MHSEBlock dual-path structural unit; The detection result acquisition module is used to obtain the defect identification and classification results of the distribution network components to be detected based on the prediction results output by the first head network and the second head network.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method for detecting defects in distribution network components as described in any one of claims 1 to 8.