CN116108885A - LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method - Google Patents

LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method Download PDF

Info

Publication number
CN116108885A
CN116108885A CN202310008710.8A CN202310008710A CN116108885A CN 116108885 A CN116108885 A CN 116108885A CN 202310008710 A CN202310008710 A CN 202310008710A CN 116108885 A CN116108885 A CN 116108885A
Authority
CN
China
Prior art keywords
data
gas pressure
pressure regulator
lstm
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310008710.8A
Other languages
Chinese (zh)
Inventor
张艳
王海超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai University of Electric Power
Original Assignee
Shanghai University of Electric Power
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai University of Electric Power filed Critical Shanghai University of Electric Power
Priority to CN202310008710.8A priority Critical patent/CN116108885A/en
Publication of CN116108885A publication Critical patent/CN116108885A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M99/00Subject matter not provided for in other groups of this subclass
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M13/00Testing of machine parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/088Non-supervised learning, e.g. competitive learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Control Of Fluid Pressure (AREA)

Abstract

The invention relates to a medium-low pressure gas pressure regulator abnormality detection method based on an LSTM-AE-DT model, which comprises the following steps: s1, collecting outlet pressure data of a medium-low pressure gas pressure regulator; s2, preprocessing outlet pressure data of the gas pressure regulator; s3, building an LSTM-AE model, inputting preprocessed training data to train the model, and storing the trained model; s4, inputting the preprocessed test data into a trained algorithm model, and outputting a predicted value of the outlet pressure of the gas pressure regulator; s5, calculating an error and a threshold epsilon of a predicted value of the outlet pressure of the gas pressure regulator and a true value of the outlet pressure of the gas pressure regulator; s6, detecting the state of the time sequence data of the gas pressure regulator according to the threshold epsilon, and outputting the corresponding operating state of the gas pressure regulator. Compared with the prior art, the invention combines the long-period memory network and the self-encoder, can reconstruct time sequence data on the basis of learning data long dependence, and improves the performance of abnormal detection of the time sequence data of the gas pressure regulator.

Description

LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method
Technical Field
The invention relates to a method for detecting abnormality of a medium-low pressure gas pressure regulator, in particular to a method for detecting abnormality of a medium-low pressure gas pressure regulator based on an LSTM-AE-DT model.
Background
With the rapid development of the gas industry, how to ensure the stability and safety in the gas conveying process is always the focus of the research in the gas field. The gas pressure regulator is an important device for ensuring that the gas is normally conveyed to downstream users, and when the gas pressure regulator fails, the problems of insufficient downstream gas consumption, unstable gas supply and the like are caused, and if the gas pressure regulator does not find the failure in time and maintain the failure, accidents such as explosion, fire and the like are continuously deteriorated and caused. The state of the gas pressure regulator can be fed back through time sequence data in the operation process of the gas pressure regulator, and whether the gas pressure regulator has faults or not is detected. Therefore, the abnormal detection research of the time sequence data of the gas pressure regulator has great practical significance and value.
The abnormal detection technology of the gas pressure regulator is mainly used for judging whether the gas pressure regulator is in a normal working state or an abnormal state. The abnormality detection technology of the gas pressure regulator in the traditional method is to directly judge abnormality through the experience of a maintainer or to judge abnormality by utilizing the traditional statistical theory; the traditional method can not early warn fault hidden trouble in advance, and has lower accuracy and poorer timeliness. Therefore, research on developing an intelligent detection method for abnormal detection of time sequence data of a gas pressure regulator is a problem to be solved urgently.
In recent years, more and more machine learning methods are applied, and more application is realized, and a plurality of students in industry propose gas based on machine learning
Voltage regulator abnormality detection techniques. The abnormal gas pressure regulator detection technology based on machine learning is to train a support vector machine and other machine learning algorithms to detect the abnormality by utilizing the historical data of the system under normal and fault conditions; the technology needs manual annotation data for supervision processing, and consumes a great deal of time and labor cost.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a medium-low pressure gas pressure regulator abnormality detection method based on an LSTM-AE-DT model.
The aim of the invention can be achieved by the following technical scheme:
a medium-low pressure gas pressure regulator abnormality detection method based on LSTM (long short term memory network) -AE (self encoder) -DT (dynamic threshold method) model comprises the following steps:
s1, collecting outlet pressure data of a medium-low pressure gas pressure regulator;
s2, preprocessing the outlet pressure data of the gas pressure regulator to obtain training data and test data;
s3, building an LSTM-AE model, inputting preprocessed training data to train the model, and storing the trained model;
s4, inputting the preprocessed test data into a trained algorithm model, and outputting a predicted value of the outlet pressure of the gas pressure regulator;
s5, reconstructing an error between a predicted value of the output gas pressure regulator outlet pressure and a true value of the gas pressure regulator outlet pressure, and a threshold epsilon of the time sequence data;
s6, detecting the state of the time sequence data of the gas pressure regulator according to the threshold epsilon, and outputting the normal operation state or the abnormal operation state of the gas pressure regulator.
Further, in the step S2, the original outlet pressure time sequence training data set x= (X) of the gas pressure regulator is obtained through the step S1 1 ,x 2 ,…,x j ,…,x N ) Calculating the average value of the outlet pressure values at the same time point three days before the value of the missing data, and filling the value of the missing data; processing the original time sequence data set by using a deviation normalization method to obtain a normalized time sequence data set X ' = (X ') ' 1 ,x′ 2 ,…,x′ j ,…,x′ N ),x′ j ∈[0,1]The formula is as follows:
Figure BDA0004036919350000021
wherein x is j For the j-th raw data, x' j Is the j-th standardTransforming time series data, min 1≤j≤N {x j The minimum value in the training data set, max 1≤j≤N {x j -represents the maximum value in the training dataset; finally, framing the data set X' by a sliding window method, wherein the sliding window width is l, l is more than or equal to 1 and less than or equal to N, the sliding step length is set to be 1, and the data set Y= (Y) subjected to framing operation at the moment 1 ,y 2 ,…,y N-l+1 ) Wherein y is i =(x′ i ,x′ i+1 ,…,x′ i+l-1 ),1≤i≤N-l+1。
Further, in the step S3, the LSTM network adopts forgetting gate screening information, the input gate retains necessary information and encodes, the hidden state is output through the output gate, and the hidden state is transmitted to the next LSTM unit for training, and the feature extraction is performed on the data.
Further, the step S3 constructs an LSTM network on an encoder and a decoder of AE, where the encoder acquires a high-dimensional input data sequence in a vector form with a fixed size.
Further, in the step S4, the data y after framing is obtained i =(x′ i ,x′ i+1 ,…,x′ i+l-1 ) Inputting the LSTM-AE model for training to obtain a reconstructed time sequence data set
Figure BDA0004036919350000031
Further, in the step S5, a reconstruction error e between the predicted value of the outlet pressure of the gas pressure regulator and the actual value of the outlet pressure of the gas pressure regulator is calculated j
Figure BDA0004036919350000032
Figure BDA0004036919350000033
Wherein x' j Represents the j-th outlet pressure data, n represents x' j Number of reconstructions,
Figure BDA0004036919350000034
Represents x' j The kth reconstructed outlet pressure data, represented by x' j Reconstruction error e of (2) j The calculation method of (1) obtains a reconstruction error sequence: e= (e) 1 ,e 2 ,…,e j ,…,e N ) Exponentially weighted sliding average is performed on e to obtain an error sequence e '= (e' 1 ,e′ 2 ,…,e′ j ,…,e′ N ) The threshold sequence ε is then calculated:
ε=μ(e′)+Z·σ(e′)
wherein μ (·) is the mean, σ (·) is the standard deviation, Z represents the artificially set weight,
Figure BDA0004036919350000035
calculating f (epsilon) t ):
Figure BDA0004036919350000036
Δμ(e′)=μ(e′)-μ({e∈e′|e<ε t })
Δσ(e′)=σ({e∈e′|e<ε t })
e a ={e∈e′|e>ε t }
Wherein E is seq E is a Such that f (epsilon) t ) The threshold epsilon at which the maximum value is reached is a threshold value, and abnormality detection of time series data is performed based on epsilon.
Further, in the step S5, the LSTM-AE-DT model is optimized by using a back propagation algorithm, and the network parameters are updated until the input and output loss functions L reach the minimum value, where the loss function L has the formula:
Figure BDA0004036919350000037
wherein e j Is gas regulatingAnd (3) reconstructing errors of the predicted value of the outlet pressure of the compressor and the actual value of the outlet pressure of the gas pressure regulator.
Further, in the step S6, the accuracy, recall and F1 value are used as evaluation indexes, and the calculation formula is as follows:
Figure BDA0004036919350000041
Figure BDA0004036919350000042
Figure BDA0004036919350000043
precision is the Precision, recall is the Recall, TP represents the number of abnormal data predicted as abnormal data; FP represents the number of abnormal data predicted from normal data; FN represents the number of abnormal data predicted as normal data.
Further, the LSTM-AE model in step S3 uses the storage capability of LSTM to make the data processed by the encoder maintain long dependency of time series data, and at the same time compress the high-dimensional input vector to the low-dimensional vector.
Further, in the step S5, a dynamic thresholding method is used to calculate the threshold epsilon of the time series data.
Compared with the prior art, the invention has the following beneficial effects:
1. according to the invention, the long-period memory network and the self-encoder are combined, the long-period memory network consists of a plurality of LSTM units, the self-encoder can well extract characteristics of non-stable time sequence data, the influence of noise on the time sequence data is eliminated, an unsupervised algorithm is adopted by a model established by combining the long-period memory network and the self-encoder, the data is not required to be labeled in the training process, the long dependence of the data in a time sequence is learned, and the correlation among the data is extracted, so that the time sequence data of the gas pressure regulator is reconstructed, the time is saved, and the labor cost is reduced.
2. The invention fully considers the long memory in the time sequence data by using the dynamic threshold method, avoids information loss caused by too long time sequence, dynamically adjusts the threshold according to the change of the time sequence data, realizes automatic updating of the threshold to perform abnormality detection, and improves the performance of detecting the abnormality of the time sequence data of the gas pressure regulator.
Drawings
FIG. 1 is a schematic flow chart of the present invention;
FIG. 2 is a schematic diagram of the LSTM-AE model structure of the present invention;
fig. 3 is a schematic diagram of an abnormality detection result curve of the medium-low pressure gas pressure regulator according to the present invention.
Detailed Description
The invention will now be described in detail with reference to the drawings and specific examples. The present embodiment is implemented on the premise of the technical scheme of the present invention, and a detailed implementation manner and a specific operation process are given, but the protection scope of the present invention is not limited to the following examples.
As shown in FIG. 1, the method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model comprises the following steps:
s1, collecting outlet pressure data of a medium-low pressure gas pressure regulator;
s2, preprocessing the outlet pressure data of the gas pressure regulator to obtain training data and test data;
s3, building an LSTM-AE model, inputting preprocessed training data to train the model, and storing the trained model;
s4, inputting the preprocessed test data into a trained algorithm model, and outputting a predicted value of the outlet pressure of the gas pressure regulator;
s5, reconstructing an error between a predicted value of the output gas pressure regulator outlet pressure and a true value of the gas pressure regulator outlet pressure, and a threshold epsilon of the time sequence data;
s6, detecting the state of the time sequence data of the gas pressure regulator according to the threshold epsilon, and outputting the normal operation state or the abnormal operation state of the gas pressure regulator.
In step S2, the fuel is obtained in step S1Original outlet pressure time sequence training data set X= (X) of air pressure regulator 1 ,x 2 ,…,x j ,…,x N ) Calculating the average value of the outlet pressure values at the same time point three days before the value of the missing data, and filling the value of the missing data; processing the original time sequence data set by using a deviation normalization method to obtain a normalized time sequence data set X ' = (X ') ' 1 ,x′ 2 ,…,x′ j ,…,x′ N ),x′ j ∈[0,1]The formula is as follows:
Figure BDA0004036919350000051
wherein x is j For the j-th raw data, x' j For the j-th normalized time series data, min 1≤j≤N {x j The minimum value in the training data set, max 1≤j≤N {x j -represents the maximum value in the training dataset; finally, framing the data set X' by a sliding window method, wherein the sliding window width is l, l is more than or equal to 1 and less than or equal to N, the sliding step length is set to be 1, and the data set Y= (Y) subjected to framing operation at the moment 1 ,y 2 ,…,y N-l+1 ) Wherein y is i =(x′ i ,x′ i+1 ,…,x′ i+l-1 ),1≤i≤N-l+1。
In the step S3, the LSTM network adopts forget gate screening information, an input gate keeps necessary information and codes, a hidden state is output through an output gate and is transmitted to the next LSTM unit for training, and the data are subjected to feature extraction. The LSTM network is built on an AE encoder and decoder, which acquire a high-dimensional input data sequence in the form of a fixed-size vector.
In step S4, the data y after framing is processed i =(x′ i ,x′ i+1 ,…,x′ i+l-1 ) Inputting the LSTM-AE model for training to obtain a reconstructed time sequence data set
Figure BDA0004036919350000061
Step S5, calculating the reconstruction error e between the predicted value of the outlet pressure of the gas pressure regulator and the true value of the outlet pressure of the gas pressure regulator j
Figure BDA0004036919350000062
Figure BDA0004036919350000063
Wherein x' j Represents the j-th outlet pressure data, n represents x' j The number of times of the reconstruction,
Figure BDA0004036919350000064
represents x' j The kth reconstructed outlet pressure data, represented by x' j Reconstruction error e of (2) j The calculation method of (1) obtains a reconstruction error sequence: e= (e) 1 ,e 2 ,…,e j ,…,e N ) Exponentially weighted sliding average is performed on e to obtain an error sequence e '= (e' 1 ,e′ 2 ,…,e′ j ,…,e′ N ) The threshold sequence ε is then calculated:
ε=μ(e′)+Z·σ(e′)
wherein μ (·) is the mean, σ (·) is the standard deviation, Z represents the artificially set weight,
Figure BDA0004036919350000065
calculating f (epsilon) t ):
Figure BDA0004036919350000066
Δμ(e′)=μ(e′)-μ({e∈e′|e<ε t })
Δσ(e′)=σ({e∈e′|e<ε t })
e a ={e∈e′|e>ε t }
Wherein E is seq Is a set of contiguous data in ea such that f (ε) t ) The threshold epsilon at which the maximum value is reached is a threshold value, and abnormality detection of time series data is performed based on epsilon.
Optimizing an LSTM-AE-DT model by using a back propagation algorithm, and updating network parameters until the input and output loss functions L reach the minimum value, wherein the loss function L has the formula:
Figure BDA0004036919350000067
wherein e j Is the reconstruction error of the predicted value of the outlet pressure of the gas pressure regulator and the true value of the outlet pressure of the gas pressure regulator.
In the step S6, the accuracy rate, the recall rate and the F1 value are adopted as evaluation indexes, and the calculation formula is as follows:
Figure BDA0004036919350000068
Figure BDA0004036919350000069
Figure BDA0004036919350000071
precision is the Precision, recall is the Recall, TP represents the number of abnormal data predicted as abnormal data; FP represents the number of abnormal data predicted from normal data; FN represents the number of abnormal data predicted as normal data.
The LSTM-AE model in step S3 uses the memory capabilities of LSTM to enable the encoder-processed data to maintain long dependencies of time-series data while compressing the high-dimensional input vector to a low-dimensional vector.
In step S5, a dynamic thresholding method is used to calculate the threshold epsilon of the time series data.
The theoretical basis of the invention is as follows:
(a) Long-short term memory network model
The long-term memory network is a variant of the cyclic neural network RNN, and the information of the RNN hidden layer only comes from the information of the hidden layer at the current input and the previous moment and has no memory function. To solve the problem that RNNs cannot achieve long-term dependency, the LSTM model introduces a cell state and uses three gates, an input gate, a forget gate, and an output gate to hold and control information.
Reading the hidden state h of the output door at the last moment t-1 And input x at the current time t Calculating the output f of the forgetting gate by using the Sigmoid activation function delta (·) t . Through f t Control of cell State C at the last time t-1 Forgotten information is required. Wherein W is f And b f Weight and bias for forget gates.
f t =δ(W f [h t-1 ,x t ]+b f )
Calculating the value i of the input gate t And a temporary cell state at the current time
Figure BDA0004036919350000072
Control of the upper layer h t-1 And x t The information that needs to be retained through the input gate. Wherein W is i And W is c Weights of input gate and cell state, b i And b c The bias of the input gate and cell state, respectively.
i t =δ(W i [h t-1 ,x t ]+b i )
Figure BDA0004036919350000073
Calculating the cell state C at the current moment t Outputting the value o of the gate t And outputting the hidden state h of the door t . Wherein W is o And b o The weight and bias of the output gate, respectively.
Figure BDA0004036919350000074
o t =δ(W o [h t-1 ,x t ]+b o )
h t =o t tan(C t )
The LSTM unit outputs the hidden state h of the door at the previous moment t-1 And input x at the current time t Calculating the temporary cell states of three gates and the current moment
Figure BDA0004036919350000075
Output f of recombination forgetting gate t And the value of input gate i t Updating the cell state C at the current moment t . Finally, the value o of the output gate is combined t Passing internal information to external hidden state h t
(b) Self-encoder model
The self-encoder is a neural network model proposed in 1986, and is composed of an encoder and a decoder. The encoder performs the encoding process of the model, and the decoder performs the decoding process of the model. The parameters of the self-encoder are optimized through a back propagation algorithm, so that the loss errors of input and output reach the minimum value, and the model is trained to be optimal.
The input data X is encoded and weighted summed. By activating a function f in combination with the bias of the encoder m (. Cndot.) the code Y is calculated. Wherein R is m And b m The weights and offsets of the encoders, respectively.
Y=f m (R m X+b m )
The code Y is calculated in the same way by activating the function f n Output of (-)
Figure BDA0004036919350000081
Wherein R is n And b n The weight and bias of the decoder, respectively.
Figure BDA0004036919350000082
And selecting a mean square error as a loss function L, and performing minimization treatment on the loss function L by using a gradient descent method. The back propagation algorithm updates the model parameters θ stepwise so that the loss error is continually approaching a minimum value, at which point the minimum loss error E is obtained.
Figure BDA0004036919350000083
The embodiment of the invention provides a medium-low pressure gas pressure regulator abnormality detection method based on an LSTM-AE-DT model. In data preprocessing, the sliding window width is set to 60, and the sliding step length is set to 1. When the dynamic threshold method calculates the threshold value, the weight Z= (1.25,1.30, … 2.0) is set according to the characteristics of the gas pressure regulator outlet pressure time sequence data. According to the invention, a model is built based on TensorFlow2.2 by using Python3.7, and experiments are carried out on hardware equipment with a processor of Inteli5-12500H and a memory of 16G by using a Windows11 operating system. The method comprises the following specific steps:
step one: collecting outlet pressure data of a low-pressure gas pressure regulator;
the specific process is as follows:
and selecting a gas pressure regulator outlet pressure data set of 2021, 6, 25, 10, 9, and 2021, which are acquired by an energy company through an SCADA system, wherein data are acquired every 5 minutes, and 30528 data are acquired in total. The front 21370 strips are training sets and the rear 9158 strips are test sets.
Step two, preprocessing the outlet pressure data of the gas pressure regulator;
the specific process is as follows:
assume that the original outlet pressure time sequence training data set of the gas pressure regulator is x= (X) 1 ,x 2 ,…,x j ,…,x N ) J is more than or equal to 1 and less than or equal to N. Firstly, filling the value of the missing data by calculating the average value of the outlet pressure values at the same time point three days before the value of the missing data in the data obtained in the step one. Then, the original time sequence data set obtained in the step one is processed by using a dispersion normalization method, so as to obtain a normalized time sequence data set X ' = (X ') ' 1 ,x′ 2 ,…,x′ j ,…,x′ N ),x′ j ∈[0,1]The formula is as follows:
Figure BDA0004036919350000091
wherein x is j For the j-th raw data, x' j For the j-th normalized time series data, min 1≤j≤N {x j The minimum value in the training data set, max 1≤j≤N {x j -represents the maximum value in the training dataset; finally, framing the data set X' by a sliding window method, wherein the sliding window width is l, l is more than or equal to 1 and less than or equal to N, the sliding step length is set to be 1, and the data set Y= (Y) subjected to framing operation at the moment 1 ,y 2 ,…,y N-l+1 ) Wherein y is i =(x′ i ,x′ i+1 ,…,x′ i+l-1 ),1≤i≤N-l+1。
Thirdly, building an LSTM-AE model, inputting preprocessed training data to train the model, and storing the trained model;
the specific process is as follows:
in the LSTM-AE model, the LSTM adopts forget gate screening information, an input gate keeps necessary information and codes, a hidden state is output through an output gate and is transmitted to the next LSTM unit for training, and further data feature extraction is achieved. An LSTM network is constructed on the encoder and decoder of the AE, the encoder taking the high-dimensional input data sequence in the form of a fixed-size vector. With the memory capability of LSTM, the encoder-processed data remains time-sequential data long-dependent while the high-dimensional input vector is compressed into a low-dimensional vector. The structure of the LSTM-AE model is shown in FIG. 2.
The LSTM encoder is mainly used for realizing the encoding process of the LSTM-AE model and learning the rule of time sequence data characteristics. Each time-series data Y of the data Y to be preprocessed i The LSTM cells are sequentially input. The input of a single LSTM unit is a hidden state h obtained by the encoding of the LSTM unit at the previous moment t-1 Temporary cell status
Figure BDA0004036919350000092
And an input unit x 'at the current time' i . The first unit codes to obtain the hidden state h of the current moment t And temporary cellular status->
Figure BDA0004036919350000093
And transmitting to a second unit, wherein the second unit decides whether to retain the information of the first unit, and sequentially transmitting downwards until the last LSTM unit. All data information is output through the last LSTM unit, the output result is Z, and the Z is repeatedly encoded to obtain RV Z1 ,RV Z2 ,…,RV Zl . The encoding process is shown in the LSTM encoder of fig. 2.
The LSTM decoder is mainly used for realizing the decoding process of the LSTM-AE model. The encoder will RV Z1 ,RV Z2 ,…,RV Zl Is passed to the decoder as input to the LSTM unit, respectively. And then reconstructing the output of the (N-l+1) moment by using the decoder, and calculating the hidden state of the (N-l+1) moment, thereby realizing the reconstruction of the time sequence data of the (N-l+1) moment. Sequentially passed until the last LSTM unit is computed. The decoding process is shown in the LSTM decoder of fig. 2.
The original data is subjected to dispersion normalization to obtain an outlet pressure data set X '= (X' 1 ,x′ 2 ,…,x′ j ,…,x′ N ),x′ j ∈[0,1]Carrying out framing operation on the data, and carrying out data y after framing i =(x′ i ,x′ i+1 ,…,x′ i+l-1 ) Inputting i which is more than or equal to 1 and less than or equal to N-l+1 into an LSTM-AE model, and training the model by using a loss function of a reconstruction error calculation model, wherein the reconstructed time sequence data set
Figure BDA0004036919350000101
x′ j Represents the j-th outlet pressure data, n represents x' j Number of reconfigurations, +.>
Figure BDA0004036919350000102
Represents x' j The k time reconstructed outlet pressure data is used for calculating a reconstruction error e between a predicted value of the outlet pressure of the gas pressure regulator and a true value of the outlet pressure of the gas pressure regulator j
Figure BDA0004036919350000103
Figure BDA0004036919350000104
The network parameters are updated using a back propagation algorithm optimization model until the input and output loss functions are minimized.
Figure BDA0004036919350000105
Inputting the preprocessed test data into a trained algorithm model, and inputting l data by using a sliding window as l, so that the (i+1) th data can be predicted, and a predicted value of the outlet pressure of the gas pressure regulator is output;
and fifthly, reconstructing an error between a predicted value of the outlet pressure of the gas pressure regulator and a true value of the outlet pressure of the gas pressure regulator, and calculating a threshold value of the time sequence data by using a dynamic threshold value method.
The specific process is as follows:
from x' j Reconstruction error e of (2) j The calculation method of (1) obtains a reconstruction error sequence: e= (e) 1 ,e 2 ,…,e j ,…,e N ) Exponentially weighted sliding average is performed on e to obtain an error sequence e '= (e' 1 ,e′ 2 ,…,e′ j ,…,e′ N ) The threshold sequence ε is then calculated:
ε=μ(e′)+Z·σ(e′)
wherein μ (·) is the mean, σ (·) is the standard deviation, Z represents the artificially set weight, and error sequence e is reconstructedThe threshold sequence epsilon can be calculated according to the above formula.
Figure BDA0004036919350000106
Calculating f (epsilon) t ):
Figure BDA0004036919350000107
Δμ(e′)=μ(e′)-μ({e∈e′|e<ε t })
Δσ(e′)=σ({e∈e′|e<ε t })
e a ={e∈e′|e>ε t }
Wherein E is seq E is a Such that f (epsilon) t ) The threshold epsilon at which the maximum value is reached is a threshold value, and abnormality detection of time series data is performed based on epsilon.
And step six, detecting the state of the time sequence data of the gas pressure regulator according to the threshold epsilon, and outputting the normal operation state or the abnormal operation state of the gas pressure regulator.
In order to more comprehensively analyze and evaluate abnormal detection results of time sequence data of the gas pressure regulator, accurate (Precision), recall rate (Recall) and F1 value are adopted as evaluation indexes. The accuracy rate refers to the ratio of the data which is predicted to be abnormal to the data which is truly abnormal; recall is the ratio of data predicted to be abnormal among data actually abnormal; the F1 value is the harmonic mean of the precision and recall. The calculation formulas of the three evaluation indexes are as follows:
Figure BDA0004036919350000111
Figure BDA0004036919350000112
Figure BDA0004036919350000113
precision is the Precision, recall is the Recall, TP represents the number of abnormal data predicted as abnormal data; FP represents the number of abnormal data predicted from normal data; FN represents the number of abnormal data predicted as normal data.
The foregoing describes in detail preferred embodiments of the present invention. It should be understood that numerous modifications and variations can be made in accordance with the concepts of the invention by one of ordinary skill in the art without undue burden. Therefore, all technical solutions which can be obtained by logic analysis, reasoning or limited experiments based on the prior art by the person skilled in the art according to the inventive concept shall be within the scope of protection defined by the claims.

Claims (10)

1. The method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model is characterized by comprising the following steps of:
s1, collecting outlet pressure data of a medium-low pressure gas pressure regulator;
s2, preprocessing the outlet pressure data of the gas pressure regulator to obtain training data and test data;
s3, building an LSTM-AE model, inputting preprocessed training data to train the model, and storing the trained model;
s4, inputting the preprocessed test data into a trained algorithm model, and outputting a predicted value of the outlet pressure of the gas pressure regulator;
s5, reconstructing an error between a predicted value of the output gas pressure regulator outlet pressure and a true value of the gas pressure regulator outlet pressure, and a threshold epsilon of the time sequence data;
s6, detecting the state of the time sequence data of the gas pressure regulator according to the threshold epsilon, and outputting the normal operation state or the abnormal operation state of the gas pressure regulator.
2. The abnormality detection method for the medium-low pressure fuel gas pressure regulator based on the LSTM-AE-DT model of claim 1, wherein in the step S2, the fuel gas pressure regulation is obtained through the step S1Raw outlet pressure time series training data set x= (X) 1 ,x 2 ,…,x j ,…,x N ) Calculating the average value of the outlet pressure values at the same time point three days before the value of the missing data, and filling the value of the missing data; processing the original time sequence data set obtained in the step S1 by using a deviation normalization method to obtain a normalized time sequence data set X ' = (X ') ' 1 ,x′ 2 ,…,x′ j ,…,x′ N ),x′ j ∈[0,1]The formula is as follows:
Figure FDA0004036919340000011
wherein x is j For the j-th raw data, x' j For the j-th normalized time series data, min 1≤j≤N {x j The minimum value in the training data set, max 1≤j≤N {x j -represents the maximum value in the training dataset; finally, framing the data set X' by a sliding window method, wherein the sliding window width is l, l is more than or equal to 1 and less than or equal to N, the sliding step length is set to be 1, and the data set Y= (Y) subjected to framing operation at the moment 1 ,y 2 ,…,y N-l+1 ) Wherein y is i =(x′ i ,x′ i+1 ,…,x′ i+l-1 ),1≤i≤N-l+1。
3. The method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model according to claim 1, wherein in the step S3, the LSTM network adopts forgetting gate screening information, an input gate retains necessary information and codes, a hidden state is output through an output gate, and the hidden state is transmitted to the next LSTM unit for training, and the data is subjected to characteristic extraction.
4. The method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model according to claim 1, wherein the step S3 constructs the LSTM network on an encoder and a decoder of AE, and the encoder acquires the high-dimensional input data sequence in a vector form with a fixed size.
5. The anomaly detection method for the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model of claim 1, wherein in the step S4, the data y after framing is obtained i =(x′ i ,x′ i+1 ,,x′ i+l-1 ) Inputting the LSTM-AE model for training to obtain a reconstructed time sequence data set
Figure FDA0004036919340000021
6. The anomaly detection method for a medium-low pressure fuel gas pressure regulator based on an LSTM-AE-DT model as set forth in claim 1, wherein in said step S5, a reconstruction error e of a predicted value of the outlet pressure of the fuel gas pressure regulator and a true value of the outlet pressure of the fuel gas pressure regulator is calculated j
Figure FDA0004036919340000022
Figure FDA0004036919340000023
Wherein x' j Represents the j-th outlet pressure data, n represents x' j The number of times of the reconstruction,
Figure FDA0004036919340000024
represents x' j The kth reconstructed outlet pressure data, represented by x' j Reconstruction error e of (2) j The calculation method of (1) obtains a reconstruction error sequence: e= (e) 1 ,e 2 ,…,e j ,…,e N ) Exponentially weighted sliding average is performed on e to obtain an error sequence e '= (e' 1 ,e′ 2 ,…,e′ j ,…,e′ N ) The threshold sequence ε is then calculated:
ε=μ(e′)+Z·σ(e′)
wherein μ (·) is the mean, σ (·) is the standard deviation, Z represents the artificially set weight,
Figure FDA0004036919340000025
calculating f (epsilon) t ):
Figure FDA0004036919340000026
Δμ(e′)=μ(e′)-μ({e∈e′|e<ε t })
Δσ(e′)=σ({e∈e′|e<ε t })
e a ={e∈e′|e>ε t }
Wherein E is seq E is a Such that f (epsilon) t ) The threshold epsilon at which the maximum value is reached is a threshold value, and abnormality detection of time series data is performed based on epsilon.
7. The method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model according to claim 1, wherein in the step S5, the LSTM-AE-DT model is optimized by using a back propagation algorithm, and the network parameters are updated until the input and output loss function L reaches a minimum value, and the loss function L has a formula:
Figure FDA0004036919340000031
wherein e j Is the reconstruction error of the predicted value of the outlet pressure of the gas pressure regulator and the true value of the outlet pressure of the gas pressure regulator.
8. The method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model according to claim 1, wherein in the step S6, the accuracy, the recall rate and the F1 value are adopted as evaluation indexes, and the calculation formula is as follows:
Figure FDA0004036919340000032
Figure FDA0004036919340000033
Figure FDA0004036919340000034
precision is the Precision, recall is the Recall, TP represents the number of abnormal data predicted as abnormal data; FP represents the number of abnormal data predicted from normal data; FN represents the number of abnormal data predicted as normal data.
9. The method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model according to claim 1, wherein the LSTM-AE model in step S3 uses the storage capability of the LSTM to make the data processed by the encoder maintain long dependency of time series data, and simultaneously compress the high-dimensional input vector to the low-dimensional vector.
10. The method for detecting the abnormality of the medium-low pressure gas pressure regulator based on the LSTM-AE-DT model according to claim 1, wherein the step S5 is characterized in that a dynamic threshold method is used for calculating the threshold epsilon of the time series data.
CN202310008710.8A 2023-01-04 2023-01-04 LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method Pending CN116108885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310008710.8A CN116108885A (en) 2023-01-04 2023-01-04 LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310008710.8A CN116108885A (en) 2023-01-04 2023-01-04 LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method

Publications (1)

Publication Number Publication Date
CN116108885A true CN116108885A (en) 2023-05-12

Family

ID=86265000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310008710.8A Pending CN116108885A (en) 2023-01-04 2023-01-04 LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method

Country Status (1)

Country Link
CN (1) CN116108885A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257959A (en) * 2023-05-15 2023-06-13 河北瑞星燃气设备股份有限公司 Analysis method for low-voltage regulator parameters, intelligent terminal and storage medium
CN117591942A (en) * 2024-01-18 2024-02-23 国网山东省电力公司营销服务中心(计量中心) Power load data anomaly detection method, system, medium and equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257959A (en) * 2023-05-15 2023-06-13 河北瑞星燃气设备股份有限公司 Analysis method for low-voltage regulator parameters, intelligent terminal and storage medium
CN116257959B (en) * 2023-05-15 2023-08-08 河北瑞星燃气设备股份有限公司 Analysis method for low-voltage regulator parameters, intelligent terminal and storage medium
CN117591942A (en) * 2024-01-18 2024-02-23 国网山东省电力公司营销服务中心(计量中心) Power load data anomaly detection method, system, medium and equipment
CN117591942B (en) * 2024-01-18 2024-04-19 国网山东省电力公司营销服务中心(计量中心) Power load data anomaly detection method, system, medium and equipment

