An electronic nose system online learning and optimization method and system

By introducing online learning and transfer learning modules into the electronic nose system, combining one-dimensional convolutional neural network and online passive aggression algorithm, the odor recognition process is optimized, and the problem of insufficient accuracy and real-time odor recognition in the existing technology is solved. The intelligent and integrated operation of electronic noses is realized.

CN118690830BActive Publication Date: 2024-11-05SHANDONG INST OF BUSINESS & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411155937.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-05
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Due to the limitations of the performance of algorithm processing units, existing electronic nose equipment cannot quickly and accurately perform odor recognition, making it difficult to achieve truly intelligent applications. It lacks automated integrated data acquisition, feature extraction, model training and recognition processes, resulting in accurate odor recognition. Not high rate and real-time performance.

Method used

An online learning and optimization method of electronic nose system is adopted, including online learning module, odor recognition model transfer learning module and incremental learning optimization module, and a one-dimensional convolutional neural network model and online passive aggression algorithm to achieve dynamic update of the model and Improve adaptability, optimize the odor recognition process through transfer learning and incremental learning.

Benefits of technology

Improve the real-time and accuracy of electronic nose odor recognition, simplify detection conditions and steps, realize the intelligent and integrated operation of electronic nose detection system, can quickly and accurately odor recognition, and embedded in resource-limited Effectively deploy lightweight deep learning algorithms on devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690830B_ABST
    Figure CN118690830B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of gas sensor detection, and specifically relates to an online learning and optimization method and system for an electronic nose system. Smell data is collected and marked in real time to form an initial data set, which is uploaded to a cloud server for subsequent model training; the trained model file and parameters are updated to the system to realize online dynamic learning of the electronic nose system; a one-dimensional convolutional neural network model is used as the original benchmark model, and the benchmark model is trained to obtain a pre-trained benchmark model; based on the pre-trained benchmark model, transfer learning is used to adjust the weight parameters to obtain a pre-trained one-dimensional convolutional neural network model after migration, and combined with an online passive aggression algorithm, incremental learning is performed on data samples transmitted to the electronic nose system in real time, thereby constructing a 1DCNN‑OPA dynamic learning model. The present invention realizes the intelligent and integrated operation of the intelligent electronic nose odor recognition system, with high recognition accuracy and strong real-time performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of gas sensor detection, and in particular relates to an online learning and optimization method and system for an electronic nose system. Background Art

[0002] In the field of gas sensing detection, improvements in sensor technology have enabled electronic noses to detect and identify odors more accurately. In data processing and pattern recognition, the odor data collected by the electronic nose requires complex processing and pattern recognition to produce accurate results. The development of artificial intelligence has provided electronic noses with powerful data processing and pattern recognition capabilities, enabling them to quickly and accurately identify and classify odors. In addition, the electronic nose also needs to establish and maintain a database containing various odor features. Manual feature engineering makes this work complicated, so it is necessary to adopt automatic feature extraction technology, and collect and organize data to ensure the accuracy and reliability of the database.

[0003] Effectively deploying lightweight deep learning models into embedded systems to realize intelligent applications is an important research direction in the field of artificial intelligence. Most of the existing mainstream methods focus on the research of algorithms in a specific aspect as mentioned above, without automatically integrating the odor analysis process of data collection, feature extraction, model training and recognition, and cannot achieve model adjustment and real-time training for different odor data. The accuracy and real-time performance of odor recognition are not high. With the advancement of technology, the characteristics of electronic nose equipment that meet the miniaturization and intelligence are also the main development trend. However, the existing electronic nose detection equipment on the market mostly uses traditional machine learning algorithms due to the performance limitations of the algorithm processing unit, and it is difficult to quickly and accurately obtain classification results and realize truly intelligent applications. It can be seen that this field is in urgent need of an electronic nose odor recognition system that can truly realize intelligence and integration to meet the detection needs of different scenarios. Summary of the invention

[0004] In order to overcome the problems in the prior art, the present invention proposes an online learning and optimization method and system for an electronic nose system.

[0005] The technical solution of the present invention to solve the above technical problems is as follows:

[0006] In a first aspect, the present invention provides an online learning and optimization system for an electronic nose system, comprising: an online learning module, an odor recognition model transfer learning module, and an incremental learning optimization module;

[0007] The online learning module is used to collect odor data in real time and mark it to form an initial data set, and upload the initial data set to the cloud server for subsequent model training; the trained model file and parameters are updated to the system to realize online dynamic learning of the electronic nose system;

[0008] The odor recognition model transfer learning module uses a one-dimensional convolutional neural model as an original benchmark model, trains the original benchmark model, and obtains a pre-trained benchmark model; based on the pre-trained benchmark model, weight parameters are adjusted by transfer learning to obtain a pre-trained one-dimensional convolutional neural network model after migration;

[0009] The incremental learning optimization module is used to perform incremental learning on the odor data samples transmitted to the electronic nose system in real time based on the migrated pre-trained one-dimensional convolutional neural network model and combined with the online passive-aggressive algorithm, so as to construct a 1DCNN-OPA dynamic learning model.

[0010] Furthermore, the one-dimensional convolutional neural network model includes an input layer, a first convolutional layer, a second convolutional layer, a first dropout layer, a first pooling layer, a third convolutional layer, a fourth convolutional layer, a second dropout layer, a second pooling layer, a fully connected layer and an output layer connected in sequence; the first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer are all used to extract features of odor data; the first dropout layer and the second dropout layer are both used to randomly discard some features; the first pooling layer and the second pooling layer are both used to retain the main features of the odor data and reduce the feature dimension; the fully connected layer is used for further dimensionality reduction processing, and finally outputs the probability distribution of the classification category of the odor data sample;

[0011] The original benchmark model is pre-trained based on an initial data set, data in a pre-defined data window of a specified size is read from the initial data set, and the one-dimensional convolutional neural network model parameters are pre-trained using a batch processing method to obtain a pre-trained benchmark model.

