Gas concentration prediction method based on MEMS electronic nose

By building a MEMS electronic nose system, combining a gas sensor array and a CE-CNN model, and integrating an efficient channel attention mechanism and a cosine annealing hot restart algorithm, the portability and accuracy issues of traditional detection methods are solved, and efficient and accurate detection of flammable and explosive gas concentrations is achieved.

CN119537858BActive Publication Date: 2025-09-23SOUTHWEST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411650307.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-09-23
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

Existing technologies make it difficult to quickly and effectively detect the concentration of flammable and explosive gases. Traditional detection methods are costly, power-intensive, and the equipment is bulky, making it difficult to use portable devices.

Method used

A gas concentration prediction method based on MEMS electronic nose is adopted. By constructing a MEMS miniature portable electronic nose system, combining a gas sensor array, a preprocessing module and a gas concentration prediction network model CE-CNN, gas concentration prediction is performed using one-dimensional convolutional layers, batch normalization layers, maximum pooling layers, attention layers and fully connected layers. An efficient channel attention mechanism and a cosine annealing hot restart algorithm are integrated to optimize the training process.

Benefits of technology

The accuracy and portability of gas concentration prediction are improved, the computational complexity and power consumption are reduced, and high-precision, real-time detection of flammable and explosive gas concentrations is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537858B_ABST
    Figure CN119537858B_ABST
Patent Text Reader

Abstract

A gas concentration prediction method based on a MEMS electronic nose comprises the following steps: 1. constructing a miniature portable electronic nose system; 2. using a gas sensor array to collect gas characteristic data; 3. performing a preprocessing module on the gas characteristic data to obtain standard data; 4. a one-dimensional convolution layer in a gas concentration prediction network to obtain standard data and perform a one-dimensional convolution operation on it to obtain convolution data; 5. a batch normalization layer to perform a batch normalization operation on the convolution data to obtain normalized data; 6. a first maximum pooling layer to perform a pooling operation on the normalized data to obtain first pooled data; 7. an attention layer to extract key features from the first pooled data to obtain channel characteristic data; 8. a second maximum pooling layer to perform a pooling operation on the channel characteristic data to obtain second pooled data; and 9. a fully connected layer to perform a fully connected operation on the second pooled data to output a gas concentration prediction result. This method improves the detection accuracy and portability of the electronic nose.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic noses, and in particular to a gas concentration prediction method based on a MEMS electronic nose. Background Art

[0002] Flammable and explosive gases are widely used in industrial production and daily life. For example, hydrogen is used in fuel cells and as a chemical raw material; propane and butane are used as fuel gas and refrigerants; and methane and ethane are the main components of natural gas. These gases play an important role in the energy, chemical, and medical fields.

[0003] However, flammable and explosive gases pose significant safety risks. In recent years, a series of fires and explosions caused by these gases have resulted in severe environmental pollution, property damage, and casualties. Therefore, continuous monitoring of flammable and explosive gas concentrations is crucial for accident prevention and ensuring industrial and environmental safety.

[0004] Disadvantages of Existing Technologies: Currently, flammable and explosive gases can be detected using a variety of methods, including gas chromatography-mass spectrometry (GC-MS), gas chromatography-flame photometric detection (GC-FPD), and infrared spectroscopy. However, these methods are costly, power-intensive, and require bulky, stationary equipment, making them difficult to detect quickly and effectively.

[0005] As a novel intelligent detection technology, the electronic nose (E-nose) analyzes odor components by simulating the animal olfactory system. It consists of a gas sensor array, signal preprocessing circuitry, and pattern recognition algorithms. As a portable device, the E-nose overcomes the limitations of traditional analytical instruments such as GC-MS and is finding increasing application in environmental monitoring, product quality testing (e.g., food, tobacco, and fermented products), medical diagnostics, and explosives detection. Furthermore, it provides a convenient and cost-effective solution for high-precision, real-time detection of flammable and explosive gas concentrations. Summary of the Invention

[0006] The present invention provides a gas concentration prediction method based on a MEMS electronic nose, which not only improves the gas concentration prediction accuracy but also has good portability.

[0007] To achieve the above-mentioned purpose, the present invention provides a gas concentration prediction method based on a MEMS electronic nose, the key of which is to include the following steps:

[0008] Step 1: Construct a MEMS micro portable electronic nose system, wherein the MEMS micro portable electronic nose system is provided with a gas sensor array, the gas sensor array is connected to a preprocessing module, and the preprocessing module is connected to a gas concentration prediction network model CE-CNN;

[0009] The gas concentration prediction network model CE-CNN is provided with a first one-dimensional convolutional layer, a batch normalization layer, a first maximum pooling layer, an attention layer, a second maximum pooling layer and a fully connected layer connected in sequence;

[0010] Step 2: The gas sensor array collects gas characteristic data a in real time and transmits it to the preprocessing module;

[0011] Step 3: The preprocessing module performs preprocessing operations on the gas characteristic data a to obtain standard data b, and passes it to the gas concentration prediction network model CE-CNN;

[0012] Step 4: The first one-dimensional convolution layer in the gas concentration prediction network model CE-CNN obtains the standard data b, performs a one-dimensional convolution operation on it, obtains the convolution data c, and passes it to the batch normalization layer;

[0013] Step 5: The batch normalization layer performs a batch normalization operation on the convolution data c to obtain normalized data d, and passes it to the first maximum pooling layer;

[0014] Step 6: The first maximum pooling layer performs a pooling operation on the normalized data d to obtain the first pooled data e, and passes it to the attention layer;

[0015] Step 7: The attention layer extracts key features from the first pooled data e to obtain channel feature data f, and passes it to the second maximum pooling layer;

[0016] Step 8: The second maximum pooling layer performs a pooling operation on the channel feature data f to obtain the second pooled data g, and passes it to the fully connected layer;

[0017] Step 9: The fully connected layer performs a fully connected operation on the second pooled data g and outputs the gas concentration prediction result Y.

[0018] Through the above design, in the CE-CNN gas concentration prediction network model, the standard data b contains the targeted feature values ​​of the gas to be predicted and is input into the first one-dimensional convolutional layer. This convolutional layer uses a Reluctant Unit (ReLU) activation function, which effectively extracts the gas-specific response signal, allowing the model to focus more closely on that gas signal and reduce background interference. First, the convolutional layer processes the input data to extract features, followed by a batch normalization layer to normalize the output to address numerical instabilities within the network. Next, a max pooling layer reduces the spatial dimensionality of the feature map, allowing the model to focus on the most significant features while reducing computational complexity. Finally, an efficient channel attention mechanism (ECA) is integrated to enhance attention to the channels of the gas to be predicted. By weighting the feature channels relevant to the gas to be predicted, the ECA module automatically assigns higher weights to the gas concentration response, making the network more sensitive to changes in the gas concentration during the feature fusion phase. In the final fully connected layer, specific gas concentration prediction optimization parameters are introduced to ensure more accurate output of the network's predictions of the gas concentration. The output layer combines the targeted extraction method of the gas features to be predicted, thereby minimizing the prediction error and achieving accurate prediction of the gas concentration to be predicted.

[0019] Preferably, in step 1, the gas sensor array includes seven MEMS gas sensors.

[0020] Seven micro-electromechanical system (MEMS) gas sensors form a self-designed miniature portable electronic nose device.

[0021] Preferably, in step 2, the gas sensor array transmits the gas characteristic data a to the preprocessing module via the analog-to-digital converter ADC. The analog-to-digital converter ADC is used to convert the analog gas characteristic data collected by the gas sensor into digital gas characteristic data, and transmit it to the preprocessing module via the USART serial communication protocol.

[0022] The miniature portable electronic nose device uses an analog-to-digital converter (ADC) module to convert the analog signal of the gas sensor into a digital signal, which is then transmitted to the preprocessing module through the USART.

[0023] Preferably, in step 3, the preprocessing operation is to downsample the gas characteristic data a and convert the downsampled gas characteristic data into a response value, i.e., standard data b. The expression of the response value is as follows:

[0024]

[0025] Among them, Response represents the response value, V a Represents the ADC reading of the gas sensor in air, V gIndicates the ADC reading of the gas sensor in the target gas, which is a flammable and explosive gas with a gas concentration range of 10 to 100 ppm.

[0026] Due to the large size of the original dataset, data analysis and computation become complex for the model, especially on resource-constrained edge devices. Therefore, the collected gas dataset was downsampled from 50Hz to 10Hz, reducing the data volume to 3,600×7, thereby increasing the number of samples from 80 to 400. This downsampling preserves the primary patterns of the predicted gas responses while reducing data redundancy and improving computational efficiency on the edge device. This operation increases the number of samples of the predicted gas, thereby increasing the model's chances of identifying changes in the predicted gas concentration and enabling it to learn richer information about the predicted gas's response within the limited dataset. This significantly reduces the time required for model training and the computing resources required for edge computing, thereby improving training and computational efficiency.

[0027] When converting raw ADC readings to response values, the mapping range is adjusted based on the characteristics of the gas being predicted, ensuring that the response value of the gas being predicted is accurately placed within the specified numerical range after conversion. This can be achieved by introducing a normalization factor for the response of the gas being predicted, ensuring that the response characteristics of the gas being predicted are more prominent in the model input, effectively reducing the impact of differences in sensitivity and response rate between different sensors.

[0028] Preferably, in step 7, the attention layer adopts an efficient channel attention mechanism ECA, and the attention layer is provided with an input layer, which is sequentially connected to a global average pooling layer, a second one-dimensional convolutional layer, and an element-wise multiplication unit, and the input layer is further connected to the element-wise multiplication unit;

[0029] The attention layer extracts key features from the first pooled data e in the following steps:

[0030] Step A1: The input layer in the attention layer obtains the first pooled data e and passes it to the global average pooling layer and the element multiplication unit;

