Water pipeline operation state anomaly detection method combining reconstruction and prediction model

Through the joint reconstruction and prediction model method, combined with the self-attention mechanism and the bidirectional gating cycle unit, the problem of underutilization of multivariate data correlation and insufficient combination of deep learning models in the prior art is solved, and higher anomaly detection accuracy and robustness are achieved.

CN119807970AActive Publication Date: 2025-04-11HUNAN UNIV

Patent Information

Application Number
CN202510010353.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-04-11
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The existing water pipeline operating status abnormality detection methods fail to fully consider the correlation between multiple data, and fail to effectively combine the advantages of deep learning prediction models and reconstruction models, resulting in insufficient accuracy and robustness of abnormal detection results.

Method used

A joint reconstruction and prediction model is adopted to capture the correlation and time series characteristics between multivariate data acquisition and preprocessing, sequence normalization processing, multivariate feature timing extraction, LSTM-BasedVAE reconstruction model and BiGRU-based prediction model, and a joint training loss function is designed, combining self-attention mechanism and bidirectional gating cycle unit to capture the correlation and time series characteristics between multivariate time series data.

Benefits of technology

It improves the accuracy and robustness of abnormal detection of operating state of water pipelines, and can more effectively capture the correlation between multivariate timing data. Combining the advantages of reconstructing models and predicting models, it enhances the robustness of the model and the accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807970A_ABST
    Figure CN119807970A_ABST
Patent Text Reader

Abstract

The invention provides a water delivery pipeline operation state anomaly detection method combining reconstruction and a prediction model. The method comprises the following steps: firstly, designing a multivariate time sequence feature extractor based on a self-attention mechanism, capturing time sequence association among multivariate data such as high-frequency pressure and flow of pipeline operation, and respectively inputting the obtained features into an LSTM-BasedVAE reconstruction model and a prediction model based on a bidirectional gating cycle unit (BiGRU) by adopting a joint training mode; meanwhile, in order to solve the balance relation between tasks in joint training, a joint training dynamic loss function is designed, and finally the abnormal condition of the pipeline operation state is detected through an abnormal judgment mechanism. According to the method, the relevance between multivariate time series data is fully captured, the advantages of a reconstruction model and a prediction model are combined, and anomaly detection has higher accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for detecting abnormal operation status of a water pipeline by combining reconstruction and prediction models, and belongs to the technical field of deep learning and water data processing. Background Art

[0002] In the field of water data processing technology, abnormality detection of the operating status of water pipelines is a crucial and challenging task. Through abnormality detection, problems in the pipeline can be discovered early, accidents caused by pipeline ruptures or other failures can be prevented, maintenance and replacement costs can be reduced, and the efficiency and reliability of the water system can be improved. Water pipeline operation data has the characteristics of multiple data dimensions, large time span, and large variability. At present, there are three main methods for detecting abnormalities in the operating status of water pipelines: statistical models, machine learning methods, and deep learning methods.

[0003] However, the most commonly used AR series in statistical models, including AR, MA, ARMA, ARIMA and other models, can only capture linear relationships, not nonlinear relationships, and cannot adapt to nonlinear application environments. For machine learning methods, although they can learn nonlinear relationships, they cannot capture the information transmitted by the mixture of long-term and short-term sequences, and cannot perceive the trend of the overall increase or decrease of the time series over time. For deep learning methods, deep learning models have powerful feature capture capabilities and network structures for processing high-dimensional data. For example, long short-term memory networks (LSTM) and gated recurrent units (GRU) are both RNN network-based methods that can capture the long-term dependencies of time series data, predict future data, and then use prediction errors to detect anomalies; or use variational autoencoders (VAEs) to learn the latent space representation of data distribution, reconstruct the time period data to be detected, calculate the reconstruction error, and detect anomalies.

[0004] By summarizing and analyzing the existing water pipeline anomaly detection methods, the existing methods have the following shortcomings: 1) The correlation between multivariate data such as pressure and flow is not fully considered; 2) The advantages of deep learning prediction models and reconstruction models are not fully combined, resulting in the accuracy of anomaly detection results and the robustness of anomaly detection methods need to be improved. Summary of the invention

[0005] In order to solve the above problems existing in the technology of abnormal operation status detection of water pipelines, the present invention provides a method for detecting abnormal operation status of water pipelines by combining reconstruction and prediction models.

[0006] To achieve the above object, the technical solution adopted by the present invention is as follows:

[0007] S1: Multivariate data collection and preprocessing;

[0008] The operation data of the water pipeline includes data of multiple dimensions such as pressure and flow. The data is sent to the server through the online data acquisition instrument. Each data item is preprocessed by time series missing value interpolation, time series denoising and other preprocessing operations to obtain a multivariate data sequence. Where t means there are a total of t consecutive time points of data, and k means the number of variables.

[0009] S2: sequence normalization processing;

[0010] Different types of variables such as pressure and flow often have different numerical ranges. In order to improve the robustness of the model, the time series X of the i-th dimension is i ∈X respectively perform data normalization to eliminate the dimensional influence between different variables. This method uses maximum and minimum normalization to process multivariate data. The calculation formula is as follows:

[0011]

[0012] where x $ Represents the time series X of the i-th dimension i The original data, x represents the time series X of this dimension i The data after data normalization.

[0013] After normalizing the data of each dimension in turn, we get the normalized sequence Divide the sequence X by sliding time window w to obtain sliding window data X t ={x t-w ,…,x t-1}, X t The data at a single time point in is k-dimensional.

[0014] S3: Multivariate feature temporal extraction;

[0015] Design a multivariate time series feature extractor based on self-attention mechanism to extract time information from input time series data. For a time window of w, the number of data variables is k, and the single window data of the input model training is S = {x1, x2, x3, ..., x w}, is a single variable at each time node t=i. t , in the current time window w, other sample data X other ={x1,…,x t-1 ,x t+1 ,,…x w}According to the actual situation, t The influence weights of are different. This paper designs a multivariate time series feature extractor based on the self-attention mechanism. For each time point data, it effectively captures the other time node data Xother The associated weight of it. t After multivariate time series feature extraction, a new time series representation x of the variable containing time series features at other time points is obtained. t ' process as an example, the processing steps of multivariate time series feature extraction specifically include the following:

[0016] 1) Change the variable x t Input to the fully connected network Q and converted into a query t Vector, other variables x in the window i ∈X other Input the fully connected network K respectively and generate the corresponding key i Vector, the formula is as follows

[0017] query t =Q(x t )=W q ·x t +b q

[0018] key i =K(x i )=W k ·x i +b k

[0019] 2) Let query t And the corresponding key i The vectors are multiplied in sequence and the variable x is obtained through a softmax function. t and other variables x i ∈X other The attention weight is as follows:

[0020]

[0021] 3) For variable x t , weight i The vector is weighted summed to represent the aggregated time information of all other variables in the time window, and finally a new time series representation x is obtained. t ′, the formula is as follows

[0022]

[0023] 4) Repeat the above steps to convert the original input S = {x1,…,x t ,…,x w} into a new representation S′={x1′,…,x t ′,…,x′ w}.

[0024] S4: Establish LSTM-BasedVAE reconstruction model and train it;

[0025] The principle of the reconstruction model is to train on normal data, learn the distribution of normal data, reconstruct the data in the process of anomaly detection, and judge the difference between it and the original data. In order to make VAE learn the time dependence of time series, the present invention combines VAE with LSTM, uses LSTM as the encoder of VAE, and uses multi-layer perceptron MLP as the decoder. The input of the reconstruction network is the time series window data x′={x′1,x′2,x′3,…,x′ w}, after being mapped to the latent space Z by the encoder, the decoder remaps the Z vector in the latent space back to the space of the original data, and the output is the reconstructed data r = {r1, r2, r3, ..., r w}, during the reconstruction process, VAE uses a conditional probability distribution p(x t ′|z t ) reconstructs the original input x t ′, where z t The optimization goal of the latent vector representation reconstruction model is to reconstruct the original input x as much as possible. t ′, which requires a posterior distribution p(z t |x t ′), the calculation formula is as follows:

[0026] p(z t |x t ′)=p(x t ′|z t )·p(z t ) / p(x t ′)

[0027] Where p(x t ′) represents the reconstruction of the original input x t ′, due to x t ′ is a multivariate sample, p(x t ′) is used to reconstruct the joint distribution of multiple single variables, and its calculation formula is as follows:

[0028] p(x t ′)=Ip(z t )p(x t ′|z t )dz t

[0029] In order to calculate the above equation, a q K (z t |x t ′) to approximate the posterior distribution p(z t |xt ′). Finally, the Loss of the reconstruction model Re It is expressed by the following formula:

