Lightweight few-shot class-incremental learning method for power line defects

By employing a lightweight feature extraction network and an adaptive feature fusion mechanism, the challenge of learning new categories in power line defect identification is solved, enabling stable deployment and efficient identification in resource-constrained scenarios. This technology is applicable to power line inspection equipment.

CN122368600APending Publication Date: 2026-07-10SKILL TRAINING CENT STATE GRID JIBEI ELECTRONICS POWER COMPANY +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202610486839.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-14
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively learn new category features under limited sample conditions in power line defect identification, leading to decreased identification accuracy. Furthermore, they suffer from catastrophic forgetting and category confusion issues as categories continue to expand. Moreover, the large model size and high computational resource consumption make them difficult to deploy in resource-constrained scenarios.

Method used

A lightweight feature extraction network is adopted, combined with adaptive feature fusion that perceives uncertainty and a prototype transfer mechanism for inter-class tension. The feature branch weights are dynamically adjusted through the adaptive feature fusion mechanism, and prototype representation and quantization-friendly model optimization strategies are used to achieve continuous expansion and stable deployment of power line defect categories.

Benefits of technology

The model improves stability and recognition accuracy under limited sample conditions, reduces computational and storage overhead, and is suitable for power line inspection equipment with limited resources. It enables rapid expansion of new defect categories and stable maintenance of recognition performance for existing categories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122368600A_ABST
    Figure CN122368600A_ABST
Patent Text Reader

Abstract

This invention discloses a lightweight few-shot incremental learning method for power line defects. The method includes: first, constructing an inspection image dataset containing basic and incremental categories, and designing a lightweight feature extraction network; training the network using the basic category data to generate prototype vectors for each category, forming an initial prototype classification model; in the incremental stage, constructing incremental prototypes for a small number of samples of the new category, and introducing a prototype transfer mechanism based on inter-class tension, adaptively adjusting the new prototype based on the geometric similarity and discrimination conflict strength between the new and existing prototypes to alleviate category conflicts; simultaneously, introducing an adaptive feature fusion mechanism that perceives discrimination uncertainty, dynamically fusing the discrimination results of the main and auxiliary branches to improve recognition stability. This invention, employing the above-mentioned lightweight few-shot incremental learning method for power line defects, can achieve efficient and stable power line defect recognition in scenarios with few samples and continuously expanding categories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image classification technology, and in particular to a lightweight few-shot incremental learning method for power line defects. Background Technology

[0002] Existing deep learning-based power line defect identification methods mostly rely on large-scale, fully labeled data for training, typically assuming that sufficient samples covering all defect categories can be obtained during the training phase. However, in actual power line inspection scenarios, the number of defect samples is often limited, the category distribution is uneven, and some defects are low-frequency or novel, making it difficult to obtain a large amount of labeled data in a short period of time. With the long-term operation of transmission lines and changes in the external environment, the types of defects continue to expand, and traditional deep learning models trained in a single phase are difficult to adapt to the needs of practical applications in the long term.

[0003] To address the issue of insufficient samples, few-shot learning can complete the identification of new categories using a small number of samples, reducing data annotation costs to some extent. Regarding the problem of continuously expanding categories, incremental class learning can gradually introduce new categories without retraining the entire model, providing a new technical approach for practical applications. However, existing few-shot learning methods typically assume that training and testing categories are independent, making them difficult to directly apply to scenarios where defect categories continuously increase in power grid inspections. Furthermore, incremental class learning generally suffers from catastrophic forgetting when introducing new categories, meaning that the model's performance in identifying previously learned defect categories significantly decreases after learning new categories.

[0004] Therefore, incremental learning with few samples has gradually become an important direction for solving the problems of limited samples and category expansion in power line defect identification. However, existing technologies still have the following shortcomings: First, under the condition of few samples, there are very few samples of new categories, making it difficult for the model to fully learn its discriminative features, which can easily lead to overlapping distributions of features of old and new categories, affecting recognition accuracy. Second, in the process of incremental learning, the model updates parameters to adapt to new categories, which can easily destroy the feature representation of already learned categories, leading to category boundary degradation and historical performance decline. Third, power line defects often have certain similarities in appearance, and the introduction of new categories can easily interfere with the discrimination boundaries of existing categories, exacerbating category confusion. Fourth, the number of samples of new categories is far less than that of old categories, and the category distribution is unbalanced during the training process, which can easily lead to the model being biased towards known categories or unstable training. Fifth, some methods rely on complex network structures or additional storage mechanisms, which are difficult to balance recognition accuracy and lightweight deployment requirements in scenarios with limited computing power and storage, such as power inspection equipment.

[0005] While existing patents have made some progress in power defect identification, they mainly focus on fixed-category identification or conventional deep learning detection tasks. For example, CN114418968A discloses a deep learning-based method for detecting small target defects, which can improve the detection performance of small target defects in transmission lines, but does not address incremental learning capabilities under conditions of continuous category expansion; CN118780778A discloses an AI-based system and method for marking and analyzing defects in power grid inspection equipment, which focuses on image feature extraction and state analysis, but lacks sufficient support for continuous learning and generalization of new defect categories; CN120598934A discloses an autonomous inspection and analysis system for power grid line defects using drones, which mainly focuses on image preprocessing and neural network training, but has not yet solved the problem of model adaptation under conditions of scarce samples and continuous expansion of defect categories; CN116343132A discloses a method for identifying power equipment defects in complex scenarios, which improves the identification performance in complex backgrounds, but lacks effective support for continuous expansion of defect categories and dynamic learning.

[0006] Existing technologies still struggle to simultaneously address the requirements of recognition accuracy, model stability, and lightweight deployment in power inspection scenarios with limited sample sizes and continuously expanding defect categories. Therefore, there is an urgent need for a defect identification method that can support the continuous expansion of defect categories under limited sample conditions and is applicable to practical engineering deployments. Summary of the Invention

[0007] The purpose of this invention is to provide a lightweight, few-sample incremental learning method for power line defects. By introducing an adaptive feature fusion mechanism that perceives discriminative uncertainty, a prototype transfer mechanism based on inter-class tension, and a quantization-friendly model optimization strategy for incremental learning tasks, the invention achieves continuous expansion of power line defect category identification and stable engineering deployment.

[0008] To achieve the above objectives, this invention provides a lightweight few-shot incremental learning method for power line defects, comprising the following steps: S1. Power line inspection image acquisition and incremental data construction; S2. Construct a lightweight feature extraction network for end-side deployment as the backbone network of the defect identification model, used to extract discriminative feature representations of power line inspection images; S3. Initialize the basic category model based on prototype representation, train the lightweight feature extraction network using basic category data, and calculate the category prototype vector corresponding to each basic category to form an initial defect recognition model based on prototype representation. S4. An adaptive feature fusion mechanism for discriminating uncertainty is introduced. For the input inspection image, multiple feature discrimination branches are constructed, and the fusion weights of each feature branch are dynamically calculated based on the uncertainty information of the model output results to generate an adaptive fusion feature representation. S5. Construct the prototype of the incremental defect category. When a new defect category is introduced, extract its feature representation using a small number of samples in the incremental category and calculate the corresponding incremental category prototype vector to complete the modeling of the new category. S6. Introduce a prototype transfer mechanism based on inter-class tension, calculate the inter-class tension relationship between the incremental category prototype and the existing category prototype, and adaptively transfer and adjust the incremental category prototype according to the inter-class tension relationship. S7. Perform quantization-friendly optimization on the model and design a quantization scheme for incremental learning characteristics; S8, Defect Recognition Inference and Continuous Incremental Update: Input the inspection image into the optimized defect recognition model and output the corresponding defect category recognition result; when a new defect category appears, repeat S4 to S7 to achieve continuous update and stable operation of the model.

[0009] Preferably, S1 is as follows: Periodic inspections of power line assets are carried out using drone inspection platforms, fixed inspection devices, or mobile inspection equipment, collecting inspection image data that includes power line equipment and its operating status. The defect categories appearing in the collected inspection images are labeled. Based on the time sequence of the defect categories appearing in the actual inspection process, all defect categories are divided into basic categories and incremental categories. The basic categories are used for the initial training of the model, while the incremental categories are introduced step by step in stages. Each stage provides a small number of labeled samples to simulate the incremental learning process of the gradual introduction of defect categories in the actual power line inspection scenario.

[0010] Preferably, S2 is as follows: For input inspection images After resizing and pixel normalization, the network input tensor is obtained. Its form is expressed as: ; in, and These represent the preset channel mean and standard deviation, respectively. A lightweight feature extraction network model for edge deployment is constructed, consisting of cascaded multi-layer convolutional modules. For any standard 2D convolutional layer, its output feature map is represented as: ; in, To output feature maps in channels Location Eigenvalues ​​at; For the input feature map in the channel Location Eigenvalues ​​at; These are the kernel weights; For bias terms; and These represent the input channel and output channel indices, respectively. The spatial location of the convolution kernel; To reduce computation, a depthwise separable convolution structure is used. Its depthwise convolution and pointwise convolution are expressed as follows: ; ; in, Indicates depthwise convolution in channels Location Output feature value at; This indicates that the input feature map is in the channel Location Eigenvalues ​​at; Indicates channel The corresponding depthwise convolutional kernel weights; Indicates the spatial location of the convolution kernel; This indicates pointwise convolution in the output channel. Location Output feature value at; This represents the input feature values ​​after depthwise convolution; Indicates the pointwise convolution weights; and These represent the input channel index and the output channel index, respectively. By stabilizing the feature distribution through batch normalization and nonlinear activation, the output form of batch normalization is as follows: ; in, This represents the output after batch normalization; Represents input features; Indicates the learnable scaling factor; Represents the learnable translation parameters; Representing input features The mean of the input features; Var(y) represents the input features. The variance; This represents a very small constant to prevent the denominator from being zero; The activation function uses ReLU or its truncated form, as shown in the following expression: ; ; in, This represents the output after ReLU activation; This represents the input features; max(0,y) represents the values ​​between 0 and y. Take the larger value between them; This indicates the output after truncation activation; This indicates the upper bound of the activation value; This indicates that in max(0,y) and Take the smaller value between them; The lightweight feature extraction network extracts high-level feature maps after multiple layers of feature extraction. Global average pooling is performed on the high-level feature maps to generate global embedding features for class modeling. The global average pooling expression is as follows: ; in, Indicates high-level feature map in channel The eigenvalues ​​obtained by global average pooling; Indicates the location of the high-level feature map ,aisle Eigenvalues ​​at; and These represent the height and width of the high-level feature map, respectively. and Indicates a spatial location index; Indicates the channel index; The embedding vector is obtained through linear mapping. The embedding vector serves as the basic feature representation for category prototype calculation and incremental category modeling. Its expression is as follows: ; in, Represents the embedding vector after linear mapping; This represents the feature vector after global average pooling; Represents the weights of a linear mapping; Represents the linear mapping bias term; Perform embedding on the vector Normalization yields the embedded feature representation: ; in, This represents the normalized embedding features; Represents the embedding vector after linear mapping; Representing vectors The norm; Category similarity is calculated based on embedded features, and the score format is as follows: ; in, Indicates the sample and the first Similarity scores between prototypes of each category; Indicates the temperature scaling factor; This represents the normalized embedding features; Indicates the first Each category prototype vector; This represents the dot product similarity between the embedded features and the category prototype; This indicates a category index.

[0011] Preferably, S3 includes the following steps: S31. Using the basic category training data, the inspection image is input into the lightweight feature extraction network constructed in S2 to obtain the corresponding embedded feature representation. The embedded features are normalized so that they are distributed on the unit hypersphere. During the initial training phase, the basic category model employs supervised learning for parameter optimization. Based on the embedded features and the current classification weights, the classification score for each basic category is calculated, and the predicted probability distribution is obtained through the Softmax function, the expression of which is: ; in, Indicates input sample Belongs to the The predicted probabilities of each basic category; Indicates that the sample belongs to the first Classification scores for each basic category; Indicates that the sample belongs to the first Classification scores for each basic category; Indicates the basic category index; This represents the category index during the summation process; The optimization objective for model training uses the cross-entropy loss function, whose expression is: ; in, Represents cross-entropy loss; Indicates the sample in the th The true label indicator value on each basic category; Indicates input sample Belongs to the The predicted probabilities of each basic category; Indicates the basic category index; By minimizing the cross-entropy loss function, the feature extraction network learns an embedding representation that can discriminate against basic defect categories; S32. Construct a category prototype based on the embedding features of base category samples. For any base category, collect the normalized embedding features of all training samples in that category and calculate their mean as the category prototype. The formula is: ; in, Indicates the first Category prototypes for each basic category; Indicates the first The number of samples in each basic category; Indicates the first The first of the basic categories Normalized embedding features of each sample; Indicates the sample index; Indicates the basic category index; For category prototypes Further normalization is performed to obtain the basic category prototype, as shown in the following expression: ; in, Represents the normalized i-th A basic category prototype; Represents the first digit before normalization. A basic category prototype; Representing vectors The norm; This represents the base category index.

[0012] Preferably, in S4, for the same input inspection image, a main discrimination branch and an auxiliary discrimination branch are constructed, and the two discrimination branches share the same embedded feature representation. Each branch outputs a corresponding classification score vector based on the current prototype library. The main discriminant branch provides the overall discriminant trend, while the auxiliary discriminant branch provides supplementary discriminant information when the main branch's discriminant is unstable. Specifically: The main discriminant branch, based on the similarity calculation method in S3, obtains classification scores for each category and calculates the predicted probability distribution using the Softmax function, which takes the following form: ; in, This indicates that the main discriminant branch predicts the input sample. Belongs to the The probability of each category; Indicates the sample and the first Similarity scores between prototypes of each category; Indicates the sample and the first Similarity scores between prototypes of each category; Indicates a category index; This represents the category index during the summation process; Based on the predicted probability distribution of the main discriminant branch, information entropy is used as a quantitative indicator of sample-level discriminant uncertainty, and its calculation method is as follows: ; in, Indicates input sample The uncertainty in discrimination; This indicates that the sample predicted by the main discriminant branch belongs to the first... The probability of each category; Represents a minimal constant to prevent numerical computational instability; Indicates a category index; Based on the magnitude of uncertainty in sample discrimination, the fusion weight between the main discrimination branch and the auxiliary discrimination branch is adaptively calculated using a gating function. Its form is: ; in, This represents the fusion weight of the main discriminant branch; Represents the Sigmoid function; This indicates the uncertainty of the input sample; The adjustment coefficient representing the change in weight; Indicates the uncertainty threshold parameter; Based on fusion weight The scores of the two discrimination branches are weighted and fused to obtain the final fused discrimination result: ; in, This represents the final discrimination score after fusion; This represents the classification score vector output by the main discriminant branch; This represents the classification score vector output by the auxiliary discriminant branch; This represents the fusion weight of the main discriminant branch; This represents the fusion weight of the auxiliary discrimination branch.

[0013] Preferably, S5 is as follows: In the In each incremental stage, the inspection image samples with newly introduced defect categories are input into the lightweight feature extraction network of S2 to extract the corresponding embedded feature representations. Through global average pooling, linear mapping, and normalization operations, the embedded features on the unit hypersphere are obtained, as shown in the following expression: ; in, Indicates the first Normalized embedding features of each incremental sample; Indicates the first Embedded vectors after linear mapping of incremental samples; Representing vectors The norm; Indicates the incremental sample index; By statistically aggregating the embedding features of all samples under the same new category, an initial prototype representation of that category is constructed. Its initial prototype is defined as the mean of the embedded features of all samples in that category: ; in, Indicates a new category The initial prototype; This indicates the number of samples in the new category; Indicates the first Normalized embedding features of each incremental sample; Indicates the incremental sample index; This represents the category index of the newly introduced category; The initial prototype is further normalized to obtain a normalized initial new category prototype. Its expression is: ; in, This represents the initial prototype of the new category after normalization. This represents the initial prototype of the new category before normalization. Representing vectors The norm; This represents the category index of the newly introduced category; Based on the initial prototype representation, a preliminary discrimination is made on samples of the new category, and the similarity calculation formula is as follows: ; in, Indicates the sample and the new category Similarity scores between initial prototypes; Indicates the temperature scaling factor; This represents the normalized embedding features; This represents the initial prototype of the new category after normalization. This represents the dot product similarity between the embedded features and the prototype of the new category; This represents the category index of the newly introduced category.

[0014] Preferably, S6 is as follows: Based on the normalized initial new category prototype Calculate its comparison with existing prototypes of each category in the current prototype library. The geometric similarity between categories is used to characterize the proximity of a new category to existing categories in the embedding space, and it is calculated as follows: ; in, Indicates a new category Geometric similarity with existing category o; This represents the initial prototype of the new category after normalization. Represents the prototype of an existing category o after normalization; 'o' indicates the category index of the newly introduced category; 'o' indicates an existing category index. Based on the prediction results of the main discriminant branch in S4, the average probability of a new category sample being classified as one of the existing categories is calculated and used as the discrimination conflict strength, which takes the form of: ; in, Indicates a new category The intensity of the discriminant conflict with the existing category o; Indicates a new category The number of samples; This indicates that the main discriminant branch will be the first... A new category of samples Predict the probability of belonging to the existing category o; Indicates the first A new category of samples; 'o' indicates an incremental sample index; 'o' indicates an existing category index. By weighting and fusing geometric similarity and discriminative conflict intensity, a comprehensive inter-class tension index is obtained: ; in, Indicates a new category Compared with existing categories A comprehensive inter-class tension index; Representing geometric similarity; Indicates the intensity of the conflict; and This represents the weighting coefficient, used to balance the influence of geometric similarity and the intensity of discriminative conflict; This represents the category index of the newly introduced category; This indicates that a category index already exists; The comprehensive tension index is normalized to obtain the tension weights corresponding to each existing category. : ; in, Indicates that a category already exists. For new categories Tension weight; Indicates a new category Compared with existing categories A comprehensive inter-class tension index; This represents a temperature parameter used to adjust the smoothness of the weight distribution. This indicates the existing category indexes during the summation process; Based on tension weight The migration direction for constructing new category prototypes takes the following form: ; in, Indicates a new category The direction of prototype migration; Indicates that there is already something different. For new categories Tension weight; This represents the initial prototype of the new category after normalization. Represents the existing categories after normalization. The prototype; And update the initial prototype of the new category: ; in, This represents the prototype of the new category after the migration and adjustment. This represents the initial prototype of the new category after normalization. Indicates the direction of migration of the new category prototype; Indicates the migration step size parameter; The updated prototype is normalized to obtain the final new category prototype: ; in, This represents the final prototype of the new category; This represents the prototype of the new category after the migration and adjustment. Representing vectors The norm; This represents the category index of the newly introduced category.

[0015] Preferably, S7 is as follows: Post-training quantizable evaluation is performed on each quantizable layer in the lightweight feature extraction network. By performing forward inference on the model under different quantization bit widths, the impact of quantization on the model's loss function is assessed, and the quantization layer is then evaluated. Layer in position width The performance perturbation introduced below is defined as: ; in, Indicates the first Layer in position width The performance disturbance introduced below; Represents the model loss function; Indicates the first Layer parameters or activation are performed with a bit width of quantization mapping operation; For each quantizable layer, the quantization bit width with the smallest performance perturbation is selected as the optimal quantization configuration for that layer. The selection method is as follows: ; in, Indicates the first The optimal quantization bit width for the layer; Indicates the first Layer in position width The performance disturbance introduced below; Indicates the network layer index; Indicates bit width; By inserting a pseudo-quantization operator into the forward propagation process of the model, the quantization error of the weights and activations is simulated, and their forms are expressed as follows: ; ; in, This represents the weights after pseudo-quantization; Indicates the original weights; Indicates quantization operation; Indicates the dequantization operation; This indicates activation after pseudo-quantization; Indicates original activation; The optimized form of the overall loss function of the quantization model, based on the current training samples, is as follows: ; in, Represents the model loss function; Represents the set of model parameters; This represents the overall quantization mapping result performed according to the optimal bit width configuration of each layer.

[0016] Therefore, the present invention employs the aforementioned lightweight few-sample incremental learning method for power line defects, with the following beneficial effects: (1) In view of the problem that existing technologies are prone to catastrophic forgetting when introducing new defect categories, which leads to a significant decline in the performance of identified defects, this invention constructs a class incremental learning mechanism based on prototype representation, which enables the model to effectively form the discriminative feature representation of new categories under conditions of few samples, thereby reducing the interference of model parameter updates on learned categories and improving the stability of the incremental learning process.

[0017] (2) In view of the problem that existing technologies rely on a single discrimination strategy in complex inspection scenarios, which are easily affected by the conflict between new and old category features and lead to unstable recognition, this invention introduces a feature adaptive feature fusion mechanism to dynamically adjust the contribution weight of different feature branches according to the uncertainty of the model's discrimination of input samples, thereby enhancing the robustness and discrimination reliability of the model under complex background and category similarity conditions.

[0018] (3) In view of the problems that existing incremental learning methods with few samples have large model size, high computational resource consumption and are not conducive to end-side device applications in engineering deployment, this invention adopts a lightweight network structure design and combines it with a quantization-friendly model optimization strategy. While ensuring recognition accuracy and incremental learning performance, it effectively reduces the storage and computational overhead of the model, making it suitable for practical application needs in resource-constrained scenarios such as power line inspection.

[0019] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the overall structure of an embodiment of the lightweight few-sample incremental learning method for power line defects according to the present invention. Figure 2 This is an overall flowchart of an embodiment of a lightweight few-sample incremental learning method for power line defects according to the present invention; Figure 3 This is a schematic diagram of an adaptive feature fusion mechanism gating for discriminating uncertainty in an embodiment of a lightweight few-sample incremental learning method for power line defects according to the present invention. Figure 4 This is a schematic diagram of the prototype transfer mechanism of an embodiment of a lightweight few-sample incremental learning method for power line defects according to the present invention. Figure 5 This is a schematic diagram of the training process of hybrid precision quantization perception training of post-training quantization priors in an embodiment of a lightweight few-sample incremental learning method for power line defects according to the present invention. Detailed Implementation

[0021] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0022] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.

[0023] This invention addresses the challenges of continuously emerging defect categories over time, extremely limited labeled samples in incremental stages, and difficulty in replaying historical data in power line inspection scenarios. It proposes a few-sample incremental defect identification method based on prototype representation. This method constructs a lightweight feature extraction network to map inspection images into a unified embedded feature space and uses category prototypes as a centralized representation of defect categories. This allows the model to expand categories by writing new category prototypes without retraining the entire network, effectively solving the problems of insufficient adaptability to new categories and severe catastrophic forgetting in traditional deep models in incremental scenarios. Furthermore, this prototype-driven classification mechanism is simple in structure, has low update costs, and is suitable for the practical needs of long-term online operation of power line inspection systems.

[0024] This invention introduces an adaptive feature fusion mechanism that perceives discriminative uncertainty during the incremental inference stage. It outputs in parallel from the main and auxiliary discriminative branches and dynamically adjusts the fusion weights using sample-level uncertainty. This ensures stable discrimination on high-confidence samples and automatically enhances the contribution of the auxiliary branch on samples with strong confusion between old and new classes or on boundary samples, significantly improving the robustness and stability of recognition in complex inspection scenarios. Furthermore, this invention proposes a prototype transfer and conflict mitigation strategy based on inter-class tension. Before writing a new class prototype, it comprehensively considers the geometric similarity and degree of discriminative confusion between the new class prototype and existing classes, adaptively transferring and adjusting the new class prototype to keep it away from high-conflict old class regions. This effectively mitigates the disruption of existing class decision boundaries caused by the introduction of new classes and reduces the risk of discriminative conflicts in incremental class learning.