[0031] Step A2: the global average pooling layer performs a global average pooling operation on the first pooled data e to obtain average pooled data e1, and passes it to the second one-dimensional convolutional layer;

[0032] Step A3: the second one-dimensional convolution layer uses a one-dimensional convolution kernel of size k to perform a convolution operation on the average pooled data e1, then optimizes the weight ω of each channel through a Sigmoid activation function, and passes the weight ω to an element-wise multiplication unit;

[0033] Step A4: The element multiplication unit multiplies the weight ω with the corresponding element of the first pooled data e to obtain channel feature data f.

[0034] This mechanism can avoid the complex dimensionality reduction and expansion process, efficiently realize local cross-channel interaction through one-dimensional convolution, and extract the dependencies between channels, thereby improving the performance of the model and the detection sensitivity of the predicted gas.

[0035] Preferably, in step A3, the size k of the one-dimensional convolution kernel is adaptively determined by the following formula:

[0036]

[0037] Among them, γ and β are hyperparameters. In order to improve the detection performance of the gas to be predicted, γ is set to 2 and β is set to 1; |t| odd t represents the nearest odd integer. To ensure that the convolution kernel size k is an odd number, it is necessary to take the absolute value and round it down to the nearest odd integer. ψ represents the mapping. Through the mapping ψ, high-dimensional channels have longer-range interactions, while low-dimensional channels have shorter-range interactions through nonlinear mapping. This mapping ensures that high-dimensional channels have longer-range cross-channel interactions, which is suitable for extracting complex dependencies of the gas to be predicted, while low-dimensional channels are adapted to shorter-range interactions. C represents the channel dimension.

[0038] In the mapping function ψ, by selecting appropriate γ and β parameters, the feature interactions of the channels related to the gas to be predicted are strengthened in a targeted manner, ensuring that subtle changes in the gas signal to be predicted can be more fully represented in the high-dimensional channel.

[0039] The expression of the weight ω is as follows:

[0040] ω=σ(C1D k (y))

[0041] Among them, C1D represents a one-dimensional convolution involving only k parameters, σ is the Sigmoid activation function, and the aggregated feature y∈R c Obtained without dimensionality reduction, it enhances the significance of the predicted gas's characteristic response through smoothing during the mapping process. By optimizing this channel dependency, ECA can effectively separate the predicted gas's characteristics from other background signals, thereby improving the model's targeted detection performance for the predicted gas.

[0042] The aggregated feature y is correlated with the overall average features of each channel. In the ECA module, the aggregated feature y is used to generate channel weights ω, thereby enhancing the dependencies between channels. This process strengthens channels related to the significant characteristics of the gas being predicted, allowing the model to focus more on the key features of the gas being predicted.

[0043] Preferably, the gas concentration prediction network model CE-CNN adopts a cosine annealing warm restart algorithm CAWR for network training, and periodically restarts the learning rate in each training stage.

[0044] The cosine annealing warm restart algorithm (CAWR) uses a large learning rate in the early stages of training. Because the response signal of the gas being predicted may be unstable, a large learning rate helps the model conduct extensive exploration in the early stages, quickly fitting the characteristics of the gas being predicted, and enabling the model to initially grasp the changing trends in the concentration of the gas being predicted. Furthermore, CAWR allows for periodic restarts of the learning rate at different training stages. By properly setting the restart cycle, the model can focus on the characteristic changes of the gas being predicted during the critical training phase. In the later stages, CAWR slowly reduces the learning rate to stabilize the model's update pace. This operation allows the model to focus on fine-tuning detailed features related to the gas being predicted as it approaches the optimal solution, further improving prediction accuracy.

[0045] This restart helps the model escape from the local optimal solution, allowing the model to continuously update and focus on the key features of the gas to be predicted, thereby avoiding overfitting of the specific signal pattern of the gas to be predicted, and thus enhancing the model's generalization ability for predicting the concentration of the gas to be predicted.

[0046] As a preference: use the mean absolute error MAE, mean square error MSE and evaluation index R 2 Three evaluation indicators are used to evaluate the prediction performance of the gas concentration prediction network model CE-CNN. The smaller the values ​​of mean absolute error (MAE) and mean square error (MSE), the more accurate the prediction results of the model. At the same time, the evaluation indicator R 2 The closer the value is to 1, the better the model fits the data;

[0047] The expression of mean absolute error MAE is as follows:

[0048]

[0049] The expression of mean square error MSE is as follows:

[0050]

[0051] Evaluation index R 2 The expression is as follows:

[0052]

[0053] Where N is the size of the test set; y t represents the true value, represents the predicted value, Represents the mean of the true values.

[0054] Preferably, in step 1, the gas concentration prediction network model CE-CNN is deployed on the MCU of the edge device to perform edge artificial intelligence device calculations, thereby meeting the high precision, portability, low cost, and low power consumption requirements of the electronic nose.

[0055] Preferably, in step 2, the gas characteristic data a is a flammable and explosive gas, and the gas characteristic data a is hydrogen sulfide H2S, propane C3H8, ammonia NH3, or ethylene C2H4.

[0056] The present invention has the following beneficial effects: To improve prediction accuracy, a gas concentration prediction network model, the CE-CNN model, is proposed. This model integrates an efficient channel attention mechanism into a convolutional neural network. A cosine annealing hot restart strategy dynamically adjusts the learning rate to optimize the training process, effectively improving the stability and accuracy of the MEMS micro-portable electronic nose system. Furthermore, the CE-CNN model is integrated into the MCU of edge devices, demonstrating the electronic nose's advantages of high precision, portability, and low power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a schematic diagram of the process of the present invention;

[0058] Figure 2 Schematic diagram of the gas concentration prediction network model CE-CNN in the embodiment;

[0059] Figure 3 Schematic diagram of the experimental device structure in the embodiment;

[0060] Figure 4 Graphs showing the raw data and pre-processed data acquired by the ADC in the embodiment;

[0061] Figure 5 is the MAE, MSE, and R of the test set model in the ablation experiment in the embodiment. 2 Comparison plot of values ​​and model loss;

[0062] Figure 6 Comparison of test set loss between the CE-CNN model and other models in the embodiment;

[0063] Figure 7 The comparative analysis diagram of the predicted concentration of C2H4 and the standard concentration in the embodiment;

[0064] Figure 8 Schematic diagram of stochastic gradient descent SGD optimization using standard learning rate scheduling and cosine annealing learning hot restart rate scheduling in an embodiment;

[0065] Figure 9FIG. 4 is a hardware structure block diagram of the MEMS micro portable electronic nose system in an embodiment. DETAILED DESCRIPTION

[0066] The present invention will be further described in detail below with reference to the accompanying drawings and specific examples. The following examples or drawings are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0067] like Figure 1 As shown: A gas concentration prediction method based on MEMS electronic nose includes the following steps:

[0068] Step 1: Construct a MEMS micro portable electronic nose system, wherein the MEMS micro portable electronic nose system is provided with a gas sensor array, the gas sensor array is connected to a preprocessing module, and the preprocessing module is connected to a gas concentration prediction network model CE-CNN;

[0069] The gas concentration prediction network model CE-CNN is provided with a first one-dimensional convolutional layer, a batch normalization layer, a first maximum pooling layer, an attention layer, a second maximum pooling layer and a fully connected layer connected in sequence, such as Figure 2 As shown;

[0070] Step 2: The gas sensor array collects gas characteristic data a in real time and transmits it to the preprocessing module;

[0071] Step 3: The preprocessing module performs preprocessing operations on the gas characteristic data a to obtain standard data b, and passes it to the gas concentration prediction network model CE-CNN;

[0072] Step 4: The first one-dimensional convolution layer in the gas concentration prediction network model CE-CNN obtains the standard data b, performs a one-dimensional convolution operation on it, obtains the convolution data c, and passes it to the batch normalization layer;

[0073] Step 5: The batch normalization layer performs a batch normalization operation on the convolution data c to obtain normalized data d, and passes it to the first maximum pooling layer;

[0074] Step 6: The first maximum pooling layer performs a pooling operation on the normalized data d to obtain the first pooled data e, and passes it to the attention layer;

[0075] Step 7: The attention layer extracts key features from the first pooled data e to obtain channel feature data f, and passes it to the second maximum pooling layer;

[0076] Step 8: The second maximum pooling layer performs a pooling operation on the channel feature data f to obtain the second pooled data g, and passes it to the fully connected layer;

[0077] Step 9: The fully connected layer performs a fully connected operation on the second pooled data g and outputs the gas concentration prediction result Y.

[0078] In step 1, the gas sensor array includes seven MEMS gas sensors.

[0079] In step 2, the gas sensor array transmits the gas characteristic data a to the preprocessing module via the analog-to-digital converter ADC. The analog-to-digital converter ADC is used to convert the analog gas characteristic data collected by the gas sensor into digital gas characteristic data and transmit it to the preprocessing module through the USART serial communication protocol.

[0080] In step 3, the preprocessing operation is to downsample the gas characteristic data a and convert the downsampled gas characteristic data into a response value, that is, standard data b. The expression of the response value is as follows:

[0081]

[0082] Among them, Response represents the response value, V a Represents the ADC reading of the gas sensor in air, V g Indicates the ADC reading of the gas sensor in the target gas, which is a flammable and explosive gas with a gas concentration range of 10 to 100 ppm.

[0083] In step 7, the attention layer adopts an efficient channel attention mechanism ECA, and the attention layer is provided with an input layer, which is sequentially connected to a global average pooling layer, a second one-dimensional convolutional layer, and an element-wise multiplication unit, and the input layer is also connected to the element-wise multiplication unit;

[0084] The attention layer extracts key features from the first pooled data e in the following steps:

[0085] Step A1: The input layer in the attention layer obtains the first pooled data e and passes it to the global average pooling layer and the element multiplication unit;

[0086] Step A2: the global average pooling layer performs a global average pooling operation on the first pooled data e to obtain average pooled data e1, and passes it to the second one-dimensional convolutional layer;

