Insulator defect detection method and system based on RT-DETR improvement

By improving the RT-DETR model, using StarNet star network and partial self-attention mechanism, combining Inner-IoU and CIoU loss functions, the complexity of backbone network and attention mechanism design limitations are solved, and the efficiency of insulator defect detection is improved and Accuracy.

CN119323572AActive Publication Date: 2025-01-17STATE GRID JIANGXI ELECTRIC POWER CO LTD RES INST

Patent Information

Application Number
CN202411874576.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-01-17
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

In the existing insulator defect detection technology, the backbone network structure is complex, the feature information is redundant, the calculation complexity is high, which affects the detection efficiency and accuracy, and the attention mechanism and loss function design have limitations, resulting in low generalization ability and slow inference speed. .

Method used

Improve the RT-DETR model, use StarNet star network for feature extraction, replace the multi-head attention mechanism as part of the self-attention mechanism, improve the RepC3 convolution module as the RepMob convolution module, and combine Inner-IoU and CIoU loss functions to optimize the detection head and attention mechanisms to improve feature representation and detection efficiency.

Benefits of technology

It realizes efficient feature representation and small object detection, reduces the computational complexity, improves detection accuracy and model convergence speed, and enhances the detection ability of insulator defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323572A_ABST
    Figure CN119323572A_ABST
Patent Text Reader

Abstract

The invention discloses an insulator defect detection method and system based on RT-DETR improvement. The method comprises the following steps: collecting a disclosed insulator defect data set and obtaining an image as a data set through a video interception frame; the method comprises the following steps: carrying out improvement based on a target detection model RT-DETR, changing a backbone network into a StarNet star network to carry out feature extraction, carrying out further improvement, removing a P5 detection head, adding a P2 detection head, and improving a star convolution module in the StarNet star network; a multi-head attention mechanism is changed into a partial self-attention mechanism PSA, and further improvement is carried out to obtain an S-PSA attention mechanism module; a RepC3 convolution module is improved into a RepMob convolution module; combining the loss function by using Inner-IoU and CIoU to obtain an Inner-CIoU loss function, and carrying out loss calculation; and training the improved RT-DETR, verifying the improved RT-DETR to obtain an optimal weight, and loading the weight into the improved RT-DETR to carry out insulator defect detection. According to the invention, the defect detection is carried out on the insulator by using the improvement based on RT-DETR, so that the detection is more accurate and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of insulator defect detection, and in particular to an insulator defect detection method and system improved based on RT-DETR. Background Art

[0002] Insulators are an important part of transmission lines and are easily damaged when exposed to outdoor conditions for a long time. Effective detection of insulator defects is of great practical significance. Traditionally, insulator defect detection relies on manual inspection. However, with the emergence of deep learning in this field, object detection algorithms have gradually replaced traditional manual inspection. Compared with costly and time-consuming manual inspection, object detection algorithms can complete the task of insulator defect detection efficiently and safely.

[0003] At present, target detection algorithms are roughly divided into single-stage detection algorithms and two-stage detection algorithms. Although the two-stage detection algorithm has a higher upper limit of accuracy, the resulting computational cost is higher and more complex, and the cost of post-processing non-maximum suppression is too high, which cannot achieve end-to-end target detection, is not conducive to real-time target detection, and is not suitable for detecting insulator defects; the single-stage detection algorithm requires a process, so the computational cost is lower, and the detection process is relatively simple. The YOLO series is a very commonly used single-stage detection algorithm, but it still relies on non-maximum suppression to obtain a unique prediction box in the inference stage.

[0004] The invention with patent application number CN202410495935.5 proposes a lightweight insulator defect detection method based on improved YOLOv8, which is mainly trained according to the following steps: (1) Collecting the insulator fault data set of the transmission line inspection, preprocessing and data enhancement of the collected insulator images; (2) Obtaining the improved YOLOv8 network model and using the processed data set to train the network model; (3) Inputting the insulator data to be detected into the optimal detection model, and outputting the insulator defect detection result, that is, the fault category of the insulator and the location where the defect occurs. However, this scheme has the following defects: ① In the improvement of the backbone network in this scheme, a large number of residual networks are used for feature fusion, which will make the network more complex. In the FasterNet block used, the ADD operation is used to fuse the features. This fusion method will increase the redundancy of the features, and the ADD operation will increase the computational complexity and poor performance. ② The EMA attention mechanism and SPPF module used in the backbone network of this scheme not only have similar functions, resulting in redundancy and repeated extraction of multi-scale information, but also increase the complexity of the backbone network, which is not conducive to the subsequent input of the transformer module of RT-DETR. ③ The efficient layer aggregation network GELAN module used in this scheme aggregates information from many branches and then updates the overall gradient. The calculated information is extremely large and the computational complexity is high. ④ In the reasoning stage of this scheme, many redundant prediction boxes will be generated, and the backend data will be processed by NMS, which is not conducive to end-to-end detection tasks, making the reasoning inefficient and not conducive to real-time detection of insulators.

