CNN and LSTM-based voltage and current abnormal data marking method

By applying a hybrid model of CNN and LSTM in the real-time monitoring system of AC power system, the difficulty of voltage and current abnormal data labeling is solved, and efficient and accurate abnormal data screening and labeling is achieved.

CN120105291APending Publication Date: 2025-06-06SHENKE TECH GRP CO LTD +5
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510165919.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

In real-time monitoring systems of AC power systems, it is difficult to mark voltage and current abnormal data, and there is inaccuracy in traditional methods, which may lead to false alarms and missed alarms.

Method used

The voltage and current abnormal data labeling method based on CNN and LSTM is adopted. By constructing an abnormal data set, a CNN-LSTM hybrid model is built, and a transfer learning optimization model is used to realize the identification and labeling of unknown abnormal curves.

Benefits of technology

It improves the accuracy and efficiency of abnormal data screening, reduces the risks of false alarms and underreports, and realizes automatic labeling of abnormal data in the AC power system in real-time monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120105291A_ABST
    Figure CN120105291A_ABST
Patent Text Reader

Abstract

The invention discloses a CNN and LSTM-based voltage and current abnormal data marking method, and the method comprises the steps: S1, constructing a voltage and current abnormal data set, and carrying out the preprocessing of voltage and current abnormal data; s2, building a voltage and current abnormal data identification model based on a CNN model and an LSTM model, wherein the voltage and current abnormal data identification model comprises a CNN-LSTM hybrid model of a first one-dimensional convolution layer, a first one-dimensional pooling layer, a first Dropout layer, a second one-dimensional convolution layer, a second one-dimensional pooling layer, a second Dropout layer, a first LSTM layer, a third Dropout layer, a second LSTM layer and an output layer; s3, optimizing the CNN-LSTM hybrid model built in the step S2 on the basis of transfer learning, so as to obtain an optimized CNN-LSTM hybrid model; s4, training and verifying the optimized CNN-LSTM hybrid model by using the voltage and current anomaly data set to obtain a verified model; s5, identifying voltage and current abnormal data by using the verified model; according to the invention, the abnormal mode can be automatically learned and identified, and the accuracy and efficiency of voltage and current abnormal data screening are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of power data detection, and relates to a voltage and current abnormal data marking method, in particular to a voltage and current abnormal data marking method based on CNN and LSTM. Background Art

[0002] In the real-time monitoring system of the AC power system, it is necessary to identify and store abnormal data in real time from a large amount of monitoring data. The forms of voltage and current anomalies are very diverse and difficult to accurately capture with general feature descriptions. Therefore, the labeling of voltage and current abnormal data becomes extremely difficult. The traditional processing method is to describe the anomaly by manually setting some feature parameters. However, this method has inaccuracies and may lead to false positives and false negatives. In the face of this challenge, machine learning methods have become a solution that has attracted much attention. It can effectively complete the data labeling work by learning the rules in the given labeled samples.

[0003] The application of machine learning provides new ideas and technical means to solve the problem of abnormal data identification in real-time monitoring systems. By using machine learning algorithms, the system can automatically learn the patterns and rules in the monitoring data, thereby accurately identifying and marking abnormal data. Compared with the traditional method of manually setting feature parameters, machine learning methods have higher accuracy and reliability, can effectively reduce the risk of false positives and false negatives, and improve the efficiency and accuracy of abnormal data detection.

[0004] In practical applications, there are still some challenges to overcome when using machine learning methods to identify abnormal data. One of the challenges is to build a high-quality abnormal data sample set, which requires a lot of labeling work and professional domain knowledge. In addition, choosing the right machine learning algorithm and model architecture is also crucial. Different types of abnormal data may require different algorithms for identification and classification. In addition, insufficient samples in the target field are also a serious challenge.

[0005] The present invention is based on a machine learning method and studies a method for screening and identifying abnormal data of voltage and current in an AC power system. The purpose is to achieve automatic marking of abnormal data in an uninterrupted real-time monitoring system by marking a group of abnormal data samples and using a machine learning model for learning and identification. First, an abnormal curve data set containing various abnormal situations is established by manual labeling. Subsequently, these abnormal curves are trained using a machine learning model so that they can accurately identify and screen out unknown abnormal curves and migrate them to the data set of the target domain. This method has high accuracy and efficiency and can be widely used in various electrical parameter monitoring fields. The introduction of the present invention will bring important technological breakthroughs and application prospects to the field of abnormal data screening. Summary of the invention

[0006] The purpose of the present invention is to realize the automatic labeling of abnormal data in the real-time monitoring system of the AC power system. First, an abnormal curve data set containing various abnormal situations is established by manual labeling, and then these abnormal curves are trained using a machine learning model so that it can accurately identify and filter out unknown abnormal curves and migrate them to the data set of the target domain.

[0007] The technical solution adopted by the present invention provides a voltage and current abnormal data marking method based on CNN and LSTM. In the AC power system, the voltage and current of the three phases A, B and C are monitored by a real-time monitoring system. The key is that the above abnormal data marking method specifically includes the following steps:

[0008] Step S1, constructing a voltage and current abnormal data set, including collecting and collating the voltage and current abnormal data and preprocessing the voltage and current abnormal data;

[0009] Step S2, building a voltage and current abnormal data recognition model based on the CNN model and the LSTM model, wherein the voltage and current abnormal data recognition model is a CNN-LSTM hybrid model including a first one-dimensional convolution layer, a first one-dimensional pooling layer, a first Dropout layer, a second one-dimensional convolution layer, a second one-dimensional pooling layer, a second Dropout layer, a first LSTM layer, a third Dropout layer, a second LSTM layer and an output layer; the first Dropout layer includes a first compression excitation layer, and the second Dropout layer includes a second compression excitation layer;

[0010] Step S3: Optimize the CNN-LSTM hybrid model built in step S2 based on transfer learning to obtain an optimized CNN-LSTM hybrid model;

[0011] Step S4: Use the voltage and current anomaly data set to train and verify the optimized CNN-LSTM hybrid model to obtain a verified CNN-LSTM hybrid model;

[0012] Step S5: Use the verified CNN-LSTM hybrid model to identify abnormal voltage and current data.

[0013] Specifically, the above step S1 specifically includes:

[0014] S1-1. Collect voltage and current basic sample data through the voltage and current real-time monitoring system, wherein the voltage basic sample data includes A-phase voltage, B-phase voltage and C-phase voltage; the current basic sample data includes A-phase current, B-phase current and C-phase current;

[0015] S1-2, using threshold judgment and mutation algorithm to preliminarily determine the suspected abnormal data in the basic sample data. The above threshold judgment method is: if the current current value exceeds the preset threshold, it is considered to be suspected abnormal data; the above mutation algorithm is: let I n is the current measurement value of the nth cycle, I n-1 is the current measurement value of the previous cycle, ΔI threshold is the threshold value of current change, when ΔI threshold If it is greater than the maximum current change value expected during normal system operation, it is considered to be suspected abnormal data;

[0016] S1-3, using Fourier transform algorithm to calculate the vector corresponding to the suspected abnormal data, and using threshold method, differential analysis method and zero sequence network method to judge the abnormal data and mark the abnormality;

[0017] S1-4. Make a basic judgment on the fault type;

[0018] S1-5. Preprocessing of abnormal data. The above preprocessing includes denoising, normalization, and smoothing.

[0019] Furthermore, the above-mentioned zero-sequence network method obtains the zero-sequence vector value by calculating the measured zero-sequence current through Fourier transform algorithm, or first obtains the vector values ​​of phase A, phase B and phase C according to the Fourier transform algorithm and then adds the vector values ​​of the three items to obtain the zero-sequence vector value.

[0020] Specifically, the above-mentioned S3 step specifically includes:

[0021] S3-1. Use the source domain dataset to train the CNN-LSTM hybrid model built in step S2 and adjust the model parameters and hyperparameters.

[0022] S3-2, migrate the CNN-LSTM hybrid model trained in step S3-1 to the target domain dataset, freeze any one or combination of the first one-dimensional convolution layer, the first one-dimensional pooling layer, the first Dropout layer, the second one-dimensional convolution layer, the second one-dimensional pooling layer, the second Dropout layer, the first LSTM layer, the third Dropout layer, and the second LSTM layer in step S2 to retain the source domain feature extraction capability, and fine-tune the target domain dataset;

[0023] S3-3, gradually adjust the model by unfreezing the layers frozen in step S3-2 and training on the target domain dataset;

[0024] S3-4. Evaluate model performance on the target domain dataset, monitor the model accuracy to ensure it meets expectations, and if the accuracy does not meet expectations, analyze the error pattern and adjust the model structure, loss function, or data processing method;

[0025] S3-5. Based on the accuracy performance, adjust and train the model repeatedly until the accuracy of the target domain data set reaches the expected level. Regularly evaluate the generalization ability of the model on the target domain data to ensure that the model performs well on unlabeled data.

[0026] Preferably, the first LSTM layer and the second LSTM layer add three structures, namely, an input gate, an output gate and a forget gate, on the basis of the basic structure of the LSTM layer; the input gate can obtain the update degree of the current information to realize the unit state update; the output gate determines the output state at this moment by confirming the value of the next state; the forget gate retains or deletes the information in the neuron state, and then filters the content that needs to be continued to be remembered.

[0027] Specifically, the above step S4 specifically includes:

