A feature-level gas leakage prediction and early warning method based on a multi-task neural network

CN120873798BActive Publication Date: 2026-09-29BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510946646.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2026-09-29
Estimated Expiration
2045-07-09

AI Technical Summary

Benefits of technology

[0052]1、本发明提供一种基于多任务神经网络的特征级燃气泄漏预测预警方法,构建了一个在特征级融合多源时序传感数据的统一神经网络模型,通过结合风险等级、浓度趋势方向和未来浓度置信上界,实现可解释、分级、动态的预警响应策略,能够实现泄漏分类、浓度回归、位置估计、风险评估与趋势预测五类任务的联合优化,从而提升预测精度、响应速度与系统部署效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120873798B_ABST
    Figure CN120873798B_ABST
Patent Text Reader

Abstract

The application provides a feature-level gas leakage prediction and early warning method based on a multi-task neural network, constructs a unified neural network model for fusing multi-source time sequence sensing data at a feature level, realizes an interpretable, hierarchical and dynamic early warning response strategy by combining a risk level, a concentration trend direction and a future concentration confidence upper bound, and can realize joint optimization of five types of tasks, i.e., leakage classification, concentration regression, position estimation, risk assessment and trend prediction, so as to improve prediction accuracy, response speed and system deployment efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical fields of gas leak detection and tracing, neural network modeling and edge intelligence fusion, and particularly relates to a feature-level gas leak prediction and early warning method based on multi-task neural networks. Background Technology

[0002] The widespread use of natural gas in urban pipeline networks has improved energy efficiency, but it has also brought safety hazards. Once a leak occurs, it can easily trigger major accidents such as fires and explosions. Traditional leak detection methods rely on single gas sensors or rule-based models, which are not only slow to respond and have a high false alarm rate, but also fail to provide richer information such as leak concentration, trends, or location. Traditional technologies mainly include: single-sensor alarms (such as combustible gas sensors) are sensitive to environmental changes, resulting in a large number of false alarms and missed alarms; rule-based threshold judgments cannot predict the leak process in its early stages; existing deep learning detection methods are mostly single-task models, only solving the problem of whether a leak has occurred, and cannot jointly output multi-dimensional indicators such as concentration, trends, and risk levels; decision-level data fusion methods fail to effectively utilize the deep correlations of multimodal information, limiting the model's predictive accuracy and generalization ability.

[0003] In recent years, deep learning-based detection methods have been gradually proposed. However, most of these methods are single-task modeling, neglecting the inherent coupling relationship between leakage classification, concentration prediction, risk assessment, and trend analysis. In addition, existing methods usually fuse multi-source data at the decision level, lacking the ability to establish deep collaborative mechanisms from the feature level, which limits the breadth of information utilization and predictive ability.

[0004] It is evident that the existing solutions have the following shortcomings: the information fusion level is shallow, lacking feature-level multimodal fusion capabilities; they cannot achieve multi-task collaborative prediction, resulting in problems such as redundant modeling and inconsistent predictions; and they lack dynamic early warning capabilities, failing to capture early leakage characteristics and exhibiting delayed response. Summary of the Invention

[0005] To address the aforementioned issues, this invention provides a feature-level gas leak prediction and early warning method based on a multi-task neural network. This method can fuse data from multiple sensors at the feature layer and combine multiple tasks to perform efficient and accurate gas leak prediction and early warning.

[0006] A feature-level gas leak prediction and early warning method based on multi-task neural networks includes the following steps:

[0007] Multimodal sensors for collecting status parameters are deployed at different locations in the gas pipeline network. These status parameters include methane concentration, wind speed and direction, temperature and humidity, pressure, and flow rate.

[0008] The input tensor is constructed based on the state parameters collected by each multimodal sensor within a set time period. X ;

[0009] A sensor topology map is constructed based on the spatial structure relationship of each multimodal sensor in the gas pipeline network, and the symmetric normalized adjacency matrix of the sensor topology map is obtained. ;

[0010] Input tensor X and symmetric normalized adjacency matrix Input the spatial encoding module to obtain spatial features;

[0011] Input tensor X Input the time encoding module to obtain time characteristics;

[0012] By fusing spatial and temporal features, a fused feature is obtained.

[0013] The fused features are input into the multi-task neural network prediction module to obtain multi-task prediction results, which include leakage probability, risk level, trend direction, future concentration, and anomaly probability.

