Gas detection model training method, device, medium and equipment based on electronic nose

By combining smoothing filter preprocessing and two-dimensional sensor image conversion of electronic nose gas recognition technology with data enhancement and deep learning, the problems of cumbersomeness and noise interference of traditional methods are solved, and high-precision and robust gas recognition is achieved.

CN115984624BActive Publication Date: 2025-09-16CHINA UNIV OF MINING & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310055393.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-19
Publication Date
2025-09-16
Estimated Expiration
2043-01-19

AI Technical Summary

Technical Problem

The existing electronic nose gas recognition technology has the following problems: traditional methods are cumbersome and require a lot of human involvement; deep neural networks have serious noise interference, resulting in low recognition accuracy and easy overfitting; and difficulty in sample collection leads to poor recognition accuracy.

Method used

Smoothing filter preprocessing is used to convert it into a two-dimensional sensor image. Combined with data enhancement technology and deep learning model, end-to-end learning is performed through a pre-trained detection model. The Gram angular field transform is used to generate a two-dimensional sensor image. The cross entropy loss function and adaptive moment estimation optimization algorithm are used for training.

Benefits of technology

It improves the accuracy of gas classification and recognition, reduces the incompleteness of artificial feature design, enhances the robustness and generalization ability of the model, and realizes end-to-end gas recognition learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115984624B_ABST
    Figure CN115984624B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of gas detection data processing, and specifically relates to a gas detection model training method, device, medium and equipment based on an electronic nose. The training method includes: acquiring a gas data set, performing smoothing filtering preprocessing on the sensor response data to obtain preprocessed data; converting the preprocessed data to generate two-dimensional sensor training images to form a two-dimensional sensor image set; using data enhancement technology on the two-dimensional sensor images to obtain a two-dimensional sensor image expansion set; analyzing the image to be analyzed in the two-dimensional sensor image expansion set using a pre-trained detection model, and determining a loss value based on the difference between the category label and the image analysis result; and training the pre-trained detection model based on the loss value, wherein the trained detection model is used to identify and detect the sensor image converted from the gas sensor response data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of gas detection data processing, and in particular relates to a gas detection model training method, device, medium and equipment based on an electronic nose. Background Art

[0002] In daily life and industrial production, accurate and rapid detection and identification of various flammable, explosive, toxic, and hazardous gases in the environment can provide early warning and prevent dangerous gas accidents, and is of great significance to human health and safety, as well as social harmony and stability. Therefore, how to quickly and accurately identify gases is a crucial research task. Electronic nose-based gas identification technology has a wide range of applications, playing a vital role in many fields, including disease prediction, food safety, and environmental monitoring. Therefore, electronic nose-based gas identification technology can be used to identify and classify flammable and explosive gases in mines. Electronic nose gas identification technology mimics the structure and function of the biological olfactory system to detect, analyze, and identify gases. It generally uses a combination of gas sensor arrays and pattern recognition algorithms to perform qualitative analysis of gases, thereby achieving gas identification and classification. Due to the constraints of gas sensor technology, it is difficult to make gas sensors have sensitivity similar to that of biological olfactory systems. The traditional electronic nose gas identification method is cumbersome and requires normalization, feature generation, feature reduction and other operations on the original gas sensor data for subsequent feature learning. The processed features are used as input to the pattern recognition algorithm, and the gas classification and identification are completed through the classifier.

[0003] Traditional electronic nose gas recognition technology requires preprocessing of raw data, extraction of gas type features, feature selection, and the design of effective recognition algorithms. Feature extraction and selection, in particular, require significant human involvement, requiring effective extraction and selection based on the characteristics of the gas to be identified. This results in poor versatility and difficulty. Furthermore, existing electronic nose gas recognition technology based on deep neural networks fails to account for the presence of noise or redundant interference in the raw response data. Instead, the raw response data is directly fed into the deep neural network for end-to-end learning, resulting in reduced gas recognition accuracy. Furthermore, the process of collecting electronic nose gas samples is difficult, and small samples can easily lead to overfitting of the classification model, which can also result in poor recognition accuracy. Summary of the Invention

[0004] To solve the technical problems existing in the above-mentioned prior art, the present invention provides a gas detection model training method, device, medium and equipment based on an electronic nose, wherein the training method includes the following steps:

[0005] Acquire a gas data set, the gas data set including sensor response data marked with category labels, and perform smoothing filter preprocessing on the sensor response data to obtain preprocessed data;

[0006] Converting the preprocessed data to generate two-dimensional sensor training images to form a two-dimensional sensor image set;

[0007] Applying data enhancement technology to the two-dimensional sensor image to obtain an extended set of two-dimensional sensor images, wherein the images to be analyzed in the extended set of two-dimensional sensor images are annotated with the category labels of the corresponding sensor response data;

[0008] Analyzing the image to be analyzed in the two-dimensional sensor image expansion set using a pre-trained detection model, and determining a loss value based on a difference between the category label and the image analysis result;

[0009] The pre-trained detection model is trained based on the loss value, and the trained detection model is used to identify and detect the sensor image converted from the gas sensor response data.

[0010] In some embodiments, acquiring the gas dataset comprises:

[0011] Obtaining raw sensor responses collected by a sensor array for gas atmospheres of different concentrations of several gas types, wherein the test time length and sampling frequency for each gas atmosphere are the same, the sensor array includes several different types of sensors, and each sensor generates raw sensor response data for a corresponding channel;

[0012] intercepting data within a same time period in the original sensor response data to form the sensor response data;

[0013] The sensor response data is labeled with the category label according to the gas category.

[0014] In some embodiments, before applying the data enhancement technology to the two-dimensional sensor image, the method further includes:

[0015] The two-dimensional sensor images corresponding to the original sensor response data collected at the same time by the same sensor array are spliced ​​into a combined two-dimensional sensor image, and the combined two-dimensional sensor image serves as an element of the two-dimensional sensor image set.

[0016] In some embodiments, the smoothing filter preprocessing includes fitting the sensor response data using a Savitzky-Golay smoothing filter algorithm.

[0017] In some embodiments, converting the preprocessed data to generate two-dimensional sensor training images to form a two-dimensional sensor image set includes:

[0018] Normalizing the preprocessed data to obtain normalized data, wherein the normalized data includes time series data with a function value between [0, 1];

[0019] Converting the normalized data into polar coordinate data, wherein the angle in the polar coordinate data is obtained by performing an arc cosine function calculation on the function value, and the radius in the polar coordinate data is related to the timestamp corresponding to the function value;

[0020] The two-dimensional sensor image is generated based on the polar coordinate data by adopting Gram angle field transformation, where the Gram angle field transformation includes a Gram angle sum field or a Gram angle difference field.

[0021] In some embodiments, the data enhancement technique includes one or more combinations of mirroring, brightening, darkening, rotating 90 degrees, or rotating 180 degrees on the two-dimensional sensor image.

[0022] In some embodiments, determining the loss value includes adopting a cross-entropy loss function; and training the pre-trained detection model includes adopting an adaptive moment estimation optimization algorithm.

[0023] The present invention also provides a gas detection model training device based on an electronic nose, comprising:

[0024] a preprocessing module, configured to obtain a gas data set, the gas data set including sensor response data annotated with a category label, and perform smoothing filter preprocessing on the sensor response data to obtain preprocessed data;

[0025] a conversion module, configured to convert the preprocessed data into a two-dimensional sensor training image to form a two-dimensional sensor image set;

[0026] a data enhancement module, configured to apply a data enhancement technique to the two-dimensional sensor image to obtain an extended set of two-dimensional sensor images, wherein the images to be analyzed in the extended set of two-dimensional sensor images are annotated with the category labels of the corresponding sensor response data;

[0027] an analysis module, wherein the analysis module analyzes the image to be analyzed in the expanded set of two-dimensional sensor images using a pre-trained detection model, and determines a loss value based on a difference between the category label and the image analysis result;

[0028] A training module is provided, wherein the training module trains the pre-trained detection model based on the loss value, and the detection model obtained by training is used to identify and detect the sensor image converted from the gas sensor response data.

[0029] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic nose-based gas detection model training method as described in any of the above embodiments is implemented.

[0030] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the electronic nose-based gas detection model training method as described in any of the above embodiments is implemented.

[0031] The embodiments of the present application have at least the following beneficial effects:

[0032] 1. The present invention utilizes smoothing filter preprocessing to obtain an efficient input data representation, thereby significantly improving the classification and recognition accuracy of the classifier. Because time series sensor data may contain redundant or noisy information, the performance of the classifier depends heavily on the input data representation. Efficient input data representation is key to gas classification and helps improve model accuracy by utilizing efficient input data.

[0033] 2. Use two-dimensional sensor images instead of time-series gas sensor data to achieve further gas classification. Since deep learning has made unprecedented progress in the field of image recognition in recent years, the classification and recognition based on time-series gas sensor data is converted into gas classification and recognition of two-dimensional sensor images. The proposed method has wider applicability.

[0034] 3. Compared with the existing electronic nose gas recognition technology that requires complex feature engineering, the embodiments of the present invention can realize automatic learning of pattern features, thereby reducing the incompleteness caused by human-designed features and realizing end-to-end learning of electronic nose gas recognition.

[0035] 4. The robustness and generalization ability of the model are improved. Different data enhancement techniques are used to expand the gas sample data. The embodiment of the present invention reduces the impact of small electronic nose gas samples on the classifier. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0037] Figure 1 This is a flow chart of the electronic nose-based gas detection model training method provided by the present invention.

[0038] Figure 2 This is a flow chart of an embodiment of the present invention;

[0039] Figure 3 A schematic diagram of a single-channel CO gas raw sensor response data curve within a time range captured in an embodiment of the present invention;

[0040] Figure 4 This is a schematic diagram of data comparison before and after smoothing filter preprocessing according to an embodiment of the present invention;

[0041] Figure 5 Schematic diagram of the results of the two methods GASF and GADF according to the embodiment of the present invention;

[0042] Figure 6 A schematic diagram of a combined two-dimensional sensing image according to an embodiment of the present invention;

[0043] Figure 7 This is a schematic diagram of an image to be analyzed after data enhancement according to an embodiment of the present invention;

[0044] Figure 8 A schematic diagram of the network architecture used by the pre-training model according to an embodiment of the present invention;

[0045] Figure 9 This is a diagram showing the classification and recognition results of the two-dimensional sensor image combination of the test set according to the embodiment of the present invention;

[0046] Figure 10 A graph showing the classification accuracy during the training and testing process of combined two-dimensional sensor image classification and recognition according to an embodiment of the present invention;

[0047] Figure 11 A graph showing the loss values ​​during the training and testing process of combined two-dimensional sensor image classification and recognition according to an embodiment of the present invention;

[0048] Figure 12 A confusion matrix diagram generated during the classification and recognition process of the combined two-dimensional sensor image according to an embodiment of the present invention;

[0049] Figure 13 This is a diagram of the architecture of the electronic nose-based gas detection model training device provided by the present invention;

[0050] Figure 14 This is a schematic diagram of the electronic device architecture provided by the present invention. DETAILED DESCRIPTION

[0051] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0052] To facilitate understanding of the embodiments of the present application, further explanation will be given below with reference to specific embodiments in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present application.

[0053] This embodiment provides a gas detection model training method based on an electronic nose. Figure 1 As shown, the following steps are included:

[0054] Step 1: Acquire a gas data set, wherein the gas data set includes sensor response data marked with category labels, and perform smoothing filter preprocessing on the sensor response data to obtain preprocessed data.

[0055] Preferably, in some embodiments, Figure 2 As shown, obtaining the gas data set includes:

[0056] Step 1.1, obtain the original sensor responses collected by the sensor array for gas atmospheres of different concentrations of several gas categories, wherein the test time length and sampling frequency for each gas atmosphere are the same, and the sensor array includes several different types of sensors, each of which generates original sensor response data for the corresponding channel.

[0057] Specifically, a gas dataset can be obtained through self-measurement or by downloading it from publicly available datasets online. The gas dataset used in this embodiment was obtained from the publicly available Twin Gas Sensor Arrays Data Set, a time-series gas sensor dataset consisting of eight sensor arrays as test units. This dataset was acquired using five identical sensor arrays, each containing four metal oxide gas sensor models: TGS2611, TGS2612, TGS2610, and TGS2602. The sensor types and operating voltages for each sensor array are shown in Table 1 below. During signal acquisition, gas measurements were performed on all five sensor arrays using the same experimental method, with a different sensor array used each day. The dates for each sensor array testing various gas concentrations are shown in Table 3. Repeated experiments over a period of time, such as one month, ensured data reproducibility and reflected the data deviations caused by ambient temperature and humidity fluctuations. The test gases included four types: methane, ethanol, ethylene, and carbon monoxide. Each type contained ten different concentration levels. The different concentration levels for the four measured gases are shown in Table 2 below. The duration of a single test experiment is 600 seconds, and the sampling frequency is 100 Hz. It should be understood that the acquisition process of the gas data set in this embodiment is for illustrative purposes only and does not limit the selection of experimental conditions, gas types, gas concentrations, and sensor models. For example, the duration of a single test experiment can also be 200-300 seconds. This embodiment makes the samples more generalizable by designing diverse sample collection, such as different concentrations, different types of sensors, possible environmental impacts, and other variables. This enables the trained model to find common characteristics of gas categories under complex and changing objective conditions, thereby enhancing the model's detection capabilities.

[0058] Table 1 Sensor types and operating voltages

[0059]

[0060] Table 2 Different concentration levels of measured gases (ppm)

[0061]

[0062] Table 3 Detection dates of different sensor arrays in the same month

[0063]

[0064]

[0065] Step 1.2: intercept the data in the same time period of the raw sensor response data to form the sensor response data. In order to effectively extract the characteristics of the gas to be identified, the acquired 8-channel raw sensor response data is intercepted. For example, in this embodiment, the response data within the time period of 30s-100s is intercepted as the processing object. On the one hand, the response data within this time range includes both the gas response process and the gas recovery process, and does not lose important response data in the gas reaction process. On the other hand, the response data within this time range removes a lot of redundant information, which improves the efficiency of model calculation. Figure 3 As shown, Figure 3 Schematic diagram of a single-channel CO gas raw sensor response data curve within the interception time range of this embodiment.

[0066] Step 1.3: Label the sensor response data with the category label according to the gas category. Since the purpose of the present invention is to identify the gas category, only the gas category is labeled, without labeling the corresponding sensor model and gas concentration parameters.

[0067] Preferably, in some embodiments, the smoothing filter preprocessing includes fitting the sensor response data using a Savitzky-Golay smoothing filter algorithm, also known as the SG algorithm. When the SG algorithm is used for smoothing filter preprocessing, the window length is generally set to an odd number, such as 29, 59, 89, or 99, with a window length of 59 being more effective. A third-order polynomial fitting is performed on the sample data points within the window. A comparison diagram of the original gas sensor response data curve and the data curve after preprocessing by the SG algorithm smoothing filter is shown in FIG. Figure 4 shown.

[0068] Step 2: converting the preprocessed data to generate two-dimensional sensor training images to form a two-dimensional sensor image set.

[0069] Preferably, in some embodiments, converting the preprocessed data to generate a two-dimensional sensor training image to form a two-dimensional sensor image set includes:

