Transmission network insulator defect detection method, device, system, and storage medium
The insulator defect detection model of the transmission grid constructed through deep learning uses 5-DCFM and DCAM modules and HCIoU loss function to solve the problems of low efficiency and insufficient accuracy in the existing technology, and achieve efficient and accurate insulator defect detection.
Patent Information
- Application Number
- CN202411770734.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The prior art is inefficient and has limited accuracy when detecting insulator defects in transmission grids, making it difficult to identify early and hidden defects, and is susceptible to external environment.
Deep learning method is used to build the insulator defect detection model of the transmission network, including the 5-DCFM module and the DCAM module. Combined with multi-scale feature extraction, hollow convolution and feature fusion mechanisms, the detection model is optimized using the HCIoU loss function, and the data set is acquired, preprocessed, divided and trained the model for identification.
It improves the accuracy and calculation efficiency of insulator defect detection in complex environments, enhances the adaptability and robustness of the model when it is irregular and multi-scale features, and significantly improves the practicality and reliability of the detection.
Smart Images

Figure CN119723036B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing technology, and in particular relates to a method and device, a system, and a storage medium for detecting defects in insulators in a power transmission network. Background Art
[0002] Insulators are crucial components of power systems, supporting and securing transmission lines and providing electrical insulation between live conductors and grounded parts. Defects in insulators, such as cracks, aging, or contamination, can lead to power equipment failures and even major power outages. Therefore, timely and accurate detection of insulator defects is crucial for the safe operation of power transmission networks.
[0003] Traditional insulator defect detection methods rely primarily on manual inspections or the use of thermal imaging, lidar, and other equipment. While these methods can effectively detect some defects, they have the following three limitations:
[0004] (1) Low efficiency of manual inspection: Manual inspection of transmission lines is costly and time-consuming;
[0005] (2) Limited detection accuracy of equipment: Although equipment such as thermal imaging and lidar can detect some defects, the detection results are easily affected by external environments such as weather and lighting, resulting in inaccurate detection.
[0006] (3) Difficulty in identifying early and hidden defects: Some insulator defects, such as tiny cracks or early aging phenomena, are not easily detected by traditional methods, which can easily lead to missed detection. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to provide a method and device, system and storage medium for detecting defects in transmission network insulators, which can greatly improve the detection efficiency and accuracy in an environment with complex background and noise interference.
[0008] To achieve the above object, the present invention adopts the following technical solutions:
[0009] A method for detecting defects in insulators of a transmission network, comprising:
[0010] Step S1, obtaining a data set of transmission network insulator defects;
[0011] Step S2: preprocessing the transmission network insulator defect dataset, and dividing the preprocessed transmission network insulator defect dataset into a training set and a test set;
[0012] Step S3: constructing a transmission network insulator defect detection model based on the preprocessed transmission network insulator defect dataset; wherein the transmission network insulator defect detection model includes: a 5-DCFM module and a DCAM module;
[0013] Step S4: training a transmission network insulator defect detection model based on the training set;
[0014] Step S5: Input the test set into the trained transmission network insulator defect detection model to identify the insulators in the current transmission network area and obtain the defect type and location.
[0015] Preferably, the 5-DCFM module adopts multi-scale feature extraction, dilated convolution and feature fusion mechanism.
[0016] Preferably, the DCAM module adopts a dilated convolution mechanism and an attention mechanism in the channel dimension and the spatial dimension.
[0017] Preferably, the transmission network insulator defect detection model adopts the HCIoU loss function to simultaneously optimize the position, size, confidence and category prediction accuracy of the bounding box.
[0018] The present invention also provides a transmission network insulator defect detection device, comprising:
[0019] An acquisition module, used to acquire a data set of insulator defects in a transmission network;
[0020] A partitioning module is used to preprocess the transmission network insulator defect dataset and partition the preprocessed transmission network insulator defect dataset to obtain a training set and a test set;
[0021] A construction module is used to construct a transmission network insulator defect detection model based on the preprocessed transmission network insulator defect dataset; wherein the transmission network insulator defect detection model includes: a 5-DCFM module and a DCAM module;
[0022] A training module, used to train a transmission network insulator defect detection model based on a training set;
[0023] The detection module is used to input the test set into the trained transmission network insulator defect detection model to identify the insulators in the current transmission network area and obtain the defect type and location.
[0024] An embodiment of the present invention further provides a transmission network insulator defect detection system, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a transmission network insulator defect detection method when executed by the processor.
[0025] An embodiment of the present invention further provides a storage medium having a computer program stored thereon, wherein the computer program executes the method for detecting defects in insulators in a power transmission network when the computer program is run.
[0026] The present invention effectively improves the accuracy and computational efficiency of insulator defect detection in complex environments; it also enhances the adaptability and robustness when processing irregular and multi-scale features, significantly improving the practicality and reliability of insulator defect detection in transmission network. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] 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.
[0028] Figure 1 This is a flow chart of a method for detecting defects in insulators in a transmission network according to an embodiment of the present invention;
[0029] Figure 2 This is a schematic diagram of the structure of the transmission network insulator defect detection model;
[0030] Figure 3 Schematic diagram of the 5-DCFM module structure
[0031] Figure 4 This is a schematic diagram of the DCAM module structure. DETAILED DESCRIPTION
[0032] 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.
[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] Example 1:
[0035] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting defects in insulators in a transmission network, comprising:
[0036] Step S1, obtaining a data set of transmission network insulator defects;
[0037] Step S2: preprocessing the transmission network insulator defect dataset, and dividing the preprocessed transmission network insulator defect dataset into a training set and a test set;
[0038] Step S3: constructing a transmission network insulator defect detection model based on the preprocessed transmission network insulator defect dataset;
[0039] Step S4: training a transmission network insulator defect detection model based on the training set;
[0040] Step S5: Input the test set into the trained transmission network insulator defect detection model to identify the insulators in the current transmission network area and obtain the defect type and location.
[0041] As an implementation method of an embodiment of the present invention, in step S1, a camera is used to photograph an area containing insulator defects, capturing transmission network insulator defect images to form a data transmission network insulator defect dataset D1. The transmission network insulator defect images in D1 (hereinafter referred to as insulator defect images) are manually annotated so that the subsequent model can more accurately identify defects. During the annotation process, an annotation tool is used to frame the insulator defect area. The specific annotation work includes determining the horizontal and vertical coordinates of the upper left and lower right corners of the frame, and adding corresponding labels to each annotated defect area to mark the defect type of the insulator in that area.
[0042] As one implementation of this embodiment of the present invention, in step S2, all insulator defect images in D1 are first cropped to the same size. Typically, the number of actual transmission network insulator defect data samples is relatively small. To enhance model performance, D1 is expanded to obtain D2, where D2 contains multiple insulator defect images. Finally, the dataset is divided into training, validation, and test sets in an 8:1:1 ratio, ensuring that the distribution and diversity of each data set effectively support model training and evaluation.
[0043] The transmission network insulator defect dataset D1 is expanded using the following common data augmentation techniques:
[0044] ① Random pixel perturbation: Increase the diversity of samples by randomly changing the pixel values in the image. The specific implementation can be achieved using the cv2.randu() function.
[0045] ② Adding Gaussian noise: By adding Gaussian noise to simulate the performance of the image in a noisy environment, the robustness of the model can be improved. This can be achieved using the GaussianBlur() method in the ImageFilter module in the PIL library.
[0046] ③ Salt and pepper noise: Randomly changes some pixels in the image to black or white to simulate a defect-like effect. You can use the cv2.randSalt() function to add it.
[0047] ④ Enhance edges: Use edge detection algorithms to make the edges of the image more obvious and enhance the model’s sensitivity to defect edges. The cv2.Canny() function is often used to implement edge detection.
[0048] ⑤ Image flip: Flip the image horizontally or vertically to enrich the different perspectives of the sample. You can use the cv2.flip() function to flip the image.
[0049] Data augmentation aims to increase the amount of data to provide sufficient samples for training, validation, and testing, and to make the model more robust and reduce the model's sensitivity to single image features.
[0050] As one implementation of an embodiment of the present invention, in step S3, a deep learning-based transmission network insulator defect detection model is constructed. Insulator defect images from the transmission network insulator defect dataset are input into the transmission network insulator defect detection model. The transmission network insulator defect detection model is used to identify insulator defects on the transmission network. The model can identify different types of defects, such as insulator cracks, chips, and aging, and automatically generates a positioning frame to determine the specific location and range of the defect.
[0051] The defect detection model of transmission network insulators is as follows: Figure 2 As shown, the pre-processed first insulator defect image X1 is input into the transmission network insulator defect detection model for processing:
[0052] First, X1 is input into the first Conv module to generate the second insulator defect feature map X2. This first Conv module consists of a Conv2d layer with a convolution kernel size of 3×3 and a stride of 2, a BN layer, and a SiLU activation function layer, all connected in series. This first Conv module effectively extracts edge and local features of the image, providing better input data for subsequent layers.
[0053] Next, X2 is input into the second Conv module to generate the third insulator defect feature map X3; on this basis, X3 is passed to the first 5-DCFM module to generate a higher-level feature map, namely the fourth insulator defect feature map X4; after that, X4 is passed through the third Conv module, the second 5-DCFM module, the fourth Conv module, the third 5-DCFM module, the fifth Conv module, and the fourth 5-DCFM module in sequence to generate a series of feature maps, namely the fifth insulator defect feature map X5, the sixth insulator defect feature map X6, the seventh insulator defect feature map X7, the eighth insulator defect feature map X8, the ninth insulator defect feature map X9, and the tenth insulator defect feature map X10. 10These feature maps contain rich defect information at different levels and scales. The transmission network insulator defect detection model extracts features layer by layer, continuously analyzing and fusing image features to identify various defect characteristics in transmission network insulators. The first, second, third, fourth, and fifth Conv modules have the same structure. The first, second, third, fourth, and fifth 5-DCFM modules also have the same structure.
[0054] X 10 It is then passed to the DCAM module for further processing to generate the insulator defect enhancement feature map X 10 ';
[0055] Then X 10 'Input into the SPPF module to generate the eleventh insulator defect characteristic diagram X 11 ; for X 11 Perform upsample operation (Upsample) to generate the twelfth insulator defect feature map X 12 ; X8 and X 12 Perform Concat operation to generate the thirteenth insulator defect characteristic map X 13 ;
[0056] In order to further extract effective features, X 13 Input into the fifth 5-DCFM module to generate the fourteenth insulator defect characteristic map X 14 ; for X 14 Perform Upsample operation to generate the fifteenth insulator defect characteristic map X 15 ; X6 and X 15 Perform Concat operation to generate the sixteenth insulator defect characteristic map X 16 ; X 16 Input into the sixth 5-DCFM module to generate the seventeenth insulator defect characteristic map X 17 ; X 17 Input into the sixth Conv module to generate the eighteenth insulator defect feature map X 18 ;
[0057] In order to further enhance the features, X 14 and X 18 Perform Concat operation to generate the nineteenth insulator defect characteristic map X 19 ; X 19 Input into the seventh 5-DCFM module to generate the twentieth insulator defect characteristic map X 20 ; X 20Input into the seventh Conv module to generate the twenty-first insulator defect feature map X 21 ; X 11 and X 21 Perform Concat operation to generate the twenty-second insulator defect characteristic diagram X 22 ; X 22 Input into the eighth 5-DCFM module to generate the twenty-third insulator defect characteristic diagram X 23 ;
[0058] Finally, X 17 、X 20 、X 23 These are input into the target prediction head, which outputs a tensor containing the prediction information. Each row of the tensor corresponds to a detection result for the insulator defect image, including information such as the predicted bounding box coordinates, defect category label, and confidence score.
[0059] Further, step S3 specifically includes:
[0060] Step 3.1: Input the preprocessed first insulator defect image X1 into the transmission network insulator defect detection model for processing. First, input X1 into the first Conv module to generate the second insulator defect feature map X2. This first Conv module consists of a Conv2d layer with a convolution kernel size of 3×3 and a stride of 2, a BN layer, and a SiLU activation function layer in series. The first Conv module effectively extracts edge and local features of the image, providing better input data for subsequent layers.
[0061] Next, X2 is input into the second Conv module to generate the third insulator defect feature map X3; on this basis, X3 is passed to the first 5-DCFM module to generate a higher-level feature map and obtain the fourth insulator defect feature map X4; then, X4 is passed through the third Conv module, the second 5-DCFM module, the fourth Conv module, the third 5-DCFM module, the fifth Conv module, and the fourth 5-DCFM module in sequence to generate a series of feature maps, namely the fifth insulator defect feature map X5, the sixth insulator defect feature map X6, the seventh insulator defect feature map X7, the eighth insulator defect feature map X8, the ninth insulator defect feature map X9, and the tenth insulator defect feature map X10. 10 These feature maps contain rich defect information at different levels and scales. The transmission network insulator defect detection model uses a layer-by-layer extraction method to continuously analyze and fuse image features to identify various defect characteristics in transmission network insulators.
[0062] like Figure 3As shown, the present invention designs a 5-DCFM module, which uses multi-scale feature extraction, void convolution and feature fusion to improve the robustness of the model in complex scenarios, thereby improving the detection accuracy of insulator defects and the generalization of the model.
[0063] The 5-DCFM module has five branches:
[0064] In branch A, the first intermediate defect feature map F1 is fed into a Conv2d layer with a 1×1 convolution kernel to generate the second intermediate defect feature map F2. F2 is then fed into a Conv2d layer with a 3×3 convolution kernel to generate the third intermediate defect feature map F3. Layer-by-layer convolution with small convolution kernels (1×1 and 3×3) allows for the extraction of detailed insulator defect information, particularly the characteristics of small insulator defects.
[0065] In the B branch, F1 is input into the X_AvgPool layer for horizontal average pooling operation and into the Y_AvgPool layer for vertical average pooling operation to obtain the fourth intermediate defect feature map F4 and the fifth intermediate defect feature map F5 respectively; F4 and F5 are concat-operated to obtain the sixth intermediate defect feature map F6; F6 is then input into the Conv2d layer and the BN layer with a convolution kernel size of 3×3 to obtain the weight Ω of each channel; then, F1 directly input into the C branch is element-wise multiplied by the weight Ω to obtain the seventh intermediate defect feature map F7; F7 is input into the Conv2d layer with a convolution kernel size of 3×3 and activated using the Sigmoid activation function to obtain the eighth intermediate defect feature map F8; finally, F7 and F8 are concat-operated to obtain the ninth intermediate defect feature map F9.
[0066] In the D branch, F1 is sequentially passed through the Conv2d layers with convolution kernel sizes of 1×1, 5×5, and 3×3, where the dilation rate of the Conv2d layer with a convolution kernel size of 3×3 is 5, and the tenth intermediate defect feature map F is obtained. 10 ; Using dilated convolution, we can capture the features of different receptive fields while maintaining the resolution. 10 Perform the Concat operation to obtain the eleventh intermediate defect feature map F 11 ;
[0067] In the E branch, F1 is sequentially input into the Conv2d layer with convolution kernel size of 1×1, 9×9, and 3×3, where the void rate of the Conv2d layer with convolution kernel size of 3×3 is 9, and the twelfth intermediate defect feature map F is obtained. 12 ; Through 9×9 convolution, the receptive field is expanded to obtain more global information. 12Perform the Concat operation to obtain the thirteenth intermediate defect feature map F 13 ; F3 of the A branch output and F of the D branch output 11 and F 13 Perform the Concat operation and then use the Sigmoid activation function to activate the insulator to improve the recognition ability of insulator defect types (such as contamination, cracks, and foreign matter adhesion), enhance the generalization performance of the model, and obtain the fourteenth intermediate defect feature map F 14 , F 14 is the final output feature map of the 5-DCFM module.
[0068] Step 3.2: X 10 It is then passed to the DCAM module for further processing to generate the insulator defect enhancement feature map X 10 ';
[0069] like Figure 4 As shown in the figure, the present invention designs a DCAM module that utilizes an attention mechanism in both channel and spatial dimensions to enhance focus on key information, effectively filter redundant background information, and strengthen the detection capabilities of different defect types. Dilated convolution can capture features at different scales, detecting even small insulator defects while also addressing defects such as large-scale insulator contamination. The attention mechanism automatically ignores irrelevant background and focuses on the insulator and its defective area. Dilated convolution, combined with the attention mechanism, provides enhanced robustness to complex weather conditions, reducing false and missed detections.
[0070] The tenth insulator defect characteristic diagram X 10 Input to DCAM module, first set X 10 After inputting the Conv2d layer with a convolution kernel size of 3×3 and a void rate of 1, the first enhanced defect feature map X is obtained. 10_1 , then X 10_1 Input to the BN layer and ReLU activation layer for processing to obtain the second enhanced defect feature map X 10_2 ; Then X 10_2 After inputting into the Conv2d layer with a convolution kernel size of 3×3 and a void rate of 1, the third enhanced defect feature map X is obtained. 10_3 , then X 10_3 Input to the BN layer and ReLU activation layer for processing to obtain the fourth enhanced defect feature map X 10_4 ; Then X 10_4 After inputting into the Conv2d layer with a convolution kernel size of 3×3 and a void rate of 1, the fifth enhanced defect feature map X is obtained. 10_5 , then X 10_5 Input to the BN layer and ReLU activation layer for processing to obtain the sixth enhanced defect feature map X 10_6 ; Then X10_6 Input them into the Global Average Pool layer and the Global Max Pool layer respectively to get two one-dimensional vectors respectively; perform Concat operation on the two one-dimensional vectors, then pass them through one-dimensional convolution (Conv1d), and pass them through Sigmoid activation function to get the weight ω of each channel, and finally add the weight ω to X 10_6 Multiply to get the insulator defect enhancement characteristic map X 10 ', X 10 ' is the final output feature map of the DCAM module.
[0071] Step 3.3: X 10 'Input into the SPPF module to generate the eleventh insulator defect characteristic diagram X 11 ; for X 11 Perform upsample operation (Upsample) to generate the twelfth insulator defect feature map X 12 ; X8 and X 12 Perform Concat operation to generate the thirteenth insulator defect characteristic map X 13 ;
[0072] In order to further extract effective features, X 13 Input into the fifth 5-DCFM module to generate the fourteenth insulator defect characteristic map X 14 ; for X 14 Perform Upsample operation to generate the fifteenth insulator defect characteristic map X 15 ; X6 and X 15 Perform Concat operation to generate the sixteenth insulator defect characteristic map X 16 ; X 16 Input into the sixth 5-DCFM module to generate the seventeenth insulator defect characteristic map X 17 ; X 17 Input into the sixth Conv module to generate the eighteenth insulator defect feature map X 18 ;
[0073] In order to further enhance the features, X 14 and X 18 Perform Concat operation to generate the nineteenth insulator defect characteristic map X 19 ; X 19 Input into the seventh 5-DCFM module to generate the twentieth insulator defect characteristic map X 20 ; X 20 Input into the seventh Conv module to generate the twenty-first insulator defect feature map X 21 ; X 11 and X 21Perform Concat operation to generate the twenty-second insulator defect characteristic diagram X 22 ; X 22 Input into the eighth 5-DCFM module to generate the twenty-third insulator defect characteristic diagram X 23 ;
[0074] Step 3.4: X 17 、X 20 、X 23 Each of these is input into the target prediction head, which outputs a tensor containing the prediction information. Each row of the tensor corresponds to a detection result, including the predicted bounding box coordinates, defect category label, and confidence score. This structure achieves accurate detection and classification of transmission network insulator defects through layer-by-layer extraction, concatenation, and fusion.
[0075] In deep learning object detection models, the head is responsible for further parsing and processing the feature map to directly predict the object's category, location, and confidence level. The output of the detection head is typically a three-dimensional tensor, with each row containing prediction information for a specific spatial location, including the category probability of each predicted box, the coordinates of the bounding box, and the confidence level of the object's presence. This information provides the model with key parameters for localization and classification.
[0076] (1) Bounding box prediction
[0077] In object detection, the image is divided into multiple grids, and each grid cell is responsible for predicting several bounding boxes. The task of bounding box prediction is to determine the location of the object, specifically including the following parameters:
[0078] Center point coordinates (x, y): relative to the center point position of the feature map cell, the relative position of the cell is offset to determine the position of the bounding box center in the entire image.
[0079] Width and height (w,h): The width and height of the bounding box relative to the overall width and height of the image, ensuring that the predicted bounding box has the correct scale and position.
[0080] To ensure more stable model training, the bounding box coordinates are normalized using a sigmoid function after prediction, limiting the coordinate output values to between 0 and 1. This process ensures more accurate bounding box coordinate predictions and helps prevent the predicted box from being too large or too small, thereby reducing bias.
[0081] (2) Category and confidence prediction
[0082] In the prediction of each bounding box, in addition to providing coordinates, you also need to predict the category and confidence:
[0083] Class Prediction: The model outputs a probability vector representing the probability of each class within the bounding box. This probability allows the model to identify specific object types, such as insulators and poles.
[0084] Confidence Prediction: The confidence level indicates the model's confidence in the presence of an object within the current bounding box. Confidence values range from 0 to 1, with higher values indicating a greater confidence level. Typically, during post-processing of the detection model, bounding boxes with higher confidence levels are filtered based on a confidence threshold to improve detection accuracy.
[0085] In practice, the Head output is a three-dimensional tensor. Each element of this tensor contains prediction information for each spatial location, namely, the category probability of each predicted box, the coordinates of the bounding box, and the confidence level of the object's presence. Specifically, for each location on the feature map, the tensor provides detailed information about all the corresponding bounding boxes. This structural design allows for more efficient simultaneous output of classification and localization information, ensuring the model's detection accuracy and efficiency.
[0086] During training, the transmission network insulator defect detection model uses the HCIoU loss function to simultaneously optimize the bounding box location, size, confidence, and class prediction accuracy. This loss function helps the transmission channel tree obstacle monitoring model balance multiple aspects to achieve the best overall performance.
[0087] This paper designs an HCIoU loss function for training a power transmission network insulator defect detection model. This function accurately calculates the difference between the predicted and true bounding boxes, resolving performance issues in detecting difficult-to-determine regions. In addition to considering the overlap between the detection and true bounding boxes, it also incorporates factors such as center distance, bounding box shape differences, and a distance penalty, making detection more stable and accurate. By integrating multiple losses, the detection box is more closely aligned with the target's true bounding box. This allows for effective detection even when the target varies significantly in size, shape, or position.
[0088] The HCIoU loss function is defined as follows:
[0089]
[0090] Among them, IoU represents the intersection-over-union ratio of the predicted box and the real box, that is, B and B gt Represent the predicted box and the real box respectively; b and b gt Represent the center points of the predicted box and the real box respectively; ρ(·) represents the Euclidean distance between the two points; w c and h c Represents the width and height of the minimum bounding box composed of the predicted box and the real box respectively; c represents the diagonal of the minimum bounding box; w gtand h gt Represents the width and height of the real box respectively; w p and h p They represent the width and height of the prediction box respectively; λ1, λ2, λ3, and λ4 are the weight coefficients of each part, and the sum of the four is 1; m is the threshold parameter. When b and b gt When the distance is too far, a penalty is imposed to prevent the detection box from shifting too far and avoid missed detections.
[0091] In the experiment of the present invention, the size of the feature map is set to H×W×C, where H is the height of the feature map, W is the width of the feature map, and C is the number of channels of the feature map.
[0092] The preprocessed first insulator defect image X1 (size 512×512×3) is input into the transmission network insulator defect detection model for processing: First, X1 is input into the first Conv module to generate the second insulator defect feature map X2 (size 256×256×64). This first Conv module is composed of a Conv2d layer with a convolution kernel size of 3×3 and a stride of 2, a BN layer, and a SiLU activation function layer in series. The first Conv module effectively extracts edge and local features of the image, providing better input data for subsequent layers.
[0093] Next, X2 is input into the second Conv module to generate the third insulator defect feature map X3, which is 128×128×128 in size. On this basis, X3 is passed to the first 5-DCFM module to generate a higher-level feature map and obtain the fourth insulator defect feature map X4, which is 128×128×256 in size. After that, X4 is passed through the third Conv module, the second 5-DCFM module, the fourth Conv module, the third 5-DCFM module, the fifth Conv module, and the fourth 5-DCFM module in sequence to generate a series of feature maps, namely the fifth insulator defect feature map X5, the sixth insulator defect feature map X6, the seventh insulator defect feature map X7, the eighth insulator defect feature map X8, the ninth insulator defect feature map X9, and the tenth insulator defect feature map X10. 10 ;
[0094] X 10 It is then passed to the DCAM module for further processing to generate an insulator defect enhancement feature map X with a size of 16×16×512 10 ';
[0095] Then X 10 'Input into the SPPF module to generate the eleventh insulator defect feature map X with a size of 16×16×512 11 ; for X 11Perform Upsample operation to generate the twelfth insulator defect feature map X with a size of 32×32×512 12 ; X8 and X 12 Perform the Concat operation to generate the thirteenth insulator defect characteristic map X with a size of 32×32×1024 13 ;
[0096] In order to further extract effective features, X 13 Input into the fifth 5-DCFM module to generate the fourteenth insulator defect feature map X with a size of 32×32×512 14 ; for X 14 Perform Upsample operation to generate the fifteenth insulator defect feature map X with a size of 64×64×512 15 ; X6 and X 15 Perform the Concat operation to generate the insulator defect feature map X with a size of 64×64×1024. 16 ; X 16 Input into the sixth 5-DCFM module to generate the seventeenth insulator defect feature map X with a size of 64×64×256 17 ; X 17 Input into the sixth Conv module to generate the eighteenth insulator defect feature map X with a size of 32×32×256 18 ;
[0097] In order to further enhance the features, X 14 and X 18 Perform the Concat operation to generate the nineteenth insulator defect characteristic map X with a size of 32×32×768 19 ; X 19 Input into the seventh 5-DCFM module to generate the twentieth insulator defect feature map X with a size of 32×32×512 20 ; X 20 Input into the seventh Conv module to generate the twenty-first insulator defect feature map X with a size of 16×16×512 21 ; X 11 and X 21 Perform the Concat operation to generate the 22nd insulator defect characteristic map X with a size of 16×16×1024 22 ; X 22 Input into the eighth 5-DCFM module to generate the twenty-third insulator defect feature map X with a size of 16×16×512 23 ;
[0098] Finally, X 17 、X 20 、X 23Each of these is input into the target prediction head, which outputs a tensor containing the prediction information. Each row of the tensor corresponds to a detection result, including the predicted bounding box coordinates, defect category label, and confidence score. This structure achieves accurate detection and classification of transmission network insulator defects through layer-by-layer extraction, concatenation, and fusion.
[0099] As an implementation method of an embodiment of the present invention, in step S4, the neural network parameters of the transmission network insulator defect detection model are first initialized. Subsequently, the hyperparameters related to the transmission network insulator defect detection model are set, including but not limited to key settings such as the training round (epoch), the size of each batch of data (batch size), the choice of optimizer (such as SGD, Adam, etc.), and the learning rate (learning rate). After completing the model initialization, the data of the training set and the validation set are divided into multiple small batches and input into the model in batches. First, a batch of training set data is input into the model each time, and the model performs forward propagation on the batch data, calculates the prediction results, and calculates the loss value loss according to the loss function.
[0100] During training, the backpropagation algorithm calculates the gradient of the loss value relative to the model parameters, and the optimizer updates the parameters of each layer of the model to gradually reduce the loss value. With each parameter update, the model gradually learns and optimizes its ability to extract features from the input data.
[0101] After completing one round of training (i.e., one epoch) for all batches of data from the training set, the validation set data is fed into the model in batches for validation, and the batch loss value (batch_loss) corresponding to the validation set is calculated. The validation set loss value is primarily used to monitor model performance and detect overfitting or underfitting. To prevent overfitting, the training process incorporates an early stopping mechanism. If the validation loss value does not significantly decrease over multiple rounds of training, training is terminated early. Overfitting is manifested as a model that performs well on the training set but performs poorly on the validation set.
[0102] After multiple rounds of training, as the training and validation losses gradually converge, the model gradually reaches the expected performance standard, indicating that the model has effectively learned the characteristics of insulator defects and can accurately detect them. Generally, when the validation loss (batch_loss) reaches a certain threshold or stops decreasing significantly after several consecutive rounds, the model is considered to have converged and the training process can be terminated. The trained model has appropriate parameter settings and strong generalization capabilities, making it suitable for application to new transmission network insulator defect detection tasks.
[0103] The 5-DCFM module of this invention utilizes multi-scale feature extraction, dilated convolution, and a channel attention mechanism to enhance the model's robustness in complex scenarios, thereby improving insulator defect detection accuracy and model generalization. In practical applications of insulator defect detection in power transmission networks, the 5-DCFM module effectively addresses issues such as complex insulator defect features, diverse target sizes, and background noise interference, ensuring the model's ability to accurately detect tiny cracks, contamination, and foreign matter on insulators.
[0104] This invention utilizes the DCAM module, employing an attention mechanism across both channel and spatial dimensions, to enhance the model's focus on key information, effectively filtering out redundant background information and strengthening its ability to detect different types of defects. The dilated convolution module is capable of capturing features at different scales, enabling the detection of even small insulator defects while also addressing defects such as large-scale insulator contamination. Through this attention mechanism, the model automatically ignores irrelevant background and focuses on the insulator and its defective areas. The combination of dilated convolution and the attention mechanism makes the model more robust to complex weather conditions, reducing false positives and missed detections.
[0105] This paper designs an HCIoU loss function for training a power transmission network insulator defect detection model. This function accurately calculates the difference between the predicted and true bounding boxes, resolving performance issues in detecting difficult-to-demarcate areas. In addition to considering the overlap between the detection and true bounding boxes, it also incorporates factors such as center distance, bounding box shape differences, and a distance penalty, making detection more stable and accurate. By integrating multiple losses, the detection box is more closely aligned with the target's true bounding box. This allows for effective detection even when the target has significant differences in size, shape, or position.
[0106] Example 2:
[0107] An embodiment of the present invention further provides a transmission network insulator defect detection device, comprising:
[0108] An acquisition module, used to acquire a data set of insulator defects in a transmission network;
[0109] A partitioning module is used to preprocess the transmission network insulator defect dataset and partition the preprocessed transmission network insulator defect dataset to obtain a training set and a test set;
[0110] A construction module is used to construct a transmission network insulator defect detection model based on the preprocessed transmission network insulator defect dataset; wherein the transmission network insulator defect detection model includes: a 5-DCFM module and a DCAM module;
[0111] A training module, used to train a transmission network insulator defect detection model based on a training set;
[0112] The detection module is used to input the test set into the trained transmission network insulator defect detection model to identify the insulators in the current transmission network area and obtain the defect type and location.
[0113] Example 3:
[0114] An embodiment of the present invention further provides a transmission network insulator defect detection system, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a transmission network insulator defect detection method when executed by the processor.
[0115] Example 4:
[0116] An embodiment of the present invention further provides a storage medium having a computer program stored thereon, wherein the computer program executes the method for detecting defects in insulators in a power transmission network when the computer program is run.
[0117] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by persons skilled in the art should fall within the scope of protection defined by the claims of the present invention.
Claims
1. A method for detecting defects in insulators of a transmission network, characterized in that: include: Step S1, obtaining a data set of transmission network insulator defects; Step S2: preprocessing the transmission network insulator defect dataset, and dividing the preprocessed transmission network insulator defect dataset into a training set and a test set; Step S3: constructing a transmission network insulator defect detection model based on the preprocessed transmission network insulator defect dataset; wherein the transmission network insulator defect detection model includes: a 5-DCFM module and a DCAM module; Step S4: training a transmission network insulator defect detection model based on the training set; Step S5: Input the test set into the trained transmission network insulator defect detection model to identify the insulators in the current transmission network area and obtain the defect type and location; The 5-DCFM module uses multi-scale feature extraction, dilated convolution, and feature fusion mechanisms; the DCAM module uses dilated convolution and attention mechanisms in both channel and spatial dimensions; and the transmission network insulator defect detection model uses the HCIoU loss function to simultaneously optimize the position, size, confidence, and category prediction accuracy of the bounding box. The preprocessed first insulator defect image X1 is input into the first Conv module to generate the second insulator defect feature map X2, and X2 is further input into the second Conv module to generate the third insulator defect feature map X3; on this basis, X3 is passed to the first 5-DCFM module to generate a higher-level feature map, namely the fourth insulator defect feature map X4; then, X4 is passed through the third Conv module, the second 5-DCFM module, the fourth Conv module, the third 5-DCFM module, the fifth Conv module, and the fourth 5-DCFM module in sequence to generate a series of feature maps, namely the fifth insulator defect feature map X5, the sixth insulator defect feature map X6, the seventh insulator defect feature map X7, the eighth insulator defect feature map X8, the ninth insulator defect feature map X9, and the tenth insulator defect feature map X10. 10 ;X 10 It is then passed to the DCAM module for further processing to generate the insulator defect enhancement feature map X 10 '; then X 10 'Input into the SPPF module to generate the eleventh insulator defect characteristic diagram X 11 ; for X 11 Perform upsampling operation to generate the twelfth insulator defect feature map X 12 ; X8 and X 12 Perform Concat operation to generate the thirteenth insulator defect characteristic map X 13 ; X 13 Input into the fifth 5-DCFM module to generate the fourteenth insulator defect characteristic map X 14 ; for X 14 Perform Upsample operation to generate the fifteenth insulator defect characteristic map X 15 ; X6 and X 15 Perform Concat operation to generate the sixteenth insulator defect characteristic map X 16 ; X 16 Input into the sixth 5-DCFM module to generate the seventeenth insulator defect characteristic map X 17 ; X 17 Input into the sixth Conv module to generate the eighteenth insulator defect feature map X 18 ; X 14 and X 18 Perform Concat operation to generate the nineteenth insulator defect characteristic map X 19 ; X 19 Input into the seventh 5-DCFM module to generate the twentieth insulator defect characteristic map X 20 ; X 20 Input into the seventh Conv module to generate the twenty-first insulator defect feature map X 21 ; X 11 and X 21 Perform Concat operation to generate the twenty-second insulator defect characteristic diagram X 22 ; X 22 Input into the eighth 5-DCFM module to generate the twenty-third insulator defect characteristic diagram X 23 ; X 17 、X 20 、X 23 They are respectively input into the target prediction head, and the output includes the predicted bounding box coordinates, defect category label and confidence score information; the structures of the first 5-DCFM module, the second 5-DCFM module, the third 5-DCFM module, the fourth 5-DCFM module, the fifth 5-DCFM module, the sixth 5-DCFM module and the seventh 5-DCFM module are the same; The 5-DCFM module has five branches: In branch A, the first intermediate defect feature map F1 is input into the Conv2d layer with a convolution kernel size of 1×1 to obtain the second intermediate defect feature map F2; F2 is then input into the Conv2d layer with a convolution kernel size of 3×3 to obtain the third intermediate defect feature map F3; In the B branch, F1 is input into the X_AvgPool layer for horizontal average pooling and into the Y_AvgPool layer for vertical average pooling to obtain the fourth intermediate defect feature map F4 and the fifth intermediate defect feature map F5, respectively; F4 and F5 are concat-operated to obtain the sixth intermediate defect feature map F6; F6 is then input into the Conv2d layer with a convolution kernel size of 3×3 and the BN layer to obtain the weight Ω of each channel; then, F1 directly input into the C branch is element-wise multiplied by the weight Ω to obtain the seventh intermediate defect feature map F7; F7 is input into the Conv2d layer with a convolution kernel size of 3×3 and activated using the Sigmoid activation function to obtain the eighth intermediate defect feature map F8; finally, F7 and F8 are concat-operated to obtain the ninth intermediate defect feature map F9; In the D branch, F1 is sequentially passed through the Conv2d layers with convolution kernel sizes of 1×1, 5×5, and 3×3, where the void rate of the Conv2d layer with a convolution kernel size of 3×3 is 5, and the tenth intermediate defect feature map F is obtained. 10 ; Change F9 and F 10 Perform the Concat operation to obtain the eleventh intermediate defect feature map F 11 ; In the E branch, F1 is sequentially input into the Conv2d layer with convolution kernel size of 1×1, 9×9, and 3×3, where the void rate of the Conv2d layer with convolution kernel size of 3×3 is 9, and the twelfth intermediate defect feature map F is obtained. 12 ; Output F9 and F of B branch 12 Perform the Concat operation to obtain the thirteenth intermediate defect feature map F 13 ; F3 of the A branch output and F of the D branch output 11 and F 13 Perform the Concat operation and then activate it using the Sigmoid activation function to obtain the fourteenth intermediate defect feature map F 14 , F 14 is the final output feature map of the 5-DCFM module; The tenth insulator defect characteristic diagram X 10 Input to DCAM module, first set X 10 After inputting the Conv2d layer with a convolution kernel size of 3×3 and a void rate of 1, the first enhanced defect feature map X is obtained. 10_1 , then X 10_1 Input to the BN layer and ReLU activation layer for processing to obtain the second enhanced defect feature map X 10_2 ; Then X 10_2 After inputting into the Conv2d layer with a convolution kernel size of 3×3 and a void rate of 1, the third enhanced defect feature map X is obtained. 10_3 , then X 10_3 Input to the BN layer and ReLU activation layer for processing to obtain the fourth enhanced defect feature map X 10_4 ; Then X 10_4 After inputting into the Conv2d layer with a convolution kernel size of 3×3 and a void rate of 1, the fifth enhanced defect feature map X is obtained. 10_5 , then X 10_5 Input to the BN layer and ReLU activation layer for processing to obtain the sixth enhanced defect feature map X 10_6 ; Then X 10_6 Input them into the global average pooling layer and the global maximum pooling layer respectively to obtain two one-dimensional vectors; perform concat operation on the two one-dimensional vectors, then pass them through one-dimensional convolution and Sigmoid activation function to obtain the weight ω of each channel, and finally add the weight ω to X 10_6 Multiply to get the insulator defect enhancement characteristic map X 10 ′,X 10 ' is the final output feature map of the DCAM module; The HCIoU loss function is defined as follows: Among them, IoU represents the intersection-over-union ratio of the predicted box and the real box, that is, B and B gt Represent the predicted box and the real box respectively; b and b gt Represent the center points of the predicted box and the real box respectively; ρ(·) represents the Euclidean distance between the two points; w c and h c Represents the width and height of the minimum bounding box composed of the predicted box and the real box respectively; c represents the diagonal of the minimum bounding box; w gt and h gt Represents the width and height of the real box respectively; w p and h p Represent the width and height of the prediction box respectively; λ1, λ2, λ3, λ4 are the weight coefficients of each part, and the sum of the four is 1; m is the threshold parameter.
2. A transmission network insulator defect detection device implementing the transmission network insulator defect detection method according to claim 1, characterized in that: include: An acquisition module, used to acquire a data set of insulator defects in a transmission network; A partitioning module is used to preprocess the transmission network insulator defect dataset and partition the preprocessed transmission network insulator defect dataset to obtain a training set and a test set; A construction module is used to construct a transmission network insulator defect detection model based on the preprocessed transmission network insulator defect dataset; wherein the transmission network insulator defect detection model includes: a 5-DCFM module and a DCAM module; A training module, used to train a transmission network insulator defect detection model based on a training set; The detection module is used to input the test set into the trained transmission network insulator defect detection model to identify the insulators in the current transmission network area and obtain the defect type and location.
3. A power transmission network insulator defect detection system, characterized in that: include: A memory and a processor, wherein the memory stores a computer program executed by the processor, and when the computer program is executed by the processor, the method for detecting defects in insulators in a power transmission network according to claim 1 is executed.
4. A storage medium, characterized in that The storage medium stores a computer program, which executes the method for detecting defects in insulators in a power transmission network according to claim 1 when running.
Citation Information
Patent Citations
Insulator defect detection method and device, terminal, storage medium and program product
CN118608498A
Fan blade defect detection method and system based on improved SSD model
WO2023173598A1