Insulator defect feature extraction method and device based on multi-centroid transfer learning
By employing a multi-centroid transfer learning method, utilizing spectral clustering algorithm and Laplacian matrix analysis, the accuracy problem of insulator defect detection across different scenarios was solved, achieving efficient feature extraction and recognition in complex backgrounds.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID JIANGSU ELECTRIC POWER CO LTD TAIZHOU POWER SUPPLY BRANCH
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional single-class-center-based transfer learning methods struggle to handle centroid structure differences within samples of the same class, leading to decreased accuracy of defect detection models across different scenarios and an inability to effectively identify defects in transmission lines.
A multi-centroid transfer learning approach is adopted. By constructing defect image datasets in various environments, spectral clustering algorithm is used to perform similarity analysis on image samples, calculate the Laplacian matrix, obtain the class centroids of the source and target domains, and perform transfer learning to extract insulator defect features.
It achieves accurate identification of insulator defects in different scenarios, improves the identification accuracy of defect detection and the generalization ability of the model, and adapts to the extraction of non-convex distribution features under complex backgrounds.
Smart Images

Figure CN121860973A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of insulator feature extraction, specifically relating to a method and apparatus for extracting insulator defect features based on multi-centroid transfer learning. Background Technology
[0002] As a crucial component of power transmission lines, insulators play a vital role in supporting conductors, isolating current, and preventing short circuits, ensuring the safety and stability of the line. However, during long-term use, insulators are susceptible to various factors such as environmental conditions, mechanical stress, and electrical stress, leading to defects such as breakage, flashover, and string failure. Failure to detect and repair these defects in a timely manner can result in equipment malfunctions or even large-scale power accidents. Therefore, regularly inspecting the operating status of insulators is extremely important.
[0003] With the development of power systems, the inspection of transmission lines has become particularly important. However, the accuracy of defect detection models is often affected by different scenario conditions (such as lighting, weather, and geographical environment). Especially in cross-scenario transfer learning, due to the highly complex multi-centroid characteristics of the distribution of similar samples, traditional single-center-based transfer learning methods have limited performance and are difficult to accurately identify various defects in transmission lines.
[0004] Patent application CN120808017A discloses a small-sample insulator defect detection method based on cross-domain feature fusion and transfer, comprising: pre-training a ConvNeXt network using the ImageNet image dataset; freezing the weights of the ConvNeXt network backbone convolutional layers and constructing dynamic feature modulation modules based on attention mechanisms in the shallow and deep layers of the ConvNeXt network to extract local and global features of the insulator; fusing the extracted local and global features by adopting a top-down feature information stacking and transfer and a bottom-up progressive fusion strategy to achieve multi-dimensional interaction between local detail features and global semantic features. By organically combining the above local-global interaction mechanism with transfer learning methods, a cross-domain feature transfer channel is established, effectively realizing a robust mapping from low-level visual features to high-level semantic features, and improving the detection accuracy of insulator images when samples are scarce.
[0005] Current analysis of transmission line defect images, including the aforementioned technologies, relies on datasets from single scenes, neglecting the impact of scene variations on image features. For example, there are significant differences between images of damaged insulators taken on a sunny urban suburb and images of the same type against a vegetated mountain background on a rainy day. This difference leads to a substantial performance drop in models trained in one scene when applied to another. Furthermore, traditional class-center-based transfer learning methods cannot effectively handle differences in centroid structure within samples of the same class, thus affecting the model's generalization ability. Therefore, how to extract features from source and target domains mixed with multiple scenes, effectively identify defect types in the target domain, and achieve defect feature extraction unaffected by scene changes is a problem that needs to be solved. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method and apparatus for extracting insulator defect features based on multi-centroid transfer learning. The method includes: collecting insulator defect image datasets for various environments based on environmental influencing factors; dividing the insulator defect image datasets according to the insulator defect type to obtain source domain defect image sets and target domain defect image sets for different environments; performing similarity analysis on image samples in the source domain and target domain defect image sets respectively to obtain source domain affinity matrices and target domain affinity matrices; calculating the corresponding Laplacian matrices based on the source domain and target domain affinity matrices to obtain sample clustering results for the source and target domains; performing spectral clustering on samples of each insulator defect type according to the sample clustering results for the source and target domains to obtain source domain centroids and target domain centroids; and performing transfer learning between the source and target domains using the source and target domain centroids to obtain feature projection matrices, thereby extracting insulator defect features.
[0007] Based on environmental influencing factors, a defect image dataset for various environments is constructed. Then, image samples with the same defect type are divided. By constructing an affinity matrix between image samples and calculating the Laplacian matrix, the high-dimensional nonlinearly distributed samples are mapped to a low-dimensional spectral space using feature vectors for clustering, and the centroids of the source domain and the target domain are obtained. Finally, a learning objective function is constructed by weighting the feature difference measure, and transfer learning is performed to minimize the distribution difference between the source and target domains, while maintaining small intra-class differences and large inter-class separability, resulting in a feature projection matrix. This matrix can effectively identify the defect type in the target domain and achieve defect feature extraction that is unaffected by scene changes.
[0008] In a first aspect, the present invention provides a method for extracting insulator defect features based on multi-centroid transfer learning, specifically including the following steps: Based on the environmental influencing factors of insulators, a dataset of insulator defect images in various environments was collected; Based on the defect type of the insulator, the insulator defect image dataset is divided to obtain source domain defect image sets and target domain defect image sets under different environments; Similarity analysis was performed on image samples from the source domain defect image set and the target domain defect image set respectively to obtain the source domain affinity matrix and the target domain affinity matrix; Based on the source domain affinity matrix and the target domain affinity matrix, the corresponding Laplacian matrix is calculated to obtain the sample clustering results corresponding to the source domain and the target domain; Based on the sample clustering results corresponding to the source domain and the target domain, spectral clustering is performed on the samples of each type of insulator defect to obtain the centroids of the source domain and the target domain. By using the centroids of the source and target domains, transfer learning is performed between the source and target domains to obtain the feature projection matrix, thereby enabling the extraction of insulator defect features.
[0009] Furthermore, similarity analysis is performed on image samples from the source domain defect image set and the target domain defect image set respectively to obtain the source domain affinity matrix and the target domain affinity matrix, specifically including: Based on image samples of each defect type in the source domain defect image set and the target domain defect image set, vector transformation is performed on the image samples in the source domain defect image set and the target domain defect image set respectively to obtain image sample vectors; Calculate the Euclidean distance between any two image sample vectors, and combine it with the Gaussian kernel function to give the affinity coefficient between the image samples; The affinity coefficients corresponding to the image samples in the source domain defect image set and the target domain defect image set are fused to obtain the source domain affinity matrix and the target domain affinity matrix.
[0010] Furthermore, the Euclidean distance between any two image sample vectors is calculated, and combined with the Gaussian kernel function, the affinity coefficient between the image samples is given, specifically including: Based on the Euclidean distance between two image samples, and combined with the similarity scale parameter, the similarity fundamental term is obtained; By adjusting the similarity basis terms using an exponential function, the affinity coefficient between image samples is obtained.
[0011] Furthermore, based on the source domain affinity matrix and the target domain affinity matrix, the corresponding Laplacian matrix is calculated to obtain the sample clustering results corresponding to the source domain and the target domain, specifically including: Based on the affinity coefficients in the source domain affinity matrix and the target domain affinity matrix, the degree of each image sample is determined, and the source domain degree matrix and the target domain degree matrix are constructed. By fusing the source domain degree matrix and source domain affinity matrix, the target domain affinity matrix and target domain degree matrix respectively, and combining them with the identity matrix, we obtain the Laplacian matrices corresponding to the source domain and the target domain. Feature analysis and feature selection are performed on the Laplacian matrix to obtain multiple eigenvalues and corresponding eigenvectors; The feature vectors are concatenated and normalized to obtain a low-dimensional spectral embedding feature matrix; Clustering analysis was performed using the low-dimensional spectral embedding feature matrix to obtain the sample clustering results corresponding to the source domain and the target domain, respectively.
[0012] Furthermore, based on the clustering results of the source domain samples and the target domain samples, spectral clustering is performed on the samples of each type of insulator defect to obtain the centroids of the source domain and the target domain, specifically including: Based on the source domain sample clustering results, the mean value of the samples for each type of insulator defect is calculated to determine multiple source domain centroids. Based on the clustering results of the target domain samples, the mean value of the samples for each type of insulator defect is calculated to determine the centroids of multiple target domain classes.
[0013] Furthermore, by using the source domain class centroid and the target domain class centroid, transfer learning is performed between the source and target domains to obtain the feature projection matrix, which specifically includes: Analyze the differences between the centroids of the source domain and the target domain to determine the centroid difference terms; The centroid difference term and the manifold regularization term are fused to construct the learning objective function; Using the variance of the entire sample as a constraint, the learning objective function is solved to obtain the feature projection matrix.
[0014] Furthermore, the objective function is learned through the following steps: Based on the centroid difference coefficient, the centroid difference term is adjusted to give the first objective term; The regularization coefficient and the manifold regularization term are fused to obtain the second objective term; By modifying the shared feature matrix using shared coefficients, the third objective term is obtained. The shared feature matrix is used to perform dimensionality reduction mapping on the features of samples in the source domain defect image set and the target domain defect image set. The first, second, and third objective terms are combined to construct a learning objective function.
[0015] Furthermore, using the global sample variance as a constraint, the learning objective function is solved to obtain the feature projection matrix, which specifically includes: Transform the learning objective function into a generalized eigenvalue equation; Solving the generalized eigenvalue equation yields multiple non-zero eigenvalues and their corresponding eigenvectors. The non-zero eigenvalues are filtered to obtain the target eigenvalues; The feature projection matrix is obtained by combining the feature vectors corresponding to the target feature values.
[0016] Furthermore, the generalized eigenvalue equation is determined through the following steps: The structural risk matrix is obtained by weighted summation of the global centroid matrix, the marginal distribution matrix, the conditional distribution matrix, and the global Laplace matrix. The covariance matrix of the global image sample vectors is calculated using the centered matrix, thus obtaining the data variance constraint matrix. Based on generalized eigenvalues and generalized eigenvectors, the relationship between the structural risk matrix and the data variance constraint matrix is constructed, forming a generalized eigenvalue equation.
[0017] Secondly, the present invention also provides an insulator defect feature extraction device based on multi-centroid transfer learning, employing an insulator defect feature extraction method based on multi-centroid transfer learning as described above, comprising: The image acquisition module is used to collect image datasets of insulator defects in various environments based on the environmental influencing factors of insulators; The image segmentation module is used to segment the insulator defect image dataset based on the insulator defect type, resulting in source domain defect image sets and target domain defect image sets under different environments; The similarity analysis module is used to perform similarity analysis on image samples in the source domain defect image set and the target domain defect image set respectively, and obtain the source domain affinity matrix and the target domain affinity matrix; The sample clustering module is used to calculate the corresponding Laplacian matrix based on the source domain affinity matrix and the target domain affinity matrix, and obtain the source domain sample clustering results and the target domain sample clustering results; The centroid determination module is used to perform spectral clustering on samples of each type of insulator defect based on the clustering results of the source domain samples and the clustering results of the target domain samples, so as to obtain the centroids of the source domain class and the target domain class. The transfer learning module is used to perform transfer learning between the source and target domains using the source domain centroid and the target domain centroid, to obtain the feature projection matrix and extract the defect features of the insulator.
[0018] The insulator defect feature extraction method and apparatus based on multi-centroid transfer learning provided by this invention have at least the following beneficial effects: (1) Based on environmental influencing factors, a defect image dataset of various environments is constructed. Then, image samples of the same defect type are divided. By constructing the affinity matrix between image samples and calculating the Laplacian matrix, the high-dimensional nonlinear distribution samples are mapped to the low-dimensional spectral space using feature vectors to perform clustering and obtain the centroids of the source domain and the target domain. Finally, by designing the weights of the feature difference measure, a learning objective function is constructed and transfer learning is performed to minimize the distribution difference between the source domain and the target domain, while maintaining small intra-class differences and large inter-class separability, resulting in a feature projection matrix. This can effectively identify the defect type of the target domain and achieve defect feature extraction that is not affected by scene changes.
[0019] (2) By dividing image samples of the same defect type into multiple centroids according to their features, a multi-centroid difference measurement mechanism is constructed. The centroids are aligned separately, which can better handle intra-class differences caused by scene changes and avoid confusing features of different environments. This improves the recognition accuracy of defect extraction, realizes the synergistic optimization of distribution consistency, intra-class compactness and inter-class separability in cross-domain feature space, and improves the accuracy of defect detection in unknown scenarios. Attached Figure Description
[0020] Figure 1 A flowchart illustrating the insulator defect feature extraction method based on multi-centroid transfer learning provided in this embodiment of the invention; Figure 2 This is a flowchart illustrating the process of obtaining the source domain affinity matrix and the target domain affinity matrix, provided in an embodiment of the present invention. Figure 3 A flowchart for determining sample clustering results provided in an embodiment of the present invention; Figure 4 This is a flowchart of obtaining the source domain class centroid and the target domain class centroid provided in an embodiment of the present invention; Figure 5 A flowchart for obtaining the feature projection matrix provided in an embodiment of the present invention; Figure 6 A flowchart for solving the learning objective function provided in an embodiment of the present invention; Figure 7 This is a structural block diagram of an insulator defect feature extraction device based on multi-centroid transfer learning provided in an embodiment of the present invention.
[0021] Among them, 201 is the image acquisition module; 202 is the image segmentation module; 203 is the similarity analysis module; 204 is the sample clustering module; 205 is the centroid determination module; and 206 is the transfer learning module. Detailed Implementation
[0022] To better understand the above technical solutions, a detailed description of the solutions will be provided below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0023] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.
[0024] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.
[0025] Currently, transfer learning theory typically uses maximum mean discrepancy (MMD) to measure the difference in distribution between the source and target domains. By minimizing MMD, the overall mean and class mean of samples in the source and target domains can be aligned. However, since the mean only reflects the overall information of the class and ignores the possibility of multiple centroids within the same class, class information may be lost, making it difficult to align the distributions of the source and target domains. Furthermore, using only the mean or alignment based on the centers of simple clusters ignores the inherent distributional consistency of samples on the manifold, which can easily lead to overlap between classes in the target domain within the solved shared feature representation space, limiting the classification accuracy of transfer learning.
[0026] To address the issue of inter-class overlap in the target domain caused by using average values for conditional distribution alignment, existing methods attempt to consider multi-centroid structures within classes. However, most still employ traditional clustering methods based on Euclidean distance, such as K-means. In real-world scenarios of power transmission line defect detection, complex backgrounds such as messy tree branches, construction nets, and high light reflections often cause samples of the same type of defect in the high-dimensional feature space to exhibit non-spherical or convex distributions. Simply using Euclidean distance for geometric partitioning can easily forcibly cut samples belonging to the same semantic manifold into different subclusters, or misclassify samples that are spatially close but belong to different manifold structures. This leads to the loss of class information for samples of the same class, resulting in difficulty in aligning the distributions of the source and target domains. Ultimately, samples belonging to different categories are not effectively distinguished, limiting the accuracy of transfer learning classification. Therefore, how to efficiently measure the differences in multi-centroid features is the problem that this invention aims to solve.
[0027] While existing research has attempted to address the feature distribution differences in cross-scene migration using multi-centroid methods, traditional methods largely rely on Euclidean distance-based clustering algorithms such as K-means. Specifically, the traditional K-means algorithm is based on the strong assumption that "clusters are spherical or convex sets," which is significantly inconsistent with the actual data distribution in the complex scenarios of power transmission lines. Traditional methods often assume that samples of the same category are compact and continuous in the feature space, but this assumption does not hold true in the actual inspection scenarios of power transmission lines. Influenced by complex micro-meteorological and geographical environments, the same type of defect often exhibits a highly irregular, non-convex distribution in the feature space, forming multiple "centroids" with independent features. For example, the same defect, "insulator damage," may appear as a high-backlight silhouette in a "dense photovoltaic panel area in a plain," due to the reflection from large water sources or photovoltaic panels; in a "mountainous forest area," the background is filled with tree branch textures; and in an "urban construction site," the background may contain brightly colored interfering objects such as dust nets and steel plates. These drastically different scenarios cause the same type of defect to split into multiple substructures such as "backlight centroid," "forest geology centroid," and "construction site background centroid." If the traditional K-means method is used, samples that originally belonged to the same manifold structure will be forcibly cut apart based on the distance between the center points, or incorrectly merged into the centroids of nearby defects. This results in the loss of the crucial scene context topology, and the model cannot accurately distinguish between real and fake defects in complex backgrounds.
[0028] To address the aforementioned issues, this invention proposes a method for extracting insulator defect features based on multi-centroid transfer learning. The method includes: collecting insulator defect image datasets from various environments based on environmental influencing factors; dividing the insulator defect image datasets according to the insulator defect type to obtain source domain defect image sets and target domain defect image sets under different environments; performing similarity analysis on image samples in the source domain and target domain defect image sets respectively to obtain source domain affinity matrices and target domain affinity matrices; calculating the corresponding Laplacian matrices based on the source domain and target domain affinity matrices to obtain sample clustering results for the source and target domains; performing spectral clustering on samples of each insulator defect type based on the sample clustering results for the source and target domains to obtain source domain centroids and target domain centroids; and performing transfer learning between the source and target domains using the source and target domain centroids to obtain feature projection matrices, thereby extracting insulator defect features.
[0029] By analyzing the influencing factors of transmission line defects in images, the specific impact of scene changes on image features is determined (environmental influencing factors are identified), and a defect image dataset containing various scene changes is constructed. Then, a spectral clustering algorithm is used to segment image samples of the same defect type. By constructing an affinity matrix between samples and calculating the Laplacian matrix, eigenvectors are used to map high-dimensional nonlinearly distributed samples to a low-dimensional spectral space for clustering. This method can segment "spectral centroids" based on the connectivity between samples rather than simply Euclidean distance, thus effectively identifying feature clusters of arbitrary shapes (such as ring-shaped or strip-shaped distributions) and more accurately representing the defect distribution structure in complex scenes. A learning objective function is constructed by weighting the feature difference measure to minimize the distribution difference between the source and target domains, while maintaining small intra-class differences and high inter-class separability.
[0030] This invention overcomes the limitations of Euclidean distance by introducing spectral clustering, adapting to the common non-spherical and non-linear feature distributions in power transmission line inspection images. Utilizing global topological information, it aligns source and target domain features in mixed scenarios (such as backlighting, woodlands, and construction site backgrounds) in a more physically semantically consistent manner. It effectively identifies defect types in the target domain, enabling defect feature extraction unaffected by scene changes, improving the model's generalization ability and robustness in unknown and complex scenarios, and solving the problem of feature alignment difficulties caused by the non-convex distribution of similar samples in complex backgrounds.
[0031] like Figure 1 As shown in the figure, this embodiment of the invention provides a method for extracting insulator defect features based on multi-centroid transfer learning, and the specific steps are as follows: S101: Based on the environmental influencing factors of insulators, collect image datasets of insulator defects in various environments.
[0032] It is important to understand that power transmission lines traverse complex terrains, making image acquisition quality highly susceptible to interference from micro-meteorological conditions and the surrounding unstructured environment. To accurately quantify the feature differences between the source and target domains, this invention, based on field surveys and statistical analysis of massive amounts of inspection data, deconstructs the environmental factors causing non-stationarity in the cross-domain feature spatial distribution into the following four dimensions of visual perturbation variables: 1. Complex background interference: Transmission line corridors often pass through dynamically changing construction areas. Non-target objects that frequently appear in the background, such as excavators, stockpiled materials, green dust nets, and reflective steel plates, not only introduce complex background texture noise, but also easily cause physical occlusion of small target defects such as loose bolts at the bottom of the tower, and also cause false detection confusion in the model during feature extraction. 2. Effects of Illumination and Reflection: When the inspection view passes over large bodies of water or photovoltaic array areas, strong diffuse and specular reflection from the water surface can cause localized highlight clipping or severe backlighting in the image. This nonlinear transformation of illumination results in a significant loss of texture details on the surfaces of wires and hardware, leaving only edge contour information and altering the frequency domain distribution of features. 3. Differences in meteorological conditions: Changes in the atmospheric medium directly alter the image quality. Haze, acting as a low-pass filter, leads to the loss of high-frequency information, reduced contrast, and blurred edges; while snowfall not only causes snow cover and obstruction, but the resulting bright background also alters the grayscale distribution histogram of fine textures such as broken wire strands, resulting in drastic shifts in the feature space. 4. Diversity of Defects: Unlike defects in standardized industrial products, defects in transmission lines exhibit strong unstructured and random characteristics. For example, the morphology of conductor strands is disordered and divergent, and the material and shape of floating foreign objects are randomly varied. This drastic variation in intraclass morphology makes it difficult for similar samples to aggregate into a compact single centroid in the feature space, resulting in a discrete manifold distribution.
[0033] Table 1. Environmental factors affecting the construction of the defective image dataset
[0034] Based on this, a wide range of transmission line inspection images from different geographical regions, seasons and time periods were collected as defect images, covering typical defect types such as insulator damage, hardware corrosion and conductor strand breakage, and were finely annotated.
[0035] S102: Based on the defect type of the insulator, the insulator defect image dataset is divided to obtain source domain defect image sets and target domain defect image sets under different environments.
[0036] By analyzing environmental influencing factors, the defect image datasets under various environments were divided into source domain defect image sets and target domain defect image sets, which contain significant scene differences. The correspondence between the source domain defect image sets and target domain defect image sets under different environments is shown in Table 2: Table 2. Image datasets of insulator defects in various environments.
[0037] Based on this, a cross-scenario dual-domain dataset containing the source domain and the target domain is constructed. In order to simulate cross-domain migration scenarios in actual inspection scenarios, it is ensured that there are significant statistical distribution differences between the two domains in the aforementioned visual perturbation dimensions. For example, the source domain mainly consists of data collected in sunny weather in urban suburbs, while the target domain consists of data collected in rainy weather conditions in mountainous areas, but their semantic category labels remain consistent, in order to simulate the cross-scenario migration problem in actual applications.
[0038] Among them, the defect images in both the source domain defect image set and the target domain defect image set have undergone data preprocessing, including resolution unification, color space standardization, and pixel value normalization.
[0039] S103: Perform similarity analysis on image samples in the source domain defect image set and the target domain defect image set respectively to obtain the source domain affinity matrix and the target domain affinity matrix.
[0040] Furthermore, similarity analysis was performed on image samples from the source domain defect image set and the target domain defect image set respectively to obtain the source domain affinity matrix and the target domain affinity matrix, referring to... Figure 2 Specifically, it includes: Based on image samples of each defect type in the source domain defect image set and the target domain defect image set, vector transformation is performed on the image samples in the source domain defect image set and the target domain defect image set respectively to obtain image sample vectors; Calculate the Euclidean distance between any two image sample vectors, and combine it with the Gaussian kernel function to give the affinity coefficient between the image samples; The affinity coefficients corresponding to the image samples in the source domain defect image set and the target domain defect image set are fused to obtain the source domain affinity matrix and the target domain affinity matrix.
[0041] In one specific implementation, image samples of each defect type in the source domain defect image set and the target domain defect image set are first processed by a pre-trained convolutional neural network to extract high-level semantic features and then transformed into vectors to obtain the image sample vectors corresponding to each image sample. Considering that under complex backgrounds and illumination interference, image samples of the same defect type often exhibit non-convex structures in the feature space, and their centroid structures differ, traditional Euclidean distance metrics are difficult to capture their global distribution topology. Based on this, this implementation uses a spectral clustering algorithm to map the image samples to a low-dimensional spectral space for substructure partitioning, thereby determining multiple "spectral centroids" that can reflect the intrinsic geometric features of the image samples.
[0042] Specifically, for a set of image samples of a certain defect type in the source domain defect image set or the target domain defect image set. N is the number of samples, and m is the feature dimension. First, an undirected weighted graph G=(V,E) is constructed, where the vertex set V corresponds to each image sample point, and the weights of the edge set E represent the similarity between each image sample, i.e., the affinity coefficient of each image sample.
[0043] Furthermore, the Euclidean distance between any two image sample vectors is calculated, and combined with the Gaussian kernel function, the affinity coefficient between the image samples is given, specifically including: Based on the Euclidean distance between two image samples, and combined with the similarity scale parameter, the similarity fundamental term is obtained; By adjusting the similarity basis terms using an exponential function, the affinity coefficient between image samples is obtained.
[0044] In a specific example, the affinity matrix A∈R is constructed using the Gaussian kernel function. N×N In the affinity matrix, the affinity coefficient A ij Specifically, it is expressed as follows: Where σ is a similarity scale parameter that controls the width of the similarity neighborhood. Let exp() be the Euclidean norm, and let exp() be the exponential function. As a similar basic term, x i Let x be the image sample vector corresponding to the i-th image sample. j Let be the image sample vector corresponding to the j-th image sample.
[0045] By constructing an affinity matrix, the local connectivity relationships between image samples are captured, thereby transitively reflecting the global topological structure.
[0046] It is understood that the above describes the construction of affinity matrices for a set of image samples of a certain defect type in the source domain defect image set and / or the target domain defect image set. The same operation can be performed on image sample sets of other defect types in the source domain defect image set and / or the target domain defect image set to obtain the corresponding affinity matrices, which will not be elaborated here.
[0047] S104: Based on the source domain affinity matrix and the target domain affinity matrix, calculate the corresponding Laplacian matrix to obtain the sample clustering results corresponding to the source domain and the target domain.
[0048] Furthermore, based on the source domain affinity matrix and the target domain affinity matrix, the corresponding Laplacian matrix is calculated to obtain the sample clustering results corresponding to the source domain and the target domain, referring to... Figure 3 Specifically, it includes: Based on the affinity coefficients in the source domain affinity matrix and the target domain affinity matrix, the degree of each image sample is determined, and the source domain degree matrix and the target domain degree matrix are constructed. By fusing the source domain degree matrix and source domain affinity matrix, the target domain affinity matrix and target domain degree matrix respectively, and combining them with the identity matrix, we obtain the Laplacian matrices corresponding to the source domain and the target domain. Feature analysis and feature selection are performed on the Laplacian matrix to obtain multiple eigenvalues and corresponding eigenvectors; The feature vectors are concatenated and normalized to obtain a low-dimensional spectral embedding feature matrix; Clustering analysis was performed using the low-dimensional spectral embedding feature matrix to obtain the sample clustering results corresponding to the source domain and the target domain, respectively.
[0049] The source domain degree matrix and the target domain degree matrix are diagonal matrices, specifically represented as follows: Among them, D ii A represents the degree corresponding to the i-th row and i-th column of the source or target domain degree matrix. ij Let be the affinity coefficient corresponding to the i-th row and j-th column in the affinity matrix.
[0050] Laplace matrix L sym Specifically, it is expressed as: Where I is the identity matrix, D is the degree matrix, and A is the affinity matrix. According to spectral theory, the clustering structure of data is implied in L. sym In the eigenvectors of L. sym Perform eigenvalue decomposition and solve the characteristic equation L. sym v = λv, select the eigenvectors v1, v2, ..., v that correspond to the K smallest eigenvalues (excluding eigenvalues 0). K Arrange this eigenvector into a matrix V∈R by columns K.N×N The low-dimensional spectral embedding feature matrix Y is obtained by normalizing each row of V. In the low-dimensional spectral embedding feature matrix Y, sample points located on the same manifold in the original high-dimensional space are mapped into compact clusters.
[0051] S105: Based on the sample clustering results corresponding to the source domain and the target domain, perform spectral clustering on the samples of each type of insulator defect to obtain the source domain centroid and the target domain centroid.
[0052] Furthermore, based on the clustering results of the source domain samples and the target domain samples, spectral clustering is performed on the samples of each type of insulator defect to obtain the centroids of the source domain and the target domain. Figure 4 Specifically, it includes: Based on the source domain sample clustering results, the mean value of the samples for each type of insulator defect is calculated to determine multiple source domain centroids. Based on the clustering results of the target domain samples, the mean value of the samples for each type of insulator defect is calculated to determine the centroids of multiple target domain classes.
[0053] In one specific implementation, based on the index of the sample clustering results, the original feature space is traced back, that is, the image sample vectors are analyzed, the mean of the samples within each sub-cluster is calculated, and this mean is used as the center of the corresponding class, i.e., the "spectral centroid center", specifically represented as: Among them, u k For the k-th source domain centroid or target domain centroid, C k For each type of insulator defect, x is the sample set. i Let be the image sample vector corresponding to the i-th image sample.
[0054] Clustering can divide each category into sub-centroids with physical semantics. For example, centroid 1 gathers images of brightly colored and relatively regular-shaped floating objects such as "balloons" and "advertising cloths"; centroid 2 gathers images of large-area coverings with strong texture repetition such as "white mulch" and "shade nets"; and centroid 3 gathers images of thin, grid-like, and difficult-to-identify images such as "fishing nets" and "kite strings".
[0055] For the source domain D respectively s With target domain D t Perform the above spectral clustering process on each class of samples to obtain the source domain class centroids. and target domain class centroid K represents the number of centroids and C represents the number of defect types.
[0056] S106: By using the centroids of the source and target domains, transfer learning is performed between the source and target domains to obtain the feature projection matrix, thereby enabling the extraction of insulator defect features.
[0057] Furthermore, by using the source domain class centroid and the target domain class centroid, transfer learning is performed between the source and target domains to obtain the feature projection matrix, which is then referenced. Figure 5 Specifically, it includes: Analyze the differences between the centroids of the source domain and the target domain to determine the centroid difference terms; The centroid difference term and the manifold regularization term are fused to construct the learning objective function; Using the variance of the entire sample as a constraint, the learning objective function is solved to obtain the feature projection matrix.
[0058] Furthermore, the objective function is learned through the following steps: Based on the centroid difference coefficient, the centroid difference term is adjusted to give the first objective term; The regularization coefficient and the manifold regularization term are fused to obtain the second objective term; By modifying the shared feature matrix using shared coefficients, the third objective term is obtained. The shared feature matrix is used to perform dimensionality reduction mapping on the features of samples in the source domain defect image set and the target domain defect image set. The first, second, and third objective terms are combined to construct a learning objective function.
[0059] Furthermore, using the global sample variance as a constraint, the learning objective function is solved to obtain the feature projection matrix, which is then referred to... Figure 6 Specifically, it includes: Transform the learning objective function into a generalized eigenvalue equation; Solving the generalized eigenvalue equation yields multiple non-zero eigenvalues and their corresponding eigenvectors. The non-zero eigenvalues are filtered to obtain the target eigenvalues; The feature projection matrix is obtained by combining the feature vectors corresponding to the target feature values.
[0060] Furthermore, the generalized eigenvalue equation is determined through the following steps: The structural risk matrix is obtained by weighted summation of the global centroid matrix, the marginal distribution matrix, the conditional distribution matrix, and the global Laplace matrix. The covariance matrix of the global image sample vectors is calculated using the centered matrix, thus obtaining the data variance constraint matrix. Based on generalized eigenvalues and generalized eigenvectors, the relationship between the structural risk matrix and the data variance constraint matrix is constructed, forming a generalized eigenvalue equation.
[0061] In one specific implementation, by analyzing the difference between the centroids of the source and target domains, the maximum class spectral-cluster-centroid discrepancy (MCSD) is used as the centroid discrepancy term. By minimizing the MCSD, the alignment of the centroids of the source and target domains is achieved. For the domain centers, since they reflect global information, the sample mean is still used for calculation. The MCSD is specifically expressed as: Wherein, MCSD is the centroid difference term. For source domain D s The mean of all image sample vectors in the dataset. For the target domain D t The mean of all image sample vectors in the dataset. Let K be the second norm, K be the number of class centroids, and C be the number of defect types. Let i be the centroid of the i-th source domain class in the defect type c of the source domain. Let be the centroid of the i-th target domain class in defect type c within the target domain.
[0062] To effectively learn shared feature representations to reduce the distributional differences between the source and target domains and achieve cross-domain knowledge transfer, a transfer learning optimization objective is established based on the maximum centroid difference constructed by spectral clustering. It is assumed that there exists a shared feature matrix W∈R. m×k This approach maps m-dimensional source and target domain data features to a k-dimensional data space, minimizing the distributional differences between these features. The shared feature matrix maps high-dimensional features to a low-dimensional subspace. Based on minimizing the maximum centroid difference (MCSD), a manifold regularization term is introduced to construct the learning objective function, specifically expressed as:
[0063] Among them, f total To learn the objective function, R manifold (W) is the manifold regularization term, L total S is the global Laplacian matrix that includes all image samples in both the source and target domains. total D is the global similarity matrix consisting of all image samples in both the source and target domains. total Let be the global degree matrix comprising all image samples from both the source and target domains. Tr() is the trace operation, used to add the diagonal elements of the matrix. The trace operation brings image samples of the same defect type closer together in the low-dimensional space, while separating image samples of different defect types, thus "increasing the spacing" to facilitate subsequent classification. W is the shared feature matrix. Norm, μ is the centroid difference coefficient, γ is the regularization coefficient, λ is the sharing coefficient, X total Let M be the global image sample set including all defect types in the source domain defect image set and the target domain defect image set, and M be the edge distribution matrix.
[0064] By minimizing the centroid difference term, a "scene-aware" feature alignment is achieved. Due to the presence of numerous photovoltaic panels and large bodies of water in actual power lines, although located in different geographical areas such as plains and mountains, the resulting optical interference manifests as backlighting against a bright background. Traditional global alignment is easily skewed by these strong interferences. This invention, however, by minimizing the difference between specific "backlight centroids," forces the shared feature matrix W to learn contour-invariant features across scenes. Even under conditions of smog or complex background interference such as dust nets and excavators at construction sites, it can still isolate environmental noise and accurately capture the essential structural features of minor defects such as loose bolts, missing pins, and slipped vibration dampers, thus achieving robust cross-scene recognition.
[0065] To prevent the data from collapsing to zero after feature mapping and to maximize the preservation of variance information in the original dataset, the constraint condition of maximizing the variance of the entire dataset is adopted, specifically expressed as follows:
[0066] Among them, X total Let H be the global image sample set of all samples in the source and target domains, where H is the centered matrix, 1 represents a vector of all 1s, and 1 represents a vector of all 1s. T Let I be the transpose of a vector consisting entirely of 1s, and let I be the identity matrix. k Let n be the k×k identity matrix, and n be the number of samples in the global image sample set.
[0067] Combining the above constraints and the learning objective function, the learning objective function can be expressed as minimizing the matrix trace: Where U is the global centroid matrix including the centroids of the source and target domains, and N is the conditional distribution matrix. According to Rayleigh entropy theory and the properties of the generalized Rayleigh quotient, the above constrained trace minimization problem is mathematically equivalent to finding the generalized eigenvalues of the matrix bundle (A, B). The generalized eigenvalue equation is specifically expressed as: Among them, v i For the i-th generalized eigenvalue, w i Let A be the i-th generalized eigenvector, and let A be the structural risk matrix. The structural risk matrix is derived from the global centroid matrix U, the marginal distribution matrix M, the conditional distribution matrix N, and the global Laplace matrix L. totalWe obtain B as the data variance constraint matrix by performing a weighted summation, and then calculate the covariance matrix of the entire data using the centered matrix H.
[0068] Solve the generalized eigenvalue equation and select the eigenvectors corresponding to the smallest *a* non-zero eigenvalues to form the final eigenprojection matrix. .
[0069] To address the problem that existing transfer learning methods suffer from poor feature transferability and weak model generalization ability due to neglecting the multi-centroid distribution characteristics of similar defect samples under complex scene changes, this invention constructs a multi-centroid difference measurement mechanism to achieve synergistic optimization of distribution consistency, intra-class compactness, and inter-class separability in cross-domain feature space, thereby improving the robustness and accuracy of defect detection models in unknown scenarios.
[0070] In a specific example, the source domain defect image set contains 1000 high-resolution 1920×1080 images of "insulator damage" taken from a frontal view against a sunny, suburban background. The target domain defect image set contains 800 images of "insulator damage," but these were taken from a side view against a rainy, mountainous vegetation background, with resolutions of 1920×1080 and 1680×1050. The images from the two domains differ significantly in lighting, background, and viewpoint. All defect images need to be normalized to a uniform 224×224, and a pre-trained ResNet-50 network is used to extract a 2048-dimensional image sample vector for each image. Next, similarity analysis and clustering are performed on image samples with the same defect type to obtain the corresponding source domain and target domain centroids.
[0071] To categorize the defect "insulator damage," a spectral clustering algorithm was used to cluster 1000 image sample vectors from the source domain and 800 image sample vectors from the target domain. After clustering, the image samples from the source domain may be divided into three centroids: "direct sunlight," "clear front lighting," and "weak evening light," and the corresponding centroid centers were calculated. Similarly, image samples in the target domain may be divided into three centroids: "rain occlusion," "fog blur," and "cluttered background," yielding the corresponding class centroid centers. The calculation ends with the mean of all image sample vectors in both the source and target domains. and We construct the maximum centroid difference (MCSD) metric to simultaneously bring the global mean of the domain and the center of the corresponding class centroid closer together.
[0072] Finally, by learning a shared feature matrix W, the original 2048-dimensional features are mapped to a new, for example, k=256-dimensional low-dimensional space. In this new space, the difference in feature distribution between the source and target domains is minimized.
[0073] A learning objective function is constructed with minimizing the MCSD as its core, while incorporating a regularization term to prevent overfitting and imposing constraints to maintain the structural stability of the source domain data. The learning objective function is transformed into a generalized eigenvalue problem, and the eigenvalues and eigenvectors of the generalized eigenvalue problem are calculated using a solver. The eigenvectors corresponding to the smallest k=256 eigenvalues are selected to form the final feature projection matrix W. proj In practical applications, when a new insulator image from the target domain (rainy day in a mountainous area) is input, its 2048-dimensional features are first extracted using ResNet-50, and then the feature projection matrix W is obtained. proj By mapping it to a 256-dimensional shared feature space, defect features can be extracted.
[0074] This invention aims to address the performance degradation problem of traditional transfer learning methods when processing image data with significant scene variations, due to the neglect of the complex internal structure of image samples with the same defect type. By learning a more robust and refined shared feature matrix, more effective knowledge transfer is achieved between the source domain (e.g., sunny day, city) and the target domain (e.g., rainy day, mountainous area), thereby improving the accuracy of cross-scene power transmission line defect identification.
[0075] This invention introduces spectral clustering to divide image samples within the same defect type into multiple centroids based on their features. Then, by minimizing the "maximum centroid difference (MCSD)," it not only aligns the overall distribution of the domain but also achieves fine alignment at the centroid level within each category.
[0076] Even for the same defect type, image features can exhibit different centroid structures in different scenarios. This invention, by aligning these centroids separately, can better handle intra-class differences caused by scene variations, avoiding the erroneous conflation of features from different patterns, thereby improving the model's generalization ability and recognition accuracy.
[0077] Due to the finer-grained alignment, the feature projection matrix W learned in this invention... proj It can better capture essential features that are invariant across domains, while suppressing scene-dependent spurious features. This allows similar samples from different domains to cluster together better in the mapped feature space, which is more beneficial for subsequent classifiers.
[0078] Reference Figure 7 This invention provides an insulator defect feature extraction device based on multi-centroid transfer learning, comprising: Image acquisition module 201 is used to acquire image datasets of insulator defects in various environments based on environmental influencing factors of insulators; The image segmentation module 202 is used to segment the insulator defect image dataset according to the insulator defect type, so as to obtain source domain defect image sets and target domain defect image sets under different environments; The similarity analysis module 203 is used to perform similarity analysis on image samples in the source domain defect image set and the target domain defect image set respectively, and obtain the source domain affinity matrix and the target domain affinity matrix; The sample clustering module 204 is used to calculate the corresponding Laplacian matrix based on the source domain affinity matrix and the target domain affinity matrix, so as to obtain the source domain sample clustering result and the target domain sample clustering result; The centroid determination module 205 is used to perform spectral clustering on samples of each type of insulator defect based on the clustering results of the source domain samples and the clustering results of the target domain samples, so as to obtain the centroids of the source domain class and the target domain class. The transfer learning module 206 is used to perform transfer learning between the source domain and the target domain through the source domain class centroid and the target domain class centroid to obtain the feature projection matrix and realize the extraction of insulator defect features.
[0079] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0080] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention. Clearly, those skilled in the art can make various alterations and modifications to the invention without departing from its spirit and scope. Thus, if these modifications and variations of the invention fall within the scope of the claims and their equivalents, the invention is also intended to include these modifications and variations.
Claims
1. A method for extracting insulator defect features based on multi-centroid transfer learning, characterized in that, include: Based on the environmental influencing factors of insulators, a dataset of insulator defect images in various environments was collected; Based on the defect type of the insulator, the insulator defect image dataset is divided to obtain source domain defect image sets and target domain defect image sets under different environments; Similarity analysis was performed on image samples from the source domain defect image set and the target domain defect image set respectively to obtain the source domain affinity matrix and the target domain affinity matrix; Based on the source domain affinity matrix and the target domain affinity matrix, the corresponding Laplacian matrix is calculated to obtain the sample clustering results corresponding to the source domain and the target domain; Based on the sample clustering results corresponding to the source domain and the target domain, spectral clustering is performed on the samples of each type of insulator defect to obtain the centroids of the source domain and the target domain. By using the centroids of the source and target domains, transfer learning is performed between the source and target domains to obtain the feature projection matrix, thereby enabling the extraction of insulator defect features.
2. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 1, characterized in that, Similarity analysis was performed on image samples from the source domain defect image set and the target domain defect image set respectively to obtain the source domain affinity matrix and the target domain affinity matrix, specifically including: Based on image samples of each defect type in the source domain defect image set and the target domain defect image set, vector transformation is performed on the image samples in the source domain defect image set and the target domain defect image set respectively to obtain image sample vectors; Calculate the Euclidean distance between any two image sample vectors, and combine it with the Gaussian kernel function to give the affinity coefficient between the image samples; The affinity coefficients corresponding to the image samples in the source domain defect image set and the target domain defect image set are fused to obtain the source domain affinity matrix and the target domain affinity matrix.
3. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 2, characterized in that, Calculate the Euclidean distance between any two image sample vectors, and using the Gaussian kernel function, give the affinity coefficient between the image samples, specifically including: Based on the Euclidean distance between two image samples, and combined with the similarity scale parameter, the similarity fundamental term is obtained; By adjusting the similarity basis terms using an exponential function, the affinity coefficient between image samples is obtained.
4. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 1, characterized in that, Based on the source domain affinity matrix and the target domain affinity matrix, the corresponding Laplacian matrix is calculated to obtain the sample clustering results corresponding to the source domain and the target domain, specifically including: Based on the affinity coefficients in the source domain affinity matrix and the target domain affinity matrix, the degree of each image sample is determined, and the source domain degree matrix and the target domain degree matrix are constructed. By fusing the source domain degree matrix and source domain affinity matrix, the target domain affinity matrix and target domain degree matrix respectively, and combining them with the identity matrix, we obtain the Laplacian matrices corresponding to the source domain and the target domain. Feature analysis and feature selection are performed on the Laplacian matrix to obtain multiple eigenvalues and corresponding eigenvectors; The feature vectors are concatenated and normalized to obtain a low-dimensional spectral embedding feature matrix; Clustering analysis was performed using the low-dimensional spectral embedding feature matrix to obtain the sample clustering results corresponding to the source domain and the target domain, respectively.
5. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 1, characterized in that, Based on the clustering results of the source domain samples and the target domain samples, spectral clustering is performed on the samples of each type of insulator defect to obtain the centroids of the source domain and the target domain, specifically including: Based on the source domain sample clustering results, the mean value of the samples for each type of insulator defect is calculated to determine multiple source domain centroids. Based on the clustering results of the target domain samples, the mean value of the samples for each type of insulator defect is calculated to determine the centroids of multiple target domain classes.
6. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 1, characterized in that, By using the source domain class centroid and the target domain class centroid, transfer learning is performed between the source and target domains to obtain the feature projection matrix, which specifically includes: Analyze the differences between the centroids of the source domain and the target domain to determine the centroid difference terms; The centroid difference term and the manifold regularization term are fused to construct the learning objective function; Using the variance of the entire sample as a constraint, the learning objective function is solved to obtain the feature projection matrix.
7. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 6, characterized in that, The learning objective function is obtained through the following steps: Based on the centroid difference coefficient, the centroid difference term is adjusted to give the first objective term; The regularization coefficient and the manifold regularization term are fused to obtain the second objective term; By modifying the shared feature matrix using shared coefficients, the third objective term is obtained. The shared feature matrix is used to perform dimensionality reduction mapping on the features of samples in the source domain defect image set and the target domain defect image set. The first, second, and third objective terms are combined to construct a learning objective function.
8. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 6, characterized in that, Using the global sample variance as a constraint, the learning objective function is solved to obtain the feature projection matrix, which specifically includes: Transform the learning objective function into a generalized eigenvalue equation; Solving the generalized eigenvalue equation yields multiple non-zero eigenvalues and their corresponding eigenvectors. The non-zero eigenvalues are filtered to obtain the target eigenvalues; The feature projection matrix is obtained by combining the feature vectors corresponding to the target feature values.
9. The insulator defect feature extraction method based on multi-centroid transfer learning as described in claim 8, characterized in that, The generalized eigenvalue equation is determined through the following steps: The structural risk matrix is obtained by weighted summation of the global centroid matrix, the marginal distribution matrix, the conditional distribution matrix, and the global Laplace matrix. The covariance matrix of the global image sample vectors is calculated using the centered matrix, thus obtaining the data variance constraint matrix. Based on generalized eigenvalues and generalized eigenvectors, the relationship between the structural risk matrix and the data variance constraint matrix is constructed, forming a generalized eigenvalue equation.
10. A device for extracting insulator defect features based on multi-centroid transfer learning, characterized in that, The insulator defect feature extraction method based on multi-centroid transfer learning as described in any one of claims 1-9 includes: The image acquisition module is used to collect image datasets of insulator defects in various environments based on the environmental influencing factors of insulators; The image segmentation module is used to segment the insulator defect image dataset based on the insulator defect type, resulting in source domain defect image sets and target domain defect image sets under different environments; The similarity analysis module is used to perform similarity analysis on image samples in the source domain defect image set and the target domain defect image set respectively, and obtain the source domain affinity matrix and the target domain affinity matrix; The sample clustering module is used to calculate the corresponding Laplacian matrix based on the source domain affinity matrix and the target domain affinity matrix, and obtain the source domain sample clustering results and the target domain sample clustering results; The centroid determination module is used to perform spectral clustering on samples of each type of insulator defect based on the clustering results of the source domain samples and the clustering results of the target domain samples, so as to obtain the centroids of the source domain class and the target domain class. The transfer learning module is used to perform transfer learning between the source and target domains using the source domain centroid and the target domain centroid, to obtain the feature projection matrix and extract the defect features of the insulator.
Citation Information
Patent Citations
Small sample insulator defect detection method based on cross-domain feature fusion migration
CN120808017A