[0005] The invention with patent application number CN202410326526.2 proposes a traffic sign detection method based on improved RT-DETR, which is mainly trained according to the following steps: 1) Obtain public traffic sign images and divide the target detection data set required for training and testing; 2) Design an improved RT-DETR traffic sign detection model and propose an MCCA (Multi channel coordinated attention) attention mechanism; In order to improve the generation ability of offset and mask parameters, splice the MCCA attention module in the DCNv2 deformable convolution to generate the DCNv2att module; Replace the two BasicBlock blocks in the detection network Backbone with DCNv2att blocks; 3) Evaluate the training results of the traffic sign detection model based on the improved RT-DETR. However, this scheme has the following defects: ① In this method, too many residual connection branches are used in the back end of the backbone network, which greatly increases the complexity of the network, and the splicing of features using the ADD operation is inefficient, and this traditional convolutional network has limitations in the high-dimensional nonlinear transformation of feature representation. ② If the dataset deviation is large, the parameters learned by the deformable convolution will be more targeted at a certain dataset. When switching datasets, the detection effect will deteriorate and the generalization ability will be low. ③ The MCCA attention mechanism module in this method aggregates features along the x and y spatial directions redundantly. In the basic module of RT-DETR, the convolutional network and AIFI and CCFM can aggregate spatial information well. Adding this attention mechanism will make the network structure redundant, and the addition of two branches will make the calculation of gradient information more complicated.

[0006] The invention with patent application number CN202410005858.0 proposes an RT-DETR infrared weak aircraft detection method and system, which is mainly trained according to the following steps: 1) Select an infrared weak aircraft data set and divide it into a training set, a test set and a validation set; 2) Based on the RT-DETR network, change the Backbone backbone network to a VanillaNet minimalist neural network; 3) Replace the RepC3 structure in the neck of the RT-DETR network with a DWRC3 structure; 4) Finally introduce three partial convolutional layers as the 28th, 29th and 30th layers at the neck of the RT-DETR network, and use them as the outputs of the 12th, 15th and 18th layers of DWRC3, respectively, to complete the construction of the initial detection model; 5) Use the training set and the validation set to train the constructed initial detection model to obtain the trained detection model; 6) Use the trained detection model to detect the target to be detected. However, this scheme has the following defects: ① The VanillaNet used in this method is relatively weak in extracting some useful areas due to its relatively low nonlinearity, and has a weak ability to fuse multiple information due to the few network branches. ② The improved DWRC3 in this method replaces the SR part with ordinary convolutional layers, which has low feature extraction efficiency and adds a large number of residual structures. In addition, the ADD operation is used to fuse features, which will cause the network to increase a lot of redundancy and calculation and parameter volume; ③ The traditional P3, P4, and P5 detection heads are used without optimization for small components, which is not conducive to defect detection of small targets. ④ The loss function used does not take into account the direction of mismatch between the required true box and the predicted box, resulting in slower convergence and lower efficiency, because the predicted box may shift during the training process and ultimately lead to worse model effects.

[0007] The shortcomings of the above-mentioned prior art can be summarized as follows: for the backbone network, the network structure will cause redundancy of feature map information when extracting image features, and the ADD operation is widely used to fuse feature maps, which will lead to low fusion efficiency and greatly increase the network width, making the network complex and not concise enough. The traditional convolutional network has limitations in the high-dimensional nonlinear transformation of feature representation; the improved attention mechanism has many additional branches, which is very complicated when calculating gradient information, and will reduce the reasoning speed; the RepC3 module of the original network has no additional branches, which will consume certain computing resources compared to using branches, and the convolution module is not efficient enough. Using this kind of convolution for reasoning is not conducive to improving accuracy and cannot replace the convolutional network with branches. After the above-mentioned improvement of this module, the excessive addition of branches will cause the update of gradient information to be complicated and the complexity of the network, and the bounding box loss function cannot be self-adjusted according to different detectors and detection tasks, does not have strong generalization, and ignores the influence of the matching angle between the real box and the predicted box. Summary of the invention