[0070] Step 2.1 normalizes the preprocessed data to obtain normalized data, where the normalized data includes time series data whose function values ​​are between [0, 1].

[0071] Specifically, the preprocessed data is scaled to [0, 1] using the following calculation formula:

[0072]

[0073] in is the normalized data value at time t, is the pre-processed data value of the i-th sensor at time t, X i is the preprocessed data value of the i-th sensor within the sampling time range.

[0074] Step 2.2: convert the normalized data into polar coordinate data, where the angle in the polar coordinate data is obtained by performing an arc cosine function calculation on the function value, and the radius in the polar coordinate data is related to the timestamp corresponding to the function value.

[0075] Specifically, the conversion algorithm of polar coordinate system data in this embodiment is expressed as:

[0076]

[0077] in, is the normalized data value at time t, is the normalized data, φ is the angle value, r is the radius, t i is the length of the time interval, and N is the number of equal parts the time interval is divided into. Since the data is scaled to [0, 1], the angle range is [0, π / 2]. Using this formula for polar coordinate conversion has a significant advantage. Because the encoding is bijective, for a given time series, the mapping result in the polar coordinate system is unique.

[0078] Step 2.3 generates the two-dimensional sensor image based on the polar coordinate data by using Gram angle field transformation, where the Gram angle field transformation includes a Gram angle sum field or a Gram angle difference field.

[0079] Specifically, after obtaining the angle value φ, the angle values ​​are added and the cosine is taken to generate the Gramian Angular Summation Fields (GASF), which is calculated as follows:

[0080]

[0081] where I is the unit row vector [1,1,...,1].

[0082] Alternatively, the angle values ​​can be subtracted and their sines taken to generate Gramian Angular Difference Fields (GADF), which are calculated as follows:

[0083]

[0084] where I is the unit row vector [1,1,...,1].

[0085] The response values ​​inherited from the original sensor response data and their time dependence are saved through the Gram angle sum field or Gram angle difference field, such as Figure 5 As shown, it is a schematic diagram of the results of the two methods of GASF and GADF, which converts the time series data that is not convenient for analysis into a two-dimensional sensor image to facilitate the analysis and recognition of the pre-trained model. In this embodiment, the Gram angle and field are used, and the size of the obtained two-dimensional sensor image is set to 64×64.

[0086] Preferably, in some embodiments, Figure 2 As shown, the method further includes step 2.4, splicing the two-dimensional sensor images corresponding to the original sensor response data collected at the same time by the same sensor array into a combined two-dimensional sensor image, and the combined two-dimensional sensor image serves as an element of the two-dimensional sensor image set.