[0087] Step A3: the second one-dimensional convolution layer uses a one-dimensional convolution kernel of size k to perform a convolution operation on the average pooled data e1, then optimizes the weight ω of each channel through a Sigmoid activation function, and passes the weight ω to an element-wise multiplication unit;

[0088] Step A4: The element multiplication unit multiplies the weight ω with the corresponding element of the first pooled data e to obtain channel feature data f.

[0089] In step A3, the size k of the one-dimensional convolution kernel is adaptively determined by the following formula:

[0090]

[0091] Among them, γ and β are hyperparameters, |t| odd represents the nearest odd number of t, ψ represents the mapping, and C represents the channel dimension;

[0092] The expression of the weight ω is as follows:

[0093] ω=σ(C1D k (y))

[0094] Among them, C1D represents a one-dimensional convolution involving only k parameters, σ is the Sigmoid activation function, and the aggregated feature y∈R c obtained without dimensionality reduction.

[0095] The gas concentration prediction network model CE-CNN uses the cosine annealing warm restart algorithm CAWR for network training, and periodically restarts the learning rate in each training stage.

[0096] Traditional cosine annealing methods face several problems: it uses a monotonically decreasing learning rate throughout training, which can cause the model to fall into local optimality in the later stages and slow down convergence. The fixed annealing strategy lacks adaptability at different training stages, which can lead to generalization issues. Figure 8 (a) shows that under a standard learning rate schedule, the model converges to a local minimum or possibly a stable limit cycle close to a saddle point.

[0097] In contrast, CAWR uses a larger learning rate in the early stages of training to help the network approach the optimal solution region more quickly, thereby improving the convergence speed. In addition, CAWR allows the learning rate to be periodically restarted at different training stages, allowing the model to escape from local optimality and search for a better global optimal solution, thereby improving the efficiency of the entire training process. Figure 8 (b) depicts the optimization process using the CAWR scheme, where the training process is divided into multiple cycles, each of which starts with a larger learning rate and then anneals to a smaller learning rate. In other words, the present invention allows stochastic gradient descent (SGD) to converge to the local minimum multiple times along its optimization path, rather than training the neural network independently from scratch multiple times. The larger learning rate provides enough energy for the model to escape from key points and saddle points, while the smaller learning rate guides the model to reach a well-behaved local minimum.

[0098] In step 1, the gas concentration prediction network model CE-CNN is deployed on the MCU of the edge device to perform device calculation of edge artificial intelligence.

[0099] Next, a specific experiment was conducted using ethylene gas to verify the present invention:

[0100] Figure 3 This paper demonstrates the experimental setup for collecting ethylene gas datasets in the laboratory using a miniature portable electronic nose device. The system consists of a pressurized gas supply containing cylinders of ethylene and air. During the experiment, the gases are mixed in a gas mixing chamber controlled by a computer interface. The mixed gas is then introduced into a chamber, where the electronic nose device's sensor array measures the gas concentration. The sensor data is then transmitted to a data acquisition platform, which records and processes the measurements in real time. After the measurement is complete, the exhaust gas is safely exhausted from the system to ensure data accuracy and reproducibility, facilitating further analysis.

[0101] The miniature portable electronic nose device uses an analog-to-digital converter (ADC) to convert the gas sensor's analog signal into a digital signal, which is then transmitted to a computer via a USART interface. Data acquisition software performs functions such as data storage, real-time mapping of sensor output data, and sending control commands.

[0102] The test gas circulates continuously within the test chamber and is ultimately exhausted by exhaust equipment installed in the exhaust hood. The entire gas measurement system for data acquisition includes a separate gas cylinder cabinet, precise gas piping, gas cylinders, a gas mixing device, an exhaust hood, and mass flow controllers (MFCs) installed in the gas mixing device.

[0103] Specifically, the gas mixing device is mainly a LY-600B gas distribution device, which uses 11 digital computer-monitored MFCs to individually adjust the gas flow of 11 branches connected to different pressurized gas cylinders, one of which is for carrier gas and the others for test gas. The maximum and minimum flow rates are 500mL / min and 1mL / min respectively, allowing the test gas to have a wide concentration range. The electronic nose is connected to a computer-controlled gas mixing unit that can provide the required gas at the required concentration to generate the necessary data set. This creates a highly accurate and repeatable gas delivery system while maintaining a constant total flow rate. As a result, a precise and reliable gas measurement system has been developed, eliminating measurement errors caused by uncontrolled environmental conditions such as relative humidity and temperature or manual operation.

[0104] In this study, the gas flow rate was kept constant at 500 mL / min throughout the experiment. The target gas concentration was controlled by a gas mixing unit and MFCs installed in the gas mixing unit. The desired concentration was obtained by mixing the test gas with synthetic air, 70% N2, and 30% O2.

