CN113378935A - Intelligent olfactory sensation identification method for gas - Google Patents
Intelligent olfactory sensation identification method for gas Download PDFInfo
- Publication number
- CN113378935A CN113378935A CN202110656610.7A CN202110656610A CN113378935A CN 113378935 A CN113378935 A CN 113378935A CN 202110656610 A CN202110656610 A CN 202110656610A CN 113378935 A CN113378935 A CN 113378935A
- Authority
- CN
- China
- Prior art keywords
- gas
- sample
- value
- sensor response
- ith
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/253—Fusion techniques of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computational Linguistics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Evolutionary Biology (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Investigating Or Analyzing Materials By The Use Of Fluid Adsorption Or Reactions (AREA)
Abstract
The invention relates to an intelligent olfactory sensation identification method for gas, which comprises the steps of firstly collecting P known gases, constructing a smell data sample library, secondly constructing and constructing a gas intelligent identification model, training by using data in the smell data sample library, finally extracting signal characteristics of the gas to be detected and constructing a characteristic vector X, inputting the X into the trained gas intelligent identification model, and outputting a predicted gas type label of the gas to be detected. The invention constructs a gas intelligent recognition model based on the neural network, and sets a weight with an additional momentum factor, a threshold with the additional momentum factor and a self-adaptive learning rate to influence the training process, thereby finally obtaining the intellectualization and the reliability of the gas recognition.
Description
Technical Field
The invention relates to the field of computer olfaction, in particular to an intelligent olfaction identification method for gas.
Background
The current intelligent identification of gas is vital in various fields such as industry, agriculture, commerce and the like, and comprises identification of toxic, harmful, flammable and explosive gas in the fields of petrochemical industry and coal mine gas, and identification of different varieties such as white spirit, wine, coffee and the like in the field of consumer goods. Gas identification or odor identification has been a troublesome problem in all industries. Unlike color recognition based on the wavelength of light, gases or odors have difficulty capturing distinct physicochemical characteristics similar to the wavelength of light, and it is difficult to recognize different odors based on only gas-specific molecular characteristics. At present, most of identification of gas or smell depends on artificial olfaction judgment and experimental detection, but olfaction subjective judgment usually involves larger errors and has potential personal safety risks. The manual experiment detection usually consumes a large amount of time and energy, even causes huge personal safety loss, and especially, the hysteresis identification of toxic, harmful, flammable and explosive gases usually needs to pay a great cost, and the method has no portability and is difficult to be applied in a specific scene on a large scale.
With the development and progress of the technology, portable detectors by means of gas sensors and gas detection technology have been primarily used. But relying solely on gas sensor technology is limited by the concentration of the gas or odor being measured. And because the gas sensor generally has the problem of cross sensitivity, the single sensor is difficult to accurately qualitatively identify and quantitatively detect the mixed gas in the environment. At present, computer vision has achieved breakthrough development in the fields of face recognition, target detection and the like, and universal approximation capability of deep learning is fully verified. Moreover, the academic world has long proposed the concept of "gas fingerprint", i.e. different gases or different smells have unique characteristics similar to fingerprints, which provides possibility for realizing computer olfaction. In order to reduce the time, labor cost and potential danger of gas identification and promote the efficient development of odor identification, the current technological front should be focused on, human intervention in the gas identification process should be reduced as much as possible, and a computer olfaction implementation method should be constructed.
Disclosure of Invention
Aiming at the problems in the prior art, the technical problems to be solved by the invention are as follows: how to intelligently and accurately identify the odor.
In order to solve the technical problems, the invention adopts the following technical scheme: an intelligent olfactory identification method for gas comprises the following steps:
s100: collecting P kinds of known gases, and constructing an odor data sample library, wherein samples in the odor data sample library are sensor response data and real labels of the known gases, and the odor data sample library construction process comprises the following steps:
setting a time period as T, taking data values once at the same time interval in the time period T, extracting data values T times in total, and acquiring T data values by each sensor when the time period T is finished;
for the p known gas, detecting the known gas by using a jth gas sensor pair, transmitting a signal detected by the jth gas sensor out of an amplifying circuit to obtain a jth voltage signal value, and for the ith known gas, obtaining T voltage signal values in a time period T;
for the jth sensor of the pth known gas, a sensor response curve is drawn by taking time as a horizontal axis and t voltage signal values as a vertical axis, and if j is 1 and 2 … N, N sensor response curves are obtained for the ith known gas;
let P be 1,2 … P, the sensor response curves for P known gases are obtained.
S200: extracting signal characteristics of the ith sample in the odor data sample library and constructing a characteristic vector XiSaid feature vector XiThe specific expression of (a) is as follows:
wherein the content of the first and second substances,obtaining an arithmetic mean value for each sensor response curve of the ith sample, and obtaining N arithmetic mean values for N sensor response curves, wherein the arithmetic mean value vector is formed by the N arithmetic mean values;
obtaining a maximum voltage value for each sensor response curve of the ith sample, obtaining N maximum voltage values for N sensor response curves, wherein the peak vector of the sensor response curve of the ith sample is formed by the N maximum voltage values;
Variobtaining a variance value for each sensor response curve of the ith sample, and obtaining N variance values for N sensor response curves, wherein the variance vector is formed by the N variance values;
Siobtaining an integral value for each sensor response curve of the ith sample, and obtaining N integral values for N sensor response curves, wherein the integral value vector is formed by the N integral values;
Varliobtaining a response value of a sensor response curve of an ith sample at the moment of maximum variance, obtaining a response value of each sensor response curve of the ith sample at the moment of maximum variance, obtaining N response values of the sensor response curves at the moment of maximum variance, wherein the response value vector at the moment of maximum variance is formed by the N response values at the moment of maximum variance;
the response value vector of the sensor response curve of the ith sample at any moment in the steady-state stage is obtained, each sensor response curve of the ith sample obtains a response value at any moment in the steady-state stage, the N sensor response curves obtain N response values at any moment in the steady-state stage, and the response value vector at any moment in the steady-state stage is formed by the N response values at any moment in the steady-state stage.
S300: constructing a gas intelligent recognition model, wherein the gas intelligent recognition model uses a deep neural network framework, and the specific expression is as follows:
where, i is 1,2, …, m, j is 1,2,. n, i.e. there are m neuron nodes at the l-1 th layer, n neuron nodes at the l-1 th layer, superscript/number of layers of neural network, wjiConnecting the ith node of the previous layer with the jth node of the next layer,is the output of the ith node of the l-1 st layer,is the output of the jth node of layer 1,is the threshold value of the jth node of layer 1, wlWeight matrix of layer 1 n x m, blThe threshold vector matrix for level 1 n x 1, g (-) is the activation function.
S400: training the intelligent gas recognition model established in the step S300, wherein the specific steps are as follows:
s410: setting a weight value with an additional momentum factor, a threshold value with the additional momentum factor and an adaptive learning rate, wherein the expression of the weight value with the additional momentum factor is as follows:
Δw(k+1)=(1-μ)ηδ(k)+μΔw(k) (4-1)
the expression for the threshold with the additional momentum factor is as follows:
Δb(k+1)=(1-μ)ηδ+μΔb(k) (4-2)
the expression for the adaptive learning rate is as follows:
wherein k is the training times; mu is a momentum factor, E (k) is the k-th error sum of squares, E (k +1) is the k + 1-th error sum of squares, Δ w (k) is a weight adjustment amount of the k-th iteration, η is a learning rate, η (k) is an adaptive learning rate of the k-th iteration, δ (k) represents a partial derivative of an error function to neurons of an output layer, Δ b (k +1) represents a threshold adjustment amount of the k + 1-th iteration, and Δ b (k) represents a threshold adjustment amount of the k-th iteration;
s420: taking the characteristic vector X of the sample as the input of an intelligent gas identification model, and taking the output of the intelligent gas identification model as a gas type prediction label of the sample;
s430: initially assigning values to TP, TN, FP and FN;
if the sample belongs to the gas sample library and the predicted label of the sample is consistent with the real label, then TP is TP + 1;
if the sample belongs to the gas sample bank, then TN ═ TN + 1;
if the sample belongs to the gas sample library and the predicted label of the sample is inconsistent with the real label, then FP is FP + 1;
if the sample does not belong to the gas sample library, labeling FN + 1;
s440: repeating S410-S430, and traversing all samples to obtain values of TP, TN, FP and FN;
s450: the accuracy is calculated according to the formula (4-4):
wherein, Accuracy represents the prediction Accuracy, TP + TN represents the number of correctly predicted samples, and TP + TN + FP + FN represents the total number of samples;
s460: and setting an accuracy threshold, stopping training when the prediction accuracy reaches or reaches the accuracy threshold to obtain a trained gas intelligent recognition model, and otherwise, reversely propagating and updating parameters of the gas intelligent recognition model and returning to the step S410 to continue training.
S500: and (4) extracting the signal characteristics of the gas to be detected, constructing a characteristic vector X, inputting the X into the trained intelligent gas identification model obtained in the step S460, and outputting a predicted gas type label of the gas to be detected.
As an improvement, S100 plots a sensor response curve for the jth sensor of the pth known gas with time as the horizontal axis and t voltage signal values as the vertical axis, and when j is 1,2 … N, N sensor response curves are obtained for the ith known gas;
and performing high-frequency signal removing processing on the response curves of the N sensors, and labeling the gas type labels.
As a refinement, the method for calculating the arithmetic mean value, the maximum voltage value, the variance value, the integral value, the response value at the time when the variance is maximum and the response value at any time in the steady state stage of each sensor response curve of the ith sample in S200 is as follows:
the arithmetic mean of each sensor response curve for the ith sample is calculated using equation (2-2):
the peak value of each sensor response curve for the ith sample is calculated using equation (2-3):
the variance value of each sensor response curve of the ith sample is calculated by using the formula (2-4):
the integral value of each sensor response curve of the ith sample is calculated using equation (2-5):
the response value vector of each sensor response curve of the ith sample at the moment when the variance is maximum is calculated by adopting the formula (2-6):
wherein the content of the first and second substances,the arithmetic mean of the jth sensor response curve representing the ith sample, y (T, i) represents the voltage signal value T times the ith sample over the time period T,the peak, Var, of the jth sensor response curve representing the ith samplei,jVariance value, S, of the jth sensor response curve representing the ith samplei,jIntegral, Varl, of the jth sensor response curve representing the ith samplei,jAnd (3) representing the response value of the jth sensor response curve of the ith sample at the moment when the variance is maximum.
As an improvement, the threshold for accuracy in S460 is 99.5%.
Compared with the prior art, the invention has at least the following advantages:
1. the invention aims at intelligent gas identification, fully excavates unique abstract characteristics of different odors, integrates odor electric signal data acquisition, odor data sample library construction and odor characteristic training processes based on an intelligent sensor technology and an artificial intelligence method, and realizes high automation and intellectualization of computer olfaction to a certain extent through intelligent classification and identification of odors on the basis of constructing a complete odor data sample library.
2. The computer olfaction implementation method can not only identify single smell, but also extract the characteristics of mixed smell, thereby achieving the purpose of identifying the mixed smell; the method can extract the unique abstract features of different smells, and for a research object mixed with various smells, the mixed smell data is stored in the sample database by labeling the smell label after the electric signal data is acquired, and once the smell data is monitored again, the type of the mixed smell can be judged according to the output label.
3. The invention constructs a gas intelligent recognition model based on the neural network, and sets a weight with an additional momentum factor, a threshold with the additional momentum factor and a self-adaptive learning rate to influence the training process, thereby finally obtaining the intellectualization and the reliability of the gas recognition.
Drawings
FIG. 1 is a flow chart of the detection system architecture.
FIG. 2 is a schematic diagram of a single sensor test circuit.
FIG. 3 is a graph of the electrical signal response of a single gas sensor.
FIG. 4 is a graph comparing pre (left) and post (right) response curves of data.
FIG. 5 is a schematic diagram of a confusion matrix.
Fig. 6 is a gas sensor response curve for samples 1,2, 3 in experimental validation, where fig. 6(a) represents sample 1, fig. 6(b) represents sample 2, and fig. 6(c) represents sample 3.
Detailed Description
The present invention is described in further detail below.
Referring to fig. 1 to 5, an intelligent olfactory identification method for gas includes the following steps:
s100: collecting P kinds of known gases, and constructing an odor data sample library, wherein samples in the odor data sample library are sensor response data and real labels of the known gases, and the odor data sample library construction process comprises the following steps:
and setting the time period as T, taking data values once at the same time interval in the time period T, extracting data values T times in total, and collecting the data values T times by each sensor when the time period T is finished.
For the p known gas, the jth gas sensor pair is used for detecting the known gas, the detection signal of the jth sensor is transmitted out of the amplifying circuit to obtain the jth voltage signal value, and for the ith known gas, T voltage signal values are obtained in the time period T.
For the jth sensor of the pth known gas, a sensor response curve is plotted with time as the horizontal axis and t voltage signal values as the vertical axis, and when j is 1,2 … N, N sensor response curves are obtained for the ith known gas.
Let P be 1,2 … P, the sensor response curves for P known gases are obtained.
The gas sensor is put into known gas with certain concentration, the voltage signal obtained by the sensor is very weak and is not beneficial to processing, therefore, the inventor thinks that the method is used for amplifying the voltage signal of the circuit, and is convenient for subsequent processing.
S200: extracting signal characteristics of the ith sample in the odor data sample library and constructing a characteristic vector XiSaid feature vector XiThe specific expression of (a) is as follows:
wherein the content of the first and second substances,the arithmetic mean vector is the arithmetic mean vector of the sensor response curves of the ith sample, each sensor response curve of the ith sample obtains an arithmetic mean, the N sensor response curves obtain N arithmetic means, and the arithmetic mean vector is formed by the N arithmetic means.
The peak value vector of the sensor response curve of the ith sample is obtained, each sensor response curve of the ith sample obtains a maximum voltage value, N sensor response curves obtain N maximum voltage values, and the peak value vector is formed by the N maximum voltage values.
VariObtaining a variance value for each sensor response curve of the ith sample, and obtaining N variance values for N sensor response curves, wherein the variance vector is formed by the N variance values.
SiIs an integral value vector of the sensor response curve of the ith sample, each sensor response curve of the ith sampleAnd obtaining an integral value, wherein N sensor response curves obtain N integral values, and the integral value vector is formed by the N integral values.
VarliAnd obtaining a response value of each sensor response curve of the ith sample at the moment when the variance is maximum, obtaining N response values of the sensor response curves of the ith sample at the moment when the variance is maximum, wherein the response value vector at the moment when the variance is maximum is formed by the N response values at the moment when the variance is maximum.
The response value vector of the sensor response curve of the ith sample at any moment in the steady-state stage is obtained, each sensor response curve of the ith sample obtains a response value at any moment in the steady-state stage, the N sensor response curves obtain N response values at any moment in the steady-state stage, and the response value vector at any moment in the steady-state stage is formed by the N response values at any moment in the steady-state stage.
S300: constructing a gas intelligent recognition model, wherein the gas intelligent recognition model uses a deep neural network framework, and the specific expression is as follows:
ol=g(wlol-1+bl) (3-2)
where, i is 1,2, …, m, j is 1,2,. n, i.e. there are m neuron nodes at l-1 level, n neuron nodes at l level, superscript/number of neural network layers, wjiConnecting the ith node of the previous layer with the jth node of the next layer,is the output of the ith node of the l-1 st layer,is the output of the jth node of layer 1,is the threshold value of the jth node of layer 1, wlWeight matrix of layer 1 n x m, blA threshold vector matrix of n x 1 at level 1, g (-) being an activation function; the activation function takes the form of a softmax function,
wherein, formula (3-1) represents an algebraic expression, and formula (3-2) represents a matrix expression; ol-1A vector of m × 1; olIs a vector of n × 1; blIs a vector of n × 1; that is, if l is 2, the corresponding o1I.e. the characteristic vector x of the input layer is ═ x1,x2,...,x6q]T。
S400: training the intelligent gas recognition model established in the step S300, wherein the specific steps are as follows:
s410: setting a weight value with an additional momentum factor, a threshold value with the additional momentum factor and an adaptive learning rate, wherein the expression of the weight value with the additional momentum factor is as follows:
Δw(k+1)=(1-μ)ηδ(k)+μΔw(k) (4-1)
the expression for the threshold with the additional momentum factor is as follows:
Δb(k+1)=(1-μ)ηδ+μΔb(k) (4-2)
the expression for the adaptive learning rate is as follows:
wherein k is the training times; mu is a momentum factor, E (k) is the square sum of the kth error, E (k +1) is the square sum of the kth error, Δ w (k) is the weight adjustment amount of the kth iteration, η is the learning rate, η (k) is the adaptive learning rate of the kth iteration, δ (k) represents the partial derivative of the error function to the neuron of the output layer, Δ b (k +1) represents the threshold adjustment amount of the kth iteration, and Δ b (k) represents the threshold adjustment amount of the kth iteration, wherein the experiment effect is optimal when the momentum factor generally takes a value of about 0.95.
S420: and taking the characteristic vector X of the sample as the input of the intelligent gas identification model, and taking the output of the intelligent gas identification model as the gas type prediction label of the sample.
S430: initially assigning values to TP, TN, FP and FN; judging whether the sample belongs to the gas sample library or not, and judging whether the prediction label of the mth sample is consistent with the real label of the mth sample or not, specifically:
if the sample belongs to the gas sample library and the predicted label of the sample is consistent with the true label, TP + 1.
If the sample belongs to the gas sample bank, then TN ═ TN + 1.
If the sample belongs to the gas sample library and the predicted label of the sample does not match the true label, FP + 1.
If the sample does not belong to the gas sample pool, the sample is labeled FN ═ FN + 1.
S440: and repeating S410-S430, and traversing all the samples to obtain the values of TP, TN, FP and FN.
S450: the accuracy is calculated according to the formula (4-4):
wherein, Accuracy represents the prediction Accuracy, TP + TN represents the number of samples with correct prediction, and TP + TN + FP + FN represents the total number of samples.
S460: and setting an accuracy threshold, stopping training when the prediction accuracy reaches or reaches the accuracy threshold to obtain a trained gas intelligent recognition model, and otherwise, reversely propagating and updating parameters of the gas intelligent recognition model and returning to the step S410 to continue training.
The threshold for accuracy was 99.5%. In the confusion matrix, the statistical number of samples is, and it is desirable that the number of correct prediction classifications is larger, i.e., the number of TPs and TNs is larger, and the number of FPs and FN is smaller. When the data volume is large, the quality of the model is difficult to measure only by the number, so that the evaluation is carried out by the accuracy, and the training process of the neural network model is completed when the accuracy reaches 99.5%.
S500: and (4) extracting the signal characteristics of the gas to be detected, constructing a characteristic vector X, inputting the X into the trained intelligent gas identification model obtained in the step S460, and outputting a predicted gas type label of the gas to be detected.
As an improvement, in S100, for the jth sensor of the pth known gas, a sensor response curve is plotted with time as a horizontal axis and t voltage signal values as a vertical axis, and when j is 1 and 2 … N, N sensor response curves are obtained for the ith known gas; and performing high-frequency signal removing processing on the response curves of the N sensors, and labeling the gas type labels. Removing high-frequency signal processing, namely data filtering, wherein arithmetic mean filtering is adopted, and a certain amount of original data is accumulated and then averaged, so that more stable output data is obtained; therefore, the high-frequency signals can be removed, so that sharp noise can be eliminated, a sampling curve is smoother, and experimental errors caused by experimental environment to experimental data are reduced.
As a refinement, the method for calculating the arithmetic mean value, the maximum voltage value, the variance value, the integral value, the response value at the time when the variance is maximum and the response value at any time in the steady state stage of each sensor response curve of the ith sample in S200 is as follows:
the arithmetic mean of each sensor response curve for the ith sample is calculated using equation (2-2):
the peak value of each sensor response curve for the ith sample is calculated using equation (2-3):
the variance value of each sensor response curve of the ith sample is calculated by using the formula (2-4):
the integral value of each sensor response curve of the ith sample is calculated using equation (2-5):
the response value vector of each sensor response curve of the ith sample at the moment when the variance is maximum is calculated by adopting the formula (2-6):
response value at a certain random time t ═ t' in the steady state phase: y (t', i).
Wherein the content of the first and second substances,the arithmetic mean of the jth sensor response curve representing the ith sample, y (T, i) represents the voltage signal value T times the ith sample over the time period T,the peak, Var, of the jth sensor response curve representing the ith samplei,jVariance value, S, of the jth sensor response curve representing the ith samplei,jIntegral, Varl, of the jth sensor response curve representing the ith samplei,jRepresenting the response value of the jth sensor response curve of the ith sample at the moment when the variance is maximum; Δ t represents the argument increment, i.e. the time interval during which data is acquired once.
y (t, i) is a function of the response curve, which represents the response of the i-th sensor at time t.
The arithmetic mean value, the peak value and the variance are static characteristic parameters, the integral value, the response value at the moment with the maximum variance and the response value at any moment in a steady state stage are dynamic characteristic parameters, the combination of the selected static and dynamic characteristics has certain representativeness and can well represent the change range of a curve, and too many characteristics can increase the calculated amount of a neural network and delay the calculation speed.
Experimental verification
Three odor samples of a sample 1, a sample 2 and a sample 3 are respectively placed in a container, the three odor samples are sampled by a sampling device, and the sample 1 is tested for 20 times to obtain 20 data information of one sample. A total of 60(3 x 20) data samples were obtained for the 3 odors. Representative gas sensor response curves for 3 odors are shown in the figure:
although a certain effect is achieved in pattern recognition and classification methods applied to the field of gas recognition, such as KNN, SVM, RF, etc., the accuracy of the methods is reduced along with the increase of sample types, the collected data of different odor samples are subjected to data processing and feature extraction,
a K nearest neighbor classification method and a deep neural network method are designed, namely the method of the invention carries out intelligent odor identification and classification of three samples through comparison experiments.
The K nearest neighbor classification method does not need a training process, only needs to put the samples to be predicted into a space formed by the features X to calculate K samples closest to the samples, has a simple and common algorithm principle, does not need to be explained more here, and counts the class with the largest repetition degree of the class to which the samples to be detected belong as the target class of the samples to be recognized. The table below shows the confusion matrix for 3 odor recognition classes by the nearest neighbor classification method. The table shows that each odor type has the possibility of identifying errors, and the accuracy of the final calculation nearest neighbor classification method reaches 85 percent.
Sample 1 | Sample 2 | Sample 3 | Total up to | |
Sample 1 | 17 | 1 | 3 | 21 |
Sample 2 | 0 | 18 | 2 | 20 |
Sample 3 | 2 | 1 | 16 | 19 |
Total up to | 19 | 20 | 21 | 60 |
In the method, as the sample data amount is less, the training set and the test set are the same data set of the collected three odor samples, and after multiple parameter optimization and confusion matrix display, two samples 1 are misjudged as a sample 3, one sample 2 is misjudged as a sample 3, and two samples 3 are misjudged as a sample 1. Overall, the prediction effect of the deep neural network reaches an accuracy of 91.67%, which may be related to the insufficient fitting degree of the neural network training due to the insufficient training samples.
Sample 1 | Sample 2 | Sample 3 | Total up to | |
Sample 1 | 18 | 0 | 2 | 20 |
Sample 2 | 0 | 19 | 1 | 20 |
Sample 3 | 2 | 0 | 18 | 20 |
Total up to | 20 | 19 | 21 | 60 |
The deep neural network has a better ability to classify the three samples tested than the nearest neighbor and deep neural network classifiers. The output of the sensor array is discrete data, and a plurality of characteristics of multiple dimensions are extracted. The K-nearest neighbor algorithm needs to perform continuous return calculation on the whole data set in the operation process, and when the sample characteristics are more, the calculation complexity in the prediction process is quite large. The neural network adds a bias term to the output of the neuron and then carries out calculation through an activation function to complete de-linearization, the deep neural network has strong nonlinear processing capability, and the deep neural network adjusts the weight and the threshold value between an input layer and a hidden layer and between the hidden layer and an output layer by means of continuous error back propagation, so that the output error of the neural network is reduced.
The neural network is used for odor recognition and has the disadvantages that the number of samples needing to be trained is too large, enough abundant samples need to be collected for training in the using process, the same group of samples can be used for periodic training for multiple times if difficulty exists, and the sample set is continuously enriched in the subsequent prediction classification process.
Finally, the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all of them should be covered in the claims of the present invention.
Claims (4)
1. An intelligent olfactory recognition method for gas is characterized in that: the method comprises the following steps:
s100: collecting P kinds of known gases, and constructing an odor data sample library, wherein samples in the odor data sample library are sensor response data and real labels of the known gases, and the odor data sample library construction process comprises the following steps:
setting a time period as T, taking data values once at the same time interval in the time period T, extracting data values T times in total, and acquiring T data values by each sensor when the time period T is finished;
for the p known gas, detecting the known gas by using a jth gas sensor pair, transmitting a signal detected by the jth gas sensor out of an amplifying circuit to obtain a jth voltage signal value, and for the ith known gas, obtaining T voltage signal values in a time period T;
for the jth sensor of the pth known gas, a sensor response curve is drawn by taking time as a horizontal axis and t voltage signal values as a vertical axis, and if j is 1 and 2 … N, N sensor response curves are obtained for the ith known gas;
let P be 1,2 … P, then get the sensor response curves of P known gases;
s200: extracting signal characteristics of the ith sample in the odor data sample library and constructing a characteristic vector XiSaid feature vector XiThe specific expression of (a) is as follows:
wherein the content of the first and second substances,obtaining an arithmetic mean value for each sensor response curve of the ith sample, and obtaining N arithmetic mean values for N sensor response curves, wherein the arithmetic mean value vector is formed by the N arithmetic mean values;
obtaining a maximum voltage value for each sensor response curve of the ith sample as the peak vector of the sensor response curve of the ith sample, and obtaining N sensor response curvesObtaining N maximum voltage values by a line, wherein the peak value vector consists of the N maximum voltage values;
Variobtaining a variance value for each sensor response curve of the ith sample, and obtaining N variance values for N sensor response curves, wherein the variance vector is formed by the N variance values;
Siobtaining an integral value for each sensor response curve of the ith sample, and obtaining N integral values for N sensor response curves, wherein the integral value vector is formed by the N integral values;
Varliobtaining a response value of a sensor response curve of an ith sample at the moment of maximum variance, obtaining a response value of each sensor response curve of the ith sample at the moment of maximum variance, obtaining N response values of the sensor response curves at the moment of maximum variance, wherein the response value vector at the moment of maximum variance is formed by the N response values at the moment of maximum variance;
obtaining a response value vector of a sensor response curve of an ith sample at any moment in a steady-state stage, wherein each sensor response curve of the ith sample obtains a response value at any moment in the steady-state stage, N sensor response curves obtain N response values at any moment in the steady-state stage, and the response value vector at any moment in the steady-state stage is formed by the N response values at any moment in the steady-state stage;
s300: constructing a gas intelligent recognition model, wherein the gas intelligent recognition model uses a deep neural network framework, and the specific expression is as follows:
where i is 1,2, …, m, j is 1,2The l-1 layer has m neuron nodes, the l-th layer has n neuron nodes, the superscript l is the number of layers of the neural network, and wjiConnecting the ith node of the previous layer with the jth node of the next layer,is the output of the ith node of the l-1 st layer,is the output of the jth node of the l-th layer,is the threshold value of the jth node of the l layer, wlWeight matrix of the l-th layer n x m, blA threshold vector matrix of the ith layer n x 1, wherein g (-) is an activation function;
s400: training the intelligent gas recognition model established in the step S300, wherein the specific steps are as follows:
s410: setting a weight value with an additional momentum factor, a threshold value with the additional momentum factor and an adaptive learning rate, wherein the expression of the weight value with the additional momentum factor is as follows:
Δw(k+1)=(1-μ)ηδ(k)+μΔw(k) (4-1)
the expression for the threshold with the additional momentum factor is as follows:
Δb(k+1)=(1-μ)ηδ+μΔb(k) (4-2)
the expression for the adaptive learning rate is as follows:
wherein k is the training times; mu is a momentum factor, E (k) is the k-th error sum of squares, E (k +1) is the k + 1-th error sum of squares, Δ w (k) is a weight adjustment amount of the k-th iteration, η is a learning rate, η (k) is an adaptive learning rate of the k-th iteration, δ (k) represents a partial derivative of an error function to neurons of an output layer, Δ b (k +1) represents a threshold adjustment amount of the k + 1-th iteration, and Δ b (k) represents a threshold adjustment amount of the k-th iteration;
s420: taking the characteristic vector X of the sample as the input of an intelligent gas identification model, and taking the output of the intelligent gas identification model as a gas type prediction label of the sample;
s430: initially assigning values to TP, TN, FP and FN;
if the sample belongs to the gas sample library and the predicted label of the sample is consistent with the real label, then TP is TP + 1;
if the sample belongs to the gas sample bank, then TN ═ TN + 1;
if the sample belongs to the gas sample library and the predicted label of the sample is inconsistent with the real label, then FP is FP + 1;
if the sample does not belong to the gas sample library, labeling FN + 1;
s440: repeating S410-S430, and traversing all samples to obtain values of TP, TN, FP and FN;
s450: the accuracy is calculated according to the formula (4-4):
wherein, Accuracy represents the prediction Accuracy, TP + TN represents the number of correctly predicted samples, and TP + TN + FP + FN represents the total number of samples;
s460: setting an accuracy threshold, stopping training when the prediction accuracy reaches or reaches the accuracy threshold to obtain a trained gas intelligent recognition model, or else, reversely propagating and updating parameters of the gas intelligent recognition model and returning to the step S410 to continue training;
s500: and (4) extracting the signal characteristics of the gas to be detected, constructing a characteristic vector X, inputting the X into the trained intelligent gas identification model obtained in the step S460, and outputting a predicted gas type label of the gas to be detected.
2. The intelligent olfactory identification method as claimed in claim 1 wherein: in S100, for a jth sensor of a pth known gas, a sensor response curve is plotted with time as a horizontal axis and t voltage signal values as a vertical axis, and when j is 1,2 … N, N sensor response curves are obtained for an ith known gas;
and performing high-frequency signal removing processing on the response curves of the N sensors, and labeling the gas type labels.
3. An intelligent olfactory identification method as claimed in claim 1 or claim 2 wherein: the method for calculating the arithmetic mean value, the maximum voltage value, the variance value, the integral value, the response value at the moment when the variance is maximum and the response value at any moment in the steady-state stage of each sensor response curve of the ith sample in S200 is as follows:
the arithmetic mean of each sensor response curve for the ith sample is calculated using equation (2-2):
the peak value of each sensor response curve for the ith sample is calculated using equation (2-3):
the variance value of each sensor response curve of the ith sample is calculated by using the formula (2-4):
the integral value of each sensor response curve of the ith sample is calculated using equation (2-5):
the response value vector of each sensor response curve of the ith sample at the moment when the variance is maximum is calculated by adopting the formula (2-6):
wherein the content of the first and second substances,the arithmetic mean of the jth sensor response curve representing the ith sample, y (T, i) represents the voltage signal value T times the ith sample over the time period T,the peak, Var, of the jth sensor response curve representing the ith samplei,jVariance value, S, of the jth sensor response curve representing the ith samplei,jIntegral, Varl, of the jth sensor response curve representing the ith samplei,jAnd (3) representing the response value of the jth sensor response curve of the ith sample at the moment when the variance is maximum.
4. The intelligent olfactory identification method as claimed in claim 3 wherein the threshold of accuracy in S460 is 99.5%.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110656610.7A CN113378935B (en) | 2021-06-11 | 2021-06-11 | Intelligent olfactory sensation identification method for gas |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110656610.7A CN113378935B (en) | 2021-06-11 | 2021-06-11 | Intelligent olfactory sensation identification method for gas |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113378935A true CN113378935A (en) | 2021-09-10 |
CN113378935B CN113378935B (en) | 2022-07-01 |
Family
ID=77574259
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110656610.7A Active CN113378935B (en) | 2021-06-11 | 2021-06-11 | Intelligent olfactory sensation identification method for gas |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113378935B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116026787A (en) * | 2023-03-29 | 2023-04-28 | 湖南汇湘轩生物科技股份有限公司 | Essence grade detection method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108416178A (en) * | 2018-05-02 | 2018-08-17 | 南京航空航天大学 | A kind of mechanical elastic vehicle wheel Design of Structural parameters method |
CN108760829A (en) * | 2018-03-20 | 2018-11-06 | 天津大学 | A kind of electronic nose recognition methods based on bionical olfactory bulb model and convolutional neural networks |
CN109102005A (en) * | 2018-07-23 | 2018-12-28 | 杭州电子科技大学 | Small sample deep learning method based on shallow Model knowledge migration |
CN111340132A (en) * | 2020-03-10 | 2020-06-26 | 南京工业大学 | Machine olfaction mode identification method based on DA-SVM |
-
2021
- 2021-06-11 CN CN202110656610.7A patent/CN113378935B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108760829A (en) * | 2018-03-20 | 2018-11-06 | 天津大学 | A kind of electronic nose recognition methods based on bionical olfactory bulb model and convolutional neural networks |
CN108416178A (en) * | 2018-05-02 | 2018-08-17 | 南京航空航天大学 | A kind of mechanical elastic vehicle wheel Design of Structural parameters method |
CN109102005A (en) * | 2018-07-23 | 2018-12-28 | 杭州电子科技大学 | Small sample deep learning method based on shallow Model knowledge migration |
CN111340132A (en) * | 2020-03-10 | 2020-06-26 | 南京工业大学 | Machine olfaction mode identification method based on DA-SVM |
Non-Patent Citations (3)
Title |
---|
CHUCHU ZHU等: "the study of multimodal gas recognition algorithm based on machine olfaction", 《2016 IEEE INTERNATIONAL CONFERENCE ON CONSUMER ELECTRONICS-CHINA》 * |
SIGERU OMATU等: "smells classification for human breath using a layered neural network", 《DISTRIBUTED COMPUTING AND ARTIFICIAL INTELLIGENCE,13TH INTERNATIONAL CONFERENCE》 * |
宋洪庆等: "油气资源开发的大数据智能平台及应用分析", 《工程科学学报》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116026787A (en) * | 2023-03-29 | 2023-04-28 | 湖南汇湘轩生物科技股份有限公司 | Essence grade detection method and system |
CN116026787B (en) * | 2023-03-29 | 2023-07-21 | 湖南汇湘轩生物科技股份有限公司 | Essence grade detection method and system |
Also Published As
Publication number | Publication date |
---|---|
CN113378935B (en) | 2022-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103544392B (en) | Medical science Gas Distinguishing Method based on degree of depth study | |
CN111666169B (en) | Improved isolated forest algorithm and Gaussian distribution-based combined data anomaly detection method | |
CN108596327B (en) | Seismic velocity spectrum artificial intelligence picking method based on deep learning | |
CN110166484A (en) | A kind of industrial control system intrusion detection method based on LSTM-Attention network | |
CN105678332A (en) | Converter steel-making endpoint determination method and system based on flame image CNN recognizing and modeling process | |
CN109919241A (en) | Hyperspectral unknown class target detection method based on probability model and deep learning | |
CN112580749B (en) | Intelligent fire detection method based on machine olfaction technology | |
CN112714130A (en) | Big data-based adaptive network security situation sensing method | |
CN111914897A (en) | Fault diagnosis method based on twin long-short time memory network | |
CN115811440B (en) | Real-time flow detection method based on network situation awareness | |
CN115348074A (en) | Deep space-time mixed cloud data center network flow real-time detection method | |
CN113378935B (en) | Intelligent olfactory sensation identification method for gas | |
CN112329974A (en) | LSTM-RNN-based civil aviation security event behavior subject identification and prediction method and system | |
CN115563546A (en) | Intelligent gas smell identification method, system, medium, equipment and terminal | |
CN116633601A (en) | Detection method based on network traffic situation awareness | |
CN111079348A (en) | Method and device for detecting slowly-varying signal | |
Zhang | Deepmal: A CNN-LSTM model for malware detection based on dynamic semantic behaviours | |
CN116930042B (en) | Building waterproof material performance detection equipment and method | |
CN117350364A (en) | Knowledge distillation-based code pre-training model countermeasure sample generation method and system | |
CN115598164B (en) | Machine learning integrated soil heavy metal concentration detection method and system | |
CN109840386B (en) | Damage identification method based on factor analysis | |
CN114970745B (en) | Intelligent security and environment big data system of Internet of things | |
CN116930759A (en) | Power battery voltage time sequence abnormality detection method, electronic device and storage medium | |
CN114863286B (en) | Mixed waste plastic classification method based on multi-algorithm collaborative optimization | |
CN115795353A (en) | Underground metal target classification method and system based on unbalanced data set |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |