Insulator fault detection method for overhead transmission line based on deep transfer learning
By employing the Swin Transformer and deep transfer learning methods, the accuracy and efficiency issues of insulator fault detection under complex backgrounds were addressed, achieving efficient and accurate insulator fault detection and reducing the safety risks and costs of manual inspection.
Patent Information
- Application Number
- CN202211711164.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-29
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-12-29
AI Technical Summary
Existing insulator fault detection methods struggle to meet the demands for high precision and efficiency in complex environments, especially for detecting insulator faults in drone aerial images. Traditional methods are inefficient and pose safety hazards, while deep learning methods still have room for improvement in feature extraction and detection speed.
The Swin Transformer module is used to extract insulator features, and deep transfer learning is used to map the insulator features of the source and target domains to the same subspace. Combined with linear discriminant analysis and pseudo-labeling methods, the accuracy of feature extraction and detection is improved.
It improves the accuracy and efficiency of insulator fault detection, enabling accurate identification of insulator faults in complex environments and reducing the safety risks and costs of manual inspection.
Smart Images

Figure CN115861857B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to insulator fault detection methods, and more particularly to an overhead transmission line insulator fault detection method based on deep transfer learning. Background Technology
[0002] With the rapid development of smart grid technology, the inspection of overhead transmission lines is a crucial prerequisite for ensuring the stable operation of the power system. Insulators are vital insulating components in overhead transmission lines, their primary function being to support and secure current-carrying conductors, playing a crucial role in ensuring the safety of power transmission. Because overhead transmission lines are exposed to the outdoors year-round and operate under high-voltage conditions, insulators are prone to damage and falling, thus affecting the stability and safety of the power system. To improve the safety factor of the power grid, it is essential to regularly inspect the insulators of overhead transmission lines to assess their condition and ensure the quality of power transmission. Traditional overhead transmission line inspections primarily rely on manual inspection for insulator abnormalities, which is labor-intensive, time-consuming, inefficient, and poses significant safety hazards. Compared to traditional manual inspections, drone inspections offer significant advantages such as low cost and ease of operation. Furthermore, they are not limited by terrain conditions and can acquire insulator image data from different angles and perspectives, which is of great significance for power line inspection and the safety and stability of overhead transmission lines.
[0003] Traditional power line inspections primarily rely on manual labor. Since most overhead transmission lines are located in rugged terrain, manual inspections require specialized power personnel to climb towers and perform regular maintenance on insulators at height. Manual inspections are limited by natural environmental and weather conditions, posing a high risk factor. Furthermore, given the vast number of overhead transmission lines in my country, relying solely on manual inspections is labor-intensive and inefficient. To improve the automation and intelligence of power line inspections, drone inspections have gradually become the primary method. Drones are easy to operate, have low environmental requirements, reduce manual labor, improve the efficiency of power line inspections, and ensure the safety of power system inspections. However, because drone-captured images of insulators have complex backgrounds and varying scales, manually identifying the insulator's condition would be extremely time-consuming. Therefore, automating image data processing and accurately detecting insulator conditions is crucial to improving the efficiency of power line inspections.
[0004] Currently, traditional insulator fault detection methods mainly involve image segmentation and machine learning to locate and detect insulators. Chen Wenhao et al. used the OTSU algorithm to segment insulator images to determine if a fault exists. Chen Guocui et al. extracted PHOG and BOW-SURF features from insulator images using a fast guided filtering algorithm and trained the images with an SVM classifier to improve the accuracy of insulator defect detection. Haiyan Cheng et al. segmented insulator images based on color features and used the vertical length of the segmented insulator and the horizontal distance between the insulator segments as spatial features to determine if a spontaneous explosion defect exists.
[0005] Traditional insulator fault detection methods struggle to detect defects in aerial images of insulators under complex backgrounds. However, deep learning-based detection methods extract features from the overall input insulator image and autonomously learn features to achieve defect detection. Wang Yijun et al. used YOLOv3-tiny to detect insulator self-explosion defects, improving the backbone network by introducing skip connections to enhance feature extraction capabilities. Tan Jicheng et al. used DenseNet as the feature extraction network for the SSD model to enhance its classification ability and improve accuracy. Wang et al. improved the Faster R-CNN algorithm, using ResNet as the backbone and introducing RPN into the ResNeSt network to strengthen defect feature extraction, thus improving the accuracy and speed of insulator defect detection. Liu et al. proposed an improved YOLO-v3 algorithm, achieving accurate localization of multiple insulators under different background interferences by adding a DenseNet module and an improved feature fusion strategy to the Darknet53 network. Fan P et al. used the random forest algorithm to segment insulators for target recognition, then used a convolutional neural network to determine whether there were defects in the insulators, and finally used the Faster R-CNN network to locate the location of the insulator defects; Shen Zehao et al. fused the features of each layer of Faster R-CNN and improved the detection accuracy of insulators by reducing the anchor frame size.
[0006] Deep learning-based detection methods offer advantages over traditional methods in terms of accuracy, speed, and generalization ability of model applications in insulator fault detection. However, there is still significant room for improvement in detection accuracy and speed for deep learning-based insulator fault detection. In practical inspection applications, issues such as the limited number of feature extraction network layers, blurred features extracted from insulator images with complex backgrounds, and the relatively small size of insulator faults compared to the insulator size make it difficult to meet actual work requirements. Summary of the Invention
[0007] Purpose of the invention: The purpose of this invention is to provide a method for detecting insulator faults in overhead transmission lines based on deep transfer learning, which can accurately and quickly detect insulator faults in overhead transmission lines and solve the problem of insulator faults during power line inspection.
[0008] Technical solution: The method for detecting faults in insulators of overhead transmission lines according to the present invention includes the following steps:
[0009] S1, acquire insulator image samples via drone and preprocess the image samples;
[0010] S2, divide the preprocessed insulator image samples into source domain and target domain, and label the source domain insulator image samples;
[0011] S3 uses the Swing Transformer module to extract insulator features from the source and target domains, and maps the insulator features in the image samples from the source and target domains to the same subspace;
[0012] S4, learns the insulator characteristics of the subspace using a linear discriminant analysis method;
[0013] S5 is a set of pseudo-labeled insulator fault samples in the target domain, and all target domain insulator fault samples are pseudo-labeled through iterative learning.
[0014] Furthermore, in step S1, images of overhead transmission line insulators under different environments are acquired by drone, and clear, high-quality aerial images of insulators are selected as image samples.
[0015] The insulator image samples are preprocessed using the copy-paste method and a mosaic enhancement algorithm. The specific implementation steps are as follows:
[0016] S11, Copy the small insulator targets that are difficult to detect from the insulator image sample, and then paste them to other locations in the image sample;
[0017] S12, four different insulator image samples are used as the top left, bottom left, top right and bottom right corners of the synthesized image, and then the four images are stitched into one image by random scaling, flipping and cropping;
[0018] S13, expand the image obtained by stitching in step S12 into the image sample.
[0019] Furthermore, in step S2, the specific implementation steps for dividing the insulator image samples into the source domain and the target domain are as follows:
[0020] S21, For the preprocessed image samples, the image samples are divided into two parts according to the insulator status: normal insulator image samples and faulty insulator image samples.
[0021] S22, mark the insulators in the normal insulator image samples, and record the marked normal insulator image samples as the source domain; record the unmarked faulty insulator image samples as the target domain.
[0022] Furthermore, the specific implementation steps for labeling the source domain insulator image samples in step S2 are as follows:
[0023] S201, Use the LabelImg tool to mark the insulators in the source domain insulator image samples. When marking, the label box should be close to the target edge and each insulator target should be marked independently. The label box should not exceed the image boundary.
[0024] If the overlapping portion of the targets is no more than half, the two annotation boxes are allowed to overlap; blurry or unclear targets are not marked.
[0025] S202 After marking is completed, the marked insulators are checked to ensure that the insulator labels are accurate; and a mark file with the same name as the insulator image is saved; the text information of the mark file includes the image name, image path, image resolution of the insulator image, as well as the bounding box coordinate parameters and label name of the mark.
[0026] Furthermore, in step S3, the Swin Transformer module is used as a feature extractor. The multi-level hierarchical structure of the Swin Transformer is used to extract features from the input image, resulting in four feature maps at different scales. The specific implementation steps are as follows:
[0027] S31, take the labeled source domain insulator image and the unlabeled target domain insulator fault image as the input image;
[0028] S32, the Patch Embedding layer divides the input image into four parts at equal intervals based on its height and width, and then stitches the divided images along the channel dimension, recombining the four parts into a single image. The feature map is then used; then, the number of channels in the input image is doubled using Linear Embedding, and the image dimensions are transformed to...
[0029] S33, construct 4 Swing-T blocks {C1,C2,C3,C4} from the Swing Transformer module according to the block number distribution of [2,2,6,2], with a downsampling factor of [4,8,16,32];
[0030] S34, the image obtained in step S32 is downsampled through three stages; each stage consists of a PatchMerging layer and a Swin Transformer module. The PatchMerging layer first divides the input feature map, then doubles the number of channels in the feature map using a Linear Embedding layer, thus achieving feature map downsampling. The dimensions of the feature map change sequentially.
[0031] Furthermore, in step S4, the specific implementation steps for learning the insulator characteristics of the subspace using the linear discriminant analysis method are as follows:
[0032] S41, use the labeled source domain insulator image samples as a labeled training sample set;
[0033] S42, Project the labeled source domain insulator image samples and the unlabeled target domain insulator fault samples onto the same straight line, and determine the sample category based on the position of the projection points:
[0034] If the samples are of the same type, the projection points of the two image samples will be close.
[0035] If the samples are outliers, the projection points of the two image samples will be far apart.
[0036] Furthermore, in step S5, the projection matrix Z is updated by combining the labeled source domain image samples and the pseudo-labeled target domain image samples, and an iterative learning method is used to improve the projection learning and pseudo-labeling. Pseudo-labeling of insulator faults in the target domain is performed using a nearest-class prototype method and a structure prediction-based method. The specific implementation steps are as follows:
[0037] S51, calculate the projections of source domain insulator samples and target domain insulator fault samples in subspace Z, and then derive the target domain insulator fault sample x using the average clustering centralization method and the L2 regularization method. t The conditional probability of belonging to class y; finally, the distance to these class prototypes is measured, and pseudo-labels are applied to insulator faults in the target domain;
[0038] S52, the structural information of the target domain insulator fault samples is obtained by cluster analysis. Then, the clustering of the target domain insulator fault samples is matched with the source domain insulators by structured prediction. Finally, pseudo-labels are applied to all target domain insulator faults according to the cluster to which the target domain insulator fault samples belong.
[0039] Compared with the prior art, the significant advantages of this invention are as follows:
[0040] 1. Using Swin-Transformer as a feature extractor to extract insulator features in the source and target domains can extract features of insulators of different sizes, improving the accuracy of insulator feature extraction;
[0041] 2. This invention divides insulator image samples into a source domain and a target domain using transfer learning, and maps the insulator features of the source domain and the target domain to the same subspace. By learning the insulator features of the labeled normal insulator image samples in the source domain of the subspace, the insulator fault features of the unlabeled fault insulator image samples in the target domain are transferred to improve the insulator feature learning efficiency.
[0042] 3. Insulator features in the subspace are learned through linear discriminant analysis. Linear discriminant analysis is a supervised learning method for dimensionality reduction and classification. In the dimensionality reduction process, prior knowledge and experience of categories can be used, and it has greater advantages over other algorithms when processing insulator feature classification information.
[0043] 4. By pseudo-labeling target domain insulator fault samples using the nearest class prototype and structured prediction methods, the accuracy of target domain insulator fault detection can be improved. Attached Figure Description
[0044] Figure 1 This is a flowchart of the present invention;
[0045] Figure 2 This is a schematic diagram illustrating the correlation between insulator samples in the source and target domains.
[0046] Figure 3 This is a schematic diagram of the Swin Transformer network structure;
[0047] Figure 4 This is a schematic diagram of the present invention. Detailed Implementation
[0048] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0049] This invention proposes a fault detection method for insulators of overhead transmission lines based on deep transfer learning, in order to improve the feature extraction capability of insulator images and meet the actual power inspection work requirements for fault detection of insulators in complex backgrounds.
[0050] Example Background: A deep convolutional neural network completes the task of identifying insulators on overhead power transmission lines during UAV power line inspection.
[0051] like Figure 1 As shown, the implementation steps of this invention are as follows:
[0052] Step 1: Acquire insulator image samples using a drone and preprocess the image samples.
[0053] This example uses a drone to acquire images of overhead transmission line insulators under different environments, selecting clear, high-quality aerial images of insulators as image samples. The insulator image samples are preprocessed using a copy-paste method and a mosaic enhancement algorithm. The copy-paste method first copies small insulator targets that are difficult to detect from the insulator image samples, then pastes the copied small insulator targets to other locations in the image samples, and then expands the image samples by generating a new insulator image. The copy-paste method can directly increase the number of small insulator target faults in the image samples, improving the sensitivity of the feature extractor to small insulator target faults.
[0054] The copy-paste method is described below: The main idea behind the copy-paste method is to combine two images of an insulator using a blending and large-scale shaking technique. The blending method involves combining two captured images of an insulator together; the specific formula is as follows:
[0055] I1×α+I2×(1-α)(1)
[0056] In the formula, I1 is the original image; I2 is the main image; and α is the mask.
[0057] The main steps are as follows: First, extract the pixels of the mask portion from the original image I1, and then paste them into the main image I2. Large-scale jitter is a method of scale jitter that expands the scale variation range based on standard-scale jitter. The scale variation range of the standard-scale jitter method is 0.8–1.25, while the scale variation range of the large-scale jitter method is 0.1–2.0. Large-scale jitter achieves a strong contrast jitter effect by expanding the jitter range.
[0058] The mosaic enhancement algorithm first uses four different insulator image samples obtained through a copy-and-paste method as the top-left, bottom-left, top-right, and bottom-right corners of the synthesized image. Then, it stitches the four images together into a single image through random scaling, flipping, and cropping. In actual power line inspections, some insulator targets may be obscured. The mosaic enhancement algorithm can enrich the background of the insulator image. By training different insulator targets with a single synthesized image, it can detect insulator faults in complex backgrounds, improving the system's robustness and insulator detection accuracy.
[0059] Step 2: Divide the insulator image samples into source and target domains, and label the source domain insulator image samples.
[0060] This example first classifies the selected high-quality image samples. Based on the insulator's condition, the image samples are divided into two parts: normal insulator image samples and faulty insulator image samples. Insulators in the normal insulator image samples are labeled, and the labeled normal insulator image samples are designated as the source domain; unlabeled faulty insulator image samples are designated as the target domain. Then, the insulator category in the image samples is determined. The image samples mainly collect samples of normal insulators and faulty insulators. The collected insulator faults are mainly external insulator faults, such as insulator bursting or insulator breakage. During data acquisition, for each insulator category, the number of samples is kept as large as possible, and the scenarios are kept as diverse as possible. The more abundant the samples, the better the insulator detection effect. Training samples are collected for both types of insulators, ensuring that the number of samples for each type is greater than 500, and the total number is not less than 2000.
[0061] The LabelImg tool, conforming to the PASCAL VOC labeling format, was used to label the insulators in the source domain insulator image samples. The correlation between the insulator samples in the source and target domains is as follows: Figure 2 As shown. When marking, the annotation box should be as close as possible to the target edge, and each insulator target should be marked independently; if the overlapping part of the targets is not more than half, the two annotation boxes are allowed to overlap; blurry targets should not be marked; the annotation box must not exceed the image boundary. After marking, the marked insulators should be checked to ensure that the insulator labels are accurate. The source domain insulator images are marked, and the insulator labels are set to "insulator". After marking, a marker file with the same name as the insulator image is saved. The text information of the marker file includes basic information about the insulator image, image name, image path, image resolution, and the bounding box coordinate parameters and label name of the markers. The text information of the marker file is as follows:
[0062]
[0063] Step 3: Use the Swin Transformer module to extract insulator features and map the insulator features from the source and target domain image samples to the same subspace.
[0064] This example uses the Swing Transformer as a feature extractor to extract features from insulator fault samples in the target domain. For example... Figure 3 As shown, the Swin Transformer is similar to the hierarchical idea of convolutional neural networks. First, it downsamples the features of the input image through the PatchEmbedding layer and the Patch Merging layer, and then extracts the features of the insulator through the Swin Transformer module, resulting in four feature maps of different scales.
[0065] The Swing Transformer is used as the feature extractor, and its multi-level hierarchical structure is used to extract features from the input image. Four Swing-T blocks {C1, C2, C3, C4} are constructed using the Swing Transformer with a block size distribution of [2, 2, 6, 2], and downsampling factors of [4, 8, 16, 32]. The parameters of the input image are (h, w, 1), where h is the height of the input image, w is the width of the input image, and 1 is the depth of the input image.
[0066] a1) Patch Embedding layer
[0067] The Patch Embedding layer consists of a Patch Partition layer and a Linear Embedding layer. Taking an h×w×1 grayscale image as input, the Patch Partition layer divides and reassembles the original input image. It divides the height and width of the input image into four equal parts, and then stitches the divided images along the channel dimension, recombining the four parts into a single image. The feature map. The Patch Partition layer divides the input image into 4×4 patches, transforming the dimensions of the input image into... The input image is transformed through a Linear Embedding layer, which doubles the number of channels and converts the dimensions of the input image to [the desired dimension].
[0068] a2) Patch Merging layer
[0069] The Patch Merging layer primarily downsamples the feature map to reduce its resolution and adjust the number of channels. Specifically, assuming an input image is a 4×4 single-channel feature map, the Patch Merging layer divides each 2×2 adjacent pixel into a patch. Then, pixels at the same position within each patch are concatenated to obtain four feature maps. The divided images are then concatenated along the channel dimension. The concatenated feature map undergoes a linear transformation along the channel dimension, changing the number of channels C to... Therefore, with each Patch Merging layer, the length and width of the feature map are halved, while the number of channels doubles.
[0070] a3)Swin Transformer module
[0071] The Swin Transformer module is used to compute multi-head self-attention, extract image features, and maintain the dimensionality of the input feature values. A Swin Transformer module contains a window self-attention mechanism layer or a transformation window self-attention mechanism layer, a layer normalization operation, and a multilayer perceptron module. The core of the Swin Transformer module is the self-attention mechanism layer and the transformation window self-attention mechanism layer. The self-attention mechanism layer divides the input image into four windows of a certain size, and each window performs self-attention computation independently. The drawback of this method is that it restricts the self-attention mechanism to a local area of each window, preventing each pixel from reaching the global receptive field. The transformation window self-attention mechanism layer changes the window division method, keeping the window for self-attention computation for each pixel in a changing state, thereby increasing the receptive field and extracting global features.
[0072] The subsequent stages consist of three phases, each comprising a Patch Merging layer and a Swin Transformer module. The Patch Merging layer first partitions the input feature map, then doubles the number of channels in the feature map using a Linear Embedding layer, achieving downsampling. The dimensions of the feature map change sequentially. The Swin Transformer only extracts features from the input image and does not change the dimensions of the feature map.
[0073] Step four: Learn the insulator characteristics of the subspace using a linear discriminant analysis method.
[0074] Insulator features from both the source and target domains are mapped to the same latent subspace. This subspace is then learned using linear discriminant analysis (LDA), with the expectation that it will share commonalities, meaning that projections of insulator samples from the same class will be close to each other. LDA is a classic linear learning method. First, labeled source domain insulator image samples are used as a labeled training sample set. Then, the labeled source domain insulator image samples and unlabeled target domain insulator fault samples are projected sequentially onto the same straight line. The sample class is determined based on the position of the projection points. If the samples are of the same class, the projection points of the two image samples will be as close as possible; if they are of different classes, the projection points will be as far apart as possible. When determining the distance between the projection points of two image samples, the concepts of Rayleigh quotient and generalized Rayleigh quotient are introduced.
[0075] Wherein, the Rayleigh quotient is a function R(A,x), expressed as follows:
[0076]
[0077] In the formula, x is a non-zero vector, and A is an n×n Hermitian matrix. R(A,x) needs to satisfy the following property: λ min ≤R(A,x)≤λ max In the formula, λ min λ is the smallest eigenvalue of matrix A. max Let x be the largest eigenvalue of matrix A. When x is an orthonormal basis, i.e., x... T When x = 1, R(A,x) = x H Ax.
[0078] The generalized Rayleigh quotient is a function R(A,B,x), expressed as follows:
[0079]
[0080] In the formula, x is a non-zero vector, and A and B are both n×n Hermitian matrices. The generalized Rayleigh quotient can be transformed into the Rayleigh quotient form through standardization, letting... The denominator is then transformed into:
[0081]
[0082] The molecule transforms into:
[0083] at this time Transform into
[0084] The maximum value of R(A,B,x′) is matrix B. -1 The largest eigenvalue of A is the minimum value of matrix B. -1 The smallest eigenvalue of A.
[0085] In this example, the insulator characteristics of the subspace are learned using a linear discriminant analysis method. The specific steps are as follows:
[0086] First, the labeled source domain insulator image samples are used as the labeled training sample set. Then, the labeled source domain insulator image samples and the unlabeled target domain insulator fault samples are projected sequentially onto the same straight line. The sample category is determined based on the position of the projection points. If the samples are of the same category, the projection points of the two image samples will be as close as possible; if the samples are of different categories, the projection points of the two image samples will be as far apart as possible. The known sets of source domain insulator image samples and target domain insulator fault image samples are as follows:
[0087]
[0088] In the formula, x i Let y be any one of the source domain insulator image samples and the target domain insulator fault image samples, an n-dimensional vector; iFor any type of image sample from the source domain insulator image sample and the target domain insulator fault image sample, y i ∈{0,1}; m is the total number of samples in the source domain insulator image sample set and the target domain insulator fault image sample set.
[0089] Let X0 be the set of source domain insulator image samples; X1 be the set of target domain insulator fault image samples; μ0 be the mean vector of the source domain insulator image samples; μ1 be the mean vector of the target domain insulator fault image samples; ∑0 be the covariance matrix of the source domain insulator image samples; and ∑1 be the covariance matrix of the target domain insulator fault image samples. If the sample data are projected onto the line ω, then the projections of the centers of the insulator samples and the insulator fault samples onto the line ω are respectively ω T μ0 and ω T μ1, the covariances of the insulator samples and the insulator fault samples on the straight line ω are ω1 and ω2, respectively. T ∑0ω and ω T ∑1ω.
[0090] The sample category is determined by the location of the projection points: if the samples are of the same type, the projection points of the two image samples will be as close as possible. This can be expressed by the formula: ω T ∑0ω+ω T ∑1ω should be as small as possible; if it is a heterogeneous sample, the projection points of the two image samples will be as far apart as possible. This can be expressed by the formula: Make it as large as possible.
[0091] By maximizing the generalized Rayleigh quotient, we obtain:
[0092]
[0093] Define the formula for the intra-class scatter matrix S. ω for:
[0094]
[0095] Define the formula S for the inter-class scatter matrix. b for:
[0096] S b =(μ0-μ1)(μ0-μ1) T (7)
[0097] Combining the intra-class scatter matrix S ω and the inter-class scatter matrix S b The generalized Rayleigh commerce can be updated to:
[0098]
[0099] because The numerator and denominator in the formula are both quadratic terms in ω, therefore, The solution depends on the direction of ω, not the magnitude of ω. Let ω T ω = 1, meaning ω is an orthonormal basis, therefore the formula can be used. Transform into (Constraint: ω) T ω=1); Combining the Lagrange multiplier method, its corresponding Lagrange function can be obtained as:
[0100]
[0101] Taking the derivative with respect to ω and setting it to 0, we get:
[0102]
[0103] right Perform eigenvalue decomposition, since S b S ω The constant direction is μ0-μ1, let S b After ω=λ(μ0-μ1), substituting it into formula (10) yields the optimal projection direction:
[0104]
[0105] The linear discriminant analysis-based algorithm used is shown in Table 1:
[0106] Table 1 uses a linear discriminant analysis-based algorithm.
[0107]
[0108] Step 5: Pseudo-label target domain samples and provide effective pseudo-labeled target domain insulator fault samples through iterative learning.
[0109] By combining labeled source domain image samples and pseudo-labeled target domain image samples, the projection matrix Z is updated, and an iterative learning method is used to improve projection learning and pseudo-labeling. Pseudo-labeling of insulator faults in the target domain is performed through a nearest-class prototype method and a structure prediction-based method.
[0110] The specific steps of the recent class prototype pseudo-labeling method are as follows: First, calculate the projections of the source domain insulator samples and the target domain insulator fault samples in the subspace Z. Then, derive the target domain insulator fault sample x by using centralization methods such as average clustering and L2 regularization. t The conditional probability of belonging to class y is calculated. Finally, the distance to these class prototypes is measured to pseudo-label the insulator faults in the target domain. However, the pseudo-labeling method based on class prototypes does not consider the inherent structural information of the insulator fault samples in the target domain. Therefore, the pseudo-labeling method based on structured prediction is chosen to pseudo-label the insulator fault samples in the target domain.
[0111] The specific steps of the structured prediction pseudo-labeling method are as follows: First, the structural information of the target domain insulator fault samples is obtained through cluster analysis. Then, the clusters of the target domain insulator fault samples are matched with the source domain insulators using structured prediction. Finally, pseudo-labels are applied to the target domain insulator faults based on the clusters to which the target domain insulator fault samples belong. The distance from the target domain insulator fault sample to the cluster center is calculated and used as the selective pseudo-labeling criterion, because target domain insulator fault samples closer to the cluster center are more likely to be selectively pseudo-labeled.
[0112] By combining the pseudo-labeling method that is closest to the class prototype and the pseudo-labeling method based on structured prediction, a subset of insulator fault samples in the target domain can be pseudo-labeled. Then, through an iterative learning process, all insulator fault samples in the target domain can be pseudo-labeled.
[0113] like Figure 4 As shown, this example uses pseudo-labeling of target domain samples and iterative learning to provide effective pseudo-labeled target domain insulator fault samples. This mainly consists of two parts: pseudo-labeling of target domain insulator fault samples and iterative learning with selective pseudo-labeling.
[0114] b1) Pseudo-labeling of insulator fault samples in the target domain
[0115] b11) Class prototype is pseudo-marked
[0116] Unlabeled target domain image samples can be labeled in the learning subspace Z, where the projections of source and target domain samples in the subspace are calculated by the following formula:
[0117]
[0118] In the formula, z s z is the projection of the source domain image sample onto the subspace; t P is the projection of the target domain image sample into the subspace; T The projection matrix; Image samples with labeled source domain; For unlabeled image samples in the target domain.
[0119] By using centralization methods such as average clustering and L2 regularization, the separability of different classes in space Z is improved. The class prototype of class y∈Y is defined as the mean vector of the projected source samples labeled y, as shown in the formula:
[0120]
[0121] By calculating a given target sample x t The conditional probability of belonging to class y is:
[0122]
[0123] 2) Pseudo-labels based on structural prediction
[0124] K-means is used to generate |Y| clusters on the projected vectors of all insulator fault samples in the target domain. Cluster centers are initialized by calculating class prototypes, establishing a one-to-one match between a cluster in the target domain and a class in the source domain, minimizing the sum of the distances between all matched cluster centers and class prototypes. Let A be a matrix representing a one-to-one mapping; the optimization formula is:
[0125]
[0126] By calculating a given target sample x t The conditional probability of belonging to class y is:
[0127]
[0128] b12) Iterative learning with selective pseudo-labels
[0129] An iterative learning strategy is used to learn the projection matrix P for aligning the source and target domains, and improved pseudo-labels are applied to insulator fault samples in the target domain. Both pseudo-labeling based on the closest class prototype and structured prediction can provide useful pseudo-labels for target domain insulator fault samples in the next iteration of learning. However, these two pseudo-labeling methods are fundamentally different. Pseudo-labeling based on the closest class prototype often outputs high probability for samples close to the source data; structured prediction outputs high probability for samples close to the cluster centers of the target domain, regardless of the distance from the source domain. A combination of these two target sample pseudo-labeling methods is used to pseudo-label insulator samples in the target domain. The specific steps of the pseudo-label prediction method for target domain insulator samples are as follows: Through... and The advantages of both pseudo-marking methods can be combined, and the specific formula is as follows:
[0130] p(y|x t )=max{p1(y|x t ),p2(y|x t )}(17).
[0131] Therefore, the target domain insulator fault sample x t The formula for predicting pseudo-labels is:
[0132]
[0133] The probabilities of all insulator fault samples and pseudo-labels in the target domain are expressed as:
[0134]
[0135] During projection learning, the target is not all pseudo-labeled target domain insulator fault samples, but rather a selected sample that includes... subset of target domain samples In the formula, k is the number of iterations for constructing the subset of fault samples of the target domain insulator; n t is the maximum number of insulator fault samples in the target domain; T is the number of iterations in the learning process. S is a subset of the insulator fault samples in the target domain. k In all target domain insulator fault samples Choose the one with the highest probability A subset S consists of insulator fault samples in the target domain. k However, this method may only select insulator fault samples of a specific category while ignoring other insulator fault sample categories. To avoid this, a classification selection is performed on the target domain insulator fault samples, ensuring that the pseudo-labeled target samples of each class have an equal selection opportunity. Specifically, for each category c∈Y, select... The target sample has pseudo-labels of class c, and then... Select the first pseudo-label S consists of high-probability samples k The unsupervised domain adaptation algorithm using selective pseudo-labels is shown in Table 2:
[0136] Table 2 shows unsupervised domain adaptation algorithms using selective pseudo-labels.
[0137]
[0138] Finally, through an iterative learning process, all insulator fault samples in the target domain can be pseudo-labeled.
Claims
1. A method for detecting faults in insulators of overhead transmission lines based on deep transfer learning, characterized in that, The steps include the following: S1, acquire insulator image samples via drone and preprocess the image samples; S2, the preprocessed insulator image samples are divided into source and target domains, and the source domain insulator image samples are labeled; the specific implementation steps for dividing the insulator image samples into source and target domains are as follows: S21, For the preprocessed image samples, the image samples are divided into two parts according to the insulator status: normal insulator image samples and faulty insulator image samples. S22, mark the insulators in the normal insulator image samples, and record the marked normal insulator image samples as the source domain; record the unmarked faulty insulator image samples as the target domain; S3 uses the Swing Transformer module to extract insulator features from the source and target domains, and maps the insulator features in the image samples from the source and target domains to the same subspace; S4, the specific steps for learning the insulator characteristics of the subspace using linear discriminant analysis are as follows: S41, use the labeled source domain insulator image samples as a labeled training sample set; S42, Project the labeled source domain insulator image samples and the unlabeled target domain insulator fault samples onto the same straight line, and determine the sample category based on the position of the projection points: If the samples are of the same type, the projection points of the two image samples will be close. If the samples are outliers, the projection points of the two image samples will be far apart; S5, pseudo-labeling the target domain insulator fault sample set, and iteratively learning to pseudo-label all target domain insulator fault samples; wherein, combining labeled source domain image samples and pseudo-labeled target domain image samples, the projection matrix Z is updated, and an iterative learning method is used to improve projection learning and pseudo-labeling, and pseudo-labeling of insulator faults in the target domain is performed by the nearest class prototype method and the structure prediction-based method; the specific implementation steps are as follows: S51, calculate the projections of source domain insulator samples and target domain insulator fault samples in subspace Z, and then derive the target domain insulator fault sample x using the average clustering centralization method and the L2 regularization method. t The conditional probability of belonging to class y; finally, the distance to these class prototypes is measured, and pseudo-labels are applied to insulator faults in the target domain; S52, the structural information of the target domain insulator fault samples is obtained by cluster analysis. Then, the clustering of the target domain insulator fault samples is matched with the source domain insulators by structured prediction. Finally, pseudo-labels are applied to all target domain insulator faults according to the cluster to which the target domain insulator fault samples belong.
2. The method for detecting faults in insulators of overhead transmission lines based on deep transfer learning according to claim 1, characterized in that, In step S1, images of overhead transmission line insulators under different environments are acquired by drone, and clear, high-quality aerial images of insulators are selected as image samples. The insulator image samples are preprocessed using the copy-paste method and a mosaic enhancement algorithm. The specific implementation steps are as follows: S11, Copy the small insulator targets that are difficult to detect from the insulator image sample, and then paste them to other locations in the image sample; S12, four different insulator image samples are used as the top left, bottom left, top right and bottom right corners of the synthesized image, and then the four images are stitched into one image by random scaling, flipping and cropping; S13, expand the image obtained by stitching in step S12 into the image sample.
3. The method for detecting faults in insulators of overhead transmission lines based on deep transfer learning according to claim 1, characterized in that, The specific steps for labeling the source domain insulator image samples in step S2 are as follows: S201, Use the LabelImg tool to mark the insulators in the source domain insulator image samples. When marking, the label box should be close to the target edge and each insulator target should be marked independently. The label box should not exceed the image boundary. If the overlapping portion of the target is no more than half, the two annotation boxes are allowed to overlap; Do not mark unclear or ambiguous targets; S202 After marking is completed, the marked insulators are checked to ensure that the insulator labels are accurate; and a mark file with the same name as the insulator image is saved; the text information of the mark file includes the image name, image path, image resolution of the insulator image, as well as the bounding box coordinate parameters and label name of the mark.
4. The method for detecting faults in insulators of overhead transmission lines based on deep transfer learning according to claim 1, characterized in that, In step S3, the Swing Transformer module is used as a feature extractor. The multi-level hierarchical structure of Swing Transformer is used to extract features from the input image, resulting in four feature maps at different scales. The specific implementation steps are as follows: S31, take the labeled source domain insulator image and the unlabeled target domain insulator fault image as the input image; S32, the Patch Embedding layer divides the input image into four equal parts based on its height and width, and then stitches the divided images along the channel dimension, recombining the four images into... The feature map is then used; then, the number of channels in the input image is doubled using LinearEmbedding, and the image dimensions are transformed to... S33, construct 4 Swing-T blocks {C1,C2,C3,C4} from the Swing Transformer module according to the block number distribution of [2,2,6,2], with a downsampling factor of [4,8,16,32]; S34, the image obtained in step S32 is downsampled through three stages; each stage consists of a PatchMerging layer and a Swin Transformer module. The PatchMerging layer first divides the input feature map, then doubles the number of channels in the feature map using a Linear Embedding layer, thus achieving feature map downsampling. The dimensions of the feature map change sequentially.