A small sample based on triad prototype network voltage sag identification method

By constructing voltage sag triples and combining triplet feature extractors and prototype classifiers, the problem of voltage sag source identification under small sample conditions is solved, achieving efficient voltage sag type identification with a small amount of data, and improving the robustness and accuracy of the model.

CN114841266BActive Publication Date: 2026-04-14NORTH CHINA ELECTRIC POWER UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTH CHINA ELECTRIC POWER UNIV
Filing Date
2022-05-05
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Under small sample conditions, existing technologies struggle to effectively identify voltage sag sources, and traditional deep learning models require a large amount of labeled data, making it difficult to perform fast and effective voltage sag source identification in real-world scenarios.

Method used

We employ a triplet-based prototype network approach with a small sample size. We construct voltage sag triplets, extract features using a triplet feature extractor and an efficient channel attention mechanism, and combine this with a prototype classifier to identify voltage sag types. We then construct a joint loss function for end-to-end training.

Benefits of technology

With limited sample data, the model's feature extraction capability and classification accuracy were improved, overfitting was reduced, robustness and generalization performance were enhanced, and efficient voltage sag type identification was achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841266B_ABST
    Figure CN114841266B_ABST
Patent Text Reader

Abstract

The application discloses a voltage sag identification method based on a triple tuple prototype network under a small sample, and belongs to the technical field of power quality analysis. The method uses a triple tuple feature extractor, a large number of voltage sag triple tuples are constructed, and effective sag features can be extracted by the model under the condition of a small number of training samples. Then, in view of the problem that some voltage sag features are similar and easy to confuse, an efficient channel attention mechanism is integrated into the triple tuple feature extractor, cross-channel feature interaction information is captured under the condition of only a small number of parameters, the model can pay attention to the key feature area, a prototype classifier is finally constructed, representative class prototypes are learned for each class by using the extracted sag features, and the final sample class is determined by comparing the similarity between sample features and class prototypes. Under the condition of limited sample data, the method can realize accurate voltage sag classification effect, and has strong practical application significance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a voltage sag identification method based on a triplet prototype network under small sample conditions, belonging to the field of power quality analysis technology. Background Technology

[0002] Driven by the energy transition, building a new power system with new energy sources as the mainstay has become an inevitable requirement for development. Currently, the power system exhibits a "dual high" development trend: a high proportion of renewable energy and a high proportion of power electronic equipment. The integration of a large number of random and complex loads into the power grid has brought new challenges to the power supply stability of the distribution network. In real-world applications, accurate identification of voltage sag sources is crucial for improving power quality and enhancing socio-economic benefits.

[0003] Domestic and international scholars have conducted extensive research on voltage sag type identification and achieved significant progress. In sag feature extraction, many researchers rely on human experience to construct signal processing models to directly extract effective feature parameters from the waveform state of voltage sags. This method primarily involves performing Hilbert-Huang transform, Fourier transform, and wavelet transform on the sag signal. However, feature extraction based on sag mechanisms relies excessively on human experience, is complex, computationally intensive, and susceptible to noise interference.

[0004] With the continuous development of deep learning, deep learning models have been widely applied in voltage sag identification. Convolutional neural networks, deep belief networks, and long short-term memory networks are used for voltage sag feature extraction and type recognition. Supervised training of voltage sag samples using deep learning leverages its powerful self-extraction capabilities to overcome the complexities of building physical models based on prior knowledge for feature extraction. This ultimately enables accurate voltage sag source identification, and the model exhibits high robustness and generalization ability.

[0005] However, traditional deep learning models require a large amount of labeled data to train a model with good generalization ability. In real-world scenarios, the amount of sample data for voltage sags is very limited, making it difficult to provide sufficient data support for model training. Since the distribution characteristics of voltage sags vary greatly across different regions, it is of great significance to train voltage sag classification models specifically for different regions under limited sample conditions, enabling rapid and effective identification of voltage sag sources and reasonable analysis of local voltage conditions.