[0008] In view of the deficiencies in the prior art, the object of the present invention is to provide an insulator defect detection method and system based on RT-DETR improvement.

[0009] In order to achieve the above object, the present invention provides the following technical solution: an improved insulator defect detection method based on RT-DETR, the detection method comprising the following steps: Collect publicly available insulator defect datasets and obtain images by capturing video frames as datasets, and split the datasets into training sets and validation sets; Based on the target detection model RT-DETR, the backbone network is changed to StarNet network for feature extraction, and the StarNet network is further improved by removing the P5 detection head and adding the P2 detection head, and improving the convolution module in the StarNet network; The multi-head attention mechanism in RT-DETR is changed to the partial self-attention mechanism PSA in YOLOv10, and the partial self-attention mechanism PSA is further improved to obtain the S-PSA attention mechanism module; Improve the RepC3 convolutional module in RT-DETR to the RepMob convolutional module; The loss function is combined with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation; The training set is input into the improved RT-DETR for training, and then verified in the validation set to obtain the best weight in the validation set; The optimal weights are loaded into the improved RT-DETR for insulator defect detection.

[0010] In a preferred embodiment, collecting a public insulator defect dataset and acquiring an image by capturing a video frame as a dataset comprises the following steps: First, we collect the public insulator defect dataset, and then collect the drone inspection video data provided by the power grid. We use the method of capturing frames from the video data to obtain the foreign object dataset. We use the LabelImg tool to annotate the foreign objects in the image, indicating the category and the true frame.

[0011] In a preferred embodiment, improving the star convolution module in the StarNet star network comprises the following steps: Input feature information, split the channel into two through the split layer, one channel uses point convolution for dimension increase, and the other channel undergoes deep convolution, and then is divided into two halves and passes through the fully connected layer respectively. One half uses the ReLU6 activation function to make the channel nonlinear, and the other half is not processed. Then the features of the two are fused through star operation, the features of different channels are multiplied two by two, and the fused features are integrated and strengthened through deep convolution. Then the channel is concat-spliced ​​with the channel of point convolution in the channel dimension, and then the channel shuffle operation is performed to strengthen the communication between channels, and finally integrated through the ordinary convolution layer.

[0012] In a preferred embodiment, the processing flow of the S-PSA attention mechanism module is as follows: first, the input information is subjected to a deep separable convolution for feature extraction, and then the obtained feature information is subjected to a ReLU6 activation function to introduce nonlinearity into the feature, and then the feature information is split through a split segmentation layer into two parts, 1 / 4 and 3 / 4, 1 / 4 feature information is not operated, 1 / 3 of the 3 / 4 feature information is not operated, and 2 / 3 of the 3 / 4 feature information is operated with a multi-head self-attention mechanism, and then it is fused with 1 / 3 of the 3 / 4 feature information that is not operated using a star operation, and then the feature information is split into two halves, one half is subjected to a point convolution to increase the dimension, and part of the channel information is fused, and then the global information is further obtained through a void convolution, and the result of the convolution is combined with the other half of the feature information that is not operated by a star operation, the learned global information is infiltrated into the channel, and then concat spliced ​​with the original 1 / 4 feature information, and then the learned global information is exchanged with the original 1 / 4 feature information through channel shuffling, and finally integrated through ordinary convolution.

[0013] In a preferred embodiment, the RepC3 convolution module in RT-DETR is improved to the RepMob convolution module, comprising the following steps: In the training phase, the input information is divided into three parts and then passed through three branches. The first branch does not process the information, the second branch uses 3×3 deep convolution to extract features, and the third branch uses 1×1 deep convolution to extract features. Then, the feature information of the three branches is fused through star operation, and then the SE channel attention mechanism is used to strengthen the channel information and distinguish the importance of the channel information. The channel information is then split into two parts. One part changes the dimensional information through point convolution for dimensionality reduction, and then passes through the ReLU6 activation function, and then adjusts the channel dimension through point convolution to increase the dimension. Finally, it is star-operated with the other part of the channel information that is not processed to obtain the final output; in the inference phase, the initial three branches are merged into a 3×3 deep convolution, and then the channel weights are calculated through the SE channel attention mechanism module to obtain important channels and unimportant channel information. The channel information is also split into two parts, one part is not processed, and the other part is channel information increased in dimension through point convolution, and then after the ReLU6 activation function, a star operation is performed with the unprocessed part of the channel information to obtain the output.