[0012] Furthermore, in the odor recognition model transfer learning module, the weight parameters of the pre-trained benchmark model are adjusted by using the 'pre-training + fine-tuning' mode of transfer learning based on the pre-trained benchmark model, so that it can adapt to the new odor data samples in the target domain based on the original odor data samples, and obtain the migrated pre-trained one-dimensional convolutional neural network model, specifically including: freezing the first convolutional layer, the second convolutional layer, the first dropout layer, the first pooling layer, the third convolutional layer, the fourth convolutional layer, the second dropout layer, and the second pooling layer in the pre-trained benchmark model, unfreezing the remaining layers of the one-dimensional convolutional neural network model, adjusting the model structure and weight parameters of the unfrozen one-dimensional convolutional neural network according to the new odor data samples, and obtaining a benchmark model adapted to the new target category task, that is, the migrated pre-trained one-dimensional convolutional neural network model.

[0013] Furthermore, in the incremental learning optimization module, the migrated pre-trained one-dimensional convolutional neural network model is used as a benchmark, combined with the online passive-aggressive algorithm, to perform incremental learning on the odor data samples transmitted to the electronic nose system in real time, so as to construct a 1DCNN-OPA dynamic learning model, which specifically includes: using the migrated pre-trained one-dimensional convolutional neural network model as a feature extractor to extract and transform the input odor data samples; combining the online passive-aggressive algorithm model as a classifier with the migrated pre-trained one-dimensional convolutional neural network model, performing incremental learning on the odor data samples collected in real time, constructing a 1DCNN-OPA dynamic learning model, and classifying and identifying odors.

[0014] Furthermore, the online passive-aggressive algorithm model is used as a classifier, and the formulas for predicting output, loss function, weights and biases are as follows:

[0015] Prediction output: (1);

[0016] Calculate the loss: (2);

[0017] When the predicted value is lower than the target value: (3);

[0018] When the predicted value is higher than the target value: (4);

[0019] in, is the input feature vector, is the true category label, is the learning rate, is the weight of the k-th classifier, is the bias of the kth classifier, is the predicted value of the k-th classifier, is the final weight, is the final bias, is the final predicted value;

[0020] In the initialization phase, the 1DCNN-OPA dynamic learning model creates a binary classifier for each pair of categories, that is, a classifier pair, and each binary classifier is used to distinguish the sample category; during the training process, for each input sample , 1DCNN-OPA dynamic learning model calculates the prediction score of each binary classifier , and select the category with the highest prediction score as the final prediction result ;

[0021] If the model's prediction is consistent with the true label, the loss function is 0; if If it is greater than 0, the learning rate is adjusted according to the loss value, and the weights and biases are updated; whenever a new odor sample is input into the 1DCNN-OPA dynamic learning model, the 1DCNN-OPA dynamic learning model adjusts the parameters according to the difference between the predicted value and the target value of each sample to achieve continuous model updating.

[0022] In a second aspect, the present invention further provides an online learning and optimization method for an electronic nose system, comprising the following steps:

[0023] Step 1: Collect different odor data to form multiple different odor data sets, that is, to form an initial data set;

[0024] Step 2: Establish a one-dimensional convolutional neural network model, take the one-dimensional convolutional neural network model as the original benchmark model, pre-train the original benchmark model to obtain a pre-trained benchmark model; use transfer learning based on the pre-trained benchmark model to adjust the weight parameters to obtain a pre-trained one-dimensional convolutional neural network model after migration;

[0025] Step 3: Based on the migrated pre-trained one-dimensional convolutional neural network model and combined with the online passive-aggressive algorithm, a 1DCNN-OPA dynamic learning model is constructed to learn the real-time incoming odor data samples.

[0026] Furthermore, the one-dimensional convolutional neural network model includes an input layer, a first convolutional layer, a second convolutional layer, a first dropout layer, a first pooling layer, a third convolutional layer, a fourth convolutional layer, a second dropout layer, a second pooling layer, a fully connected layer and an output layer connected in sequence; the first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer are all used to extract the features of the original signal of the sensor array; the first dropout layer and the second dropout layer are both used to randomly discard some features; the first pooling layer and the second pooling layer are both used to retain the main features of the data and reduce the feature dimension; the fully connected layer is used for further dimensionality reduction processing, and finally outputs the probability distribution of the classification category of the odor sample;

[0027] A one-dimensional convolutional neural network model is used as an original benchmark model, and the original benchmark model is pre-trained based on an initial data set. Data in a pre-defined data window of a specified size is read from the initial data set, and the one-dimensional convolutional neural network model parameters are pre-trained using a batch processing method to obtain a pre-trained benchmark model.

[0028] Furthermore, in step 2, the weight parameters of the pre-trained benchmark model are adjusted by adopting the 'pre-training + fine-tuning' mode of transfer learning based on the pre-trained benchmark model, so that it can adapt to the new odor data samples in the target domain based on the original odor data samples, and obtain the migrated pre-trained one-dimensional convolutional neural network model, specifically including: freezing the first convolutional layer, the second convolutional layer, the first dropout layer, the first pooling layer, the third convolutional layer, the fourth convolutional layer, the second dropout layer, and the second pooling layer in the pre-trained benchmark model, unfreezing the remaining layers of the one-dimensional convolutional neural network model, adjusting the model structure and weight parameters of the unfrozen one-dimensional convolutional neural network according to the newly collected odor data samples, and obtaining a benchmark model adapted to the new target category task, that is, the migrated pre-trained one-dimensional convolutional neural network model.

[0029] Furthermore, in step 3, based on the migrated pre-trained one-dimensional convolutional neural network model and combined with the online passive-aggressive algorithm, a 1DCNN-OPA dynamic learning model is constructed to learn the real-time incoming odor data samples, specifically including:

[0030] The migrated pre-trained one-dimensional convolutional neural network model is used as a feature extractor to extract and transform the features of the input odor data samples. The online passive-aggressive algorithm model is used as a classifier and combined with the migrated pre-trained one-dimensional convolutional neural network model to perform incremental learning on the odor data samples collected in real time, and a 1DCNN-OPA dynamic learning model is constructed to classify and identify odors.