[0028] S4-1, divide the abnormal data set constructed in step S1 into a training set, a validation set and a test set, with the division ratio being 70% training set, 15% validation set and 15% test set;

[0029] S4-2. Processing the abnormal data set: The above processing includes data enhancement and sequence processing;

[0030] S4-3. Select an initialization method for the model's weights and biases, train the model using the training set data, evaluate the model performance using the validation set data after each epoch, and adjust the model parameters based on the validation set loss and accuracy.

[0031] S4-4. According to the performance on the validation set, adjust the hyperparameters to optimize the model performance and obtain the verified CNN-LSTM hybrid model.

[0032] Specifically, the above step S5 specifically includes:

[0033] S5-1, Model loading: Load the verified CNN-LSTM hybrid model into the real-time monitoring system and set parameters;

[0034] S5-2, system integration: integrating the loaded model into the monitoring system so that the loaded model can receive real-time data input and output prediction results;

[0035] S5-3, Anomaly threshold setting: According to business needs and historical data, set the anomaly detection threshold to determine whether the model output indicates anomalies;

[0036] S5-4, Real-time monitoring: After denoising, normalizing and smoothing the real-time monitoring data, the data is input into the verified CNN-LSTM hybrid model, and the predicted results of voltage and current data are output; the predicted results are compared with the actual data according to the set threshold to identify abnormal data;

[0037] S5-5. Exception handling: When an exception is identified, the system will trigger an alarm mechanism and notify relevant personnel; the system records the abnormal data and the predicted results of the abnormal data for subsequent analysis and model optimization; the system adjusts and optimizes model parameters based on real-time monitoring results and feedback.

[0038] Preferably, the above-mentioned data enhancement is to increase sample diversity through data enhancement technology, and the above-mentioned data enhancement includes any one or a combination of rotation, scaling and cropping.

[0039] Preferably, the above sequence processing is to serialize the data of the LSTM model and ensure that the length of each sequence is the same; for the data of the CNN model, it is ensured that the input data has the same dimension.

[0040] Specifically, for the data of the CNN model, the specific operation to ensure that the input data has the same dimension is to perform dimensionality reduction processing on the data of the non-one-dimensional CNN model.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] The present invention relates to a voltage and current abnormal data screening method and a transfer learning method based on a convolutional neural network and a long short-term memory network, wherein the convolutional neural network is CNN and the long short-term memory network is LSTM, which are intended to be applied to a real-time monitoring system of an AC power system to realize automatic data labeling.

[0043] The present invention utilizes a deep learning model in combination with CNN and LSTM to automatically learn and identify abnormal patterns, thereby improving the accuracy and efficiency of abnormal data screening. First, the present invention establishes a training set containing rich abnormal data samples by constructing and marking abnormal data sets. CNN is used to extract spatial features and capture local patterns in voltage and current waveforms, while LSTM is used to capture long-term dependencies in time series, taking into account the spatiotemporal characteristics of the data. An effective loss function and optimization algorithm are used for model training to improve the generalization ability and robustness of the model. In addition, the present invention utilizes a compressed excitation layer to expand the field of view of the convolutional network, and the abnormal data screening method based on CNN and LSTM has higher accuracy and reliability than the traditional method. The method of the present invention can effectively identify various types of voltage and current abnormal data and improve the accuracy of abnormal recognition of the real-time monitoring system.

[0044] The voltage and current abnormal data screening method based on combined transfer learning CNN and LSTM proposed in this invention provides a new solution for abnormal data identification in real-time monitoring systems. Future work can further optimize the model structure and parameter settings to adapt to more complex abnormal situations, and apply the method of the invention to a wider range of fields, bringing more innovation and value to the field of power system status monitoring and fault analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is a flow chart of abnormal marking in step S1 of the present invention.

[0046] Figure 2 It is a structural diagram of the CNN-LSTM hybrid model of the present invention.

[0047] Figure 3 This is a detailed structural diagram of the first LSTM layer and the second LSTM layer in the CNN-LSTM hybrid model.

[0048] Figure 4 This is the flowchart of optimizing the CNN-LSTM hybrid model based on transfer learning in step S3. DETAILED DESCRIPTION

[0049] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Example

[0051] In an AC power system, a real-time monitoring system is used to monitor the voltage and current of three phases A, B, and C. The abnormal data marking method of this embodiment includes the following specific steps:

[0052] Step S1: construct a voltage and current anomaly data set, including collecting and organizing voltage and current anomaly data and preprocessing the voltage and current anomaly data:

[0053] S1-1. Collect voltage and current basic sample data through the voltage and current real-time monitoring system. The voltage basic sample data includes A-phase voltage, B-phase voltage and C-phase voltage; the current basic sample data includes A-phase current, B-phase current and C-phase current.