[0014] In a preferred embodiment, the loss function is combined with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation, including the following steps: Inner-IoU is calculated as follows: , , , , , , , in is the left boundary of the real box, is the right boundary of the real box, is the bottom boundary of the real box, is the top boundary of the real box, is the left boundary of the prediction box, is the right boundary of the prediction box, is the bottom boundary of the prediction box, is the top boundary of the prediction box, is the horizontal coordinate of the center point of the real frame, is the ordinate of the center point of the real frame, is the horizontal coordinate of the center point of the prediction box, is the ordinate of the center point of the prediction box, is the width of the real frame, is the height of the real box, w is the width of the predicted box, h is the height of the predicted box, ratio is the scale factor, inter is the intersection of the auxiliary box of the real box and the auxiliary box of the predicted box, and union is the union of the auxiliary box of the real box and the auxiliary box of the predicted box. Finally, we get is the IoU of the auxiliary box, which is then combined with the loss of CIoU. , , , , , Where b is the center coordinate of the prediction box, is the coordinate of the center point of the real frame, To calculate the Euclidean distance, is the weight function, v is a parameter to measure the similarity of aspect ratios, c is the diagonal distance of the minimum enclosing rectangle, It is the ratio of the intersection area of ​​the real box and the predicted box to the combined area. In order to consider the complete intersection between target boxes and introduce the new IoU after the correction factor, is the CIoU loss, It is the loss of Inner-IoU combined with CIoU.

[0015] An improved insulator defect detection system based on RT-DETR, including a data preprocessing module, an improved backbone network module, an improved attention mechanism module, an improved RepC3 convolution module, an improved loss function module, a model training module, and an insulator defect detection module; Data preprocessing module: collects publicly available insulator defect datasets and obtains images by capturing video frames as datasets, and splits the datasets into training sets and validation sets; Improved backbone network module: Based on the target detection model RT-DETR, the backbone network is changed to StarNet network for feature extraction, and the StarNet network is further improved by removing the P5 detection head and adding the P2 detection head, and improving the convolution module in the StarNet network; Improved attention mechanism module: The multi-head attention mechanism in RT-DETR is changed to the partial self-attention mechanism PSA in YOLOv10, and the partial self-attention mechanism PSA is further improved to obtain the S-PSA attention mechanism module; Improved RepC3 convolution module: The RepC3 convolution module in RT-DETR is improved to RepMob convolution module; Improved loss function module: The loss function is combined with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation; Model training module: input the training set into the improved RT-DETR for training, and verify it in the validation set to obtain the best weight in the validation set; Insulator defect detection module: The optimal weight is loaded into the improved RT-DETR for insulator defect detection.

[0016] In the above technical solution, the technical effects and advantages provided by the present invention are: 1. The present invention uses StarNet star network as a new backbone network for improvement. By using star operation, the mapping of high-dimensional feature space is realized while keeping the computational complexity low. By using star operation, richer feature representation is realized. In addition, the present invention further improves StarNet star network by adding P2 detection head to make small target detection more accurate, and improves star convolution module to make feature extraction more efficient. 2. The present invention improves the multi-head attention mechanism module, performs partial self-attention operations on it and then merges it, does not perform attention operations on all information, does not cause waste of computing resources of the attention mechanism, and can also make good use of the attention mechanism to pay more attention to defects; the present invention also improves the RepC3 convolution module, uses the self-developed RepMob convolution module, adds certain branches, does not increase too much calculation amount, and also improves the convolution module, uses star operation to improve the information fusion part, so that the top-down and bottom-up feature fusion is more efficient, and improves the utilization rate of feature information. The present invention also combines Inner-IoU with CIoU, uses auxiliary borders to improve the calculation of the bounding box loss function, and considers the center point distance and diagonal distance of the bounding box, and uses a function combined with the two to calculate the bounding box loss, thereby improving the model convergence speed and training accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0018] Figure 1 is a flow chart of the method of the present invention; Figure 2 This is a schematic diagram of the improved StarNet network; Figure 3 Schematic diagram of the improved star convolution module; Figure 4 Schematic diagram of the S-PSA attention mechanism module; Figure 5 This is a schematic diagram of the RepMob convolution module training phase; Figure 6 Schematic diagram of the RepMob convolutional module inference phase. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.

[0020] Example 1: Please refer to Figure 1 As shown, the improved insulator defect detection method based on RT-DETR described in this embodiment includes the following steps: (1) Collect publicly available insulator defect datasets and obtain images by capturing video frames as datasets; First, we collected the public insulator defect dataset, and then collected the drone inspection video data provided by the power grid. We used the method of capturing frames from the video data to obtain the foreign object dataset. We used the LabelImg tool to annotate the foreign objects in the image, indicating the category and the true frame, and split the dataset into a training set and a validation set (8:2).

[0021] (2) Based on the target detection model RT-DETR, the backbone network is changed to the StarNet network for feature extraction. The StarNet network is further improved by removing the P5 detection head and adding the P2 detection head to improve the small target detection effect. The convolution module in the StarNet network is also improved to make the features obtained by the network richer and more efficient. Improved StarNet network Figure 2 As shown, the image is input into the StarNet network, and the convolution downsampling module is used to first obtain the 2-fold downsampling features, and then the convolution downsampling operation is continued to obtain the 4-fold downsampling features, and then the features are fused and enriched through the star convolution module, and then the 8-fold and 16-fold downsampling image features are continued to be obtained, and the 32-fold downsampling features are removed. Because the insulator itself is small, the 32-fold downsampling detection head of P5 is generally used to detect large targets. In this embodiment, the P5 detection head is discarded, and the 4-fold downsampling detection head of P2 is added, which is more conducive to the detection of small targets such as insulators.

[0022] The improved star convolution module is as follows Figure 3As shown in the figure, first input the feature information, split the channel into two through the split segmentation layer, one channel uses point convolution to increase the dimension of convolution to improve the cross-channel information fusion, and the other channel undergoes deep convolution. Since deep convolution performs convolution on each channel separately and uses different convolution kernels, the extracted features can also be diverse, enhancing the feature representation ability of the network. After deep convolution, it is divided into two halves and passes through the fully connected layer respectively. One half uses the ReLU6 activation function to make the channel nonlinear, and the other half is not processed. Then the features of the two are fused through star operation, and the features of different channels are multiplied two by two. , it realizes efficient feature representation without too much additional computational overhead, can perform calculations in low-dimensional space, and can implicitly consider extremely high-dimensional features, which can provide efficient calculation and better feature representation. The fused features are integrated and strengthened through deep convolution, and then the channel is concat-concatenated with the channel of point convolution in the channel dimension. Then, because deep convolution lacks information exchange between its own channels and also lacks communication with point convolution channels, a channel shuffling operation is added to strengthen the communication between channels, and finally integrated through ordinary convolution layers. The improved star convolution module is easy to calculate and more efficient for extracting features.

[0023] The present invention uses the StarNet star network to improve the backbone network of the original model, and further improves the StarNet star network, so that the feature extraction part of the model is more efficient and simple to operate.

[0024] (3) The multi-head attention mechanism in RT-DETR is changed to the partial self-attention mechanism PSA in YOLOv10, and the partial self-attention mechanism PSA is further improved to obtain the S-PSA attention mechanism module. The partial self-attention mechanism is used to perform self-attention operations on part of the information, and the other information is convolved and fused with the information after the self-attention operation, which can also achieve the effect of self-attention and reduce resource waste; like Figure 4As shown in the figure, the processing flow of the S-PSA attention mechanism module is as follows: first, the input information is subjected to a deep separable convolution for feature extraction, which can generate diversified feature information and amplify and extract important features. The purpose is to better associate favorable information with global information during subsequent multi-head attention mechanism calculations. The obtained feature information is then subjected to a ReLU6 activation function. This computationally simple nonlinear activation function is used to introduce nonlinearity into the features, and then into the model, making the model nonlinear. The feature information is then split into two parts, 1 / 4 and 3 / 4, through a split layer. No operation is performed on the 1 / 4 feature information, no operation is performed on 1 / 3 of the 3 / 4 feature information, and 2 / 3 of the 3 / 4 feature information is subjected to a multi-head self-attention mechanism operation. In this way, half of the original information is subjected to a multi-head self-attention operation to capture global feature information, and then it is combined with the non-return feature information. 1 / 3 of the 3 / 4 feature information that is operated is fused using star operation. Star operation is used instead of ADD operation to fuse information. While the calculation efficiency is high, richer and more expressive feature representation can be obtained. Then the feature information is split into two halves. One half is increased in dimension through point convolution, and part of the channel information is fused. Then, more global information is further obtained through dilated convolution. In order to prevent the dilated convolution from producing a grid effect, the convolution result is combined with the other half of the feature information that is not operated through star operation, so that the learned global information is infiltrated into the channel and the information loss of dilated convolution is improved. Then, it is concat-joined with the original 1 / 4 feature information, and then the learned global information is exchanged with the original 1 / 4 feature information through channel shuffling, which means that the original information is retained and better global information is learned. Finally, it is integrated into the appropriate number of channels through ordinary convolution and output to the next layer to continue processing the information.

