Odor identification method based on gas sensor and deep learning

文档序号:1352945 发布日期:2020-07-24 浏览:6次 中文

阅读说明:本技术 一种基于气体传感器与深度学习的气味识别方法 (Odor identification method based on gas sensor and deep learning ) 是由 刘欢 方聪 李华曜 白翔 李龙 唐江 于 2020-03-27 设计创作,主要内容包括:本发明公开了一种基于气体传感器与深度学习的气味识别方法,通过气体传感器阵列获取待测气味的响应曲线簇,并将该原始数据直接作为气味识别深度神经网络的输入样本,对其进行数据预处理与数据扩增,利用深度学习自动提取时间序列响应数据层次化特征,同时进行全局特征提取和长程动态特征提取,并通过分类器输出气味标签,实现高灵敏、特异性气味识别。本发明方法具有高灵敏度、高可靠性,可广泛应用于工业生产、医疗、环境和安全等领域。(The invention discloses a smell identification method based on a gas sensor and deep learning, which is characterized in that a response curve cluster of a smell to be detected is obtained through a gas sensor array, the original data is directly used as an input sample of a smell identification deep neural network, data preprocessing and data amplification are carried out on the input sample, time series response data hierarchical characteristics are automatically extracted by utilizing the deep learning, global characteristic extraction and long-range dynamic characteristic extraction are simultaneously carried out, and a smell label is output through a classifier, so that high-sensitivity and specific smell identification is realized. The method has high sensitivity and high reliability, and can be widely applied to the fields of industrial production, medical treatment, environment, safety and the like.)

1. A gas sensor and deep learning-based odor identification method is characterized by comprising the following steps:

(1) acquiring a response curve cluster of the odor to be detected through a gas sensor array;

(2) carrying out data preprocessing and data amplification on the response curve cluster to obtain a sensing signal;

(3) extracting the multi-dimensional time series signal characteristics of the backbone network for the sensing signals, and simultaneously extracting global characteristics and long-range dynamic characteristics;

(4) and performing multi-mode feature fusion and classified output of smell labels to finish the identification of the smell to be detected.

2. The odor identification method based on the gas sensor and the deep learning as claimed in claim 1, wherein an artificial olfaction system hardware base is constructed by adopting a gas sensor array and a signal acquisition module, response curve clusters to different odors are obtained through the gas sensor array, the raw data is directly used as an input sample of an odor identification deep neural network, and data dimension reduction or artificial feature extraction is not performed.

3. The method for odor recognition based on gas sensor and deep learning of claim 1, wherein the data preprocessing and data amplification specifically comprises:

(21) raw data setContaining N original data samples and corresponding labels, wherein each original sampleComprises K gas sensor units; each original sample TiComprises a plurality of window slices, the window slices are defined as Wherein i is the time label of the start time of the window slice, and j is the time label of the end time.

Using a window of length s in the original of length nSliding on the starting sample, resulting in m +1 time-series slices: sliding (T, S) { S }1:s,S1+p:s+p,…,S1+p*m:s+p*mAll window slices have the same label as the original sample, p is the window sliding step, 0 ≦ (N-s-p × m) < p, the number of samples in the original data set is expanded to N × (m + 1);

(22) the original data set after data amplification is normalized,

(23) and performing reciprocal transformation on partial channels in the normalized original data set:wherein k is the number of the sensor unit needing inverse transformation;

(24) dividing the processed original data set into a training set and a testing set, carrying out random scale transformation on each sample in the training set, and amplifying the number of the samples of the training set by M times, wherein M is the number of times of the random scale transformation;

(25) performing pixel-level power function transformation on each sample in the training set and the test set: and amplifying the number of channels of each sample from K to K × (q +1), wherein K is the number of gas sensitive units of the gas sensor array, and q is the number of power functions.

4. The odor identification method based on the gas sensor and the deep learning as claimed in claim 1, wherein the adopted multidimensional time series signal feature extraction backbone network is a multi-stage one-dimensional residual block, each one-dimensional residual block comprises a plurality of residual bottleneck structures, each bottleneck structure adopts 3 serially connected one-dimensional convolutional layers to perform feature extraction on the multidimensional time series signal, the convolutional cores of the bottleneck structures are 1 × 1, 3 × 1 and 1 × 1 in sequence, and each one-dimensional convolutional layer is followed by a batch normalization layer and a Re L U activation layer.

5. The odor identification method based on gas sensor and deep learning as claimed in claim 4, wherein a channel and time attention module is added on top of each residual bottleneck structure; the channel attention module and the time attention module are arranged in a serial or parallel mode, and when the channel attention module and the time attention module are arranged in a parallel mode, improved characteristic images are fused by adopting pixel-level addition operation;

the input of the channel attention module is a feature map F of the previous layer, and the output isWhereinPoint-by-point multiplication; channel attention map MC(F) Is obtained by the following formula:

wherein, AvgPool and MaxPool are average pooling operation and maximum pooling operation respectively, M L P represents weight-sharing multi-layer perceptron, W0∈RC/r×CAnd W1∈RC×C/rRepresenting the weight of M L P, r being the compression ratio, "+" representing point-by-point addition, and sigma representing sigmoid activation function;

the input of the time attention module is a feature map F of the previous layer, and the output isChannel attention map MT(F) Is obtained by the following formula:

wherein AvgPool and MaxPool are average pooling operation and maximum pooling operation, respectively, f7×1Representing a multilayer perceptron with shared weight, "; "denotes a connection on a channel.

6. The method as claimed in claim 1, wherein the global feature extraction network branch adopts global average pooling operation to calculate the average value of each channel time series signal, the output is a one-dimensional feature vector, and the length of the feature vector is consistent with the number of channels of the output feature map of the previous network; the long-range dynamic feature extraction network branch adopts a long-and-short-term memory network to model the long-range link in the multidimensional time series signal, and the output of the long-range link is a one-dimensional feature vector; the one-dimensional feature vectors output by the multiple network branches are fused together and used as the output of the stage.

7. The method as claimed in claim 6, wherein the input feature map is compressed by average pooling in the long-range dynamic feature extraction network branch, and then the long-term memory network is input, so as to improve the execution efficiency of the network branch.

Technical Field

The invention belongs to the technical field of artificial olfaction, and particularly relates to a smell identification method based on a gas sensor and deep learning.

Background

The electronic nose constructed based on the gas sensor is a typical portable artificial olfactory system, generates signals through the reaction of a sensor array and atmosphere, can identify simple and complex odors by combining a pattern recognition technology, has the characteristics of convenient use, low price and easy popularization compared with common laboratory gas component analysis methods (such as an electrochemical method, an optical method, a chromatographic separation method and the like), is suitable for on-site rapid detection and distributed on-line monitoring of various gases/odors, and has been practically applied in the fields of food industry, agricultural production, environmental monitoring and the like. For example, it is a development trend of artificial olfaction technology to identify freshness of food by detecting atmosphere generated in food deterioration process through an electronic nose, identify different odors generated in brewing process to control brewing process, identify tobacco grade according to different odors of tobacco, detect disease markers in exhaled gas of human body to predict related diseases, and further improve field environment adaptability and identification accuracy.

With the significant breakthrough of various "bio-heuristic" sensors and artificial intelligence algorithm technologies, the performance of artificial vision, auditory and tactile systems has reached and even surpassed that of humans. Compared with thousands of odor receptors in a human olfactory system, due to the limitation of volume and power consumption of the gas sensors, the number of the gas sensors in the current electronic nose artificial olfactory system is very limited, and the pattern recognition technology mainly depends on the artificial extraction of data features of the gas sensors, only one-sided features such as sensitivity, response time and the like are extracted to be used as input data of a neural network, an effective feature extraction means specially aiming at original signals of an odor sensor array is lacked, and systematic and comprehensive big data cannot be provided for a deep learning algorithm to mine high-level and abstract odor features. Therefore, compared with intelligent image and voice recognition based on sensing of physical quantities such as optics and acoustics, the development of an artificial olfactory system based on a gas sensor and deep learning is delayed seriously.

In the Chinese invention patent of a portable intelligent electronic nose system and a smell identification method (publication number: CN106841308A, publication date: 2017, 6 and 13 months) features are extracted from a response curve by a difference method, and dimension reduction algorithms such as Principal Component Analysis (PCA) and the like are adopted to reduce the dimension of the extracted features. On one hand, in the process of preprocessing, feature extraction and dimension reduction of original data, the information compression ratio is very high, so that many distinguishable features are lost, and the performance of a subsequent classifier is limited; meanwhile, although the method can decompose a complex parent problem into a plurality of simple, controllable and clear-structured sub-problems, the method can only seek an optimal solution on each sub-problem, and cannot obtain a global optimal solution of the parent problem, so that the generalization performance and the capability of solving the complex problem are limited.

