Gas identification method based on grouped convolution-TCN neural network

By using the packet convolution-TCN neural network method in gas recognition, the compensation problem of the impact of flow on gas sensors is solved, the recognition accuracy and real-timeness are improved, and it is suitable for deployment on the end side.

CN120196858APending Publication Date: 2025-06-24NANJING UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510259955.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-24

AI Technical Summary

Technical Problem

The prior art is difficult to effectively compensate for the impact of flow on gas sensors in gas recognition, resulting in low recognition accuracy, and the existing algorithm model parameters and inference time are long, and the real-time performance is insufficient, making it difficult to deploy on the end side.

Method used

The gas recognition method based on packet convolution-TCN neural network is adopted to compensate the gas sensor data through the packet convolution network, and the improved TCN neural network structure, including deep separable convolution and global average pooling layer, extract the gas sensor features independent of flow to achieve gas recognition.

Benefits of technology

It improves the detection accuracy of target gas under different flow rates, shortens the model's inference time, is suitable for deployment on resource-constrained platforms, and realizes real-time gas detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120196858A_ABST
    Figure CN120196858A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of deep learning and gas recognition, in particular to a gas recognition method based on a grouped convolution-TCN neural network, and the method comprises the following steps: 1, collecting gas data through an MEMS gas sensor array, and obtaining MEMS gas sensor array gas data sets under different flows; step 2, preprocessing the obtained test data; step 3, model establishment: constructing a model combining a grouped convolutional neural network and a TCN neural network for extracting characteristics of a gas sensor irrelevant to flow and realizing gas recognition; 4, completing model training and performance evaluation; and step 5, quantifying and deploying the grouping convolution-TCN neural network model. According to the method, flow compensation is carried out on the data of the gas sensor by using grouping convolution, so that the detection precision of the target gas under different flows is improved; meanwhile, the TCN neural network structure is improved, and classic convolution is replaced with depth separable convolution, so that the model size and the reasoning time are remarkably reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of deep learning and gas recognition, and particularly relates to a gas recognition method based on a grouped convolution-TCN neural network. Background Art

[0002] Semiconductor gas sensors based on MEMS technology are widely used in the field of gas detection. Semiconductor gas sensors have the characteristics of being lightweight, low in energy consumption, fast in response speed, and high in sensitivity. During actual use, their temperature, humidity, pressure, and flow rate will all affect the sensor response, and this kind of influence will significantly affect the accuracy of recognition. Once there are missed or false alarms in the gas recognition results, it may not only cause economic losses, but even endanger the lives of personnel.

[0003] At present, many studies focus on the compensation methods for temperature and humidity. By detecting the temperature and humidity conditions in the environment, the gas sensors are compensated, and good compensation effects have been achieved. However, few studies consider the influence of the flow rate on the sensors. The current compensation methods cannot meet the working requirements with different flow rate conditions; at the same time, the model parameters and inference time of the current gas recognition algorithms are relatively long, the real-time performance is not strong enough, and it is difficult to deploy at the edge side. Summary of the Invention

[0004] The purpose of the present invention is to solve the deficiencies existing in the prior art, and to propose a gas recognition method based on a grouped convolution-TCN neural network, which can reduce the influence of the flow rate on the gas sensor, improve the detection accuracy and inference speed of the sensor, and realize real-time detection of gas at the edge side.

[0005] In order to achieve the above purpose, the present invention adopts the following technical solutions:

[0006] A gas recognition method based on a grouped convolution-TCN neural network includes the following steps:

[0007] Step 1: Use a MEMS gas sensor array to collect gas data, and use a gas flow sensor to collect the flow rate data passing through the MEMS gas sensor array, so as to obtain a MEMS gas sensor array gas data set under different flow rates. Among them, the array gas data set includes 4 columns of gas sensor array time series data and 1 column of gas flow sensor time series data;

[0008] Step 2: Preprocess the obtained test data to obtain standardized data;

