Insulator defect detection method and device, computer equipment and storage medium
By integrating SwinTransformer and C2fSRT modules into the YOLOv8s network, combined with the improved BiFPN module, an efficient insulator defect detection method was built, which solved the problems of low detection accuracy, insufficient real-time and poor adaptability in the prior art, and achieved complexity The high-precision and real-time detection of tiny defects in the background ensures the safe and stable operation of the power system.
Patent Information
- Application Number
- CN202411625580.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-14
AI Technical Summary
When detecting insulator defects, it is difficult to accurately identify small defects, lack of real-time performance, and poor adaptability to small targets and complex backgrounds, which affects the accuracy and reliability of the detection.
Using the insulator defect detection method based on YOLOv8s-SwinT, by integrating the characteristics of SwinTransformer into the YOLOv8s network architecture, and introducing the C2fSRT module in the Backbone layer and the Neck layer, adding a subtle target detection layer, and using the improved BiFPN module to build a fusion model to achieve the High-precision, real-time detection of tiny defects in complex backgrounds.
It significantly improves detection accuracy, can accurately identify small defects, has good real-time performance, meets the real-time monitoring needs of large-scale transmission lines, enhances the detection capabilities of small targets and complex backgrounds, and ensures the safe and stable operation of the power system.
Smart Images

