Gas concentration prediction method based on MEMS electronic nose
Through the gas concentration prediction method based on MEMS electronic nose, the MEMS micro portable electronic nose system and gas concentration prediction network model CE-CNN are used to solve the problems of high detection cost, large power consumption and large equipment volume in the prior art, and high precision, portability and low power consumption gas concentration prediction are achieved.
Patent Information
- Application Number
- CN202411650307.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The prior art uses the detection of flammable and explosive gases to have problems such as high cost, high power consumption, large equipment volume and difficult to detect quickly and effectively.
Using a gas concentration prediction method based on MEMS electronic nose, a MEMS micro portable electronic nose system is constructed, combined with a gas sensor array, a pretreatment module and a gas concentration prediction network model CE-CNN, to achieve high-precision prediction of flammable and explosive gas concentration.
It improves the accuracy of gas concentration prediction and has good portability, realizes rapid and effective detection of flammable and explosive gas concentrations, and reduces equipment costs and power consumption.
Smart Images

Figure 00000000_0000_ABST
Abstract
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] Inflammable and explosive gases are widely used in industrial production and daily life. For example, hydrogen is used in fuel cells and chemical raw materials; propane and butane are used as fuel gas and refrigerants; methane and ethane are the main components of natural gas. These gases play an important role in energy, chemical industry, medical treatment and other fields.
[0003] However, flammable and explosive gases have high safety risks. In recent years, a series of fires and explosions caused by flammable and explosive gases have caused serious environmental pollution, property losses 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, the detection of flammable and explosive gases can be achieved through a variety of methods, including gas chromatography-mass spectrometry (GC-MS), gas chromatography-flame photometric detection (GC-FPD) and infrared spectroscopy. However, these detection methods are costly, power-intensive, bulky and fixed, making it difficult to quickly and effectively detect such gases.
[0005] As a novel intelligent detection technology, the electronic nose (E-nose) analyzes odor components by simulating the olfactory system of animals. It consists of a gas sensor array, a signal preprocessing circuit, and a pattern recognition algorithm. As a portable device, the electronic nose overcomes the limitations of traditional analytical instruments such as GC-MS and has been increasingly used in environmental monitoring, product quality testing (such as food, tobacco, fermented products), medical diagnosis, and explosive detection. In addition, 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 gas concentration prediction method based on MEMS electronic nose provided by the present invention not only improves the gas concentration prediction accuracy but also has good portability.
[0007] To achieve the above object, the present invention provides a gas concentration prediction method based on MEMS electronic nose, the key of which is: comprising 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 pooling 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 pooling 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 a gas concentration prediction result Y.
[0018] Through the above design, in the gas concentration prediction network model CE-CNN, 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. The convolutional layer uses ReLU as the activation function, which can effectively extract the specific response signal of the gas, so that the model can focus more on the gas signal and reduce the interference of background gas. First, the convolutional layer processes the input data to extract the input data features, and then standardizes the output through the batch normalization layer to solve the numerical instability within the network. Next, the maximum pooling layer reduces the spatial dimension of the feature map, so that the model can focus on the most significant features while reducing the computational complexity. Then, the attention to the gas channel to be predicted is strengthened by integrating the efficient channel attention mechanism ECA. By weighting the feature channels related to the gas to be predicted, the ECA module can automatically give a higher weight to the gas concentration response to be predicted, making the network more sensitive to changes in the concentration of the gas to be predicted in the feature fusion stage. In the final fully connected layer, specific gas concentration prediction optimization parameters are introduced, so that the network outputs more accurate prediction results for the gas concentration to be predicted. The output layer combines the method of targeted extraction of gas features to be predicted, thereby minimizing the prediction error and achieving accurate prediction of the concentration of the gas 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 make up 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, and 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 via 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 gIt represents the ADC reading of the gas sensor in the target gas, where the target gas is a flammable and explosive gas with a gas concentration ranging from 10 to 100 ppm.
[0026] Due to the large size of the original data set, the data analysis and calculation of the model become complicated, especially on resource-constrained edge devices. Therefore, the collected gas data set is downsampled from 50Hz to 10Hz, and the data volume is reduced to 3,600×7, thereby increasing the number of samples from 80 to 400. This downsampling retains the main pattern of the gas response to be predicted, while reducing the redundancy of the data and improving the computing efficiency on the edge device. This operation increases the number of samples of the gas to be predicted, thereby increasing the model's chances of identifying changes in the concentration of the gas to be predicted, allowing it to learn richer information about the response of the gas to be predicted within a limited data set. Therefore, the time required for model training and the computing resources required for edge computing are significantly reduced, thereby improving training and computing efficiency.
[0027] When converting the raw ADC readings to response values, the mapping range is adjusted according to the characteristics of the gas to be predicted, ensuring that the response value of the gas to be 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 to be predicted to ensure that the response characteristics of the gas to be predicted are more prominent in the model input, effectively reducing the impact of differences in sensitivity and response rate of 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 multiplication unit, and the input layer is also connected to the element 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 pooling data e1, and then optimizes the weight ω of each channel through a Sigmoid activation function, and passes the weight ω to an element 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 taken as 2 and β is taken as 1; |t| odd Represents the nearest odd number of t. In order 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 number; ψ represents mapping. Through 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 characteristic 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 It is obtained without dimensionality reduction, and it enhances the significance of the characteristic response of the gas to be predicted by smoothing in the mapping process. Through the optimization of this channel dependency, ECA can effectively separate the characteristics of the gas to be predicted from other background signals, thereby improving the model's targeted detection performance for the gas to be predicted.
[0042] The aggregate feature y has a certain correlation with the overall average feature of each channel. Through the ECA module, the aggregate feature y is used to generate the channel weight ω, thereby enhancing the dependency between channels. This process can strengthen the channels related to the significant features of the gas to be predicted, so that the model can pay more attention to the key features of the gas to be predicted.
[0043] Preferably, the gas concentration prediction network model CE-CNN adopts a cosine annealing hot restart algorithm CAWR for network training, and periodically restarts the learning rate in each training stage.
[0044] The cosine annealing hot restart algorithm CAWR uses a larger learning rate in the early stages of training. Since the response signal of the gas to be predicted may be unstable, a large learning rate can help the model conduct a large-scale exploration in the early stages, quickly fit the characteristics of the gas to be predicted, and enable the model to initially grasp the changing trend of the concentration of the gas to be predicted. In addition, CAWR allows the learning rate to be restarted periodically at different training stages. By reasonably setting the restart cycle, the model can focus on the characteristic changes of the gas to be predicted during the critical training stage. In the later stages, CAWR stabilizes the update pace of the model by slowly reducing the learning rate. This operation allows the model to focus on fine-tuning the detailed features related to the gas to be predicted when it is close to the optimal solution, further improving the 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 further enhancing the model's generalization ability for predicting the concentration of the gas to be predicted.
[0046] As a preference: use mean absolute error MAE, mean square error MSE and evaluation index R 2 The three evaluation indicators are used to evaluate the prediction performance of the gas concentration prediction network model CE-CNN. The smaller the 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 requirements of high precision, portability, low cost and low power consumption 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] Beneficial effects of the present invention: In order to improve the prediction accuracy, a gas concentration prediction network model CE-CNN model is proposed, which integrates the efficient channel attention mechanism into the convolutional neural network, and dynamically adjusts the learning rate through the cosine annealing hot restart strategy to optimize the training process, effectively improving the stability and accuracy of the MEMS micro portable electronic nose system. At the same time, the gas concentration prediction network model CE-CNN model is integrated on the MCU of the edge device, reflecting the high precision, portability and low power consumption advantages of the electronic nose. 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 structure of the gas concentration prediction network model CE-CNN in the embodiment;
[0059] Figure 3 It is a schematic diagram of the structure of the experimental device in the embodiment;
[0060] Figure 4 The figure is a graph of the raw data acquired by the ADC and the pre-processed data in the embodiment;
[0061] Figure 5 are the MAE, MSE, and R of the test set model in the ablation experiment in the embodiment. 2 Comparison chart of values and model loss;
[0062] Figure 6 This is a test set loss comparison diagram of the CE-CNN model and other models in the embodiment;
[0063] Figure 7 It is a comparative analysis diagram of the predicted concentration of C2H4 and the standard concentration in the embodiment;
[0064] Figure 8 It is a schematic diagram of stochastic gradient descent SGD optimization using standard learning rate scheduling and cosine annealing learning hot restart rate scheduling in the embodiment;
[0065] Fig. 9FIG. 4 is a hardware structure block diagram of the MEMS micro portable electronic nose system in the embodiment. DETAILED DESCRIPTION
[0066] The present invention is further described in detail below in conjunction with the accompanying drawings and specific examples. The following examples or drawings are used to illustrate the present invention, but are not used 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 pooling 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 pooling 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 a 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 It represents the ADC reading of the gas sensor in the target gas, where the target gas is a flammable and explosive gas with a gas concentration ranging from 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 multiplication unit, and the input layer is also connected to the element 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 pooling data e1, and then optimizes the weight ω of each channel through a Sigmoid activation function, and passes the weight ω to an element 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 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 adopts the cosine annealing hot restart algorithm CAWR for network training, and periodically restarts the learning rate in each training stage.
[0096] The traditional cosine annealing method faces several problems: it uses a monotonically decreasing learning rate throughout the training process, which may cause the model to fall into a local optimum in the later stages and slow down the convergence speed. The fixed annealing strategy lacks adaptability at different training stages, which may lead to generalization problems. 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] On the contrary, CAWR uses a larger learning rate in the early stages of training to help the network approach the optimal solution area faster, thereby improving the convergence speed. In addition, CAWR allows the learning rate to be restarted periodically at different training stages, allowing the model to get rid of the local optimum and search for a better global optimum, thereby improving the efficiency of the entire training process. Figure 8 (b) describes 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 on 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 is conducted using ethylene gas to verify the present invention:
[0100] Figure 3 The experimental setup for collecting ethylene gas datasets in the laboratory using a miniature portable electronic nose device is demonstrated. The system consists of a pressurized gas supply unit containing cylinders of ethylene and air. During the experiment, the gases are mixed in a gas mixing chamber controlled by a computer operator interface. The mixed gas is introduced into the chamber, where the sensor array of the electronic nose device measures the gas concentration. The sensor data is then transmitted to a data acquisition platform, which records and processes the measurement data in real time. After the measurement is completed, the exhaust gas is safely exhausted from the system to ensure the accuracy and repeatability of the data for further analysis.
[0101] The miniature portable electronic nose device uses an analog-to-digital converter (ADC) to convert the analog signal of the gas sensor into a digital signal, which is then transmitted to the computer via USART. The 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 in the test chamber and is eventually exhausted by the exhaust equipment installed in the exhaust hood. The entire gas measurement system is used for data acquisition, including an independent gas cylinder cabinet, precise gas pipelines, gas cylinders, gas mixing devices, exhaust hoods, 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 regulate the gas flow of 11 branches connected to different pressurized gas cylinders, one for carrier gas and the others for test gas. The maximum and minimum flow rates are 500mL / min and 1mL / min respectively, allowing a wide range of concentrations of test gases. The electronic nose is connected to a computer-controlled gas mixing unit that is able to 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 is 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 control of the target gas concentration was achieved by the gas mixing unit and the MFCs installed in the gas mixing unit to obtain the desired concentration by mixing the test gas with synthetic air, 70% N2 and 30% O2.
[0105] The seven MEMS gas sensors are GM-302B, GM-402B, GM-502B, GM-512B, GM-602B, GM-602B, and GM-702B. Before the gas characteristic data collection, the MEMS gas sensors were preheated for 48 hours to ensure a repeatable response pattern during the measurement process. The sensors were operated at an equal measurement voltage of 3.3V. The heating voltage of each sensor is shown in Table 1. In the test chamber, the ambient temperature was maintained at 20±5℃ and the relative humidity was controlled at 50±10%. The resistance values of the seven sensors were continuously collected at a sampling frequency of 50Hz through 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 concentration range of C2H4 was set from 10 to 100 ppm with a gradient of 10 ppm. The gas sensing experiment was divided into three stages: cleaning, response, and recovery: First, the chamber was cleaned with synthetic air for 300 seconds to obtain the current baseline value of each MEMS sensor. Then, C2H4 gas was injected into the chamber and waited for 180 seconds to allow the sensor to fully stabilize. Subsequently, the test chamber was ventilated for 180 seconds to allow the sensor to recover to its initial state. As the gas concentration increased, the response-recovery process was cycled until the gas concentration reached 100 ppm. The entire gas data set acquisition experiment was repeated 8 times. Each gas concentration gradient was defined as a separate sample, and a total of 80 samples from 10 different gas concentrations were generated. The data acquisition process in a single experiment generated a total of 18,000×7×10 data points, where 18,000 represents the sampled data points for each sample, a sampling time of 360 seconds at a frequency of 50 Hz, 7 represents the number of sensors, and 10 represents the number of samples collected in one experiment.
[0110] Due to the large size of the original dataset, which makes data analysis and calculation complicated, especially on resource-constrained edge devices, 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 method retains the main features of the data while increasing the distance between data points and reducing data redundancy. Therefore, the time required for model training and the computing resources required for edge computing are significantly reduced, thereby improving training and computing efficiency.
[0111] In addition, differences in sensitivity, output range, and response rate among different gas sensors may cause data bias, so it is necessary to convert the raw ADC readings to response values to map the output data to a uniform range to reduce 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 obvious steady-state values. Figure 4 (b) shows the concentration gradient curve derived from the response value, where the ADC reading value 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 plus the cosine annealing hot restart strategy C-CNN, and the convolutional neural network plus the efficient channel attention mechanism E-CNN with the gas concentration prediction network model of the present invention using the cosine annealing hot restart strategy and the convolutional neural network CE-CNN integrated with the efficient channel attention mechanism. 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) It verifies 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 reduced to 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 2The CE-CNN model improves this index to 0.9985. Figure 5 (c) as 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 the local minimum, while ECA enhances the capture of channel dependencies, thereby reducing losses and prediction errors, 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 the present 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 contrast, among the 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 not 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 the training efficiency and model convergence by periodically resetting the learning rate starting from a higher value. Finally, the ability of CNN in capturing complex nonlinear relationships in input response data is crucial for accurate concentration prediction. Therefore, the combination of the three methods forms an efficient model.
[0119] Although machine learning algorithms have advantages when computing resources are low and have certain advantages on edge devices, the main indicators of the concentration prediction task 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 selection of kernel functions and regularization parameters, making it less effective in modeling complex nonlinear relationships; and decision tree regression DTR is sensitive to noise and has poor generalization ability. These inherent limitations explain why traditional machine learning models perform relatively poorly 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] To evaluate the fitting ability of the model, the predicted C2H4 concentrations were analyzed in comparison with the standard concentrations, e.g. Figure 7 As shown. The horizontal axis represents the standard value, and the vertical axis represents the predicted value of the gas concentration. The degree to which the black point deviates from the red line indicates the prediction accuracy of the model. The light red shaded area indicates the range of the prediction band. Obviously, the model effectively identifies C2H4 in the range of 10 to 100 ppm in the environment. The fitting equation between the standard value and the predicted value is y=-0.41171+1.00343x, and the slope is close to 1, which further verifies 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 way to build an efficient, reliable and convenient analysis system. In the testing phase, edge testing was performed using the electronic nose with the CE-CNN model deployed to evaluate the performance of the device. Specifically, the test set was input into the edge device, and the C2H4 concentration ranged from 10ppm to 100ppm, with an increment of 10ppm each time, covering a total of 10 concentrations. The electronic nose displayed and recorded the predicted value of each C2H4 concentration in real time. Each concentration test was repeated 5 times and the average was taken. In addition, the maximum concentration prediction error of the miniature portable electronic nose was 1.80ppm. 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 electronic nose systems, the advanced neural network models deployed in the miniature portable electronic nose enable the device to still perform well when processing complex data. In addition, for edge computing, data processing is performed directly on the MCU installed in the electronic nose. Processes such as sensing, data acquisition, and model reasoning can all be completed on this small edge device, eliminating dependence on external facilities, reducing hardware costs, and achieving real-time measurement.
[0128] like Fig. 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 above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A gas concentration prediction method based on 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 pooling 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 pooling 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 a gas concentration prediction result Y.
2. The gas concentration prediction method based on MEMS electronic nose according to claim 1 is 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 is 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 is 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 It represents the ADC reading of the gas sensor in the target gas, where the target gas is a flammable and explosive gas with a gas concentration ranging from 10 to 100 ppm.
5. The gas concentration prediction method based on MEMS electronic nose according to claim 1 is 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 multiplication unit, and the input layer is also connected to the element 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, and then optimizes the weight ω of each channel through a Sigmoid activation function, and passes the weight ω to an element 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 is 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 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 is characterized in that: The gas concentration prediction network model CE-CNN adopts the cosine annealing hot 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 is characterized in that: The mean absolute error (MAE), mean square error (MSE) and evaluation index R are used. 2 The three evaluation indicators are used to evaluate the prediction performance of the gas concentration prediction network model CE-CNN. The smaller the 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 is 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
CO concentration prediction method based on electronic nose and improved sample convolution interactive network
CN118332296A
Cross-platform recognition algorithm for electronic nose
CN118520351A
Quick and intelligent IR7-EC network based classification method for concrete image crack type
US20240029402A1