[0054] S1-2, using threshold judgment and mutation algorithm to preliminarily determine the suspected abnormal data in the basic sample data. The threshold judgment method of the present invention is that if the current current value exceeds the preset threshold, it is considered to be suspected abnormal data. In this embodiment, when the previous current value (Icurrent ) exceeds the preset threshold (Threshold), the data is considered to be abnormal data, which is expressed as formula 1:

[0055]

[0056] In formula 1, I current represents the previous current value, Threshold represents the preset threshold, and Anomaly represents a binary variable. current When the threshold is exceeded, Anomaly is 1, indicating that an anomaly is detected; otherwise, it is 0, indicating that there is no anomaly;

[0057] The mutation amount algorithm of the present invention is to set n is the current measurement value of the nth cycle, I n-1 is the current measurement value of the previous cycle, ΔI threshold The current change threshold is set based on the maximum current change expected during normal system operation. threshold If the current change is greater than the expected maximum current change value during normal system operation, it is considered to be suspected abnormal data, which can be expressed as:

[0058]

[0059] According to Formula 2, if the difference between two consecutive measurements exceeds ΔI threshold This threshold, then the anomaly is detected in the nth cycle. Formula 2 can be applied to each 20ms cycle with an unlimited sampling rate to continuously monitor the change in current; if the current change exceeds the normal range, the system will mark it as an anomaly.

[0060] S1-3. Use the Fourier transform algorithm to calculate the vector corresponding to the suspected abnormal data, and use the threshold method, differential analysis method and zero-sequence network method to judge the abnormal data and mark the abnormality. The zero-sequence network method of the present invention can obtain the zero-sequence vector value by performing Fourier transform algorithm on the measured zero-sequence current; if the zero sequence is not measured during the acquisition process, the vector values ​​of the three items of phase A, phase B and phase C can be obtained according to the Fourier transform algorithm, and then the vector values ​​of the three items are added to obtain the zero-sequence vector value.

[0061] The flowchart of abnormal marking of step S1 in this embodiment can be found in the attached Figure 1 .

[0062] S1-4. Make a basic judgment on the fault type. The basic judgment methods for fault types include four categories:

[0063] The first type is single-phase grounding fault judgment:

[0064] When the zero sequence current I0 >0.4×zero-sequence protection setting value (the zero-sequence protection setting value in this embodiment is 15A), and 3U 0 >0.3U N =6kV, it is judged that an asymmetrical ground fault occurs;

[0065] If the phase voltage of a phase A is less than or equal to 0.77 times the phase voltage (U N =U N line / 1.732), and the other two phase voltages are greater than 1.12 times the phase voltage (U N ), it is considered that a ground fault occurs in phase A;

[0066] If the voltages of the other two phases (non-fault phases) do not meet the condition of being greater than 1.12 times, it is further determined whether the phase angle difference between the zero-sequence current of the faulty line and the phase angle difference of the zero-sequence voltage fault component of the busbar meets the conditions in the range of [155°~180°]. If so, it is also considered that a ground fault has occurred in phase A.

[0067] The second type is the phase-to-phase short circuit grounding fault judgment:

[0068] When the zero-sequence current is greater than 0.4× the zero-sequence protection setting value (the zero-sequence protection setting value is 15A in this embodiment), and 3U 0 >0.3U N =6kV, two-phase ΔI 1x >584A, it is judged as an asymmetrical ground fault;

[0069] If the phase voltage of a phase A is between 1.2 and 1.6 times the phase voltage (U N ), the phase voltage of the other two phases B and C is less than 1.01 times the phase voltage (U N ), it is considered that a phase-to-phase short-circuit grounding fault occurs between phases B and C.

[0070] The third type is phase-to-phase short circuit fault judgment

[0071] When the zero-sequence current is less than 0.3× the zero-sequence protection setting value (the zero-sequence protection setting value is 10A in this embodiment), and 3U 0 <0.1U N =2kV, two-phase ΔI 1x >584A, judged as two-phase non-grounding fault;

[0072] Calculate the ratio of each phase voltage after the fault to the corresponding normal phase voltage before the fault. Assume that the X phase uses U X_ratio It means that if the ratio of the phase voltage after the fault to the phase voltage before the fault of a phase A is U A_ratio Between 0.95 and 1.6 times, and the U of the other two phases B and C B_ratio , U C_ratioIf both are between 0.2 and 0.9 times at the same time, it is considered that a phase-to-phase short circuit fault has occurred between phases B and C.

[0073] The fourth category is three-phase short circuit fault judgment

[0074] Calculate the ratio of each phase voltage after the fault to the normal voltage before the fault: U A_ratio , U B_ratio , U C_ratio .

[0075] Another: U abratio =U A_ratio / U B_ratio , U bcratio =U B_ratio / U C_ratio