[0025] This invention addresses the deployment requirements of power line inspection equipment at the end-side by proposing a PTQ-prior-driven hybrid precision quantization-sensing training optimization method. Through post-training quantization sensitivity analysis, the optimal quantization bit width is selected for different network layers. A pseudo-quantization operator is introduced during the quantization-sensing training phase to simulate quantization error, enabling the model parameters to adapt to low-bit representation conditions. This significantly reduces model storage overhead and inference computational complexity while maintaining the consistency of embedded features and defect identification accuracy during incremental learning. Experimental and engineering applications demonstrate that the proposed defect identification method achieves rapid expansion capabilities for new defect categories and stable performance maintenance for existing defect categories without excessive computational burden, exhibiting significant engineering deployment value and promising prospects for widespread application.

[0026] like Figure 2 As shown, a lightweight few-shot incremental learning method for power line defects includes the following steps: S1. Power line inspection image acquisition and incremental data construction, specifically: Periodic inspections of power line assets are conducted using drone inspection platforms, fixed inspection devices, or mobile inspection equipment. Inspection image data containing power line equipment and its operating status are collected. The collected images cover a variety of typical power line asset types and their normal and defective states, and the diversity of shooting angles, lighting conditions, and background environments is maintained as much as possible to match the actual inspection application scenarios.

[0027] The defect categories appearing in the collected inspection images are labeled manually or semi-automatically, and each image is assigned a corresponding defect category label. The labeling of this invention only involves defect category information and does not require precise location labeling, thereby reducing the labeling cost.

[0028] Based on the chronological order of the occurrence of defect categories during actual inspections, all defect categories are divided into basic categories and incremental categories. The basic categories are used for the initial training of the initial defect model, while the incremental categories are introduced gradually in stages, with a small number of labeled samples provided in each stage. In actual power line inspection scenarios, defect categories continuously expand while samples are limited. This step is used to simulate the incremental learning process of the gradual introduction of defect categories in actual power line inspection scenarios.

[0029] S2, such as Figure 1 As shown, a lightweight feature extraction network for edge deployment is constructed as the backbone network of the defect identification model. It is used to extract discriminative feature representations of power line inspection images, that is, to map the input power line inspection images into low-dimensional, stable and discriminative embedded feature representations.

[0030] The feature extraction network prioritizes convolutional structures with low computational complexity and strong operator regularity in its structural design. This is to meet the deployment requirements of power line inspection equipment under conditions of limited computing power and storage resources, and to provide a unified feature foundation for subsequent incremental learning processes based on feature embedding. Specifically: First, process the input inspection image. After resizing and pixel normalization, the network input tensor is obtained. Its form is expressed as: ; in, and These represent the preset channel mean and standard deviation, used to reduce the impact of lighting variations and imaging differences under different inspection environments on feature extraction. This normalization method remains consistent throughout the model training and inference phases to ensure the stability of feature distribution at different stages.

[0031] A lightweight feature extraction network model for edge deployment is constructed, consisting of cascaded multi-layer convolutional modules. For any standard 2D convolutional layer, its output feature map can be represented as: ; in, To output feature maps in channels Location Eigenvalues ​​at; For the input feature map in the channel Location Eigenvalues ​​at; These are the kernel weights; For bias terms; and These represent the input channel and output channel indices, respectively. represents the spatial location of the convolution kernel.

[0032] To further reduce computational load, this invention employs a depthwise separable convolution structure, where depthwise convolution and pointwise convolution are expressed as follows: ; ; in, Indicates depthwise convolution in channels Location Output feature value at; This indicates that the input feature map is in the channel Location Eigenvalues ​​at; Indicates channel The corresponding depthwise convolutional kernel weights; Indicates the spatial location of the convolution kernel; This indicates pointwise convolution in the output channel. Location Output feature value at; This represents the input feature values ​​after depthwise convolution; Indicates the pointwise convolution weights; and These represent the input channel index and the output channel index, respectively. Through the above structural decomposition, the number of model parameters and computational complexity are significantly reduced while maintaining the ability to model spatial features.

[0033] After the convolution operation, normalization and non-linear activation are introduced to stabilize the feature distribution. Taking batch normalization as an example, its output form is as follows: ; in, This represents the output after batch normalization; Represents input features; Indicates the learnable scaling factor; Represents the learnable translation parameters; Representing input features The mean of the input features; Var(y) represents the input features. The variance; This represents a minimal constant to prevent the denominator from being zero.

[0034] The activation function can be ReLU or its truncated form, as shown in the following expression: ; ; in, This represents the output after ReLU activation; This represents the input features; max(0,y) represents the values ​​between 0 and y. Take the larger value between them; This indicates the output after truncation activation; This indicates the upper bound of the activation value; This indicates that in max(0,y) and The smaller value should be chosen from the two. Limiting the activation output amplitude helps reduce the risk of numerical instability during subsequent model quantization deployment.

[0035] The lightweight feature extraction network extracts high-level feature maps after multiple layers of feature extraction. Global average pooling is performed on the high-level feature maps to generate global embedding features for class modeling. The global average pooling expression is as follows: ; in, Indicates high-level feature map in channel The eigenvalues ​​obtained by global average pooling; Indicates the location of the high-level feature map ,aisle Eigenvalues ​​at; and These represent the height and width of the high-level feature map, respectively. and Indicates a spatial location index; Indicates the channel index.

[0036] The embedding vector is obtained through linear mapping. This embedding vector serves as the basic feature representation for subsequent steps of class prototype calculation and incremental class modeling. Its expression is as follows: ; in, Represents the embedding vector after linear mapping; This represents the feature vector after global average pooling; Represents the weights of a linear mapping; This represents the linear mapping bias term.

[0037] To ensure the geometric comparability of features between different samples and between different classes in the incremental stages, the embedding vectors are processed. Normalization yields the embedded feature representation: ; in, This represents the normalized embedding features; Represents the embedding vector after linear mapping; Representing vectors The norm of the normalized embedding feature will be used uniformly in subsequent steps for category prototype construction, similarity calculation, and discriminant conflict analysis.

[0038] When calculating category similarity based on embedded features, the score format is as follows: ; in, Indicates the sample and the first Similarity scores between prototypes of each category; Indicates the temperature scaling factor; This represents the normalized embedding features; Indicates the first Each category prototype vector; This represents the dot product similarity between the embedded features and the category prototype; This indicates a category index.

[0039] By constructing the aforementioned lightweight feature extraction network, the model can ensure the ability to discriminate embedded features while also meeting the needs of edge deployment, and provide a unified, stable, and reusable feature representation foundation for subsequent prototype-based incremental learning methods.

[0040] S3. Initialize the prototype-based base category model. After constructing the lightweight feature extraction network in S2, train the lightweight feature extraction network using the base category data, and calculate the category prototype vectors corresponding to each base category based on the embedded features obtained from the training, thereby forming an initial defect recognition model based on prototype representation for subsequent class incremental learning. This step includes the following steps: S31. Using the basic category training data, input the inspection image into the lightweight feature extraction network constructed in S2 to obtain the corresponding embedded feature representation. The process of obtaining the embedded features is the same as described in step two. The embedding vector is obtained through global average pooling and linear mapping, and the embedded features are normalized using the following formula to distribute them on a unit hypersphere: .

[0041] The normalized embedded features serve as a unified feature representation for basic category modeling and classification.

[0042] During the initial training phase, the basic category model employs supervised learning for parameter optimization. Based on the embedded features and the current classification weights, the classification score for each basic category is calculated, and the predicted probability distribution is obtained through the Softmax function, the expression of which is: ; in, Indicates input sample Belongs to the The predicted probabilities of each basic category; Indicates that the sample belongs to the first Classification scores for each basic category; Indicates that the sample belongs to the first Classification scores for each basic category; Indicates the basic category index; This represents the category index during the summation process.

[0043] The optimization objective for model training uses the cross-entropy loss function, whose expression is: ; in, Represents cross-entropy loss; Indicates the sample in the th The true label indicator value on each basic category; Indicates input sample Belongs to the The predicted probabilities of each basic category; This represents the base category index.

[0044] By minimizing the cross-entropy loss function, the feature extraction network can learn an embedding representation that has good discriminative ability for basic defect categories.