[0030] Loss Re =Loss re +Loss kL

[0031] Among them, Loss re To maximize the log-likelihood estimate of the reconstructed data, the specific calculation formula is as follows:

[0032]

[0033] Loss kL Q K (z t |x t ′) and p(z t ), the specific calculation formula is as follows:

[0034] Loss kL =KL(q K (z t |x t ′)||p(z t )A

[0035] S5: Establish a prediction model based on a bidirectional gated recurrent unit (BiGRU) and train it;

[0036] The principle of the prediction model is to directly predict the data at the next time point based on historical data, and then compare the predicted value at the next time point with the actual value to identify anomalies. The present invention uses a prediction model based on a bidirectional gated recurrent unit (BiGRU), adding a reverse GRU layer on the basis of GRU, taking into account the past and future information of time series data at the same time, and using the context information to better capture the time series characteristics. Input data x t 'After forward propagation GRU unit, we get vector After back-propagation GRU' unit, we get the vector Then, after a multi-layer perceptron (MLP), the final prediction result f′={f1′,f2′,f3′,…,f t ′}, the relevant formula is as follows:

[0037]

[0038] Finally, using the true value f = {f1,f2,f3,…,f t} and predicted value f′={f1′,f2′,f3′,…,f tThe root mean square error RMSE between ′} is used as the prediction model error Loss Fore , the calculation formula is as follows:

[0039]

[0040] S6: Design joint training loss function;

[0041] The total loss function is a combination of the reconstruction model and prediction model loss functions. A common approach is to directly set two weights based on the contributions of the reconstruction task and the prediction task. The weight parameters set in this approach are static and cannot fully tap the dynamic correlation between the two. The present invention designs a joint training loss function, adds the task weight coefficient to the network, and can dynamically learn the correlation between the two tasks. The formula is as follows:

[0042]

[0043] Among them, Loss Re Represents the loss function of the reconstruction model, Loss Fore Represents the loss function of the prediction model, c1 and c2 are parameters learned by the network and may be negative.

[0044] S7: abnormal judgment;

[0045] Assume that the time series data to be detected is the data at time t. For the reconstruction module, the input of the model is the data X of time window w. t ={x t-w+1 ,…,x t}, the output is The last term is the reconstructed value at time step t For the prediction module, the input of the model is the historical data X with a time window of w. t ={x t-w ,…,x t-1}, the output is the inferred value for the next time step t The original data at time t is x t , the anomaly score design is shown in the formula:

[0046]

[0047] Among them, λ1,λ2∈(0,1) are hyperparameters for adjusting the reconstruction results and prediction results. The POT algorithm is used to find the optimal threshold in the test set. If the score is greater than the optimal threshold, it is considered that the data at the current time point is abnormal, otherwise, it is considered that no abnormality has occurred.

[0048] Beneficial effects:

[0049] The present invention proposes a method for detecting abnormal operation status of a water pipeline by a joint reconstruction and prediction model, which belongs to the technical field of deep learning and water data processing, and includes steps such as multivariate data collection and preprocessing, sequence normalization processing, multivariate feature extraction, reconstruction model training, prediction model training, joint training loss function design, and abnormality judgment. The present invention first designs a multivariate time series feature extractor based on a self-attention mechanism to capture the time series association between multivariate data such as high-frequency pressure and flow of pipeline operation, and adopts a joint training mode to input the acquired features into the LSTM-BasedVAE reconstruction model and the prediction model based on the bidirectional gated recurrent unit (BiGRU) respectively. At the same time, in order to solve the balance relationship between tasks in the joint training, the present invention designs a joint training dynamic loss function, and finally detects the abnormal situation of the pipeline operation status through the abnormal judgment mechanism. The present invention fully captures the correlation between multivariate time series data, combines the advantages of the reconstruction model and the prediction model, and the abnormality detection has higher accuracy and robustness.

[0050] In summary, compared with the traditional water pipeline operation status abnormality detection method, the present invention can capture the time series correlation between the high-frequency pressure and flow data of pipeline operation, fully combine the advantages of the prediction model and the reconstruction model, and further improve the robustness of the model and the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 It is the overall flow chart of the present invention;

[0052] Figure 2 It is the algorithm flow chart of the present invention;

[0053] Figure 3 This is a structural diagram of the multivariate temporal feature extractor based on the self-attention mechanism of the present invention. DETAILED DESCRIPTION

[0054] The following is combined with Figure 1-3 The present invention is further illustrated with examples.

[0055] Embodiment 1:

[0056] A water pipeline operation status anomaly detection method based on joint reconstruction and prediction model, such as Figure 1 As shown, the method comprises the following steps:

[0057] S1: The water pipeline operation data, including pressure, flow and other dimensional data, is sent to the server through the online data acquisition instrument. Each data item is preprocessed by time series missing value interpolation, time series denoising and other preprocessing operations to obtain a multivariate data sequence. Where t means there are a total of t consecutive time points of data, and k means the number of variables.

[0058] S2: Different types of variables such as pressure and flow often have different numerical ranges. In order to improve the robustness of the model, the time series X of the i-th dimension is i ∈X respectively perform data normalization to eliminate the dimensional influence between different variables. This method uses maximum and minimum normalization to process multivariate data. The calculation formula is as follows:

[0059]

[0060] where x $ Represents the time series X of the i-th dimension i The original data, x represents the time series X of this dimension i The data after data normalization.

[0061] After normalizing the data of each dimension in turn, we get the normalized sequence Divide the sequence X by sliding time window w to obtain sliding window data X t ={x t-w ,…,x t-1}, X t The data at a single time point in is k-dimensional.

[0062] S3: Design a multivariate time series feature extractor based on self-attention mechanism to extract time information from input time series data. For a time window of w, the number of data variables is k, and the single window data of the input model training is X = {x1, x2, x3, ..., x w}, is a single variable at each time node t=i. t , in the current time window w, other sample data X other ={x1,…,x t-1 ,x t+1 ,,…x w}According to the actual situation, t The influence weights of are different. This paper designs a multivariate time series feature extractor based on the self-attention mechanism. For each time point data, it effectively captures the other time node data X other The associated weight of it. t After multivariate time series feature extraction, a new time series representation x of the variable containing time series features at other time points is obtained. t ' process as an example, the processing steps of multivariate time series feature extraction specifically include the following:

[0063] 1) Change the variable x t Input to the fully connected network Q and converted into a query tVector, other variables x in the window i ∈X other Input the fully connected network K respectively and generate the corresponding key i Vector, the formula is as follows

