Method for realizing rapid gas detection based on long short-term memory network and convolutional neural network

By using the method based on long and short-term memory networks and convolutional neural networks, the gas sensor's response curve signal is used for rapid gas detection in the first 10 seconds, which solves the problems of long sensor response time and low classification accuracy, and achieves rapid identification and high accuracy gas detection effect.

CN119044402APending Publication Date: 2024-11-29QINGDAO UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411053751.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The existing gas sensors have a long response time and are not very accurate in different gas classifications, which limits their immediate response capabilities in emergencies and the accuracy of identification of changes in gas composition in complex environments.

Method used

Using a method based on long and short-term memory networks and convolutional neural networks, the signal of the response curve measured by the gas sensor is used as input data, and the gas is rapidly detected and identified by the LSTM-CNN neural network, including the construction of an LSTM with a specific structure. -CNN neural network for training and prediction.

Benefits of technology

It realizes rapid identification and concentration judgment of gas, short response time and high accuracy, and is suitable for large-scale promotion and use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119044402A_ABST
    Figure CN119044402A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of deep learning, in particular to a rapid detection method based on a long short-term memory network and a convolutional neural network, and the method comprises the steps: taking first 10-second signals of a gas sensor responding to gas as characteristic values, and inputting the characteristic values into a constructed LSTM-CNN neural network to achieve the rapid detection and recognition of the gas; the LSTM-CNN neural network comprises an LSTM neural network and a CNN neural network, the LSTM neural network is used for processing input data, the processed data is sent to the CNN neural network for processing and analysis, and a prediction result is obtained; the LSTM-CNN neural network is simple in structure, only 10-second signals of a sensor response section need to serve as input data of the neural network, the needed response time is short, the neural network can rapidly recognize gas and detect the gas concentration, and the result accuracy is high; the method is suitable for large-scale popularization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and more specifically to a method for gas detection based on long short-term memory network and convolutional neural network. Background Art

[0002] Gas sensors are devices used to detect and quantify specific gas components in the air. They are designed to be sensitive to one or more gases and convert the presence of the gas into an electrical signal that can be measured and used to indicate the concentration of the gas. With the rapid development of the Internet of Things, the demand for gas sensors in smart cities, smart factories and even smart healthcare is increasing.

[0003] Despite the increasing application of gas sensors, they still face some technical challenges and limitations. Among them, long response time and low accuracy in classifying different gases are two major problems in current gas sensor technology. These problems limit the sensor's ability to respond immediately in certain emergency situations, and also affect the system's recognition and processing accuracy of changes in gas composition in complex environments. Therefore, studying and improving the response speed and classification accuracy of gas sensors is an important development direction in this field.

[0004] Yao Qinghe et al. proposed a method for gas identification and classification using convolutional neural networks (CN113948203A). This method effectively improves the recognition accuracy, but the feature value extraction process is complex and time-consuming. This time delay may limit the practicality of this method in emergency scenarios such as industrial leaks and fire scenes. Therefore, although this method has advantages in theory, it still has certain limitations in practical applications.

[0005] Therefore, an efficient and fast prediction method is urgently needed. Summary of the invention

[0006] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for rapid gas detection based on long short-term memory and convolutional neural network. The response curves of different gases are first measured by a gas sensor, and the signals of the first 10 seconds of the response section are selected as the input data of the long short-term memory network (LSTM). The processed data is sent to the convolutional neural network (CNN) for processing and analysis to obtain the prediction results.

[0007] In order to achieve the above object, the present invention adopts the following technical solution:

[0008] A method for rapid gas detection based on long short-term memory network and convolutional neural network includes the following steps:

[0009] (1) obtaining a characteristic data set, identifying a known gas using a gas sensor, and obtaining a response curve of the gas sensor to gas identification; extracting the first 10 seconds of the signal in the response phase as a characteristic value to obtain a characteristic data set; adding ±1% to the characteristic data as an error; the gas is one or more and the gas concentration is known;

[0010] (2) randomly dividing the feature data set into a training data set and a test data set;

[0011] (3) Input the training data set into the constructed LSTM-CNN neural network for training.