[0006] In recent years, many scholars have conducted extensive research on the few-shot problem. Few-shot learning aims to enable models to efficiently learn features using a limited number of samples. This field often employs metric-based learning methods, which calculate the distance between samples based on inter-class differences and intra-class similarities, using a given distance function to obtain sample similarity as a basis for model classification. Triple networks are a type of metric-based few-shot learning model. Addressing the problem of low sample data affecting model recognition accuracy, it improves the model's feature extraction capability by efficiently utilizing training data. Unlike other traditional networks, triple networks use data triples (anchor sample, positive sample, negative sample) as input. The positive sample and anchor sample belong to the same class, while the negative sample belongs to a different class; each triple consists of the anchor sample and its similar and dissimilar samples. Prototype networks, as a representative few-shot classification network, introduce the concept of prototypes when performing classification tasks. This network maps input samples to the embedding space while learning representative class prototype features of the same dimension as the feature embedding for each class. When determining a sample category, the more similar a sample's features are to a certain class prototype, the higher the probability that it belongs to that category. Therefore, by measuring the distance between sample features and class prototypes, the closest prototype category can be selected as the sample category output. This class prototype-based classification method allows the model to have good discriminative ability even when faced with limited data dimensions or new category samples.

[0007] This paper proposes a voltage sag identification method based on a triplet prototype network for small sample sizes. First, a large number of training triples are constructed from limited voltage sag data, and a triplet featurer is used to efficiently extract typical features of different voltage sag signal categories. Then, to improve the model's ability to distinguish easily confused features, an efficient channel attention mechanism is added to the feature extractor. This method can capture cross-channel interaction information with only a few parameter increases, thus obtaining more discriminative sag features. Finally, a prototype classifier is used to obtain an accurate metric prototype for each sag category. The similarity between sample features and representative prototypes is compared to ultimately achieve voltage sag type identification. During model training, the model is trained end-to-end by minimizing a joint loss function constructed based on triplet loss and prototype loss, which simultaneously improves the model's feature extraction capability and classification performance. Summary of the Invention

[0008] The purpose of this invention is to provide a voltage sag identification method based on a triplet prototype network under small sample conditions, addressing the problems of limited sample data and difficulty in identifying sample features in real-world scenarios.

[0009] This invention fuses triplet networks and prototype networks in metric learning, employing a triplet prototype network to identify the type of voltage sag waveform data with small sample sizes. A triplet feature extractor is used, constructing voltage sag triplets to maintain model training stability even with a small number of training samples. An efficient channel attention mechanism is incorporated into the feature extractor to improve the model's ability to distinguish easily confused features. A prototype classifier is used to enhance the model's overall recognition ability and robustness. The specific steps of this method are as follows:

[0010] Step 1: Preprocess the voltage sag recording data and tag data from the power quality monitoring points;

[0011] Step 2: Construct voltage sag training triples based on the training set data;

[0012] Step 3: Use the triplet feature extractor to extract features from the voltage sag training triplet;

[0013] Step 4: Use the prototype classifier to identify the type of voltage sag samples. Input the feature vector of the anchor sample extracted in Step 2 into the prototype classifier to obtain the final sample identification result.

[0014] Step 5: Train the model using training triples, update the weight parameters using the backpropagation algorithm until the training stabilizes, and save the model;

[0015] Step 6: Use the test set data to perform type identification and accuracy verification on the model saved in Step 5;

[0016] The voltage sag recording data and tag data preprocessing steps include:

[0017] Step 1: Process the voltage sag waveform data into 40*40*3 dimensions using a two-dimensional transformation operation;

[0018] Step 2: Perform maximum-minimum normalization on the waveform data output from Step 1;

[0019] Step 3: Vectorize the voltage sag tag data;

[0020] Step 4: Divide the waveform data output from Step 2 and the label data output from Step 3 into training set and test set.

[0021] The steps for constructing voltage sag training triples include:

[0022] Step 1: Based on the waveform data and label data of the training set, set the number of training triples to be K;

[0023] Step 2: Use each sample in the dataset as the anchor sample for the training triple in turn, and select positive and negative samples from the remaining samples to form the training triple.

[0024] Step 3: Repeat the triplet construction steps until K training triplets are generated.

[0025] The triplet feature extractor includes four convolutional layers using ReLU activation functions. An efficient channel attention mechanism is added after each convolutional layer to extract key feature information. Finally, the feature vector of the voltage sag sample output by the fully connected layer is used.

[0026] The prototype classifier performs the following steps for type identification of voltage sag samples:

[0027] Step 1: Input the anchor sample feature vector extracted by the triplet feature extractor;

[0028] Step 2: Learn a class prototype feature for each category;

[0029] Step 3: Compare the similarity between the prototype features and the anchor sample features to obtain the sample category.

[0030] The steps for training a model using training triples are as follows: construct a joint loss function based on triple loss and prototype loss; use training triple data to train the model end-to-end based on the joint loss function; update the weight parameters through the backpropagation algorithm to achieve the goal of minimizing the joint loss function.

[0031] The steps for identifying test set data types and verifying model accuracy are as follows: input the test set waveform data into the trained model, judge the category probability output by the prototype classifier, select the category with the highest probability as the category to which the data belongs, compare the voltage sag category judged by the model with the test set label data, and thus obtain the model's recognition accuracy for the test set.

[0032] Compared with the prior art, the method of the present invention has the following advantages:

[0033] (1) The use of a triplet feature extractor effectively alleviates the overfitting phenomenon that occurs during training with small samples. Traditional deep learning methods are prone to pattern collapse, which reduces the efficiency of feature extraction. The sample group training method of the triplet prototype network makes it less prone to overfitting and more suitable for sample recognition with small samples.

[0034] (2) An efficient channel attention mechanism is introduced into the feature extractor, which improves the model’s ability to extract features from easily confused samples of different categories in a lightweight and efficient manner compared to other attention mechanisms.

[0035] (3) Using a prototype classifier, a representative metric prototype is obtained for each category. The sample is accurately classified by comparing the similarity between the sample features and the metric prototype. The robustness and generalization performance of the model are higher.

[0036] (4) Use a joint loss function based on triplet loss and prototype loss to combine the model's feature extractor and classifier.

[0037] By conducting joint training in an end-to-end manner, the extracted features and metric prototypes become more typical and representative. Attached Figure Description

[0038] Figure 1 This is a schematic diagram of the voltage sag identification method based on a triplet prototype network.

[0039] Figure 2 This is a schematic diagram of the triplet feature extractor.

[0040] Figure 3 This is a schematic diagram of the prototype classifier. Detailed Implementation

[0041] The following is in conjunction with the appendix Figure 1 Appendix Figure 2 Appendix Figure 3 The embodiments provide a detailed description of the voltage sag identification method based on triplet prototype networks under small sample conditions, but the implementation of the present invention is not limited thereto.

[0042] Example:

[0043] like Figure 1 The diagram shows the structure of the voltage sag identification method based on a triplet prototype network in this embodiment under small sample conditions. It includes a triplet construction module, a triplet feature extraction module, and a prototype classification module.

[0044] like Figure 2 The diagram shown is a schematic of the triplet feature extractor in this embodiment.

[0045] like Figure 3 The diagram shown is a schematic representation of the prototype classifier in this embodiment.

[0046] This embodiment uses 500 voltage sag monitoring data points from a power quality monitoring system in a certain region of China from September 2019 to April 2020. Among them, there are 100 sets of sample data for each category: single-phase short circuit fault, two-phase short circuit fault, three-phase short circuit fault, transformer switching, and large induction motor starting (C1 to C5).