[0064] query t =Q(x t )=W5·x t +b5

[0065] key i =K(x i )=W k ·x i +b k

[0066] 2) Let query t And the corresponding key i The vectors are multiplied in sequence and the variable x is obtained through a softmax function. t and other variables x i ∈X other The attention weight is as follows:

[0067]

[0068] 3) For variable x t , key i The vector is weighted summed to represent the aggregated time information of all other variables in the time window, and finally a new time series representation x is obtained. t ′, the formula is as follows

[0069]

[0070] 4) Repeat the above steps to convert the original input S = {x1,…,x t ,…,x w} into a new representation S′={x1′,…,x t ′,…,x′ w}.

[0071] S4: Establish LSTM-BasedVAE reconstruction model, train on normal data, learn the distribution of normal data, reconstruct data in the process of anomaly detection, and judge the difference between it and the original data. Combine VAE with LSTM, use LSTM as the encoder of VAE, and use multi-layer perceptron MLP as the decoder. The input of the reconstruction network is the time series window data x′={x′1,x′2,x′3,…,x′ w}, after being mapped to the latent space Z by the encoder, the decoder remaps the Z vector in the latent space back to the space of the original data, and the output is the reconstructed data r = {r1, r2, r3, ..., r w}, during the reconstruction process, VAE uses a conditional probability distribution p(x t ′|z t ) reconstructs the original input x t ′, where z t The optimization goal of the latent vector representation reconstruction model is to reconstruct the original input x as much as possible. t ′, which requires a posterior distribution p(z t |x t ′), the calculation formula is as follows:

[0072] p(z t |x t ′)=p(x t ′|z t )·p(z t ) / p(x t ′)

[0073] Where p(x t ′) represents the reconstruction of the original input x t ′, due to x t ′ is a multivariate sample, p(x t ′) is used to reconstruct the joint distribution of multiple single variables, and its calculation formula is as follows:

[0074] p(x t ′)=Ip(z t )p(x t ′|z t )dz t