[0025] The present invention uses a partial self-attention mechanism module to improve the multi-head self-attention mechanism of the original method, so that the network can capture global features while not excessively increasing the computational complexity brought by the multi-head self-attention mechanism, making global information acquisition more efficient.

[0026] (4) Improve the RepC3 convolutional module in RT-DETR to the RepMob convolutional module; This embodiment refers to the re-parameterized structure of RepVIT and improves the RepC3 convolution module into the RepMob convolution module. Figure 5As shown in the figure, the input information is first divided into three parts and then passed through three branches. The first branch does not process the information in order to retain the original information. The second branch uses 3×3 deep convolution to extract features. The third branch uses 1×1 deep convolution to extract features. Convolution kernels of different sizes are used to obtain image information of different receptive field sizes. The feature information of the three branches is then fused through star operations. The SE channel attention mechanism is then used to strengthen the channel information and distinguish the importance of the channel information, so that the model focuses on more important channel information. The channel information is then split into two parts. One part is subjected to point convolution to change the dimensional information and reduce the dimensionality. Then, it is subjected to the ReLU6 activation function and then point convolution to adjust the channel dimension and increase the dimensionality, so that more channel dimension information can be learned. Finally, it is subjected to star operations with the other part of the channel information that is not processed to obtain the final output. The inference stage after reparameterization is as follows Figure 6 As shown in the figure, the initial three branches are merged into a 3×3 deep convolution, and then the channel weights are calculated through the SE channel attention mechanism module to obtain important channel and unimportant channel information. The channel information is also split into two parts, one part is not processed, and the other part is dimensionally upgraded through point convolution, and then the ReLU6 activation function is used to perform star operation with the unprocessed part of the channel information to obtain the output.

[0027] The present invention improves the RepC3 convolution module, and adopts deep convolution and SE channel attention mechanism in the training stage to continuously amplify the channel features and pay attention to more important channel information, so that the network can learn more recognizable features during training, reduce the number of branches during reasoning, merge the convolution branches into a separate deep convolution with high computational efficiency, and use SE channel attention mechanism and star operation to greatly improve the retention of features in the training stage, so that a simple inference network structure can achieve the effect during training.

[0028] (5) Combine the loss function with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation; Inner-IoU is a method for calculating loss by using auxiliary borders. It controls the size of the auxiliary borders through the scale factor ratio to calculate the loss and accelerate convergence. The Inner-IoU calculation method is as follows: , , , , , , , in is the left boundary of the real box, is the right boundary of the real box, is the bottom boundary of the real box, is the top boundary of the real box, is the left boundary of the prediction box, is the right boundary of the prediction box, is the bottom boundary of the prediction box, is the top boundary of the prediction box, is the horizontal coordinate of the center point of the real frame, is the ordinate of the center point of the real frame, is the horizontal coordinate of the center point of the prediction box, is the ordinate of the center point of the prediction box, is the width of the real frame, is the height of the real box, w is the width of the predicted box, h is the height of the predicted box, ratio is the scale factor, inter is the intersection of the auxiliary box of the real box and the auxiliary box of the predicted box, and union is the union of the auxiliary box of the real box and the auxiliary box of the predicted box. Finally, we get is the IoU of the auxiliary box, which is then combined with the loss of CIoU. , , , , , Where b is the center coordinate of the prediction box, is the coordinate of the center point of the real frame, To calculate the Euclidean distance, is the weight function, v is a parameter to measure the similarity of aspect ratios, c is the diagonal distance of the minimum enclosing rectangle, It is the ratio of the intersection area of ​​the real box and the predicted box to the combined area (intersection-to-union ratio), In order to consider the complete intersection between target boxes and introduce the new IoU after the correction factor, is the CIoU loss, It is the loss of Inner-IoU combined with CIoU.

[0029] The present invention uses Inner-IoU combined with CIoU to calculate the loss, uses auxiliary borders to accelerate the loss convergence, and simultaneously pays attention to the center point distance and diagonal distance of the bounding box, making the loss calculation more reasonable and effective, and accelerating the convergence speed of the model.

[0030] (6) Input the training set into the improved RT-DETR for training and verify it in the validation set to obtain the best weight in the validation set; (7) The optimal weight is loaded into the improved RT-DETR for insulator defect detection.