[0076] If U abratio and U bcratio At the same time, it is within the range of 0.94 to 1.08 times, and the zero-sequence current is <0.2×zero-sequence protection setting value (8A in this embodiment), and the three-phase ΔI 1x >584A, three-phase U A_ratio , U B_ratio , U C_ratio If they are roughly equal and between 0.2 and 0.9 times, it is judged that a three-phase short circuit has occurred.

[0077] S1-5. Preprocessing of abnormal data. Specific preprocessing includes denoising, normalization, and smoothing. The Z-Score method, mean filling method, and data normalization can be used:

[0078] Among them, the outlier processing method can use the Z-Score method, which is a statistical method used to identify outliers in a data set;

[0079] Z-Score represents the number of standard deviations of a data point from the mean. Usually, if the Z-Score of a data point exceeds a certain threshold (for example, the threshold is 3), it is considered an outlier. The calculation formula is shown in 3.

[0080]

[0081] In Formula 3, X represents the data point, μ represents the mean value, and σ represents the standard deviation.

[0082] Outlier handling methods can also handle missing values, such as using mean filling, which is a simple method used to fill missing values ​​in a dataset; for each feature, the mean of all non-missing values ​​is calculated, denoted by μ, and this mean is used to fill the missing values ​​of the feature.

[0083] For data normalization, minimum-maximum normalization can be used. This method scales the data to a specified range, usually [0,1], to help process features of different dimensions and ranges, making model training more stable.

[0084] Step S2, building a voltage and current abnormal data recognition model based on the CNN model and the LSTM model. The voltage and current abnormal data recognition model in the present invention is a CNN-LSTM hybrid model including a first one-dimensional convolution layer, a first one-dimensional pooling layer, a first Dropout layer, a second one-dimensional convolution layer, a second one-dimensional pooling layer, a second Dropout layer, a first LSTM layer, a third Dropout layer, a second LSTM layer and an output layer; wherein the first one-dimensional convolution layer, the first one-dimensional pooling layer, the first Dropout layer, the second one-dimensional convolution layer, the second one-dimensional pooling layer, and the second Dropout layer can be used as the CNN part of the model, and the first LSTM layer, the third Dropout layer, the second LSTM layer and the output layer can be used as the LSTM part of the model, that is, the model is input into two LSTM layers after two one-dimensional convolutions, and a preliminary result is output after LSTM. The structure of the CNN-LSTM hybrid model can be seen in the attached figure. Figure 2 .

[0085] The first Dropout layer includes a first compression-excitation layer, and the second Dropout layer includes a second compression-excitation layer.

[0086] In this embodiment, alternating between convolutional layers and pooling layers can effectively solve the overfitting problem while retaining the salient features of the data.

[0087] In this embodiment, the number of input channels, convolution kernel size, and output channels of the first one-dimensional convolutional layer are set, denoted as conv 1 (128,7,128); Set the number of input channels, convolution kernel size, and output channels of the second one-dimensional convolution layer, denoted as conv 2 (128,5,256).

[0088] For a detailed structural diagram of the first LSTM layer and the second LSTM layer in this embodiment, please refer to the attached Figure 3 When the structure of the recurrent neural network is more complex, problems such as gradient explosion and gradient disappearance will arise. Figure 3 In the example, σ is the sigmoid activation function, which represents the state of each neuron; the tanh function outputs the adjustment value; x t is the current input; C t is the storage and update amount of long-term memory; h t For C-based tThe output generated by the current input. The neuron state can compress the information of the previous moment and add the information of the current moment to memorize long-term information.

[0089] The LSTM part of the present invention adds three structures, namely, an input gate, an output gate and a forget gate, to its basic structure.

[0090] Among them, the input gate can obtain the update degree of the current information and realize the unit state update. The specific calculation is shown in Formula 4:

[0091] i t =σ(W xi x t +W hi h t-1 +b i ) Formula 4,

[0092] In formula 4, W xi and W hi are the weights between the input, the output of the previous moment and the input gate, and b i is the bias term, i t is the input gate output;

[0093] The output gate determines the output state at this moment by confirming the value of the next state. For specific calculation, see Formula 5:

[0094] O t =σ(W xo x t +W ho h t-1 +b o ) Formula 5,

[0095] In formula 5, W xo and W ho are the weights between the output gate and the input and historical output, respectively, and b o is the bias term, O t Output of the output gate;

[0096] The forget gate retains or deletes the information in the neuron state, and then selects the content that needs to be remembered. The calculation is shown in Formula 6:

[0097] f t =σ(W xf x t +W hf h t-1 +b f ) Formula 6,

[0098] In formula 6, W xf and W hf are the weights between the forget gate and the input and the historical output, respectively,f is the bias term, f t is the output of the forget gate.