[0075] In order to calculate the above equation, a q K (z t |x t ′) to approximate the posterior distribution p(z t |x t ′). Finally, the Loss of the reconstruction model Re It is expressed by the following formula:

[0076] Loss Re =Loss re +Loss kL

[0077] Among them, Loss re To maximize the log-likelihood estimate of the reconstructed data, the specific calculation formula is as follows:

[0078]

[0079] Loss kL Q K (z t |x t ′) and p(z t ), the specific calculation formula is as follows:

[0080] Loss kL =KL(q K (z t |x t ′)||p(z t )A

[0081] S5: Establish a prediction model based on BiGRU, directly predict the data at the next time point based on historical data, and then compare the predicted value at the next time point with the actual value to identify anomalies. The present invention uses a prediction model based on BiGRU, adds a reverse GRU layer on the basis of GRU, considers the past and future information of time series data at the same time, and uses the context information to better capture the time series features. Input data x t 'After forward propagation GRU unit, we get vector After back-propagation GRU' unit, we get the vector Then, after a multi-layer perceptron (MLP), the final prediction result f′={f1′,f2′,f3′,…,f t ′}, the relevant formula is as follows:

[0082]

[0083] Finally, using the true value f = {f1,f2,f3,…,f t} and predicted value f′={f1′,f2′,f3′,…,f t The root mean square error RMSE between ′} is used as the prediction model error Loss Fore , the calculation formula is as follows:

[0084]

[0085] S6: Design a joint training loss function, add the task weight coefficient to the network, and dynamically learn the correlation between the two tasks. The formula is as follows:

[0086]

[0087] Among them, Loss Re Represents the loss function of the reconstruction model, Loss ForeRepresents the loss function of the prediction model, c1 and c2 are parameters learned by the network and may be negative.

[0088] S7: Assume that the time series data to be detected is the data at time t. For the reconstruction module, the input of the model is the data X of time window w. t ={x t-w+1 ,…,x t}, the output is The last term is the reconstructed value at time step t For the prediction module, the input of the model is the historical data X with a time window of w. t ={x t-w ,…,x t-1}, the output is the inferred value for the next time step t The original data at time t is x t , the anomaly score design is shown in the formula:

[0089]

[0090] where λ1,λ - ∈(0,1) is a hyperparameter for adjusting the reconstruction results and the prediction results. The POT algorithm is used to find the optimal threshold in the test set. If the score is greater than the optimal threshold, it is considered that the data at the current time point is abnormal, otherwise, it is considered that no abnormality has occurred.

[0091] Embodiment 2:

[0092] See also Figures 1 to 3 , a water pipeline operation status abnormality detection method based on joint reconstruction and prediction model, comprising the following steps:

[0093] S1: The operating data of multiple dimensions such as pressure and flow of the water pipeline are sent to the server through the online data acquisition instrument, and each data is preprocessed by time series missing value interpolation, time series denoising and other preprocessing operations in turn to obtain a multivariate data sequence Where t means there are a total of t consecutive time points of data, and k means the number of variables.

[0094] S2: Different types of variables such as pressure and flow often have different numerical ranges. In order to improve the robustness of the model, data normalization is performed on the time series of each dimension in turn to eliminate the dimensional influence between different variables and obtain the normalized series Divide the sequence X by sliding time window w to obtain sliding window data X t ={x t-w ,…,x t-1}.

[0095] S3: Design a multivariate time series feature extractor based on the self-attention mechanism to extract time information from the input time series data. For each time point data, effectively capture the data of other time nodes X other The weight associated with it.

[0096] S4: Establish an LSTM-BasedVAE reconstruction model, train it on normal data, learn the distribution of normal data, and reconstruct the data during anomaly detection. The loss function of the reconstruction model is Loss Re .

[0097] S5: Establish a prediction model based on the bidirectional gated recurrent unit (BiGRU), and the loss function of the prediction model is Loss Fore .

[0098] S6: The present invention designs a joint training loss function, adds the task weight coefficient to the network, and can dynamically learn the correlation between the two tasks. The joint loss function is Loss.

[0099] S7: Assume that the time series data to be detected is the data at time t, and the reconstruction value of the reconstruction model at time step t is The inferred value of the prediction model at time step t is The original data at time t is x t , the anomaly score is Score, and the POT algorithm is used to find the optimal threshold in the test set. If the Score is greater than the optimal threshold, it is considered that the data at the current time point has an anomaly, otherwise, it is considered that no anomaly has occurred.

[0100] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for detecting abnormal operation status of a water pipeline by combining reconstruction and prediction models, characterized in that: The following steps are involved: S1: The operating data of multiple dimensions such as pressure and flow of the water pipeline are sent to the server through the online data acquisition instrument, and each data is preprocessed by time series missing value interpolation, time series denoising and other preprocessing operations to obtain a multivariate data sequence. Where t means there are a total of t consecutive time points of data, and k means the number of variables; S2: Different types of variables such as pressure and flow often have different numerical ranges. In order to improve the robustness of the model, data normalization is performed on the time series of each dimension in turn to eliminate the dimensional influence between different variables and obtain the normalized series Divide the sequence X by sliding time window w to obtain sliding window data X t ={x t-w ,…,x t-1 }; S3: Design a multivariate time series feature extractor based on the self-attention mechanism to extract time information from the input time series data. For each time point data, effectively capture the data of other time nodes X other The weight of its association; S4: Establish an LSTM-BasedVAE reconstruction model, train it on normal data, learn the distribution of normal data, and reconstruct the data during anomaly detection. The loss function of the reconstruction model is loss Re . S5: Establish a prediction model based on the bidirectional gated recurrent unit (BiGRU), and the loss function of the prediction model is Loss Fore ; S6: The present invention designs a joint training loss function, adds the task weight coefficient to the network, and can dynamically learn the correlation between the two tasks. The joint loss function is Loss; S7: Assume that the time series data to be detected is the data at time t. For the reconstruction module, the input of the model is the data X of time window w. t ={x t-w+1 ,…,x t }, the output is The last term is the reconstructed value at time step t For the prediction module, the input of the model is the historical data X with a time window of w. t ={x t-w ,…,x t-1 }, the output is the inferred value for the next time step t The original sample data at time t is x t , the anomaly score is Score, and the POT algorithm is used to find the optimal threshold in the test set. If the Score is greater than the optimal threshold, it is considered that the data at the current time point has an anomaly, otherwise, it is considered that no anomaly has occurred.

2. The method for detecting abnormal operation status of a water pipeline according to claim 1, characterized in that: In S2, for the time series X of the i-th dimension i ∈X respectively perform data normalization to eliminate the dimensional influence between different variables. This method uses maximum and minimum normalization to process multivariate data. The calculation formula is as follows: Where x0 represents the time series X of the i-th dimension i The original data, x represents the time series X of this dimension i The data after data normalization. After normalizing the data of each dimension in turn, we get the normalized sequence Divide the sequence X by sliding time window w to obtain sliding window data X t ={x t-w ,…,x t-1 }, X t The data at a single time point in is k-dimensional.

3. The method for detecting abnormal operation status of a water pipeline according to claim 1, characterized in that: In S3, the time window is w, the number of data variables is k, and the single window data input for model training is X = {x1, x2, x3, ..., x w }, is a single variable at each time node t=i. t , in the current time window w, other sample data X other ={x1,…,x t-1 ,x t+1 ,,…x w }According to the actual situation, t The influence weights of are different. This paper designs a multivariate time series feature extractor based on the self-attention mechanism. For each time point data, it effectively captures the other time node data X other The associated weight of it. t After multivariate time series feature extraction, a new time series representation x′ is obtained, which contains the time series features of other time points. t Taking the process as an example, the processing steps of multivariate time series feature extraction specifically include: the following: 1) Set the variable x t Input to the fully connected network Q and converted into a query t Vector, other variables x in the window i ∈X other Input the fully connected network K respectively and generate the corresponding key i Vector, the formula is as follows query t =Q(x t )=W5·x t +b5 key i =K(x i )=W k ·x i +b k 2) Let query t And the corresponding key i The vectors are multiplied in sequence and the variable x is obtained through a softmax function. t and other variables x i ∈X other The attention weight is as follows: 3) For variable x t , key i The vector is weighted summed to represent the aggregated time information of all other variables in the time window, and finally a new time series representation x′ is obtained. t , the formula is as follows 4) Repeat the above steps to convert the original input S = {x1,…,x t ,…,x w } is transformed into a new representation S′={x′1,…,x′ t ,…,x′ w }.

