Gas detection method, equipment, medium and product
By adopting a multi-task convolutional neural network model in the electronic nose system, using the shared convolution layer and pooling layer to extract feature maps, and combining task-specific layers and fully connected layers for multi-task prediction, the existing single task of the electronic nose system is solved. The problem of low prediction efficiency achieves efficient gas detection and prediction.
Patent Information
- Application Number
- CN202411533679.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
The existing electronic nose system can only perform single-task prediction, resulting in low prediction efficiency for the gas to be detected, affecting the operation efficiency and applicability of the electronic nose system.
Using a multi-task convolutional neural network model, the response data is obtained through the sensor array, and after preprocessing, the initial feature map is extracted using the shared convolution layer, and the target feature map is further extracted by the pooling layer and the second shared convolution layer. , combining multiple task-specific and fully connected layers to output prediction results of gas categories, concentrations, sensor states and abnormality detection.
Multi-task prediction of detection gas is realized, which significantly improves prediction efficiency and improves the operation efficiency and applicability of the electronic nose system.
Smart Images

Figure HDA0005111017630000011 
Figure HDA0005111017630000012 
Figure HDA0005111017630000021
Abstract
Description
Technical Field
[0001] The present application relates to the field of gas detection technology, and in particular to a gas detection method, equipment, medium and product. Background Art
[0002] In recent years, the development of electronic nose systems for the detection of volatile organic compounds has received widespread attention in various fields. Electronic nose systems have a wide range of applications and adaptability in real-time analysis due to their cost-effectiveness, speed, ease of measurement, and non-invasiveness. As an emerging pattern recognition algorithm, deep learning has been used in recent years to improve the performance of electronic nose systems. Electronic nose technology combined with advanced machine learning methods provides an innovative path for air quality monitoring, healthcare, industrial safety, and process control.
[0003] An electronic nose system is a device that uses a sensor array to detect odor samples and generate corresponding response data. These data are usually complex and involve different gas components and concentrations, so effective data processing and pattern recognition technology are needed to analyze and identify different odors.
[0004] At present, the existing technology can only perform single-task prediction on the gas to be detected through the electronic nose system and the convolutional neural network model, resulting in low prediction efficiency of the gas to be detected, which in turn affects the operating efficiency and applicability of the electronic nose system. Summary of the invention
[0005] The purpose of the present application is to provide a gas detection method, device, medium and product, which can solve the problem of low detection efficiency caused by only single-task detection of the gas to be detected in the prior art.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a gas detection method, which is applied to an electronic nose system, wherein the electronic nose system comprises a sensor array, including:
[0008] Based on the sensor array, obtaining response data of the gas to be detected;
[0009] Inputting the preprocessed response data into the first shared convolution layer of the multi-task convolutional neural network model to obtain an initial feature map; the multi-task convolutional neural network model includes a first shared convolution layer, a pooling layer, a second shared convolution layer, a plurality of task-specific layers and a fully connected layer connected in sequence;
[0010] Inputting the initial feature map to the pooling layer for downsampling, and inputting the downsampled feature map to the second shared convolution layer to obtain a target feature map;
[0011] After the target feature map is input into multiple task-specific layers, the prediction result of the gas to be detected is output through the fully connected layer; wherein the prediction result includes gas category classification result, gas concentration prediction result, sensor state evaluation result and gas anomaly detection result.
[0012] In a second aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the gas detection method described above.
[0013] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the gas detection method described above when executed by a processor.
[0014] In a fourth aspect, the present application provides a computer program product, including a computer program, which implements the gas detection method described above when executed by a processor.
[0015] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0016] The present application provides a gas detection method, device, medium and product. First, based on the sensor array, the response data of the gas to be detected is obtained, and then the pre-processed response data is input into the first shared convolution layer of the multi-task convolutional neural network model to obtain the initial feature map, and then the initial feature map is input into the pooling layer of the multi-task convolutional neural network model for downsampling, and then input into the second shared convolution layer of the multi-task convolutional neural network model to obtain the target feature map. In this way, the first shared convolution layer and the second shared convolution layer are used to realize the extraction of shared features (i.e., target feature maps) for subsequent different tasks, and then multiple task-specific layers are used to realize the simultaneous prediction of four tasks: gas category, gas concentration, sensor state evaluation and gas anomaly detection. Finally, the multi-task convolutional neural network model greatly improves the prediction efficiency of the gas to be detected, thereby improving the operating efficiency and applicability of the electronic nose system, and has great potential in promoting the development of electronic nose technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1A schematic diagram of a gas detection method provided in an embodiment of the present application;
[0019] Figure 2 This is a schematic diagram related to response data of a gas detection method provided in an embodiment of the present application; wherein, Figure 2 (a) is a graph showing the resistance value variation of the sensor array output; Figure 2 (b) is the response curve of methylbenzene without high-value noise injection; Figure 2 (c) is the response curve of toluene injected with high-value noise;
[0020] Figure 3 A schematic diagram of the structure of a multi-task convolutional neural network model of a gas detection method provided in an embodiment of the present application; Figure 3 (a) is a schematic diagram of the structure of the multi-task convolutional neural network model; Figure 3 (b) is a diagram showing the process of feature map evolution through branches of multiple task-specific layers;
[0021] Figure 4 An overall schematic diagram of a multi-task convolutional neural network model for performing feature fusion and data enhancement on a gas to be detected in a gas detection method provided in an embodiment of the present application;
[0022] Figure 5 A training process diagram of a multi-task convolutional neural network model of a gas detection method provided in an embodiment of the present application; wherein, Figure 5 (a) is the loss curve diagram of gas classification, the loss curve of state assessment and the MSE curve diagram of concentration prediction; Figure 5 (b) is a graph showing the accuracy of gas classification, the accuracy of sensor status assessment, and the concentration prediction.
[0023] Figure 6 This is a prediction effect diagram of a multi-task convolutional neural network model of a gas detection method provided in an embodiment of the present application; wherein, Figure 6 (a) is the confusion matrix diagram of gas classification; Figure 6 (b) is the confusion matrix diagram of sensor state evaluation; Figure 6 (c) is the violin plot of concentration prediction; Figure 6 (d) in the figure is the precision-recall curve of anomaly detection. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] Electronic nose (E-nose) is an advanced exploration technology that has attracted widespread attention in many fields such as environmental monitoring and disease prevention. This application proposes an innovative multi-task convolutional neural network model to improve the performance of the electronic nose. Compared with the traditional electronic nose system, the multi-task convolutional neural network model of this application can simultaneously complete four tasks: gas classification, concentration prediction, state assessment and anomaly detection.
[0026] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0027] like Figure 1 As shown, the present application provides a gas detection method, which is applied to an electronic nose system, wherein the electronic nose system includes a sensor array, and the gas detection method includes:
[0028] Step 101: Based on the sensor array, obtain response data of the gas to be detected.
[0029] Among them, a large-scale data set consisting of millions of valid data points was collected from a self-developed electronic nose system (i.e., SJTU-G919 gas sensing test system, not shown in the figure) as response data. Exemplarily, 11 volatile organic compounds were detected, including acetone, ethanol, butyl acetate, methanol, xylene, isopropanol, toluene, benzaldehyde, hexane, 1-propanol, and ethylene glycol. The sensor array uses eight commercial gas sensors, including MQ-2, MQ-3, MQ-4, MQ-5, MQ-6, MQ-7, MQ-8, and MQ-9. Specifically, 11 volatile organic compounds of different concentrations were subjected to more than ten response experiments using the electronic nose system, generating a data set containing millions of valid data points as response data.
[0030] The host of the electronic nose system collects the response data of the sensor array at a sampling rate of 2Hz through wireless communication. The concentration of each volatile organic compound is systematically increased from 0ppm to 100ppm, with an increment of 10ppm each time. In this way, the response data at each concentration segment is obtained, and the concentration is predicted by these response data.
[0031] like Figure 2As shown in (a), it can be seen that the resistance values of the eight sensors change when the gas concentration increases from 0 ppm to 100 ppm.
[0032] In some embodiments, based on the sensor array, response data of the gas to be detected is obtained, specifically including: obtaining the resistance of the sensor sensitive material of the sensor array in the air and the resistance of the sensor sensitive material in the gas to be detected; and taking the ratio of the resistance of the sensor sensitive material in the air to the resistance of the sensor sensitive material in the gas to be detected as the response data.
[0033] Among them, when detecting gas, the resistance values of the eight sensors will change to varying degrees. The response of the sensor in practical applications is the increase in the sensor resistance value. In order to more comprehensively display the response, a sensor array consisting of 8 sensors can be used. If you want a more comprehensive display, you can increase the number of sensors in the sensor array.
[0034] To ensure the comparability of responses to different concentrations of volatile organic compounds, the response data of the sensor array is calculated using the formula R0 / Rg, where R0 represents the resistance value of the sensor sensitive material in the air and Rg represents the resistance value of the sensor sensitive material in the gas to be detected.
[0035] In some embodiments, after step 101 obtains the response data of the gas to be detected based on the sensor array, it also includes:
[0036] Step 201: Select a preset number of response data and inject Gaussian noise as abnormal samples; the Gaussian noise includes low-value noise, high-value noise and normal noise.
[0037] In order to simulate the changes and abnormal conditions in the real world, Gaussian noise is randomly added to the initial sensor data. Gaussian noise is added to simulate the random fluctuations in sensor readings. Gaussian noise is added to the initial sensor data, so the curve after adding Gaussian noise is rougher than the original curve. Gaussian noise can help the multi-task convolutional neural network model resist small random disturbances in the input data. High-value noise can simulate the situation where unexpected peaks may occur in sensor readings. High-value noise can train the model to recognize and adapt to sudden drops in sensor readings. For example, if the gas to be detected is toluene, such as Figure 2 (b) shows the toluene response curve without high-value noise injection. It can be seen that the toluene response curve becomes smooth. Figure 2 (c) in the figure shows the toluene response curve after injecting high-value noise. It can be seen that the toluene response curve becomes rough.
[0038] Step 202: Based on a fixed window, the abnormal samples are segmented in time order to obtain the pre-processed response data.
[0039] The specific operation of data segmentation is to record the response value of the sensor (i.e., response data) by time, twice per second. If it is recorded for 40 seconds, then 80 rows and 8 columns of data are obtained (8 columns are 8 sensors). According to the division of every eight rows, 10 data blocks of 8 rows and 8 columns are obtained. These 8 rows save the changes of data in each time period. Data segmentation is the key to the training effect and performance of the multi-task convolutional neural network model. Data segmentation retains the time structure of the response data, enabling the multi-task convolutional neural network model to capture changes and trends over time.
[0040] For example, 8 sensors are used as the sensor array to output the response data, and the data width of the response data is fixed to 8. The data width is the number of columns of the data, that is, the fixed window. For example, the response data is 1268872 rows and 8 columns, which is converted into an array (12688728, 8). After every 8 rows are divided, the processed response data is (158609, 8, 8).
[0041] Step 102: Input the preprocessed response data into the first shared convolutional layer of the multi-task convolutional neural network model to obtain an initial feature map; the multi-task convolutional neural network model includes a first shared convolutional layer, a pooling layer, a second shared convolutional layer, multiple task-specific layers and a fully connected layer connected in sequence.
[0042] Among them, the first shared convolution layer (shared_layer) consists of multiple convolution layers and pooling layers. The first shared convolution layer first receives the input response data and extracts low-level visual features (such as edges, corners, etc.) through convolution operations. The pooling layer is used to reduce the dimension and enhance the spatial invariance of the model.
[0043] Reference Figure 4, the multi-task convolutional neural network model is the MTL-CNN model. The CNN in the MTL-CNN model automatically learns the spatial hierarchical features in the data through its convolutional layers. This is very important for response data, because the responses from different sensors may be correlated and show specific patterns or structures. Through the convolutional layer and the pooling layer, the CNN can identify specific features and patterns from the responses of the entire sensor array. After feature extraction, the CNN contains a fully connected layer, which is responsible for making the final decision based on the extracted features, such as the classification of odors. The special thing about the MTL-CNN model is that four tasks can be completed simultaneously through the CNN model. In other words, the function of the electronic nose system has been upgraded from a single task to four tasks, or even multiple tasks. Among them, the gas data sensing is the response data obtained by the sensor array; the shared layer I is the first shared convolutional layer; the shared layer II is the second shared convolutional layer. Branch layer 1 to branch layer 4 are four task-specific layers.
[0044] Specifically, the initial feature map input shape is 512×1×8×8. Among them, 512 is the batch size (batchsize), which means that 512 data samples are input at a time. 1 is the number of channels (channel), indicating that the input has only 1 channel, usually for grayscale images or single features. 8×8 means that the size of the initial feature map of the input is 8×8. The first convolutional shared layer is a 3×3 convolutional layer (Conv2d), and the convolution kernel size is 3×3. A 3×3 convolution kernel is used for convolution operation. The feature map (f.maps) output by the first convolutional shared layer is 16@8×8; that is, 16 feature maps (feature channels) are generated after convolution, indicating that 16 different convolution kernels are used in this layer. After the convolution operation, the spatial dimension of the feature map is still 8×8, indicating that the size of the input is not changed in the convolution operation (it may be kept the same size by padding). Pooling layer, pooling window size: 2×2, a 2×2 pooling window is used to downsample the feature map after convolution. Output feature map: 16@4×4, because pooling does not change the number of channels, there are still 16 feature maps. In addition, after 2×2 pooling, the spatial dimension of the feature map is reduced from 8×8 to 4×4, which is usually to reduce the amount of calculation and prevent overfitting. The convolution kernel size of the second shared convolution layer (Conv2d) is 3×3, and a 3×3 convolution kernel is used again for convolution operation. Output the target feature map, and still generate 16 feature maps. The size of the target feature map remains unchanged, still 4×4, indicating that appropriate padding is used in the convolution operation to prevent the size of the feature map from being reduced.
[0045] The convolution layer (Conv2d) of branch layer 1 (task-specific layer) is 3×3, and the output feature map of the convolution layer is 8@2×2, where 8 means the number of output feature maps is reduced to 8, in order to reduce the complexity of the model. 2×2 means the spatial dimension of the feature map is reduced from 4×4 to 2×2, and there is no padding in the convolution operation, which leads to a reduction in the spatial size of the feature map.
[0046] The fully connected layer (FC) input is 8 2×2 feature maps: this means there are 8 feature maps of size 2×2, and after expansion there are 8×2×2=328\times2\times2=328×2×2=32 nodes. The fully connected layer usually connects these nodes to an output layer for classification or regression.
[0047] Output_1 is the output layer, and the final output is This means that the network finally outputs predictions for 11 categories, and each output node represents the score of the category.
[0048] like Figure 3 As shown in (a) in the figure, the multi-task convolutional neural network model can perform multiple specific tasks at the same time and use shared features to improve cross-task performance. This neural network architecture integrates shared convolutional layers, followed by specific task branches, that is, multiple task-specific layers, each of which targets a specific prediction target: gas classification, sensor state prediction, concentration prediction, and anomaly detection. The multi-task convolutional neural network model is implemented in PyTorch and uses a combination of convolutional layers, batch normalization, activation functions, and fully connected layers.
[0049] Step 103: Input the initial feature map to the pooling layer for downsampling, and input the downsampled feature map to the second shared convolution layer to obtain a target feature map.
[0050] Among them, the second shared convolutional layer (shared_layer_2) further processes the initial feature map output by the first convolutional layer and extracts more abstract features, namely the target feature map, through a deeper convolutional network.
[0051] Among them, through two shared convolutional layer structures, namely the dual-block knowledge sharing structure, the multi-task convolutional neural network model can learn common features that can be shared across tasks at multiple levels, significantly improving the performance of the electronic nose system in multiple tasks. That is, the target feature map as a shared feature helps to handle different but related tasks. The main uses of shared features in multi-task learning include: First, improve efficiency: by sharing basic features, the model does not need to relearn all features for each task, thereby reducing the number of parameters that need to be trained, speeding up training, and reducing computational costs. Second, enhance generalization ability: shared features enable the knowledge learned by the multi-task convolutional neural network model on one task to be transferred to other tasks, helping the model to perform well when faced with limited data and reducing the risk of overfitting. Third, improve task-specific performance: shared features can provide rich contextual information for specific tasks, so that the final task-specific layer can make more accurate predictions. Fourth, flexible application: in practical applications, a trained multi-task convolutional neural network model can quickly adapt to new tasks and start predicting new tasks with only a small amount of adjustment, making the deployment of network models more flexible.
[0052] Step 104: After the target feature map is input into multiple task-specific layers, the prediction result of the gas to be detected is output through the fully connected layer; wherein the prediction result includes gas category classification result, gas concentration prediction result, sensor state evaluation result and gas anomaly detection result.
[0053] The evolution process of inputting the target feature map into multiple task-specific layers is referred to as Figure 3 (b) in .
[0054] In some embodiments, the training process of the multi-task convolutional neural network model specifically includes steps 301 to 305:
[0055] Step 301: Acquire real labels of historical gases; the first real label, the second real label, the third real label and the fourth real label in the real labels are respectively the real category of the gas, the real concentration of the gas, the real state of the sensor array and the response value of the abnormal response data; the real state of the electronic nose includes idle, recovery and response.
[0056] Specifically, since all experiments based on the electronic nose system use the same time series for process control, the data can be labeled according to 22 fixed periods. The labeling process includes identifying the operating state of the electronic nose. The operating state of the electronic nose system, i.e., the real state, includes idle, responding, and recovering.
[0057] Step 302: Input the historical response data into the first shared convolutional layer, and output the historical initial feature map.
[0058] Step 303: After the historical initial feature map is input into the pooling layer for downsampling, it is input into the second shared convolution layer to output the historical target feature map.
[0059] Step 304: Input the historical target feature map into the multiple task-specific layers to obtain the features required for the specific task, and output the historical prediction results based on the fully connected layer; the historical prediction results include historical gas category classification results, historical gas concentration prediction results, historical sensor state evaluation results and historical gas anomaly detection results; the specific tasks include classification tasks and regression tasks.
[0060] Step 305: Based on the historical prediction results and the true labels of the gases to be detected, training the multi-task convolutional neural network model.
[0061] In practical applications, the input data of the multi-task convolutional neural network model is a batch of initial feature maps with dimensions [batch_size, 1, height, width], where batch_size is the batch size; 1 is the number of channels; height is the data length; and width is the data width. First, it is processed by two shared convolutional layers (the first shared convolutional layer and the second shared convolutional layer). The initial feature extraction is performed using convolution operations through two shared convolutional layers, followed by batch normalization and ReLU activation to introduce nonlinearity. Among them, the spatial dimension can be reduced through maximum pooling processing. Through two shared convolutional layers, the multi-task convolutional neural network model not only utilizes the common features of different tasks, but also effectively utilizes the parameter sharing mechanism, thereby improving the overall performance and reducing the risk of overfitting. Each specific task branch fine-tunes the shared representation to meet the unique requirements of its own task, thereby ensuring the professionalism and accuracy of the prediction.
[0062] In some embodiments, step 305 trains the multi-task convolutional neural network model based on the historical prediction results and the real label of the gas to be detected, specifically including steps 401-402:
[0063] Step 401: Calculate a first loss between the historical gas category classification result and the first real label. Calculate a second loss between the historical gas concentration prediction result and the second real label. Calculate a third loss between the historical sensor state evaluation result and the third real label. Calculate a fourth loss between the historical gas anomaly detection result and the fourth real label.
[0064] Step 402: When the first loss is less than a first preset threshold, the second loss is less than a second preset threshold, the third loss is less than a third preset threshold, and the fourth loss is less than a fourth preset threshold, the trained multi-task convolutional neural network model is obtained.
[0065] In some embodiments, multiple loss functions are used to calculate the losses corresponding to different task-specific layers; the multiple loss functions include cross entropy loss and mean square error loss; the cross entropy loss is used to calculate the first loss, the third loss and the fourth loss; the mean square error loss is used to calculate the second loss.
[0066] Specifically, a variety of loss functions are used to calculate the loss values for different tasks. These include cross entropy loss (CrossEntropyLoss) for classification tasks and mean square error loss (MSELoss) for regression tasks (concentration prediction tasks). Among them, cross entropy loss is used to measure the difference between the probability distribution in the predicted results in the classification task and the probability distribution corresponding to the true label. The mean square error loss is used to calculate the average of the squares of the difference between the predicted value and the true value of the regression task.
[0067] In some embodiments, the multiple task-specific layers include a task-specific layer for classification tasks and a task-specific layer for regression tasks; the classification tasks include gas category classification, sensor state evaluation, and gas anomaly detection; the regression tasks include gas concentration prediction; the prediction result of the classification task is determined by a fully connected layer and an activation function; the prediction result of the regression task is determined by a fully connected layer.
[0068] Among them, the prediction results of gas category, sensor status evaluation and gas anomaly detection are predicted probabilities through activation functions, that is, these values are converted into probability distributions by using the Softmax function (processed in the loss function). The prediction results of gas concentration do not use the Softmax function and directly output the predicted value.
[0069] Reference Figure 5 ,The multi-task convolutional neural network model adopts a dual-block knowledge sharing structure of the first layer of shared convolutional layers and the second layer of shared convolutional layers, which has strong stability and generalization ability.
[0070] like Figure 5 As can be seen from (a) in the figure, the multi-task convolutional neural network model continues to improve during the training process, and the loss in different tasks is steadily decreasing. This continuous downward trend shows that even with the increase in the number of iterations, the model can effectively learn and improve its predictions without showing signs of overfitting. Among them, Cl loss is the cross entropy curve of the gas classification task; St loss is the cross entropy curve of the sensor state task; Cc MSE is the mean square error curve of the gas concentration prediction. In addition, Figure 5 (b) in the figure highlights the high-precision prediction performance of the multi-task convolutional neural network model. Among them, Cl.train.acc is the accuracy of the gas classification task training set; Cl.valid acc is the accuracy of the gas classification task validation set; St.train acc is the accuracy of the sensor state training set; St.validacc is the accuracy of the sensor state validation set; Cc train acc is the accuracy of the gas concentration training set; Cc validacc is the accuracy of the gas concentration validation set. The training and validation accuracies of the classification tasks (Cl and St) are quite high, reaching 97% and 98% respectively. At the same time, the R2 score of the regression task (Cc) during training and validation is as high as 97.5%. These results show that the multi-task convolutional neural network model can quickly capture features in the initial feature map and maintain high accuracy in different tasks, thereby ensuring reliable and accurate predictions with minimal training time; among them, R 2 Represents the coefficient of determination, which is used to reflect the degree of fit of the multi-task convolutional neural network model to the data.
[0071] In practical applications, the performance of the multi-task convolutional neural network model is reflected. The confusion matrix is obtained based on the predicted categories and the actual categories. The confusion matrix can show the comparison between the predicted categories and the actual categories of the multi-task convolutional neural network model. The confusion matrix can intuitively see the prediction error types of the multi-task convolutional neural network model. Figure 6 As shown in (a), the confusion matrix of gas classification shows that the multi-task convolutional neural network model has achieved excellent accuracy in 11 different gases with almost no significant errors, which shows that the multi-task convolutional neural network model has a strong ability in correctly identifying gas types. Figure 6 (b) in Figure 2 shows the confusion matrix of sensor state assessment. The multi-task convolutional neural network model also shows high accuracy and minimal misclassification. Figure 6 (c) in the figure describes the concentration prediction of different gases to be detected, and the red dashed line represents the ideal prediction value. As can be seen from the figure, the predicted value is basically consistent with the actual value, but there is also a slight deviation, especially at high concentrations, which may be caused by sensor saturation or nonlinear response of the sensor at high concentrations. Figure 6 The precision-recall (PR) curve in (d) shows that the multi-task convolutional neural network model has a strong anomaly detection capability and maintains high precision over a wide range of recall values, with an area under the curve (AUC) of 0.99. This shows that the multi-task convolutional neural network model is very effective in distinguishing true positives from false positives, achieving excellent precision without sacrificing recall.
[0072] Among them, for Figure 6The numbers on the coordinate axis of (a) represent the labels of different types of gases. Specifically: acetone: 0; ethanol: 1; butyl acetate: 2; methanol: 3; xylene: 4; isopropanol: 5; methylbenzene: 6; benzaldehyde: 7; n-hexane: 8; 1-propanol: 9; ethylene glycol: 10; Figure 6 The numbers on the coordinate axis in (b) represent three states. Specifically, ideal state: 0; reaction state: 1; recovery state: 2.
[0073] The multi-task convolutional neural network model of this application adopts a unique dual-zone knowledge sharing structure, which greatly improves the efficiency of the system. In addition, the multi-task convolutional neural network model also adopts noise injection and data segmentation mechanisms to enhance the robustness and generalization ability of the model. The million-level data sets collected from the independently developed gas sensing system highlight the ability of the multi-task convolutional neural network model to effectively handle real-world changes and anomalies. The gas classification accuracy of the multi-task convolutional neural network model reached 97%, the sensor state assessment accuracy reached 98%, the concentration prediction accuracy exceeded 97%, and the AUC for anomaly detection was 0.99. This comprehensive framework integrates efficient data processing and anti-noise mechanisms, demonstrating the great potential of the MTL-CNN model (multi-task convolutional neural network) in promoting the development of electronic nose technology.
[0074] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the above method is implemented when the processor executes the computer program.
[0075] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the above method when executed by a processor.
[0076] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements the above method when executed by a processor.
[0077] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0078] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRdM), magnetic random access memory (MRdM), ferroelectric random access memory (FRdM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RdM) or external cache memory, etc. By way of illustration and not limitation, RdM may be in various forms, such as static random access memory (SRdM) or dynamic random access memory (DRdM).
[0079] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0080] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0081] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A gas detection method, applied to an electronic nose system, wherein the electronic nose system comprises a sensor array, characterized in that: include: Based on the sensor array, obtaining response data of the gas to be detected; Inputting the preprocessed response data into the first shared convolution layer of the multi-task convolutional neural network model to obtain an initial feature map; the multi-task convolutional neural network model includes a first shared convolution layer, a pooling layer, a second shared convolution layer, a plurality of task-specific layers and a fully connected layer connected in sequence; Inputting the initial feature map to the pooling layer for downsampling, and inputting the downsampled feature map to the second shared convolution layer to obtain a target feature map; After the target feature map is input into multiple task-specific layers, the prediction result of the gas to be detected is output through the fully connected layer; wherein the prediction result includes gas category classification result, gas concentration prediction result, sensor state evaluation result and gas anomaly detection result.
2. The gas detection method according to claim 1, characterized in that: After obtaining the response data of the gas to be detected based on the sensor array, it also includes: Select a preset number of response data and inject Gaussian noise as abnormal samples; the Gaussian noise includes low-value noise, high-value noise and regular noise; Based on a fixed window, data segmentation is performed on the abnormal samples in chronological order to obtain the preprocessed response data.
3. The gas detection method according to claim 1, characterized in that: The training process of the multi-task convolutional neural network model specifically includes: Acquire real labels of historical gases; the first real label, the second real label, the third real label and the fourth real label in the real labels are respectively the real category of the gas, the real concentration of the gas, the real state of the sensor array and the response value of the abnormal response data; the real state of the electronic nose includes idle, recovery and response; Input the historical response data into the first shared convolutional layer and output the historical initial feature map; Input the historical initial feature map to the pooling layer for downsampling, then input it to the second shared convolution layer, and output the historical target feature map; The historical target feature map is input into the multiple task-specific layers to obtain the features required for the specific task, and based on the fully connected layer, the historical prediction results are output; the historical prediction results include historical gas category classification results, historical gas concentration prediction results, historical sensor state evaluation results and historical gas anomaly detection results; the specific task includes classification tasks and regression tasks. The multi-task convolutional neural network model is trained based on the historical prediction results and the true label of the gas to be detected.
4. The gas detection method according to claim 3, characterized in that: Based on the historical prediction results and the real labels of the gases to be detected, training the multi-task convolutional neural network model specifically includes: Calculating a first loss between the historical gas category classification result and the first true label; Calculating a second loss between the historical gas concentration prediction result and the second true label; Calculating a third loss between the historical sensor state evaluation result and the third true label; Calculating a fourth loss between the historical gas anomaly detection result and the fourth true label; When the first loss is less than a first preset threshold, the second loss is less than a second preset threshold, the third loss is less than a third preset threshold, and the fourth loss is less than a fourth preset threshold, the trained multi-task convolutional neural network model is obtained.
5. The gas detection method according to claim 4, characterized in that: Multiple loss functions are used to calculate the losses corresponding to different task-specific layers; the multiple loss functions include cross entropy loss and mean square error loss; the cross entropy loss is used to calculate the first loss, the third loss and the fourth loss; the mean square error loss is used to calculate the second loss.
6. The gas detection method according to claim 1, characterized in that: Based on the sensor array, the response data of the gas to be detected is obtained, including: Obtaining the resistance of the sensor sensitive material of the sensor array in the air and the resistance of the sensor sensitive material in the gas to be detected; The ratio of the resistance of the sensor sensitive material in the air to the resistance of the sensor sensitive material in the gas to be detected is used as the response data.
7. The gas detection method according to claim 1, characterized in that: The multiple task-specific layers include a task-specific layer for classification tasks and a task-specific layer for regression tasks; the classification tasks include gas category classification, sensor state evaluation and gas anomaly detection; the regression tasks include gas concentration prediction; the prediction result of the classification task is determined by a fully connected layer and an activation function; the prediction result of the regression task is determined by a fully connected layer.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the gas detection method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the gas detection method according to any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the gas detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
State detection method, device and equipment based on electronic nose and storage medium
CN120429740A
Lightweight mixed gas type and concentration detection method and system and storage medium
CN120600286A
Cargo damage assessment method and device, electronic equipment and storage medium
CN120655956A