Malodorous gas qualitative and quantitative detection method and system based on time sequence data
Through the qualitative quantitative detection method of malodor gas based on time sequence data, the main encoder and sequence decomposition unit are used to extract characteristic data, and gas concentration prediction is carried out in combination with the DCT channel attention mechanism layer and external compensation model, which solves the problem of reducing detection accuracy caused by gas sensor drift error, and achieves high-precision detection of malodor gas.
Patent Information
- Application Number
- CN202411967987.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-30
AI Technical Summary
During the continuous detection process, the gas sensor drift error causes the detection accuracy of malodor gases to be reduced, making it difficult to accurately identify multi-component malodor gases and predict gas concentrations.
Qualitative quantitative detection method of foul-odor gas based on time sequence data is adopted, and the comprehensive gas response data is obtained for pre-processing, and the comprehensive feature data and information data are extracted using the main encoder and sequence decomposition unit. Combined with the attention mechanism layer of the DCT channel and the external compensation model, preliminary prediction and drift compensation of gas concentration information are performed, and the detection accuracy is finally improved.
During the short-term drifting state changes, the detection accuracy of malodor gases is optimized, the sensor drift error is reduced, and the multi-component malodor gas recognition accuracy and gas concentration prediction accuracy are improved.
Smart Images

Figure CN119885076A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent gas perception and prediction, and more specifically to a qualitative and quantitative detection method and system for malodorous gases based on time series data. Background Art
[0002] Odor is a general term for various gases with bad odors, which can directly harm and affect people's health and mental state through the human respiratory system. With the rapid development of the global economy, environmental pollution problems are becoming increasingly urgent, and the control of odor pollution has attracted the attention of the whole society.
[0003] At present, the requirements for scientific law enforcement in environmental monitoring are gradually increasing, and detection instruments are also developing towards the trend of intelligence and generalization, which puts forward higher requirements for odor detection. At the same time, odor control relies on accurate information on the concentration of odorous gases. These data can help identify pollution sources, assess the degree of pollution, analyze the real-time diffusion status of odors, and formulate accurate and efficient control measures to ensure people's healthy living environment. In actual detection application scenarios, it is usually necessary to continuously detect odorous gases in the area for a long time to cope with the rapid changes of odorous gases in the actual air. In this scenario, gas sensor detection is inevitably accompanied by sensor drift errors, which will greatly reduce the actual odor gas detection accuracy and bring certain difficulties to continuous odor detection.
[0004] Therefore, how to improve the accuracy of multi-component malodorous gas identification and the accuracy of malodorous gas concentration prediction during continuous detection is an urgent problem that technicians in this field need to solve. Summary of the invention
[0005] In view of this, the present invention provides a method and system for qualitative and quantitative detection of malodorous gases based on time series data, which improves the accuracy of identifying multi-component malodorous gases and the accuracy of predicting malodorous gas concentrations during continuous detection.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A method for qualitative and quantitative detection of malodorous gases based on time series data, comprising:
[0008] Obtain gas comprehensive response data and perform preprocessing to obtain time series response data;
[0009] Based on the time series response data, the data are respectively input into the main encoder and the sequence decomposition unit to obtain comprehensive feature data and comprehensive information data accordingly;
[0010] Based on the comprehensive feature data, input into the first DCT channel attention mechanism layer to obtain enhanced feature data;
[0011] Based on the enhanced characteristic data, input into the main decoder to obtain preliminary gas concentration information;
[0012] Based on the comprehensive information data, the data is input into a data fusion unit to obtain drift information;
[0013] Based on the drift information, the compensation output unit is input to obtain gas concentration compensation information;
[0014] Based on the fusion of the preliminary gas concentration information and the gas concentration compensation information, a multi-channel malodorous gas information prediction result is obtained.
[0015] Preferably, the gas comprehensive response data includes: gas response data and environmental information data;
[0016] The gas response data includes response data to malodorous gases collected by multiple gas sensors;
[0017] The environmental information data includes the air temperature, air humidity and air pressure of the space where the gas sensor is located.
[0018] Preferably, the pretreatment comprises:
[0019] Continuously collecting and storing the gas comprehensive response data based on a preset interval to obtain a gas comprehensive response data group sequence;
[0020] Based on the real-time degree of model response and the size of the time window, the gas comprehensive response data group sequence is segmented according to the set interval to obtain initial time series response data;
[0021] Filtering is performed based on the initial time series response data to obtain the time series response data.
[0022] Preferably, the main encoder comprises: a convolutional neural network unit and a bidirectional long short-term memory network unit;
[0023] The time series response data includes: gas time series response data and environment time series response data;
[0024] The gas time series response data are respectively input into the convolutional neural network unit and the bidirectional long short-term memory network unit, and local spatial feature information and deep feature information are correspondingly obtained;
[0025] The local spatial feature information and the deep feature information are fused to obtain the comprehensive feature data.
[0026] Preferably, the convolutional neural network unit includes: a first one-dimensional convolutional neural network, a first ReLU layer, a second one-dimensional convolutional neural network, a second ReLU layer, a third one-dimensional convolutional neural network, a third ReLU layer and a normalization layer;
[0027] The gas time series response data is sequentially input into the first one-dimensional convolutional neural network, the first ReLU layer, the second one-dimensional convolutional neural network, the second ReLU layer, the third one-dimensional convolutional neural network, the third ReLU layer and the normalization layer to obtain the local spatial feature information.
[0028] Preferably, the bidirectional long short-term memory network unit comprises: a first bidirectional long short-term memory network and a second bidirectional long short-term memory network;
[0029] The gas time series response data is sequentially input into the first bidirectional long short-term memory network and the second bidirectional long short-term memory network to obtain the deep feature information.
[0030] Preferably, the main decoder comprises: a first long short-term memory network, a second long short-term memory network, a first fully connected layer, and a second fully connected layer;
[0031] The enhanced feature data is sequentially input into the first long short-term memory network, the second long short-term memory network, the first fully connected layer and the second fully connected layer to obtain the preliminary gas concentration information.
[0032] Preferably, the data fusion unit includes: a multi-layer perceptron and a Transformer model;
[0033] The comprehensive information data includes: trend information and seasonal information;
[0034] The trend information is input into the multi-layer perceptron to obtain first processed information;
[0035] The seasonal information is input into the Transformer model to obtain second processed information;
[0036] The first processed information and the second processed information are fused to obtain the drift information.
[0037] Preferably, the compensation output unit comprises: a second DCT channel attention mechanism layer, a third fully connected layer and a fourth fully connected layer;
[0038] The drift information is sequentially input into the second DCT channel attention mechanism layer, the third fully connected layer and the fourth fully connected layer to obtain the gas concentration compensation information.
[0039] A malodorous gas qualitative and quantitative detection system based on time series data, comprising: a data preprocessing module, a data information extraction module, a first processing module, a preliminary result acquisition module, a second processing module, a compensation information acquisition module and a final result output module;
[0040] The data preprocessing module is used to obtain gas comprehensive response data and perform preprocessing to obtain time series response data;
[0041] The data information extraction module is used to input the time series response data into the main encoder and the sequence decomposition unit respectively, and obtain the comprehensive feature data and the comprehensive information data accordingly;
[0042] The first processing module is used to obtain enhanced feature data based on the comprehensive feature data input into the first DCT channel attention mechanism layer;
[0043] The preliminary result acquisition module is used to obtain preliminary gas concentration information based on the enhanced feature data input to the main decoder;
[0044] The second processing module is used to obtain drift information based on the comprehensive information data input into the data fusion unit;
[0045] The compensation information acquisition module is used to obtain gas concentration compensation information based on the drift information input into the compensation output unit;
[0046] The final result output module is used to obtain a multi-channel malodorous gas information prediction result based on the fusion of the preliminary gas concentration information and the gas concentration compensation information.
[0047] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a method and system for qualitative and quantitative detection of malodorous gases based on time series data, which improves the versatility of the system model in gas detection based on the time series response data of the gas sensor; the hybrid model architecture gas detection model constructed by the Encoder-Decoder architecture and the external compensation model has more stable detection performance in actual application scenarios; the CNN model, LSTM model, and Transformer model are used to improve the ability to capture global sequence information from the dimensions of the time characteristics and spatial characteristics of the time series response data, and the DCT-Attention mechanism is used to further improve the detection accuracy of the system model; through the idea of decomposition, an external compensation model is used to make corresponding compensation for the continuously changing time series data, which adapts to the scenario requirements of long-term continuous malodorous gas detection and reduces the sensor drift error. On the basis of optimizing the short-term drift dynamic change process, the malodorous gas detection accuracy in continuous detection can be improved, and high-precision gas information results can be output for malodorous gas detection, providing a realistic and feasible solution for malodorous gas detection equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0049] Figure 1 A flow chart of a method for qualitative and quantitative detection of malodorous gases based on time series data provided by the present invention.
[0050] Figure 2 This is a schematic diagram of the main encoder structure provided by the present invention.
[0051] Figure 3 Schematic diagram of the bidirectional long short-term memory network structure operation provided by the present invention
[0052] Figure 4 This is a schematic diagram of the long short-term memory network structure provided by the present invention.
[0053] Figure 5 This is a schematic diagram of the main structural model provided by the present invention.
[0054] Figure 6 This is a schematic diagram of the Transformer model structure provided by the present invention.
[0055] Figure 7 This is a schematic diagram of the compensation correction model structure provided by the present invention.
[0056] Figure 8 A schematic diagram of the structure of a system for qualitative and quantitative detection of malodorous gases based on time series data provided by the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Example 1
[0059] Currently, gas sensors are still in the development stage, and the drift of gas sensor arrays is still an important factor that restricts the recognition effect of electronic noses. In actual application scenarios, electronic noses will be affected by various conditions such as environmental interference and sensor stability, making the drift direction difficult to predict. Malodorous substances often contain acidic gases or sulfides, which will be difficult to desorb after long-term contact with gas-sensitive materials, and are more likely to cause detection errors in the detection results. At the same time, in continuous detection, the accumulation of errors in previous detections will affect the recovery characteristics of the sensor and reduce the performance of continuous detection. Therefore, how to build a model that can adapt to the dynamic changes of gas sensor drift during the detection process will become the key to improving the continuous detection accuracy of gas detection equipment.
[0060] In the specific implementation process, different types of gas sensors have different response processes and drift dynamic change processes for different malodorous gases, but by utilizing the modeling characteristics of deep learning models for complex data, the system model can adapt well to different gas sensors; the qualitative and quantitative detection method of malodorous gases based on time series data provided in the embodiments of the present application can improve the detection accuracy of malodorous gases in continuous detection on the basis of optimizing the short-term drift dynamic change process.
[0061] Based on the above, if Figure 1 As shown, the embodiment of the present invention discloses a method for qualitative and quantitative detection of malodorous gas based on time series data, comprising:
[0062] Obtain gas comprehensive response data and perform preprocessing to obtain time series response data;
[0063] Based on the time series response data, the data are input into the main encoder and the sequence decomposition unit respectively, and the comprehensive feature data and the comprehensive information data are obtained correspondingly;
[0064] Based on the comprehensive feature data, the first DCT channel attention mechanism layer is input to obtain enhanced feature data;
[0065] Based on the enhanced characteristic data input to the main decoder, preliminary gas concentration information is obtained;
[0066] Based on the comprehensive information data, the drift information is input into the data fusion unit;
[0067] Based on the drift information input into the compensation output unit, gas concentration compensation information is obtained;
[0068] Based on the fusion of preliminary gas concentration information and gas concentration compensation information, the multi-channel odorous gas information prediction result is obtained.
[0069] Example 2
[0070] The embodiment of the present invention discloses a method for qualitative and quantitative detection of malodorous gas based on time series data, comprising:
[0071] The gas comprehensive response data is acquired and preprocessed to obtain the time series response data.
[0072] Preferably, the comprehensive gas response data includes: gas response data and environmental information data;
[0073] The gas response data includes response data to malodorous gases collected by multiple gas sensors;
[0074] The environmental information data includes the air temperature, air humidity and air pressure of the space where the gas sensor is located.
[0075] Preferably, a sensor array is composed of a plurality of malodorous gas sensors, a temperature sensor, a humidity sensor, and an air pressure sensor;
[0076] The sensor array is placed in a well-sealed gas chamber, and a stable vacuum pump inputs the sampling gas into the gas chamber at a fixed flow rate to detect the gas input into the gas chamber and obtain the original response signal output by the sensor array, namely the comprehensive gas response data.
[0077] Preferably, in this embodiment, 16 electrochemical, MOS, and PID type malodorous gas sensors are used to collect gas response data.
[0078] Preferably, the pretreatment comprises:
[0079] Continuously collect and store gas comprehensive response data based on preset intervals to obtain a gas comprehensive response data group sequence;
[0080] Based on the real-time degree of model response and the size of the time window, the gas comprehensive response data group sequence is segmented according to the set interval to obtain the initial time series response data;
[0081] The initial time series response data is filtered to obtain the time series response data.
[0082] Preferably, in this embodiment, the preset interval is set to 1 second and the set interval is set to 3 minutes.
[0083] Preferably, 16 malodorous gas sensors and temperature sensors, humidity sensors, and air pressure sensors are used to collect 19 channels of sequence data with a length of 180, of which 3 channels of data are environmental information data.
[0084] Preferably, the data collected by the 16 malodorous gas sensors are numbered so as to subsequently extract the corresponding gas time series response data.
[0085] Preferably, this embodiment performs Kalman filtering and S_G filtering on the initial time series response data in sequence: the initial time series response data is subjected to Kalman filtering to obtain the initial time series response data after state estimation processing, and then the processed initial time series response data is subjected to S_G filtering again to obtain the initial time series response data after smoothing and noise reduction as the time series response data.
[0086] The time series response data is input into the main encoder to obtain comprehensive feature data.
[0087] Preferably, Figure 2 As shown, the main encoder includes: a convolutional neural network unit and a bidirectional long short-term memory network unit;
[0088] The time series response data includes: gas time series response data and environment time series response data;
[0089] The gas time series response data are input into the convolutional neural network unit and the bidirectional long short-term memory network unit respectively, and the local spatial feature information and deep feature information are obtained accordingly;
[0090] The local spatial feature information and deep feature information are fused to obtain comprehensive feature data.
[0091] Preferably, in this embodiment, the gas time series response data of 16 channels are input into a convolutional neural network unit and a bidirectional long short-term memory network unit respectively, and local spatial feature information and deep feature information are obtained accordingly.
[0092] Preferably, the convolutional neural network unit includes: a first one-dimensional convolutional neural network, a first ReLU layer, a second one-dimensional convolutional neural network, a second ReLU layer, a third one-dimensional convolutional neural network, a third ReLU layer and a normalization layer;
[0093] The gas time series response data are sequentially input into the first one-dimensional convolutional neural network, the first ReLU layer, the second one-dimensional convolutional neural network, the second ReLU layer, the third one-dimensional convolutional neural network, the third ReLU layer and the normalization layer to obtain local spatial feature information.
[0094] Preferably, the bidirectional long short-term memory network unit comprises: a first bidirectional long short-term memory network and a second bidirectional long short-term memory network;
[0095] The gas time series response data are sequentially input into the first bidirectional long short-term memory network and the second bidirectional long short-term memory network to obtain deep feature information.
[0096] Preferably, the bidirectional long short-term memory network (Bi_LSTM) structure operation diagram is as follows Figure 3As shown in the figure, the Bi_LSTM model is an improved model based on LSTM. Bi_LSTM consists of two independent unidirectional LSTMs, one of which processes the input time series data in forward time order, called forward LSTM, and the other processes the input time series data in reverse time order, called backward LSTM. Compared with LSTM, Bi_LSTM also considers the contextual information of time series data and can better capture the characteristic information of time series. Each LSTM unit maintains a hidden state, which contains information from the beginning of the sequence to the current time step, and the LSTM unit in each direction has its own hidden state, which captures the past and future contextual information respectively. The final output of Bi_LSTM is a sequence data containing the superposition representation of each time step.
[0097] Based on the comprehensive feature data, the enhanced feature data is input into the first DCT channel attention mechanism layer.
[0098] Preferably, by setting the DCT-Attention mechanism layer, the model's ability to capture frequency domain information of the data is enhanced, thereby improving the model's prediction accuracy and generalization ability.
[0099] Preferably, the comprehensive feature data is calculated by channel through the first DCT channel attention mechanism layer, the channel data is enhanced to extract frequency domain feature information, and the enhanced feature data is obtained as input data of the main decoder.
[0100] Based on the enhanced characteristic data input to the main decoder, preliminary gas concentration information is obtained.
[0101] Preferably, the main decoder comprises: a first long short-term memory network, a second long short-term memory network, a first fully connected layer, and a second fully connected layer;
[0102] The enhanced feature data are sequentially input into the first long short-term memory network, the second long short-term memory network, the first fully connected layer, and the second fully connected layer to obtain preliminary gas concentration information.
[0103] Preferably, the enhanced feature data are sequentially input into the first long short-term memory network and the second long short-term memory network for forward propagation calculations, and after the sequence data features are extracted, they are sequentially input into the first fully connected layer and the second fully connected layer to obtain preliminary gas concentration information, which includes preliminary 8 types of controlled malodorous gas component information.
[0104] Preferably, the eight controlled malodorous substances are: ammonia (NH3), hydrogen sulfide (H2S), methyl sulfide (CH3SCH3), methyl mercaptan (CH3SH), dimethyl disulfide (CH3SSCH3), styrene (C8H8), trimethylamine (N(CH3)3) and carbon disulfide (CS2).
[0105] Preferably, Figure 4 As shown in Figure 1, the long short-term memory network (LSTM) consists of four components: input gate, forget gate, output gate and cell state. The input gate is used to control whether the newly input data should be remembered, the forget gate is used to control whether the stored information should be forgotten, the output gate is used to determine the output of the current LSTM time step, and the cell state is a special internal state used to maintain and transmit information in time series data.
[0106] Preferably, the calculation process of LSTM is:
[0107] The first step is to calculate the forget gate, and the input is the hidden state h of the previous moment t-1 and the current input X t , the output is the output value f of the forget gate t , the calculation formula is as follows:
[0108] f t =σ(W f *[h t-1 ,X t ]+b f )
[0109] In the formula, f t is the value of the forget gate at time t, σ is the sigmoid activation function, W f is the input weight of the forget gate, h t-1 is the hidden state at time t-1, X t is the input at the current moment, b f is the input bias of the forget gate.
[0110] The second step is to calculate the input gate and candidate cell state, with the input being the hidden state h at the previous moment t-1 and the current input X t , the output is the value of the input gate i t and candidate cell states The calculation formula is as follows:
[0111] i t =σ(W i *[h t-1 ,X t ]+b i )
[0112]
[0113] In the formula, i t is the value of the input gate at time t, W i is the input weight of the input gate, b i is the input bias of the input gate, is the candidate cell state at time t, tanh is the tanh activation function, W c is the input weight of the memory cell state, b c is the input bias of the memory cell state.
[0114] The third step is to calculate the cell state at the current moment, and the input is the value i of the input gate t , the value of the forget gate f t , candidate cell states and the cell state C at the previous moment t-1 , the output is the cell state C at the current moment t , the calculation formula is as follows:
[0115]
[0116] In the formula, C t is the cell state at time t, C t-1 is the cell state at time t-1.
[0117] The fourth step is to calculate the output gate and the current hidden state, and the input is the hidden state h at the previous moment t-1 , the current input X t and the current cell state C t , the output is the value of the output gate O t and the hidden state h t , the relevant calculation formula is as follows:
[0118] O t =σ(W o *[h t-1 ,X t ]+b o )
[0119] ht=O t *tanh(C t )
[0120] In the formula, O t is the value of the output gate at time t, W o is the input weight of the output gate, b o is the input bias of the output gate.
[0121] Preferably, Figure 5 As shown, the main structure model is composed of the main encoder, the first DCT channel attention mechanism layer and the main decoder.
[0122] The time series response data is input into the sequence decomposition unit to obtain the comprehensive information data.
[0123] Preferably, the time series response data of 19 channels, i.e., 16 gas time series response data and 3-channel environmental time series response data, are input into a sequence decomposition unit, and the sequence decomposition unit processes the time series response data of 19 channels by a moving average method to extract trend information data of 19 channels and seasonal information data of 19 channels.
[0124] Based on the comprehensive information data, the drift information is input to the data fusion unit.
[0125] Preferably, the data fusion unit includes: a multi-layer perceptron and a Transformer model;
[0126] Comprehensive information data includes: trend information and seasonal information;
[0127] The trend information is input into the multi-layer perceptron to obtain the first processed information;
[0128] The seasonal information is input into the Transformer model to obtain the second processed information;
[0129] The first processed information and the second processed information are fused to obtain drift information.
[0130] Preferably, the first processed information and the second processed information are fused to obtain drift information of global information in the 38-channel time series response data.
[0131] Preferably, Figure 6 As shown in the figure, the Transformer model consists of an embedding layer, an encoder module, a linear layer, and a fully connected layer (FC). The embedding layer is used to embed the position information of the time series data so that the model can understand the order of the input improved time series data.
[0132] Preferably, in this embodiment, the encoder module is composed of a multi-head attention mechanism (Multivariate Attention), a normalization layer (LayerNorm), and a feed-forward propagation layer (Feed-forward). The encoder module is used to process the input improved time series data and learn global dependencies. The self-attention mechanism allows the model to establish associations between various positions within the input sequence and capture long-distance dependencies.
[0133] The gas concentration compensation information is obtained by inputting the drift information into the compensation output unit.
[0134] Preferably, the compensation output unit comprises: a second DCT channel attention mechanism layer, a third fully connected layer and a fourth fully connected layer;
[0135] The drift information is sequentially input into the second DCT channel attention mechanism layer, the third fully connected layer, and the fourth fully connected layer to obtain the gas concentration compensation information.
[0136] Preferably, the drift information is input into the second DCT channel attention mechanism layer for channel calculation to enhance the extraction of frequency domain feature information by channel data; after being calculated and processed by the second DCT channel attention mechanism layer, the calculated channel data is expanded and input into the third fully connected layer and the fourth fully connected layer for calculation to obtain 8 types of controlled malodorous gas concentration compensation information.
[0137] Preferably, Figure 7 As shown, based on the Transformer model's ability to process global time series information and the MLP's ability to model trend information, a precise compensation correction model is constructed in combination with a sequence decomposition unit and a compensation output unit. The compensation correction model outputs compensation information on the concentration of 8 types of controlled malodorous gases.
[0138] Based on the fusion of preliminary gas concentration information and gas concentration compensation information, the multi-channel odorous gas information prediction result is obtained.
[0139] Preferably, the above-mentioned main structure model and compensation correction model are used to calculate in parallel to obtain preliminary 8 types of controlled malodorous gas concentration information and 8 types of controlled malodorous gas concentration compensation information, and the two are superimposed and compensated to obtain the final output of high-precision 8 types of controlled malodorous gas information prediction results.
[0140] Preferably, the main structure model and the compensation correction model together constitute a malodorous gas prediction model, and the gas to be detected is input into the malodorous gas prediction model to obtain the corresponding malodorous gas information prediction result.
[0141] Example 3
[0142] like Figure 8 As shown, a malodorous gas qualitative and quantitative detection system based on time series data includes: a data preprocessing module, a data information extraction module, a first processing module, a preliminary result acquisition module, a second processing module, a compensation information acquisition module and a final result output module;
[0143] A data preprocessing module is used to obtain gas comprehensive response data and perform preprocessing to obtain time series response data;
[0144] A data information extraction module is used to input the time series response data into the main encoder and the sequence decomposition unit respectively, and obtain the comprehensive feature data and the comprehensive information data accordingly;
[0145] A first processing module is used to obtain enhanced feature data based on the comprehensive feature data input into the first DCT channel attention mechanism layer;
[0146] A preliminary result acquisition module, used to obtain preliminary gas concentration information based on the enhanced feature data input to the main decoder;
[0147] A second processing module is used to obtain drift information based on the comprehensive information data input to the data fusion unit;
[0148] A compensation information acquisition module, used to obtain gas concentration compensation information based on drift information input to the compensation output unit;
[0149] The final result output module is used to obtain the multi-channel malodorous gas information prediction results based on the fusion of preliminary gas concentration information and gas concentration compensation information.
[0150] Preferably, the process of implementing the functions of each functional module in this implementation corresponds one by one to the content of the above method, and will not be repeated here.
[0151] Example 4
[0152] Based on the same inventive concept, the present invention also provides a computer device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0153] Memory, used to store computer programs;
[0154] The processor, when used to execute the program stored in the memory, can implement a qualitative and quantitative detection method for malodorous gases based on time series data as in Example 1 or 2.
[0155] The electronic device may include: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. The processor may call the logic instructions in the memory to execute a method for qualitative and quantitative detection of odorous gas based on time series data in embodiment 1 or 2.
[0156] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0157] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a method and system for qualitative and quantitative detection of malodorous gases based on time series data, which improves the versatility of the system model in gas detection based on the time series response data of the gas sensor; the hybrid model architecture gas detection model constructed by the Encoder-Decoder architecture and the external compensation model has more stable detection performance in actual application scenarios; the CNN model, LSTM model, and Transformer model are used to improve the ability to capture global sequence information from the dimensions of the time characteristics and spatial characteristics of the time series response data, and the DCT-Attention mechanism is used to further improve the detection accuracy of the system model; through the idea of decomposition, an external compensation model is used to make corresponding compensation for the continuously changing time series data, which adapts to the scenario requirements of long-term continuous malodorous gas detection and reduces the sensor drift error. On the basis of optimizing the short-term drift dynamic change process, the malodorous gas detection accuracy in continuous detection can be improved, and high-precision gas information results can be output for malodorous gas detection, providing a realistic and feasible solution for malodorous gas detection equipment.
[0158] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0159] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for qualitative and quantitative detection of malodorous gases based on time series data, characterized in that: include: Obtain gas comprehensive response data and perform preprocessing to obtain time series response data; Based on the time series response data, the data are respectively input into the main encoder and the sequence decomposition unit to obtain comprehensive feature data and comprehensive information data accordingly; Based on the comprehensive feature data, input into the first DCT channel attention mechanism layer to obtain enhanced feature data; Based on the enhanced characteristic data, input to the main decoder to obtain preliminary gas concentration information; Based on the comprehensive information data, the data is input into a data fusion unit to obtain drift information; Based on the drift information, the compensation output unit is input to obtain gas concentration compensation information; Based on the fusion of the preliminary gas concentration information and the gas concentration compensation information, a multi-channel malodorous gas information prediction result is obtained.
2. According to claim 1, a method for qualitative and quantitative detection of malodorous gases based on time series data is characterized in that: The gas comprehensive response data includes: gas response data and environmental information data; The gas response data includes response data to malodorous gases collected by multiple gas sensors; The environmental information data includes the air temperature, air humidity and air pressure of the space where the gas sensor is located.
3. The method for qualitative and quantitative detection of malodorous gases based on time series data according to claim 1 is characterized in that: The pre-processing comprises: Continuously collecting and storing the gas comprehensive response data based on a preset interval to obtain a gas comprehensive response data group sequence; Based on the real-time degree of model response and the size of the time window, the gas comprehensive response data group sequence is segmented according to the set interval to obtain initial time series response data; Filtering is performed based on the initial time series response data to obtain the time series response data.
4. The method for qualitative and quantitative detection of malodorous gases based on time series data according to claim 2 is characterized in that: The main encoder includes: a convolutional neural network unit and a bidirectional long short-term memory network unit; The time series response data includes: gas time series response data and environment time series response data; The gas time series response data are respectively input into the convolutional neural network unit and the bidirectional long short-term memory network unit, and local spatial feature information and deep feature information are correspondingly obtained; The local spatial feature information and the deep feature information are fused to obtain the comprehensive feature data.
5. The method for qualitative and quantitative detection of malodorous gases based on time series data according to claim 4 is characterized in that: The convolutional neural network unit includes: a first one-dimensional convolutional neural network, a first ReLU layer, a second one-dimensional convolutional neural network, a second ReLU layer, a third one-dimensional convolutional neural network, a third ReLU layer and a normalization layer; The gas time series response data is sequentially input into the first one-dimensional convolutional neural network, the first ReLU layer, the second one-dimensional convolutional neural network, the second ReLU layer, the third one-dimensional convolutional neural network, the third ReLU layer and the normalization layer to obtain the local spatial feature information.
6. The method for qualitative and quantitative detection of malodorous gases based on time series data according to claim 4 is characterized in that: The bidirectional long short-term memory network unit includes: a first bidirectional long short-term memory network and a second bidirectional long short-term memory network; The gas time series response data is sequentially input into the first bidirectional long short-term memory network and the second bidirectional long short-term memory network to obtain the deep feature information.
7. The method for qualitative and quantitative detection of malodorous gases based on time series data according to claim 4 is characterized in that: The main decoder includes: a first long short-term memory network, a second long short-term memory network, a first fully connected layer and a second fully connected layer; The enhanced feature data is sequentially input into the first long short-term memory network, the second long short-term memory network, the first fully connected layer and the second fully connected layer to obtain the preliminary gas concentration information.
8. The method for qualitative and quantitative detection of malodorous gases based on time series data according to claim 1 is characterized in that: The data fusion unit includes: a multi-layer perceptron and a Transformer model; The comprehensive information data includes: trend information and seasonal information; The trend information is input into the multi-layer perceptron to obtain first processed information; The seasonal information is input into the Transformer model to obtain second processed information; The first processed information and the second processed information are fused to obtain the drift information.
9. The method for qualitative and quantitative detection of malodorous gas based on time series data according to claim 1, characterized in that: The compensation output unit includes: a second DCT channel attention mechanism layer, a third fully connected layer and a fourth fully connected layer; The drift information is sequentially input into the second DCT channel attention mechanism layer, the third fully connected layer and the fourth fully connected layer to obtain the gas concentration compensation information.
10. A system for qualitative and quantitative detection of malodorous gases based on time series data, applied to a method for qualitative and quantitative detection of malodorous gases based on time series data as claimed in any one of claims 1 to 9, characterized in that: include: A data preprocessing module, a data information extraction module, a first processing module, a preliminary result acquisition module, a second processing module, a compensation information acquisition module and a final result output module; The data preprocessing module is used to obtain gas comprehensive response data and perform preprocessing to obtain time series response data; The data information extraction module is used to input the time series response data into the main encoder and the sequence decomposition unit respectively, and obtain the comprehensive feature data and the comprehensive information data accordingly; The first processing module is used to obtain enhanced feature data based on the comprehensive feature data input into the first DCT channel attention mechanism layer; The preliminary result acquisition module is used to obtain preliminary gas concentration information based on the enhanced feature data input to the main decoder; The second processing module is used to obtain drift information based on the comprehensive information data input into the data fusion unit; The compensation information acquisition module is used to obtain gas concentration compensation information based on the drift information input into the compensation output unit; The final result output module is used to obtain a multi-channel malodorous gas information prediction result based on the fusion of the preliminary gas concentration information and the gas concentration compensation information.
Citation Information
Patent Citations
Electronic nose drift compensation method
CN118243856A
Gas sensing device for sensing one or more gases in a mixture of gases
US20230288359A1
Cited By
Air pressure compensation structure of laser spectrum gas sensor and concentration prediction method
CN120927611A
Odor Gas Identification Method Based on Deep Learning Network using Discrete Wavelet Transform
CN122671498A