4. The method for detecting abnormal operation status of a water pipeline according to claim 1, characterized in that: In S4, the reconstruction model uses LSTM as the encoder of VAE and uses multi-layer perceptron MLP as the decoder. The input of the reconstruction network is the time series window data x′={x′1,…,x′ t ,…,x′ w }, after being mapped to the latent space Z by the encoder, the decoder remaps the Z vector in the latent space back to the space of the original data, and the output is the reconstructed data r = {r1,…,r t ,…,r w }, during the reconstruction process, VAE uses a conditional probability distribution p(x′ t |z t ) Reconstruct the original input x′ t , where z t The optimization goal of the latent vector representation reconstruction model is to reconstruct the original input x′ as much as possible. t , which requires a posterior distribution p(z t |x′ t ), the calculation formula is as follows: p(z t |x′ t )=p(x′ t |z t )·p(z t ) / p(x′ t ) where p(x′ t ) represents the reconstruction of the original input x′ t The probability of x′ t is a multivariate sample, p(x′ t ) is used to reconstruct the joint distribution of multiple single variables, and its calculation formula is as follows: p(x′ t )=Ip(z t )p(x′ t |z t )dz t In order to calculate the above equation, a q K (z t |x′ t ) to approximate the posterior distribution p(z t |x′ t ). Finally, the Loss of the reconstruction model Re It is expressed by the following formula: Loss Re =Loss re +Loss kL Among them, Loss re To maximize the log-likelihood estimate of the reconstructed data, the specific calculation formula is as follows: Loss re =-E 5N [logp(x′ t |z t )] Loss kL Q K (z t |x′ t ) and p(z t ), the specific calculation formula is as follows: Loss kL =KL(q K (z t |x′ t )||p(z t )A 5. The method for detecting abnormal operation status of a water pipeline according to claim 1, characterized in that: In S5, the present invention uses a prediction model based on a bidirectional gated recurrent unit (BiGRU), adds a reverse GRU layer on the basis of GRU, considers the past and future information of the time series data, and uses the context information to better capture the time series features. Input data x′ t After forward propagation of the GRU unit, we get the vector After back-propagation GRU' unit, we get the vector Then, after a multi-layer perceptron (MLP), the final prediction result f′={f′1,f′2,f′3,…,f′ t }, the relevant formula is as follows: Finally, using the true value f = {f1,f2,f3,…,f t } and predicted value f′={f′1,f′2,f′3,…,f′ t The root mean square error RMSE between} is used as the prediction model error Loss Fore , the calculation formula is as follows:

6. The method for detecting abnormal operation status of a water pipeline according to claim 1, characterized in that: In S6, the method of artificially setting the weights of the reconstruction task and the prediction task is abandoned, and a joint training loss function is designed to add the task weight coefficient to the network, which can dynamically learn the correlation between the two tasks. The formula is as follows: Among them, Loss Re Represents the loss function of the reconstruction model, Loss Fore Represents the loss function of the prediction model, c1 and c2 are parameters learned by the network and may be negative.

7. The method for detecting abnormal operation status of a water pipeline according to any one of claims 1 to 6, characterized in that: In S7, it is assumed that the time series data to be detected is the data at time t. For the reconstruction module, the input of the model is the data X of the time window w. t ={x t-w+1 ,…,x t }, the output is The last term is the reconstructed value at time step t For the prediction module, the input of the model is the historical data X with a time window of w. t ={x t-w ,…,x t-1 }, the output is the inferred value for the next time step t The original data at time t is x t , the anomaly score design is shown in the formula: where λ1,λ - ∈(0,1) is a hyperparameter for adjusting the reconstruction results and the prediction results. The POT algorithm is used to find the optimal threshold in the test set. If the score is greater than the optimal threshold, it is considered that the data at the current time point is abnormal, otherwise, it is considered that no abnormality has occurred.

Citation Information

Patent Citations

  • Time sequence anomaly detection method based on SA-GAN architecture

    CN115185937A

  • Method and terminal for detecting time series data exception by combining attention mechanism and LSTM (Long Short Term Memory)

    CN115983087A

  • Water supply pipeline operation data anomaly detection method

    CN116842323A

  • Abnormality detection and positioning method and device for multivariate time series data

    CN117076171A

  • Time sequence anomaly detection method and system based on hypergraph attention network

    CN117290800A

Cited By

  • Abnormal flow detection method and system based on industrial process space-time modeling

    CN120434042A

  • System operation multivariate time series data anomaly detection method and electronic equipment

    CN122310382A