[0031] Furthermore, the online passive-aggressive algorithm model is used as a classifier, and the formulas for predicting output, loss function, weights and biases are as follows:

[0032] Prediction output: (1);

[0033] Calculate the loss: (2);

[0034] When the predicted value is lower than the target value: (3);

[0035] When the predicted value is higher than the target value: (4);

[0036] in, is the input feature vector, is the true category label, is the learning rate, is the weight of the k-th classifier, is the bias of the kth classifier, is the predicted value of the k-th classifier, is the final weight, is the final bias, is the final predicted value;

[0037] In the initialization phase, the 1DCNN-OPA dynamic learning model creates a binary classifier for each pair of categories, that is, a classifier pair, and each binary classifier is used to distinguish the sample category; during the training process, for each input sample , 1DCNN-OPA dynamic learning model calculates the prediction score of each binary classifier , and select the category with the highest prediction score as the final prediction result ;

[0038] If the model's prediction is consistent with the true label, the loss function is 0; if If it is greater than 0, the learning rate is adjusted according to the loss value, and the weights and biases are updated; whenever a new odor sample is input into the 1DCNN-OPA dynamic learning model, the 1DCNN-OPA dynamic learning model adjusts the parameters according to the difference between the predicted value and the target value of each sample to achieve continuous model updating.

[0039] Compared with the prior art, the present invention has the following technical effects:

[0040] (1) The present invention adopts a one-dimensional convolutional neural network as the original benchmark model, and introduces online transfer learning and incremental learning modules, and proposes a recognition optimization method with an online learning mechanism. By continuously collecting new gas / odor data, the model is dynamically updated; the one-dimensional convolutional neural network automatically learns and extracts features from the original data; transfer learning fine-tunes the pre-trained model to adapt it to new samples in the target domain based on the original training samples; online incremental learning collects real-time sample data and dynamically adjusts parameters to optimize the model, making the model more flexible and usable.

[0041] (2) The present invention deploys the entire 1DCNN-OPA network to a GPU-based embedded edge platform, combines hardware and software to build an electronic nose system with an online learning mechanism, and implements network training and reasoning acceleration optimization on the edge computing platform; it solves the problem of how to better combine lightweight deep learning algorithms with resource-limited embedded devices in traditional electronic nose devices, improves the efficiency of model training and reasoning, and can obtain odor recognition results more quickly and accurately.

[0042] (3) The method of the present invention is based on convolutional neural networks and online learning technology, which improves the real-time and accuracy of electronic nose odor recognition, simplifies the detection conditions and steps of electronic nose odor recognition, and realizes the intelligent and integrated operation of the electronic nose detection system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 It is a schematic diagram of the online learning process of the present invention;

[0045] Figure 2 is a schematic diagram of the odor recognition network model of the present invention;

[0046] Figure 3 It is a schematic diagram of the transfer learning of the odor recognition network of the present invention;

[0047] Figure 4 This is a comparison chart of model results when unfreezing different layers of the pre-trained model during the transfer learning process of the present invention;

[0048] Figure 5 It is a schematic diagram of the online optimization strategy of the present invention;

[0049] Figure 6 It is the accuracy change curve of the online incremental learning of the present invention. DETAILED DESCRIPTION

[0050] In order to further explain the technical means and effects taken by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. The specific features, structures or characteristics in one or more embodiments may be combined in any suitable form. Unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those commonly understood by technicians in the technical field of the present invention.

[0051] In one embodiment of the present invention, an online learning and optimization system for an electronic nose system is provided, comprising: an online learning module, an odor recognition model transfer learning module, and an incremental learning optimization module;

[0052] The online learning module is used to collect odor data in real time and mark it to form an initial data set, and upload the initial data set to the cloud server for subsequent model training; the trained model file and parameters are updated to the system to realize online dynamic learning of the electronic nose system;

[0053] The odor recognition model transfer learning module uses a one-dimensional convolutional neural model as an original benchmark model, trains the original benchmark model, and obtains a pre-trained benchmark model; based on the pre-trained benchmark model, weight parameters are adjusted by transfer learning to obtain a pre-trained one-dimensional convolutional neural network model after migration;

[0054] The incremental learning optimization module is used to perform incremental learning on the odor data samples transmitted to the electronic nose system in real time based on the migrated pre-trained one-dimensional convolutional neural network model and combined with the online passive-aggressive algorithm, so as to construct a 1DCNN-OPA dynamic learning model.

[0055] In this embodiment, the online learning module is used to collect odor data in real time and mark it to form an initial data set, and upload the initial data set to the cloud server for subsequent model training; the trained model files and parameters are updated to the system to realize online dynamic learning of the electronic nose system.

[0056] Among them, refer to Figure 1 , the online learning module includes a data acquisition module, a core control module and a cloud server;

[0057] The data acquisition module is used to collect raw odor data and transmit multiple gas response voltage values ​​and temperature and humidity information to the core control module in the form of timestamps. The data acquisition module includes an STM32 microcontroller based on a Cortex-M3 core, a gas sensor array, an air pump, a gas path gating device and a signal acquisition circuit. The original odor data is collected through the gas sensor array, and multiple gas response voltage values ​​and temperature and humidity information are transmitted to the core control module in the form of timestamps through a Bluetooth serial port. Specifically, the STM32 microcontroller serves as the core of the data acquisition module, and the STM32 microcontroller based on the Cortex-M3 core is used for overall data acquisition process control, receiving digital signals from the signal acquisition circuit, and processing, storing and transmitting gas data; the air pump is used to extract sample gas into the system to ensure that the gas sensor array can detect accurate gas concentrations; the gas path gating device enables different gases or odors to be detected sequentially or simultaneously by the sensor by accurately controlling the gas flow path, and is implemented using existing technology; the gas sensor array is composed of multiple gas sensors of different types, which can simultaneously detect the concentrations of multiple gases or odors and provide original gas data; the signal acquisition circuit is used to convert the analog signal output by the gas sensor array into a digital signal, which is convenient for the microcontroller to process and transmit.