[0009] Step 3: Model establishment: Construct a model combining a grouped convolution neural network and a TCN neural network to extract the features of the gas sensor that are independent of the flow rate and realize gas recognition;

[0010] Construct a specific grouped convolutional neural network: The network structure consists of two convolutional layers, and the number of output channels of each convolutional layer is 12; The input 4 + 1 column data is divided into 4 groups, each group includes 1 column of gas sensor sequence and 1 column of gas flow sequence, and each group uses 3 convolutional kernels. The first layer uses a 2×2 convolutional kernel, and the second layer uses a 3×3 convolutional kernel. Through the way of grouped convolution, the model obtains the interaction relationship between different gas sensors and flows, and then obtains the characteristic time series of gas sensors independent of flow, realizes the compensation of flow signals, and inputs the results into the following model;

[0011] Introduce an improved TCN neural network model. The model structure consists of four TCN convolutional layers, a pooling layer and two fully connected layers. The size of the convolutional kernel is 3, and the dilation factor starts from 1 and increases with the square of the number of layers; After the convolutional layer, a global average pooling layer is introduced to reduce the amount of data while retaining the most important features, obtaining a 12×1 feature vector. The feature vector is input into the fully connected layer, and the fully connected layer converts the feature vector into gas feature coding calculation, and finally obtains the inferred target gas type;

[0012] Step 4: Complete model training and performance evaluation;

[0013] Divide the processed data set in Step 2 into a training set and a test set; Select the cross-entropy loss function as the loss function of the model. The cross-entropy value represents the degree of proximity between the detection result of the model and the distribution of the true label; Train the model by minimizing the loss function to obtain a trained grouped convolutional - TCN neural network model;

[0014] Step 5: Quantize and deploy the grouped convolutional - TCN neural network model.

[0015] Preferably, in Step 2, the specific process of standardization preprocessing is as follows:

[0016] Step 2.1: Perform moving average filtering on the original data with a moving window size of 100 to obtain smoothed data;

[0017] Step 2.2: Select the time points when the target gas contacts and reacts with the gas sensor;

[0018] Step 2.3: Divide three samples in a group of data. Select the time point in Step 2.2 as the center point of the first sample window, with a window size of 150 and a window sliding step of 75, so as to obtain three samples.

[0019] Preferably, in Step 3, the specific operation process of the improved TCN convolutional layer is as follows:

[0020] The improved TCN convolutional layer will perform depthwise separable convolution, which can maintain the expressive power of the model as much as possible while reducing the computational amount and model parameters, making it suitable for deployment on resource-constrained platforms; applying the Gaussian error linear unit activation function to complete the classification of gas types; the formula is as follows:

[0021]

[0022] Among them, x represents the output result of the depthwise separable convolution;

[0023] Normalizing the obtained data can standardize the results of the convolution operation and avoid the problem of gradient vanishing or explosion.

[0024] Preferably, in step 5, the specific quantization and deployment methods are as follows:

[0025] Step 5.1: Load the trained model: Load the trained floating-point model and prepare to perform quantization conversion on it;

[0026] Step 5.2: Set the TensorFlow Lite converter: Use the TFLiteConverter provided by TensorFlow Lite to perform quantization conversion;

[0027] Step 5.3: Set the quantization options: Specify the quantization options to enable static quantization;

[0028] Step 5.4: Provide a representative dataset: Define a representative dataset for activation calibration during the quantization process; this dataset is usually small but needs to be able to cover the overall distribution of the model input;

[0029] Step 5.5: Perform quantization conversion: Convert the floating-point model into a quantized TensorFlow Lite model and save it in the.tflite format;

[0030] Step 5.6: Verify the quantized model: Through inference and accuracy evaluation, verify whether the quantized model maintains sufficient accuracy and can accelerate inference on the target device;