Similar Documents

Publication Publication Date Title
CN116108885A (en) LSTM-AE-DT model-based medium-low pressure gas pressure regulator abnormality detection method
CN114297910A (en) Aero-engine service life prediction method based on improved LSTM
CN115293280A (en) Power equipment system anomaly detection method based on space-time feature segmentation reconstruction
CN113627091A (en) Device and method for predicting energy load
CN115758290A (en) Fan gearbox high-speed shaft temperature trend early warning method based on LSTM
CN114218872A (en) Method for predicting remaining service life based on DBN-LSTM semi-supervised joint model
WO2023231374A1 (en) Semi-supervised fault detection and analysis method and apparatus for mechanical device, terminal, and medium
CN114781744A (en) Deep learning multi-step long radiance prediction method based on codec
CN116840765B (en) Voltage transformer error state evaluation method based on multivariate time sequence analysis
CN114266201B (en) Self-attention elevator trapping prediction method based on deep learning
CN112257917A (en) Time series abnormal mode detection method based on entropy characteristics and neural network
CN115343784A (en) Local air temperature prediction method based on seq2seq-attention model
CN115766504A (en) Method for detecting cycle time sequence abnormity
CN113779879A (en) Medium-and-long-term electricity utilization abnormity detection method based on LSTM-seq2seq-attention model
CN111881299A (en) Outlier event detection and identification method based on duplicate neural network
CN114581699A (en) Transformer state evaluation method based on deep learning model in consideration of multi-source information
CN117350161A (en) Wind power extreme scene generation method based on condition generation countermeasure network
CN117725399A (en) Encoder load prediction method embedded with long-term and short-term memory cells
CN117992887A (en) Multi-constraint anomaly detection method for wind turbine component working conditions
CN117113202A (en) Power loop energy consumption detection method and equipment based on joint error stacking model
Wu et al. Interval-valued-based stacked attention autoencoder model for process monitoring and fault diagnosis of nonlinear uncertain systems
CN112598186B (en) Improved LSTM-MLP-based small generator fault prediction method
CN117436564A (en) Hydropower unit shafting degradation trend prediction method and device
CN114021469B (en) Method for monitoring one-stage furnace process based on mixed sequence network
CN114298413B (en) Hydroelectric generating set runout trend prediction method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination