Joint reconstruction and prediction model for anomaly detection of water pipeline operational status

Through the self-attention mechanism and joint training loss function, combined with the LSTM-Based VAE and BiGRU models, the problem of unconsidered multivariate data association in the abnormal detection of water pipeline operation status is solved, and higher detection accuracy and robustness are achieved.

CN119807970BActive Publication Date: 2025-10-10HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing anomaly detection methods for water pipeline operation status fail to fully consider the correlation between multivariate data and fail to effectively combine the advantages of deep learning prediction models and reconstruction models, resulting in insufficient accuracy and robustness of anomaly detection results.

Method used

A multivariate temporal feature extractor based on the self-attention mechanism is adopted, combined with an LSTM-Based VAE reconstruction model and a prediction model based on a bidirectional gated recurrent unit (BiGRU). A joint training loss function is designed to dynamically learn the correlation between tasks and detect anomalies through an anomaly judgment mechanism.

Benefits of technology

The accuracy and robustness of water pipeline operation status anomaly detection are improved, the correlation between multivariate time series data is fully captured, and the advantages of reconstruction models and prediction models are combined to improve the accuracy and reliability of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807970B_ABST
    Figure CN119807970B_ABST
Patent Text Reader

Abstract

The application provides a water pipeline operation state anomaly detection method combining a reconstruction model and a prediction model. The application first designs a multivariate time series feature extractor based on a self-attention mechanism to capture the time series correlation between multivariate data such as high-frequency pressure and flow of pipeline operation, adopts a joint training mode, and inputs the obtained features into an LSTM-Based VAE reconstruction model and a prediction model based on a bidirectional gated recurrent unit (BiGRU). Meanwhile, in order to solve the balance relationship between tasks in joint training, the application designs a joint training dynamic loss function, and finally detects the abnormality of the pipeline operation state through an anomaly evaluation mechanism. The application fully captures the correlation between multivariate time series data, combines the advantages of the reconstruction model and the prediction model, and has higher accuracy and robustness in anomaly detection.
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 utility data processing, detecting anomalies in the operational status of water pipelines is a crucial and challenging task. This anomaly detection allows for early detection of pipeline problems, preventing accidents caused by ruptures or other failures, reducing repair and replacement costs, and improving the efficiency and reliability of water utility systems. Water pipeline operational data is characterized by multiple dimensions, large time spans, and high variability. Currently, there are three main approaches to detecting anomalies in water pipeline operations: statistical models, machine learning, and deep learning.

[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 are therefore unsuitable for nonlinear application environments. While machine learning methods can learn nonlinear relationships, they cannot capture the information conveyed by a mixture of long-term and short-term sequences, nor can they perceive the overall trend of a time series increasing or decreasing over time. Deep learning methods possess powerful feature capture capabilities and network structures for processing high-dimensional data. For example, long short-term memory networks (LSTMs) and gated recurrent units (GRUs) are both RNN-based methods that can capture long-term dependencies in time series data, predict future data, and then use prediction errors to detect anomalies. Alternatively, a variational autoencoder (VAE) can be used to learn a latent space representation of the data distribution, reconstruct the data for the time period to be tested, 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) they do not fully consider the correlation between multivariate data such as pressure and flow; 2) they do not fully combine the advantages of deep learning prediction models and reconstruction models, 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] In order 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 water pipeline operation data 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 represents a total of t consecutive time points of data, and k represents 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, the normalized sequence is obtained Divide the sequence X by the sliding time window w to obtain the 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] A multivariate time series feature extractor based on self-attention mechanism is designed 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 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. Take a single variable x t After multivariate time series feature extraction, the new time series representation x of the variable containing the time series features of other time points is obtained. t Taking the process of ′ as an example, the processing steps of multivariate time series feature extraction specifically include the following:

[0016] 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 Enter 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} is transformed 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 dependency 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 the encoder, it is mapped to the latent space Z, and 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 ) 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 ′), and its 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. This paper 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 both past and future information of time series data, and using contextual information to better capture time series features. Input data x t 'The vector is obtained by forward propagation GRU unit After back propagation GRU' unit obtains 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 values ​​f′={f1′,f2′,f3′,…,f t′} 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 manually set two weights based on the contributions of both the reconstruction task and the prediction task. This approach sets static weight parameters and cannot fully exploit the dynamic correlation between the two tasks. This paper designs a joint training loss function that adds task weight coefficients to the network, which 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 the time window w. t ={x t-w+1 ,…,x t}, the output is The last item 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 of 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 an anomaly has occurred in the data at the current time point. Otherwise, it is considered that no anomaly has occurred.

[0048] Beneficial effects:

[0049] The present invention proposes a method for detecting abnormal operation status of a water pipeline based on a joint reconstruction and prediction model, which belongs to the field of deep learning and water data processing technology, and includes the steps of multivariate data collection and preprocessing, sequence normalization processing, multivariate feature extraction, reconstruction model training, prediction model training, joint training loss function design, and anomaly judgment. The present invention first designs a multivariate time series feature extractor based on a self-attention mechanism to capture the time series correlation between multivariate data such as high-frequency pressure and flow in 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). 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 abnormal conditions of the pipeline operation status through an anomaly 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 has higher accuracy and robustness in anomaly detection.

[0050] In summary, compared with the traditional method for detecting abnormal operation status of water pipelines, the present invention can capture the temporal 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 includes the following steps:

[0057] S1: The water pipeline operation data, including pressure, flow and other dimensions, 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 represents a total of t consecutive time points of data, and k represents 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, the normalized sequence is obtained Divide the sequence X by the sliding time window w to obtain the 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 the self-attention mechanism to extract time information from the 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 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. Take a single variable x t After multivariate time series feature extraction, the new time series representation x of the variable containing the time series features of other time points is obtained. t Taking the process of ′ as an example, the processing steps of multivariate time series feature extraction specifically include the following:

[0063] 1) Set 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 Enter 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} is transformed into a new representation S′={x1′,…,x t ′,…,x′ w}.

[0071] S4: Establish an LSTM-Based VAE reconstruction model, train it on normal data, learn the distribution of normal data, reconstruct the data during 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 the encoder, it is mapped to the latent space Z, and 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 ) 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 ′), and its 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 the Bidirectional Gated Recurrent Unit (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. This invention uses a prediction model based on the Bidirectional Gated Recurrent Unit (BiGRU), adding a reverse GRU layer on the basis of GRU, taking into account both the past and future information of the time series data, and using the context information to better capture the time series features. Input data x t 'The vector is obtained by forward propagation GRU unit After back propagation GRU' unit obtains 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 values ​​f′={f1′,f2′,f3′,…,f t ′} is used as the prediction model error Loss Fore , the calculation formula is as follows:

[0084]

[0085] S6: Design a joint training loss function to add task weight coefficients to the network, which can 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 in time window w. t ={x t-w+1 ,…,x t}, the output is The last item 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 of 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 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] Example 2:

[0092] See also Figures 1 to 3 A method for detecting abnormal operation status of a water pipeline by combining reconstruction and prediction models comprises 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. 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 represents a total of t consecutive time points of data, and k represents 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 effects between different variables and obtain the normalized series. Divide the sequence X by the sliding time window w to obtain the 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, it effectively captures the other time node data 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), the loss function of which 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 an anomaly has occurred in the data at the current time point, otherwise, it is considered that no anomaly has occurred.