[0014] The dynamic judgment process mechanism is used to determine the response level of multi-task prediction results, recommend risk avoidance operations, and locate the leakage area.

[0015] Furthermore, input tensors X The specific construction method is as follows:

[0016] Each multimodal sensor acquires state parameters once at a set sampling period to obtain a time series dataset;

[0017] Using a sliding window of a set size and a set step size, different sliding window data are extracted from the time series dataset, and all sliding window data constitute the input tensor. ,in, T Indicates the number of sliding window data items. F Represents the dimension of the state parameters, and F =5.

[0018] Furthermore, the method for constructing the sensor topology map is as follows:

[0019] The locations where each multimodal sensor is deployed are respectively used as the sensor topology. Figure 1 There are nodes, among which there exists an edge between nodes corresponding to two directly physically connected multimodal sensors;

[0020] Assign edge weights to each edge in the sensor topology graph. The method for setting the edge weight for any given edge is as follows:

[0021]

[0022] in, For the firsti The node and the first j Edge weights between nodes For the first i The node and the first j The length of the pipe between nodes For the first i The node and the first j The diameter of the pipe between nodes.

[0023] Furthermore, the symmetric normalized adjacency matrix The method for obtaining it is as follows:

[0024]

[0025] in, This is the degree matrix of the sensor topology. Let be a self-looping matrix of the sensor topology, where is a self-looping matrix. The calculation method is as follows:

[0026]

[0027] in, This is the original adjacency matrix of the sensor topology graph. It is the identity matrix;

[0028] Degree matrix The calculation method for any element in the set is as follows:

[0029]

[0030] in, Degree matrix The Middle i Line 1 i Elements in the column, For a self-loop matrix The i Line 1 j Elements in a column.

[0031] Furthermore, the method for obtaining spatial features is as follows:

[0032]

[0033]

[0034] in, These are the trainable weights of the first layer of the graph neural network in the spatial encoding module. These are intermediate features output by the first layer of the graph neural network. It is a linear rectified function. These are the trainable weights of the second layer of the graph neural network in the spatial encoding module. This represents the spatial features output by the second layer of the graph neural network.

[0035] Furthermore, the method for obtaining time features is as follows:

[0036] Input tensor X Temporal features are obtained by sequentially performing positional encoding, Transformer encoding, and multi-head attention mechanisms.

[0037] Furthermore, the method for obtaining the fused features is as follows:

[0038]

[0039] in, As a feature of fusion, For spatial features, As a time feature, for Convolution operation, express The width of the convolution kernel.

[0040] Furthermore, the multi-task neural network prediction module includes a leakage identification task unit, a risk level assessment task unit, a trend direction prediction task unit, a concentration prediction task unit, and an anomaly identification task unit.

[0041] The leakage identification task unit outputs the leakage probability. Risk level assessment task unit outputs predicted risk level The values ​​0 through 4 correspond to normal, low, medium, high, and emergency levels, respectively; the trend direction prediction task unit outputs the trend direction prediction result. Here, "increasing" indicates an upward trend in methane concentration, "stable" indicates a stable methane concentration, and "decreasing" indicates a downward trend in methane concentration; the concentration prediction task unit outputs future... Predicted future concentration values ​​after time The probability of an anomaly occurring when the anomaly detection task unit outputs abnormal sensor data or when the multi-task neural network prediction module makes an abnormal prediction. .

[0042] Furthermore, the specific method for determining the response level, recommending risk avoidance operations, and locating leakage areas based on the dynamic judgment process mechanism for multi-task prediction results is as follows:

[0043] Step 1: Determine if the leakage probability is greater than 0.8. If yes, proceed to Step 2; otherwise, stop the determination.

[0044] Step 2: Determine the response level based on the risk level, trend direction, and future concentration, then proceed to Step 3. If the following conditions are met... or This triggers an "emergency response," in which... For the future The 95% upper confidence bound of the future concentration prediction at that time. The lower limit of explosion is set; if and If the risk level rises, a "high-risk response" will be triggered; if and If the risk level rises, a "medium-risk response" will be triggered; otherwise, the risk level will be considered "low-risk" or "continuous monitoring".

[0045] Step 3: Judgment If the condition is not met, the judgment is stopped; if it is met, proceed to step 4.

[0046] Step 4: Determine the corresponding values ​​of three consecutive sliding window data, including the current sliding window data and the two sliding window data preceding it. If all responses are decreasing, then lower the current response level by one level and proceed to step 5; otherwise, keep the response level unchanged and proceed to step 5.

