Disclosure of Invention
The embodiment of the invention provides a method for identifying the smell of a bionic electronic nose based on an MOS gas sensor array, which can improve the accuracy of identifying the smell of gas to be detected.
The embodiment of the invention provides a smell recognition method of a bionic electronic nose based on an MOS gas sensor array, which comprises the following steps:
acquiring m-dimensional response value data obtained by detecting gas samples with different concentrations by an MOS gas sensor array of an m-dimensional array, and forming odor fingerprint samples of the gas samples with different concentrations;
training to obtain a cyclic neural network model for identifying the gas types according to the odor fingerprint samples of the gas samples with the concentrations and the odor types of the gas samples with the concentrations;
acquiring m-dimensional response value data obtained by detecting the gas to be detected by an MOS gas sensor array of an m-dimensional array, and forming an odor fingerprint of the gas to be detected;
calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in a preset odor fingerprint standard library;
if the similarity result is greater than the preset threshold value, inputting the odor fingerprint of the gas to be tested into the trained cyclic neural network model to obtain the odor type of the gas to be tested.
As an improvement of the above scheme, the recurrent neural network includes an input layer, a hidden layer and an output layer; the input layer has n neurons corresponding to n gas samples; the number of output layers is the number n of gas types.
As an improvement of the above solution, the training to obtain the cyclic neural network model for identifying the gas type according to the odor fingerprint sample of the gas sample with each concentration and the odor type of the gas sample with each concentration includes:
inputting odor fingerprint samples of the gas samples with various concentrations into the cyclic neural network to obtain predicted odor classification results of the gas samples;
determining a loss value of the recurrent neural network according to the predicted odor classification result of each gas sample and the odor type of each gas sample;
updating parameters of the recurrent neural network through a back propagation algorithm according to the loss value;
and stopping training when the loss value reaches a preset first threshold value or the iteration number reaches a preset second threshold value, and obtaining a trained circulating neural network model for identifying the gas type.
As an improvement of the above solution, the calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in the preset odor fingerprint standard library includes:
and calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in a preset odor fingerprint standard library by using a cosine similarity algorithm.
As an improvement of the above solution, after obtaining the odor type of the gas to be measured, the method further includes:
the control display displays the odor type of the gas to be measured.
Another embodiment of the present invention correspondingly provides a device for identifying smell of a bionic electronic nose based on a MOS gas sensor array, including:
the sample acquisition module is used for acquiring m-dimensional response value data obtained by detecting gas samples with different concentrations by the MOS gas sensor array of the m-dimensional array to form odor fingerprint samples of the gas samples with different concentrations;
the training module is used for training to obtain a cyclic neural network model for identifying the gas types according to the odor fingerprint samples of the gas samples with the concentrations and the odor types of the gas samples with the concentrations;
the data acquisition module is used for acquiring m-dimensional response value data obtained by detecting the gas to be detected by the MOS gas sensor array of the m-dimensional array to form odor fingerprints of the gas to be detected;
the similarity calculation module is used for calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in the preset odor fingerprint standard library;
and the identification module is used for inputting the odor fingerprint of the gas to be tested into the trained cyclic neural network model to obtain the odor type of the gas to be tested if the similarity result is greater than a preset threshold value in the similarity results obtained through calculation.
As an improvement of the above solution, the training module is specifically configured to:
inputting odor fingerprint samples of the gas samples with various concentrations into the cyclic neural network to obtain predicted odor classification results of the gas samples;
determining a loss value of the recurrent neural network according to the predicted odor classification result of each gas sample and the odor type of each gas sample;
updating parameters of the recurrent neural network through a back propagation algorithm according to the loss value;
and stopping training when the loss value reaches a preset first threshold value or the iteration number reaches a preset second threshold value, and obtaining a trained circulating neural network model for identifying the gas type.
As an improvement of the above solution, the similarity calculation module is specifically configured to:
and calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in a preset odor fingerprint standard library by using a cosine similarity algorithm.
Another embodiment of the present invention provides a device for identifying smell of a bionic electronic nose based on a MOS gas sensor array, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the method for identifying smell of a bionic electronic nose based on a MOS gas sensor array according to the embodiment of the present invention when executing the computer program.
Another embodiment of the present invention provides a storage medium, where the computer readable storage medium includes a stored computer program, and when the computer program runs, the device where the computer readable storage medium is located is controlled to execute the method for identifying smell of a bionic electronic nose based on a MOS gas sensor array according to the embodiment of the present invention.
Compared with the prior art, one of the technical schemes has the following advantages:
training to obtain a cyclic neural network model for identifying gas types by utilizing the odor fingerprint samples of the gas samples with the concentrations and the odor types of the gas samples with the concentrations; then acquiring smell fingerprints acquired by the MOS gas sensor array for the gas to be detected, and comparing the smell fingerprints with the similarity of all standard smell fingerprints in the smell fingerprint standard library; if the similarity result is larger than the preset threshold value, the gas to be detected is the target gas needing to be identified by smell, and at the moment, the smell fingerprint of the gas to be detected is input into the trained cyclic neural network model to obtain the smell type of the gas to be detected. Therefore, according to the embodiment of the invention, the sample of the target gas with different concentrations is used for training the cyclic neural network model, then, whether the gas to be detected contains the target gas or not is determined based on the similarity comparison of the smell fingerprints of the gas to be detected and the standard gas, and if so, the trained cyclic neural network model is used for identifying the smell of the gas to be detected, so that the accuracy of identifying the smell of the gas to be detected is improved.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flow chart of a method for identifying smell of a bionic electronic nose based on a MOS gas sensor array according to an embodiment of the present invention is provided, where the method for identifying smell of a bionic electronic nose based on a MOS gas sensor array includes steps S10 to S14:
s10, acquiring m-dimensional response value data obtained by detecting gas samples with different concentrations by an MOS gas sensor array of an m-dimensional array, and forming odor fingerprint samples of the gas samples with different concentrations;
the MOS gas sensor array can be a sensor array of gas sensitive materials integrated with 32/64/128 channels respectively, and can output data of 32/64/128 dimensions for different gas samples to form odor fingerprints. It is understood that the gas sample may be a mixed gas (may be a mixture of 1 or more target gases, or a mixture of 1 or more target gases and other non-target gases, where the target gases may be the gases to be measured in an actual scenario).
S11, training to obtain a cyclic neural network model for identifying the gas types according to the odor fingerprint samples of the gas samples with the concentrations and the odor types of the gas samples with the concentrations;
specifically, the recurrent neural network comprises an input layer, a hidden layer and an output layer; the input layer has n neurons corresponding to n gas samples; the number of output layers is the number n of gas types.
S12, acquiring m-dimensional response value data obtained by detecting the gas to be detected by an MOS gas sensor array of an m-dimensional array, and forming an odor fingerprint of the gas to be detected;
s13, calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in a preset odor fingerprint standard library;
and S14, if the similarity result is greater than a preset threshold value, inputting the odor fingerprint of the gas to be tested into the trained cyclic neural network model to obtain the odor type of the gas to be tested.
According to the embodiment of the invention, the sample of the target gas with different concentrations is used for training the cyclic neural network model, then, whether the gas to be detected contains the target gas or not is determined based on the similarity comparison of the smell fingerprints of the gas to be detected and the standard gas, if so, the trained cyclic neural network model is used for identifying the smell of the gas to be detected, so that the accuracy of identifying the smell of the gas to be detected is improved.
In one embodiment, the step S11 includes steps S110 to S113:
s110, inputting smell fingerprint samples of the gas samples with various concentrations into the cyclic neural network to obtain a predicted smell classification result of each gas sample;
s111, determining a loss value of the circulating neural network according to the predicted smell classification result of each gas sample and the smell type of each gas sample;
s112, updating parameters of the recurrent neural network through a back propagation algorithm according to the loss value;
and S113, stopping training when the loss value reaches a preset first threshold value or the iteration number reaches a preset second threshold value, and obtaining a trained cyclic neural network model for identifying the gas type.
In this embodiment, the loss function and the loss value of the cyclic neural network may be determined according to the predicted smell classification result of each gas sample and the smell type of each gas sample, and the parameters of the cyclic neural network may be updated according to the loss value by using a back propagation algorithm, so that the cyclic neural network model may be optimized, and the accuracy of the cyclic neural network model may be improved. It can be appreciated that the specific training process of the recurrent neural network model and the model parameter optimization process using the loss value of the loss function can be specifically referred to the prior art, and will not be described herein.
As an example, the loss function of the recurrent neural network is:
wherein,representing the true type of tn concentration gas sample, +.>Represents the predicted value of the recurrent neural network, and N represents the total number of concentrations of the gas sample.
In one embodiment, the calculating the similarity between the odor fingerprint of the gas to be measured and each standard odor fingerprint in the preset odor fingerprint standard library includes:
and calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in a preset odor fingerprint standard library by using a cosine similarity algorithm.
In this embodiment, a cosine similarity algorithm is used to perform similarity calculation and comparison on the odor fingerprints of the gas to be measured and the standard gas, so as to determine whether the gas to be measured contains the target gas. It can be appreciated that the similarity calculation process of the cosine similarity algorithm can refer to the prior art, and will not be described herein.
In one embodiment, after obtaining the odor type of the gas to be measured, the method further comprises:
the control display displays the odor type of the gas to be measured.
In this embodiment, the identified odor type of the gas to be measured is displayed, so that people can know the odor type of the gas to be measured conveniently.
Referring to fig. 2, a schematic structural diagram of a device for identifying smell of a bionic electronic nose based on a MOS gas sensor array according to an embodiment of the present invention includes:
the sample acquisition module 10 is used for acquiring m-dimensional response value data obtained by detecting the gas samples with different concentrations by the MOS gas sensor array of the m-dimensional array to form odor fingerprint samples of the gas samples with different concentrations;
the training module 11 is used for training to obtain a cyclic neural network model for identifying the gas types according to the odor fingerprint samples of the gas samples with the concentrations and the odor types of the gas samples with the concentrations;
the data acquisition module 12 is used for acquiring m-dimensional response value data obtained by detecting the gas to be detected by the MOS gas sensor array of the m-dimensional array to form an odor fingerprint of the gas to be detected;
the similarity calculation module 13 is used for calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in the preset odor fingerprint standard library;
and the identification module 14 is configured to input the odor fingerprint of the gas to be tested into the trained recurrent neural network model to obtain the odor type of the gas to be tested if the similarity result is greater than the preset threshold value.
According to the embodiment of the invention, the sample of the target gas with different concentrations is used for training the cyclic neural network model, then, whether the gas to be detected contains the target gas or not is determined based on the similarity comparison of the smell fingerprints of the gas to be detected and the standard gas, if so, the trained cyclic neural network model is used for identifying the smell of the gas to be detected, so that the accuracy of identifying the smell of the gas to be detected is improved.
In one embodiment, the training module is specifically configured to:
inputting odor fingerprint samples of the gas samples with various concentrations into the cyclic neural network to obtain predicted odor classification results of the gas samples;
determining a loss value of the recurrent neural network according to the predicted odor classification result of each gas sample and the odor type of each gas sample;
updating parameters of the recurrent neural network through a back propagation algorithm according to the loss value;
and stopping training when the loss value reaches a preset first threshold value or the iteration number reaches a preset second threshold value, and obtaining a trained circulating neural network model for identifying the gas type.
In one embodiment, the similarity calculation module is specifically configured to:
and calculating the similarity between the odor fingerprint of the gas to be detected and each standard odor fingerprint in a preset odor fingerprint standard library by using a cosine similarity algorithm.
In one embodiment, the recurrent neural network includes an input layer, a hidden layer, and an output layer; the input layer has n neurons corresponding to n gas samples; the number of output layers is the number n of gas types.
In one embodiment, after obtaining the odor type of the gas to be measured, the method further comprises:
the control display displays the odor type of the gas to be measured.
It can be understood that, the embodiment of the odor recognition device of the bionic electronic nose based on the MOS gas sensor array may be referred to the relevant content of the embodiment of the odor recognition method of the bionic electronic nose based on the MOS gas sensor array, which is not described herein.
The embodiment of the invention provides a smell recognition device of a bionic electronic nose based on an MOS gas sensor array. The smell recognition device of the bionic electronic nose based on the MOS gas sensor array of the embodiment comprises: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a scent recognition program for a biomimetic electronic nose based on a MOS gas sensor array. The steps in the embodiment of the smell identification method of the bionic electronic nose based on the MOS gas sensor array are realized when the processor executes the computer program. Or the processor executes the computer program to realize the functions of the modules/units in the embodiment of the bionic electronic nose smell recognition device based on the MOS gas sensor array.
The computer program may be divided into one or more modules/units, which are stored in the memory and executed by the processor to accomplish the present invention, for example. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program in the scent recognition device of the MOS gas sensor array based biomimetic electronic nose.
The odor recognition equipment of the bionic electronic nose based on the MOS gas sensor array can be computing equipment such as a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The odor identification device of the bionic electronic nose based on the MOS gas sensor array can comprise, but is not limited to, a processor and a memory. It will be understood by those skilled in the art that the schematic diagram is merely an example of the smell recognition device of the bionic electronic nose based on the MOS gas sensor array, and does not constitute a limitation of the smell recognition device of the bionic electronic nose based on the MOS gas sensor array, and may include more or fewer components than those illustrated, or combine certain components, or different components, for example, the smell recognition device of the bionic electronic nose based on the MOS gas sensor array may further include an input/output device, a network access device, a bus, and the like.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general processor may be a microprocessor or the processor may also be any conventional processor, etc., and the processor is a control center of the odor identification device of the bionic electronic nose based on the MOS gas sensor array, and connects various parts of the odor identification device of the entire bionic electronic nose based on the MOS gas sensor array by using various interfaces and lines.
The memory may be used to store the computer program and/or module, and the processor may implement various functions of the scent recognition device of the bionic electronic nose based on the MOS gas sensor array by running or executing the computer program and/or module stored in the memory and invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
Wherein the module/unit integrated with the odor recognition device of the bionic electronic nose based on the MOS gas sensor array can be stored in a computer readable storage medium if the module/unit is realized in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that the above-described apparatus embodiments are merely illustrative, and the units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the invention, the connection relation between the modules represents that the modules have communication connection, and can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.