Figure CN119445087A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection technology, and in particular to an insulator defect detection method, device, computer equipment and storage medium. Background Art
[0002] With the continuous development of the power industry, the safe and stable operation of power transmission lines is of vital importance. In power transmission lines, insulators are exposed to the outdoor environment for a long time and will be affected by many factors such as bad weather, pollution and aging, which will cause various defects such as cracks, wear and stains. If these defects are not detected and repaired in time, it is very likely to cause serious safety accidents such as arc discharge and leakage, which seriously threaten the stability of the entire power system.
[0003] At present, the industry mainly uses two methods to meet the demand for insulator defect detection: manual inspection and traditional image processing technology. However, both methods face many difficult-to-overcome problems in practical applications.
[0004] In terms of detection accuracy, traditional methods are limited by their technical principles. In complex background environments, it is difficult to accurately identify tiny defects on insulators. Especially when the background is complex and the defects themselves are very subtle, false detection or missed detection often occurs, which greatly reduces the accuracy of the detection results.
[0005] From a real-time perspective, traditional detection methods have relatively slow processing speeds. When faced with large-scale transmission lines that require real-time monitoring, they cannot meet the demand for fast and timely acquisition of detection results, affecting the timely control of the overall operating status of the power system.
[0006] Furthermore, traditional detection methods have obvious deficiencies in their ability to detect small targets. For example, small target defects such as tiny cracks and slight wear on insulators are difficult to effectively capture and accurately identify using existing traditional detection algorithms, which is not conducive to a comprehensive investigation of various hidden dangers of insulators.
[0007] In addition, transmission lines are often located in a complex and changeable natural environment with many background interference factors. Traditional detection methods lack sufficient adaptability and are difficult to cope with complex background conditions in different scenarios, which in turn affects the reliability of detection. Therefore, it is necessary to improve the existing technology.
[0008] 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
[0009] The present invention provides an insulator defect detection method, device, computer equipment and storage medium to solve the problems existing in the prior art.
[0010] To achieve the above object, the present invention provides the following technical solutions:
[0011] An insulator defect detection method, comprising:
[0012] Model construction includes: integrating the features of SwinTransformer into the YOLOv8s network architecture and combining it with the C2f module in YOLOv8s, introducing the C2fSRT module in the Backbone layer and Neck layer of YOLOv8s, adding a subtle target detection layer, and using an improved BiFPN module to obtain a fusion model;
[0013] Collect images of power transmission lines containing insulators, annotate the insulators in the images, and distinguish between normal insulators and damaged insulators to construct a dataset. Then divide the annotated dataset into training set, validation set, and test set.
[0014] Use the training set to train the constructed model in a preset experimental environment;
[0015] Conduct ablation experiments on the insulator dataset and compare the trained model with other typical related models;
[0016] Use the trained and evaluated model to detect new power transmission line images and output defect detection results, defect types and defect location information.
[0017] Optionally, the method for obtaining the C2fSRT module includes:
[0018] The structural features used to extract and fuse multi-scale features in the C3 module are combined with the structural features used to capture long-range dependencies in the ELAN module to obtain an intermediate product.
[0019] Based on the feature information contained in the intermediate product as the feature extraction direction of the SwinTransformer module, the SwinTransformer module is introduced after the C2f module of the YOLOv8s network with a specific interface and parameter configuration.
[0020] Optionally, the subtle target detection layer is constructed in the following manner:
[0021] The second layer features in the original YOLOv8s algorithm are incorporated into the feature fusion network, and a feature map with a size of 160×160 is added. Upsampling and downsampling operations are performed in the feature fusion network in sequence, so that the detection layer is increased to four layers, thereby enhancing the detection capability of subtle targets.
[0022] Optionally, the improved BiFPN module is obtained by:
[0023] Based on the traditional FPN unidirectional information flow, the PANet bottom-up path is used to improve information transmission and retain shallow features. Based on the original BiFPN, some feature fusion nodes are cancelled to reduce the computational complexity, and cross-scale connections are introduced based on the original BiFPN to improve feature representation.
[0024] Optionally, the marking of insulators in the image includes:
[0025] The labeling tool is used to accurately mark the box where the actual physical boundary of the insulator is located.
[0026] Optionally, the SwinTransformer adopts a hierarchical construction method to reduce the number of modules and expand the module receptive field as the network depth increases, and utilizes a hierarchical setting based on window sliding calculation to limit self-attention within a local window to perform comprehensive modeling of neighborhood features.
[0027] Optionally, the ablation experiment analyzes the impact of the C2fSRT module, the fine target detection layer, and the improved BiFPN module on the model performance, and performs targeted adjustment and optimization on the model parameters according to the analysis results.
[0028] The present invention also provides an insulator defect detection device, which is used to implement the insulator defect detection method as described in any one of the above items, comprising:
[0029] An image acquisition module, used for acquiring images of power transmission lines including insulators;
[0030] A labeling module, connected to the image acquisition module, is used to label the insulators in the image acquired by the image acquisition module, distinguish between ordinary insulators and damaged insulators, thereby constructing a data set, and dividing the data set into a training set, a verification set and a test set according to corresponding rules;
[0031] The model building module is used to integrate the characteristics of SwinTransformer into the YOLOv8s network architecture and combine it with the C2f module in YOLOv8s, introduce the C2fSRT module in the Backbone layer and Neck layer of YOLOv8s, add a subtle target detection layer, and use the improved BiFPN module to obtain a fusion model;
[0032] A training module, connected to the model building module and the annotation module, is used to train the model built by the model building module using the training set divided by the annotation module under a preset experimental environment;
[0033] An experimental analysis module, connected to the training module, is used to carry out ablation experiments on the insulator data set, and to compare the model trained by the training module with other typical related models, and to adjust and optimize the model-related parameters based on the experimental results;
[0034] The detection module is connected to the experimental analysis module and is used to detect the new power transmission line image using the model evaluated by the experimental analysis module, and output defect detection results, defect types and defect location information.
[0035] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the insulator defect detection method as described in any one of the above items when executing the computer program.
[0036] The present invention also provides a storage medium containing computer executable instructions, wherein the computer executable instructions are executed by a computer processor to implement the insulator defect detection method as described in any one of the above items.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] The present invention provides an insulator defect detection method, device, computer equipment and storage medium, which effectively improve the detection accuracy through specific model construction and a series of detection processes, and can accurately identify tiny defects; have good real-time performance and can meet the real-time monitoring needs of large-scale transmission lines; and also enhance the detection capabilities of small targets and complex backgrounds to ensure the stable operation of the power system.
[0039] 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
[0040] 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.
[0041] Figure 1 It is a flow chart of an insulator defect detection method provided by the present invention;
[0042] Figure 2It is a schematic diagram of a visual Transformer network involved in an insulator defect detection method provided by the present invention;
[0043] Figure 3 It is a SwinTransformer model structure involved in an insulator defect detection method provided by the present invention;
[0044] Figure 4 It is a YOLOv8s-SwinT network architecture diagram in an insulator defect detection method provided by the present invention;
[0045] Figure 5 It is a structural diagram of a C2fSTR module in an insulator defect detection method provided by the present invention;
[0046] Figure 6 It is a feature fusion network setting diagram in an insulator defect detection method provided by the present invention;
[0047] Figure 7 This is an example diagram of data enhancement in an insulator defect detection method provided by the present invention;
[0048] Figure 8 It is a label and a label distribution diagram in an insulator defect detection method provided by the present invention;
[0049] Fig. 9 It is a comparison diagram of training results of different models in an insulator defect detection method provided by the present invention;
[0050] Fig.10 It is a detection result diagram of different algorithms in an insulator defect detection method provided by the present invention;
[0051] Fig.11 It is a structural block diagram of an insulator defect detection device provided by the present invention.
[0052] Figure numerals: 10, image acquisition module; 20, annotation module; 30, model building module; 40, training module; 50, experimental analysis module; 60, detection module. DETAILED DESCRIPTION
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] 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.
[0059] Similar to the understanding in the Examination Guidelines, 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.
[0060] 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.
[0061] 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.
[0062] The purpose of the present invention is to solve the above problems and propose an insulator defect detection method based on YOLOv8s-SwinT. By combining advanced deep learning algorithms and self-attention mechanisms, high-precision and real-time detection of tiny defects under complex backgrounds can be achieved, especially the detection capability of small targets can be improved, so as to ensure the safe and stable operation of the power system.
[0063] Please refer to Figure 1 , an embodiment of the present invention provides an insulator defect detection method, comprising:
[0064] S1. Build the model.
[0065] This step includes: integrating the characteristics of SwinTransformer into the YOLOv8s network architecture and combining it with the C2f module in YOLOv8s, introducing the C2fSRT module in the Backbone layer and Neck layer of YOLOv8s, adding a subtle target detection layer, and using an improved BiFPN module to obtain a fusion model.
[0066] The C2fSRT module can be obtained by:
[0067] The structural features used to extract and fuse multi-scale features in the C3 module are combined with the structural features used to capture long-range dependencies in the ELAN module to obtain an intermediate product.
[0068] Based on the feature information contained in the intermediate product as the feature extraction direction of the SwinTransformer module, the SwinTransformer module is introduced after the C2f module of the YOLOv8s network with a specific interface and parameter configuration.
[0069] The subtle target detection layer is constructed in the following way:
[0070] The second layer features in the original YOLOv8s algorithm are incorporated into the feature fusion network, and a feature map with a size of 160×160 is added. Upsampling and downsampling operations are performed in the feature fusion network in sequence, increasing the number of detection layers to four, thereby enhancing the detection capability of subtle targets.
[0071] The improved BiFPN module is obtained by:
[0072] Based on the traditional FPN unidirectional information flow, the PANet bottom-up path is used to improve information transmission and retain shallow features. Based on the original BiFPN, some feature fusion nodes are cancelled to reduce the computational complexity, and cross-scale connections are introduced based on the original BiFPN to improve feature representation.
[0073] Label the insulators in the image, including:
[0074] The labeling tool is used to accurately mark the box where the actual physical boundary of the insulator is located.
[0075] Among them, SwinTransformer adopts a hierarchical construction method to reduce the number of modules and expand the module receptive field as the network depth increases. It uses a hierarchical setting based on window sliding calculation to limit self-attention within the local window and perform comprehensive modeling of neighborhood features.
[0076] The following is an introduction to SwinTransformer, please refer to Figure 2 , a schematic diagram of the visual Transformer network.
[0077] The ViT architecture uses MLP layers to capture spatial and two-dimensional features, which has unique advantages in handling various tasks. Compared with CNN, ViT's self-attention mechanism works on global features, but lacks inductive bias. Figure 2The setup of ViT is shown, which includes splitting the input image into small patches, converting it into vectors, and then processing it through a Transformer. The encoder adopts the traditional Transformer approach, including embedded patches, layer normalization, and MSA. MSA combines the results of V and Q, enhances it through an MLP, and then returns it to the original structure. For image classification, ViT adds a unique tag to the input and outputs it as the final prediction result. This adaptability allows ViT to perform well in image classification tasks and fully utilizes its continuous processing capabilities.
[0078] Although ViT implements global self-attention modeling by dividing the image into 16×16 blocks, it has certain limitations in extracting multi-scale information. As the network depth increases, the number of blocks of ViT remains unchanged, which limits its ability to extract multi-scale features. In contrast, SwinTransformer adopts a hierarchical construction method, which gradually reduces the number of blocks and expands the receptive field of each block as the network depth increases, thereby better adapting to the multi-scale information in visual tasks.
[0079] Unlike traditional convolutional methods, SwinTransformer eliminates the generation of redundant information and solves the quadratic complexity problem associated with global self-attention calculation in the ViT model. It can still maintain linear computational complexity when the number of network layers increases, reflecting the advantages of hierarchical feature mapping and improving the performance of multi-scale features and dense prediction tasks. In addition, SwinTransformer further enhances the information interaction ability between neighborhood feature blocks through multi-level integrated embedding.
[0080] The SwinTransformer model structure is as follows Figure 3 As shown in the figure, the SwinTransformer network structure diagram is shown in Figure (a), where the SwinTransformer model structure is shown in Figure (b), and the SwinTransformer module is shown in Figure (b). The layered setting implemented by window sliding calculation can comprehensively model the neighborhood features of each block by limiting self-attention within a specific non-overlapping local window, thereby achieving a better global modeling effect.
[0081] Figure 3 Figure 1. An overview of the four different stages of the SwinTransformer model. It segments the input image into smaller 4×4 patches, forming patches. In the initial stage, these patches are transformed and embedded before being processed by the SwinTransformer module. Subsequent stages merge patches to gradually enrich the feature dimensions. Figure 3b shows the SwinTransformer module, which consists of two Transformer modules. The first block contains normalization, MSA, and MLP. However, the global self-attention method of MSA brings computational complexity. The second block introduces a sliding window mechanism to facilitate information exchange between adjacent windows. This approach can maintain computational efficiency while improving the performance of multi-scale tasks, thereby achieving flexible information processing and improving the accuracy of visual detection. This paper successfully combines the outstanding features of SwinTransformer with the C2f module in YOLOv8s to create a novel network architecture. This innovation enables the network to effectively capture global and local information on feature maps, establishing a complementary relationship between feature extraction and information fusion. Therefore, it greatly improves the detection accuracy of the network.
[0082] The improved YOLOV8S algorithm is introduced below.
[0083] The original YOLOv8s object detection network focuses on capturing local information in feature maps to enhance the receptive field of the model. However, for highly similar data, it may be difficult to extract basic specific entity features. To address this problem, this paper proposes a new object detector for detecting insulator damage defects, called YOLOv8s-SwinT, as shown in Figure 4 The figure shows the YOLOv8s-SwinT network architecture. This model integrates the SwinTransformer module into the Backbone layer and Neck layer of YOLOv8s, which facilitates the establishment of a global self-attention model during feature extraction. The traditional feature pyramid structure in YOLOv8s is replaced by an improved BiFPN structure, which dynamically balances features with different weight information at different scales. In addition, a small object detection layer is introduced to enhance the network's ability to detect insulator damage defects.
[0084] The C2fSRT module is introduced below. At present, the object detection method based on deep learning mainly uses CNN as the backbone network. However, the convolution structure is limited by the size of the convolution kernel and can only focus on the local area of the feature map, and has low sensitivity to global information. This limitation is particularly problematic for detecting small defect targets with small volume and limited feature information, which often leads to feature loss and increases the risk of false negatives. The C2fSTR module introduced in this invention aims to overcome the limitations of the convolution structure and enable the model to better capture global gradient flow information while remaining lightweight. Its structure is as follows Figure 5 As shown, the structure of the C2fSTR module is shown in the figure.
[0085] The setting of the C2fSTR module is inspired by the C3 module and ELAN, which contains a dedicated convolution module that effectively fuses feature maps of different scales to improve the model's re-scene and detection accuracy. The C3 module is a neural network module that extracts features of different scales through multiple parallel convolutional layers and fuses them to improve the model's expressiveness and detection accuracy. The ELAN (Effective Long-range Aggregation Network) module is a neural network module that is mainly used to capture long-range dependencies. During the processing, the ELAN module can effectively extract global background data, thereby improving the accuracy and efficiency of the model.
[0086] In YOLOv8s, the C2f module is applied to both the Backbone layer and the Neck layer to merge feature maps of different scales, and is an important component of the network structure. The present invention introduces the SwinTransformer module after the C2f module to further improve the performance of the model. SwinTransformer extracts global features through a self-attention mechanism and a sliding window, and strengthens the global information interaction in the feature map. This combination effectively solves the shortcomings of traditional convolution in global information acquisition, and especially improves the robustness and accuracy of detecting small defect targets. In summary, the C2fSTR module cleverly integrates the advantages of C2f and SwinTransformer, enabling the model to better capture global information while maintaining lightweight characteristics, thereby improving the performance of detecting small defect targets.
[0087] The subtle target detection layer is introduced below.
[0088] In traditional object detection networks, such as the original YOLOv8s, feature fusion usually starts from the third layer of features. The present invention introduces a small object detection layer on the basis of the original YOLOv8s algorithm to enhance the network's ability to detect small objects. The role of this layer is to incorporate the second layer features into the feature fusion network and retain more shallow semantic information. Specifically, the present invention introduces additional information about small objects by adding an initially unmerged 160×160 feature map to the feature extraction network. In order to effectively process this new feature map, the present invention performs an upsampling operation in the feature fusion network and then a downsampling operation. These operations increase the detection layer to four layers, enhancing the network's perception and sensitivity to small objects. This refined architecture enables the network to fully capture the semantic information in the image, mainly when dealing with small objects. By making these adjustments to the original YOLOv8s algorithm, the present invention aims to achieve excellent performance in object detection tasks, especially in dealing with small object detection tasks.
[0089] The improved BiFPN module is introduced below. The traditional FPN structure in the object detection network uses a top-down unidirectional information flow for feature fusion. Figure 6 As shown in a, PANet improves this process by introducing an additional bottom-up path. This improvement helps to transfer information more efficiently and retain shallow features. Figure 6 The BiFPN shown in b further improves the feature fusion process. The original BiFPN network fuses layers 3 to 7 of the 7 feature layers, using a specific strategy to consider that nodes with only one input edge contribute less to the network. BiFPN eliminates the feature fusion nodes in layers 3 and 7 to reduce computational complexity. In addition, a cross-scale connection method is introduced to improve feature representation. This method adds an additional edge to directly fuse features from the feature extraction network with features of relative size in the bottom-up path.
[0090] The present invention improves BiFPN by introducing cross-scale connections, which improves the feature fusion without significantly increasing the computational cost. The modified network structure is as follows Figure 6 As shown in c, the computational complexity is slightly higher, but it performs well in small object detection tasks. The basic advantage of this structure is that it can retain shallow semantic information while retaining relatively deep semantic information, thereby improving the overall perception ability of the network.
[0091] S2. Build and divide the data set.
[0092] The images of power transmission lines containing insulators are collected, and the insulators in the images are labeled to distinguish between normal insulators and damaged insulators. The dataset is then constructed and divided into training set, validation set and test set.
[0093] S3. Train the constructed model.
[0094] Use the training set to train the constructed model in a preset experimental environment;
[0095] S4. Conduct ablation experiments and comparative experiments.
[0096] Ablation experiments are carried out on the insulator dataset, and the trained model is compared with other typical related models.
[0097] Optionally, the ablation experiment analyzes the impact of the C2fSRT module, the subtle target detection layer, and the improved BiFPN module on the model performance, and makes targeted adjustments and optimizations to the model parameters based on the analysis results.
[0098] S5. Use the model to perform detection and output the results.
[0099] Use the trained and evaluated model to detect new power transmission line images and output defect detection results, defect types and defect location information.
[0100] Figure 7 The following are example diagrams of data enhancement, where (a) is a schematic diagram of geometric transformation, (b) is a schematic diagram of blackening an arbitrary rectangular area, (c) is a schematic diagram of blackening an arbitrary rectangular area and adjusting the brightness, and (d) is a schematic diagram of blackening an arbitrary rectangular area and adding Gaussian noise.
[0101] The present invention uses a labeling tool to annotate the actual boxes in the image and divides the annotated objects into ordinary insulators and damaged insulators. Subsequently, the present invention divides the annotated insulator dataset into a training set, a validation set, and a test set in a ratio of 7:2:1. The number and categories of labels in the dataset are shown in Figure 2. Figure 8 As shown, there are labels and label distribution diagrams.
[0102] The image sizes and numbers in the training set, validation set, and test set are shown in Table 1.
[0103] Table 1 Dataset division
[0104]
[0105] The software environment and hardware parameters used in the experiment are shown in Table 2.
[0106] Table 2 Experimental environment configuration
[0107]
[0108] In order to verify the positive impact of the proposed improvement strategy on the network, the present invention conducts an ablation experiment on the insulator dataset. Table 3 summarizes the ablation experiment results, where "√" indicates that the corresponding improvement method is adopted, and "×" indicates that it is not adopted. SOD represents the small target detection layer, and IBiFPN represents the improved BiFPN.
[0109] Table 3 Ablation experiment results
[0110]
[0111] As shown in Table 3, the present invention first uses the YOLOv8s model as the base network and tests the effect of adding the C2fSTR module. The results show that the precision is improved by 2.5%, the recall rate is improved by 2.8%, and the mAP@0.5 is improved by 2.1%. This shows that the C2fSTR module guides the network to focus on the local information in the feature map and improves the global information attention by adding the SwinTransformer module, thereby enhancing the detection ability of the model. In the second experiment, the present invention compares the impact of adding the improved BiFPN. The results show that compared with the base network, the precision is improved by 1.7%, the recall rate is improved by 1.1%, and the mAP@0.5 is improved by 1.5%. This shows that the new feature fusion network can effectively integrate more feature layers. In addition, during the feature fusion process, the network emphasizes the input features that have made significant contributions and enhances its learning ability. The third experiment compares the impact of adding a small object detection layer. The results show that compared with the base network, the precision and recall rate are improved by 0.3% and 0.4%, respectively, and the mAP@0.5 is improved by 0.6%. This shows that the addition of the small object detection layer enhances the network's ability to detect tiny defects and reduces the false negative rate. Finally, experiments were conducted combining the three improved methods. The results show that the comprehensive improved algorithm has the best performance, with an accuracy of 95.6%, a recall rate of 95.3%, and a mAP@0.5 of 97.6%, which meets the accuracy requirements of insulator defect detection.
[0112] In order to verify the superiority of the method of the present invention, the present invention compares it with YOLOv5s, FasterR-CNN and YOLOv7, as shown in Fig. 9 As shown in the figure, it is a comparison chart of the training results of different models, where (a) represents the accuracy; (b) represents the recall rate; and (c) represents MAP@0.5, which is the average value of the accuracy under different recall rates, calculated with an IoU threshold of 0.5. The results show that the improved algorithm of the present invention is superior to other models in terms of accuracy, recall rate and mAP@0.5.
[0113] Based on the above experiments, the enhanced YOLOv8s algorithm proposed in this paper has significant advantages in detection accuracy. The newly added C2fSTR module guides people to pay attention to the local information in the feature map and emphasizes the global information, which enhances the feature extraction ability of the network. After adding the small target detection layer and the improved feature fusion network, more scale feature layers can be integrated to improve small target detection and overall performance. Although the speed is slightly reduced, it can still meet the real-time requirements of insulator defect detection in actual engineering.
[0114] In order to verify the generalization ability and robustness of the algorithm, the present invention specially selected small objects and targets in complex environments for testing in the test set. Fig.10As shown, the detection results of different algorithms are represented, Figure (a) is R-CNN, Figure (b) is YOLOv5s, Figure (c) is YOLOv7, Figure (d) is YOLOv8s, and Figure (e) is the algorithm of the present invention.
[0115] It can be seen that the improved algorithm performs well in identifying tiny defects in insulators and can accurately identify insulator targets in challenging environments. The defect labels in the figure all represent damaged defects.
[0116] Please refer to Fig.11 The present invention also provides an insulator defect detection device, which is used to implement the insulator defect detection method as described above, comprising:
[0117] An image acquisition module 10, for acquiring images of power transmission lines including insulators;
[0118] The labeling module 20 is connected to the image acquisition module 10 and is used to label the insulators in the image acquired by the image acquisition module 10, distinguish between ordinary insulators and damaged insulators, thereby constructing a data set, and dividing the data set into a training set, a verification set and a test set according to corresponding rules;
[0119] A model building module 30 is used to integrate the characteristics of SwinTransformer into the YOLOv8s network architecture and combine it with the C2f module in YOLOv8s, introduce the C2fSRT module in the Backbone layer and the Neck layer of YOLOv8s, add a subtle target detection layer, and use an improved BiFPN module to obtain a fusion model;
[0120] The training module 40 is connected to the model building module 30 and the labeling module 20, and is used to train the model built by the model building module 30 using the training set divided by the labeling module 20 under a preset experimental environment;
[0121] The experimental analysis module 50 is connected to the training module 40 and is used to carry out ablation experiments on the insulator data set, and to compare the model trained by the training module 40 with other typical related models, and to adjust and optimize the model-related parameters based on the experimental results;
[0122] The detection module 60 is connected to the experimental analysis module 50 and is used to detect the new power transmission line image using the model evaluated by the experimental analysis module 50, and output defect detection results, defect types and defect location information.
[0123] The insulator defect detection device of the present invention is described in detail below.
[0124] The image acquisition module 10 is the front end of the entire detection device, equipped with a high-resolution image acquisition device, such as a high-definition camera, etc., which can clearly acquire images of power transmission lines including insulators. These images provide raw data for the subsequent detection process, and the quality of the images collected has an important impact on the accuracy of the final detection results. During the acquisition process, different environmental lighting conditions, shooting angles and other factors need to be taken into account to ensure that comprehensive and effective image information is collected.
[0125] The labeling module 20 is closely connected to the image acquisition module 10 and receives the images it has collected. The module has built-in professional labeling algorithms and tools to accurately label the insulators in the image based on the appearance characteristics of the insulators. During the labeling process, a strict distinction is made between ordinary insulators and damaged insulators. Damaged insulators include various defects such as cracks, wear, and contamination. After the labeling is completed, the data set is divided into a training set, a validation set, and a test set in a scientific and reasonable proportion to prepare for model training and evaluation. This process requires ensuring the accuracy and consistency of the labeling to avoid deviations in model training due to labeling errors.
[0126] The model building module 30 cleverly integrates the characteristics of SwinTransformer into the YOLOv8s network architecture and combines it with the C2f module. The C2fSRT module is introduced in the Backbone layer and Neck layer of YOLOv8s. This module combines the advantages of the C3 module and ELAN, and can effectively enhance the model's ability to capture global information. At the same time, a subtle target detection layer is added to enhance the detection ability of tiny targets by processing certain feature layers in the original algorithm. And the improved BiFPN module is used. This module improves the feature fusion degree without significantly increasing the computational cost through cross-scale connection, thereby further improving the model performance and finally obtaining a fusion model.
[0127] The training module 40 is connected to the model building module 30 and the annotation module 20, and performs model training according to a preset experimental environment. This experimental environment covers specific hardware configurations and software parameters. During the training process, the model constructed by the model building module 30 is repeatedly trained using the training set divided by the annotation module 20, so that the model can learn the image features of the insulator in different states, and gradually optimize the model parameters to improve the model's ability to detect insulator defects.
[0128] The experimental analysis module 50 is connected to the training module 40 and is responsible for in-depth analysis of the trained model. An ablation experiment is carried out on the insulator dataset. By removing or changing certain modules in the model one by one, such as the C2fSTR module, the subtle target detection layer, the improved BiFPN module, etc., the specific impact of each module on the model performance is analyzed. At the same time, the trained model is compared with other typical related models, such as YOLOv5s, Faster-RCNN and YOLOv7, and the model performance is comprehensively evaluated from multiple evaluation indicators such as accuracy, recall rate, mAP@0.5, etc. According to these experimental results, the relevant parameters of the model are accurately adjusted and optimized to further improve the performance and stability of the model.
[0129] The detection module 60 is connected to the experimental analysis module 50 and is the final execution link of the entire detection device. It uses the model evaluated by the experimental analysis module 50 to detect the new power transmission line image. During the detection process, the model can quickly and accurately analyze whether there are defects in the insulator in the image, and output detailed defect detection results, including the type of defect, such as cracks, wear, contamination and other specific types, and defect location information, such as the coordinate position in the image, etc., so as to provide accurate maintenance basis for power maintenance personnel and ensure the safe and stable operation of power transmission lines.
[0130] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements any of the above insulator defect detection methods when executing the computer program.
[0131] The present invention also provides a storage medium containing computer executable instructions, and the computer executable instructions are executed by a computer processor to implement any of the above insulator defect detection methods.
[0132] 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. A method for detecting insulator defects, characterized in that: include: Model construction includes: integrating the features of SwinTransformer into the YOLOv8s network architecture and combining it with the C2f module in YOLOv8s, introducing the C2fSRT module in the Backbone layer and Neck layer of YOLOv8s, adding a subtle target detection layer, and using an improved BiFPN module to obtain a fusion model; Collect images of power transmission lines containing insulators, annotate the insulators in the images, and distinguish between normal insulators and damaged insulators to construct a dataset. Then divide the annotated dataset into training set, validation set, and test set. Use the training set to train the constructed model in a preset experimental environment; Conduct ablation experiments on the insulator dataset and compare the trained model with other typical related models; Use the trained and evaluated model to detect new power transmission line images and output defect detection results, defect types and defect location information.
2. The insulator defect detection method according to claim 1, characterized in that: The method of obtaining the C2fSRT module includes: The structural features used to extract and fuse multi-scale features in the C3 module are combined with the structural features used to capture long-range dependencies in the ELAN module to obtain an intermediate product. Based on the feature information contained in the intermediate product as the feature extraction direction of the SwinTransformer module, the SwinTransformer module is introduced after the C2f module of the YOLOv8s network with a specific interface and parameter configuration.
3. The insulator defect detection method according to claim 1, characterized in that: The subtle target detection layer is constructed in the following way: The second layer features in the original YOLOv8s algorithm are incorporated into the feature fusion network, and a feature map with a size of 160×160 is added. Upsampling and downsampling operations are performed in the feature fusion network in sequence, so that the detection layer is increased to four layers, thereby enhancing the detection capability of subtle targets.
4. The insulator defect detection method according to claim 1, characterized in that: The improved BiFPN module is obtained by: Based on the traditional FPN unidirectional information flow, the PANet bottom-up path is used to improve information transmission and retain shallow features. Based on the original BiFPN, some feature fusion nodes are cancelled to reduce the computational complexity, and cross-scale connections are introduced based on the original BiFPN to improve feature representation.
5. The insulator defect detection method according to claim 1, characterized in that: The marking of the insulators in the image includes: The labeling tool is used to accurately mark the box where the actual physical boundary of the insulator is located.
6. The insulator defect detection method according to claim 1, characterized in that: The SwinTransformer adopts a hierarchical construction method to reduce the number of modules and expand the module receptive field as the network depth increases. It uses a hierarchical setting based on window sliding calculation to limit self-attention within a local window and perform comprehensive modeling of neighborhood features.
7. The insulator defect detection method according to claim 1, characterized in that: The ablation experiment analyzes the impact of the C2fSRT module, the subtle target detection layer, and the improved BiFPN module on the model performance, and makes targeted adjustments and optimizations to the model parameters based on the analysis results.
8. An insulator defect detection device, characterized in that: The method for detecting insulator defects according to any one of claims 1 to 7 comprises: An image acquisition module, used for acquiring images of power transmission lines including insulators; A labeling module, connected to the image acquisition module, is used to label the insulators in the image acquired by the image acquisition module, distinguish between ordinary insulators and damaged insulators, thereby constructing a data set, and dividing the data set into a training set, a verification set and a test set according to corresponding rules; The model building module is used to integrate the characteristics of SwinTransformer into the YOLOv8s network architecture and combine it with the C2f module in YOLOv8s, introduce the C2fSRT module in the Backbone layer and Neck layer of YOLOv8s, add a subtle target detection layer, and use the improved BiFPN module to obtain a fusion model; A training module, connected to the model building module and the annotation module, is used to train the model built by the model building module using the training set divided by the annotation module under a preset experimental environment; An experimental analysis module, connected to the training module, is used to carry out ablation experiments on the insulator data set, and to compare the model trained by the training module with other typical related models, and to adjust and optimize the model-related parameters based on the experimental results; The detection module is connected to the experimental analysis module and is used to detect the new power transmission line image using the model evaluated by the experimental analysis module, and output defect detection results, defect types and defect location information.
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 according to any one of claims 1 to 7 is implemented.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are executed by a computer processor to implement the insulator defect detection method according to any one of claims 1 to 7.
Citation Information
Cited By
Urban low-altitude weak unmanned aerial vehicle identification method based on self-attention mechanism
CN121582552A