[0047] Step 5: Determine whether the response level is "critical response", "high-risk response" or "medium-risk response". If yes, provide risk avoidance operation recommendations and the leakage area. The risk avoidance operation recommendations include shutting down the valve and dispatching personnel for inspection. If no, stop the judgment.

[0048] Furthermore, the 95% confidence upper bound is calculated as follows:

[0049]

[0050] in, For the future The 95% upper confidence bound of the future concentration prediction at time step, where the prediction time step is... ; This is the mean forecast value of future concentrations; This is an estimate of the standard deviation of the error during the training phase of the multi-task neural network prediction module.

[0051] Beneficial effects:

[0052] 1. This invention provides a feature-level gas leak prediction and early warning method based on a multi-task neural network. It constructs a unified neural network model that integrates multi-source time-series sensor data at the feature level. By combining risk level, concentration trend direction, and upper bound of future concentration confidence, it realizes an interpretable, hierarchical, and dynamic early warning response strategy. It can achieve joint optimization of five types of tasks: leak classification, concentration regression, location estimation, risk assessment, and trend prediction, thereby improving prediction accuracy, response speed, and system deployment efficiency.

[0053] 2. This invention provides a feature-level gas leak prediction and early warning method based on a multi-task neural network. The sensor nodes are constructed as graph structure nodes, and the edge weights in the graph are jointly defined by the pipe segment length and pipe diameter. This can meet the modeling requirements of the physical mechanism of gas diffusion and improve the spatial robustness of gas diffusion sensing.

[0054] 3. This invention provides a feature-level gas leak prediction and early warning method based on a multi-task neural network. First, based on shared feature representation, a neural network structure is constructed that includes task heads such as leak detection, risk level judgment, trend direction prediction, and concentration trend regression. Second, spatial features are extracted using GCN, time series are encoded using Transformer, and fused through convolution to form a unified high-dimensional representation. Finally, trainable parameters are introduced to weight the loss of each task, which can improve the training stability and model performance of multi-task learning.

[0055] 4. This invention provides a feature-level gas leak prediction and early warning method based on a multi-task neural network. It combines the risk level, trend direction, future concentration prediction, and confidence interval output by the multi-task model to form a dynamic early warning judgment rule. When the trend continuously declines, an automatic downgrade strategy is executed, balancing the timeliness and stability of the early warning, thus improving response timeliness and false alarm control capabilities. Attached Figure Description

[0056] Figure 1 A flowchart of a feature-level gas leak prediction and early warning method based on a multi-task neural network provided by the present invention;

[0057] Figure 2 This is a block diagram illustrating the principle of the multi-task neural network prediction module provided by the present invention. Detailed Implementation

[0058] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0059] This invention proposes an end-to-end gas leak prediction and early warning method. Based on a multi-task neural network model, it integrates graph neural networks and Transformer architecture, and combines urban gas pipeline network topology and sensor data to achieve multi-task linkage such as leak detection, concentration prediction, risk assessment, trend analysis and anomaly identification.

[0060] Specifically, such as Figure 1 As shown, a feature-level gas leak prediction and early warning method based on a multi-task neural network includes the following steps:

[0061] S1: Deploy multimodal sensors at different locations in the gas pipeline network to collect status parameters, including methane concentration, wind speed and direction, temperature and humidity, pressure, and flow rate.

[0062] S2: Construct the input tensor based on the state parameters collected by each multimodal sensor within a set time period. X ;

[0063] Specifically, this invention deploys multi-modal sensors at gas pipeline network nodes to measure methane concentration, wind speed and direction, temperature and humidity, pressure, and flow rate. To ensure spatiotemporal consistency, the system employs a BeiDou-5G synchronization mechanism to achieve microsecond-level time synchronization across all nodes. A sampling cycle of 10 seconds is defined, and all sensor readings are tagged with a unified timestamp to form a time-series dataset. .

[0064] in: Indicates time node F-dimensional eigenvectors;