[0012] The LSTM-CNN neural network includes an LSTM neural network and a CNN neural network. The LSTM neural network includes an input layer, a first LSTM layer, a first random deactivation layer, a second LSTM layer, a second random deactivation layer and a fully connected layer in sequence according to the data transmission direction; the CNN neural network includes a first module, a second module, a third module and a fourth module in sequence according to the data transmission direction. The first module includes a convolution layer, a batch normalization layer, a pooling layer and a random deactivation layer connected in sequence in the data transmission direction; the structure of the second module is the same as that of the first module; the third module includes a fully connected layer, a batch normalization layer and a random deactivation layer connected in sequence in the data transmission direction; the fourth module includes a fully connected layer and a Softmax layer connected in sequence; the output of the fully connected layer in the LSTM neural network is used as the input of the CNN neural network; the output of the Softmax layer is used as the output of the LSTM-CNN neural network; the model uses an Adam optimizer to adjust the learning rate, and a mean square error loss function measures the error between the predicted value and the actual value.

[0013] The first LSTM layer is a long short-term memory layer with 80 units. This layer is designed to process sequence data and capture long-term dependencies and patterns in the input.

[0014] The first random dropout layer: After the LSTM layer, there is a Dropout layer with a dropout rate of 0.2. This means that 20% of the neuron outputs are randomly set to zero during training. This layer is used to prevent overfitting by reducing the model's sensitivity to specific features in the training data.

[0015] The second LSTM layer is a long short-term memory layer with 100 units, which is used to further process the information extracted by the first LSTM layer and compress it into a fixed-size output vector that captures the most relevant information in the input sequence.

[0016] The second random dropout layer: After the second LSTM layer, there is a Dropout layer with a dropout rate of 0.2. This means that 20% of the neuron outputs are randomly set to zero during training. This layer is used to prevent overfitting by reducing the model's sensitivity to specific features in the training data.

[0017] The fully connected layer in the LSTM neural network is a single neuron, and its output serves as the output feature of the LSTM neural network.

[0018] The convolutional layer in the first module is used to accept the LSTM neural network output value as the CNN neural network input value, so as to extract the hidden features in the data.

[0019] The three batch normalization layers in the CNN neural network are used to normalize the data of the previous layer, that is, to keep the output mean close to 0 and the output standard deviation close to 1.

[0020] The two pooling layers in the CNN neural network reduce the dimensionality of each feature, which helps to reduce the computational burden and improve feature detection.

[0021] The three random dropout layers in the CNN neural network are used to reduce the sensitivity of the model to specific features in the training data to prevent overfitting.

[0022] The input features of the fully connected layer in the CNN neural network are the output features of the random inactivation layer.

[0023] The Softmax layer uses the Softmax function as the activation function to convert the original value of the network output into a probability distribution, and the sum of the probabilities of each category is 1. The output features are used as the prediction results of the LSTM-CNN neural network.

[0024] (4) applying the neural network trained in step (3) to a test data set to achieve rapid detection and identification of gases;

[0025] (5) The gas to be tested is identified by using a gas sensor, and the signal of the first 10 seconds of the response phase is input into the trained neural network to obtain the predicted type and gas concentration of the gas to be tested.

[0026] The LSTM-CNN neural network described in the present invention can be trained with different gases and concentrations as required to achieve the purpose of quickly identifying different gases and judging gas concentrations.

[0027] Compared with the prior art, the LSTM-CNN neural network structure of the present invention is simple, only the first 10 seconds of the sensor response segment signal is needed as the input data of the neural network, the required response time is short, the neural network can quickly identify different gases and judge the gas concentration, and the result is highly accurate; the present invention is suitable for large-scale promotion and use. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] 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.

[0029] Figure 1 The present invention relates to a method for realizing rapid gas detection based on a long short-term memory network and a convolutional neural network.

[0030] Figure 2 It is a schematic diagram of the model structure principle of the long short-term memory network and convolutional network involved in the present invention.

[0031] Figure 3 This is a schematic diagram of the confusion matrix obtained by processing the LSTM-CNN neural network in Example 1 of the present invention.

[0032] Figure 4 This is an error result diagram obtained by processing with the LSTM-CNN neural network in Example 1 of the present invention. Specific implementation plan

[0033] The present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings.

[0034] Embodiment 1:

[0035] This embodiment relates to a method for realizing rapid gas detection based on long short-term memory and convolutional neural network, comprising the following specific steps:

[0036] S1, respectively collecting ammonia, trimethylamine, triethylamine, and NN dimethylformamide gases with concentrations of 2ppm, 10ppm, 20ppm, and 40ppm, respectively, using existing gas sensors to detect the above gases, respectively, to obtain a series of response curves of ammonia, trimethylamine, triethylamine, and NN dimethylformamide gases, and taking the signals of the first 10 seconds of each gas response segment as characteristic values;

[0037] S2, shuffle the eigenvalue data obtained in S1, randomly select 80% as the training set and 20% as the test set;

[0038] S3. Construct an LSTM-CNN neural network that meets the data set to realize gas prediction. The LSTM-CNN neural network includes an LSTM neural network and a CNN neural network. The LSTM neural network includes an input layer, a first LSTM layer, a first random inactivation layer, a second LSTM layer, a second random inactivation layer and a fully connected layer in the direction of data transmission. The CNN neural network includes a first module, a second module, a third module and a fourth module in the direction of data transmission. The first module includes a convolutional layer, a batch normalization layer, a pooling layer and a random inactivation layer connected in sequence. The structure of the second module is the same as that of the first module. The third module includes a fully connected layer, a batch normalization layer and a random inactivation layer connected in sequence. The fourth module includes a fully connected layer and a Softmax layer connected in sequence. The output of the fully connected layer in the LSTM neural network is used as the input of the CNN neural network. The output of the Softmax layer is used as the output of the LSTM-CNN neural network. The model uses the Adam optimizer to adjust the learning rate, and the mean square error loss function measures the error between the predicted value and the actual value.

[0039] The input layer is used to accept a single training sample of the training data set;

[0040] The first LSTM layer is a long short-term memory layer with 80 units. This layer is designed to process sequence data and capture long-term dependencies and patterns in the input.

[0041] The first random dropout layer: After the first LSTM layer, there is a Dropout layer with a dropout rate of 0.2. This means that 20% of the neuron outputs are randomly set to zero during training. This layer is used to prevent overfitting by reducing the model's sensitivity to specific features in the training data.

[0042] The second LSTM layer is a long short-term memory layer with 100 units. This layer further processes the information extracted by the first LSTM layer and compresses it into a fixed-size output vector that captures the most relevant information in the input sequence. Unlike the first LSTM layer, the second LSTM layer does not return the complete output sequence.

[0043] The second random dropout layer: After the second LSTM layer, there is a Dropout layer with a dropout rate of 0.2. This means that 20% of the neuron outputs are randomly set to zero during training. This layer is used to prevent overfitting by reducing the model's sensitivity to specific features in the training data.

[0044] The LSTM neural network has a single neuron in the fully connected layer, and its output features are used as input features of the CNN neural network.

[0045] The convolutional layer of the first module is used to accept the output value of the LSTM neural network as the input value of the CNN neural network, so as to extract hidden features in the data.

[0046] The three batch normalization layers of the CNN neural network are used to normalize the data of the previous layer in each module, that is, to keep the output mean close to 0 and the output standard deviation close to 1.

[0047] The two pooling layers of the CNN neural network reduce the dimensionality of each feature, which helps to reduce the computational burden and improve feature detection.

[0048] The three random dropout layers in the CNN neural network are used to reduce the sensitivity of the model to specific features in the training data to prevent overfitting.

[0049] The input features of the fully connected layer in the CNN neural network are the output features of the random inactivation layer.

[0050] The Softmax layer uses the Softmax function as an activation function to convert the original value of the network output into a probability distribution, the sum of the probabilities of each category is 1, and its output features are used as the prediction values ​​of the entire neural network.

[0051] S4, put the training data set in step S2 into the neural network of S3 for training, and the training ends when the loss function is less than -0.1;

[0052] S5, applying the neural network trained in S4 to the test data set to achieve rapid detection and identification of gas;

[0053] In step S5, the detection results of different gases are as follows: Figure 3 , Figure 4 shown.

[0054] from Figure 3 It can be seen that the model has a 100% recognition accuracy for triethylamine, trimethylamine, and NN-dimethylformamide, and a 91% recognition accuracy for ammonia, proving that our model has a high recognition accuracy.

[0055] from Figure 4 It can be seen that the model's prediction errors for triethylamine, trimethylamine, NN-dimethylformamide, and ammonia concentrations are 3.66%, 5.83%, 2.73%, and 1.54%, respectively, with an average error of 3.44%, proving that our model has a high concentration prediction accuracy.

