A lightweight gas identification method using an electronic nose

By using data preprocessing and model pretraining methods in the electronic nose, virtual sensor signals and spatiotemporal pseudo-images are generated, multiple rounds of parallel training of the convolutional neural network model, and deployed to the electronic nose microprocessor through the TinyML framework, the deployment of the deep learning model on resource-constrained devices in the existing technology is solved, and efficient and portable gas recognition effect is achieved.

CN119357560BActive Publication Date: 2025-04-29ZHEJIANG GONGSHANG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411897193.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-29
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

Existing deep learning models face resource constrained deployment difficulties caused by spatiotemporal information destruction, overfitting and high complexity in electronic nasal gas recognition, and are difficult to effectively deploy in small micro electronic nasal devices.

Method used

An electronic nose lightweight gas recognition method is adopted to use data preprocessing, model pretraining and deployment to resource-constrained microprocessors. The specific steps include data acquisition and preprocessing, using the absolute sensor response difference method and Markov transfer field method to generate virtual sensor signals and spatiotemporal pseudo-images, conduct multiple rounds of parallel training on the convolutional neural network model, select the model with the highest accuracy of the test set as the pre-trained final model, and deploy the model to the embedded microprocessor of the electronic nose through the TinyML micro machine learning framework.

Benefits of technology

It realizes the deployment of deep learning models on resource-constrained electronic nose microprocessors, maintains high recognition accuracy, reduces costs, and expands application scenarios. It is suitable for fast, portable, and real-time gas detection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357560B_ABST
    Figure CN119357560B_ABST
Patent Text Reader

Abstract

The present invention provides a lightweight gas identification method for an electronic nose, which takes into account both the accuracy of gas identification and the lightweight of the model, and can be deployed on a resource-constrained electronic nose microprocessor. The present invention includes the following steps: (i) using an electronic nose to collect data and preprocess the data; (ii) model pretraining, including the following steps: (1) processing the preprocessed data to generate a virtual sensor signal; (2) using the generated virtual sensor signal to construct a Markov chain and generate a Markov transfer field spatiotemporal pseudo image; (3) using the spatiotemporal pseudo image as input, performing multiple rounds of parallel training on the convolutional neural network model, and selecting the pretrained final model; (iii) deploying the model on the microprocessor of the electronic nose; when the electronic nose is used in an actual scenario, the electronic nose collects gas signal data, and the pretrained model in the electronic nose microprocessor performs inference and recognition to obtain the final recognition result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a lightweight gas identification method of an electronic nose. Background Art

[0002] Smell is one of the indispensable senses in human life. It can help people identify food and detect potential dangers, thereby improving the quality of life and ensuring safety. Therefore, the demand for research and development of olfactory bionic technology is becoming increasingly prominent, which is of great significance to human life and social development. The artificial olfactory system - electronic nose is a bionic gas detection instrument that uses a cross-sensitive sensor array to collect comprehensive gas information of the sample being tested, and then uses appropriate pattern recognition methods to classify it. As a non-destructive testing method, the electronic nose has the advantages of fast detection speed, high accuracy, simple operation and low cost, and can be widely used in the fields of environment, food, medical care, public safety, etc.

[0003] The electronic nose detects gas mainly in three steps: data acquisition, feature extraction, and pattern recognition. In traditional gas identification methods, the above three steps are often independent, especially the quality of the feature extraction method directly affects the decision-making results of pattern recognition. This process depends on the experience of the designer, and excessive human intervention leads to limitations in the accuracy and generalization ability of the algorithm. In recent years, the rapid development of deep learning has provided electronic noses with more powerful data processing and pattern recognition capabilities for gas identification, and has significantly improved the accuracy of complex gas identification by automatically extracting high-dimensional features. As shown in the Chinese patent with application number 201810812710.2, entitled Electronic Nose-Based Odor Identification Method, Device, and Electronic Nose System.

[0004] However, the application of deep learning algorithms in electronic nose gas recognition still faces some challenges. First, since the original signals collected by the electronic nose are multi-channel time series data, directly using existing deep learning models for recognition may destroy the temporal and spatial information contained in them, resulting in unsatisfactory recognition results; second, the high complexity of deep learning models often requires a large amount of labeled data for training, and due to the high cost of collecting and labeling gas data, usually only small-scale data sets can be obtained. This contradiction between data scale and model complexity inevitably leads to overfitting, thereby reducing the accuracy of model recognition; third, the complexity of existing deep learning models is usually high, and their huge number of parameters and computing requirements face challenges in deployment on resource-constrained hardware platforms, making it difficult to integrate deep learning algorithms into small and micro electronic nose devices. Summary of the invention

[0005] The purpose of the present invention is to overcome the above-mentioned deficiencies in the prior art and to provide a reasonably designed electronic nose lightweight gas identification method, which takes into account both the accuracy of gas identification and the lightweight of the model and can be deployed on a resource-constrained electronic nose microprocessor.

[0006] The technical solution adopted by the present invention to solve the above problem is: a lightweight gas identification method of an electronic nose, characterized in that it includes the following steps:

[0007] 1. Collect data using electronic nose and pre-process the data;

[0008] (II) Model pre-training includes the following steps:

[0009] (1) Process the preprocessed data to generate a virtual sensor signal;

[0010] (2) Use the generated virtual sensor signals to construct a Markov chain and generate a spatiotemporal pseudo image of the Markov transfer field;

[0011] (3) Using the Markov transfer field spatiotemporal pseudo image as input, the convolutional neural network model is trained in multiple rounds in parallel, and the model with the highest accuracy in the test set is selected as the final pre-trained model;

[0012] (3) Deploy the pre-trained model to the microprocessor of the electronic nose; when the electronic nose is used in an actual scenario, the electronic nose collects gas signal data, which is directly inferred and recognized by the pre-trained model in the electronic nose microprocessor to obtain the final recognition result.

[0013] In step (ii) (1) of the present invention, the pre-processed data is processed using an absolute sensor response difference method, which is expressed as:

[0014] ,

[0015] in and Respectively represent t i The response value data of the ath and bth sensors after time preprocessing are converted by the absolute sensor response difference method to generate A virtual sensor signal.

[0016] The step (ii) (2) of the present invention specifically includes the following steps:

[0017] (1) Take a one-dimensional vector s(t) for the virtual sensor signal:

[0018] ,

[0019] Represents the virtual sensor signal of the i-th sensor generated at time t; determine its Q quantile interval and assign each virtual sensor signal value to the corresponding interval q j ;

[0020] (2) Construct a Q×Q Markov transfer matrix W, which is represented by the following matrix:

[0021] ,

[0022] where w ij Indicates that the current virtual sensor signal value is at quantile q i and the next value is at quantile q j The probability of

[0023] (3) Based on the Markov transfer matrix W, a Markov transfer field is constructed, which is represented by the following matrix:

[0024] ;

[0025] (4) In the time series data of the virtual sensor signal generated by the absolute sensor response difference method, several time points are intercepted, and each one-dimensional vector s(t) is subjected to Markov transfer field transformation to obtain a sub-image, which is then spliced ​​in the order of their appearance in the time series to generate the final Markov transfer field spatiotemporal pseudo-image.

[0026] In step (ii) (3) of the present invention, the size and step length of the convolution kernel of the convolutional neural network layer are consistent with the dimension of the sub-image; the convolutional layer contains r convolution kernels, and after passing through this layer, the size is The sub-images are convolutionally encoded into 1×1 dimensions, output as 1×rP dimensional vectors through the flattening layer, and passed to the fully connected layer. The final output layer contains C neurons, corresponding to the number of classified categories.

[0027] The step (I) of the present invention specifically includes the following steps:

[0028] (1) Use the electronic nose to collect data, and transmit and store the collected data in a computer;

[0029] (2) Preprocess the collected data, which specifically includes the following steps:

[0030] (21) Filter and denoise the collected data;

[0031] (22) Align the baseline of the filtered and denoised data.

[0032] The steps of filtering and denoising described in the present invention are as follows:

[0033] Assume that the data x sampled N times by the kth sensor of the electronic nose is k Represented as x k ={x k (t1), x k (t2),…,x k (t N )}, then the kth sensor is at t i The response value data x after filtering at time k (t i ) filtered for:

[0034] ,

[0035] x k (t i ) indicates that the kth sensor is at t i The response value data at time x k (t i-1 ) indicates that the kth sensor is at t i-1 The response value data at the moment, SH represents the set threshold.

[0036] The steps of baseline alignment described in the present invention are as follows:

[0037] The w sampling data of each sensor before the target gas is introduced are averaged respectively, and the corresponding average value is subtracted from the response value data of each sensor to align the baseline. The specific method is as follows:

[0038] ;

[0039] After the baseline is aligned, the kth sensor is at t i The response value data at the moment.

[0040] After aligning the baseline of the filtered and denoised data, the present invention augments the data. The augmentation steps are as follows:

[0041] (1) Assume that the time series data of the electronic nose after baseline alignment is ,

[0042] in , represents the t of a single sample i The one-dimensional vector of the sensor array signal collected at the moment and after baseline alignment, n is the number of sensors in the sensor array, and N represents the total number of sampling points;

[0043] (2) Randomly extract P one-dimensional vectors from the time series data T to form a downsampled sample T', and construct an augmented data set through multiple extractions , as follows:

[0044] ,

[0045] ,

[0046] The index collection Used to construct u random subsequences ;

[0047] P is an empirical parameter;

[0048] is any vector after baseline alignment in the v samplings before the l-th downsampling point;

[0049] m l (j) Indicates the jth down-sampled sample T' l The index subscript of a one-dimensional vector.

[0050] In step (i) of the present invention, the collected data is transmitted and stored in a computer, and data preprocessing and model pretraining are performed on the computer.

[0051] In step (iii) of the present invention, the pre-trained model is deployed to the embedded microprocessor hardware of the electronic nose through the TinyML micro machine learning framework method.

[0052] Compared with the prior art, the present invention has the following advantages and effects:

[0053] Through the innovation of the electronic nose gas recognition algorithm from input features to model structure, the deep learning model can still maintain a high recognition accuracy when data is limited. At the same time, the lightweight algorithm ensures that it can be deployed on resource-constrained embedded microprocessors, and real-time gas detection and recognition can be achieved without computer processing. It not only realizes the miniaturization and intelligence of the electronic nose system, but also reduces costs and expands application scenarios. It is suitable for a variety of occasions that require fast, portable, and real-time gas detection. It provides a new solution for low-cost portable and handheld electronic nose devices, and provides new technologies for on-site gas detection and rapid identification in mobile environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 The following is a flowchart of an embodiment of the present invention.

[0055] Figure 2 This is a main algorithm flow chart of an embodiment of the present invention.

[0056] Figure 3 This is a flow chart of the use of the handheld electronic nose system used in the experiment of the present invention.

[0057] Figure 4These are pseudo images generated by the absolute sensor response difference method and the Markov transfer field method for the six types of vinegar in the experiment of the present invention.

[0058] Figure 5 These are the spatiotemporal pseudo images of the six types of vinegar used for model pre-training in the experiment of the present invention.

[0059] Figure 6 This is the confusion matrix of the recognition results of 6 types of vinegar in the experiment of the present invention. DETAILED DESCRIPTION

[0060] The present invention will be further described in detail below with reference to the accompanying drawings and by way of examples. The following examples are intended to explain the present invention but the present invention is not limited to the following examples.

[0061] 1. The electronic nose lightweight gas identification method according to the embodiment of the present invention comprises the following steps:

[0062] 1. Use the electronic nose to collect data and pre-process the data. The specific steps include:

[0063] (1) Use an electronic nose to collect data and transmit and store the collected data in a computer.

[0064] The electronic nose consists of a sensor array, an air chamber, an airflow control system, and a data acquisition module. During the data acquisition phase, the electronic nose is connected to a computer, and the collected data is transmitted and stored in the computer for subsequent data preprocessing and model pretraining on the computer side.

[0065] (2) Preprocess the collected data. The specific steps include:

[0066] (21) Filter and denoise the collected data.

[0067] The gas sensor signal collected by the electronic nose is a time series data. In order to avoid the influence of possible noise on the recognition result, it can be filtered and denoised first. In order to reduce the computational complexity of the filter and take into account the actual situation of the sensor output signal, a filtering method based on threshold SH is used to remove abnormal "burr" noise; the steps of filtering and denoising are as follows:

[0068] Suppose the response value data x of the kth sensor of the electronic nose sampled N times k Represented as x k ={x k (t1), x k (t2),…,x k (t N )}, then the kth sensor is at t i The response value data x after filtering at time k (ti ) filtered for:

[0069] ;

[0070] x k (t i ) indicates that the kth sensor is at t i The response value data at time x k (t i-1 ) indicates that the kth sensor is at t i-1 The response value data at the moment, SH represents the set threshold.

[0071] (22) Align the baseline of the filtered and denoised data.

[0072] Different sensors of the electronic nose usually have different response baselines, and the filtered and denoised data needs to be baseline aligned. The steps are as follows:

[0073] The present invention calculates the average value of the w sampling data of each sensor before the target gas is taken in, and subtracts the corresponding average value from the response value data of each sensor to align the baseline. The specific method is as follows:

[0074] ;

[0075] After the baseline is aligned, the kth sensor is at t i The response value data at the moment.

[0076] (23) Augment the data after baseline alignment.

[0077] If the sample size of data collected by the electronic nose is relatively large, data augmentation is not necessary. However, the data collection of the electronic nose requires processes such as intake reaction and exhaust cleaning, which is time-consuming. Therefore, the amount of data samples that can be obtained is usually small. In order to prevent the deep learning model from overfitting, considering the actual situation of the sensor output signal, the present invention can augment the data after baseline alignment by the following method:

[0078] (231), let the time series data of the electronic nose after baseline alignment be ,

[0079] in , i∈ [1, N], represents the t of a single sample i The one-dimensional vector of the sensor array signal collected at the moment and after baseline alignment, n is the number of sensors in the sensor array, and N is the total number of sampling points.

[0080] (232) Randomly extract P one-dimensional vectors from the above time series data T into regions to form a downsampled sample T', and construct an augmented data set through multiple extractions , as follows:

[0081] ,

[0082] ,

[0083] The index collection Used to construct u random subsequences ;

[0084] P is used to downsample the original time series data by N / P times. P is an empirical parameter set by oneself. That is, there are N original sampled time series data, and then a P is set to get the downsampling multiple N / P, that is, the time series data is reduced to the original P / N;

[0085] is any vector after baseline alignment in the v samplings before the l-th downsampling point. In this embodiment, v is 99 and u is 100.

[0086] m l (j) Indicates the jth down-sampled sample T' l The index subscript of a one-dimensional vector.

[0087] (II) Model pre-training includes the following steps:

[0088] (1) Use an absolute sensor response difference method ADSR to process the preprocessed data to generate a virtual sensor signal; if data augmentation is performed, the preprocessed data in this step includes all augmented data. Specifically, it includes the following steps:

[0089] The original electronic nose sensor array signal can be regarded as a comprehensive "fingerprint" of a specific gas, which contains rich gas information. In order to further extract its potential features, the preprocessed data is processed as follows:

[0090] The absolute sensor response difference method ADSR can be expressed as:

[0091] ,

[0092] in and Respectively represent t i After the preprocessing of the response value data of the ath and bth sensors at the moment, the absolute sensor response difference method ADSR conversion can generate Each virtual sensor signal is obtained by calculating the absolute value of the difference between any two sensor responses, which quantifies the relative changes between the sensor responses and reflects the spatial distribution characteristics of the sensor responses.

[0093] (2) Use the virtual sensor signal generated by the aforementioned absolute sensor response difference method ADSR to construct a Markov chain, capture the spatial information and correlation of the gas sensor data, and generate a Markov transfer field spatiotemporal pseudo image. The specific steps include:

[0094] (21) Take the one-dimensional vector s(t) of the virtual sensor signal:

[0095] ,

[0096] Represents the virtual sensor signal of the i-th sensor generated at time t, and determines its Q quantile interval, assigning each virtual sensor signal value to the corresponding interval q j , j∈ [1,Q].

[0097] (22) Construct a Q×Q Markov transfer matrix W, that is

[0098] ,

[0099] where w ij Indicates that the current virtual sensor signal value is at quantile q i and the next value is at quantile q j probability.

[0100] (23) However, the above Markov transfer matrix W only focuses on the information of adjacent points and ignores the spatial dependencies between all points to a certain extent. To overcome this defect, a Markov transfer field MTF is constructed based on the Markov transfer matrix W, which is expressed as the following matrix: ,

[0101] When the ath and bth virtual sensor signals generated at time t and Located at quantile q i and q j When M ij Represents q i →q j The transition probability of , where q ∈ [1, Q], ; Therefore, the Markov transfer field matrix M can be generated using the matrix W containing the transition probability. The Markov transfer field MTF realizes the encoding of the above one-dimensional vector s(t) into a pseudo image.

[0102] (24) In the virtual sensor signal time series data generated by the aforementioned absolute sensor response difference method ADSR, several time points are intercepted, and the above-mentioned Markov transfer field MTF transformation is applied to each one-dimensional vector s(t) to obtain a sub-image, and they are spliced ​​in the order of their order in the time series to generate the final Markov transfer field spatiotemporal pseudo-image. The spatiotemporal pseudo-image is a spatiotemporal pseudo-image representing the specific gas information. It retains and expands the spatiotemporal information of the original signal, laying an information foundation for improving the recognition accuracy of the deep learning model.

[0103] (3) The Markov transfer field spatiotemporal pseudo-image is used as input, and the convolutional neural network model is trained in multiple rounds in parallel. The model with the highest accuracy in the test set is selected as the pre-trained final model.

[0104] Since the Markov transition field spatiotemporal pseudo image generated by the above method is a pseudo image, it lacks semantic structure compared to the real image, and its structure mainly depends on the arrangement of the sub-images. Therefore, the convolution kernel size and step size of the convolutional neural network in the present invention are consistent with the dimension of the sub-image to retain the time information in the original response. Figure 2 As shown, the convolution layer contains r convolution kernels. After passing through this layer, the size is The sub-images are convolutionally encoded into 1×1 dimensions, output as 1×rP dimensional vectors through the flattening layer, and passed to the fully connected layer. The final output layer contains C neurons, corresponding to the number of classified categories.

[0105] The present invention uses the Markov transfer field spatiotemporal pseudo image generated after ADSR and MTF conversion as input, adopts the 10-fold cross-validation method to perform multiple rounds of parallel training on the improved convolutional neural network model, and selects the model with the highest test set accuracy as the final model.

