Hydrogen delivery pipe network flow anomaly detection method and system based on two-dimensional characteristics
By adopting two-dimensional feature abnormal detection method in the hydrogen transmission pipeline network, adaptive slice and feature extraction are carried out, the problems of high false alarm rate and insufficient flexibility in the traditional methods are solved, and the abnormal flow of the hydrogen transmission pipeline network is realized. Improved precision detection and safety management.
Patent Information
- Application Number
- CN202411183021.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-27
AI Technical Summary
Traditional hydrogen transmission pipeline traffic monitoring methods are prone to false alarms when facing a single sensor failure, and lack flexibility and accuracy when processing multi-sensor data, which increases operation and maintenance costs and manual audit burden.
The flow abnormality detection method of hydrogen transmission pipeline network based on two-dimensional characteristics is adopted. By performing adaptive slices in the time dimension and channel dimensions, the time feature extractor, spatial feature extractor and backbone feature extractor are used to extract features, and through multi-field heavy The network is constructed to perform abnormal scoring to achieve accurate abnormal detection.
Effectively identifying abnormal traffic data in the industrial hydrogen transmission pipeline network improves the level of industrial safety management, reduces false alarm rates and operation and maintenance costs, and improves the flexibility and accuracy of detection.
Smart Images

Figure CN119150186A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field related to pipeline flow detection, and in particular to a method and system for detecting flow anomalies in a hydrogen transmission pipeline network based on dual-dimensional features. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] As a key link in the hydrogen energy industry chain, the hydrogen pipeline network undertakes the important task of transporting hydrogen from production sites to consumption sites. With the growing global demand for clean energy, the construction and optimization of the hydrogen pipeline network has become an important part of hydrogen energy development. Ensuring the stable operation of the hydrogen pipeline network is of great significance to reducing energy costs and improving energy efficiency.
[0004] In the field of flow monitoring and anomaly detection in hydrogen pipeline networks, traditional technologies often adopt the method of independently analyzing the data of each sensor, failing to fully utilize the relationship between sensors. This independent analysis strategy may cause false alarms when facing a single sensor failure, thereby increasing operation and maintenance costs and the burden of manual review. In addition, existing technologies often lack sufficient flexibility and accuracy when processing multi-sensor data with strong correlation. Summary of the invention
[0005] In order to overcome the above-mentioned deficiencies of the prior art, the present invention provides a method and system for detecting abnormal flow in a hydrogen pipeline network based on dual-dimensional features. The method of the present invention can effectively identify abnormal flow data in an industrial hydrogen pipeline network and improve the level of industrial safety management.
[0006] To achieve the above objectives, the first aspect of the present invention provides a method for detecting abnormal flow in a hydrogen transmission pipeline network based on dual-dimensional features, comprising:
[0007] Obtain hydrogen flow data of the hydrogen transmission pipeline network to be tested;
[0008] In the trained anomaly detection network model, the hydrogen flow data of the hydrogen transmission network to be detected is adaptively sliced in the time dimension and the channel dimension to obtain data slices of the same size;
[0009] A time feature extractor is used to extract time features of different data slices in the time slice direction, a spatial feature extractor is used to extract channel features in the dimension slice direction from the extracted time features, and a backbone feature extractor is used to extract backbone features of the channel features;
[0010] Using a reconstruction network composed of multiple sets of hidden layers with different feature scales, the latent representations of the extracted backbone features at different scales are learned to obtain the reconstructed output under multiple fields of view.
[0011] The reconstructed outputs under multiple fields of view are scored for abnormality to obtain anomaly detection results.
[0012] The second aspect of the present invention provides a hydrogen transmission pipeline network flow anomaly detection system based on dual-dimensional features, comprising:
[0013] An acquisition unit, used to acquire hydrogen flow data of the hydrogen transmission network to be detected;
[0014] A slicing unit is used to adaptively slice the acquired hydrogen flow data of the hydrogen transmission network to be detected in the time dimension and the channel dimension in the trained anomaly detection network model to obtain data slices of the same size;
[0015] An extraction unit, used to extract time features of different data slices in the time slice direction using a time feature extractor, extract channel features in the dimension slice direction from the extracted time features using a spatial feature extractor, and extract backbone features of the channel features using a backbone feature extractor;
[0016] A reconstruction unit is used to learn potential representations of different scales for the extracted backbone features using a reconstruction network composed of multiple sets of hidden layers with different feature scales, and obtain reconstruction outputs under multiple fields of view;
[0017] The anomaly detection unit is used to perform anomaly scoring on the reconstructed outputs under the multiple fields of view to obtain anomaly detection results.
[0018] The third aspect of the present invention provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, a method for detecting flow anomalies in a hydrogen pipeline network based on dual-dimensional features is executed.
[0019] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, a method for detecting flow anomalies in a hydrogen transmission pipeline network based on dual-dimensional features is executed.
[0020] One or more of the above technical solutions have the following beneficial effects:
[0021] In the present invention, data slices of the same size are obtained by adaptively slicing in the time dimension and the channel dimension; the feature associations within and between slices are captured using a time feature extractor, a space feature extractor, and a backbone feature extractor; reconstruction under multiple fields of view is performed using a reconstruction network composed of multiple groups of hidden layers with different feature scales, and the reconstruction results are scored for anomalies to achieve accurate anomaly detection; the method of the present invention can effectively identify abnormal flow data in industrial hydrogen transmission pipelines and improve the level of industrial safety management.
[0022] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0024] Figure 1 This is a flowchart of the overall framework of the anomaly detection model in the first embodiment of the present invention;
[0025] Figure 2 This is a flowchart of simulating anomalies in the verification set in Embodiment 1 of the present invention;
[0026] Figure 3 This is a diagram of a dual-dimensional adaptive slicing network structure in Embodiment 1 of the present invention;
[0027] Figure 4 This is a diagram of a cross-level feature interaction network structure in Embodiment 1 of the present invention;
[0028] Figure 5 This is a diagram of a multi-view feature reconstruction network structure in Embodiment 1 of the present invention;
[0029] Figure 6 This is a flow chart of the loss guidance network in the first embodiment of the invention. DETAILED DESCRIPTION
[0030] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0031] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.
[0032] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0033] Embodiment 1
[0034] This embodiment discloses a method for detecting abnormal flow in a hydrogen transmission pipeline network based on dual-dimensional features, including:
[0035] Obtain hydrogen flow data of the hydrogen transmission pipeline network to be tested;
[0036] In the trained anomaly detection network model, the hydrogen flow data of the hydrogen transmission network to be detected is adaptively sliced in the time dimension and the channel dimension to obtain data slices of the same size;
[0037] A time feature extractor is used to extract time features of different data slices in the time slice direction, a spatial feature extractor is used to extract channel features in the dimension slice direction from the extracted time features, and a backbone feature extractor is used to extract backbone features of the channel features;
[0038] Using a reconstruction network composed of multiple sets of hidden layers with different feature scales, the latent representations of the extracted backbone features at different scales are learned to obtain the reconstructed output under multiple fields of view.
[0039] The reconstructed outputs under multiple fields of view are scored for abnormality to obtain anomaly detection results.
[0040] This embodiment ensures the consistency and comparability of different sensor data by adaptively slicing in two dimensions: time and channel. A cross-dimensional feature interaction network and a multi-angle feature reconstruction network are used to capture local information and correlation features between different sensor data, and reconstruct the original time series from different perspectives. A dynamic loss feedback mechanism is designed to dynamically adjust the slice size according to the overall loss of the model, optimizing the model's adaptability and detection performance. Through the application of the scheme of this embodiment, abnormal hydrogen flow in the industrial hydrogen transmission pipeline network will receive timely warnings, ensuring the safety of industrial hydrogen transmission and promoting stable and sustainable development.
[0041] Combine the following Figure 1 The hydrogen transmission pipeline network flow anomaly detection method based on dual-dimensional features proposed in this embodiment is described in detail, specifically including:
[0042] S1. Obtain hydrogen flow data from the industrial hydrogen transmission pipeline network, and select part of the collected data to simulate abnormal conditions through single-point injection method, pattern change method, replication mutation and pulse interference method, and update the modified abnormal labels.
[0043] In S1, the hydrogen flow data of the industrial hydrogen transmission pipeline network is obtained and preprocessed to obtain the training set, validation set and test set, and simulated abnormal situation data is added to the validation set data.
[0044] In a specific implementation, the specific steps of preprocessing the hydrogen flow data of the industrial hydrogen transmission pipeline network and adding the simulated abnormal situation data to the validation set data are:
[0045] Use sensors installed in the hydrogen transmission network to collect hydrogen flow data in real time and store the data in an EXCEL file;
[0046] The collected hydrogen flow data of the hydrogen transmission pipeline network is matched one by one with the label data in EXCEL format, and the obtained data can be expressed as:
[0047] X L ={x1,x2,…x L}
[0048] Among them, x i ∈R c , C represents the number of sensors, that is, the channel dimension size of the time series, and R represents a set of real numbers.
[0049] Convert the EXCEL format label into NPY format label data, where the NPY label data contains the abnormal type of hydrogen flow data of the hydrogen transmission pipeline network;
[0050] The hydrogen flow data of the hydrogen transmission pipeline network collected by each sensor is standardized and normalized to eliminate the influence of dimension, reduce the interference of extreme values and facilitate model training.
[0051] The process of normalizing and standardizing the data at each sensor is described by the following formula.
[0052] standardization:
[0053]
[0054] in, is the standardized data of the ith time point of the eth sensor in the original data set, is the i-th time point of the e-th sensor in the original dataset, μ ( e ) is the mean of the e-th sensor in the original dataset, and σ(e) is the standard deviation of the e-th sensor in the original dataset.
[0055] Normalization:
[0056]
[0057] in, is the normalized data of the ith time point of the eth sensor in the dataset, Z (e) is all the data after standardization on the e-th sensor, min(Z (e)) is the minimum value of the normalized data of the e-th sensor, max(Z (e) ) is the maximum value in the normalized data of the e-th sensor.
[0058] According to the continuity and abnormality of the data, the pre-trained data is divided into training set, validation set and test set. Continuous and non-abnormal data are selected from the processed hydrogen flow data of the hydrogen transmission pipeline network as the training set; continuous and non-abnormal data, as well as simulated abnormal data and abnormal labels are selected as the validation set, where the initial abnormal labels are all 0, and the length is consistent with the number of time series sampling points; continuous data containing abnormal conditions and their corresponding abnormal labels are selected as the test set.
[0059] like Figure 2 As shown, 1% of the data in the validation set is randomly selected and abnormal data is added through the single-point injection method.
[0060] In this embodiment, the process of adding abnormal data to the validation set by the single-point injection method is described by the following formula.
[0061] x' t =x t +α·x t ·∈ (3)
[0062] Among them, x t is the tth time point in the data, x' t is the value after adding the anomaly, α is the noise intensity parameter, and ∈ is a random number drawn from the standard normal distribution N(0,1).
[0063] 2% of the continuous data in the validation set are randomly selected and abnormal data are added through the mode transformation method to simulate the mode transformation anomaly of the data.
[0064] The following formula describes the process of adding abnormal data to the validation set through the pattern transformation method.
[0065]
[0066] Among them, A is the amplitude of the sine wave, f is the frequency, τ is the starting point of the mutation, and T p is the length of the subinterval, is the phase shift.
[0067] 2% of the continuous data in the validation set is randomly selected to add abnormal data through the pulse interference method to simulate the instantaneous mutation of the data.
[0068] The following formula describes the process of adding abnormal data to the validation set through the pulse interference method.
[0069]
[0070] Among them, β is the peak intensity of the pulse, t0 is the starting time point of the pulse, γ is the decay rate, and u(t-t0) is the unit cross-order function.
[0071] 2% of the continuous data in the validation set are randomly selected and abnormal data are added through the replication mutation method to simulate the replication mutation anomaly of the data.
[0072] The following formula describes the process of adding abnormal data to the validation set through the replication mutation method.
[0073]
[0074] Among them, t c is the insertion point of the replication fragment, Δt is the length of the fragment, is a random phase shift.
[0075] The validation set after adding the anomaly is compared point by point with the data in the original validation set. For the time point where the data is inconsistent, the corresponding anomaly label is updated to 1 to indicate the existence of the anomaly.
[0076] In S2-S6, an anomaly detection model is established, which is connected in sequence by a two-dimensional adaptive slicing network, a cross-level feature interaction network, a multi-view feature reconstruction network, and a loss-guided network. The anomaly detection model is trained and optimized through a loss function, and the monitoring data is scored for anomalies using an industrial hydrogen flow anomaly detection network. Among them, the two-dimensional adaptive slicing network is used to generate data slices of the same size, the cross-level feature interaction network is used to extract the features associated within different data slices and between data slices, the multi-view feature reconstruction network is used to reconstruct the original time series, and the loss-guided network is used to dynamically adjust the size of the time slice and channel slice according to the change in loss.
[0077] S2. Build a two-dimensional adaptive slicing network to generate data slices of the same size by adaptively slicing in the time and channel dimensions.
[0078] like Figure 3 As shown, the dual-dimensional adaptive slicing network slices the time dimension and slices the channel dimension through the mode expansion method and the correlation aggregation method.
[0079] In a specific implementation, the dual-dimensional adaptive slicing network in the anomaly detection model aims to reduce the amount of computation while being able to focus on the correlation information between channels with strong correlation, so as to assist the anomaly detection model to better identify abnormal conditions. In order to better slice the time dimension, slice the channel dimension and ensure that each slice is of the same size while aggregating strongly correlated channels, a global volatility index, pattern expansion and correlation aggregation method are introduced. The specific steps of the global volatility index, pattern expansion and correlation aggregation method are as follows:
[0080] The processed time series data X L Perform sequential and non-overlapping slicing in the time dimension, and calculate whether the length of the time series in the time dimension can be divided by the slicing length q. If it cannot be divided, perform random interpolation. The final slicing length q should satisfy the factor of the total number of data in the window after interpolation, otherwise skip this process.
[0081] The global volatility index is calculated based on the characteristics of the time series input each time; then, it is calculated whether the length of the time series in the time dimension can be divided by the slice size. If the division fails, random interpolation is performed, otherwise this step is skipped.
[0082] For the i-th slice with a length of q in the time dimension, the size is The global volatility index is calculated based on the characteristics of the data on the time series data with a sliding window size of W. The formula of the global volatility index is:
[0083]
[0084] Among them, V t is the global volatility indicator, x t is the value of the time series at time t, and W is the sliding window size.
[0085] For slicing in the channel dimension direction, the mode expansion method is first used to expand the channel dimension size, and then the similarity aggregation method is used to aggregate strongly correlated channels, and sequential and non-overlapping slicing is performed.
[0086] The pattern expansion method includes the following steps: first, calculating the remainder k between the channel dimension size C and the slice length p of the channel dimension; wherein C represents the channel dimension size of the hydrogen flow data of the hydrogen transmission pipeline network, and p represents the slice size of the channel dimension.
[0087] If k≠0, the expansion strategy is dynamically selected through the relevance-diversity trade-off function centrality calculation formula, and the centrality C is calculated for each channel separately. i , record the comparison results in set Z, and sort Z in descending order after the calculation is completed.
[0088] Z=Order({C1,C2,…,C C}) (8)
[0089] Among them, Order is a descending operation on the collection.
[0090] The relevance-diversity trade-off function formula is:
[0091]
[0092]
[0093] Among them, C i is the centrality of channel i, R ij is the Spearman correlation coefficient between channel i and channel j, V t It is a global volatility indicator in the time dimension. represents the volatility index on the jth channel; β and γ are adjustment coefficients that control the weights of correlation and volatility indicators in the centrality calculation.
[0094] Select the channels corresponding to the first pk values in the set Z for copying, and add the copied pk channels to the original channel dimension. The channel dimension size of the final data set is C+pk.
[0095] Relevance aggregation includes the following steps:
[0096] Calculate the Spearman correlation coefficient matrix between channels in the channel dimension;
[0097] The correlation coefficients between each channel and other channels are sorted in descending order, and the first p-1 related channels are selected from the first channel and aggregated into a channel slice. No operation is performed on the selected channels, and so on, until all channels are selected, where p is the size of the channel slice.
[0098] Specifically, for each channel of the data set X, the inter-channel Spearman correlation coefficient is calculated to obtain a (C+pk)×(C+pk) correlation matrix R, where R ij represents the correlation coefficient between the i-th channel and the j-th channel, and obtains a new correlation matrix R', where R' ij =|R ij |.
[0099] For each channel i, the correlation coefficients of the channel with other channels in R' are sorted in descending order, and the p-1 channels with the strongest correlation with channel i are selected, excluding channel i itself.
[0100] The formula for correlation aggregation of the i-th channel is as follows:
[0101] S i ={X i}∪{X j |j∈Top(p-1,R′ i )∧j≠i} (11)
[0102] Among them, X i and X jThey represent the data of the i-th channel and the j-th channel respectively, S i is the set of other channels aggregated with channel i, Top(p-1,R' i ) indicates that the R' matrix is i The p-1 channels with the strongest correlation, excluding X i , ∧ represents the logical AND operation.
[0103] The selected p-1 channels are aggregated with channel i into a new channel slice. The selected channels will no longer participate in the subsequent selection process.
[0104] Repeat the above process until all channels are selected and aggregated into channel slices, and finally output X' L .
[0105] S3. Build a cross-level feature interaction network to extract local information and related features between slices in different dimensions and between different slices.
[0106] like Figure 4 As shown in Figure 1, the cross-level feature interaction network consists of a temporal feature extractor, a spatial feature extractor, and a backbone feature extractor. The temporal feature extractor is responsible for extracting the dependency features in the time slice direction of the time series, the spatial feature extractor is responsible for extracting the correlation features in the dimension slice direction, and the backbone feature extractor integrates these features to extract higher-level feature representations. Among them, the temporal feature extractor, the spatial feature extractor, and the backbone feature extractor are all composed of two convolution modules with a convolution kernel size of 3, a convolution module with a convolution kernel size of 1, a transposition operation, and a residual connection.
[0107] The temporal feature extractor receives normal data from the training set, permutes the dimension position through the transposition operation, extracts features from the time slice information, permutes the dimension position again through the transposition operation, obtains output data of the same size as the input size, and adds the input and output data through the residual connection. The formula is as follows:
[0108] X′ T =X′ L +T(Conv1(Conv3(Conv3(T(X′ L ))))) (12)
[0109] Among them, X' T is the temporal feature extractor output, X' L is the input of the temporal feature extractor, T is the transposition operation, Conv1 is a convolution module with a convolution kernel size of 1, and Conv3 is a convolution module with a convolution kernel size of 3.
[0110] Subsequently, the spatial feature extractor receives the output data from the temporal feature extractor, permutes the dimension position through a transpose operation, performs feature extraction on the channel slice information, permutes the dimension position again through a transpose operation, obtains output data of the same size as the input size, and finally adds the input and output data through a residual connection.
[0111] The formula is as follows:
[0112] X′ C =X′ T +T(Conv1(Conv3(Conu3(T(X′ T ))))) (13)
[0113] Among them, X' C is the spatial feature extractor output, X' T is the input of the spatial feature extractor, T is the transposition operation, Conv1 is a convolution module with a convolution kernel size of 1, and Conv3 is a convolution module with a convolution kernel size of 3.
[0114] Finally, the backbone feature extractor receives the output data from the spatial feature extractor, extracts features for each different slice, and permutes the dimension position again through the transposition operation to obtain output data of the same size as the input size, and finally adds the input and output data through the residual connection. The formula is as follows:
[0115] X′ S =X′ C +Con1(Conv3(Conv3(X′ C ))) (14)
[0116] Among them, X' S is the output of the backbone feature extractor, X' C As the input of the backbone feature extractor, Conv1 is a convolution module with a convolution kernel size of 1, and Conv3 is a convolution module with a convolution kernel size of 3.
[0117] S4. Build a multi-view feature reconstruction network to reconstruct the original time series by crossing the time series under different views, thereby realizing the cross-reconstruction of features under multiple views.
[0118] like Figure 5As shown in the figure, the multi-view feature reconstruction network aims to reconstruct the original time series from different hidden angles to improve the reliability of the results. It consists of three groups of fully connected layers with different hidden layer feature scales, normalization layers, and RELU activation functions. The output of the backbone feature extractor is flattened to a one-dimensional vector and passed through three groups of fully connected layers with different hidden feature scales to learn different hidden layer representations. The sizes of the three groups of hidden layers are int(1.2×W×C'), int(W×C'), and int(0.8×W×C'), respectively, and the dimension size of the output layer is int(L×C'). Among them, int() is a rounding operation, W is the length of the time series in the sliding window, and C' is the channel dimension length after pattern expansion.
[0119] The output of the backbone feature extractor X' S Flatten to a one-dimensional vector, and pass through three groups of fully connected layers with different hidden feature scales to learn the potential representation at different scales, and then normalize and use the Relu activation function for nonlinear processing to obtain the hidden layer reconstructed output. For the i-th hidden layer reconstructed output X i ′, and then multiply it with the cross weight coefficient to perform weighted fusion with the other two groups of reconstruction outputs to obtain the reconstruction output X at the i-th angle i .
[0120] The formula is as follows:
[0121] X1′=FC 12 (σ(BN(FC 11 (F(X′ S ))))) (15)
[0122] X2′=FC 22 (σ(BN(FC 21 (F(X′ S ))))) (16)
[0123] X3′=FC 32 (σ(BN(FC 31 (F(X′ S ))))) (17)
[0124] X1=X′1+α 11 X2′+α 12 X3′ (18)
[0125] X2=X′2+α 21 X1′+α 22 X3′ (19)
[0126] X3=X′3+α 31 X1′+α 32 X2′ (20)
[0127] Among them, X1, X2, and X3 are the reconstructed outputs of three groups of different hidden feature scales, which are used to calculate the loss with the real data. X1′, X2′, and X3′ are the reconstructed outputs of the hidden layer at different angles. F is the flattening operation, BN is the normalization layer, σ is the Relu activation function, and FC ij represents the jth fully connected layer of the i-th group, α ij represents the jth weight coefficient of the i-th group.
[0128] S5. Build a loss guidance network to dynamically adjust the slice size of time slices and channel slices according to the overall loss change, and feed back to the anomaly detection model to update the slice size.
[0129] like Figure 6 As shown in Figure 1, the loss-guided network aims to dynamically adjust the size of the time slice and channel slice according to the change of the overall loss. When the feedback mechanism is triggered, the initial slice size of the dual-dimensional adaptive slice network is adaptively adjusted. Before training the anomaly detection model, define L total is the total loss during model training, and L is initially set total The size is INF, that is, the initial total loss is infinite.
[0130] Loss function L total It consists of three parts: basic reconstruction loss function, complexity penalty term and regularization term:
[0131] L total =L base +L complexity +L reg (twenty one)
[0132] L base is the basic reconstruction loss function, which is used to measure the reconstruction accuracy of the anomaly detection model for time series data. The mean square error is used to measure the difference between the three groups of reconstructed data and the original data. complexity is a complexity penalty term, which is used to measure the relationship between slice size and complexity, and encourages the model to reduce computational complexity while maintaining accuracy; L reg is a regularization term used to prevent overfitting.
[0133] Basic reconstruction loss function L base It is composed of mean square error and the formula is shown below.
[0134]
[0135] Among them, X i is the reconstructed data for the i-th group, and X is the real data.
[0136] Larger slices mean more features and higher model complexity, so the model complexity penalty term is defined as follows:
[0137] L complexity =λ1·(P t 2 log(P t +1))·(P f 2 log(P f +1)) (23)
[0138] Among them, λ1 is the preset weight, P t is the time slice size, P f is the channel slice size.
[0139] L reg is the L2 regularization term, and the formula is as follows:
[0140]
[0141] Among them, λ2 is the regularization strength parameter, w i is the i-th weight parameter, and n represents the total number of weight parameters.
[0142] During model training, record the overall loss of the i-th training round If the overall loss of the i-th round is greater than the overall loss of the previous round, the slice size is reduced, otherwise the slice size is increased. The formula is as follows.
[0143]
[0144] P′ s =p+D·Δs1 (26)
[0145] P′ t =q+D·Δs2 (27)
[0146] Where D is the direction function, p and q are channel dimension slices and time dimension slices respectively, Δs1 and Δs2 are the adjustment steps, indicating the amount of change each time the slice size is adjusted, and P′ s and P′ t are the adjusted slice sizes respectively.
[0147] S6. Build an industrial hydrogen flow anomaly detection network to detect and identify it from multiple sets of reconstructed time series.
[0148] The input of the industrial hydrogen flow anomaly detection network is the three time series X1, X2 and X3 reconstructed by the multi-angle reconstruction network. For each reconstructed time series, the error between the original sequence X and the reconstruction loss function is calculated, the output scale is reduced using a logarithmic operation, and the reconstructed sequence is scored for anomaly using the industrial anomaly scoring function. The formula is as follows:
[0149]
[0150] Among them, α is the adjustment factor, the weight of the control error, log is the logarithmic function, S is the industrial anomaly scoring function, X i is the i-th sequence reconstructed by the multi-angle reconstruction network, and X is the real sequence data.
[0151] S7. Use the training set to train the anomaly detection model, use the validation set to evaluate the anomaly detection model, use the test set to verify the anomaly detection model after training, and use the trained anomaly detection model to perform anomaly detection on the hydrogen flow data of the industrial hydrogen pipeline network to be detected.
[0152] The anomaly detection model is trained, and the trained anomaly detection model is used to perform anomaly detection on the hydrogen flow data of the industrial hydrogen pipeline network to be detected.
[0153] In a specific implementation, the anomaly detection model is trained for 20 rounds. After each round, the model weight is retained through the validation set evaluation. After the training, the model with the best performance in the validation set is selected for evaluation on the test set and finally deployed to ensure that the entire anomaly detection algorithm achieves optimal performance in practical applications. After the training, the best model is selected for deployment to achieve real-time monitoring of hydrogen flow data in the industrial hydrogen transmission pipeline network.
[0154] Embodiment 2
[0155] The purpose of this embodiment is to provide a hydrogen transmission pipeline network flow anomaly detection system based on dual-dimensional features, including:
[0156] An acquisition unit, used to acquire hydrogen flow data of the hydrogen transmission network to be detected;
[0157] A slicing unit is used to adaptively slice the acquired hydrogen flow data of the hydrogen transmission network to be detected in the time dimension and the channel dimension in the trained anomaly detection network model to obtain data slices of the same size;
[0158] An extraction unit, used to extract time features of different data slices in the time slice direction using a time feature extractor, extract channel features in the dimension slice direction from the extracted time features using a spatial feature extractor, and extract backbone features of the channel features using a backbone feature extractor;
[0159] A reconstruction unit is used to learn potential representations of different scales for the extracted backbone features using a reconstruction network composed of multiple sets of hidden layers with different feature scales, and obtain reconstruction outputs under multiple fields of view;
[0160] The anomaly detection unit is used to perform anomaly scoring on the reconstructed outputs under the multiple fields of view to obtain anomaly detection results.
[0161] Embodiment 3
[0162] The purpose of this embodiment is to provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0163] Embodiment 4
[0164] The purpose of this embodiment is to provide a computer-readable storage medium.
[0165] A computer-readable storage medium stores a computer program, which executes the steps of the above method when executed by a processor.
[0166] The steps involved in the apparatuses of the above embodiments 2, 3 and 4 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.
[0167] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0168] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. Hydrogen pipeline network flow anomaly detection method based on dual-dimensional features, It is characterized in that include: Obtain hydrogen flow data of the hydrogen transmission pipeline network to be tested; In the trained anomaly detection network model, the hydrogen flow data of the hydrogen transmission network to be detected is adaptively sliced in the time dimension and the channel dimension to obtain data slices of the same size; A time feature extractor is used to extract time features of different data slices in the time slice direction, a spatial feature extractor is used to extract channel features in the dimension slice direction from the extracted time features, and a backbone feature extractor is used to extract backbone features of the channel features; Using a reconstruction network composed of multiple sets of hidden layers with different feature scales, the latent representations of the extracted backbone features at different scales are learned to obtain the reconstructed output under multiple fields of view. The reconstructed outputs under multiple fields of view are scored for abnormality to obtain anomaly detection results.
2. The method for detecting abnormal flow rate in a hydrogen transmission pipeline network based on dual-dimensional features according to claim 1, It is characterized in that In the training of the anomaly detection network model, the total loss of the current training round is recorded. If the total loss of the current training round is greater than the total loss of the previous training round, the slice size is reduced; if the total loss of the current training round is less than the total loss of the previous training round, the slice size is increased.
3. The method for detecting abnormal flow rate of a hydrogen transmission pipeline network based on dual-dimensional features according to claim 1, It is characterized in that The acquired hydrogen flow data of the hydrogen transmission network to be detected is adaptively sliced in the time dimension and the channel dimension to obtain data slices of the same size; specifically: Calculate whether the hydrogen flow data of the hydrogen transmission network to be tested can be divided by the segmentation length q in the time dimension. If it cannot be divided, perform random interpolation processing. The segmentation length q should satisfy the factor of the total number of data in the window after interpolation. The pattern expansion method is used to expand the dimension size of the hydrogen flow data channel of the hydrogen transmission pipeline network to be detected, and the similarity aggregation method is used to aggregate strongly correlated channels, and sequential and non-overlapping slicing is performed.
4. The method for detecting abnormal flow rate in a hydrogen transmission pipeline network based on dual-dimensional features according to claim 3, It is characterized in that The mode expansion method is used to expand the dimension size of the hydrogen flow data channel of the hydrogen transmission network to be detected, specifically: Calculate the remainder k between the channel dimension size C and the slice length p of the channel dimension; If the calculated remainder k is not equal to 0, the expansion strategy is dynamically selected through the correlation-diversity centrality calculation formula, and the centrality is calculated for each channel and recorded in the set Z; Sort the results of each calculation in set Z in descending order; Select the channels corresponding to the first pk values in the descending set Z for copying, and add the copied pk channels to the end of the original channel dimension.
5. The method for detecting abnormal flow rate in a hydrogen transmission pipeline network based on dual-dimensional features according to claim 3, It is characterized in that The similarity aggregation method is specifically as follows: Calculate the Spearman correlation coefficient matrix between each channel; Each channel is sorted in descending order according to the Spearman correlation coefficient matrix with other channels, and the first p-1 related channels are selected from the first channel and aggregated into a channel slice. No operation is performed on the selected channels, and so on until all channels are selected, where p is the size of the channel slice.
6. The method for detecting abnormal flow rate in a hydrogen transmission pipeline network based on dual-dimensional features according to claim 1, It is characterized in that The time feature extractor is used to extract the time features of different data slices in the time slice direction, the spatial feature extractor is used to extract the channel features in the dimension slice direction of the extracted time features, and the backbone feature extractor is used to extract the backbone features of the channel features, specifically: X′ T =X′ L +T(Conv1(Conv3(Conv3(T(X′ L ))))), X′ C =X′ T +T(Conv1(Conv3(Conv3(T(X′ T ))))), X′ S =X′ C +Conv1(Conv3(Conv3(X′ C ))), Among them, X′ L is the input of the temporal feature extractor, X′ T , X′ C , X′ S They are the outputs of the temporal feature extractor, spatial feature extractor and backbone feature extractor respectively, T is the transposition operation, Conv1 is a convolution module with a convolution kernel size of 1, and Conv3 is a convolution module with a convolution kernel size of 3.
7. The method for detecting abnormal flow rate in a hydrogen transmission pipeline network based on dual-dimensional features according to claim 1, It is characterized in that Using a reconstruction network composed of multiple sets of hidden layers with different feature scales, the extracted backbone features are learned to have potential representations at different scales, and the reconstructed outputs under multiple fields of view are obtained, specifically: X 1 ′=FC 12 (σ(BN(FC 11 (F(X′ S ))))), X 2 ′=FC 22 (σ(BN(FC 21 (F(X′ S )))), X 3 ′=FC 32 (σ(BN(FC 31 (F(X′ S ))))), X 1 =X′ 1 +a 11 X 2 ′+a 12 X 3 ′, X 2 =X′ 2 +a 21 X 1 ′+a 22 X 3 ′, X 3 =X′ 3 +a 31 X 1 ′+a 32 X 2 ′, Among them, X 1 , X 2 , X 3 are the reconstructed outputs of three sets of different hidden feature scales, X′ S is the output of the backbone feature extractor, F is the flattening operation, BN is the normalization layer, σ is the Relu activation function, and FC ij represents the jth fully connected layer of the i-th group, α ij represents the jth weight coefficient of the i-th group.
8. Hydrogen pipeline network flow anomaly detection system based on dual-dimensional features, It is characterized in that include: An acquisition unit, used to acquire hydrogen flow data of the hydrogen transmission network to be detected; A slicing unit is used to adaptively slice the acquired hydrogen flow data of the hydrogen transmission network to be detected in the time dimension and the channel dimension in the trained anomaly detection network model to obtain data slices of the same size; An extraction unit, used to extract time features of different data slices in the time slice direction using a time feature extractor, extract channel features in the dimension slice direction from the extracted time features using a spatial feature extractor, and extract backbone features of the channel features using a backbone feature extractor; A reconstruction unit is used to learn potential representations of different scales for the extracted backbone features using a reconstruction network composed of multiple sets of hidden layers with different feature scales, and obtain reconstruction outputs under multiple fields of view; The anomaly detection unit is used to perform anomaly scoring on the reconstructed outputs under the multiple fields of view to obtain anomaly detection results.
9. A computer device, It is characterized in that include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the method for detecting abnormal flow in a hydrogen transmission pipeline network based on dual-dimensional features is performed.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting abnormal flow rate of a hydrogen transmission pipeline network based on dual-dimensional features as described in any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Gas flow anomaly detection method and system based on machine learning and dynamic threshold
CN115964636A
Industrial internet time series data anomaly detection method and device
CN116522265A
System and method for dynamically ordering video channels according to rank of abnormal detection
US20190221090A1