[0045] S32. After the basic training phase is completed, the class prototype is no longer directly relied upon based on the learnable fully connected classification weights. Instead, it is constructed based on the embedding features of the basic class samples. For any basic class, the normalized embedding features of all training samples in that class are collected, and their mean is calculated as the class prototype. The formula is: ; in, Indicates the first Category prototypes for each basic category; Indicates the first The number of samples in each basic category; Indicates the first The first of the basic categories Normalized embedding features of each sample; Indicates the sample index; This represents the base category index.

[0046] To ensure geometric consistency between the category prototype and the embedded features, the category prototype... Further normalization is performed to obtain the basic category prototype, as shown in the following expression: ; in, Represents the normalized i-th A basic category prototype; Represents the first digit before normalization. A basic category prototype; Representing vectors The norm; This represents the base category index.

[0047] This base category prototype, serving as a centralized representation of the category in the feature space, is written into the prototype library or classification module to replace traditional learnable classification weights. In subsequent inference and class increment stages, the model makes judgments based on the similarity between embedded features and category prototypes, with the scoring format remaining consistent with S2. .

[0048] By using the above-mentioned prototype-based basic category model initialization method, the model can explicitly map its category discrimination ability into the feature space after initial training, providing a stable and scalable structural foundation for introducing new categories without accessing historical samples or retraining the overall model.

[0049] S4. Considering that in incremental learning scenarios, newly introduced defect categories may have high similarity to existing categories in appearance features, and the model cannot fully correct the discrimination boundary using a large number of samples during the incremental stage, a single discrimination path is prone to producing unstable or biased prediction results for some samples during the inference stage. Therefore, an adaptive feature fusion mechanism that perceives discrimination uncertainty is introduced to improve the model's discrimination robustness under mixed new and old categories.

[0050] For the input inspection image, multiple feature discrimination branches are constructed, and based on the uncertainty information of the model output results, the fusion weight of each feature branch is dynamically calculated to generate an adaptive fusion feature representation. This enables the model to adaptively suppress the influence of unreliable feature branches in the mixed recognition scenario of old and new defect categories, thereby improving the discrimination stability in the class incremental learning process.

[0051] Specifically: For the same input inspection image, the model constructs a main discriminant branch and an auxiliary discriminant branch while maintaining the S2 feature extraction network unchanged. The two discriminant branches share the same embedded feature representation. Each branch outputs a corresponding classification score vector based on the current prototype library. The main discriminant branch is used to provide the overall discriminant trend, while the auxiliary discriminant branch is used to provide supplementary discriminant information when the main branch's discriminant is unstable.

[0052] The main discriminant branch, based on the similarity calculation method in S3, obtains classification scores for each category and calculates the predicted probability distribution using the Softmax function, which takes the following form: ; in, This indicates that the main discriminant branch predicts the input sample. Belongs to the The probability of each category; Indicates the sample and the first Similarity scores between prototypes of each category; Indicates the sample and the first Similarity scores between prototypes of each category; Indicates a category index; This represents the category index during the summation process.

[0053] Based on the predicted probability distribution of the main discriminant branch, information entropy is used as a quantitative indicator of sample-level discriminant uncertainty, and its calculation method is as follows: ; in, Indicates input sample The uncertainty in discrimination; This indicates that the sample predicted by the main discriminant branch belongs to the first... The probability of each category; Represents a minimal constant to prevent numerical computational instability; This indicates the category index; when the predicted probability distribution is relatively dispersed, the information entropy value is large, indicating that the model has a low confidence in the discrimination of that sample.

[0054] The magnitude of uncertainty is determined based on the sample, by means of, for example Figure 3 The gating function shown adaptively calculates the fusion weights between the main discriminant branch and the auxiliary discriminant branch. Its form is: ; in, This represents the fusion weight of the main discriminant branch; Represents the Sigmoid function; This indicates the uncertainty of the input sample; The adjustment coefficient representing the change in weight; This represents the uncertainty threshold parameter. When the sample discrimination uncertainty is low, the fusion weights... The larger the uncertainty, the more the model relies on the main discriminant branch; when the uncertainty is high, the weight of the auxiliary discriminant branch in the final decision increases accordingly.

[0055] Based on the above fusion weights The scores of the two discrimination branches are weighted and fused to obtain the final fused discrimination result: ; in, This represents the final discrimination score after fusion; This represents the classification score vector output by the main discriminant branch; This represents the classification score vector output by the auxiliary discriminant branch; This represents the fusion weight of the main discriminant branch; This represents the fusion weight of the auxiliary discrimination branch. This fusion score will serve as an important basis for subsequent inference stages and incremental category conflict analysis, used to generate the final defect category prediction result.

[0056] By introducing an adaptive feature fusion mechanism that perceives discrimination uncertainty, the model can dynamically adjust its decision-making strategy according to the discrimination difficulty of different samples. This effectively alleviates the discrimination instability caused by confusion between old and new categories during the incremental learning process, and provides a more reliable discrimination basis for subsequent incremental category prototype construction and prototype transfer steps.

[0057] S5. Constructing prototypes for incremental defect categories: When a new defect category appears during power line inspection, and only a very small number of labeled samples are available for that category, the model enters the incremental defect category modeling stage. Feature representations are extracted using the limited number of samples from the incremental category. The corresponding incremental category prototype vector is then calculated. To avoid retraining the model or accessing historical data, this invention uses a prototype-based representation approach to complete new category modeling, thus meeting the requirements of incremental class learning for data isolation and computational efficiency.

[0058] The specific process for implementing this step is as follows: In the In each incremental stage, the inspection image samples with newly introduced defect categories are input into the lightweight feature extraction network of S2 to extract the corresponding embedded feature representations. The process of obtaining the embedded features is consistent with the basic stage. Through global average pooling, linear mapping, and normalization operations, the embedded features on the unit hypersphere are obtained, as shown in the following expression: ; in, Indicates the first Normalized embedding features of each incremental sample; Indicates the first Embedded vectors after linear mapping of incremental samples; Representing vectors The norm; This represents the incremental sample index; this feature indicates that it is in the same feature space as the embedding feature of the base category sample in step three, which is used to ensure the geometric comparability between the old and new categories.

[0059] After obtaining the embedding features of samples in the new category, an initial prototype representation of that category is constructed by statistically aggregating the embedding features of all samples in the same new category. Specifically, for the new category... Its initial prototype is defined as the mean of the embedded features of all samples in that category: ; in, Indicates a new category The initial prototype; This indicates the number of samples in the new category; Indicates the first Normalized embedding features of each incremental sample; Indicates the incremental sample index; This represents the category index of the newly introduced category; since the number of samples in the incremental phase is usually small, the above mean operation can approximate the overall feature distribution of the new category without additional training.

[0060] To ensure geometric consistency between the new category prototype and the existing category prototype, the initial prototype is further normalized using the same formula used to normalize the category prototype, resulting in a normalized initial new category prototype. Its expression is: ; in, This represents the initial prototype of the new category after normalization. This represents the initial prototype of the new category before normalization. Representing vectors The norm; This represents the category index of the newly introduced category; the normalized prototype of the new category is temporarily stored in the prototype buffer for subsequent discrimination conflict analysis and prototype migration processing. At this stage, the new category prototype is not directly written into the prototype library, nor does it participate in the final classification decision.

[0061] Based on the initial prototype representation described above, the model can make preliminary distinctions between new category samples, and the similarity calculation formula is as follows: ; in, Indicates the sample and the new category Similarity scores between initial prototypes; Indicates the temperature scaling factor; This represents the normalized embedding features; This represents the initial prototype of the new category after normalization. This represents the dot product similarity between the embedded features and the prototype of the new category; This represents the category index of the newly introduced category.

[0062] The preliminary discrimination results are used to assess the potential confusion between the new category and the existing category, and to provide the necessary discrimination basis for prototype transfer based on inter-class tension in subsequent steps.

[0063] Through the above-described incremental defect category prototype construction process, this invention can quickly establish stable feature representations for newly introduced defect categories without accessing historical samples or updating feature extraction network parameters, providing basic inputs for subsequent prototype transfer and conflict mitigation steps, thereby ensuring the efficiency and scalability of the incremental learning process.