[0105] The seven MEMS gas sensors were GM-302B, GM-402B, GM-502B, GM-512B, GM-602B, GM-602B, and GM-702B. Before collecting gas signature data, the MEMS gas sensors were preheated for 48 hours to ensure repeatable response patterns during measurements. The sensors were operated at an isobaric measurement voltage of 3.3V. The heating voltages for each sensor are shown in Table 1. Within the test chamber, the ambient temperature was maintained at 20±5°C, and the relative humidity was controlled at 50±10%. Resistance values ​​from the seven sensors were continuously collected at a sampling frequency of 50Hz using a computer and data acquisition software.

[0106] Table 1

[0107]

[0108] The gas concentration prediction network model CE-CNN is deployed on a 32-bit high-performance general-purpose microcontroller unit MCU based on ARM Cortex-M4, with 192KB of SRAM and 1024KB of flash memory for data acquisition and edge computing.

[0109] The C₂H₄ concentration range was set from 10 to 100 ppm with a 10 ppm gradient. The gas sensing experiment was divided into three phases: purge, response, and recovery. First, the chamber was purged with synthetic air for 300 seconds to obtain a baseline value for each MEMS sensor. Then, C₂H₄ gas was injected into the chamber, and a 180-second wait allowed the sensors to fully stabilize. Subsequently, the test chamber was ventilated for 180 seconds to allow the sensors to recover to their initial state. The response-recovery process was repeated as the gas concentration increased until the gas concentration reached 100 ppm. The entire gas data set acquisition experiment was repeated eight times. Each gas concentration gradient was defined as a separate sample, resulting in a total of 80 samples from 10 different gas concentrations. The data acquisition process in a single experiment generated a total of 18,000 × 7 × 10 data points, where 18,000 represents the number of sample points per sample, the sampling time is 360 seconds at a 50 Hz frequency, 7 represents the number of sensors, and 10 represents the number of samples collected in a single experiment.

[0110] Because the original dataset is large, data analysis and computation are complex, especially on resource-constrained edge devices. Therefore, the collected gas dataset was downsampled from 50Hz to 10Hz, reducing the data volume to 3,600×7, thereby increasing the number of samples to 400. This approach preserves the data's key features while increasing the distance between data points and reducing data redundancy. Consequently, it significantly reduces the time required for model training and the computing resources required for edge computing, thereby improving training and computational efficiency.

[0111] In addition, differences in sensitivity, output range, and response rate among different gas sensors can cause data deviations, so it is necessary to convert the raw ADC readings into response values ​​to map the output data to a uniform range, thereby reducing the impact of these differences.

[0112] Figure 4 (a) shows the raw data obtained from seven sensors, where the ADC readings fluctuate with concentration and exhibit a clear steady-state value. Figure 4 (b) shows the concentration gradient curve derived from the response value, where the ADC reading is converted into a more consistent and interpretable sensor response value. This conversion helps to better analyze the sensor behavior and thus achieve more accurate gas concentration prediction.

[0113] Next, an ablation experiment was conducted to compare the performance of the convolutional neural network (CNN), the convolutional neural network with a cosine annealing hot restart strategy (C-CNN), and the convolutional neural network with an efficient channel attention mechanism (E-CNN). The gas concentration prediction network model of the present invention uses a cosine annealing hot restart strategy and integrates a convolutional neural network with an efficient channel attention mechanism (CE-CNN). The comparison results are shown in Figure 2. Figure 5 and as shown in Table 2.

[0114] Table 2

[0115]

[0116] Figure 5 The performance comparison of various models in the ablation experiment is shown, and Table 2 further quantifies the specific values ​​of each model in all indicators. Figure 5 (a) Verification shows that the baseline CNN model performs the worst with a MAE of 4.3531, while the CE-CNN model achieves the best performance with a MAE of 0.7297. Figure 5 (b) shows the MSE value. The baseline CNN model has an MSE of 29.0507, while the CE-CNN model significantly reduces the MSE to 1.1087. 2 Value, R of the baseline CNN model 2is 0.9615, while the CE-CNN model improves this indicator to 0.9985. Figure 5 (c) shown. Figure 5 (d) depicts the loss during training in the ablation experiment. Compared with the CNN, C-CNN, and E-CNN models, the CE-CNN model shows a lower loss rate at the end of training.

[0117] The basic reasons for these three superior performance indicators are as follows: CAWR periodically resets the learning rate to reduce the probability of falling into local minima, while ECA enhances the capture of channel dependencies, thereby reducing loss and prediction error, and lowering MAE and MSE. In addition, CAWR accelerates convergence and stabilizes training, improving the interpretability of the model, while ECA enhances the interaction and extraction capabilities of features, making R 2 Scores close to 1 indicate that the model fits the data well.