[0031] Embodiment 2: The improved insulator defect detection system based on RT-DETR described in this embodiment includes a data preprocessing module, an improved backbone network module, an improved attention mechanism module, an improved RepC3 convolution module, an improved loss function module, a model training module, and an insulator defect detection module; Data preprocessing module: collects publicly available insulator defect datasets and obtains images by capturing video frames as datasets, and splits the datasets into training sets and validation sets; Improved backbone network module: Based on the target detection model RT-DETR, the backbone network is changed to StarNet network for feature extraction, and the StarNet network is further improved by removing the P5 detection head and adding the P2 detection head, and improving the convolution module in the StarNet network; Improved attention mechanism module: The multi-head attention mechanism in RT-DETR is changed to the partial self-attention mechanism PSA in YOLOv10, and the partial self-attention mechanism PSA is further improved to obtain the S-PSA attention mechanism module; Improved RepC3 convolution module: The RepC3 convolution module in RT-DETR is improved to RepMob convolution module; Improved loss function module: The loss function is combined with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation; Model training module: input the training set into the improved RT-DETR for training, and verify it in the validation set to obtain the best weight in the validation set; Insulator defect detection module: The optimal weight is loaded into the improved RT-DETR for insulator defect detection.

[0032] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0033] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to only specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.

Claims

1. The improved insulator defect detection method based on RT-DETR is characterized by: The detection method comprises the following steps: Collect publicly available insulator defect datasets and obtain images by capturing video frames as datasets, and split the datasets into training sets and validation sets; Based on the target detection model RT-DETR, the backbone network is changed to StarNet network for feature extraction, and the StarNet network is further improved by removing the P5 detection head and adding the P2 detection head, and improving the convolution module in the StarNet network; The multi-head attention mechanism in RT-DETR is changed to the partial self-attention mechanism PSA in YOLOv10, and the partial self-attention mechanism PSA is further improved to obtain the S-PSA attention mechanism module; Improve the RepC3 convolutional module in RT-DETR to the RepMob convolutional module; The loss function is combined with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation; The training set is input into the improved RT-DETR for training, and then verified in the validation set to obtain the best weight in the validation set; The optimal weights are loaded into the improved RT-DETR for insulator defect detection.

2. The improved insulator defect detection method based on RT-DETR according to claim 1 is characterized in that: Collecting a public insulator defect dataset and obtaining images by capturing video frames as a dataset includes the following steps: First, we collect the public insulator defect dataset, and then collect the drone inspection video data provided by the power grid. We use the method of capturing frames from the video data to obtain the foreign object dataset. We use the LabelImg tool to annotate the foreign objects in the image, indicating the category and the true frame.

3. The improved insulator defect detection method based on RT-DETR according to claim 2 is characterized in that: Improving the star convolution module in the StarNet network includes the following steps: Input feature information, split the channel into two through the split layer, one channel uses point convolution for dimension increase, and the other channel undergoes deep convolution, and then is divided into two halves and passes through the fully connected layer respectively. One half uses the ReLU6 activation function to make the channel nonlinear, and the other half is not processed. Then the features of the two are fused through star operation, the features of different channels are multiplied two by two, and the fused features are integrated and strengthened through deep convolution. Then the channel is concat-spliced ​​with the channel of point convolution in the channel dimension, and then the channel shuffle operation is performed to strengthen the communication between channels, and finally integrated through the ordinary convolution layer.

4. The improved insulator defect detection method based on RT-DETR according to claim 3 is characterized in that: The processing flow of the S-PSA attention mechanism module is as follows: first, the input information is subjected to deep separable convolution for feature extraction, and then the obtained feature information is subjected to the ReLU6 activation function to introduce nonlinearity into the feature, and then the feature information is split through the split layer into two parts, 1 / 4 and 3 / 4, 1 / 4 feature information is not operated, 1 / 3 of the 3 / 4 feature information is not operated, and 2 / 3 of the 3 / 4 feature information is operated by the multi-head self-attention mechanism, and then it is fused with the 1 / 3 of the 3 / 4 feature information that is not operated by star operation, and then the feature information is split into two halves, one half is increased in dimension by point convolution, and part of the channel information is fused, and then the global information is further obtained by the void convolution, and the convolution result is combined with the other half of the feature information that is not operated by star operation, the learned global information is infiltrated into the channel, and then concat spliced ​​with the original 1 / 4 feature information, and then the learned global information is exchanged with the original 1 / 4 feature information through channel shuffling, and finally integrated through ordinary convolution.