[0064] S6. This invention proposes a prototype transfer and conflict mitigation method based on inter-class tension. Considering that the initial prototype of the new category constructed in S5 is estimated from only a very small number of samples, its position in the embedding space may overlap significantly with existing category prototypes. Directly writing this initial prototype into the prototype library could easily disrupt the discrimination boundaries of existing categories, leading to catastrophic forgetting problems. Therefore, before formally incorporating the new category into the classification system, a method such as... Figure 4 The prototype migration mechanism based on inter-class tension shown adaptively adjusts the prototype of the new category to reduce the risk of conflict between the old and new categories. Figure 4 This illustrates the potential conflict relationships between new class prototypes and multiple old class prototypes in the embedding space, using arrows to represent their distances and interactions. To reduce this conflict, the model migrates the new class prototype based on the distribution of the old class prototypes, moving it along the direction of the dashed arrows to a more separated and stable position from the old classes.

[0065] Simultaneously, the inter-class tension relationship between the incremental category prototype and the existing category prototype is calculated, and the incremental category prototype is adaptively transferred and adjusted based on the inter-class tension relationship; this enables the newly introduced category to maintain its own discriminative characteristics while reducing interference with the discriminative boundaries of the existing categories, thereby effectively alleviating the catastrophic forgetting problem in class incremental learning.

[0066] This step is specifically as follows: First, based on the normalized initial new category prototype Calculate its comparison with existing prototypes of each category in the current prototype library. The geometric similarity between categories is used to characterize the proximity of a new category to existing categories in the embedding space, and it is calculated as follows: ; in, Indicates a new category Geometric similarity with existing category o; This represents the initial prototype of the new category after normalization. Represents the prototype of an existing category o after normalization; 'o' represents the category index of the newly introduced category; 'o' represents the index of an existing category. A higher geometric similarity value indicates that the new category is closer to the existing category in the feature space, suggesting a higher potential risk of confusion.

[0067] Meanwhile, to further reflect the model's confusion between new and old categories at the discrimination level, based on the prediction results of the main discriminant branch in S4, the average probability of a new category sample being classified as each existing category is calculated as the discrimination conflict strength, which takes the form of: ; in, Indicates a new category Compared with existing categories The intensity of the discriminant conflict between them; Indicates a new category The number of samples; This indicates that the main discriminant branch will be the first... A new category of samples Predicted as an existing category The probability of; Indicates the first A new category of samples; Indicates the incremental sample index; This indicates that a category index already exists.

[0068] Based on this, a weighted fusion of geometric similarity and discriminative conflict intensity is obtained to obtain a comprehensive inter-class tension index: ; in, Indicates a new category Compared with existing categories A comprehensive inter-class tension index; Representing geometric similarity; Indicates the intensity of the conflict; and This represents the weighting coefficient, used to balance the influence of geometric similarity and the intensity of discriminative conflict; This represents the category index of the newly introduced category; This indicates that a category index already exists.

[0069] To ensure the comparability of the tension impact of different existing categories on the new category, the comprehensive tension index is normalized to obtain the tension weights corresponding to each existing category. : ; in, Indicates that a category already exists. For new categories Tension weight; Indicates a new category Compared with existing categories A comprehensive inter-class tension index; This represents a temperature parameter used to adjust the smoothness of the weight distribution. This represents the index of the existing category during the summation process. The larger the tension weight, the stronger the constraint of the existing category on the prototype of the new category.

[0070] Based on tension weight The migration direction for constructing new category prototypes takes the following form: ; in, Indicates a new category The direction of prototype migration; Indicates that there is already something different. For new categories Tension weight; This represents the initial prototype of the new category after normalization. Represents the existing categories after normalization. The prototype.

[0071] And update the initial prototype of the new category: ; in, This represents the prototype of the new category after the migration and adjustment. This represents the initial prototype of the new category after normalization. Indicates the direction of migration of the new category prototype; This represents the migration step size parameter; to maintain geometric consistency, the updated prototype is normalized to obtain the final new category prototype: ; in, This represents the final prototype of the new category; This represents the prototype of the new category after the migration and adjustment. Representing vectors The norm; This represents the category index of the newly introduced category.

[0072] Through the above-mentioned prototype transfer process based on inter-class tension, the new class prototype actively moves away from existing classes with a high risk of conflict in the embedding space, while maintaining its ability to represent its own small sample feature distribution. Thus, without accessing historical samples or updating the feature extraction network parameters, the discrimination conflict problem caused by the introduction of new classes during class incremental learning can be effectively alleviated.

[0073] S7. Quantization-friendly model optimization for incremental tasks: Considering that power line inspection systems are usually deployed on edge devices with limited computing and storage resources, after completing the migration and update of the new category prototype in S6, the model needs to be optimized for quantization, and a quantization scheme is designed for the incremental learning characteristics.

[0074] By combining quantized perception training with post-quantized training, the impact of changes in model parameter accuracy on the recognition performance of new and old categories is reduced. While ensuring stable recognition accuracy and incremental learning performance, the model storage overhead and inference computation complexity are significantly reduced, ensuring its suitability for long-term deployment in resource-constrained equipment such as power line inspection. Specifically: like Figure 5 As shown, without changing the overall model structure and parameter topology, post-training quantizable layers in the lightweight feature extraction network are evaluated using quantization. By performing forward inference on the model under different quantization bit widths, the impact of quantization on the model's loss function is assessed, and the quantization layer is then evaluated. Layer in position width The performance perturbation introduced below is defined as: ; in, Indicates the first Layer in position width The performance disturbance introduced below; Represents the model loss function; Indicates the first Layer parameters or activation are performed with a bit width of The quantization mapping operation; through this evaluation process, the sensitivity of different network layers to changes in quantization accuracy can be characterized.

[0075] Based on the above evaluation results, the quantization bit width with the smallest performance perturbation is selected as the optimal quantization configuration for each quantizable layer. The selection method is as follows: ; in, Indicates the first The optimal quantization bit width for the layer; Indicates the first Layer in position width The performance disturbance introduced below; Indicates the network layer index; Indicates bit width.

[0076] By adopting a hierarchical, non-uniform bit-width configuration, the model can maintain the stability of feature embedding and class discrimination capabilities as much as possible while keeping the overall computational complexity under control.

[0077] After configuring the quantization bit width, the quantization-aware training phase begins. In this phase, a pseudo-quantization operator is inserted into the model's forward propagation process to simulate quantization errors in the weights and activations, expressed as follows: ; ; in, This represents the weights after pseudo-quantization; Indicates the original weights; Indicates quantization operation; Indicates the dequantization operation; This indicates activation after pseudo-quantization; This represents the original activation. By explicitly introducing quantization error during the training phase, the model parameters are gradually adapted to the quantization environment, thereby reducing the risk of accuracy degradation during actual deployment.

[0078] During the quantization perception training process, the model's optimization objective remains consistent with that of the basic stage: minimizing the overall loss function of the quantization model based on the current training samples. Its optimization form is as follows: ; in, Represents the model loss function; Represents the set of model parameters; This represents the overall quantization mapping result performed according to the optimal bit width configuration of each layer.

[0079] Through the aforementioned quantization-friendly optimization process for incremental class tasks, the model can maintain geometric consistency between embedded features and class prototypes under low-bit representation conditions after completing the new class prototype update. This enables efficient and stable defect identification inference in edge deployment environments, providing a reliable model foundation for subsequent inference and continuous incremental class update steps.

[0080] S8, Defect Recognition Inference and Continuous Incremental Update: Input the inspection image into the optimized defect recognition model and output the corresponding defect category recognition result; when a new defect category appears, repeat S4 to S7 to achieve continuous update and stable operation of the model.

[0081] This step is specifically as follows: The defect identification model, optimized with S7 quantization, is deployed on power line inspection equipment or edge computing nodes for online defect identification of image data collected during actual inspections. During the inference phase, the model preprocesses the input inspection images and generates corresponding feature representations through a lightweight feature extraction network. It then combines these representations with prototypes of various categories stored in the current prototype library to determine the defect category.