[0100] Although the embodiments of the present invention have been described with reference to 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 of pressure and flow of the water pipeline are sent to the server through the online data acquisition instrument, and each data is interpolated with missing values ​​in time series and pre-processed with time series denoising to obtain a multivariate data sequence. ,in Indicates a total of Data at consecutive time points, Indicates 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 effects between different variables and obtain the normalized series. , through a sliding time window Pair Sequence Divide and obtain sliding window data ; 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, it effectively captures the data of other time nodes. The associated weight of it; 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 ; S5: Establish a prediction model based on bidirectional gated recurrent unit. The loss function of this prediction model is ; 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 joint loss function is ; S7: Assume that the time series data to be detected is For the reconstruction module, the input of the model is the time window Data , the output is , the last item is the time step The reconstruction value of ; For the prediction module, the input of the model is the time window Historical data , the output is the next time step The inferred value of , the original sample The time data is , the anomaly score is , use the POT algorithm to find the optimal threshold in the test set, if If it is greater than the optimal threshold, then it is considered that the data at the current time point has an abnormality, otherwise, it is considered that no abnormality has occurred; in S3, the time window is w, the number of data variables is k, and the single window data for input model training is , is a single variable at each time node t=i; , in the current time window w, other sample data According to the actual situation, The influence weights 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 data of other time nodes. The associated weight of a single variable After multivariate time series feature extraction, a new time series representation of the variable containing time series features of other time points is obtained. Taking the process as an example, the processing steps of multivariate time series feature extraction specifically include: the following: 1) Set the variable Input to the fully connected network Q and transform it into a Vector, other variables in the window Input the fully connected network K respectively to generate the corresponding Vector, the formula is as follows ; ; 2) Let and the corresponding The vectors are multiplied in sequence and the variables are obtained through a softmax function. and other variables The attention weight is as follows: ; 3) For variables ,Will 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 is obtained. , the formula is as follows ; 4) Repeat the above steps to convert the original input Transformed into a new representation that incorporates temporal feature information ; In S4, the reconstruction model uses LSTM as the encoder of VAE and multi-layer perceptron MLP as the decoder; the input of the reconstruction network is the time series window data , after the encoder, it is mapped to the latent space Z, and 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 , during the reconstruction process, VAE uses a conditional probability distribution Reconstructing the original input ,in The optimization goal of the latent vector representation reconstruction model is to reconstruct the original input as much as possible , which requires a posterior distribution , the calculation formula is as follows: ; in Reconstructing the original input The probability of is a multivariate sample, To reconstruct the joint distribution of multiple single variables, the calculation formula is as follows: ; In order to calculate the above equation, we introduce a To approximate the posterior distribution ; Finally, rebuild the model It is expressed by the following formula: ; in, To maximize the log-likelihood estimate of the reconstructed data, the specific calculation formula is as follows: ; for and The KL divergence between them is calculated as follows: ; In S5, a prediction model based on a bidirectional gated recurrent unit is used, and a reverse GRU layer is added on the basis of the GRU. The past and future information of the time series data is considered at the same time, and the context information is used to better capture the time series characteristics. Input Data After forward propagation of GRU unit, we get vector , after back-propagation GRU' unit, we get the vector , and then pass through a multi-layer perceptron to get the final prediction result , the relevant formula is as follows: ; ; ; Finally, using the true value and predicted values The root mean square error RMSE between the two is used as the prediction model error , the calculation formula is as follows: ; In S6, the method of manually setting the weights of the reconstruction task and the prediction task is abandoned. Instead, 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: ; in represents the loss function of the reconstruction model, represents the loss function of the prediction model, and are parameters learned by the network.

2. The method for detecting abnormal operation status of a water pipeline according to claim 1, wherein: In the above S2, Time series of dimensions Data normalization is performed separately to eliminate the dimensional effects between different variables. This method uses maximum and minimum normalization to process multivariate data. The calculation formula is as follows: ; in Indicates the Time series of dimensions The original data, Represents the time series of this dimension Data after data normalization; After normalizing the data of each dimension in turn, the normalized sequence is obtained , through a sliding time window Pair Sequence Divide and obtain sliding window data , The data for a single time point is Dimensional.

3. The method for detecting abnormal operation status of a water pipeline according to any one of claims 1 to 2, characterized in that: In S7, it is assumed that the time series data to be detected is For the reconstruction module, the input of the model is the time window Data , the output is , the last item is the time step The reconstruction value of ; For the prediction module, the input of the model is the time window Historical data , the output is the next time step The inferred value of , The original data at the moment is , the anomaly score design is shown in the formula: ; in In order to adjust the hyperparameters of the reconstruction results and the prediction results, the POT algorithm is used to find the optimal threshold in the test set. If it is greater than the optimal threshold, then it is considered that the data at the current time point has an anomaly; otherwise, it is considered that no anomaly has occurred.

Citation Information

Patent Citations

  • Power grid network flow anomaly detection method, device and equipment and storage medium

    CN118260594A

  • Industrial time sequence anomaly detection method and device and computer equipment

    CN119128760A