[0058] The core control module is used to add labels to the odor data and transmit it remotely to the cloud server through NB-IOT (NarrowBand Internet of Things). The core control module is an embedded GPU edge computing platform that runs the Linux system. The core is the NVIDIA Jetson TX2 NX module, with a built-in algorithm analysis unit and data storage unit. The built-in algorithm analysis unit is used to convert the raw data into the tensor form required by the algorithm model and add labels to the data. The data storage unit is used to store data and display the recognition results.

[0059] The cloud server receives data for model training and obtains the corresponding weight parameter file; the built-in online intelligent recognition software updates the trained model parameter file to the system and continuously collects new data for incremental learning and odor recognition.

[0060] The online intelligent recognition software includes a function configuration module, an online update module and a real-time display module. Among them, the function configuration module is used to receive, process and store the real-time data stream transmitted from the data acquisition module, analyze and process the original gas / odor data, and finally display the classification recognition results; the online update module is used for data annotation, file upload and pre-trained model and parameter delivery, which is to transfer the pre-trained model and parameter files in the cloud server to the core control module, and the main interface reads the model and analyzes and recognizes the new gas / odor data, and provides the option of whether to migrate the model, set it according to the category of the sample being tested, and then perform incremental learning and generate recognition results; the real-time display module is used to display the response voltage and time waveform of the odor sample in real time, and the user can decide whether to stop data acquisition by configuring the button.

[0061] After completing the design and model deployment of the electronic nose system, an experimental scheme was designed to verify whether it can continuously improve its performance through online learning. The data acquisition module continuously collects sample data from the gas sensor array and transmits it to the core control module; these data are recorded with timestamps. In the core control module, the raw data is converted into the tensor form required by the algorithm model and labels are added to the data. The data is stored in the core control module in the CSV (Comma-Separated Values) file format or uploaded to the server.

[0062] In this embodiment, the odor recognition model transfer learning module is used to train the original benchmark model with the one-dimensional convolution model as a benchmark to obtain a pre-trained benchmark model; and to adjust the weight parameters using transfer learning based on the pre-trained benchmark model to obtain a migrated pre-trained one-dimensional convolutional neural network model.

[0063] The odor recognition model transfer learning module adopts the 'pre-training + fine-tuning' mode of transfer learning. When faced with different environments and odor conditions, it quickly adapts to new scenarios and odor types by fine-tuning the model's weight parameters to obtain a pre-trained one-dimensional convolutional neural network model after migration. This process uses the previously learned knowledge structure to adjust the model to improve the adaptability and accuracy of model recognition.

[0064] The one-dimensional convolutional neural network mainly includes 1 input layer, 4 convolutional layers, 2 pooling layers, 2 dropout layers, 1 fully connected layer and 1 output layer, wherein the pooling layer is global average pooling, and the dropout layer is a regularization technology. Specifically, the one-dimensional convolutional neural network model includes an input layer, a first convolutional layer, a second convolutional layer, a first dropout layer, a first pooling layer, a third convolutional layer, a fourth convolutional layer, a first dropout layer, a second pooling layer, a fully connected layer and an output layer connected in sequence. The original signal is collected by the sensor array and passed through the input layer, after which feature selection and dimensionality reduction are performed to extract the key features in the data; the convolution layer is used to extract the features of the original signal of the sensor array and perform array optimization, and the convolution kernel size of the four convolution layers is set to 3x3; to prevent overfitting, a dropout layer is added between every two convolution layers to randomly discard some features and improve the generalization ability and robustness of the model; at the same time, a pooling layer is added to retain the main features of the data and reduce the number of parameters by reducing the dimension of the features, thereby reducing the complexity of data operations. The convolution kernel size of the pooling layer is 2x2; after the feature learning is completed, the obtained features are extended to vectors through the fully connected layer and dimensionality reduction is performed, and finally the network outputs the probability distribution of the corresponding classification category, thereby realizing the classification of the input signal.

[0065] Each odor data sample has a time dimension of 600 (sampling frequency 1Hz), so the network input is a tensor of size (1, 600, 7), which represents the voltage values ​​of 7 gas sensors at 600 moments over time obtained from one sample measurement. The total input data obtained from n sample measurements is a data set of dimension (n, 600, 7), which is the initial data set. The data of size (1, 600, 7) of each sample measurement is converted into a one-dimensional vector operation, and features are extracted layer by layer using a one-dimensional convolutional network, which is integrated at the output layer to obtain an accurate representation of the input data.

[0066] The original benchmark model is pre-trained based on an initial data set, data in a pre-defined data window of a specified size is read from the initial data set, and the one-dimensional convolutional neural network model parameters are pre-trained using a batch processing method in combination with known measurement results to obtain a pre-trained benchmark model.

[0067] In the odor recognition model transfer learning module, based on the pre-trained benchmark model, the 'pre-training + fine-tuning' mode of transfer learning is used to adjust the weight parameters of the pre-trained benchmark model, so that it can adapt to the new samples of the target domain based on the original training samples, and obtain a benchmark model adapted to the new target category task; unfreeze some convolutional layers of the convolutional model to retain its learning ability for the low-level features of the gas / odor data; unfreeze different network layers according to the performance of the model, the cost of training, and the real-time nature of the task, so that the model can re-learn the identification features of specific gas / odor categories related to the gas / odor classification and recognition task. Specifically, all layers before the fully connected layer can be frozen, that is, the first convolutional layer, the second convolutional layer, the first dropout layer, the first pooling layer, the third convolutional layer, the fourth convolutional layer, the second dropout layer, and the second pooling layer are fixed, and by fine-tuning the model structure and weight parameters of the one-dimensional convolutional neural network, it is converted into a network model suitable for the newly collected gas / odor data, that is, the pre-trained one-dimensional convolutional neural network model after migration.

[0068] In this implementation, the incremental learning optimization module uses the migrated pre-trained one-dimensional convolutional neural network model as a benchmark, combined with the Online Passive-Aggressive Algorithms, to perform incremental learning on real-time incoming gas data samples; constructs a dynamic learning model of 1DCNN-OPA to continuously optimize odor recognition capabilities.