[0082] During defect identification, the model utilizes the discriminative uncertainty-aware adaptive fusion mechanism built in S4 to make comprehensive decisions based on the output results of different discriminative branches. When the model has a high discriminative confidence in the input sample, it mainly relies on the main discriminative branch to predict the defect category; when the discriminative uncertainty is high, the discriminative information of the auxiliary discriminative branch is introduced, thereby improving the stability and reliability of identification in complex scenarios.

[0083] During continuous model operation, when the inspection system discovers a new defect type that does not belong to the currently learned category set, it can trigger an incremental class update process without stopping system operation or accessing historical samples. This process gradually incorporates the new defect type into the existing identification system through steps such as new category prototype construction, prototype migration, and quantization-friendly optimization.

[0084] Through the above reasoning and continuous incremental update method, the defect identification model can continuously adapt to the actual needs of the continuous changes in defect types in the power line inspection scenario during long-term operation. While ensuring the stability of existing defect identification performance, it can achieve rapid response and effective identification of new defect categories.

[0085] Therefore, the present invention adopts the above-mentioned lightweight few-sample incremental learning method for power line defects, which achieves continuous expansion of power line defect category identification without relying on a large number of historical samples and overall retraining, and maintains the overall discrimination performance of new and old defect categories.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A lightweight few-sample incremental learning method for power line defects, characterized in that, Includes the following steps: S1. Power line inspection image acquisition and incremental data construction; S2. Construct a lightweight feature extraction network for end-side deployment as the backbone network of the defect identification model, used to extract discriminative feature representations of power line inspection images; S3. Initialize the basic category model based on prototype representation, train the lightweight feature extraction network using basic category data, and calculate the category prototype vector corresponding to each basic category to form an initial defect recognition model based on prototype representation. S4. An adaptive feature fusion mechanism for discriminating uncertainty is introduced. For the input inspection image, multiple feature discrimination branches are constructed, and the fusion weights of each feature branch are dynamically calculated based on the uncertainty information of the model output results to generate an adaptive fusion feature representation. S5. Construct the prototype of the incremental defect category. When a new defect category is introduced, extract its feature representation using a small number of samples in the incremental category and calculate the corresponding incremental category prototype vector to complete the modeling of the new category. S6. Introduce a prototype transfer mechanism based on inter-class tension, calculate the inter-class tension relationship between the incremental category prototype and the existing category prototype, and adaptively transfer and adjust the incremental category prototype according to the inter-class tension relationship. S7. Perform quantization-friendly optimization on the model and design a quantization scheme for incremental learning characteristics; S8, Defect Recognition Inference and Continuous Incremental Update: Input the inspection image into the optimized defect recognition model and output the corresponding defect category recognition result; when a new defect category appears, repeat S4 to S7 to achieve continuous update and stable operation of the model.

2. The lightweight few-sample incremental learning method for power line defects according to claim 1, characterized in that, S1 specifically refers to: Periodic inspections of power line assets are carried out using drone inspection platforms, fixed inspection devices, or mobile inspection equipment, collecting inspection image data that includes power line equipment and its operating status. The defect categories appearing in the collected inspection images are labeled. Based on the time sequence of the defect categories appearing in the actual inspection process, all defect categories are divided into basic categories and incremental categories. The basic categories are used for the initial training of the model, while the incremental categories are introduced step by step in stages. Each stage provides a small number of labeled samples to simulate the incremental learning process of the gradual introduction of defect categories in the actual power line inspection scenario.

3. The lightweight few-sample incremental learning method for power line defects according to claim 2, characterized in that, S2 specifically refers to: For input inspection images After resizing and pixel normalization, the network input tensor is obtained. Its form is expressed as: ; in, and These represent the preset channel mean and standard deviation, respectively. A lightweight feature extraction network model for edge deployment is constructed, consisting of cascaded multi-layer convolutional modules. For any standard 2D convolutional layer, its output feature map is represented as: ; in, To output feature maps in channels Location Eigenvalues ​​at; For the input feature map in the channel Location Eigenvalues ​​at; These are the kernel weights; For bias terms; and These represent the input channel and output channel indices, respectively. The spatial location of the convolution kernel; To reduce computation, a depthwise separable convolution structure is used. Its depthwise convolution and pointwise convolution are expressed as follows: ; ; in, Indicates depthwise convolution in channels Location Output feature value at; This indicates that the input feature map is in the channel Location Eigenvalues ​​at; Indicates channel The corresponding depthwise convolutional kernel weights; Indicates the spatial location of the convolution kernel; This indicates pointwise convolution in the output channel. Location Output feature value at; This represents the input feature values ​​after depthwise convolution; Indicates the pointwise convolution weights; and These represent the input channel index and the output channel index, respectively. By stabilizing the feature distribution through batch normalization and nonlinear activation, the output form of batch normalization is as follows: ; in, This represents the output after batch normalization; Represents input features; Indicates the learnable scaling factor; Represents the learnable translation parameters; Representing input features The mean of the input features; Var(y) represents the input features. The variance; This represents a very small constant to prevent the denominator from being zero; The activation function uses ReLU or its truncated form, as shown in the following expression: ; ; in, This represents the output after ReLU activation; This represents the input features; max(0,y) represents the values ​​between 0 and y. Take the larger value between them; This indicates the output after truncation activation; This indicates the upper bound of the activation value; This indicates that in max(0,y) and Take the smaller value between them; The lightweight feature extraction network extracts high-level feature maps after multiple layers of feature extraction. Global average pooling is performed on the high-level feature maps to generate global embedding features for class modeling. The global average pooling expression is as follows: ; in, Indicates high-level feature map in channel The eigenvalues ​​obtained by global average pooling; Indicates the location of the high-level feature map ,aisle Eigenvalues ​​at; and These represent the height and width of the high-level feature map, respectively. and Indicates a spatial location index; Indicates the channel index; The embedding vector is obtained through linear mapping. The embedding vector serves as the basic feature representation for category prototype calculation and incremental category modeling. Its expression is as follows: ; in, Represents the embedding vector after linear mapping; This represents the feature vector after global average pooling; Represents the weights of a linear mapping; Represents the linear mapping bias term; Perform embedding on the vector Normalization yields the embedded feature representation: ; in, This represents the normalized embedding features; Represents the embedding vector after linear mapping; Representing vectors The norm; Category similarity is calculated based on embedded features, and the score format is as follows: ; in, Indicates the sample and the first Similarity scores between prototypes of each category; Indicates the temperature scaling factor; This represents the normalized embedding features; Indicates the first Each category prototype vector; This represents the dot product similarity between the embedded features and the category prototype; This indicates a category index.

4. A lightweight few-sample incremental learning method for power line defects according to claim 3, characterized in that, S3 includes the following steps: S31. Using the basic category training data, the inspection image is input into the lightweight feature extraction network constructed in S2 to obtain the corresponding embedded feature representation. The embedded features are normalized so that they are distributed on the unit hypersphere. During the initial training phase, the basic category model employs supervised learning for parameter optimization. Based on the embedded features and the current classification weights, the classification score for each basic category is calculated, and the predicted probability distribution is obtained through the Softmax function, the expression of which is: ; in, Indicates input sample Belongs to the The predicted probabilities of each basic category; Indicates that the sample belongs to the first Classification scores for each basic category; Indicates that the sample belongs to the first Classification scores for each basic category; Indicates the basic category index; This represents the category index during the summation process; The optimization objective for model training uses the cross-entropy loss function, whose expression is: ; in, Represents cross-entropy loss; Indicates the sample in the th The true label indicator value on each basic category; Indicates input sample Belongs to the The predicted probabilities of each basic category; Indicates the basic category index; By minimizing the cross-entropy loss function, the feature extraction network learns an embedding representation that can discriminate against basic defect categories; S32. Construct a category prototype based on the embedding features of base category samples. For any base category, collect the normalized embedding features of all training samples in that category and calculate their mean as the category prototype. The formula is: ; in, Indicates the first Category prototypes for each basic category; Indicates the first The number of samples in each basic category; Indicates the first The first of the basic categories Normalized embedding features of each sample; Indicates the sample index; Indicates the basic category index; For category prototypes Further normalization is performed to obtain the basic category prototype, as shown in the following expression: ; in, Represents the normalized i-th A basic category prototype; Represents the first digit before normalization. A basic category prototype; Representing vectors The norm; This represents the base category index.