[0087] Since the gas response data of each test sample is measured by 8 gas sensors, considering that the time series data intervals of all experimental samples are exactly the same, that is, the time series data of each sample will not affect the classification and recognition of the subsequent network model, this embodiment uses 8 two-dimensional sensor images obtained from the original sensor response data measured by each sensor array in one experiment to construct a 3×3 composite image, such as Figure 6 As shown, there are four combined two-dimensional sensor images. The combined two-dimensional sensor image consists of the two-dimensional sensor images corresponding to the eight sensor channels and the time data (located at Figure 6 As shown in the figure, the first image in each combined 2D sensor image (located in the upper left corner) is formed. The time data is obtained by two-dimensionally converting the time interval 30-100 seconds. Since all data samples are selected from the 30-100 second range, the inclusion of time data does not affect classification and recognition. Finally, the gas sensor response data of each test sample is processed, converted, and combined into a 192×192 combined 2D sensor image using the GASF method. Since the gas data measured by a group of sensor arrays has complete commonality, the combined 2D sensor images obtained from this group can be used as units for analysis and training, improving training efficiency while not reducing the generalization of the gas dataset.

[0088] Step 3: Using data enhancement technology on the two-dimensional sensor image to obtain a two-dimensional sensor image expansion set, wherein the image to be analyzed in the two-dimensional sensor image expansion set is annotated with the category label of the corresponding sensor response data.

[0089] Preferably, the data enhancement technique includes a combination of one or more of mirroring, brightening, darkening, rotating 90 degrees, or rotating 180 degrees on the two-dimensional sensor image. In this embodiment, the data sample is expanded by applying different data enhancement techniques to the combined two-dimensional sensor image obtained in step 2.4. The data enhancement techniques for gas samples include mirroring, brightness transformation (brightening and darkening), and rotation (90° and 180°), so that the total amount of gas data samples is expanded to six times the original amount. A schematic diagram of the image to be analyzed after data enhancement processing is shown as follows. Figure 7 As shown, the image to be analyzed also inherits the category label from the original sensor response data in the gas dataset.

[0090] Step 4: Analyze the image to be analyzed in the two-dimensional sensor image expansion set using a pre-trained detection model, and determine a loss value based on the difference between the category label and the image analysis result.

[0091] After the training data is prepared, Figure 8 As shown, the network architecture used in the pre-trained model is determined. The network architecture in this embodiment is fine-tuned based on the GoogLeNet network model. The network is roughly divided into five modules. The first module uses one convolutional layer and one max pooling layer. In our gas classification and recognition model, the convolution operation requires a ReLU activation function. The second module uses two convolutional layers and one max pooling layer.

[0092] In this embodiment, unlike the original model, local response normalization is not used in the first two modules. Since this layer of structure does not play a significant role, this layer is discarded to simplify the network model structure.

[0093] In the third module, there are two layers of structures, namely Inception3a layer and Inception3b layer, each divided into four branches, and adopts multi-scale processing; after that, the specific experimental operations of the fourth and fifth modules are similar to those of the Inception3a layer and Inception3b layer in the third module.

[0094] Finally, the output layer, unlike previous neural network output layers, which use three consecutive fully connected layers, employs an adaptive average pooling layer. This layer not only reduces dimensionality but also combines lower-level features to abstract the global image characteristics. Dropout is also applied with a dropout probability of 40-60%, preferably 50%. This operation randomly reduces the number of neurons and connection weights in the network, improving numerical performance and preventing overfitting. Finally, a softmax layer is used as a classifier to identify four different gases: methane, ethylene, ethanol, and carbon monoxide.

[0095] Step 5: Training the pre-trained detection model based on the loss value. The trained detection model is used to identify and detect the sensor image converted from the gas sensor response data.

[0096] Preferably, in some embodiments, determining the loss value includes adopting a cross entropy loss function; and training the pre-trained detection model includes adopting an adaptive moment estimation optimization algorithm.

[0097] During model training, a fine-tuned GoogLeNet network model was used, using the Pytorch framework for deep learning and running on a GPU to accelerate computation for gas classification and recognition. In the experiment, the ultimate goal was to classify four different gases. For multi-classification tasks, the cross-entropy loss function (CrossEntropyLoss) was used as the loss function. The adaptive moment estimation (Adam) optimization algorithm was used for optimization. The batch size was set to 32, the learning rate was 0.0003, and the number of iterations was 100. The combined two-dimensional sensor images in the expanded set of two-dimensional sensor images obtained above were divided into training and test sets in a ratio of 7:3-9:1, preferably 8:2. The combined two-dimensional sensor images were input into the pre-trained model to achieve gas classification training and testing.

[0098] Preferably, in order to make the combined two-dimensional sensor image adapt to the input requirements of the pre-training model, this embodiment crops the 192*192 combined two-dimensional sensor image to a size of 224*224 before inputting it into the model.

[0099] During the prediction process, the two-dimensional sensor image converted from the gas response data is loaded, and by reading the label file generated during the training process, the model parameters saved during the training process are loaded based on the model establishment, and finally the recognition prediction of the image is realized, that is, the accurate prediction of the four different gases, namely methane, ethylene, ethanol, and carbon monoxide, is achieved. Figure 9 The figure shows the prediction result, which achieves accurate prediction of carbon monoxide gas.

[0100] In summary, the training method adopted in this embodiment is to apply Savitzky-Golay smoothing filtering to the gas sample gas data set to obtain pre-processed gas sensor data, and then use the GASF method to encode the gas sensor response data into a two-dimensional sensor image. In addition, the experiment also adopted a data enhancement network strategy to reduce the impact of small samples on the classifier. After obtaining the data-enhanced two-dimensional sensor image, it was randomly divided into training set and test set in an 8:2 ratio. Combined with the multi-Inception V1 neural network, it took advantage of its automatic learning of deep sample features to finally achieve the classification of four gases: methane, ethanol, ethylene and carbon monoxide, with the highest recognition accuracy of 100%. The accuracy and loss rate during training and testing are shown in the figure below. Figure 10 and Figure 11 As shown. Figure 10 and Figure 11 It can be seen that the present invention has achieved higher accuracy in electronic nose gas recognition, completed convergence in fewer iterations, and the final loss value converged to near 0. The accuracy during training and testing has the same upward trend and is relatively close. Similarly, the loss value during training and testing has the same downward trend and is relatively close. In addition, when the accuracy increases, the loss value shows a downward trend. All these indicate that the proposed method does not have overfitting. Figure 12 shown.

[0101] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0102] Although the operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.