[0069] The baseline model of the incremental learning optimization module adopts the migrated pre-trained one-dimensional convolutional neural network model to directly learn the original input of the odor data set to automatically extract key features; the odor recognition task is regarded as a multivariate time series classification task, and a one-dimensional convolutional neural network is adopted to read the data in each designated data window. The sample overlap rate of the data window is dynamically adjusted according to the amount of data collected, and the importance of the multidimensional data collected by the gas sensor array is selected and the overall features are summarized and analyzed to complete the odor recognition.

[0070] In the incremental learning optimization module, the online passive-aggressive algorithm model is combined as a classifier with the migrated pre-trained one-dimensional convolutional neural network model, and the training samples are used in the embedded platform to classify and identify gases / odors. The migrated pre-trained one-dimensional convolutional model is used as a feature extractor to extract and transform the input data. Each group of newly collected odor data samples consists of odor data (X) and sample label values ​​(Y), where X is the array response data of dimension (1, 600, 7) and Y is the real sample label value encoded in integer. The odor data samples are input one by one into the migrated pre-trained one-dimensional convolutional neural network model for feature processing, and the output vector of the migrated pre-trained one-dimensional convolutional neural network model is set as the input vector x of the passive-aggressive algorithm OPA classifier, and the final gas sample label value is set to y, and the weights and bias parameters are randomly initialized to start the training process.

[0071] The passive-aggressive algorithm uses the "One-vs-Rest" (OvR) strategy to deal with multi-classification problems. Specifically, the implementation of this strategy includes the following aspects:

[0072] Prediction output: (1);

[0073] Calculate the loss: (2);

[0074] When the predicted value is lower than the target value: (3);

[0075] When the predicted value is higher than the target value: (4);

[0076] in, is the input feature vector, is the true category label, is the learning rate, is the weight of the k-th classifier, is the bias of the kth classifier, is the predicted value of the k-th classifier, is the final weight, is the final bias, is the final predicted value;

[0077] In the initialization phase, the model creates a binary classifier (i.e., a classifier pair) for each pair of categories. The task of each binary classifier is to distinguish whether a sample belongs to a specific category from other categories. During training, for each input sample , the model calculates the prediction score for each binary classifier (k) (-1 or 1), and select the category with the highest prediction score as the final prediction result .

[0078] If the prediction result of the 1DCNN-OPA dynamic learning model is consistent with the true label, the loss function is 0. If it is greater than 0, the learning rate is adjusted according to the loss value, and the weights and biases are updated. Whenever a new odor sample is input into the 1DCNN-OPA dynamic learning model, the 1DCNN-OPA dynamic learning model adjusts the parameters according to the difference between the predicted value and the target value of each sample to achieve continuous model updates, thereby optimizing the recognition accuracy. Through this iterative process, the 1DCNN-OPA dynamic learning model gradually learns and improves its ability to recognize odor samples.

[0079] Based on the same inventive concept, the embodiment of the present invention also provides an electronic nose system online learning and optimization method for realizing the above-mentioned electronic nose system online learning and optimization system. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more system embodiments provided below can refer to the above-mentioned limitations on an electronic nose system online learning and optimization system, and will not be repeated here.

[0080] In one embodiment of the present invention, an online learning and optimization method for an electronic nose system is provided, comprising the following steps:

[0081] Step 1: Collect different odor data to form multiple different odor data sets, that is, to form an initial data set;

[0082] Step 2: Establish a one-dimensional convolutional neural network model, take the one-dimensional convolutional neural network model as the original benchmark model, pre-train the original benchmark model to obtain a pre-trained benchmark model; use transfer learning based on the pre-trained benchmark model to adjust the weight parameters to obtain a pre-trained one-dimensional convolutional neural network model after migration;

[0083] Step 3: Based on the migrated pre-trained one-dimensional convolutional neural network model and combined with the online passive-aggressive algorithm, a 1DCNN-OPA dynamic learning model is constructed to learn the real-time incoming data samples.

[0084] The following is a detailed explanation of each of the above steps:

[0085] Step 1: Collect different odor data to form multiple different odor data sets, that is, to form an initial data set.

[0086] Sample data is continuously collected from the gas sensor array and transmitted to the core control module. These data are recorded with timestamps. The sensor models are shown in Table 1. The raw data is converted into the tensor form required by the algorithm model and labels are added to the data, which are then stored in csv file format or uploaded to the server.

[0087] Table 1 Gas sensor array models

[0088]

[0089] The concentration data of peracetic acid was collected as samples for concentration classification experiments, aiming to test whether the electronic nose system can effectively distinguish gases of different concentrations. In daily use, peracetic acid needs to be diluted to ensure safety. In this experiment, 6 concentration gradients were set for peracetic acid (0.1%, 0.2%, 0.3%, 0.4%, 0.5%, and 0.6%), and they were divided into two groups, A and B, each containing 3 concentration gradients. The sampling frequency of the electronic nose system for peracetic acid gas is 1Hz, the time step of each sample is 600 seconds, and the collection time of each group of samples is 10 minutes, of which the time for sampling gas and air is 5 minutes. A total of 2000 samples were collected for incremental training and testing.

[0090] Step 2: Establish a one-dimensional convolutional neural network model, take the one-dimensional convolutional neural network model as the original benchmark model, pre-train the original benchmark model to obtain a pre-trained benchmark model; use transfer learning based on the pre-trained benchmark model to adjust the weight parameters to obtain the migrated pre-trained one-dimensional convolutional neural network model.

[0091] As an example, this step may include:

[0092] Step 2-1: Establish a one-dimensional convolutional neural network model, which includes an input layer, a first convolutional layer, a second convolutional layer, a first dropout layer, a first pooling layer, a third convolutional layer, a fourth convolutional layer, a second dropout layer, a second pooling layer, a fully connected layer and an output layer connected in sequence.