5. A lightweight few-shot incremental learning method for power line defects according to claim 4, characterized in that, In S4, for the same input inspection image, a main discrimination branch and an auxiliary discrimination branch are constructed, and the two discrimination branches share the same embedded feature representation. Each branch outputs a corresponding classification score vector based on the current prototype library. The main discriminant branch provides the overall discriminant trend, while the auxiliary discriminant branch provides supplementary discriminant information when the main branch's discriminant is unstable. Specifically: The main discriminant branch, based on the similarity calculation method in S3, obtains classification scores for each category and calculates the predicted probability distribution using the Softmax function, which takes the following form: ; in, This indicates that the main discriminant branch predicts the input sample. Belongs to the The probability of each category; Indicates the sample and the first Similarity scores between prototypes of each category; Indicates the sample and the first Similarity scores between prototypes of each category; Indicates a category index; This represents the category index during the summation process; Based on the predicted probability distribution of the main discriminant branch, information entropy is used as a quantitative indicator of sample-level discriminant uncertainty, and its calculation method is as follows: ; in, Indicates input sample The uncertainty in discrimination; This indicates that the sample predicted by the main discriminant branch belongs to the first... The probability of each category; Represents a minimal constant to prevent numerical computational instability; Indicates a category index; Based on the magnitude of uncertainty in sample discrimination, the fusion weight between the main discrimination branch and the auxiliary discrimination branch is adaptively calculated using a gating function. Its form is: ; in, This represents the fusion weight of the main discriminant branch; Represents the Sigmoid function; This indicates the uncertainty of the input sample; The adjustment coefficient representing the change in weight; Indicates the uncertainty threshold parameter; Based on fusion weight The scores of the two discrimination branches are weighted and fused to obtain the final fused discrimination result: ; in, This represents the final discrimination score after fusion; This represents the classification score vector output by the main discriminant branch; This represents the classification score vector output by the auxiliary discriminant branch; This represents the fusion weight of the main discriminant branch; This represents the fusion weight of the auxiliary discrimination branch.

6. A lightweight few-shot incremental learning method for power line defects according to claim 5, characterized in that, S5 specifically refers to: In the In each incremental stage, the inspection image samples with newly introduced defect categories are input into the lightweight feature extraction network of S2 to extract the corresponding embedded feature representations. Through global average pooling, linear mapping, and normalization operations, the embedded features on the unit hypersphere are obtained, as shown in the following expression: ; in, Indicates the first Normalized embedding features of each incremental sample; Indicates the first Embedded vectors after linear mapping of incremental samples; Representing vectors The norm; Indicates the incremental sample index; By statistically aggregating the embedding features of all samples under the same new category, an initial prototype representation of that category is constructed. Its initial prototype is defined as the mean of the embedded features of all samples in that category: ; in, Indicates a new category The initial prototype; This indicates the number of samples in the new category; Indicates the first Normalized embedding features of each incremental sample; Indicates the incremental sample index; This represents the category index of the newly introduced category; The initial prototype is further normalized to obtain a normalized initial new category prototype. Its expression is: ; in, This represents the initial prototype of the new category after normalization. This represents the initial prototype of the new category before normalization. Representing vectors The norm; This represents the category index of the newly introduced category; Based on the initial prototype representation, a preliminary discrimination is made on samples of the new category, and the similarity calculation formula is as follows: ; in, Indicates the sample and the new category Similarity scores between initial prototypes; Indicates the temperature scaling factor; This represents the normalized embedding features; This represents the initial prototype of the new category after normalization. This represents the dot product similarity between the embedded features and the prototype of the new category; This represents the category index of the newly introduced category.

7. A lightweight few-shot incremental learning method for power line defects according to claim 6, characterized in that, S6 specifically refers to: Based on the normalized initial new category prototype Calculate its comparison with existing prototypes of each category in the current prototype library. The geometric similarity between categories is used to characterize the proximity of a new category to existing categories in the embedding space, and it is calculated as follows: ; in, Indicates a new category Geometric similarity with existing category o; This represents the initial prototype of the new category after normalization. Represents the prototype of an existing category o after normalization; 'o' indicates the category index of the newly introduced category; 'o' indicates an existing category index. Based on the prediction results of the main discriminant branch in S4, the average probability of a new category sample being classified as one of the existing categories is calculated and used as the discrimination conflict strength, which takes the form of: ; in, Indicates a new category The intensity of the discriminant conflict with the existing category o; Indicates a new category The number of samples; This indicates that the main discriminant branch will be the first... A new category of samples Predict the probability of belonging to the existing category o; Indicates the first A new category of samples; 'o' indicates an incremental sample index; 'o' indicates an existing category index. By weighting and fusing geometric similarity and discriminative conflict intensity, a comprehensive inter-class tension index is obtained: ; in, Indicates a new category Compared with existing categories A comprehensive inter-class tension index; Representing geometric similarity; Indicates the intensity of the conflict; and This represents the weighting coefficient, used to balance the influence of geometric similarity and the intensity of discriminative conflict; This represents the category index of the newly introduced category; This indicates that a category index already exists; The comprehensive tension index is normalized to obtain the tension weights corresponding to each existing category. : ; in, Indicates that a category already exists. For new categories Tension weight; Indicates a new category Compared with existing categories A comprehensive inter-class tension index; This represents a temperature parameter used to adjust the smoothness of the weight distribution. This indicates the existing category indexes during the summation process; Based on tension weight The migration direction for constructing new category prototypes takes the following form: ; in, Indicates a new category The direction of prototype migration; Indicates that there is already something different. For new categories Tension weight; This represents the initial prototype of the new category after normalization. Represents the existing categories after normalization. The prototype; And update the initial prototype of the new category: ; in, This represents the prototype of the new category after the migration and adjustment. This represents the initial prototype of the new category after normalization. Indicates the direction of migration of the new category prototype; Indicates the migration step size parameter; The updated prototype is normalized to obtain the final new category prototype: ; in, This represents the final prototype of the new category; This represents the prototype of the new category after the migration and adjustment. Representing vectors The norm; This represents the category index of the newly introduced category.

8. A lightweight few-shot incremental learning method for power line defects according to claim 7, characterized in that, S7 specifically refers to: Post-training quantizable evaluation is performed on each quantizable layer in the lightweight feature extraction network. By performing forward inference on the model under different quantization bit widths, the impact of quantization on the model's loss function is assessed, and the quantization layer is then evaluated. Layer in position width The performance perturbation introduced below is defined as: ; in, Indicates the first Layer in position width The performance disturbance introduced below; Represents the model loss function; Indicates the first Layer parameters or activation are performed with a bit width of quantization mapping operation; For each quantizable layer, the quantization bit width with the smallest performance perturbation is selected as the optimal quantization configuration for that layer. The selection method is as follows: ; in, Indicates the first The optimal quantization bit width for the layer; Indicates the first Layer in position width The performance disturbance introduced below; Indicates the network layer index; Indicates bit width; By inserting a pseudo-quantization operator into the forward propagation process of the model, the quantization error of the weights and activations is simulated, and their forms are expressed as follows: ; ; in, This represents the weights after pseudo-quantization; Indicates the original weights; Indicates quantization operation; Indicates the dequantization operation; This indicates activation after pseudo-quantization; Indicates original activation; The optimized form of the overall loss function of the quantization model, based on the current training samples, is as follows: ; in, Represents the model loss function; Represents the set of model parameters; This represents the overall quantization mapping result performed according to the optimal bit width configuration of each layer.

Citation Information

Patent Citations

  • Power transmission line small target defect detection method based on deep learning

    CN114418968A

  • Complex scene power equipment defect identification method and device and computer equipment

    CN116343132A

  • Power grid inspection equipment defect marking analysis system and method based on artificial intelligence

    CN118780778A

  • Unmanned aerial vehicle autonomous inspection analysis system for power grid line defects

    CN120598934A