In the paper "Development of a L eNet-5 GasIdentification CNN Structure for Electronic Nos" published in "Sensors" of 2019 and the paper "A Fast and Robust Gas registration Algorithm base on hybrid consistent and Recurred neural Network" published in "IEEE Access" of 2019, the processing method adopts a two-dimensional convolution neural Network to perform feature extraction on the original signal, and has two disadvantages that firstly, the response curve of the Gas sensor array is a multidimensional time series signal, and is different from a two-dimensional image, the one-dimensional time series signals from different sensor units have no spatial correlation and are not suitable for feature extraction by adopting two-dimensional convolution, and secondly, the two-dimensional convolution has higher time complexity and spatial complexity compared with one-dimensional convolution, and increases the calculation and storage cost.

A method for simulating biological Olfactory behaviors by using a Neuromorphic chip is reported in a paper 'Rapid on line L and Robust Recall in a neurological oxygen Circuit' published in 2 nd 2020. the method is based on a gas sensor database disclosed by a network, intercepts 30-180s of response data (with the interval time of 5s) from response time sequence signal raw data of a plurality of metal oxide gas sensors, reduces the complexity of the signals through simple data quantization processing, simulates signals obtained after the biological Olfactory organ Olfactory pellets are processed through a L oihi Neuromorphic chip developed by Intel to output an odor recognition result.

Disclosure of Invention

Aiming at the defects or improvement requirements of the prior art, the invention provides an odor identification method based on a gas sensor and deep learning, which aims to solve the problem of spatial independence among multiple channels of time series signals, solve the problem that the existing artificial olfactory system odor identification network based on a two-dimensional convolution kernel cannot model the long-range relation of single-channel time series signals, and solve the problem of influence of sensor baseline drift and environmental factor change on identification accuracy.

In order to realize the purpose, a gas sensor array and a signal acquisition module are adopted to construct the hardware basis of the artificial olfaction system, and the original data is directly used as an input sample of the odor recognition deep neural network. The odor identification method based on the gas sensor and the deep learning specifically comprises the following steps:

(1) acquiring a response curve cluster of the odor to be detected through a gas sensor array;

(2) carrying out data preprocessing and data amplification on the response curve cluster to obtain a sensing signal;

(3) extracting the multi-dimensional time series signal characteristics of the backbone network for the sensing signals, and simultaneously extracting global characteristics and long-range dynamic characteristics;

(4) and performing multi-mode feature fusion and classification to complete the identification of the odor to be detected.

Preferably, in the data preprocessing and data amplification, in order to effectively extract the multi-dimensional time series signal characteristics, the method adopts a one-dimensional residual error network and combines a channel and time attention mechanism, so that the backbone network automatically extracts the characteristics suitable for the odor classification task.

In the aspect of obtaining robust odor identification performance under complex measurement conditions, the main data preprocessing and amplification method provided by the invention specifically comprises the following steps:

(21) sliding window based data clipping. Raw data setContaining N original data samples and corresponding labels, wherein each original sampleComprises K gas sensor units; each original sample TiComprises a plurality of window slices, the window slices are defined asWherein i is the time label of the start time of the window slice, and j is the time label of the end time.

Sliding a window of length s over an original sample of length n to obtain m +1 time series slices: sliding (T, S) { S }1:s,S1+p:s+p,…,S1+p*m:s+p*mAll window slices have the same label as the original sample, p is the window sliding step, 0 ≦ (N-s-p × m) < p, the number of samples in the original data set is expanded to N × (m + 1);

(22) and (6) normalizing the data. The original data set after data amplification is normalized,

(23) pixel level inverse transform. And performing reciprocal transformation on partial channels in the normalized original data set:wherein k is the number of the sensor unit needing inverse transformation;

(24) and (4) channel-level random scale transformation. Dividing the processed original data set into a training set and a testing set, carrying out random scale transformation on each sample in the training set, and amplifying the number of the samples of the training set by M times, wherein M is the number of times of the random scale transformation;

(25) and (4) pixel level power function transformation.Performing pixel-level power function transformation on each sample in the training set and the test set:and amplifying the number of channels of each sample from K to K × (q +1), wherein K is the number of gas sensitive units of the gas sensor array, and q is the number of power functions.

Preferably, the adopted multi-dimensional time series signal feature extraction backbone network is a multi-stage one-dimensional residual block, each one-dimensional residual block comprises a plurality of residual bottleneck structures, each bottleneck structure adopts 3 one-dimensional convolutional layers connected in series to perform feature extraction on the multi-dimensional time series signal, the convolutional cores of the bottleneck structures are 1 × 1, 3 × 1 and 1 × 1 in sequence, and each one-dimensional convolutional layer is followed by a batch normalization layer and a Re L U activation layer.