[0118] The response value data is used as the input of the CE-CNN model, using MAE, MSE and R 2 Table 3 shows the gas concentration prediction performance of CE-CNN and other models. The results show that the gas concentration prediction network model CE-CNN in this invention outperforms other models in all indicators. Among all models, CE-CNN achieves the lowest MAE and MSE values, which are 0.7297 and 1.1087 respectively, and the highest R 2 The value is 0.9985. In comparison, among deep learning models, the fitting performance of the back-propagation neural network (BPNN), the residual neural network (ResNet), and the time-domain convolutional network (TCN) is less than ideal. The ECA attention mechanism adaptively focuses on the relationship between channels and adjusts the weight parameters to enhance the extraction and utilization of key features. In addition, the CAWR strategy improves training efficiency and model convergence by periodically resetting the learning rate from a higher value. Finally, the ability of CNN to capture complex nonlinear relationships in input response data is crucial for accurate concentration prediction. Therefore, the combination of the three methods forms a highly efficient model.

[0119] Although machine learning algorithms have advantages when computing resources are limited and have certain advantages on edge devices, the main indicators for concentration prediction tasks are recognition accuracy and data fitting ability. According to the indicators in Table 3, the prediction accuracy and fitting performance of the CE-CNN model are significantly better than those of traditional machine learning models. Specifically, K-nearest neighbor regression (KNNR) performs poorly when processing high-dimensional data because it relies on manually extracted features; the generalization ability of support vector regression (SVR) is limited by the choice of kernel function and regularization parameters, making it less effective when modeling complex nonlinear relationships; and decision tree regression (DTR) is sensitive to noise and has poor generalization ability. These inherent limitations explain the relatively poor performance of traditional machine learning models compared to CE-CNN.

[0120] Table 3

[0121]

[0122] Figure 6 The model loss of CE-CNN and other models on the test set is shown. CE-CNN is close to the optimal value at about 75 training epochs, surpassing other comparison models and showing the best performance with fewer training epochs.

[0123] In order to evaluate the fitting ability of the model, the predicted C2H4 concentrations were compared with the standard concentrations, e.g. Figure 7 As shown in the figure, the horizontal axis represents the standard values, and the vertical axis represents the predicted gas concentrations. The degree to which the black dots deviate from the red line indicates the model's prediction accuracy. The light red shaded area represents the range of the prediction band. Clearly, the model effectively identifies C₂H₄ in the ambient air within the 10 to 100 ppm range. The fitting equation between the standard values ​​and the predicted values ​​is y = -0.41171 + 1.00343x, with a slope close to 1, further validating the strong fitting ability and prediction accuracy of the CE-CNN model.

[0124] In the final stage of the experiment, the trained neural network model was deployed on a miniature portable electronic nose device, which is a practical approach to building an efficient, reliable, and convenient analysis system. During the testing phase, an electronic nose equipped with the CE-CNN model was used for edge testing to evaluate the device's performance. Specifically, a test set was input into the edge device, with C2H4 concentrations ranging from 10 ppm to 100 ppm, in increments of 10 ppm, covering a total of 10 concentrations. The electronic nose displayed and recorded the predicted value for each C2H4 concentration in real time. Each concentration test was repeated five times, and the average value was taken. In addition, the maximum concentration prediction error of the miniature portable electronic nose was 1.80 ppm. The edge computing prediction results of the electronic nose for C2H4 concentration are shown in Table 4.

[0125] Table 4 C2H4 concentration measured by miniature portable electronic nose

[0126]

[0127] Although the computing power of MCU-based electronic nose systems is relatively lower than that of computer-based systems, the advanced neural network models deployed in the miniature portable electronic nose enable the device to perform well when processing complex data. Furthermore, with edge computing, data processing is performed directly on the MCU installed in the electronic nose. Sensing, data acquisition, and model inference can all be completed on this small edge device, eliminating dependence on external facilities, reducing hardware costs, and enabling real-time measurement.

[0128] like Figure 9 As shown: the MEMS micro portable electronic nose system is provided with a gas sensor array, which is connected to a microcontroller MCU, on which a preprocessing module and a CE-CNN model are deployed;

[0129] The MEMS micro portable electronic nose system is also provided with a circuit module, which includes a peripheral control circuit, a communication system and a power subsystem. The circuit module is used to ensure the normal operation and communication of the EMS micro portable electronic nose system.

[0130] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A gas concentration prediction method based on a MEMS electronic nose, characterized by: The following steps are involved: Step 1: Construct a MEMS micro portable electronic nose system, wherein the MEMS micro portable electronic nose system is provided with a gas sensor array, the gas sensor array is connected to a preprocessing module, and the preprocessing module is connected to a gas concentration prediction network model CE-CNN; The gas concentration prediction network model CE-CNN is provided with a first one-dimensional convolutional layer, a batch normalization layer, a first maximum pooling layer, an attention layer, a second maximum pooling layer and a fully connected layer connected in sequence; Step 2: The gas sensor array collects gas characteristic data a in real time and transmits it to the preprocessing module; Step 3: The preprocessing module performs preprocessing operations on the gas characteristic data a to obtain standard data b, and passes it to the gas concentration prediction network model CE-CNN; Step 4: The first one-dimensional convolution layer in the gas concentration prediction network model CE-CNN obtains the standard data b, performs a one-dimensional convolution operation on it, obtains the convolution data c, and passes it to the batch normalization layer; Step 5: The batch normalization layer performs a batch normalization operation on the convolution data c to obtain normalized data d, and passes it to the first maximum pooling layer; Step 6: The first maximum pooling layer performs a pooling operation on the normalized data d to obtain the first pooled data e, and passes it to the attention layer; Step 7: The attention layer extracts key features from the first pooled data e to obtain channel feature data f, and passes it to the second maximum pooling layer; Step 8: The second maximum pooling layer performs a pooling operation on the channel feature data f to obtain the second pooled data g, and passes it to the fully connected layer; Step 9: The fully connected layer performs a fully connected operation on the second pooled data g and outputs the gas concentration prediction result Y.