[0103] The present invention also provides a gas detection model training device based on an electronic nose, such as Figure 13 Shown, including:

[0104] a preprocessing module, configured to obtain a gas data set, the gas data set including sensor response data annotated with a category label, and perform smoothing filter preprocessing on the sensor response data to obtain preprocessed data;

[0105] a conversion module, configured to convert the preprocessed data into a two-dimensional sensor training image to form a two-dimensional sensor image set;

[0106] a data enhancement module, configured to apply a data enhancement technique to the two-dimensional sensor image to obtain an extended set of two-dimensional sensor images, wherein the images to be analyzed in the extended set of two-dimensional sensor images are annotated with the category labels of the corresponding sensor response data;

[0107] an analysis module, wherein the analysis module analyzes the image to be analyzed in the expanded set of two-dimensional sensor images using a pre-trained detection model, and determines a loss value based on a difference between the category label and the image analysis result;

[0108] A training module is provided, wherein the training module trains the pre-trained detection model based on the loss value, and the detection model obtained by training is used to identify and detect the sensor image converted from the gas sensor response data.

[0109] The present invention also provides an electronic device, such as Figure 14 As shown, it includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the gas detection model training method based on the electronic nose as described in any of the above embodiments is implemented.

[0110] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the electronic nose-based gas detection model training method as described in any of the above embodiments is implemented.

[0111] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0112] Professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0113] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application. It should be understood that the above description is only the specific implementation methods of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.

Claims

1. A gas detection model training method based on an electronic nose, characterized in that: The following steps are involved: Acquire a gas data set, the gas data set including sensor response data marked with category labels, and perform smoothing filter preprocessing on the sensor response data to obtain preprocessed data; Converting the preprocessed data to generate two-dimensional sensor training images to form a two-dimensional sensor image set; Applying data enhancement technology to the two-dimensional sensor image to obtain an extended set of two-dimensional sensor images, wherein the images to be analyzed in the extended set of two-dimensional sensor images are annotated with the category labels of the corresponding sensor response data; Analyzing the image to be analyzed in the two-dimensional sensor image expansion set using a pre-trained detection model, and determining a loss value based on a difference between the category label and the image analysis result; Training the pre-trained detection model based on the loss value, wherein the trained detection model is used to recognize and detect a sensor image converted from the gas sensor response data; The obtaining of the gas data set comprises: Obtaining raw sensor responses collected by a sensor array for gas atmospheres of different concentrations of several gas types, wherein the test time length and sampling frequency for each gas atmosphere are the same, the sensor array includes several different types of sensors, and each sensor generates raw sensor response data for a corresponding channel; intercepting data within a same time period in the original sensor response data to form the sensor response data; labeling the sensor response data with the category label according to the gas category; The pre-trained detection model network architecture is fine-tuned based on the GoogLenet network model; it includes five modules, of which the first module uses one convolutional layer and one maximum pooling layer; the second module uses two convolutional layers and one maximum pooling layer; the third module uses two Inception layers and one maximum pooling layer; the fourth module uses four Inception layers and one maximum pooling layer; and the fifth module uses two Inception layers. The output layer network uses an adaptive average pooling layer, a Dropout layer with a dropout probability of 40-60%, a fully connected layer, and a softmax layer.

