IF-DETR-based insulator defect detection method and system
Through the insulator defect detection method based on IF-DETR, the multi-scale feature extraction network and context fusion module are used, combined with the optimized IDIoU loss function, the problems of poor detection effect of small defects, background interference and unstable matching in the existing technology are solved, and the problem of poor detection of small defects in the existing technology is realized. Efficient insulator defect detection and background distinction are used to improve the reliability of the power grid.
Patent Information
- Application Number
- CN202411632775.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-25
AI Technical Summary
The existing insulator defect detection technology is difficult to effectively capture small defect characteristics, there are background interference problems, and the matching process is unstable, resulting in low detection accuracy and insufficient reliability.
The insulator defect detection method based on IF-DETR is adopted, and the improved DETR model is combined with a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function to detect insulator defects.
It realizes effective detection of small insulator defects and distinguishes complex backgrounds, improves the reliability and operational safety of the power grid, and is suitable for image analysis collected by remote perception equipment such as drone images.
Smart Images

Figure CN119515845A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power grid operation and maintenance, and in particular to an insulator defect detection method and system based on IF-DETR. Background Art
[0002] In the existing technology, insulator defect detection has the following main problems: First, the poor detection effect of small defects is a major shortcoming of the current insulator defect detection technology. Traditional detection methods often have difficulty in effectively capturing the subtle features of small defects in insulators. With the continuous development of deep learning technology, the level of feature extraction has gradually deepened, and the scale of the feature layer has also decreased. However, this process has brought about the problem of the gradual loss of small defect features, which seriously limits the model's ability to accurately identify tiny defects. This not only increases the risk of missed detection, but also reduces the reliability of the overall detection.
[0003] Secondly, the background interference problem should not be ignored. In actual detection scenarios, insulators are often in complex and changing backgrounds. When dealing with such complex backgrounds, traditional detection methods often have difficulty effectively distinguishing small defects from background features, which greatly reduces the accuracy of the detection results. This background interference not only increases the difficulty of detection, but also further weakens the model's ability to detect small defects.
[0004] Furthermore, the instability of the matching process is also one of the problems that the current technology needs to solve urgently. In insulator defect detection, the Hungarian matching algorithm is often used to achieve the matching between feature points and detection frames. However, when dealing with small defects, the algorithm may encounter unstable matching, resulting in deviations in matching results. This instability not only affects the optimization process of the model, but may also have an adverse effect on the final detection accuracy.
[0005] In summary, insulator defect detection technology still faces many challenges under existing conditions. In order to improve the detection effect, it is necessary to improve and innovate the existing technology.
[0006] The above information is presented as background information only to assist with understanding the present disclosure and no determination or admission is made as to whether any of the above may be used as prior art with respect to the present disclosure. Summary of the invention
[0007] The present invention provides an insulator defect detection method and system based on IF-DETR to solve the problems existing in the prior art.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] In a first aspect, the present invention provides an insulator defect detection method based on IF-DETR, the method comprising:
[0010] Acquire an insulator image;
[0011] The insulator image is input into the IF-DETR model to obtain the insulator defect detection result; the IF-DETR model is an improved DETR model, which adopts a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function.
[0012] Further, in the insulator defect detection method based on IF-DETR, the context fusion module includes an ECA-Net module and a SAU operator;
[0013] The ECA-Net module enhances the expressiveness of features by using local cross-channel interactions;
[0014] The SAU operator performs feature upsampling and cross-scale fusion through a spatial attention mechanism.
[0015] Furthermore, in the insulator defect detection method based on IF-DETR, the formula of the IDIoU loss function is as follows:
[0016] ;
[0017] Among them, o and o gt denote the center of the predicted box and the ground truth box respectively, and w c and h c Respectively represent the width and height of the minimum bounding box in the two boxes, represents the Euclidean distance between two points, and r represents the classification score.
[0018] Furthermore, in the insulator defect detection method based on IF-DETR, the method further includes:
[0019] Based on the DETR model, a multi-scale feature extraction network, context fusion module and optimized IDIoU loss function are used to improve the IF-DETR model.
[0020] The IF-DETR model is trained to obtain the trained IF-DETR model.
[0021] In a second aspect, the present invention provides an insulator defect detection system based on IF-DETR, the system comprising:
[0022] An image acquisition module, used for acquiring an insulator image;
[0023] The defect detection module is used to input the insulator image into the IF-DETR model to obtain the insulator defect detection result; the IF-DETR model is an improved DETR model, which adopts a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function.
[0024] Further, in the IF-DETR-based insulator defect detection system, the context fusion module includes an ECA-Net module and a SAU operator;
[0025] The ECA-Net module enhances the expressiveness of features by using local cross-channel interactions;
[0026] The SAU operator performs feature upsampling and cross-scale fusion through a spatial attention mechanism.
[0027] Furthermore, in the insulator defect detection system based on IF-DETR, the formula of the IDIoU loss function is as follows:
[0028] ;
[0029] Among them, o and o gt denote the center of the predicted box and the ground truth box respectively, and w c and h c Respectively represent the width and height of the minimum bounding box in the two boxes, represents the Euclidean distance between two points, and r represents the classification score.
[0030] Furthermore, in the insulator defect detection system based on IF-DETR, the system also includes a model building module for:
[0031] Based on the DETR model, a multi-scale feature extraction network, context fusion module and optimized IDIoU loss function are used to improve the IF-DETR model.
[0032] The IF-DETR model is trained to obtain the trained IF-DETR model.
[0033] In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the insulator defect detection method based on IF-DETR as provided in the first aspect above is implemented.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a computer processor to implement the insulator defect detection method based on IF-DETR as provided in the first aspect above.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] The present invention provides an insulator defect detection method and system based on IF-DETR. Based on the DETR model, a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function are used to improve the IF-DETR model. Then, the IF-DETR model is used to detect insulator defects. The method and system can effectively detect small insulator defects and distinguish complex backgrounds, thereby improving the reliability and operation safety of the power grid. The method and system are particularly suitable for image analysis collected by remote sensing equipment such as drone images, and are widely used in the maintenance and detection of high-voltage transmission lines.
[0037] The present invention has other features and advantages, which will be apparent from or will be described in detail in the accompanying drawings and the following detailed description incorporated herein, which together serve to explain the specific principles of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 It is a flow chart of an insulator defect detection method based on IF-DETR provided in the first embodiment of the present invention;
[0040] Figure 2 It is the structural diagram of the IF-DETR model mentioned in the first embodiment of the present invention;
[0041] Figure 3 It is a structural diagram of the ECA-Net module mentioned in the first embodiment of the present invention;
[0042] Figure 4 Schematic diagram of the self-attention upsampling layer mentioned in the first embodiment of the present invention;
[0043] Figure 5 is the IFDD data set sample diagram mentioned in the first embodiment of the present invention;
[0044] Figure 6 is a diagram of the detection results of different methods mentioned in Example 1 of the present invention;
[0045] Figure 7This is a comparison chart of the instability scores of RT-DETR and F-DETR for small defects mentioned in Example 1 of the present invention;
[0046] Figure 8 It is a functional module schematic diagram of an insulator defect detection system based on IF-DETR provided in the second embodiment of the present invention;
[0047] Fig. 9 It is a structural diagram of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0048] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0049] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0050] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0051] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0052] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0053] Without further limitations, in this application, the words "include", "comprises", "has" or other similar expressions used in the sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0054] In this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0055] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0056] Unless otherwise expressly specified or limited, in the description of the embodiments of the present application, the terms such as "install", "connect", "connect", "fix", "set", etc. used should be understood in a broad sense. For example, the "connection" can be a fixed connection, a detachable connection, or an integrated setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. For technicians in the technical field to which the present application belongs, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0057] Embodiment 1
[0058] Please refer to the attached Figure 1 , is a flow chart of an insulator defect detection method based on IF-DETR provided in Embodiment 1 of the present invention, which is applicable to the scenario of detecting defects in insulators. The method specifically comprises the following steps:
[0059] S101. Acquire an insulator image.
[0060] It should be noted that appropriate image acquisition equipment (such as drones, inspection robots, cameras, etc.) is used to capture images of insulators on transmission lines.
[0061] It is understandable that some preprocessing may be performed on the collected insulator images, including denoising, enhancement, normalization and other operations, to improve the accuracy of subsequent processing.
[0062] S102. Input the insulator image into the IF-DETR model to obtain an insulator defect detection result; the IF-DETR model is an improved DETR model, which adopts a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function.
[0063] It should be noted that the detected insulator defect information (such as defect location, type, severity, etc.) is output in the form of visualization or data for further processing by the user or system.
[0064] The context fusion module includes an ECA-Net module and a SAU operator.
[0065] The purpose of this invention is to use the DETR architecture to identify insulator defects, with the focus on improving the detection accuracy of small defects. Figure 2 As shown, the IF-DETR (Insulator Defect DETR) model is an end-to-end pit recognition model based on Transformer technology.
[0066] This model has two innovations. First, through the fusion module of ECA-Net and SAU, the low-level features of the backbone network are fused with the high-level features of Transformer to further capture contextual information. Second, the IDIoU loss function is used to solve the instability problem caused by small defects in the matching process and speed up the training.
[0067] The model adopts a multi-scale feature fusion method to integrate the features before and after the encoder at different scales. Efficient Channel Attention (ECA-Net) is an attention mechanism that focuses on the channel dimension. It enhances feature representation through local cross-channel interactions without significantly increasing computational overhead. It focuses on feature upsampling and cross-scale fusion through spatial attention mechanisms. The combination of these two techniques optimizes feature representations at different levels and improves the overall performance of the model. In the "head" part, multi-scale features processed by cross-scale fusion are fed into the transform decoder, thereby increasing the number of queries in training. Finally, in order to simplify the optimization of small objects, the present invention designs a special stable IoU (Intersection over Union) loss function for small objects.
[0068] In convolutional neural networks, it has been proven that multi-scale feature fusion can effectively improve detection accuracy. However, the increase in input sequence length still leads to a large amount of computational requirements. To overcome this obstacle, the present invention reconsiders the encoder structure and designs a series of different encoder variants, such as Figure 2 As shown in the figure. The fusion of features at two scales can not only obtain good detection results, but also avoid introducing too much calculation. Self-attention to high-level features with richer semantic concepts can capture the relationship between conceptual entities in the image, which helps subsequent modules to detect and identify objects in the image. In addition, multi-level feature fusion can effectively extract contextual information around defects and prevent foreground and background confusion.
[0069] CNN tends to treat all feature channels in an image equally and ignore the correlation between different channels. This will cause interference from redundant information when extracting features, thereby reducing performance. To solve this problem, the present invention introduces an attention mechanism that allows the network to dynamically adjust its focus on different feature channels. Figure 3 As shown in Figure 1, ECA-Net is a model based on the attention mechanism, which enhances the feature modeling ability of the network by introducing channel attention.
[0070] ECA-Net aggregates features obtained through global average pooling (GAP) and generates channel weights by performing fast 1D convolutions of size k, where k is adaptively determined by mapping the channel dimension C.
[0071] The core idea of ECA-Net is to introduce channel attention after the convolutional layer to dynamically adjust the responses of different channels. First, ECA-Net uses GAP to reduce the dimension of the feature map. Then, the output of the global average pooling is reduced to a smaller vector through a fully connected layer. This vector captures the global information of each channel. Finally, the output of the channel attention module is connected to the input of the convolutional layer using a residual connection to ensure lossless information transfer.
[0072] In the feature fusion process, traditional upsampling methods mainly include interpolation algorithms and deconvolution. Interpolation has limitations in capturing rich semantic information, while deconvolution is limited by the use of a unified kernel. To solve this problem, CARAFE (Content-Aware Recombination of Features) introduces a novel convolutional upsampling method to recombinate features in a content-aware manner. However, this method can only integrate high-level features into low-level features, but cannot solve the problem of cross-scale feature interaction. The present invention proposes a self-attention upsampling layer, such as Figure 4 As shown in Figure 2. This layer uses cross-scale local cross attention, and each element in the low-resolution feature map calculates cross attention with the corresponding high-resolution feature area. This ensures semantic consistency and enhances the expressiveness of features by fusing high-level and low-level features. In addition, it can effectively preserve the spatial information of small defects and their context in low-level features to prevent foreground-background confusion.
[0073] High-level features The features from the Transformer encoder Enhanced, high-resolution low-level features Extracted by the backbone network. Use a "2×2" sliding window with a step size of 2. When the sliding window moves once on F1, a self-attention mechanism is used to obtain At the same time, the i-th feature pixel in S is regarded as and .right and After linear projection, we get and The Key and Value at index i correspond to the query at index i. The i-th attention weight unit Defined as and The final weight is obtained through the Softmax operation, then dot-multiplied with feature S2 and fused with the low-level feature F to obtain the final result S.
[0074] The weight calculation method is shown in Formula 1:
[0075] ……(1);
[0076] where d is the normalization coefficient.
[0077] The calculation method is shown in Formula 2:
[0078] ……(2);
[0079] In the matrix V, each row has the projection of the i-th high-level feature pixel.
[0080] The projection of the pixel is denoted as Vi.
[0081] The resulting feature matrix S is shown in Formula 3:
[0082] ……(3);
[0083] The present invention combines ECA-Net and SAU to form a fusion module. ECA-Net enhances the expressiveness of features by using local cross-channel interactions, while SAU focuses on feature upsampling and cross-scale fusion through a spatial attention mechanism. The combination of the two can optimize feature representations at different levels, thereby improving the overall performance of the model.
[0084] The loss function of the two-stage DETR variant usually consists of three parts, namely classification loss, box L1 loss and IoU-based loss. The loss function of IF-DETR is defined as follows:
[0085] ……(4);
[0086] The hyperparameters are used to adjust the ratio of the three components of the loss. In addition, and Denote the predicted value and the ground truth, respectively, where c and b denote the category and the bounding box. Lcls() and LIDIoU() are the classification loss and IDIoU loss designed by the present invention to optimize the difficulty of defect detection. The classification loss using Focal loss is defined as follows:
[0087] ……(5);
[0088] The present invention finds that it is challenging to optimize small defect detection during training, mainly because defect features can be easily confused with background features. In addition, it is also challenging to improve the stability of one-to-one matching. The original DETR used IoU loss to measure the overlap between the prediction and the ground truth, but the IoU loss does not accurately reflect the distance between the predicted box and the actual box. Therefore, many DETR variants choose GIoU (Generalized Intersection over Union) loss instead of IoU loss. However, when two boxes have an inclusion relationship, the GIoU loss degenerates into the IoU loss, and the IoU loss cannot express the relative position of the box, which is not conducive to data sets with dense small defects. For example, in the initial stage of training, a predicted box may contain multiple small defects. In this case, the GIoU loss has little effect on one-to-one matching, while the classification loss and box L1 loss become more important. In addition, the present invention also finds that using only the classification score and the L1 score for one-to-one matching will produce different results, resulting in an unstable matching process because the model cannot be optimized towards a unified goal.
[0089] In order to solve these problems, the present invention proposes an IDIoU loss for small defects based on the EIoU (Efficient-IoU) loss. The EIoU loss consists of three parts: IoU loss, center distance loss, and aspect ratio loss. The present invention finds that even if the predicted box is inside the actual box, the EIoU Loss can still effectively discriminate the relative position of the predicted box and incorporate the supervision of the box L1 loss into the IoU loss. The IDIoU loss designed specifically for small defects in the present invention uses classification scores and optimizes all components in a unified direction. As shown in Formula 6, the present invention introduces the defect IoU loss to adapt to this improvement, and the formula of the IDIoU loss function is as follows:
[0090] ……(6);
[0091] Among them, o and o gt denote the center of the predicted box and the ground truth box respectively, and w c and h c Respectively represent the width and height of the minimum bounding box in the two boxes, represents the Euclidean distance between two points, and r represents the classification score.
[0092] In one implementation of this embodiment, the method further includes:
[0093] Based on the DETR model, a multi-scale feature extraction network, context fusion module and optimized IDIoU loss function are used to improve the IF-DETR model.
[0094] The IF-DETR model is trained to obtain the trained IF-DETR model.
[0095] experiment:
[0096] Dataset:
[0097] In the field of insulator fault detection, data is relatively scarce and research usually relies on proprietary datasets. This paper uses the IFDD public dataset, conducts comparative experiments with the most advanced methods on this dataset, and conducts ablation studies on the backbone network structure, loss function selection, and upsampling mechanism selection. Since the main purpose of the present invention is to improve detection accuracy, the experiments of the present invention mainly use recall and precision as evaluation indicators.
[0098] The IFDD dataset contains 1600 image samples divided in a ratio of 7:2:1. The dataset contains a sufficient number of defect samples, covering most of the defects found in insulators in daily life, and the data is widely distributed. The samples of the IFDD dataset are as follows: Figure 5 This dataset contains data of various sizes, mainly small and medium-sized objects, which is closer to real-world application scenarios.
[0099] Training settings:
[0100] In the experiment, the present invention uses the Resnet model pre-trained on ImageNet as the backbone network for extracting multi-scale features. The present invention uses a linear warm-up strategy to optimize the learning rate, and finally determines the learning rate to be 0.0002. In addition, the present invention also uses the AdamW optimizer to optimize the loss function 200 times, and the weight decay is 0.0001. The anchor points in the auxiliary head are consistent with the anchor points used in YOLOv3. All experiments are implemented in PyTorch on a Tesla A100 GPU.
[0101] Evaluation Metrics:
[0102] In order to evaluate the detection quality of the model, the present invention uses precision and recall as performance indicators on the dataset, which is similar to most detection methods. The present invention classifies the predicted boxes with an IoU greater than 0.5 compared with the ground truth as true positives, and the rest as false positives. The specific formula is as follows:
[0103] ……(7);
[0104] ……(8);
[0105] Prediction boxes that do not contain defects are classified as false negatives (FN). Prediction boxes that contain defects and have an IoU value greater than 0.5 with the ground truth are classified as true positives (TP), while prediction boxes with IoU values less than or equal to 0.5 are classified as false positives (FP). ||TP||, ||FP||, and ||FN|| represent the counts of true positives, false positives, and false negatives, respectively. Higher precision and recall indicate better detection performance.
[0106] On the IFDD dataset, we compare IF-DETR with other advanced DETR variants. Table 1 shows the results of these comparisons. As can be seen from the table, our model achieves the highest precision and recall with fewer parameters and makes progress in detecting small defects (AP).
[0107] Table 1:
[0108]
[0109] Compared with high-performance models such as RT-DETR, Focus-DETR and DINO, the method of the present invention improves detection accuracy by 3% on average. These models have difficulty identifying defects with weak features or complex backgrounds because they unify multi-scale features into a single input to the encoder, resulting in increased computational cost and potential feature confusion. In contrast, the model of the present invention integrates a feature fusion step between the encoder and decoder, which effectively ensures that small pit features in high-resolution feature maps are not ignored during the learning process. In addition, the training strategy of the present invention also ensures that the encoder learns higher quality features.
[0110] Compared with the baseline model RT-DETR, IF-DETR improves its accuracy by more than 2%. This is because the interpolation upsampling and convolutional pooling of RT-DETR cannot ensure the semantic consistency of features. In addition, the sparse sampling method used by RT-DETR for object query selection also limits the decoding ability of the decoder. The SAU operator proposed in this paper can ensure the consistency of upsampled features and is suitable for networks based on self-attention calculation.
[0111] Figure 6 The detection results of four high-performance DETR variants and the proposed method are shown. The results show that Deformable-DETR and RT-DETR perform poorly in identifying small defects, such as Figure 6 As shown in the second column, there are cases of missed detection. The algorithm of the present invention is precisely designed and can effectively identify small pits with unclear edge features, so it shows excellent detection performance on such objects.
[0112] exist Figure 6In the third column, the model of the present invention shows advantages when processing images with complex backgrounds. The complex texture features in these images pose a challenge to detection because they resemble defects. Although complex backgrounds pose a challenge to all detectors, the method of the present invention is minimally affected and can accurately detect defects that other methods cannot detect, thanks to the self-attention upsampling module proposed by the model of the present invention, which can effectively distinguish between foreground and background, resulting in excellent feature learning capabilities and enhanced model robustness.
[0113] exist Figure 7 In the above figure, the present invention makes a separate comparison for small defects. Compared with the baseline model, the instability score of the model of the present invention decreases faster in the early stage of training, but becomes more stable in the later stage of training. This shows that the method of the present invention effectively alleviates the instability of small defect matching and speeds up the optimization process.
[0114] In summary, the algorithm of the present invention has obvious advantages in feature learning and distinguishing foreground and background features. It improves the accuracy of defect detection, especially the detection of small defects, by using more effective multi-scale feature fusion technology and more stable matching process.
[0115] Ablation experiment:
[0116] The present invention conducts a series of ablation experiments to evaluate the specific contribution of each component to the performance of the model. By gradually incorporating the three innovative points proposed by the present invention, the detection results are improved. Table 2 summarizes these experimental results. Initially, the present invention uses a multi-scale backbone network structure in the classic DETR, which improves the accuracy of defect detection by 0.9%. The improvement of 0.9% highlights the advantages of multi-scale feature fusion under the DETR framework. Subsequently, the fusion module of ECA-Net and SAU is integrated into the multi-scale bottom-up path, and the detection accuracy of the model is improved by 0.4%, reflecting the efficacy of the fusion module in emphasizing the features of small defects. This reflects the efficacy of the fusion module in emphasizing the features of small defects. The performance of the model is improved by 0.4%, indicating that appropriate upsampling enhances the model's ability to distinguish between foreground and background. Finally, by using the loss function, the detection accuracy of the model is improved by 0.4% again, indicating the favorable effect of the IDIoU loss function on the detection accuracy. It shows the favorable effect of IDIoU loss on network training. In summary, the experiments of the present invention prove that each component of the algorithm effectively improves the performance of the model, and they work in coordination with each other without any conflict.
[0117] Table 2:
[0118]
[0119] Although the terms such as model, defect, and detection are used more frequently in this application, the possibility of using other terms is not excluded. These terms are used only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional restrictions is contrary to the spirit of the present invention.
[0120] An insulator defect detection method based on IF-DETR is provided in an embodiment of the present invention. Based on the DETR model, a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function are used to improve the IF-DETR model, and then the insulator defects are detected through the IF-DETR model. The method can effectively detect small insulator defects and distinguish complex backgrounds, thereby improving the reliability and operation safety of the power grid. It is particularly suitable for image analysis collected by remote sensing equipment such as drone images, and is widely used in the maintenance and detection of high-voltage transmission lines.
[0121] Embodiment 2
[0122] Please refer to Figure 8 , Figure 8 This is a functional module diagram of an insulator defect detection system based on IF-DETR provided in Embodiment 2 of the present invention. The system is suitable for executing the insulator defect detection method based on IF-DETR provided in Embodiment 2 of the present invention. The system specifically includes the following modules:
[0123] An image acquisition module 201 is used to acquire an insulator image;
[0124] The defect detection module 202 is used to input the insulator image into the IF-DETR model to obtain the insulator defect detection result; the IF-DETR model is an improved DETR model, which adopts a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function.
[0125] Preferably, the context fusion module includes an ECA-Net module and a SAU operator;
[0126] The ECA-Net module enhances the expressiveness of features by using local cross-channel interactions;
[0127] The SAU operator performs feature upsampling and cross-scale fusion through a spatial attention mechanism.
[0128] Preferably, the formula of the IDIoU loss function is as follows:
[0129] ;
[0130] Among them, o and o gt denote the center of the predicted box and the ground truth box respectively, and wc and h c Respectively represent the width and height of the minimum bounding box in the two boxes, represents the Euclidean distance between two points, and r represents the classification score.
[0131] Preferably, the system further comprises a model building module, for:
[0132] Based on the DETR model, a multi-scale feature extraction network, context fusion module and optimized IDIoU loss function are used to improve the IF-DETR model.
[0133] The IF-DETR model is trained to obtain the trained IF-DETR model.
[0134] An insulator defect detection system based on IF-DETR is provided in an embodiment of the present invention. Based on the DETR model, a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function are used to improve the IF-DETR model. Then, the insulator defects are detected through the IF-DETR model. The system can effectively detect small insulator defects and distinguish complex backgrounds, thereby improving the reliability and operational safety of the power grid. The system is particularly suitable for image analysis collected by remote sensing equipment such as drone images, and is widely used in the maintenance and detection of high-voltage transmission lines.
[0135] The above system can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0136] Embodiment 3
[0137] Fig. 9 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Fig. 9 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Fig. 9 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0138] like Fig. 9 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0139] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0140] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0141] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0142] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0143] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via a bus 18. It should be understood that although Fig. 9 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0144] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the insulator defect detection method based on IF-DETR provided in the embodiment of the present invention.
[0145] Embodiment 4
[0146] Embodiment 4 of the present invention provides a computer-readable storage medium having computer-executable instructions stored thereon. When the instructions are executed by a processor, the insulator defect detection method based on IF-DETR as provided in all the embodiments of the invention of this application is implemented.
[0147] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.
[0148] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0149] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0150] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0151] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of this application, this does not limit the scope of patent protection of this application. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concept of this application using the contents recorded in the specification and drawings of this application, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of this application.
Claims
1. An insulator defect detection method based on IF-DETR, characterized in that: The method comprises: Acquire an insulator image; The insulator image is input into the IF-DETR model to obtain the insulator defect detection result; the IF-DETR model is an improved DETR model, which adopts a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function.
2. The insulator defect detection method based on IF-DETR according to claim 1, characterized in that: The context fusion module includes an ECA-Net module and a SAU operator; The ECA-Net module enhances the expressiveness of features by using local cross-channel interactions; The SAU operator performs feature upsampling and cross-scale fusion through a spatial attention mechanism.
3. The insulator defect detection method based on IF-DETR according to claim 1, characterized in that: The formula of the IDIoU loss function is as follows: ; Among them, o and o gt denote the center of the predicted box and the ground truth box respectively, and w c and h c Respectively represent the width and height of the minimum bounding box in the two boxes, represents the Euclidean distance between two points, and r represents the classification score.
4. The insulator defect detection method based on IF-DETR according to claim 1, characterized in that: The method further comprises: Based on the DETR model, a multi-scale feature extraction network, context fusion module and optimized IDIoU loss function are used to improve the IF-DETR model. The IF-DETR model is trained to obtain the trained IF-DETR model.
5. An insulator defect detection system based on IF-DETR, characterized in that: The system comprises: An image acquisition module, used for acquiring an insulator image; The defect detection module is used to input the insulator image into the IF-DETR model to obtain the insulator defect detection result; the IF-DETR model is an improved DETR model, which adopts a multi-scale feature extraction network, a context fusion module and an optimized IDIoU loss function.
6. The insulator defect detection system based on IF-DETR according to claim 5, characterized in that: The context fusion module includes an ECA-Net module and a SAU operator; The ECA-Net module enhances the expressiveness of features by using local cross-channel interactions; The SAU operator performs feature upsampling and cross-scale fusion through a spatial attention mechanism.
7. The insulator defect detection system based on IF-DETR according to claim 5, characterized in that: The formula of the IDIoU loss function is as follows: ; Among them, o and o gt denote the center of the predicted box and the ground truth box respectively, and w c and h c Respectively represent the width and height of the minimum bounding box in the two boxes, represents the Euclidean distance between two points, and r represents the classification score.
8. The insulator defect detection system based on IF-DETR according to claim 5, characterized in that: The system also includes a model building module for: Based on the DETR model, a multi-scale feature extraction network, context fusion module and optimized IDIoU loss function are used to improve the IF-DETR model. The IF-DETR model is trained to obtain the trained IF-DETR model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the insulator defect detection method based on IF-DETR as described in any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that: The computer executable instructions are executed by a computer processor to implement the insulator defect detection method based on IF-DETR as described in any one of claims 1 to 4.