[0065] For the time series data of each node, a sliding window is constructed, generating a data window with a sliding window size of 30 minutes and a sliding step size of 5 minutes. An input tensor is constructed for each window. ,in , The features include methane concentration, wind speed and direction, temperature and humidity, pressure, and flow rate. Based on the multimodal observation features (including methane concentration, wind speed and direction, temperature and humidity, pressure, and flow rate) within each time step, a normalized risk score vector is calculated. Simultaneously, according to the risk level classification standards in the "Urban Gas Design Code," each score is mapped to a five-level risk label. The labels represent normal, low risk, medium risk, high risk, and critical risk, respectively. This label sequence is used to train prediction tasks such as the risk level assessment module and the trend direction prediction module.

[0066] S3: Construct a sensor topology map based on the spatial structure relationship of each multimodal sensor in the gas pipeline network, and obtain the symmetric normalized adjacency matrix of the sensor topology map. ;

[0067] It should be noted that, in order to construct the spatial structure of the gas sensor network, the monitoring nodes for each state parameter need to be transformed into nodes in a graph structure based on the actual pipeline layout. Pipes that physically connect multimodal sensors are defined as edges in the graph. The edge weights are designed based on the diffusion physical properties. In this invention, "physical connection" refers to the existence of a continuous gas transmission pipe section between two monitoring nodes, and this pipe section allows gas to diffuse and flow between the nodes under normal operating conditions, such as a continuous pipe section or a valve-free isolation section, which is used to establish the edges in the graph structure. If there is no physical connection, no graph edges are established to reflect the topological constraints of actual gas propagation.

[0068] In other words, if two multimodal sensor nodes are located on the same pipe segment or a continuous pipe segment (with continuous gas flow), they are defined as physically connected; if there is no gas pipe or valves, walls, etc. between the two multimodal sensor nodes, they are considered not to have a direct physical connection; this "connection" reflects the calculable physical propagation channel such as gas diffusion path, diffusion speed, and dilution characteristics.

[0069] The specific method for constructing the sensor topology map is as follows:

[0070] 1) Construct an undirected weighted graph To model the topological relationships between sensors, where nodes Representing each monitoring point, edge The edge weight matrix represents the connection relationship between pipes. Define the gas diffusion correlation strength between nodes.

[0071] 2) Edge weight Representing the difficulty of information propagation, this invention proposes the following edge weight design formula based on the physical characteristics of gas propagation and diffusion in pipelines, defined as follows:

[0072]

[0073] in, For the first i The node and the first j Edge weights between nodes For the first i The node and the first j The length of the pipe between nodes For the first i The node and the first j The pipe diameter between nodes reflects the inverse relationship between the diffusion path and the dilution effect, which helps to accurately model changes in gas concentration.

[0074] 3) Construct and normalize the adjacency matrix, generating the original adjacency matrix according to the node connection relationships. Adding an identity matrix forms a matrix with self-loops. The degree matrix is ​​calculated as follows: , Degree matrix The element in the i-th row and i-th column, For a self-loop matrix The i Line 1 j Elements in the column; construct a symmetric normalized adjacency matrix This matrix serves as the input for graph neural network modeling in subsequent steps.

[0075] S4: Input tensor X and symmetric normalized adjacency matrix Input the spatial encoding module to obtain spatial features;

[0076] Specifically, the spatial coding module uses a two-layer graph neural network (GCN) to extract structural relationship features between nodes, and its calculation formula is as follows:

[0077]

[0078]

[0079] in, For the input tensor, These are the trainable weights of the first layer of the graph neural network in the spatial encoding module. These are intermediate features output by the first layer of the graph neural network. It is a linear rectified function. These are the trainable weights of the second layer of the graph neural network in the spatial encoding module. This represents the spatial features output by the second layer of the graph neural network.

[0080] S5: Input tensor X Input the time encoding module to obtain time characteristics;

[0081] Specifically, the time encoding module applies the Transformer encoding module to the time series (sliding window) of each node, with the input being the sliding window tensor of each node. After adding positional encoding, the data is fed into a Transformer, where a multi-head attention mechanism is used to capture trend changes and long dependencies in the sequence; learnable positional encoding is added to preserve temporal location information; and a temporal feature matrix is ​​output. .

[0082] S6: Merge spatial and temporal features to obtain fused features;

[0083] Specifically, this invention will incorporate spatial features With time characteristics After splicing, using Convolution is used for compression to obtain fused features:

[0084]

[0085] in, As a feature of fusion, For spatial features, As a time feature, for Convolution operation, express The width of the convolution kernel.