2. The gas detection model training method based on electronic nose according to claim 1 is characterized in that: Before applying the data enhancement technology to the two-dimensional sensor image, the method further includes: The two-dimensional sensor images corresponding to the original sensor response data collected at the same time by the same sensor array are spliced ​​into a combined two-dimensional sensor image, and the combined two-dimensional sensor image serves as an element of the two-dimensional sensor image set.

3. The gas detection model training method based on electronic nose according to claim 1 is characterized in that: The smoothing filter preprocessing includes fitting the sensor response data using a Savitzky-Golay smoothing filter algorithm.

4. The gas detection model training method based on electronic nose according to claim 1 is characterized in that: Converting the preprocessed data to generate two-dimensional sensor training images to form a two-dimensional sensor image set, including: Normalizing the preprocessed data to obtain normalized data, wherein the normalized data includes time series data with a function value between [0, 1]; Converting the normalized data into polar coordinate data, wherein the angle in the polar coordinate data is obtained by performing an arc cosine function calculation on the function value, and the radius in the polar coordinate data is related to the timestamp corresponding to the function value; The two-dimensional sensor image is generated based on the polar coordinate data by adopting Gram angle field transformation, where the Gram angle field transformation includes a Gram angle sum field or a Gram angle difference field.

5. The gas detection model training method based on electronic nose according to claim 1 is characterized in that: The data enhancement technology includes one or more combinations of mirroring, brightening, darkening, rotating 90 degrees, or rotating 180 degrees on the two-dimensional sensor image.

6. The gas detection model training method based on electronic nose according to claim 1 is characterized in that: Determination of the loss value includes adopting a cross entropy loss function; and training of the pre-trained detection model includes adopting an adaptive moment estimation optimization algorithm.

7. A gas detection model training device based on an electronic nose, which is implemented using any training method of claims 1-6, characterized in that: include: a preprocessing module, configured to obtain a gas data set, the gas data set including sensor response data annotated with a category label, and perform smoothing filter preprocessing on the sensor response data to obtain preprocessed data; a conversion module, configured to convert the preprocessed data into a two-dimensional sensor training image to form a two-dimensional sensor image set; a data enhancement module, configured to apply a data enhancement technique to the two-dimensional sensor image to obtain an extended set of two-dimensional sensor images, wherein the images to be analyzed in the extended set of two-dimensional sensor images are annotated with the category labels of the corresponding sensor response data; an analysis module, wherein the analysis module analyzes the image to be analyzed in the expanded set of two-dimensional sensor images using a pre-trained detection model, and determines a loss value based on a difference between the category label and the image analysis result; A training module is provided, wherein the training module trains the pre-trained detection model based on the loss value, and the detection model obtained by training is used to identify and detect the sensor image converted from the gas sensor response data.

8. An electronic device, characterized in that: The system comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the gas detection model training method based on the electronic nose is implemented.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the gas detection model training method based on an electronic nose according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Perimeter security disturbance identification algorithm based on GAF-ConvNeXt-TF

    CN115496100A

  • Machine learning data generation device, machine learning data generation method, program, and learning data set

    WO2021246210A1