[0056] The LSTM-CNN neural network described in the present invention can be used to identify and judge ammonia, trimethylamine, triethylamine, and NN dimethylformamide gases and their concentrations. Only the first 10 seconds of the sensor response segment signal is required as input data of the neural network. The required response time is short, and the neural network can quickly identify the gas and judge the gas concentration, and the result accuracy is high.

Claims

1. A method for rapid gas detection based on long short-term memory network and convolutional neural network, characterized in that: The following steps are involved: (1) Obtaining a characteristic data set, using a gas sensor to identify a known gas and obtaining a response curve; extracting the first 10 seconds of the response phase signal as a characteristic value to obtain a characteristic data set; (2) randomly dividing the feature data set into a training data set and a test data set; (3) Input the training data set into the constructed LSTM-CNN neural network for training; The LSTM-CNN neural network includes an LSTM neural network and a CNN neural network. The LSTM neural network includes an input layer, a first LSTM layer, a first random deactivation layer, a second LSTM layer, a second random deactivation layer and a fully connected layer in sequence according to the data transmission direction; the CNN neural network includes a first module, a second module, a third module and a fourth module in sequence according to the data transmission direction. The first module includes a convolution layer, a batch normalization layer, a pooling layer and a random deactivation layer connected in sequence according to the data transmission direction; the structure of the second module is the same as that of the first module; the third module includes a fully connected layer, a batch normalization layer and a random deactivation layer connected in sequence according to the data transmission direction; the fourth module includes a fully connected layer and a Softmax layer connected in sequence; the output of the fully connected layer in the LSTM neural network is used as the input of the CNN neural network; the output of the Softmax layer is used as the output of the LSTM-CNN neural network; the model uses an Adam optimizer to adjust the learning rate, and a mean square error loss function measures the error between the predicted value and the actual value; (4) applying the neural network trained in step (3) to a test data set to achieve rapid detection and identification of gases; (5) The gas to be tested is identified by using a gas sensor, and the signal of the first 10 seconds of the response phase is input into the trained neural network to obtain the predicted type and gas concentration of the gas to be tested.

2. The method for rapid gas detection based on long short-term memory network and convolutional neural network according to claim 1 is characterized in that: The gas in step (1) is one or more gases, and the gas concentration is known.

3. The method for rapid gas detection based on long short-term memory network and convolutional neural network according to claim 1 is characterized in that: The first LSTM layer is a long short-term memory layer with 80 units, which is used to process sequence data and capture long-term dependencies and patterns in the input; The first random dropout layer: After the LSTM layer, there is a Dropout layer with a dropout rate of 0.2; this means that 20% of the neuron outputs are randomly set to zero during training; this layer is used to prevent overfitting by reducing the model’s sensitivity to specific features in the training data; The second LSTM layer is a long short-term memory layer with 100 units, which is used to further process the information extracted by the first LSTM layer and compress it into a fixed-size output vector that captures the most relevant information in the input sequence; The second random dropout layer: After the second LSTM layer, there is a Dropout layer with a dropout rate of 0.2; it is used to randomly set 20% of the neuron outputs to zero during training; it prevents overfitting by reducing the model's sensitivity to specific features in the training data; The fully connected layer in the LSTM neural network is a single neuron, and its output serves as the output feature of the LSTM neural network.

4. The method for rapid gas detection based on long short-term memory network and convolutional neural network according to claim 1 is characterized in that: The convolution layer in the first module is used to accept the output value of the LSTM neural network as the input value of the CNN neural network to extract hidden features in the data; The three batch normalization layers in the CNN neural network are used to normalize the data of the previous layer, that is, to keep the output mean close to 0 and the output standard deviation close to 1; The two pooling layers in the CNN neural network reduce the dimensionality of each feature, which helps to reduce the computational burden and improve feature detection; The three random dropout layers in the CNN neural network are used to reduce the sensitivity of the model to specific features in the training data to prevent overfitting; The input features of the fully connected layer in the CNN neural network are the output features of the random inactivation layer; The Softmax layer uses the Softmax function as the activation function to convert the original value of the network output into a probability distribution, and the sum of the probabilities of each category is 1. The output features are used as the prediction results of the LSTM-CNN neural network.

Citation Information

Cited By

  • Gas sensor low-delay classification method based on sliding window and confidence accumulation

    CN121561679A