[0093] The structure of a one-dimensional convolutional neural network is as follows: Figure 2As shown in the figure, it mainly includes 1 input layer, 4 convolution layers, 2 global average pooling layers, 2 dropout layers, 1 fully connected layer and 1 output layer. The original signal is collected by the sensor array and passed to the neural network through the input layer. Feature selection and dimensionality reduction are performed at each layer to extract the key features in the data. Among them, the convolution layer is used to extract the features of the original signal of the sensor array and perform array optimization. The convolution kernel size of the 4 convolution layers is set to 3x3. In order to prevent overfitting, a dropout layer is added between every two convolution layers to randomly discard some features and improve the generalization ability and robustness of the model; at the same time, a global average pooling layer is added to retain the main features of the data, and reduce the number of parameters by reducing the dimension of the features, thereby reducing the complexity of data operations. The convolution kernel size of the global average pooling layer is 2x2. After the feature learning is completed, the obtained features are extended to vectors through the fully connected layer and dimensionality reduction is performed. Finally, the network outputs the probability distribution of the corresponding classification category, thereby realizing the classification of the input signal;

[0094] Each sample has a time dimension of 600 (sampling frequency 1Hz), so the network input is a tensor of size (1, 600, 7), which represents the voltage values ​​of 7 gas sensors at 600 moments over time obtained from one sample measurement. The total input data obtained from n sample measurements is a data set of dimension (n, 600, 7), which is the initial data set. The data of size (1, 600, 7) of each sample measurement is converted into a one-dimensional vector operation, and features are extracted layer by layer using a one-dimensional convolutional network, which is integrated at the output layer to obtain an accurate representation of the input data.

[0095] The original benchmark model is pre-trained based on an initial data set, data in a pre-defined data window of a specified size is read from the initial data set, and the one-dimensional convolutional neural network model parameters are pre-trained using a batch processing method in combination with known measurement results to obtain a pre-trained benchmark model.

[0096] Step 2-2: Train the constructed one-dimensional convolutional neural network model to obtain a pre-trained benchmark model;

[0097] The obtained odor data set is defined as the source domain Ds, which is used to train the one-dimensional convolutional neural network model to establish the learning task Ts and obtain the pre-trained benchmark model.

[0098] Specifically, based on the principle of odor category balance, the constructed one-dimensional convolutional neural network model is trained to obtain a pre-trained benchmark model. As an example, 400 training samples are collected from the peracetic acid concentration of group A and uploaded to the server for training the one-dimensional convolutional neural network model while maintaining category balance; the trained model is sent to the core control module and 300 test samples are collected to test the model, and its accuracy is recorded as a baseline.

[0099] Step 2-3: Migrate the baseline model to the new target domain Dt and establish a new learning task Tt. Fix all layers of the baseline model before the fully connected layer, and convert it into a network model suitable for the newly collected gas / odor data by adjusting the weight parameters, that is, the migrated pre-trained one-dimensional convolutional neural network model.

[0100] In order to make the network scalable and applicable to new classification tasks, the network is migrated to the new target domain Dt and a new learning task Tt is established to improve its recognition ability in the new target domain. Figure 3 In the process, all layers of the baseline model before the fully connected layer are fixed, and by fine-tuning the model structure and weight parameters of the one-dimensional convolutional neural network, it is converted into a network model suitable for the newly collected gas / odor data in the embedded system, that is, the migrated pre-trained one-dimensional convolutional neural network model.

[0101] The convolutional layers of a one-dimensional convolutional neural network model usually learn to extract low-level features of data. In the gas / odor classification and recognition task, the first few layers of the one-dimensional convolutional neural network model are frozen to retain its ability to learn low-level features of gas / odor data, such as the basic shape and frequency of the gas / odor. You can also try to unfreeze different network layers by weighing the performance of the model, the cost of training, the real-time nature of the task, etc., until the model relearns higher-level identification features of specific gas / odor categories related to the gas / odor classification and recognition task.

[0102] The network layers of the one-dimensional convolutional neural network model are compared after the migration of the pre-trained model, when the weights are frozen at different network layers. The accuracy of the one-dimensional convolutional neural network model, the one-dimensional convolutional neural network-SGD model, and the one-dimensional convolutional neural network-OPA model on group B data is shown in Table 2. The specific results are as follows Figure 4 As shown in the figure, after experimental testing, the recognition accuracy of the model tends to increase with the increase of the number of unfreezing layers.

[0103] Table 2 Arrangement of the one-dimensional convolutional neural network structure from top to bottom

[0104]

[0105] Step 3: Based on the migrated pre-trained one-dimensional convolutional neural network model and combined with the online passive-aggressive algorithm, a 1DCNN-OPA dynamic learning model is constructed to learn the real-time incoming data samples, so that the 1DCNN-OPA dynamic learning model has the ability of incremental learning.

[0106] The pre-trained one-dimensional convolutional neural network model after the migration mentioned above can classify and identify new input data after training, but it does not have the ability to continuously learn new samples. The pre-trained one-dimensional convolutional neural network model after the migration is used as a benchmark, combined with the online passive-aggressive algorithm, to build a dynamic learning model based on 1DCNN-OPA, learn the real-time incoming data samples, so that the model has the ability of incremental learning.

[0107] First, the Fine-Tuning method is used in the system to fine-tune the baseline model. Fine-Tuning is a commonly used technique in the field of machine learning. It allows further adjustments based on an already trained model to make the model's output more in line with expectations. This method does not require retraining a new model, thus saving high training costs.

[0108] As an example, the Fine-Tuning method is used in the system to fine-tune the baseline model to adapt to the samples in group B. 400 samples from group B are collected for training, and 300 test samples are collected to test the model training accuracy under different layer weight freezing. Secondly, 300 training samples are collected again from group B, and incremental learning is gradually performed in the system. The pre-trained model after transfer learning is used to train the 1DCNN-OPA model.