Preferably, a channel and time attention module is added on top of each residual bottleneck structure; the channel attention module and the time attention module are arranged in a serial or parallel mode, and when the channel attention module and the time attention module are arranged in a parallel mode, improved characteristic images are fused by adopting pixel-level addition operation;

the input of the channel attention module is a feature map F of the previous layer, and the output isWhereinPoint-by-point multiplication; channel attention map MC(F) Is obtained by the following formula:

wherein, AvgPool and MaxPool are average pooling operation and maximum pooling operation respectively, M L P represents weight-sharing multi-layer perceptron, W0∈RC/r×CAnd W1∈RC×C/rRepresenting the weight of M L P, r being the compression ratio, "+" representing point-by-point addition, and sigma representing sigmoid activation function;

the input to the temporal attention module being of the previous layerA feature map F having an output ofChannel attention map MT(F) Is obtained by the following formula:

wherein AvgPool and MaxPool are average pooling operation and maximum pooling operation, respectively, f7×1Representing a multilayer perceptron with shared weight, "; "denotes a connection on a channel.

In order to achieve the purpose, in the aspect of establishing long-range connection of a time sequence signal, two branch networks are adopted to simultaneously extract complementary global static characteristics and long-range dynamic characteristics, so that global information corresponding to an artificial characteristic engineering method is reserved, long-range time sequence information is added, and the odor recognition performance can be effectively improved through the fused characteristics. The global feature extraction network branch adopts global average pooling operation to calculate the average value of each channel time sequence signal, the output of the average value is a one-dimensional feature vector, and the length of the feature vector is consistent with the channel number of the output feature map of the previous layer of network; the long-range dynamic feature extraction network branch adopts a long-and-short-term memory network to model the long-range link in the multidimensional time series signal, and the output of the long-range link is a one-dimensional feature vector; and finally, fusing the one-dimensional feature vectors output by the plurality of network branches together to serve as the output of the stage.

Preferably, the deep neural network takes the output of the cross entropy loss function as a feedback signal, fine tuning is carried out on the weight of each layer of the network by adopting a back propagation algorithm, and the odor recognition precision is continuously improved by the iteration mode. Meanwhile, the types of the sensors suitable for the purposes are identified by analyzing the contribution degree of each sensor to the identification result, the combination mode of the gas sensor array is optimized, and a basis is provided for developing new sensors.

Generally, compared with the prior art, the technical scheme of the invention has the following beneficial effects:

(1) according to the invention, the hierarchical characteristics of time sequence response data of the gas sensor array to different odors are automatically extracted by deep learning, the complementary global static characteristics and long-range dynamic characteristics are simultaneously extracted by adopting a plurality of branch networks, the odor identification performance is greatly improved by the fused characteristics, and then the odor label is output by the classifier, so that high-sensitivity and specific odor identification is realized;

(2) the invention provides a novel one-dimensional convolution backbone network with residual connection, channels and a time attention mechanism, so that an original signal can obtain a differentiable intermediate representation, the method has the characteristics of capacity of virtually amplifying the number of sensors and high operation efficiency, and the defect of information loss when the characteristics are manually extracted by the traditional method can be avoided;

(3) the invention inputs the original response curve cluster of the gas sensor array into the odor identification network, ensures the integrity of odor information, and simultaneously adopts a series of data preprocessing and amplification technologies to make the data more suitable for hierarchical feature extraction.

Drawings

Fig. 1 is an overall flow chart of the artificial olfactory system odor identification method based on the one-dimensional convolutional neural network and the recurrent neural network provided by the invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

The invention provides an odor identification method based on a gas sensor and deep learning, which specifically comprises the following steps of:

(1) obtaining a response curve cluster of the odor to be detected through a gas sensor array;

(2) carrying out data preprocessing and data amplification on the response curve cluster to obtain a sensing signal;

(3) extracting the multi-dimensional time series signal characteristics of the backbone network for the sensing signals, and simultaneously extracting global characteristics and long-range dynamic characteristics;

(4) and performing multi-mode feature fusion and classification to complete the identification of the odor to be detected.

There are mainly four implementation parts: 1) obtaining an odor response curve cluster through a gas sensor array; 2) data preprocessing and amplification; 3) a multi-channel time sequence signal feature extraction backbone network; 4) extracting a branch network from the global static characteristics and the long-range dynamic characteristics; 5) a classifier and a loss function. The steps of the present invention will be described in detail below.

The invention adopts a gas sensor array and a signal acquisition module to construct artificial olfaction system hardware, which comprises a sampling system (an air pump), a gas sensor array (comprising 6 semiconductor gas sensors) and a data acquisition module (a data acquisition card).