[0047] The steps for establishing and identifying the triplet prototype network model based on this sample are as follows:

[0048] (1) Preprocessing of voltage sag recording data and tag data from power quality monitoring points. The dimensions of the recording data are transformed: the 1600×3 sample is transformed into a 40×40×3 sample dimension. Then, the recording data is normalized and the tag data is vectorized. Finally, training and test sets are divided. 20 samples are randomly assigned to each class as the training set, resulting in a total of 100 training samples. All remaining data (excluding the training set) are used as the test set for comparative experiments, resulting in a test set of 400 samples.

[0049] (2) Based on the training set data, construct voltage sag training triples, specify the number of training triples as 4800, and finally obtain 4800 training triples and corresponding anchor sample label data.

[0050] (3) Use a triplet feature extractor to extract features from the voltage sag training triplet. The overall structure is as follows: Figure 2 As shown, the input to the triplet feature extractor is the voltage sag training triplet, which is then fed into a shared-weight CNN feature extraction network to extract the corresponding embedded features. This network contains four convolutional layers, four efficient channel attention mechanisms, and two fully connected layers. Finally, the obtained embedded features are similarly measured and input into the triplet loss to learn the feature relationships between different samples, ultimately making the distance between features of similar samples as close as possible and the distance between features of dissimilar samples as far as possible.

[0051] The formula for tuple loss is:

[0052] L triplet =max(d(E) a E p )-d(E a E n +margin, 0)(1.1)

[0053] Among them, E a E p E n These represent the feature representations of anchor samples, positive samples, and negative samples, respectively, d(E) a E p ) and d(E a E n ) represent the Euclidean distance between the anchor sample and the positive and negative samples, respectively, and margin is the threshold constant.

[0054] (4) Use a prototype classifier to identify the type of voltage sag samples. The overall structure is as follows: Figure 3As shown in the diagram, to avoid duplicate recognition by the model during feature classification, only the feature vectors of the anchor samples are input into the prototype classification module for type identification. The dashed circles in the diagram represent the prototype features learned by the model for each category, while the remaining circles represent the anchor sample features. After inputting the anchor sample features into the prototype classification module, a prototype representation is learned for each category based on the features of different categories. When determining the anchor sample category, the similarity between the sample features and the class prototype features is compared to obtain...

[0055] The probability of belonging to the corresponding category. The prototype loss formula is:

[0056]