2. The gas concentration prediction method based on MEMS electronic nose according to claim 1, characterized in that: In step 1, the gas sensor array includes seven MEMS gas sensors.

3. The gas concentration prediction method based on MEMS electronic nose according to claim 1, characterized in that: In step 2, the gas sensor array transmits the gas characteristic data a to the preprocessing module via the analog-to-digital converter ADC. The analog-to-digital converter ADC is used to convert the analog gas characteristic data collected by the gas sensor into digital gas characteristic data and transmit it to the preprocessing module through the USART serial communication protocol.

4. The gas concentration prediction method based on MEMS electronic nose according to claim 3, characterized in that: In step 3, the preprocessing operation is to downsample the gas characteristic data a and convert the downsampled gas characteristic data into a response value, that is, standard data b. The expression of the response value is as follows: Among them, Response represents the response value, V a Represents the ADC reading of the gas sensor in air, V g Indicates the ADC reading of the gas sensor in the target gas, which is a flammable and explosive gas with a gas concentration range of 10 to 100 ppm.

5. The gas concentration prediction method based on MEMS electronic nose according to claim 1, characterized in that: In step 7, the attention layer adopts an efficient channel attention mechanism ECA, and the attention layer is provided with an input layer, which is sequentially connected to a global average pooling layer, a second one-dimensional convolutional layer, and an element-wise multiplication unit, and the input layer is also connected to the element-wise multiplication unit; The attention layer extracts key features from the first pooled data e in the following steps: Step A1: The input layer in the attention layer obtains the first pooled data e and passes it to the global average pooling layer and the element multiplication unit; Step A2: the global average pooling layer performs a global average pooling operation on the first pooled data e to obtain average pooled data e1, and passes it to the second one-dimensional convolutional layer; Step A3: the second one-dimensional convolution layer uses a one-dimensional convolution kernel of size k to perform a convolution operation on the average pooled data e1, then optimizes the weight ω of each channel through a Sigmoid activation function, and passes the weight ω to an element-wise multiplication unit; Step A4: The element multiplication unit multiplies the weight ω with the corresponding element of the first pooled data e to obtain channel feature data f.

6. The gas concentration prediction method based on MEMS electronic nose according to claim 5, characterized in that: In step A3, the size k of the one-dimensional convolution kernel is adaptively determined by the following formula: Among them, γ and β are hyperparameters, |t| odd represents the nearest odd number of t, ψ represents the mapping, and C represents the channel dimension; The expression of the weight ω is as follows: ω=σ(C1D k (y)) Among them, C1D represents a one-dimensional convolution involving only k parameters, σ is the Sigmoid activation function, and the aggregated feature y∈R c obtained without dimensionality reduction.

7. The gas concentration prediction method based on MEMS electronic nose according to claim 1, characterized in that: The gas concentration prediction network model CE-CNN uses the cosine annealing warm restart algorithm CAWR for network training, and periodically restarts the learning rate in each training stage.

8. The gas concentration prediction method based on MEMS electronic nose according to claim 7, characterized in that: The mean absolute error MAE, mean square error MSE and evaluation index R 2 Three evaluation indicators are used to evaluate the prediction performance of the gas concentration prediction network model CE-CNN. The smaller the values ​​of mean absolute error (MAE) and mean square error (MSE), the more accurate the prediction results of the model. At the same time, the evaluation indicator R 2 The closer the value is to 1, the better the model fits the data; The expression of mean absolute error MAE is as follows: The expression of mean square error MSE is as follows: Evaluation index R 2 The expression is as follows: Where N is the size of the test set; y t represents the true value, represents the predicted value, Represents the mean of the true values.

9. The gas concentration prediction method based on MEMS electronic nose according to claim 1, characterized in that: In step 1, the gas concentration prediction network model CE-CNN is deployed on the MCU of the edge device to perform device calculation of edge artificial intelligence.

10. The gas concentration prediction method based on MEMS electronic nose according to claim 1, characterized in that: In step 2, the gas characteristic data a is a flammable and explosive gas, and the gas characteristic data a is either hydrogen sulfide H2S; or propane C3H8; or ammonia NH3; or ethylene C2H4.

Citation Information

Patent Citations

  • Electronic nose new coronal pneumonia respiratory diagnosis device based on DWT-1DCNN

    CN116671893A

  • Quick and intelligent IR7-EC network based classification method for concrete image crack type

    US20240029402A1