5. The improved insulator defect detection method based on RT-DETR according to claim 4 is characterized in that: The RepC3 convolutional module in RT-DETR is improved to the RepMob convolutional module, which includes the following steps: In the training phase, the input information is divided into three parts and then passed through three branches. The first branch does not process the information, the second branch uses 3×3 deep convolution to extract features, and the third branch uses 1×1 deep convolution to extract features. Then, the feature information of the three branches is fused through star operation, and then the SE channel attention mechanism is used to strengthen the channel information and distinguish the importance of the channel information. The channel information is then split into two parts. One part changes the dimensional information through point convolution for dimensionality reduction, and then passes through the ReLU6 activation function, and then adjusts the channel dimension through point convolution to increase the dimension. Finally, it is star-operated with the other part of the channel information that is not processed to obtain the final output; in the inference phase, the initial three branches are merged into a 3×3 deep convolution, and then the channel weights are calculated through the SE channel attention mechanism module to obtain important channels and unimportant channel information. The channel information is also split into two parts, one part is not processed, and the other part is channel information increased in dimension through point convolution, and then after the ReLU6 activation function, a star operation is performed with the unprocessed part of the channel information to obtain the output.

6. The improved insulator defect detection method based on RT-DETR according to claim 5 is characterized in that: The loss function is combined with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation, including the following steps: Inner-IoU is calculated as follows: , , , , , , , in is the left boundary of the real box, is the right boundary of the real box, is the bottom boundary of the real box, is the top boundary of the real box, is the left boundary of the prediction box, is the right boundary of the prediction box, is the bottom boundary of the prediction box, is the top boundary of the prediction box, is the horizontal coordinate of the center point of the real frame, is the ordinate of the center point of the real frame, is the horizontal coordinate of the center point of the prediction box, is the ordinate of the center point of the prediction box, is the width of the real frame, is the height of the real box, w is the width of the predicted box, h is the height of the predicted box, ratio is the scale factor, inter is the intersection of the auxiliary box of the real box and the auxiliary box of the predicted box, and union is the union of the auxiliary box of the real box and the auxiliary box of the predicted box. Finally, we get is the IoU of the auxiliary box, which is then combined with the loss of CIoU. , , , , , Where b is the center coordinate of the prediction box, is the coordinate of the center point of the real frame, To calculate the Euclidean distance, is the weight function, v is a parameter to measure the similarity of aspect ratios, c is the diagonal distance of the minimum enclosing rectangle, It is the ratio of the intersection area of ​​the real box and the predicted box to the combined area. In order to consider the complete intersection between target boxes and introduce the new IoU after the correction factor, is the CIoU loss, It is the loss of Inner-IoU combined with CIoU.

7. An improved insulator defect detection system based on RT-DETR, used to implement the detection method according to any one of claims 1 to 6, characterized in that: Including data preprocessing module, improved backbone network module, improved attention mechanism module, improved RepC3 convolution module, improved loss function module, model training module, insulator defect detection module; Data preprocessing module: collects publicly available insulator defect datasets and obtains images by capturing video frames as datasets, and splits the datasets into training sets and validation sets; Improved backbone network module: Based on the target detection model RT-DETR, the backbone network is changed to StarNet network for feature extraction, and the StarNet network is further improved by removing the P5 detection head and adding the P2 detection head, and improving the convolution module in the StarNet network; Improved attention mechanism module: The multi-head attention mechanism in RT-DETR is changed to the partial self-attention mechanism PSA in YOLOv10, and the partial self-attention mechanism PSA is further improved to obtain the S-PSA attention mechanism module; Improved RepC3 convolution module: The RepC3 convolution module in RT-DETR is improved to RepMob convolution module; Improved loss function module: The loss function is combined with Inner-IoU and CIoU to obtain the Inner-CIoU loss function for loss calculation; Model training module: input the training set into the improved RT-DETR for training, and verify it in the validation set to obtain the best weight in the validation set; Insulator defect detection module: The optimal weight is loaded into the improved RT-DETR for insulator defect detection.

Citation Information

Patent Citations

  • RT-DETR infrared weak aircraft detection method and system

    CN117974972A

  • Traffic sign detection method based on improved RT-DETR

    CN117975418A

  • Lightweight insulator defect detection method based on improved YOLOv8

    CN118314436A

  • Insulator defect detection method based on improved yolov5

    CN114022432A

  • Weak supervision small sample target detection system and method based on positioning pre-training

    CN116958742A

Cited By

  • Real-time inspection method applied to damaged insulator of power transmission line

    CN119649310A

  • Pumped storage unit insulation defect detection method based on robot combined with improved RT-DETR algorithm

    CN119851091A

  • High-speed rail dropper insulator integrity identification method and system based on improved YOLOv9

    CN120279382A

  • Power grid target detection method based on improved RT-DETR model

    CN121904047A