Gas detection alarm method
By adopting constant temperature and humidity collaborative control and dual-agent coordination algorithm in gas detection, combined with spatiotemporal Gaussian modeling and Bayesian classifiers, the problems of gas detection accuracy and misjudgment in underground spaces are solved, and accurate gas concentration detection and safety warning are achieved.
Patent Information
- Application Number
- CN202511128293.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-08-13
AI Technical Summary
Existing gas detection technology has low measurement accuracy in underground spaces due to changes in temperature and humidity, and the fixed threshold judgment leads to a high probability of misjudgment, making it impossible to accurately detect the concentration of harmful gases.
A gas detection method based on coordinated control of constant temperature and humidity is adopted. Through a dual-agent coordination algorithm and a coupled compensation model, combined with spatiotemporal Gaussian modeling and Bayesian classifiers, accurate compensation and dynamic decision-making of temperature and humidity are achieved, thereby improving the accuracy of gas concentration measurement and reducing misjudgments.
It achieves accurate detection of harmful gas concentrations in underground spaces, reduces the probability of misjudgment, provides safety warnings, and ensures personnel safety.
Smart Images

Figure CN120629055B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of gas detection, and in particular to a gas detection alarm method. Background Art
[0002] Underground spaces, such as parking lots, subway stations, and mines, are enclosed and ventilation systems struggle to efficiently replace air, leading to the accumulation of harmful gases. Furthermore, the underground environment is complex, and multiple factors influence gas concentration distribution. Accurately monitoring harmful gas concentrations is crucial for ensuring the safety of personnel in underground spaces. This not only provides real-time monitoring of concentration changes but also triggers alarms when concentrations exceed thresholds, providing safety warnings and preventing health risks and accidents.
[0003] Existing gas detection technologies mostly use conventional sensors for direct measurement. Changes in temperature and humidity can affect the sensor measurement results, resulting in low measurement accuracy. At the same time, existing gas detection technologies use fixed thresholds for judgment, ignoring the impact of time period and location on gas concentration, resulting in a high probability of misjudgment. Summary of the Invention
[0004] In response to the shortcomings of the existing technology, the present invention proposes a gas detection alarm method to achieve accurate gas concentration detection based on coordinated control of constant temperature and humidity, as well as adaptive hazard judgment considering the detection position and detection time period, thereby improving the gas measurement accuracy and reducing the probability of misjudgment.
[0005] The technical solutions for achieving the purpose of the present invention are:
[0006] The gas detection alarm method comprises the following steps:
[0007] At the current detection moment Collect ambient gas samples and measure the current sample temperature , sample humidity And compare the standard temperature , standard humidity To calculate the temperature deviation , humidity deviation , combined with the coupling compensation model to obtain the current temperature compensation and humidity compensation ;
[0008] Using the dual-agent coordination algorithm, the temperature control device and the humidity control device are regarded as agents and the experience pool is collected through simulation control to train and update the action network, benefit network and target network of the agent. After the training is completed, the current temperature control action of the agent is determined based on the deviation and compensation of temperature and humidity. and humidity control actions To make the ambient gas sample reach the standard temperature With standard humidity ;
[0009] measure the current gas concentration table , extract the current detection time , detection location and the spatiotemporal characteristics of the gas concentration table generate the current probability density , based on the attribution relationship between the probability density and the confidence interval decide the current environmental state label ;
[0010] classify the current gas concentration table , detection time , detection location and environmental state label to the leaf node of the decision tree through the Bayesian classifier to determine the next detection time .
[0011] Specifically, the coupling compensation model considers the mutual influence relationship of temperature control and humidity control, indicating that the humidity compensation is linearly related to the temperature deviation and the temperature compensation is linearly related to the humidity deviation , and the coefficients and biases of linear correlation are determined by linear regression method combined with a large amount of historical temperature data and humidity data.
[0012] Further, the dual-agent coordination algorithm is used to determine the current temperature control action and humidity control action so that the environmental gas sample reaches the standard temperature and the standard humidity , including the following steps:
[0013] initialize the temperature control parameter and humidity control parameter of the temperature control action network and the humidity control action network , the input and output of the temperature control action network are the temperature state vector spliced by the temperature deviation and the temperature compensation and the temperature control action , and the input and output of the humidity control action network are the humidity state vector spliced by the humidity deviation and the humidity compensation and the humidity control action ;
[0014] Initialize the temperature gain network , humidity benefit network Temperature gain parameters and humidity gain parameters , temperature gain network and humidity benefits network The outputs are the future temperature control benefits and humidity control benefits;
[0015] Copy the temperature control action network, humidity control action network, temperature benefit network and humidity benefit network to generate the corresponding target network. The target network includes the target temperature control action network. , target humidity control action network , target temperature benefit network and target humidity gain network , the target parameters of the target network include the target temperature control parameters , target humidity control parameters , target temperature benefit parameters and target humidity gain parameters ,in, and Target temperature control action network Output target temperature control action and target humidity control action network Output target humidity control action, target temperature benefit network and target humidity gain network The outputs are target temperature control benefit and target humidity control benefit respectively;
[0016] Setting up the temperature control reward function and humidity control reward function , when the temperature deviation and humidity deviation When the absolute value of is less than the corresponding deviation threshold, the temperature control reward function and humidity control reward function Will give immediate positive rewards;
[0017] The current temperature state vector and humidity state vector As the temperature state vector of the first round and humidity state vector , input the temperature state vector and humidity state vector of each round into the temperature control action network and humidity control action network Generate temperature control actions and humidity control actions and simulate their execution, generate the temperature state vector and humidity state vector for the next round and calculate the temperature control reward and humidity control reward for each round, and use the input, output, generated amount and calculation results in each round to form the experience sample for each round, and repeat Round building experience pool;
[0018] Use the experience pool to collaboratively train the temperature control agent and the humidity control agent, and define the Target temperature control contribution of the wheel and target humidity control contribution Equal to the Wheel temperature control bonus Add a conversion factor With the Target temperature control benefit of the wheel The product and Wheel Humidity Control Bonus Add a conversion factor With the Target moisture control benefit of the wheel The product of , where and Respectively Wheel temperature state vector Substitute the target temperature control action network Output The target temperature control action of the round and the Wheel humidity state vector Substitute into the target humidity control action network Output The target wet control action of the wheel, , is the total number of iterations, and defines the temperature control loss and moisture loss They are The mean error between the target temperature control contribution and the temperature control benefit, and the mean error between the target humidity control contribution and the humidity control benefit of the wheel;
[0019] Utilize temperature control loss About temperature gain parameters Negative gradient and humidity control loss About humidity gain parameters The negative gradient of the temperature gain parameter is updated and humidity gain parameters ,in accordance with The temperature control benefit and temperature control action of the wheel are related to the temperature control parameters The mean and product of the gradients of The wheel's humidity control benefits and humidity control actions are related to humidity control parameters The mean of the product of the gradients of and humidity control parameters , update the target parameters of the target network to the balance coefficient The product of the corresponding original network parameters plus the balanced complementary coefficient The product of the current target parameter;
[0020] When the mean of all negative gradients and the product of gradients converges, the training of the temperature control agent and the humidity control agent is completed, and the current temperature state vector and humidity state vector Input the trained temperature control action network and humidity control action network , get the current temperature control action and humidity control actions And execute, so that the ambient sample gas reaches the standard temperature With standard humidity .
[0021] Specifically, the current gas concentration table Including current carbon dioxide concentrations , total hydrocarbon concentration and hydrogen sulfide concentration , measured by existing infrared absorption method, photoionization detection method and electrochemical method respectively.
[0022] Furthermore, spatiotemporal Gaussian modeling is used to extract the current detection moment , detection position and gas concentration table The spatiotemporal characteristics generate the current probability density , based on the probability density With confidence interval The current environment state label is determined by the ownership relationship , including the following steps:
[0023] The current detection time , detection position and gas concentration table Splice into the current feature vector , based on the training mean and training variance Normalize the current feature vector , generate the standard feature vector , where the training mean and training variance For the training set The mean and variance of the distribution of the eigenvectors in ;
[0024] The standard feature vector Input spatiotemporal convolution model, using point-by-point temporal convolution to expand the standard feature vector Channel, generate the current first feature matrix , use channel-by-channel time convolution to transform the first feature matrix middle The features of each channel are weighted and aggregated to generate the current second feature vector , using dilated spatial convolution to capture the second eigenvector The spatial dependency relationship generates the current spatiotemporal feature vector , where the dilated spatial convolution is achieved by inserting 0 into the traditional convolution kernel;
[0025] The spatiotemporal feature vector Enter the Gaussian model Generate the current probability density And determine whether it is in the confidence interval If it is within the confidence interval Set the environment status tag To reflect the safety status, if it is in the confidence interval In addition, set the environment status tag To reflect dangerous conditions.
[0026] Furthermore, the spatiotemporal convolutional model and Gaussian model need to be pre-trained, including the following steps:
[0027] Collect multiple different feature vectors to construct a training set , each feature vector includes the detection time, detection location and gas concentration table in a safe state, and the training set is calculated The training mean and training variance ;
[0028] Build a spatiotemporal convolution model and initialize the convolution parameters , standardize the training set The feature vector in is input into the spatiotemporal convolution model to generate a spatiotemporal feature vector set , the maximum likelihood estimation method is used to calculate the spatiotemporal feature vector set The estimated mean vector of the spatiotemporal characteristic vector and the estimated covariance matrix ;
[0029] Based on the estimated mean vector and the estimated covariance matrix Building a Gaussian model , define the loss function is the space-time feature vector set Each spatiotemporal feature vector is input into the Gaussian model The sum of the negative logarithms of the resulting probability densities;
[0030] Use stochastic gradient descent to continuously update the convolution parameters To minimize the loss function And update the Gaussian model until the loss function Convergence, set the confidence level to 0.95, based on the Gaussian distribution characteristics, the confidence interval Located at the estimated mean vector The range is plus or minus 1.96 times the standard deviation vector, where the square of the standard deviation vector is the estimated covariance matrix. The variance vector formed by the arrangement of the diagonal elements of .
[0031] Furthermore, the construction of the decision tree is based on the classification and regression tree, and multiple decision feature vectors are collected to construct the decision training set. Each decision feature vector includes detection time, detection location, gas concentration table, environmental state label and detection interval. The matching data set of the root node is set as the decision training set. , calculate the Gini index of each eigenvalue of each feature in the decision feature vector for the root node, take the feature with the smallest Gini index and the corresponding eigenvalue as the split feature and split value of the root node, perform node splitting, and convert the decision training set The decision feature vectors whose eigenvalues of the split feature are less than or equal to the split value are used as the matching data set of the first-level left node, and the remaining decision feature vectors are used as the matching data set of the first-level right node. Separability judgment is performed on each node. When the Gini value of the matching data set of the node is less than the Gini threshold or the number of decision feature vectors of the matching data set is less than the minimum number of vectors, the node is regarded as a leaf node and the splitting is stopped. In other cases, node splitting and separability judgment are recursively performed on the node until all nodes are leaf nodes, and the leaf nodes are marked using the average detection interval of the matching data set of each leaf node.
[0032] Furthermore, the current gas concentration table is transformed into , detection time , detection position and environmental status tags Classify the leaf nodes of the decision tree to determine the next detection time , including the following specific steps:
[0033] Label the current environment status With the characteristic vector Spliced into the current decision feature vector ;
[0034] Calculate the prior probability of each leaf node in the decision tree. The prior probability of each leaf node is equal to the number of decision feature vectors of the matching dataset of the leaf node divided by the decision training set. The total number of decision feature vectors;
[0035] Calculate the conditional probability of each leaf node, the conditional probability of each leaf node is equal to the decision feature vector The product of the probability of the feature value of each dimension in the matching data set of the leaf node;
[0036] Based on Bayesian theorem, the posterior probability of each leaf node is positively correlated with the product of the prior probability and conditional probability of the leaf node. Belong to the leaf node with the largest product of prior probability and conditional probability;
[0037] Get decision feature vector The average detection interval of the leaf node mark, the next detection time Equal to the current detection time Add the obtained average detection interval.
[0038] Compared with the prior art, the present invention has the following significant advantages:
[0039] 1. Collect ambient gas samples at the detection time and measure the temperature and humidity of the samples. Based on the deviation of temperature and humidity, the corresponding compensation is obtained in combination with a coupling compensation model that considers the interaction between temperature change and humidity change. Using the dual-agent coordination algorithm, the temperature control equipment and the humidity control equipment are regarded as intelligent agents for simulation control training. After training, the temperature control action and humidity control action are determined based on the deviation and compensation of temperature and humidity to make the ambient gas sample reach the standard temperature and standard humidity, thereby avoiding the influence of temperature and humidity on gas concentration measurement.
[0040] 2. Spatiotemporal Gaussian modeling is used to extract the spatiotemporal features of the current detection time, detection location, and gas concentration table to generate the current probability density and determine the current environmental status label. The Bayesian classifier is used to classify the current gas concentration table, detection time, detection location, and environmental status label into leaf nodes of the decision tree to determine the next detection time. This achieves dynamic decision-making and judgment of environmental hazards that takes into account spatiotemporal relationships. At the same time, the detection interval is adaptively determined based on the judgment results to avoid unnecessary frequent detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a flow chart of the gas detection alarm method;
[0042] Figure 2 Flowchart for generating the current probability density and deciding the current environment state label using spatiotemporal Gaussian modeling;
[0043] Figure 3 Pre-training flowchart for spatiotemporal convolutional model and Gaussian model;
[0044] Figure 4 This is a flowchart for determining the next detection time using a Bayesian classifier. DETAILED DESCRIPTION
[0045] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0046] like Figure 1 As shown, a specific embodiment of the present invention discloses a gas detection alarm method, comprising the following steps:
[0047] Arrival at the current detection time , collect environmental gas samples and store them in the control area, and measure the current sample temperature through temperature sensors and humidity sensors and sample humidity Based on the coupling compensation model, the mutual influence of temperature control and humidity control is considered, and the current sample temperature is With standard temperature Temperature deviation , sample humidity With standard humidity Humidity deviation , get the current temperature compensation and humidity compensation ;
[0048] Using the dual-agent coordination algorithm, the temperature control device and the humidity control device are regarded as independent agents. Through simulation and regulation, the experience pool is collected, the action network and benefit network of the agent are iteratively trained, and the target network is soft-updated to stabilize the training process. After the training is completed, based on the current temperature deviation , humidity deviation , temperature compensation and humidity compensation , output temperature control action and humidity control actions And coordinate the operation of temperature control equipment and humidity control equipment to make the ambient gas sample reach the standard temperature With standard humidity ;
[0049] The regulated ambient gas samples are transported to the detection area and the current gas concentration is measured by infrared absorption, photoionization detection and electrochemical methods. , using spatiotemporal Gaussian modeling to extract the current detection moment , detection position and gas concentration table The spatiotemporal characteristics of the , based on the probability density With confidence interval The current environment state label is determined by the ownership relationship , where the gas concentration table Including current carbon dioxide concentrations , total hydrocarbon concentration and hydrogen sulfide concentration , environmental status label The values reflect dangerous and safe states;
[0050] Based on the constructed decision tree, the current gas concentration table is classified into , detection time , detection position and environmental status tags Classify the leaf nodes of the decision tree to determine the next detection time .
[0051] Specifically, the coupling compensation model is based on the sample temperature With standard temperature Temperature deviation and sample humidity With standard humidity Humidity deviation , based on the mutual influence relationship, calculate the humidity compensation of temperature control for humidity control And humidity control to temperature compensation of temperature control , providing a theoretical basis for the dual-agent coordination algorithm to coordinate the temperature and humidity of environmental gas samples. The coupled compensation model shows that humidity compensation Temperature deviation Linearly dependent and temperature compensated Deviation from humidity They are linearly related, as follows:
[0052] ,
[0053] ,
[0054] in, and are the moisture compensation coefficient and temperature compensation coefficient respectively, and They are humidity compensation bias and temperature compensation bias respectively. The coupling compensation model is built based on a large amount of historical temperature data and humidity data. The linear regression method is used to find the temperature deviation. With humidity compensation , humidity deviation With temperature compensation The linear relationship between the wet filling coefficient , wet compensation bias and temperature compensation coefficient , temperature compensation bias , quantify the effect of temperature control on humidity control and the effect of humidity control on temperature control.
[0055] Furthermore, the dual-agent coordination algorithm is used to coordinate the operation of the temperature control device and the humidity control device to maintain a constant standard temperature of the ambient gas sample. With standard humidity , including the following steps:
[0056] Initialize the temperature control action network Temperature control parameters , is the temperature state vector, and Respectively, temperature deviation and temperature compensation, temperature control action network The output is the temperature control action of the temperature control agent ;
[0057] Initialize the humidity control action network Humidity control parameters , is the humidity state vector, and They are humidity deviation and humidity compensation, humidity control action network The output is the humidity control action of the humidity control agent ;
[0058] Initialize the temperature gain network Temperature gain parameters , temperature gain network The output is the future temperature control benefits of the actions of the two independent agents under the corresponding state vectors;
[0059] Initialize the humidity gain network Humidity gain parameters , humidity gain network The output is the future humidity control benefits of the actions of the two independent agents under the corresponding state vectors;
[0060] Copy the temperature control action network separately , humidity control action network , Temperature Gain Network and humidity benefits network The network structure and parameters are used to generate the corresponding target network, which includes the target temperature control action network , target humidity control action network , target temperature benefit network and target humidity gain network , the target parameters of the target network include the target temperature control parameters , target humidity control parameters , target temperature benefit parameters and target humidity gain parameters ,in, and are the target temperature control action network and the target humidity control action network are the output of the target humidity control action, the target temperature reward network and the target humidity reward network The outputs of the target temperature reward network and the target humidity reward network are the target temperature reward and the target humidity reward, respectively.
[0061] The temperature control reward function and the humidity control reward function are used to evaluate the instant temperature reward and humidity reward, which are as follows:
[0062] ,
[0063] ,
[0064] wherein, and are the temperature deviation threshold and the humidity deviation threshold, respectively, when the absolute value of the temperature deviation and the humidity deviation is less than the temperature deviation threshold and the humidity deviation threshold , the temperature control reward function and the humidity control reward function will give a positive reward.
[0065] The current temperature state vector and the humidity state vector are taken as the temperature state vector and the humidity state vector of the first round, respectively. The temperature state vector and the humidity state vector of each round are input into the temperature control action network and the humidity control action network , respectively, and the temperature control agent and the humidity control agent simulate the execution of the generated temperature control action and humidity control action to generate the temperature state vector and the humidity state vector of the next round, and calculate the temperature control reward and the humidity control reward of each round. Repeat iteration rounds to build an experience pool, which includes round experience samples, the round experience samples include the round temperature state vector , humidity state vector , temperature control action , humidity control action , temperature control reward , humidity control reward and the Wheel temperature state vector and humidity state vector , , is the total number of iterations;
[0066] Using the experience pool The experience samples of the first round are used to collaboratively train the temperature control agent and the humidity control agent, and define the Target temperature control contribution of the wheel Equal to Wheel temperature control reward Add a certain percentage of the conversion Target temperature control benefit of the wheel , as follows:
[0067] ,
[0068] in, is the conversion factor. Similarly, Targeted humidity control contribution of the wheel Equal to Wheel Humidity Control Bonus Add a certain percentage of the conversion Target moisture control benefit of the wheel , as follows:
[0069] ,
[0070] in, and Respectively Wheel temperature state vector Substitute the target temperature control action network Output target temperature control action and Wheel humidity state vector Substitute into the target humidity control action network Output target humidity control action;
[0071] in accordance with The mean error between the target temperature control contribution and the temperature control benefit and the mean error between the target humidity control contribution and the humidity control benefit define the temperature control loss respectively. and moisture loss , as follows:
[0072] ,
[0073] ,
[0074] in, and Respectively The temperature control benefit and humidity control benefit of the wheel are relatively accurate measures of action benefits, because the target temperature control contribution and target humidity control contribution take into account the immediate reward and future benefits. The temperature control benefit and humidity control benefit are calculated through the temperature benefit network. and humidity benefits network Estimation of motion gain, temperature control loss and moisture loss It reflects the degree of deviation between the profit estimate and the accurate profit;
[0075] Utilize temperature control loss About temperature gain parameters Negative gradient and learning rate The product of the temperature gain network is updated Temperature gain parameters , using moisture loss control About humidity gain parameters Negative gradient and learning rate The product of the humidity gain network is updated Humidity gain parameters ;
[0076] Calculation temperature control action network About temperature control parameters The temperature control strategy gradient is equal to The temperature control benefit and temperature control action of the wheel are related to the temperature control parameters The mean of the product of the gradients of About temperature control parameters Temperature control strategy gradient and learning rate Update the temperature control parameters by multiplying ;
[0077] Computational Humidity Control Action Network About humidity control parameters The humidity control strategy gradient is equal to The wheel's humidity control benefits and humidity control actions are related to humidity control parameters The mean of the product of the gradients of About humidity control parameters Humidity control strategy gradient and learning rate Update the humidity control parameters by multiplying ;
[0078] Based on the balance coefficient and the equilibrium complementarity coefficient Target temperature control parameters , target humidity control parameters , target temperature benefit parameters and target humidity gain parameters Perform soft update, i.e. target temperature control parameters Updated to balance coefficient and temperature control parameters The product of the current target temperature control parameter Complementarity coefficient with equilibrium The product of target humidity control parameters Updated to balance coefficient and humidity control parameters The product of the current target humidity control parameter Complementarity coefficient with equilibrium The product of the target temperature gain parameter Updated to balance coefficient Gain parameters with temperature The product of the current target temperature gain parameter Complementarity coefficient with equilibrium The product of the target humidity gain parameter Updated to balance coefficient and humidity gain parameters The product of the current target humidity gain parameter Complementarity coefficient with equilibrium The product of
[0079] When temperature control loss About temperature gain parameters Negative gradient, humidity control loss About humidity gain parameters Negative gradient, temperature control action network About temperature control parameters Temperature control strategy gradient and humidity control action network About humidity control parameters When the gradients of the humidity control strategies converge, the training of the temperature control agent and the humidity control agent is completed;
[0080] The current temperature state vector and humidity state vector Input the trained temperature control action network respectively and humidity control action network , get the current temperature control action and humidity control actions And control the temperature control equipment and humidity control equipment to make the environmental sample gas reach the standard temperature With standard humidity .
[0081] Specifically, infrared absorption method is used to measure carbon dioxide concentration , start the infrared light source to emit infrared light containing the characteristic wavelength of carbon dioxide absorption to the environmental sample gas, and convert the received light signal after being absorbed by the environmental sample gas into an electrical signal through the detector to detect the attenuation of light intensity. Based on the Beer-Lambert law, the attenuation of light intensity is related to the concentration of carbon dioxide. The carbon dioxide concentration is calculated based on the pre-calibrated light intensity attenuation-concentration ratio. .
[0082] Specifically, photoionization detection is used to measure total hydrocarbon concentration , using ultraviolet light source to irradiate the environmental sample gas, the total hydrocarbon absorbs the photon energy and is converted into ions, and the ions move in a directional manner under the action of the electric field to produce the total hydrocarbon concentration. The relevant current is converted into total hydrocarbon concentration based on the current intensity .
[0083] Specifically, electrochemical measurement is used to measure hydrogen sulfide concentration The environmental gas sample is filtered and diluted through a porous membrane by using a pump suction sampling method, so that the hydrogen sulfide in the environmental gas sample undergoes an oxidation reaction at the working electrode to produce a concentration of hydrogen sulfide. The proportional current signal is further amplified, filtered and converted into the hydrogen sulfide concentration. .
[0084] like Figure 2 As shown, further, spatiotemporal Gaussian modeling is used to extract the current detection moment , detection position and gas concentration table The spatiotemporal characteristics of the , based on the probability density With confidence interval The current environment state label is determined by the ownership relationship , including the following steps:
[0085] The current detection time , detection position and gas concentration table Splice into the current feature vector , the dimension is , based on the training mean and training variance For the current feature vector Perform standardization to generate standard feature vector , where the training mean and training variance For the training set The mean and variance of the distribution of the eigenvectors in ;
[0086] The standard feature vector Input the trained spatiotemporal convolution model and use point-by-point temporal convolution to expand the standard feature vector of a single channel Channel, generate the current first feature matrix ,in, represents the convolution operation, and They are the first convolution kernel and the first bias matrix, respectively, with dimensions of and , is the number of channels, compared to the standard feature vector , the dimension is The first characteristic matrix of It includes feature information of different channels, which expands the expression capacity of the spatiotemporal convolution model and helps to establish more complex nonlinear mapping relationships;
[0087] Use channel-by-channel temporal convolution to transform the first feature matrix middle The features of each channel are weighted and aggregated to remove redundant features and generate the current second feature vector ,in, and The second convolution kernel and the second bias vector are respectively, and the dimensions are and , is the size of the second convolution kernel, is a predefined dimensionality reduction number compared to the first characteristic matrix , the dimension is The second eigenvector of The computational complexity of the spatiotemporal convolution model is greatly reduced, highlighting the key feature information in time series;
[0088] Use dilated spatial convolution to capture the second eigenvector The spatial dependency relationship generates the current spatiotemporal feature vector , among which, spatiotemporal features The calculation formula is as follows:
[0089] ,
[0090] in, and The third convolution kernel The convolution weights and the current spatiotemporal feature vector Middle If the spatiotemporal characteristics , then spatiotemporal features , and are the size and void ratio of the third convolution kernel, respectively. Equal to the third convolution kernel The number of 0 elements inserted between adjacent convolution weights, , ;
[0091] The current spatiotemporal feature vector Input the trained Gaussian model , generating the current probability density And determine whether it is in the confidence interval of the Gaussian distribution If it is within the confidence interval In the inside, it indicates that the current space-time feature vector Data distribution that complies with security status, setting environment status labels To reflect the safety status, if it is in the confidence interval In addition, it indicates the current detection time and detection position , gas concentration table Data distribution that does not conform to the safe state, set the environment status label To reflect dangerous conditions.
[0092] like Figure 3 As shown, further, the spatiotemporal convolutional model and Gaussian model need to be pre-trained, including the following steps:
[0093] collect Different feature vectors to construct the training set ,Each feature vector includes the detection time, detection location and a table of gas concentration in a safe state;
[0094] Calculate and obtain the training set The mean and variance of the feature vector distribution in are used as training means and training variance ;
[0095] Construct a spatiotemporal convolution model, including point-by-point temporal convolution, channel-by-channel convolution layer, and dilated spatial convolution layer, and initialize the convolution parameters involved in the spatiotemporal convolution model ;
[0096] Standardize the training set The feature vector in is input into the spatiotemporal convolution model to generate a spatiotemporal feature vector set , the maximum likelihood estimation method is used to calculate the spatiotemporal feature vector set The estimated mean vector of the spatiotemporal characteristic vector and the estimated covariance matrix , as follows:
[0097] ,
[0098] ,
[0099] in, is the space-time feature vector set Middle spatiotemporal feature vectors, represents the transpose of a vector or matrix, ;
[0100] Based on the estimated mean vector and the estimated covariance matrix Building a Gaussian model , define the loss function is the negative log-likelihood function, the loss function is the space-time feature vector set Each spatiotemporal feature vector is input into the Gaussian model The sum of the negative logarithms of the resulting probability densities is as follows:
[0101] ;
[0102] Use stochastic gradient descent to continuously update the convolution parameters To minimize the loss function And update the Gaussian model, when the loss function Obtain the spatiotemporal convolutional model and Gaussian model upon convergence;
[0103] Set the confidence level to 0.95, based on the Gaussian distribution characteristics, the confidence interval Located at the estimated mean vector The range is plus or minus 1.96 times the standard deviation vector, as follows:
[0104] ,
[0105] in, Indicates taking the estimated covariance matrix The variance vector of the diagonal elements in , and the variance vector is equal to the square of the standard deviation vector.
[0106] Furthermore, the construction of the decision tree is based on the classification and regression tree, and different decision feature vectors are collected to construct the decision training set. Each decision feature vector includes detection time, detection location, gas concentration table, environmental state label and detection interval. The Gini index is used as the metric for feature selection, and the matching data set of the root node is set as the decision training set. , calculate the Gini index of the matching data set of the root node for each feature in the decision feature vector, and use the feature with the smallest Gini index and the corresponding feature value as the split feature and split value of the root node to perform node splitting. Divide into first-level left nodes and first-level right nodes and set corresponding matching data sets respectively. The matching data sets of first-level left nodes and first-level right nodes are decision training sets respectively. The decision feature vectors whose eigenvalues of all split features are less than or equal to the split value and the decision feature vectors whose eigenvalues of all split features are greater than the split value are selected. For each node, a separable judgment is performed. When the Gini value of the matching data set of the node is less than the Gini threshold or the number of decision feature vectors of the matching data set is less than the minimum number of vectors, the node is regarded as a leaf node and the splitting is stopped. In other cases, the node splitting and separable judgment are recursively performed on the node until all nodes are leaf nodes. The leaf node is marked using the next average detection interval in the matching data set of each leaf node, and the decision tree is constructed.
[0107] like Figure 4 As shown, further, based on the constructed decision tree, the current gas concentration table is classified into , detection time , detection position and environmental status tags Classify as a leaf node of the decision tree and determine the next detection time , including the following steps:
[0108] Label the current environment status With the characteristic vector Spliced into the current decision feature vector ;
[0109] Calculate the prior probability of each leaf node in the decision tree. The prior probability of each leaf node is equal to the number of decision feature vectors of the matching dataset of the leaf node divided by the decision training set. The total number of decision feature vectors;
[0110] Calculate the conditional probability of each leaf node, the conditional probability of each leaf node is equal to the decision feature vector The product of the probability of the feature value of each dimension in the matching data set of the leaf node;
[0111] Based on Bayesian theorem, the posterior probability of each leaf node is positively correlated with the product of the prior probability and conditional probability of the leaf node. Belong to the leaf node with the largest product of prior probability and conditional probability;
[0112] Get decision feature vector The average detection interval of the leaf node mark, the next detection time Equal to the current detection time The average detection interval of the leaf nodes to be added.
[0113] The present invention discloses a gas detection alarm method, which collects environmental gas samples and measures the temperature and humidity of the samples at the detection time, obtains corresponding compensation based on the deviation of temperature and humidity, and combines a coupling compensation model that considers the interactive influence of temperature change and humidity change, and uses a dual-agent coordination algorithm to regard the temperature control device and the humidity control device as intelligent agents for simulation control training. After training, the temperature control action and the humidity control action are determined based on the deviation and compensation of temperature and humidity to make the environmental gas sample reach the standard temperature and standard humidity, avoiding the influence of temperature and humidity on gas concentration measurement; uses spatiotemporal Gaussian modeling to extract the spatiotemporal characteristics of the current detection time, detection position and gas concentration table and generate the current probability density, and decides the current environmental state label; uses a Bayesian classifier to classify the current gas concentration table, detection time, detection position and environmental state label into the leaf nodes of the decision tree to determine the next detection time, thereby realizing dynamic decision-making and judgment of environmental hazards considering the spatiotemporal relationship, and adaptively determines the detection interval based on the judgment result to avoid unnecessary frequent detection.
[0114] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the concept of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A gas detection alarm method, characterized in that: The following steps are involved: Collect ambient gas samples at the current detection time, measure the current sample temperature and sample humidity, calculate the temperature deviation and humidity deviation, and use the coupling compensation model to obtain the current temperature compensation and humidity compensation; Using the dual-agent coordination algorithm, the temperature control device and the humidity control device are regarded as agents respectively. Through simulation control, the experience pool is collected to train and update the action network, benefit network and target network. After training, the temperature control action and humidity control action are determined based on the deviation and compensation of temperature and humidity to make the ambient gas sample reach the standard temperature and standard humidity. The experience pool includes The experience samples of each round include the temperature state vector, humidity state vector, temperature control action, humidity control action, temperature control reward, humidity control reward, and the temperature state vector and humidity state vector of the next round; Spatiotemporal Gaussian modeling is used to extract the spatiotemporal features of the current detection time, detection location, and gas concentration table to generate the current probability density. The current environmental state label is determined based on the relationship between the probability density and the confidence interval. The current gas concentration table, detection time, detection location, and environmental status label are classified into the leaf nodes of the decision tree through the Bayesian classifier to determine the next detection time; Among them, the dual-agent coordination algorithm initializes the temperature control parameters and humidity control parameters of the temperature control action network and the humidity control action network. The input and output of the temperature control action network are the temperature state vector and temperature control action spliced by temperature deviation and temperature compensation respectively. The input and output of the humidity control action network are the humidity state vector and humidity control action spliced by humidity deviation and humidity compensation respectively. The temperature gain parameters and humidity gain parameters of the temperature gain network and the humidity gain network are initialized. The outputs of the temperature gain network and the humidity gain network are temperature control gain and humidity control gain respectively. The temperature control action network, the humidity control action network, the temperature gain network and the humidity gain network are copied to generate the corresponding target network and determine the target temperature control parameters, target humidity control parameters, target temperature gain parameters and target humidity gain parameters respectively. The target network includes the target temperature control action network, the target humidity control action network, the target temperature gain network and the target humidity gain network. Among them, the outputs of the target temperature control action network and the target humidity control action network are the target temperature control action and the target humidity control action. The inputs of the target temperature gain network and the target humidity gain network are the target temperature control action and the target humidity control action respectively. The outputs of the target temperature gain network and the target humidity gain network are the target temperature control gain and the target humidity control gain respectively. The dual-agent coordination algorithm is used for the first The experience sample of the round, define the The target temperature control contribution and target humidity control contribution of the first round are equal to The temperature control reward plus the conversion factor of the first round The product of the target temperature control benefits of the first round and the The humidity control bonus plus the conversion factor of the first round The product of the target humidity control benefits of the wheel, , is the total number of iterations; the temperature control loss and humidity control loss are defined as The mean error between the target temperature control contribution and the temperature control benefit of each round, and the mean error between the target humidity control contribution and the humidity control benefit, are used to update the temperature benefit parameter and the humidity benefit parameter respectively using the negative gradient of the temperature control loss with respect to the temperature benefit parameter and the negative gradient of the humidity control loss with respect to the humidity benefit parameter; the temperature control parameter and the humidity control parameter are updated respectively based on the mean of the product of the temperature control benefit and the gradient of the temperature control action with respect to the temperature control parameter of all rounds, and the mean of the product of the humidity control benefit and the gradient of the humidity control action with respect to the humidity control parameter; the target parameters of the target network are updated to the product of the stability coefficient and the corresponding original network parameters plus the product of the balance complementary coefficient and the current target parameters; when the mean of all negative gradients and gradient products converge, the training and update of the temperature control agent and the humidity control agent are completed; The spatiotemporal Gaussian modeling splices the current detection time, detection location and gas concentration table, and pre-processes the training mean and training variance of the training set to generate a standard feature vector and input it into the spatiotemporal convolution model. The current spatiotemporal feature vector is generated and input into the Gaussian model. The current probability density is generated and the attribution relationship with the confidence interval is judged. If the current probability density is outside the confidence interval, the environmental status label is set to a dangerous state that requires an alarm. The confidence interval is determined based on the preset confidence level, the estimated mean vector and the estimated covariance matrix. During the training process, the standardized training set is input into the spatiotemporal convolution model and the maximum likelihood estimation method is used to calculate the estimated mean vector and the estimated covariance matrix.
2. The gas detection alarm method according to claim 1, wherein: Experience pool includes The experience samples of each round include the temperature state vector, humidity state vector, temperature control action, humidity control action, temperature control reward, humidity control reward and the temperature state vector and humidity state vector of the next round. The temperature state vector and humidity state vector of each round are respectively input into the temperature control action network and the humidity control action network to generate temperature control action and humidity control action and simulate execution to generate the temperature state vector and humidity state vector of the next round, and calculate the temperature control reward and humidity control reward of each round, and integrate to generate the experience samples of each round. Among them, the temperature state vector and humidity state vector of the first round are the current temperature state vector and humidity state vector respectively. The temperature control reward and humidity control reward are calculated based on the temperature control reward function and the humidity control reward function. When the absolute value of the temperature deviation and the humidity deviation is less than the corresponding deviation threshold, the temperature control reward function and the humidity control reward function will give positive rewards, and negative rewards will be given in other cases.
3. The gas detection alarm method according to claim 1, wherein: The method of using spatiotemporal Gaussian modeling to extract the spatiotemporal features of the current detection time, detection location, and gas concentration table to generate the current probability density, and determining the current environmental state label based on the attribution relationship between the probability density and the confidence interval, includes the following specific steps: Input the standard feature vector into the trained spatiotemporal convolution model, and use point-by-point temporal convolution to expand the channel of the single-channel standard feature vector to generate the current first feature matrix; Channel-by-channel temporal convolution is used to weight the features of each channel in the first feature matrix to generate the current second feature vector; Use dilated spatial convolution to capture the spatial dependency of the second eigenvector and generate the current spatiotemporal eigenvector; The current spatiotemporal feature vector is input into the trained Gaussian model to generate the current probability density and determine whether it is within the confidence interval of the Gaussian distribution. If it is within the confidence interval, it indicates that the current spatiotemporal feature vector conforms to the data distribution of the safe state, and an environmental state label reflecting the safe state is set. If it is outside the confidence interval, it indicates that the current spatiotemporal feature vector does not conform to the data distribution of the safe state, and an environmental state label reflecting the dangerous state is set.
4. The gas detection alarm method according to claim 3, wherein: The pre-training of spatiotemporal convolutional models and Gaussian models includes the following specific steps: Collect multiple different feature vectors to construct a training set, each feature vector includes the detection time, detection location and gas concentration table in a safe state; Calculate the mean and variance of the feature vector distribution in the training set and use them as the training mean and training variance respectively; Construct a spatiotemporal convolution model and initialize the convolution parameters involved in the spatiotemporal convolution model; The feature vectors in the training set are normalized and input into the spatiotemporal convolution model to generate a spatiotemporal feature vector set. The estimated mean vector and estimated covariance matrix of the spatiotemporal feature vectors in the spatiotemporal feature vector set are calculated using the maximum likelihood estimation method. A Gaussian model is constructed based on the estimated mean vector and the estimated covariance matrix, and the loss function is defined as a negative log-likelihood function. The loss function is the sum of the negative logarithms of the probability density obtained by inputting each spatiotemporal feature vector in the spatiotemporal feature vector set into the Gaussian model. Use stochastic gradient descent to continuously update the convolution parameters to minimize the loss function and update the Gaussian model. When the loss function converges, the spatiotemporal convolution model and Gaussian model are obtained. The confidence level is set to 0.
95. Based on the Gaussian distribution characteristics, the confidence interval is within the range of the estimated mean vector plus or minus 1.96 times the standard deviation vector.
5. The gas detection alarm method according to claim 1, wherein: The construction of the decision tree is based on the classification and regression tree. Multiple decision feature vectors are collected to construct a decision training set. Each decision feature vector includes the detection time, detection location, gas concentration table, environmental state label and detection interval. The matching data set of the root node is set as the decision training set. The Gini index of each eigenvalue of each feature in the decision feature vector for the root node is calculated. The feature with the smallest Gini index and the corresponding eigenvalue are used as the split feature and split value of the root node. Node splitting is performed. The decision feature vector with the eigenvalue of the split feature in the decision training set is less than or equal to the split value as the matching data set of the first-level left node, and the remaining decision feature vectors are used as the matching data set of the first-level right node. Separability judgment is performed on each node. When the Gini value of the node's matching data set is less than the Gini threshold or the number of decision feature vectors in the matching data set is less than the minimum number of vectors, the node is regarded as a leaf node and splitting is stopped. In other cases, node splitting and separability judgment are recursively performed on the nodes until all nodes are leaf nodes and the leaf nodes are marked using the average detection interval of the matching data set of each leaf node.
6. The gas detection alarm method according to claim 1, wherein: The method of classifying the current gas concentration table, detection time, detection location, and environmental status label into the leaf nodes of the decision tree by using the Bayesian classifier to determine the next detection time includes the following specific steps: The current environment state label and feature vector are concatenated into the current decision feature vector; Calculate the prior probability of each leaf node in the decision tree. The prior probability of each leaf node is equal to the number of decision feature vectors in the matching data set of the leaf node divided by the total number of decision feature vectors in the decision training set. Calculate the conditional probability of each leaf node. The conditional probability of each leaf node is equal to the product of the probability of the feature value of each dimension in the decision feature vector appearing in the matching data set of the leaf node; Based on Bayesian theorem, the decision feature vector is assigned to the leaf node with the largest product of prior probability and conditional probability; The average detection interval of the leaf node label to which the decision feature vector belongs is obtained, and the next detection time is equal to the current detection time plus the obtained average detection interval.
7. The gas detection alarm method according to claim 1, wherein: The coupled compensation model considers the mutual influence between temperature control and humidity control, and is used to express that humidity compensation is linearly correlated with temperature deviation and temperature compensation is linearly correlated with humidity deviation. The linear correlation coefficient and bias are determined by linear regression method combined with historical temperature data and humidity data.
8. The gas detection alarm method according to claim 1, wherein: The current gas concentration table includes the current carbon dioxide concentration, total hydrocarbon concentration and hydrogen sulfide concentration, which are measured by infrared absorption method, photoionization detection method and electrochemical method respectively.
Citation Information
Patent Citations
Gas detection method
CN120064191A
Gas concentration compensation method and gas concentration compensation system
CN120446035A