[0057] Among them, C m Let f(x) be the representative prototype of the m-th category (m∈{1,2,…,M) and f(x) be the feature embedding of the sample to be classified. The similarity between the class prototype and the sample feature embedding is obtained by calculating the Euclidean distance d between them.

[0058] (5) Construct a joint loss function based on triplet loss and prototype loss, and use the training triplet data based on the joint loss function.

[0059] For end-to-end training of the pairwise model, the formula for the joint loss function is:

[0060] L total =L protype +λL triplet (1.3)

[0061] In the formula, λ represents the weight coefficients of the triplet loss. The weight parameters are updated using the backpropagation algorithm to minimize the joint loss function. The overall architecture and training steps of the triplet prototype network are as follows: Figure 1 As shown.

[0062] (6) Using 400 data points from the test set, the saved model was used for type identification and accuracy verification to obtain the model's identification accuracy for each category in the test set. The average identification accuracy for single-phase short-circuit fault C1 was 98.96%, and for two-phase short-circuit faults...

[0063] The average accuracy rate for identifying C2 faults is 99.23%, for three-phase short circuit faults it is 98.45%, for transformer switching it is 100%, and for starting large induction motors it is 100%.

[0064] This invention provides a voltage sag identification method based on a triplet prototype network for small sample sizes, belonging to the field of power quality analysis technology. This method uses a triplet feature extractor, constructing a large number of voltage sag triples to enable the model to extract effective sag features even with limited training samples. Then, addressing the issue of high similarity and easy confusion among some voltage sag features, an efficient channel attention mechanism is incorporated into the triplet feature extractor. This mechanism captures cross-channel feature interaction information with only a few parameter increases, allowing the model to focus on key feature regions. Finally, a prototype classifier is constructed, using the extracted sag features to learn representative class prototypes for each category. The final sample category is determined by comparing the similarity between sample features and class prototypes. This method achieves accurate voltage sag classification even with limited sample data, demonstrating strong practical application significance.

Claims

1. A voltage sag identification method based on a triplet prototype network under small sample conditions, characterized in that, We construct a voltage sag detection model based on the triplet network and the prototype network in metric learning, and use the triplet module as the feature extractor of the voltage sag detection model. An efficient channel attention mechanism is incorporated into the triplet module; a prototype-based classifier is constructed, using the voltage sag features extracted by the triplet module to learn a representative class prototype for each category. The final sample category is determined by comparing the similarity between the sample features and the class prototype. The specific steps of this method are as follows: Step 1: Preprocess the voltage sag recording data and tag data from the power quality monitoring points; Step 2: Construct voltage sag training triples based on the training set data. The construction process is based on the waveform data and label data of the training set, and the number of training triples to be generated is set to K. Each sample in the dataset is used as the anchor sample of the training triple. Positive and negative samples are selected from the remaining samples and combined to form training triples. Repeat the triple construction steps until K training triples are generated. Step 3: Use a triplet feature extractor to extract features from the voltage sag training triplet. The feature extractor includes four convolutional layers using ReLU activation functions. An efficient channel attention mechanism is added after each convolutional layer to extract key feature information. Finally, a fully connected layer is used to output the feature vector of the voltage sag sample. Step 4: Use the prototype classifier to identify the type of voltage sag samples. Input the feature vector of the anchor sample extracted in Step 2 into the prototype classifier to obtain the final sample identification result. Step 5: Train the model using training triples, update the weight parameters using the backpropagation algorithm until the training stabilizes, and save the model; Step 6: Use the test set data to perform type identification and accuracy verification on the model saved in Step 5.

2. The voltage sag identification method based on a triplet prototype network under small sample conditions according to claim 1, characterized in that, The voltage sag recording data and tag data preprocessing steps include: Step 1: Process the voltage sag waveform data into 40*40*3 dimensions using a two-dimensional transformation operation; Step 2: Perform maximum-minimum normalization on the waveform data output from Step 1; Step 3: Vectorize the voltage sag tag data; Step 4: Divide the waveform data output from Step 2 and the label data output from Step 3 into training set and test set.

3. The voltage sag identification method based on a triplet prototype network under small sample conditions according to claim 1, characterized in that, The prototype classifier performs the following steps for type identification of voltage sag samples: Step 1: Input the anchor sample feature vector extracted by the triplet feature extractor; Step 2: Learn a class prototype feature for each category; Step 3: Compare the similarity between the prototype features and the anchor sample features to obtain the sample category.

4. The voltage sag identification method based on a triplet prototype network under small sample conditions according to claim 1, characterized in that, The steps for training a model using training triples are as follows: construct a joint loss function based on triple loss and prototype loss; use training triple data to train the model end-to-end based on the joint loss function; update the weight parameters through the backpropagation algorithm to achieve the goal of minimizing the joint loss function.

5. The voltage sag identification method based on a triplet prototype network under small sample conditions according to claim 1, characterized in that, The steps for identifying test set data types and verifying model accuracy are as follows: input the test set waveform data into the trained model, judge the category probability output by the prototype classifier, select the category with the highest probability as the category to which the data belongs, compare the voltage sag category judged by the model with the test set label data, and thus obtain the model's recognition accuracy for the test set.

Citation Information

Patent Citations

  • Voltage sag reason identification method based on deep learning model fusion

    CN109635928A

  • Method of training a machine learning model, method of assessing ultrasound measurement data, method of determining information about an anatomical feature, ultrasound system

    WO2022069315A1