[0031] Step 5.7: Deploy the quantized model to the edge platform.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] 1. For the detection of target gases, the present invention uses a grouped convolutional network to perform flow compensation on gas sensor data using grouped convolution, improving the detection accuracy of target gases under different flows.

[0034] 2. By improving the TCN neural network structure and using depthwise separable convolutions to replace classical convolutions, the present invention significantly reduces the model size and inference time.

[0035] 3. By quantifying and deploying the model, the present invention enables the method to run in real time on resource-constrained platforms, improving the portability of the recognition and detection device. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a flowchart of the present invention;

[0037] Figure 2 is a schematic structural diagram of the grouped convolutional neural network in the present invention;

[0038] Figure 3 is a schematic diagram of the model training and test losses in the present invention;

[0039] Figure 4 is a comparison chart of the accuracy and recall rates of the model of the present invention and other models.

[0040] In the figure: 101, timing data of the first gas sensor; 102, timing data of the second gas sensor; 103, timing data of the third gas sensor; 104, timing data of the fourth gas sensor; 105, timing data of the gas flow rate. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0041] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings, so that those skilled in the art can better understand the advantages and features of the present invention, and thus more clearly define the protection scope of the present invention. The embodiments described in the present invention are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0042] Refer to Figures 1-4 , a gas recognition method based on a grouped convolutional - TCN neural network, comprising the following steps:

[0043] Step 1: Use a MEMS gas sensor array to collect gas data to obtain a MEMS gas sensor array gas data set under different flow rates;

[0044] Step 2: Preprocess the obtained experimental data;

[0045] Step 3: Model establishment: Construct a model combining a grouped convolutional neural network and a TCN neural network to extract features of gas sensors independent of flow rate and achieve gas recognition;

[0046] Step 4: Complete model training and performance evaluation;

[0047] Step 5: Quantize and deploy the grouped convolutional - TCN neural network model.

[0048] Specifically, step 1 specifically includes:

[0049] Step 1: Use a MEMS gas sensor array to collect gas data and a gas flow sensor to collect the flow data passing through the MEMS gas sensor array, obtaining a MEMS gas sensor array gas dataset under different flows. Among them, the array gas dataset includes 4 columns of gas sensor array time - series data and 1 column of gas flow sensor time - series data.

[0050] As Figure 2 shown, the 4 columns of gas sensor array time - series data include the time - series data 101 of the first gas sensor, the time - series data 102 of the second gas sensor, the time - series data 103 of the third gas sensor, and the time - series data 104 of the fourth gas sensor; the 1 column of gas flow sensor time - series data includes the gas flow time - series data 105.

[0051] Among them, the gas data includes the MEMS gas sensor array data with CO gas introduced, the MEMS gas sensor array data with SO2 gas introduced, and the MEMS gas sensor array data with NH3 gas introduced.

[0052] Specifically, in step 2, the specific process of normalization pre - processing is as follows:

[0053] Step 2.1: Perform moving average filtering on the original data with a moving window size of 100 to obtain the smoothed data;

[0054] Step 2.2: Select the time points when the target gas contacts and reacts with the gas sensor;

[0055] Step 2.3: Divide three samples in a set of data. Select the time point in step 2.2 as the center point of the first sample window with a window size of 150 and a window sliding step of 75, thereby obtaining three samples.

[0056] Specifically, step 3 specifically includes:

[0057] Since different gas sensors are affected by flow changes to different degrees, for the data collected by the MEMS gas sensor array, it is necessary to perform flow compensation for each column of data separately. Therefore, in order to allow the model to learn the degree to which different gas sensors are affected by flow, a specific grouped convolutional neural network is constructed: the network structure consists of two convolutional layers, and the number of output channels of each convolutional layer is 12; the input 4+1 columns of data are divided into 4 groups, each group includes 1 column of gas sensor sequence and 1 column of gas flow sequence, and each group uses 3 convolution kernels. The first layer uses a 2×2 convolution kernel, and the second layer uses a 3×3 convolution kernel. Through group convolution, the model obtains the interaction relationship between different gas sensors and flow, and then obtains the characteristic timing of gas sensors that are not related to flow, realizes compensation for flow signals, and inputs the results into the following model.

[0058] Since the data collected by the MEMS gas sensor array is time series data, the general convolutional neural network cannot learn the time series information in the data well. Therefore, an improved TCN neural network model is introduced. The structure consists of four TCN convolutional layers, one pooling layer and two fully connected layers. The convolution kernel size is 3, and the expansion factor starts from 1 and increases with the number of layers to the power of 2. After the convolution layer, a global average pooling layer is introduced to reduce the amount of data while retaining the most important features, and obtain a 12×1 feature vector. The feature vector is input to the fully connected layer, which converts the feature vector into a gas feature encoding calculation, and finally obtains the inferred target gas type.

[0059] Among them, the specific operation process of the improved TCN convolutional layer is as follows:

[0060] The improved TCN convolution layer will perform depth-separable convolution, which can reduce the amount of calculation and model parameters while maintaining the expressiveness of the model as much as possible; the Gaussian error linear unit activation function is applied to complete the classification of gas types; the formula is as follows:

[0061]

[0062] Among them, x represents the output result of depth-wise separable convolution;

[0063] Normalize the obtained data and standardize the results of the convolution operation to avoid the problem of gradient disappearance or explosion.

[0064] Specifically, step 4 includes:

[0065] Step 4: Select the cross-entropy loss function as the loss function of the model. The cross-entropy value represents the degree of proximity between the detection result of the model and the distribution of the true labels. The model is trained by minimizing the loss function. During the training process, Adam is selected as the network optimizer of the model, which can dynamically adjust the learning rate of each parameter and has strong robustness. Obtain the trained grouped convolutional - TCN neural network model. The training and test loss graphs are as Figure 3 shown.

[0066] Perform performance evaluation on the model. Using the method of 5-fold cross-validation, the average accuracy of gas recognition reaches 95.63%, and the comparison with other models is as Figure 4 shown.

[0067] Specifically, the specific quantization and deployment methods in Step 5 are as follows:

[0068] Step 5.1: Load the trained model: Load the trained floating-point model and prepare to perform quantization conversion on it.

[0069] Step 5.2: Set the TensorFlow Lite converter: Use the TFLiteConverter provided by TensorFlow Lite to perform quantization conversion.

[0070] Step 5.3: Set the quantization options: Specify the quantization options to enable static quantization.

[0071] Step 5.4: Provide a representative dataset: Define a representative dataset for activation calibration during the quantization process. This dataset is usually small, but it needs to be able to cover the overall distribution of the model input.

[0072] Step 5.5: Perform quantization conversion: Convert the floating-point model into a quantized TensorFlow Lite model and save it in the.tflite format.

[0073] Step 5.6: Verify the quantized model: Through inference and accuracy evaluation, verify whether the quantized model maintains sufficient accuracy and can accelerate inference on the target device.

[0074] Step 5.7: Deploy the quantized model to the edge platform.

[0075] In summary, the present invention improves the detection accuracy of the target gas under different flow rates by using grouped convolution for flow compensation of gas sensor data; at the same time, the present invention improves the TCN neural network structure and uses depthwise separable convolution to replace classical convolution, significantly reducing the model size and inference time. This method improves the detection accuracy of gas sensors under flow rate changes, meets the detection requirements under different flow rates, and can be deployed on platforms with limited resources.

[0076] The descriptions and practices disclosed in the present invention are easy to think about and understand for those of ordinary skill in the art. Without departing from the principle of the present invention, several improvements and refinements can also be made. Therefore, modifications or improvements made without departing from the spirit of the present invention should also be regarded as within the protection scope of the present invention.

Claims