[0086] like Figure 2 As shown, steps S4 to S6 of this invention aim to fuse pipeline network structure and sensor time-series information, extract key features for subsequent risk prediction; fuse pipeline network graph structure with multimodal time-series observation data, and extract spatiotemporal coupling features through three sub-modules for use by subsequent task modules; that is, this invention introduces graph structure encoding + time-series attention mechanism for joint modeling, which enhances the spatiotemporal coupling representation capability and is suitable for gas diffusion modeling scenarios in non-Euclidean space.

[0087] S7: Input the fused features into the multi-task neural network prediction module to obtain the multi-task prediction results, which include leakage probability, risk level, trend direction, future concentration, and anomaly probability.

[0088] It should be noted that, as shown in Table 1, the multi-task neural network prediction module of this invention includes a leakage identification task unit, a risk level assessment task unit, a trend direction prediction task unit, a concentration prediction task unit, and an anomaly identification task unit; fusion features As a shared input to all downstream task modules (such as leak identification, risk classification, and trend judgment), it is fed into the corresponding task head network for multi-task parallel prediction. The output is a multi-dimensional prediction result, including information such as leak status, risk level, and concentration trend.

[0089] Table 1

[0090]

[0091] It should be noted that the Leakage Identification Task Unit and Risk Level Assessment Task Unit are used for leakage identification and classification; the Trend Direction Prediction Task Unit and Concentration Prediction Task Unit are used for trend judgment and early warning; and the Anomaly Identification Task Unit, in conjunction with other heads, serves as an auxiliary indicator for anomaly verification.

[0092] Among them, the leakage identification task unit outputs the leakage probability. Risk level assessment task unit outputs predicted risk level The values ​​0 through 4 correspond to normal, low, medium, high, and emergency levels, respectively; the trend direction prediction task unit outputs the trend direction prediction result. Here, "increasing" indicates an upward trend in methane concentration, "stable" indicates a stable methane concentration, and "decreasing" indicates a downward trend in methane concentration; the concentration prediction task unit outputs future... Predicted future concentration values ​​after time The probability of an anomaly occurring when the anomaly detection task unit outputs abnormal sensor data or when the multi-task neural network prediction module makes an abnormal prediction. .

[0093] Furthermore, in order to solve the gradient conflict problem between the sub-tasks of the prediction module in the multi-task neural network, this invention introduces a method for adjusting weights based on task uncertainty to ensure the stability and generalization ability of the model training.

[0094] 1) Constructing the loss function

[0095] The total loss function is defined as:

[0096]

[0097] in: For the first Individual task losses; For the corresponding task, represents the uncertainty parameter, and represents the trainable parameter; Number of tasks;

[0098] 2) Mechanism of action

[0099] When training for a certain task is unstable (with large fluctuations in loss), the system automatically reduces its uncertainty parameters, which can effectively coordinate the differences in task training objectives and improve overall performance.

[0100] S8: Based on the dynamic judgment process mechanism, the multi-task prediction results are used to determine the response level, recommend risk avoidance operations, and locate the leakage area.

[0101] It should be noted that step S8 aims to construct an interpretable, dynamic, and hierarchical gas leak early warning and response mechanism based on the output results of each task head of the multi-task neural network. This mechanism integrates detection probability, risk level prediction, concentration trend direction, and concentration trend quantification value, realizing an integrated dynamic risk control framework of "prediction-judgment-response".

[0102] The model outputs the following task header results as input to the early warning mechanism, including the leakage probability. Risk level prediction value Trend direction Concentration trend prediction ,in Minutes; Probability of anomalies .

[0103] The specific method for determining the response level, recommending risk avoidance operations, and locating leakage areas based on the dynamic judgment process mechanism for multi-task prediction results is as follows:

[0104] Step 1: Determine if the leakage probability is greater than 0.8. If yes, proceed to Step 2; otherwise, stop the determination.

[0105] Step 2: Determine the response level based on the risk level, trend direction, and future concentration, then proceed to Step 3. If the following conditions are met... or This triggers an "emergency response," in which... For the future The 95% upper confidence bound of the future concentration prediction at that time. The lower explosion limit is typically set at 5% (corresponding to 50,000 ppm); if and If the risk level rises, a "high-risk response" will be triggered; if and If the risk level rises, a "medium-risk response" will be triggered; otherwise, the risk level will be considered "low-risk" or "continuous monitoring".

[0106] The 95% confidence upper bound is calculated as follows:

[0107]