[0109] In order to adapt to the real-time input samples, the OPA algorithm model in online learning is combined with the migrated pre-trained one-dimensional convolutional neural network model as a classifier, and the training samples are trained on the embedded platform to classify and identify gases / odors. The specific implementation process of online learning is as follows: Figure 5 As shown in the figure, the migrated pre-trained one-dimensional convolutional neural network model is used as a feature extractor to extract and transform the input data. Each group of newly collected odor samples consists of odor data (X) and sample label values ​​(Y); where X is the array response data of dimension (1, 600, 7) and Y is the real sample label value encoded in integer. The samples are input one by one into the migrated pre-trained one-dimensional convolutional neural network model for feature processing. The output vector of the migrated pre-trained one-dimensional convolutional neural network model is set as the input vector x of the passive-aggressive algorithm OPA classifier, the final gas sample label value is set to y, and the weights and bias parameters are randomly initialized to start the training process.

[0110] The passive-aggressive algorithm uses the "One-vs-Rest" (OvR) strategy to deal with multi-classification problems. Specifically, the implementation of this strategy includes the following aspects:

[0111] Prediction output: (1);

[0112] Calculate the loss: (2);

[0113] When the predicted value is lower than the target value: (3);

[0114] When the predicted value is higher than the target value: (4);

[0115] in, is the input feature vector, is the true category label, is the learning rate, is the weight of the k-th classifier, is the bias of the kth classifier, is the predicted value of the k-th classifier, is the final weight, is the final bias, is the final predicted value;

[0116] In the initialization phase, the model creates a binary classifier (i.e., a classifier pair) for each pair of categories. The task of each binary classifier is to distinguish whether a sample belongs to a specific category from other categories. During training, for each input sample , the model calculates the prediction score for each binary classifier (k) (-1 or 1), and select the category with the highest prediction score as the final prediction result .

[0117] If the prediction result of the 1DCNN-OPA dynamic learning model is consistent with the true label, the loss function is 0. If it is greater than 0, the learning rate is adjusted according to the loss value, and the weights and biases are updated. Whenever a new odor sample is input into the 1DCNN-OPA dynamic learning model, the 1DCNN-OPA dynamic learning model adjusts the parameters according to the difference between the predicted value and the target value of each sample to achieve continuous model updates, thereby optimizing the recognition accuracy. Through this iterative process, the 1DCNN-OPA dynamic learning model gradually learns and improves its ability to recognize odor samples.

[0118] like Figure 6 As shown in the figure, an incremental learning experiment is conducted to compare the training accuracy of the 1DCNN-OPA model and the 1DCNN-SGD model. The experimental results show that by adjusting their respective learning rates, both models can improve the recognition accuracy based on the baseline model, reaching an accuracy of 95.23%, which is 2.7% higher than the average accuracy of the original model. At the same time, the 1DCNN-OPA model converges faster.

[0119] The above two sets of experiments have verified that the electronic nose system with online learning mechanism can improve the accuracy of gas classification and identification in the process of continuously collecting new samples, and has the ability to adapt to sample data of other categories to a certain extent after adjusting the model.

[0120] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.

Claims

1. An online learning and optimization system for an electronic nose system, characterized in that: include: Online learning module, odor recognition model transfer learning module and incremental learning optimization module; The online learning module is used to collect and label odor data in real time to form an initial data set, and upload the initial data set to a cloud server for subsequent model training; The trained model files and parameters are updated to the system to realize online dynamic learning of the electronic nose system; The odor recognition model transfer learning module uses a one-dimensional convolutional neural model as an original benchmark model, trains the original benchmark model, and obtains a pre-trained benchmark model; based on the pre-trained benchmark model, weight parameters are adjusted by transfer learning to obtain a pre-trained one-dimensional convolutional neural network model after migration; The incremental learning optimization module is used to perform incremental learning on the odor data samples transmitted to the electronic nose system in real time based on the migrated pre-trained one-dimensional convolutional neural network model and combined with the online passive-aggressive algorithm, so as to construct a 1DCNN-OPA dynamic learning model, which specifically includes: using the migrated pre-trained one-dimensional convolutional neural network model as a feature extractor to perform feature extraction and conversion on the input odor data samples; The online passive-aggressive algorithm model is used as a classifier and combined with the migrated pre-trained one-dimensional convolutional neural network model. That is, the output vector of the migrated pre-trained one-dimensional convolutional neural network model is set as the input vector of the passive-aggressive algorithm OPA classifier. Incremental learning is performed on the odor data samples collected in real time, and a 1DCNN-OPA dynamic learning model is constructed to classify and identify odors.

2. The electronic nose system online learning and optimization system according to claim 1, characterized in that: The one-dimensional convolutional neural network model includes an input layer, a first convolutional layer, a second convolutional layer, a first dropout layer, a first pooling layer, a third convolutional layer, a fourth convolutional layer, a second dropout layer, a second pooling layer, a fully connected layer and an output layer connected in sequence; the first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer are all used to extract the features of the odor data; the first dropout layer and the second dropout layer are both used to randomly discard some features; the first pooling layer and the second pooling layer are both global average pooling with a convolution kernel size of 2x2, which is used to retain the features of the odor data and reduce the feature dimension; The fully connected layer is used for further dimensionality reduction processing, and finally outputs the probability distribution of the classification category of the odor data sample; The original benchmark model is pre-trained based on an initial data set, data in a pre-defined data window of a specified size is read from the initial data set, and the one-dimensional convolutional neural network model parameters are pre-trained using a batch processing method to obtain a pre-trained benchmark model.

3. The electronic nose system online learning and optimization system according to claim 2, characterized in that: In the odor recognition model transfer learning module, the weight parameters of the pre-trained benchmark model are adjusted by using the 'pre-training + fine-tuning' mode of transfer learning based on the pre-trained benchmark model, so that it can adapt to the new odor data samples in the target domain based on the original odor data samples, and obtain the migrated pre-trained one-dimensional convolutional neural network model, which specifically includes: freezing the first convolutional layer, the second convolutional layer, the first dropout layer, the first pooling layer, the third convolutional layer, the fourth convolutional layer, the second dropout layer, and the second pooling layer in the pre-trained benchmark model, unfreezing the remaining layers of the one-dimensional convolutional neural network model, adjusting the model structure and weight parameters of the unfrozen one-dimensional convolutional neural network for the new odor data samples, and obtaining a benchmark model adapted to the new target category task, that is, the migrated pre-trained one-dimensional convolutional neural network model.