[0099] Step S3: Based on transfer learning, the CNN-LSTM hybrid model built in step S2 is optimized to obtain an optimized CNN-LSTM hybrid model. For the specific process, see the attached Figure 4 .

[0100] In this embodiment, the domain that needs to be pre-learned for transfer learning is called the source domain, the pre-learned task is called the source task, the domain to be learned is called the target domain, and the task to be learned is called the target task, which specifically includes:

[0101] S3-1. Use the source domain dataset to train the CNN-LSTM hybrid model built in step S2 to ensure that the model achieves the expected performance level on the source domain data; adjust the model parameters and hyperparameters, and use the validation set to evaluate the generalization ability of the model;

[0102] S3-2, migrate the CNN-LSTM hybrid model trained in step S3-1 to the target domain dataset, freeze any one or combination of the first one-dimensional convolution layer, the first one-dimensional pooling layer, the first Dropout layer including the first compression excitation layer, the second one-dimensional convolution layer, the second one-dimensional pooling layer, the second Dropout layer including the second compression excitation layer, the first LSTM layer, the third Dropout layer, and the second LSTM layer in step S2, for example, freeze the bottom layer of CNN, i.e., the first one-dimensional convolution layer, the first one-dimensional pooling layer, and the first Dropout layer including the first compression excitation layer, so as to retain the source domain feature extraction capability, and fine-tune the target domain dataset;

[0103] S3-3, gradually adjust the model to adapt to the new data by unfreezing the layers frozen in step S3-3 and training on the target domain dataset;

[0104] S3-4. Evaluate the model performance on the target domain dataset and monitor the model accuracy to ensure that it meets expectations. If the accuracy does not meet the expected requirements, such as the accuracy is lower than the overdue requirement of 95%, analyze the error pattern and adjust the model structure, loss function or data processing method;

[0105] S3-5. Based on the accuracy performance, adjust and train the model repeatedly until the accuracy of the target domain data set reaches the expected level. Regularly evaluate the generalization ability of the model on the target domain data to ensure that the model performs well on unlabeled data.

[0106] Step S4: Use the voltage and current anomaly data set to train and verify the optimized CNN-LSTM hybrid model to obtain the verified CNN-LSTM hybrid model, which specifically includes:

[0107] S4-1, divide the abnormal data set constructed in step S1 into a training set, a validation set and a test set, with the division ratio being 70% training set, 15% validation set and 15% test set;

[0108] S4-2. Processing of abnormal data sets: The processing includes data enhancement and sequence processing. Data enhancement is to increase sample diversity through data enhancement technology. Data enhancement technology includes any one or combination of rotation, scaling and cropping, which can solve the problem of less abnormal data. Sequence processing is to serialize the data of the LSTM model and ensure that the length of each sequence is the same. The dimensionality reduction processing is performed on the data of the CNN model to ensure that the input data has the same dimension.

[0109] S4-3. Select an initialization method for the model's weights and biases, train the model using the training set data, evaluate the model performance using the validation set data after each epoch, and adjust the model parameters based on the validation set loss and accuracy:

[0110] Select a suitable initialization method for the model weights and biases. This embodiment uses the Xavier initialization method.

[0111] Select the loss function and optimizer: In this embodiment, the mean square error loss and Adam are selected as the optimizer;

[0112] Callback function settings, early stopping to prevent overfitting, model checkpoints to save the best model;

[0113] For training, that is, after each epoch, the validation set data is used to evaluate the model performance, and the model parameters are adjusted according to the loss and accuracy of the validation set.

[0114] S4-4. According to the performance on the validation set, adjust the hyperparameters to optimize the model performance and obtain the verified CNN-LSTM hybrid model. For example, according to the performance on the validation set, adjust the hyperparameters such as learning rate, batch size, number of units in the LSTM layer, etc. to optimize the model performance.

[0115] Step S5: using the verified CNN-LSTM hybrid model to identify abnormal voltage and current data, the steps specifically include:

[0116] This step relies on the voltage and current data collected in the real-time monitoring system. These data come from sensors or other devices capable of real-time monitoring. The continuity and real-time nature of the data must be ensured. In addition, refer to S1-5, the preprocessing process of abnormal data, to preprocess the real-time monitoring data, which also includes denoising, normalization, and smoothing. The Z-Score method, mean filling method, and data normalization can also be used.

[0117] S5-1. Model loading: Load the verified CNN-LSTM hybrid model into the real-time monitoring system to ensure that the model file is complete and all necessary configurations and parameters have been set.

[0118] S5-2. System integration: Integrate the loaded model into the monitoring system so that it can receive real-time data input and output prediction results.

[0119] S5-3. Anomaly threshold setting: According to business needs and historical data, set the anomaly detection threshold to determine whether the model output indicates anomalies.

[0120] S5-4, Real-time monitoring: After data enhancement and sequence processing, the real-time monitoring data is input into the verified CNN-LSTM hybrid model to output the predicted results of voltage and current data; according to the set threshold, the predicted results are compared with the actual data to identify abnormal data.

[0121] S5-5, exception handling: When an exception is identified, the system will trigger an alarm mechanism and notify relevant personnel through SMS or system notification; the system records automatic exception data and the predicted results of the exception data for subsequent analysis and model optimization; the system adjusts and optimizes model parameters based on the results and feedback of real-time monitoring. The present invention can continuously adjust and optimize model parameters based on the results and feedback of real-time monitoring to improve the accuracy and efficiency of anomaly detection.

[0122] The following is the process of the embodiment to mark the abnormal voltage and current data. CNN, LSTM, LSTM-CNN and the method of the present invention (LSTM-CNNS) are selected for comparison. The quantitative evaluation indicators are mainly average accuracy (G-means), recall rate Recall (Recall) and specificity (Specificity). All abnormal data marking methods are run in the same environment.

[0123] The quantitative evaluation index results of the four voltage and current abnormal data marking methods are shown in Table 1.

[0124] Table 1: Quantitative evaluation index results of four voltage and current abnormal data marking methods

[0125] Method Name (Device Number) G-means (%) Recall(%) Specificity(%) CNN 97.6 95.6 99.77 LSTM 95.9 92.1 99.89 LSTM-CNN 94.2 88.8 99.86 LSTM-CNNS 98.7 97.7 99.91

[0126] It can be seen from the results in Table 1 that the three indicators of the voltage and current abnormal data marking method of the present invention are higher than other methods. This is because the convolution calculation of the CNN model is more conducive to extracting spatial domain features, and the LSTM model has the ability to remember past input information and can better learn the time domain features of the data. The model LSTM-CNNS model of the present invention not only learns the time domain features of the data from the perspective of time, but also uses the compression excitation layer in the one-dimensional convolutional network layer to expand the field of view of the convolutional network, so that the spatial features learned by the model are more accurate and comprehensive, which is conducive to improving the accuracy of data identification.

Claims

1. A voltage and current abnormal data labeling method based on CNN and LSTM, in which the voltage and current of three phases A, B, and C are monitored by a real-time monitoring system in an AC power system, characterized in that: The specific steps of the abnormal data marking method include: Step S1, constructing a voltage and current abnormal data set, including collecting and collating the voltage and current abnormal data and preprocessing the voltage and current abnormal data; Step S2, building a voltage and current abnormal data recognition model based on the CNN model and the LSTM model, wherein the voltage and current abnormal data recognition model is a CNN-LSTM hybrid model including a first one-dimensional convolution layer, a first one-dimensional pooling layer, a first Dropout layer, a second one-dimensional convolution layer, a second one-dimensional pooling layer, a second Dropout layer, a first LSTM layer, a third Dropout layer, a second LSTM layer and an output layer; the first Dropout layer includes a first compression excitation layer, and the second Dropout layer includes a second compression excitation layer; Step S3: Optimize the CNN-LSTM hybrid model built in step S2 based on transfer learning to obtain an optimized CNN-LSTM hybrid model; Step S4: Use the voltage and current anomaly data set to train and verify the optimized CNN-LSTM hybrid model to obtain a verified CNN-LSTM hybrid model; Step S5: Use the verified CNN-LSTM hybrid model to identify abnormal voltage and current data.

2. According to the method for marking abnormal voltage and current data based on CNN and LSTM according to claim 1, it is characterized in that: The S1 step specifically includes: S1-1. Collect voltage and current basic sample data through a voltage and current real-time monitoring system, wherein the voltage basic sample data includes A-phase voltage, B-phase voltage and C-phase voltage; and the current basic sample data includes A-phase current, B-phase current and C-phase current; S1-2, using threshold judgment and mutation algorithm to preliminarily determine the suspected abnormal data in the basic sample data, the threshold judgment method is: if the current current value exceeds the preset threshold, it is considered to be suspected abnormal data; the mutation algorithm is: assuming I n is the current measurement value of the nth cycle, I n-1 is the current measurement value of the previous cycle, ΔI threshold is the threshold value of current change, when ΔI threshold If it is greater than the maximum current change value expected during normal system operation, it is considered to be suspected abnormal data; S1-3, using Fourier transform algorithm to calculate the vector corresponding to the suspected abnormal data, and using threshold method, differential analysis method and zero sequence network method to judge the abnormal data and mark the abnormality; S1-4. Make a basic judgment on the fault type; S1-5. Preprocessing of abnormal data, including denoising, normalization and smoothing.

3. According to the method for marking abnormal voltage and current data based on CNN and LSTM in claim 2, it is characterized in that: The zero-sequence network method is to obtain the zero-sequence vector value by calculating the measured zero-sequence current through Fourier transform algorithm, or first obtain the vector values ​​of phase A, phase B and phase C according to the Fourier transform algorithm and then add the vector values ​​of the three items to obtain the zero-sequence vector value.

4. According to the method for marking abnormal voltage and current data based on CNN and LSTM in claim 1, it is characterized in that: The S3 step specifically includes: S3-1. Use the source domain dataset to train the CNN-LSTM hybrid model built in step S2 and adjust the model parameters and hyperparameters. S3-2, migrate the CNN-LSTM hybrid model trained in step S3-1 to the target domain dataset, freeze any one or combination of the first one-dimensional convolution layer, the first one-dimensional pooling layer, the first Dropout layer, the second one-dimensional convolution layer, the second one-dimensional pooling layer, the second Dropout layer, the first LSTM layer, the third Dropout layer, and the second LSTM layer described in step S2 to retain the source domain feature extraction capability, and fine-tune the target domain dataset; S3-3, gradually adjust the model by unfreezing the layers frozen in step S3-2 and training on the target domain dataset; S3-4. Evaluate model performance on the target domain dataset, monitor the model accuracy to ensure it meets expectations, and if the accuracy does not meet expectations, analyze the error pattern and adjust the model structure, loss function, or data processing method; S3-5. Based on the accuracy performance, adjust and train the model repeatedly until the accuracy of the target domain data set reaches the expected level. Regularly evaluate the generalization ability of the model on the target domain data to ensure that the model performs well on unlabeled data.

5. According to claim 4, a voltage and current abnormal data marking method based on CNN and LSTM is characterized in that: The first LSTM layer and the second LSTM layer add three structures, namely, input gate, output gate and forget gate, on the basis of the basic structure of the LSTM layer; the input gate can obtain the update degree of the current information and realize the update of the unit state; the output gate determines the output state at this moment by confirming the value of the next state; the forget gate retains or deletes the information in the neuron state, and then filters the content that needs to be remembered.

6. The voltage and current abnormal data marking method based on CNN and LSTM according to claim 1 is characterized in that: The S4 step specifically includes: S4-1, divide the abnormal data set constructed in step S1 into a training set, a validation set and a test set, with the division ratio being 70% training set, 15% validation set and 15% test set; S4-2. Processing the abnormal data set: the processing includes data enhancement and sequence processing; S4-3. Select an initialization method for the model's weights and biases, train the model using the training set data, evaluate the model performance using the validation set data after each epoch, and adjust the model parameters based on the validation set loss and accuracy. S4-4. According to the performance on the validation set, adjust the hyperparameters to optimize the model performance and obtain the verified CNN-LSTM hybrid model.

7. The voltage and current abnormal data marking method based on CNN and LSTM according to claim 1 is characterized in that: The S5 step specifically includes: S5-1, Model loading: Load the verified CNN-LSTM hybrid model into the real-time monitoring system and set parameters; S5-2, system integration: integrating the loaded model into the monitoring system so that the loaded model can receive real-time data input and output prediction results; S5-3, Anomaly threshold setting: According to business needs and historical data, set the anomaly detection threshold to determine whether the model output indicates anomalies; S5-4, Real-time monitoring: After denoising, normalizing and smoothing the real-time monitoring data, the data is input into the verified CNN-LSTM hybrid model, and the predicted results of voltage and current data are output; the predicted results are compared with the actual data according to the set threshold to identify abnormal data; S5-5. Exception handling: When an exception is identified, the system will trigger an alarm mechanism and notify relevant personnel; the system records the abnormal data and the predicted results of the abnormal data for subsequent analysis and model optimization; the system adjusts and optimizes model parameters based on real-time monitoring results and feedback.

8. A voltage and current abnormal data marking method based on CNN and LSTM according to claim 6 or 7, characterized in that: The data enhancement is to increase sample diversity through data enhancement technology, and the data enhancement includes any one or a combination of rotation, scaling and cropping.

9. A voltage and current abnormal data marking method based on CNN and LSTM according to claim 6 or 7, characterized in that: The sequence processing is to serialize the data of the LSTM model and ensure that the length of each sequence is the same; for the data of the CNN model, it is ensured that the input data has the same dimension.

10. The voltage and current abnormal data marking method based on CNN and LSTM according to claim 9 is characterized in that: For the data of the CNN model, the specific operation to ensure that the input data has the same dimension is to perform dimensionality reduction processing on the data of the non-one-dimensional CNN model.

Citation Information

Cited By

  • Non-contact AO channel current monitoring pre-diagnosis method and system

    CN122171868A