[0108] in, For the future The 95% upper confidence bound of the future concentration prediction at time step, where the prediction time step is... This is used to construct confidence boundaries for trend prediction results and avoid using model outputs with excessive errors; This is the mean forecast value of future concentrations; This is an estimate of the standard deviation of the error during the training phase of the multi-task neural network prediction module.

[0109] Step 3: Judgment If the condition is not met, the judgment and subsequent actions are stopped to prevent accidental triggering; if the condition is met, proceed to step 4.

[0110] Step 4: Determine the corresponding values ​​of three consecutive sliding window data, including the current sliding window data and the two sliding window data preceding it. If all responses are decreasing, then lower the current response level by one level to improve the ability to resist false alarms, and proceed to step 5; if not, then keep the response level unchanged, and proceed to step 5.

[0111] It should be noted that if there is a time when the trend direction is not clearly downward, the system will start counting again. Automatic downgrading will only be performed when the trend direction is downward for three consecutive windows.

[0112] Step 5: Determine whether the response level is "critical response", "high-risk response" or "medium-risk response". If yes, provide risk avoidance operation recommendations and the leakage area. The risk avoidance operation recommendations include shutting down the valve and dispatching personnel for inspection. If no, stop the judgment.

[0113] In other words, once a risk response is triggered, the system will generate the following output: the current response level; the triggering basis (such as the upper limit of the predicted trend, the risk level, etc.); recommended actions (such as shutting down the valve, dispatching manual inspection); and optional leakage area estimation results (for terminal display or map annotation).

[0114] Furthermore, the prediction and early warning system corresponding to the feature-level gas leak prediction and early warning method based on multi-task neural networks provided by this invention can be deployed on low-power edge devices to achieve rapid prediction and inference. At the same time, it relies on the cloud platform to realize model fine-tuning, updating and pushing, ensuring that the system has good response speed, online adaptability and continuous evolution capability.

[0115] The system is deployed on edge inference devices that support embedded systems (such as Jetson Nano and RK3588 platforms). Its deployment modules include: a model execution engine (ONNX / TensorRT); a data preprocessing module (sliding window construction, normalization); and an inference cache and response output module.

[0116] Communication module (5G / NB-IoT) and OTA interface. The quantized model size is controlled within 30~50MB, INT8 inference latency <200ms, and power consumption <10W.

[0117] The cloud platform executes fine-tuning tasks daily on a scheduled basis. The process is as follows: First, raw data from all high-risk trigger segments over the past 24 hours is collected; then, a lightweight training set is built and the backbone structure is frozen, with only the task header being fine-tuned; after training, the parameter drift rate is calculated using the following formula:

[0118]

[0119] The update strategy is as follows: if If so, push directly via OTA; Then platform review is required; if If the result is not met, it is considered structural drift, and OTA should not be performed. A complete retraining is recommended.

[0120] The cloud pushes incremental model update packages to edge devices via the OTA module. The update process employs a signature verification mechanism and supports breakpoint resumption and version rollback: the OTA package size is controlled to <5MB; after three failures, it rolls back to the previous model version; all model weights are stored using AES256 encryption. Upon receiving the OTA update package, the edge device first performs digital signature verification to ensure the update package has not been tampered with; after successful signature verification, the new model is temporarily stored in the backup space, and the new model is automatically loaded to perform local inference tests (using a reserved historical dataset or simulated input); after performing multiple test inferences (no less than 5 times), if the inference is normal, the inference latency is below a preset threshold (e.g., <200ms), and memory usage meets deployment specifications, then local verification is considered successful. If local verification is successful, the edge device automatically sends an "OTA update successful" feedback signal to the cloud and officially switches to the new model. If local verification fails, such as two consecutive abnormal inference results, inference latency exceeding the threshold, or memory exceeding requirements, the abnormal inference result is defined as: the value of any single task head in the prediction output exceeds its reasonable range (e.g., the leakage probability is significantly lower than the historical average, or the trend prediction abruptly exceeds the historical error limit). The device automatically rolls back to the previous stable version of the model and sends an "OTA update failed" signal to the cloud. After receiving the feedback, the cloud records the update result and automatically notifies the management personnel to intervene and investigate the cause of the anomaly when it fails. The edge device periodically (e.g., every 24 hours) sends a running status signal (including model version number, inference latency, and running status code) to the cloud. If the cloud does not receive a feedback signal from the device for three consecutive times or receives abnormal status feedback, the cloud alarm mechanism is triggered, and the management personnel intervene.