4. The electronic nose system online learning and optimization system according to claim 1, characterized in that: Using the online passive-aggressive algorithm model as a classifier, the formulas for predicting output, loss function, weights and biases are as follows: Prediction output: (1); Calculate the loss: (2); When the predicted value is lower than the target value: (3); When the predicted value is higher than the target value: (4); in, is the input feature vector, is the true category label, is the learning rate, is the weight of the k-th classifier, is the bias of the kth classifier, is the predicted value of the k-th classifier, is the final weight, is the final bias, is the final predicted value; In the initialization phase, the 1DCNN-OPA dynamic learning model creates a binary classifier for each pair of categories, that is, a classifier pair, and each binary classifier is used to distinguish the sample category; during the training process, for each input sample , 1DCNN-OPA dynamic learning model calculates the prediction score of each binary classifier , and select the category with the highest prediction score as the final prediction result ; If the model's prediction is consistent with the true label, the loss function is 0; if If it is greater than 0, the learning rate is adjusted according to the loss value, and the weights and biases are updated; whenever a new odor sample is input into the 1DCNN-OPA dynamic learning model, the 1DCNN-OPA dynamic learning model adjusts the parameters according to the difference between the predicted value and the target value of each sample to achieve continuous model updating.

5. An online learning and optimization method for an electronic nose system, characterized in that: The following steps are involved: Step 1: Collect different odor data to form multiple different odor data sets, that is, to form an initial data set; Step 2: Establish a one-dimensional convolutional neural network model, take the one-dimensional convolutional neural network model as the original benchmark model, pre-train the original benchmark model to obtain a pre-trained benchmark model; use transfer learning based on the pre-trained benchmark model to adjust the weight parameters to obtain a pre-trained one-dimensional convolutional neural network model after migration; Step 3: Based on the migrated pre-trained one-dimensional convolutional neural network model and the online passive-aggressive algorithm, a 1DCNN-OPA dynamic learning model is constructed to learn the real-time incoming odor data samples, including: The migrated pre-trained one-dimensional convolutional neural network model is used as a feature extractor to extract and transform the input odor data samples. The online passive-aggressive algorithm model is used as a classifier and combined with the migrated pre-trained one-dimensional convolutional neural network model. That is, the output vector of the migrated pre-trained one-dimensional convolutional neural network model is set as the input vector of the passive-aggressive algorithm OPA classifier. Incremental learning is performed on the odor data samples collected in real time, and a 1DCNN-OPA dynamic learning model is constructed to classify and identify odors.

6. The method for online learning and optimization of an electronic nose system according to claim 5, characterized in that: The one-dimensional convolutional neural network model includes an input layer, a first convolutional layer, a second convolutional layer, a first dropout layer, a first pooling layer, a third convolutional layer, a fourth convolutional layer, a second dropout layer, a second pooling layer, a fully connected layer and an output layer connected in sequence; the first convolutional layer, the second convolutional layer, the third convolutional layer and the fourth convolutional layer are all used to extract the features of the original signal of the sensor array; the first dropout layer and the second dropout layer are both used to randomly discard some features; the first pooling layer and the second pooling layer are both global average pooling with a convolution kernel size of 2x2, which is used to retain the features of the odor data and reduce the feature dimension; the fully connected layer is used for further dimensionality reduction processing, and finally outputs the probability distribution of the classification category of the odor sample; A one-dimensional convolutional neural network model is used as an original benchmark model, and the original benchmark model is pre-trained based on an initial data set. Data in a pre-defined data window of a specified size is read from the initial data set, and the one-dimensional convolutional neural network model parameters are pre-trained using a batch processing method to obtain a pre-trained benchmark model.

7. The method for online learning and optimization of an electronic nose system according to claim 6, characterized in that: In the step 2, the weight parameters of the pre-trained benchmark model are adjusted by using the 'pre-training + fine-tuning' mode of transfer learning based on the pre-trained benchmark model, so that it can adapt to the new odor data samples in the target domain based on the original odor data samples, and obtain the migrated pre-trained one-dimensional convolutional neural network model, specifically including: freezing the first convolutional layer, the second convolutional layer, the first dropout layer, the first pooling layer, the third convolutional layer, the fourth convolutional layer, the second dropout layer, and the second pooling layer in the pre-trained benchmark model, unfreezing the remaining layers of the one-dimensional convolutional neural network model, adjusting the model structure and weight parameters of the unfrozen one-dimensional convolutional neural network according to the newly collected odor data samples, and obtaining a benchmark model adapted to the new target category task, that is, the migrated pre-trained one-dimensional convolutional neural network model.

8. The method for online learning and optimization of an electronic nose system according to claim 5, characterized in that: Using the online passive-aggressive algorithm model as a classifier, the formulas for predicting output, loss function, weights and biases are as follows: Prediction output: (1); Calculate the loss: (2); When the predicted value is lower than the target value: (3); When the predicted value is higher than the target value: (4); in, is the input feature vector, is the true category label, is the learning rate, is the weight of the k-th classifier, is the bias of the kth classifier, is the predicted value of the k-th classifier, is the final weight, is the final bias, is the final predicted value; In the initialization phase, the 1DCNN-OPA dynamic learning model creates a binary classifier for each pair of categories, that is, a classifier pair, and each binary classifier is used to distinguish the sample category; during the training process, for each input sample , 1DCNN-OPA dynamic learning model calculates the prediction score of each binary classifier , and select the category with the highest prediction score as the final prediction result ; If the model's prediction is consistent with the true label, the loss function is 0; if If it is greater than 0, the learning rate is adjusted according to the loss value, and the weights and biases are updated; whenever a new odor sample is input into the 1DCNN-OPA dynamic learning model, the 1DCNN-OPA dynamic learning model adjusts the parameters according to the difference between the predicted value and the target value of each sample to achieve continuous model updating.