[0106] (3) Model deployment application, that is, deploying the above pre-trained model (including structure and parameters) to the embedded microprocessor hardware of the electronic nose through the TinyML micro machine learning framework (such as Google's TensorFlowLite) and deployment method.

[0107] When using the electronic nose in actual scenarios, there is no need to connect to a computer. It is only necessary to collect gas signals through an embedded microprocessor, perform the above-mentioned preprocessing such as filtering and denoising, baseline alignment, and directly use the pre-trained model deployed on it for inference and recognition to obtain the final recognition result. Before using the electronic nose in different application scenarios, it is necessary to first build a pre-trained model for the application scenario according to the aforementioned data preprocessing and model pre-training methods, and deploy it to the electronic nose embedded microprocessor before it can be used. Users can build multiple pre-trained models for different application scenarios and store them in the embedded microprocessor, switching between them as needed; they can also build more pre-trained model libraries and store them on the computer, deploying them as needed.

[0108] 2. Experiment: Use a handheld electronic nose to distinguish six types of “Chinese time-honored” vinegar from different origins and brands.

[0109] 1. Experimental handheld electronic nose.

[0110] This instrument integrates a small gas flow control system and a data acquisition and analysis system. The characteristics of each sensor are shown in Table 1. They are installed in the gas chamber.

[0111] Table 1

[0112] .

[0113] 2. Data Collection

[0114] As an experiment, this experiment selected six different brands of vinegar to verify the accuracy of the proposed method for identifying six types of vinegar with similar gases. These vinegars are Zhenjiang Hengshun, Sichuan Baoning, Tianjin Duliu, Shanxi Laifu, Liaoning Gaoqiao and Shanxi Donghu, marked as ZJHS, SCBN, TJDL, SXLF, LNGQ and SXDH respectively. 25 parallel samples were made for each type of vinegar, and 15 mL of each sample was placed in a clean and dry conical bottle, sealed with a rubber stopper, and left to stand for use. The laboratory temperature was controlled at 24°C.

[0115] Before formal data collection for each type of sample, the air chamber was first ventilated continuously in the cleaning mode, and the sensor was heated at the same time to desorb the residual gas on the sensor surface to maintain the sensitivity and consistency of the sensor. Then, the sampling mode was used to collect data for each parallel sample in turn, with a sampling frequency of 20Hz and a total time of 660 seconds. The no-load response value data generated in the first 25 seconds was used as the reference value of the sensor. From the 25th second, the headspace gas in the conical flask was introduced into the air chamber for 30 seconds through the air intake pump, and then the air intake pump was turned off to allow the gas to continue to react in the air chamber for 30 seconds, so that the sensor response reached a certain degree of balance. In the last 575 seconds, the air intake pump and the air outlet pump were turned on at the same time to introduce fresh air to clean the air chamber to desorb the sensor and restore the response signal to the baseline. Finally, 25 data samples were collected for each type of vinegar.

[0116] 3. Data preprocessing.

[0117] First, the original sensor response data was denoised using a threshold-based filtering method. Then, the data of the first 25 seconds of air intake were averaged and baseline aligned. The first 200 seconds of data after each air intake were retained for analysis. This data covers the full time series of sensor response, including adsorption, reaction, and desorption. Finally, the data was augmented using the augmentation method in the technical solution. The total number of samples in the augmented data set was 15,000.

[0118] 4. Model pre-training.

[0119] The model is pre-trained on the pre-processed data. First, the 8 sensor signals are converted by ADSR to generate 28 virtual sensor signals, and then the one-dimensional virtual sensor signals are converted into two-dimensional spatiotemporal pseudo images using MTF. Figure 4 As shown. In this experiment, for each sample data, 5 time points in its full time series are selected to obtain 5 one-dimensional vectors, which are converted by ADSR and MTF respectively to generate 5 sub-images of size 28×28, which are combined to form the spatiotemporal pseudo image of the sensor response of the data sample, as shown in Figure 5 The generated spatiotemporal pseudo image retains the spatiotemporal information of the original signal, laying an information foundation for deep learning model recognition.

[0120] This experiment uses Figure 5 The spatiotemporal pseudo image in the image is used as the input of the subsequent convolutional neural network. In this experiment, the total number of trainable parameters of the entire network is 3578. Through the 10-fold cross-validation method, the average test accuracy of 100 parallel training-testing experiments is taken as the final result. The final recognition accuracy reaches 99.42%. The confusion matrix is ​​as follows Figure 6 shown.

[0121] 5. Model deployment.

[0122] This experiment uses TinyML technology to deploy the pre-trained model to the embedded microprocessor of the electronic nose. TinyML is a technology that deploys machine learning algorithms to embedded devices with limited resources such as processing power, memory, and storage, so that these devices can make real-time inference decisions without computers or servers, and realize edge intelligence. This experiment uses the TensorFlow machine learning framework provided by Google to write the aforementioned model code, complete pre-training on the computer side, and then use the tool TensorFlow Lite converter provided by it to compress and quantize the pattern to generate a lightweight model file. This experiment uses ESP32 as the microprocessor. Without using a file system, the model file can be further converted into a C byte array using the provided tools, compiled into embedded code, and finally deployed to the microprocessor for operation.

[0123] 6. Equipment usage.

[0124] After the power is turned on, the LCD display of the handheld electronic nose in this experiment displays the main interface information. The user selects the specific operation mode through the button, including setting mode, cleaning mode, sampling mode and detection mode, such as Figure 3 As shown. In the setting mode, users can set the acquisition parameters, including the sampling frequency of each of the three modes of cleaning / sampling / detection; set the automatic start and stop time of the air inlet pump and the air outlet pump in the two modes of sampling / detection; configure the WiFi network connection parameters, etc. In the cleaning mode, users can manually control the start and stop of the air pump to clean the air chamber and restore the sensor baseline. At the same time, the system will automatically collect data to detect the baseline recovery, automatically stop cleaning, and prepare for the next operation. In the sampling mode, the system automatically controls the start and stop of the air pump according to the acquisition parameters of the setting mode. The collected gas data will be temporarily stored in the electronic nose or transferred to the computer software via USB or WiFi. After one acquisition, it will automatically clean and prepare for the next acquisition. In the detection mode, the system also automatically controls the start and stop of the air pump according to the acquisition parameters of the setting mode, and processes the collected data in real time, performs inference analysis through the built-in pre-trained model, and finally displays the detection results on the LCD. After one detection, it will automatically clean and prepare for the next detection. After each mode operation is completed, the user can press the button to return to the main interface.

[0125] Through the above experiments, the present invention can improve the recognition accuracy, and the gas recognition accuracy can reach more than 99%. The model proposed by the present invention contains only 3578 parameters, while even the simplest CNN model LeNet-5 has 61366 parameters. The number of parameters of the model of the present invention is only 5.83% of LeNet-5, which is more suitable for deployment on resource-constrained microcontroller platforms and adapting to the low power consumption requirements of embedded and portable devices.

[0126] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different, and the above content described in this specification is only an example of the structure of the present invention. All equivalent changes or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. Technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A lightweight gas identification method using an electronic nose, characterized in that: The steps include:

1. Collect data using electronic nose and pre-process the data; (II) Model pre-training includes the following steps: (1) Process the preprocessed data to generate a virtual sensor signal; In this step, the preprocessed data is processed using an absolute sensor response difference method, which is expressed as: , in and Respectively represent t i The response value data of the ath and bth sensors after preprocessing at time instant; Generated by absolute sensor response difference conversion A virtual sensor signal; (2) Use the generated virtual sensor signals to construct a Markov chain and generate a spatiotemporal pseudo image of the Markov transfer field; (3) Using the Markov transfer field spatiotemporal pseudo image as input, the convolutional neural network model is trained in multiple rounds in parallel, and the model with the highest accuracy in the test set is selected as the final pre-trained model; (3) Deploy the pre-trained model to the microprocessor of the electronic nose; when the electronic nose is used in an actual scenario, the electronic nose collects gas signal data, which is directly inferred and recognized by the pre-trained model in the electronic nose microprocessor to obtain the final recognition result.

2. The electronic nose lightweight gas identification method according to claim 1, characterized in that: The step (ii) (2) specifically includes the following steps: (1) Take a one-dimensional vector s(t) for the virtual sensor signal: , represents the virtual sensor signal of the i-th sensor generated at time t; Determine its Q quantile interval and assign each virtual sensor signal value to the corresponding interval q j ; (2) Construct a Q×Q Markov transfer matrix W, which is represented by the following matrix: , where w ij Indicates that the current virtual sensor signal value is at quantile q i and the next value is at quantile q j probability; (3) Based on the Markov transfer matrix W, a Markov transfer field is constructed, which is represented by the following matrix: ; (4) In the time series data of the virtual sensor signal generated by the absolute sensor response difference method, several time points are intercepted, and each one-dimensional vector s(t) is subjected to Markov transfer field transformation to obtain a sub-image, which is then spliced ​​in the order of their appearance in the time series to generate the final Markov transfer field spatiotemporal pseudo-image.

3. The electronic nose lightweight gas identification method according to claim 2, characterized in that: In the step (ii) (3), the convolution kernel size and step size of the convolutional neural network layer are consistent with the dimension of the sub-image; the convolutional layer contains r convolution kernels, and after passing through this layer, the size is The sub-images are convolutionally encoded into 1×1 dimensions, output as 1×rP dimensional vectors through the flattening layer, and passed to the fully connected layer. The final output layer contains C neurons, corresponding to the number of classified categories.

4. The electronic nose lightweight gas identification method according to claim 1, characterized in that: The step (specifically comprises the following steps: (1) Use the electronic nose to collect data, and transmit and store the collected data in a computer; (2) Preprocess the collected data, which specifically includes the following steps: (21) Filter and denoise the collected data; (22) Align the baseline of the filtered and denoised data.

5. The electronic nose lightweight gas identification method according to claim 4, characterized in that: The steps of filtering and denoising are as follows: Assume that the data x sampled N times by the kth sensor of the electronic nose is k Represented as x k ={x k (t1), x k (t2),…,x k (t N )}, then the kth sensor is at t i The response value data x after filtering at time k (t i ) filtered for: , x k (t i ) indicates that the kth sensor is at t i The response value data at time x k (t i-1 ) indicates that the kth sensor is at t i-1 The response value data at the moment, SH represents the set threshold.

6. The electronic nose lightweight gas identification method according to claim 4, characterized in that: The steps of baseline alignment are as follows: The w sampling data of each sensor before the target gas is introduced are averaged respectively, and the corresponding average value is subtracted from the response value data of each sensor to align the baseline. The specific method is as follows: ; After the baseline is aligned, the kth sensor is at t i The response value data at the moment.

7. The electronic nose lightweight gas identification method according to claim 6, characterized in that: After aligning the baseline of the filtered and denoised data, the data is augmented. The augmentation steps are as follows: (1) Assume that the time series data of the electronic nose after baseline alignment is ,in , represents the t of a single sample i The one-dimensional vector of the sensor array signal collected at the moment and after baseline alignment, n is the number of sensors in the sensor array, and N represents the total number of sampling points; (2) Randomly extract P one-dimensional vectors from the time series data T to form a downsampled sample T', and construct an augmented data set through multiple extractions , as follows: , , The index collection Used to construct u random subsequences ; P is an empirical parameter; is any vector after baseline alignment in the v samplings before the l-th downsampling point; m l (j) Indicates the jth down-sampled sample T' l The index subscript of a one-dimensional vector.

8. The electronic nose lightweight gas identification method according to claim 1, characterized in that: In step (i), the collected data is transmitted and stored in a computer, and data preprocessing and model pretraining are performed on the computer.

9. The electronic nose lightweight gas identification method according to claim 7, characterized in that: In step (iii), the pre-trained model is deployed to the embedded microprocessor hardware of the electronic nose through the TinyML micro machine learning framework method.

Citation Information

Patent Citations

  • Odor recognition method and device based on electronic nose and electronic nose system

    CN109239207A

  • Imaged liquor recognition method applicable to multiple electronic nose platforms

    CN108694375A