[0121] Compared to existing leak warning schemes that mainly rely on rule-based threshold triggering, single-point concentration monitoring, or traditional neural network methods, this invention has the following technical advantages:

[0122] 1. Graph structure input based on physical topology modeling improves the spatial robustness of gas diffusion sensing.

[0123] Existing methods often treat sensors as independent nodes and stitch together their features, making it difficult to capture the actual physical connection characteristics in urban gas pipeline networks. This invention introduces an edge weight design based on "pipe segment length × pipe diameter" to establish a graph structure that reflects the actual gas diffusion path. Through a graph neural network propagation mechanism, this structure achieves cross-node concentration collaborative modeling, effectively enhancing the system's ability to perceive gas "mobility" and "dilution trend".

[0124] In real-world simulation data testing, compared to the unstructured modeling approach, the concentration trend prediction error decreased by 18.3% in multi-source interference scenarios.

[0125] 2. Introduce a "graph + Transformer" dual-branch spatiotemporal modeling structure to solve the problem of trend prediction difficulties in complex scenarios.

[0126] Existing models often separate temporal and spatial processing flows, making it difficult to unify the learning of coupled features. This invention encodes spatial structure using Graph Convolutional Networks (GCNs), models temporal trends using Transformers, and then fuses high-order features through 1×1 convolutions. This invention introduces a dual-branch structure into the multi-task neural network: one branch uses GCNs to encode spatial structural features between nodes, capturing "where the anomaly is"; the other branch uses Transformers to model the dynamic trend of the sequence, capturing "when the risk increases." The two networks are fused through 1×1 convolutions to jointly drive the downstream task head, achieving joint modeling of node-level leakage anomaly detection and future trend direction identification, significantly improving the model's ability to express complex risk behaviors and its multi-task interpretability. In model inference, compared to the traditional CNN-LSTM approach, this method reduces RMSE by 21.7% on the 15-minute concentration prediction task and significantly improves the accuracy of future trend direction classification.

[0127] 3. Build a trend-driven dynamic risk response mechanism to improve response timeliness and false alarm control capabilities.

[0128] This invention breaks through the traditional "fixed threshold triggering" method, and for the first time combines the output results of a multi-task model (risk level, trend direction, future concentration prediction and its confidence interval) to form a dynamic early warning judgment rule. It also executes an automatic degradation strategy when the trend is continuously declining, balancing the timeliness and stability of the early warning. Compared with the fixed threshold strategy, under strong interference conditions, the average false alarm rate is reduced by 34.6%, and the average early response time is improved by approximately 6.2 minutes.

[0129] Of course, the present invention may have other various embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art can make various corresponding changes and modifications according to the present invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.

Claims

1. A feature-level gas leak prediction and early warning method based on a multi-task neural network, characterized in that, Includes the following steps: Multimodal sensors for collecting status parameters are deployed at different locations in the gas pipeline network. These status parameters include methane concentration, wind speed and direction, temperature and humidity, pressure, and flow rate. The input tensor is constructed based on the state parameters collected by each multimodal sensor within a set time period. X ; A sensor topology map is constructed based on the spatial structure relationship of each multimodal sensor in the gas pipeline network, and the symmetric normalized adjacency matrix of the sensor topology map is obtained. The method for constructing the sensor topology map is as follows: Each location where a multimodal sensor is deployed is treated as a node in the sensor topology graph. There are edges between nodes corresponding to two multimodal sensors that are directly physically connected. Assign edge weights to each edge in the sensor topology graph. The method for setting the edge weight for any given edge is as follows: in, For the first i The node and the first j Edge weights between nodes For the first i The node and the first j The length of the pipe between nodes For the first i The node and the first j The diameter of the pipe between nodes; Input tensor X and symmetric normalized adjacency matrix Input the spatial encoding module to obtain spatial features; Input tensor X Input the time encoding module to obtain time characteristics; By fusing spatial and temporal features, a fused feature is obtained. The fused features are input into the multi-task neural network prediction module to obtain multi-task prediction results, which include leakage probability, risk level, trend direction, future concentration, and anomaly probability. The dynamic judgment process mechanism is used to determine the response level of multi-task prediction results, recommend risk avoidance operations, and locate the leakage area.

2. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 1, characterized in that, Input tensor X The specific construction method is as follows: Each multimodal sensor acquires state parameters once at a set sampling period to obtain a time series dataset; Using a sliding window of a set size and a set step size, different sliding window data are extracted from the time series dataset, and all sliding window data constitute the input tensor. ,in, T Indicates the number of sliding window data items. F Represents the dimension of the state parameters, and F =5.

3. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 2, characterized in that, Symmetric normalized adjacency matrix The method for obtaining it is as follows: in, This is the degree matrix of the sensor topology. Let be a self-looping matrix of the sensor topology, where is a self-looping matrix. The calculation method is as follows: in, This is the original adjacency matrix of the sensor topology graph. It is the identity matrix; Degree matrix The calculation method for any element in the set is as follows: in, Degree matrix The Middle i Line 1 i Elements in the column, For a self-loop matrix The i Line 1 j Elements in a column.

4. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 1, characterized in that, The method for obtaining spatial features is as follows: in, These are the trainable weights of the first layer of the graph neural network in the spatial encoding module. These are intermediate features output by the first layer of the graph neural network. It is a linear rectified function. These are the trainable weights of the second layer of the graph neural network in the spatial encoding module. This represents the spatial features output by the second layer of the graph neural network.

5. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 1, characterized in that, The method for obtaining time features is as follows: Input tensor X Temporal features are obtained by sequentially performing positional encoding, Transformer encoding, and multi-head attention mechanisms.

6. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 1, characterized in that, The method for obtaining fusion features is as follows: in, As a feature of fusion, For spatial features, As a time feature, for Convolution operation, express The width of the convolution kernel.

7. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 2, characterized in that, The multi-task neural network prediction module includes a leakage identification task unit, a risk level assessment task unit, a trend direction prediction task unit, a concentration prediction task unit, and an anomaly identification task unit. The leakage identification task unit outputs the leakage probability. Risk level assessment task unit outputs predicted risk level The values ​​0 through 4 correspond to normal, low, medium, high, and emergency levels, respectively; the trend direction prediction task unit outputs the trend direction prediction result. Here, "increasing" indicates an upward trend in methane concentration, "stable" indicates a stable methane concentration, and "decreasing" indicates a downward trend in methane concentration; the concentration prediction task unit outputs future... Predicted future concentration values ​​after time The probability of an anomaly occurring when the anomaly detection task unit outputs abnormal sensor data or when the multi-task neural network prediction module makes an abnormal prediction. .

8. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 7, characterized in that, The specific method for determining the response level, recommending risk avoidance operations, and locating leakage areas based on the dynamic judgment process mechanism for multi-task prediction results is as follows: Step 1: Determine if the leakage probability is greater than 0.

8. If yes, proceed to Step 2; otherwise, stop the determination. Step 2: Determine the response level based on the risk level, trend direction, and future concentration, then proceed to Step 3. If the following conditions are met... or This triggers a "crisis response," in which... For the future The 95% upper confidence bound of the future concentration prediction at that time. The lower limit of explosion is set; if and If the risk level rises, a "high-risk response" will be triggered; if and If the risk level rises, a "medium-risk response" will be triggered; otherwise, the risk level will be considered "low-risk" or "continuous monitoring". Step 3: Judgment If the condition is not met, the judgment is stopped; if it is met, proceed to step 4. Step 4: Determine the corresponding values ​​of three consecutive sliding window data, including the current sliding window data and the two sliding window data preceding it. If all responses are decreasing, then lower the current response level by one level and proceed to step 5; otherwise, keep the response level unchanged and proceed to step 5. Step 5: Determine whether the response level is "critical response", "high-risk response" or "medium-risk response". If yes, provide risk avoidance operation recommendations and the leakage area. The risk avoidance operation recommendations include shutting down the valve and dispatching manual inspection. If no, stop the judgment.

9. The feature-level gas leak prediction and early warning method based on a multi-task neural network as described in claim 8, characterized in that, The 95% confidence upper bound is calculated as follows: in, For the future The 95% upper confidence bound of the future concentration prediction at time step, where the prediction time step is... ; This is the mean forecast value of future concentrations; This is an estimate of the standard deviation of the error during the training phase of the multi-task neural network prediction module.

Citation Information

Patent Citations

  • Method and system for detecting leakage of hydrogen-doped natural gas pipeline in comprehensive pipe gallery

    CN119042546A

  • Pipeline leakage early warning method and device for multi-source heterogeneous gas pipe network data fusion

    CN119084836A