1. A gas identification method based on group convolution-TCN neural network, characterized in that: The steps include: Step 1: Use a MEMS gas sensor array to collect gas data, and use a gas flow sensor to collect flow data passing through the MEMS gas sensor array to obtain a MEMS gas sensor array gas data set at different flow rates, wherein the array gas data set includes 4 columns of gas sensor array timing data and 1 column of gas flow sensor timing data; Step 2: Preprocess the obtained test data to obtain standardized data; Step 3: Model building: Build a model combining group convolutional neural network and TCN neural network to extract the features of gas sensors that are not related to flow rate and realize gas identification; Construct a group convolutional neural network: the network structure consists of two convolutional layers, and the number of output channels of each convolutional layer is 12; the input 4+1 columns of data are divided into 4 groups, each group includes 1 column of gas sensor sequence and 1 column of gas flow sequence, and each group uses 3 convolution kernels. The first layer uses a 2×2 convolution kernel, and the second layer uses a 3×3 convolution kernel. Through group convolution, the model obtains the relationship between different gas sensors and flow, and then obtains the characteristic timing of gas sensors that are not related to flow, realizes compensation of flow signals, and inputs the results into the following model; An improved TCN neural network model is introduced. The model structure consists of four TCN convolutional layers, one pooling layer and two fully connected layers. The convolution kernel size is 3, and the expansion factor starts from 1 and increases with the number of layers to the power of 2. After the convolutional layer, a global average pooling layer is introduced to obtain a 12×1 feature vector. The feature vector is input to the fully connected layer, which converts the feature vector into a gas feature coding calculation, and finally obtains the inferred target gas type. Step 4: Complete model training and performance evaluation; The processed data set in step 2 is divided into a training set and a test set; the cross entropy loss function is selected as the loss function of the model, and the cross entropy value represents the closeness between the detection result of the model and the distribution of the true label; the model is trained by minimizing the loss function to obtain a trained group convolution-TCN neural network model; Step 5: Quantize and deploy the grouped convolutional-TCN neural network model.

2. A gas identification method based on a group convolution-TCN neural network according to claim 1, characterized in that: In step 2, the specific process of standardization preprocessing is as follows: Step 2.1: Perform sliding average filtering on the original data with a sliding window size of 100 to obtain smoothed data; Step 2.2: Select the time point when the target gas contacts and reacts with the gas sensor; Step 2.3: Divide three samples in a set of data, select the time point in step 2.2 as the center point of the first sample window, the window size is 150, the window sliding step is 75, and then obtain three samples.

3. A gas identification method based on group convolution-TCN neural network according to claim 1, characterized in that: In step 3, the specific operation process of the improved TCN convolutional layer is as follows: The improved TCN convolutional layer will perform depth-separable convolution to enable deployment on resource-constrained platforms; the Gaussian error linear unit activation function is applied to complete the classification of gas types, and the formula is as follows: Among them, x represents the output result of depth-wise separable convolution; Normalize the obtained data and standardize the results of the convolution operation to avoid the problem of gradient disappearance or explosion.

4. A gas identification method based on group convolution-TCN neural network according to claim 1, characterized in that: In step 5, the specific quantification and deployment methods are as follows: Step 5.1: Load the trained model: Load the trained floating point model and prepare to quantize it; Step 5.2: Set up the TensorFlow Lite converter: Use the TFLiteConverter provided by TensorFlow Lite to perform quantization conversion; Step 5.3: Set quantization options: Specify quantization options to enable static quantization; Step 5.4: Provide a representative dataset: Define a representative dataset for activation calibration during quantification. Step 5.5: Perform quantization conversion: Convert the floating point model to a quantized TensorFlow Lite model and save it in .tflite format; Step 5.6: Verify the quantized model: Through reasoning and accuracy evaluation, verify whether the quantized model maintains sufficient accuracy and can accelerate reasoning on the target device; Step 5.7: Deploy the quantized model to the client platform.

Citation Information

Cited By

  • Signal waveform detection and identification method based on TCN network model

    CN121980195A

  • Environment detection method and system based on deep learning

    CN122307029A