The data preprocessing and amplification process mainly comprises the following steps:

(21) raw data setContaining N original data samples and corresponding labels, wherein each original sampleContains K sensor units. Each original sample TiComprises a plurality of window slices, the window slices are defined as Wherein i is the time label of the start time of the window slice, and j is the time label of the end time.

Sliding a window of length s over an original sample of length n to obtain m +1 time series slices: sliding (T, S) { S }1:s,S1+p:s+p,…,S1+p*m:s+p*mTherein all ofThe labels of the window sections are the same as the original samples, p is the window sliding step, 0 ≦ (N-s-p × m) < p.

(22) Normalizing the data set after sample number amplification:

(23) and performing reciprocal transformation on part of channels in the normalized data set sample:where k is the number of the sensor unit that needs to be inverted.

(24) Dividing the preprocessed and amplified data set into a training set and a testing set, and carrying out random scale transformation on each sample in the training set: s't=λ·St,λ∈(1,1.1)。

(25) Performing pixel-level power function transformation on each sample in the training set and the test set: and amplifying the number of channels of each sample from K to K × (q +1), wherein K is the number of gas sensitive units of the gas sensor array, and q is the number of power functions.

For multi-channel time sequence signal feature extraction, training the whole network through a cross entropy loss function, wherein the whole network comprises a one-dimensional residual error network, a time attention mechanism and a channel attention mechanism;

(1) one-dimensional residual network similar to the two-dimensional version, comprising a first one-dimensional convolutional layer and a plurality of repeated stages.A plurality of one-dimensional residual blocks are stacked in each stage.A structure of each residual block stacks a plurality of 1 × 1 convolutional layers with batch normalization and Re L U active layers and 3 × 1 convolutional layers, and forms a bottleneck structure.

(2) The channel attention mechanism is as follows: for the one-dimensional feature map F, it is multiplied point-by-point:

channel attention map MC(F) Is obtained by the following formula:

wherein AvgPool and MaxPool are average pooling operation and maximum pooling operation on time axis respectively, M L P represents weight-sharing multi-layer perceptron, W0∈RC/r×CAnd W1∈RC×C/rDenotes the weight of M L P, r is the compression ratio, "+" denotes point-by-point addition, and σ denotes the sigmoid activation function.

(3) Time attention mechanism: for the one-dimensional feature map F, it is multiplied point-by-point:

time attention map MT(F) Is obtained by the following formula:

where AvgPool and MaxPool are the average pooling operation and maximum pooling operation on the channel, respectively, f7×1Representing a multilayer perceptron with shared weight, "; "denotes a connection on a channel.

(4) The channel attention mechanism and the time attention mechanism can be arranged in a serial or parallel mode and integrated into each one-dimensional residual block.

For the extraction of global static features and long-range dynamic features, on one hand, a one-dimensional multi-channel feature map is converted into a one-dimensional feature vector by adopting one-dimensional global average pooling operation, and the length of the feature vector is consistent with the number of channels of the previous layer of network output feature map, so that the global information of each channel is obtained; on the other hand, firstly, the average pooling operation is adopted to extract high-level semantic features and enlarge the receptive field, and then the one-dimensional multi-channel feature map with the shortened length is input into the long-time and short-time memory network to obtain the one-dimensional feature vector containing the long-range dynamic information. Finally, the feature vectors whose information is complementary are connected together as input to the classifier.

Classifying the fused global static characteristics and long-range dynamic characteristics by adopting three full-connection layers and one SoftMax layer, and outputting the prediction probability P of each class as { P }1,p2,…,pcWhere c is the total number of classes. And (4) adopting a cross entropy loss function to supervise the odor recognition network for training.

The invention provides a smell identification method based on a gas sensor and deep learning. The one-dimensional residual error network can be used for well extracting the multi-dimensional time series signal characteristics, and the subsequent extraction of global characteristics and long-range characteristics is facilitated. In addition, a multi-dimensional time series signal characteristic representation with higher discrimination is learned by adopting a channel and time attention network, so that the multi-dimensional time series signal characteristic representation has good robustness on measurement noise. In order to further improve the identification precision, a global pooling branch and a recurrent neural network branch are adopted for extracting and fusing complementary features. Based on these operations, the present invention not only achieves high recognition accuracy, but also enables odor recognition in real time.

It will be understood by those skilled in the art that the foregoing is only a preferred embodiment of the present invention, and is not intended to limit the invention, and that any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种可以方便安装和拆卸的城市环境检测装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!