Disclosure of Invention
In order to solve the problems that in the existing mixed gas photoacoustic spectrometry detection technology, identification of overlapping peaks in photoacoustic spectrometry of mixed gas is difficult, and the existing identification method is high in cost and low in equipment stability, the invention provides a mixed gas photoacoustic spectrometry identification method based on deep learning, which comprises the following steps: acquiring photoacoustic spectrums of a plurality of mixed gases, and recording the photoacoustic spectrums as first photoacoustic spectrums; carrying out Fourier deconvolution and bilateral filtering on the plurality of first photoacoustic spectrums in sequence to obtain a plurality of second photoacoustic spectrums; determining the order of the derivative number of the single peak according to the number of the single peaks contained in the overlapped peak in each second photoacoustic spectrum, so that the number of the overlapped peaks in the derivative photoacoustic spectrum of each second photoacoustic spectrum is lower than a threshold value; extracting the maximum absorption position, the absorption depth, the symmetry and the corresponding gas information of each wave band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof, and mapping the maximum absorption position, the absorption depth and the symmetry into a multi-dimensional vector; the gas information includes a concentration of a gas; respectively taking the first photoacoustic spectrum and the multi-dimensional vector as a sample and a label to construct a sample data set; training a target recognition neural network by using the sample data set until the error is lower than a threshold value and tends to be stable, and obtaining a trained target recognition neural network; inputting a photoacoustic spectrum to be identified into a trained target identification neural network to obtain identification information in the photoacoustic spectrum; the identification information includes the composition of the mixed gas, the maximum absorption position of the absorption peak, the absorption depth, and the degree of symmetry.
In some embodiments of the present invention, the sequentially performing fourier deconvolution and bilateral filtering on a plurality of first photoacoustic spectra to obtain a plurality of second photoacoustic spectra includes: carrying out Fourier deconvolution on overlapped peaks in the first photoacoustic spectrums, carrying out bilateral filtering on the first photoacoustic spectrums after the Fourier deconvolution to obtain second photoacoustic spectrums; the calculation method of the bilateral filtering is represented as follows:
,
g(i,j)represents an output point;
S(i,j)is meant to refer to
(i,j)A range of sizes of (2N +1) at the center;
f(k,l)a plurality of input points representing photoacoustic spectra;
w(i,j,k,l)representing the values calculated by two gaussian functions.
In some embodiments of the present invention, the determining the order of the derivative number according to the number of the single peaks included in the overlapped peak in each second photoacoustic spectrum so that the number of the overlapped peaks in the derivative photoacoustic spectrum of each second photoacoustic spectrum is lower than the threshold value comprises the following steps: taking the order of the initial derivative number as 1, counting the number of single peaks contained in each overlapped peak in each second photoacoustic spectrum, and deriving the overlapped peak containing the most single peaks: if the number of the single peaks obtained by derivation of the overlapped peak containing the most single peaks is larger than or equal to a threshold value, taking the order of the derivative as the order of the derivative of each second photoacoustic spectrum; and if the number of the superposed peaks obtained by derivation of the superposed peaks containing the maximum number of the single peaks is smaller than the threshold, gradually increasing the order of the derivative according to the step length of 1 until the number of the superposed peaks obtained by derivation is larger than or equal to the threshold, and taking the order of the derivative as the order of the derivative of each second photoacoustic spectrum.
In some embodiments of the present invention, the extracting and mapping the maximum absorption position, the absorption depth, the symmetry, and the corresponding gas information of each wavelength band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof into the multidimensional vector comprises the steps of: extracting the maximum absorption position, the absorption depth, the symmetry and the corresponding gas information of each wave band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof; the gas information comprises a concentration or volume fraction of a gas; taking the maximum absorption position, the absorption depth and the symmetry degree of each wave band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof as a first feature vector; the corresponding gas information is used as a second eigenvector; and fusing the first feature vector and the second feature vector and mapping the first feature vector and the second feature vector into a multi-dimensional vector.
In some embodiments of the present invention, the target recognition neural network includes a first YOLO neural network and a second YOLO neural network, a full connection layer of the first YOLO neural network and the second YOLO neural network being connected to each other, the first YOLO neural network identifying a component of the mixed gas; the second YOLO neural network is used for identifying the maximum absorption position, the depth and the symmetry degree of an absorption peak. Preferably, the second YOLO neural network is a YOLO V4 neural network.
The invention provides a gas photoacoustic spectrum recognition device based on deep learning, which comprises an acquisition module, a determination module, an extraction module, a training module and a recognition module, wherein the acquisition module is used for acquiring photoacoustic spectra of a plurality of mixed gases and recording the photoacoustic spectra as first photoacoustic spectra; carrying out Fourier deconvolution and bilateral filtering on the plurality of first photoacoustic spectrums in sequence to obtain a plurality of second photoacoustic spectrums; the determining module is used for determining the order of the derivative number of the single peak according to the number of the single peaks contained in the overlapped peak in each second photoacoustic spectrum, so that the number of the overlapped peaks in the derivative photoacoustic spectrum of each second photoacoustic spectrum is lower than a threshold value; the extraction module is used for extracting the maximum absorption position, the absorption depth, the symmetry degree and the corresponding gas information of each wave band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof, and mapping the maximum absorption position, the absorption depth, the symmetry degree and the corresponding gas information into a multidimensional vector; the gas information includes a concentration of a gas; the training module is used for respectively taking the first photoacoustic spectrum and the multi-dimensional vector as a sample and a label to construct a sample data set; training a target recognition neural network by using the sample data set until the error is lower than a threshold value and tends to be stable, and obtaining a trained target recognition neural network; the identification module is used for inputting the photoacoustic spectrum to be identified into a trained target identification neural network to obtain identification information in the photoacoustic spectrum; the identification information includes the composition of the mixed gas, the maximum absorption position of the absorption peak, the absorption depth, and the degree of symmetry.
In some embodiments of the present invention, the identification means includes a first identification means for identifying a component of the mixed gas of photoacoustic spectroscopy; the second identification module is used for identifying the maximum absorption position, the depth and the symmetry of the absorption peak in the photoacoustic spectrum.
In a third aspect of the present invention, there is provided an electronic device comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the deep learning-based mixed gas photoacoustic spectrum identification method provided by the first aspect of the present invention.
In a fourth aspect of the present invention, a computer readable medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the deep learning-based mixed gas photoacoustic spectrum identification method provided by the first aspect of the present invention.
The invention has the beneficial effects that:
1. firstly, the Fourier deconvolution of the photoacoustic spectrum preliminarily separates overlapped peaks, and bilateral filtering sharpens waveform edges while retaining edge characteristics, so that the definition of the photoacoustic spectrum is improved; separating the overlapped peaks into a plurality of single peaks by a derivative method; then, the maximum absorption position, the absorption depth, the symmetry and the corresponding gas information are used as characteristics to extract the characteristics of the photoacoustic spectrum, so that the data dimensionality is reduced while the main characteristics of the photoacoustic spectrum of the mixed gas are ensured to be covered;
the YOLO neural network is used as a fast and lightweight target identification network, can identify or output a plurality of targets and related information, and has the characteristics of fast identification, high accuracy and the like;
3. because the neural network model is adopted for spectrum identification, compared with the traditional analysis method, the identification speed is higher; because the detection conditions are relaxed, the device does not depend on the modulation of an excitation light source or an optical filter and other equipment, the identification cost is reduced, and the stability of an identification device or a system is improved. With the improvement of future hardware computing power, the real-time accurate measurement of the components detected by the mixed gas can be realized.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, in a first aspect of the present invention, there is provided a mixed gas photoacoustic spectrum identification method based on deep learning, including the following steps: s101, acquiring photoacoustic spectrums of a plurality of mixed gases, and recording the photoacoustic spectrums as first photoacoustic spectrums; carrying out Fourier deconvolution and bilateral filtering on the plurality of first photoacoustic spectrums in sequence to obtain a plurality of second photoacoustic spectrums; s102, determining the order of the derivative number of the superposed peaks according to the number of single peaks contained in the superposed peaks in each second photoacoustic spectrum, so that the number of the superposed peaks in the derivative photoacoustic spectrum of each second photoacoustic spectrum is lower than a threshold value; s103, extracting the maximum absorption position, the absorption depth, the symmetry and the corresponding gas information of each wave band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof, and mapping the maximum absorption position, the absorption depth, the symmetry and the corresponding gas information into a multi-dimensional vector; the gas information includes a concentration of a gas; s104, the first photoacoustic spectrum and the multi-dimensional vector are respectively used as a sample and a label to construct a sample data set; training a target recognition neural network by using the sample data set until the error is lower than a threshold value and tends to be stable, and obtaining a trained target recognition neural network; s105, inputting the photoacoustic spectrum to be identified into a trained target identification neural network to obtain identification information in the photoacoustic spectrum; the identification information includes the composition of the mixed gas, the maximum absorption position of the absorption peak, the absorption depth, and the degree of symmetry. The above-mentioned acquisition of the photoacoustic spectra of the plurality of mixed gases may be derived from a history database (HITRAN) in which measurement has been completed or actual measurement. Optionally, the bilateral filtering is replaced by a filtering method based on mallat, such as wavelet transform and median filtering.
It can be understood that when the recognition model of the invention is used for recognizing the photoacoustic spectrum, the limitation that the traditional recognition method of the photoacoustic spectrum depends on a specific excitation light source and the modulation equipment thereof and the number of photoacoustic cells is broken through: in the traditional gas measurement, in order to ensure high precision, gas is introduced into different photoacoustic cells, and the concentration of the gas is respectively measured through different optical filters. Therefore, the mixed gas includes at least one of water, hydrogen, methane, ethane, ethylene, acetylene, carbon monoxide, carbon dioxide, oxygen, or nitrogen.
In step S101 of some embodiments of the present invention, performing fourier deconvolution and bilateral filtering on a plurality of first photoacoustic spectra in sequence to obtain a plurality of second photoacoustic spectra includes: and carrying out bilateral filtering on the first photoacoustic spectrums subjected to the Fourier deconvolution to obtain second photoacoustic spectrums. The calculation method of the bilateral filtering is represented as follows:
,
g(i,j)represents an output point;
S(i,j)is meant to refer to
(i,j)A range of sizes of (2N +1) at the center;
f(k,l)a plurality of input points representing photoacoustic spectra;
w(i,j, k,l)representing the values calculated by two gaussian functions.
Referring to FIG. 2, schematically, H2O and CO2At 3600cm-1To 3640cm-1In the wavelength band, a plurality of overlapping peaks occur and are difficult to distinguish, which results in difficulty in photoacoustic spectrum identification or low identification accuracy, and thus it is necessary to perform peak separation (separation of 1 or more overlapping peaks into a plurality of single peaks) or separate analysis of the overlapping peaks. In step S102 of some embodiments of the present invention, the determining the derivative of each second photoacoustic spectrum according to the number of the single peaks included in the overlapped peak in the second photoacoustic spectrum such that the number of the overlapped peaks in the derivative of each second photoacoustic spectrum is lower than the threshold value includes: taking the order of the initial derivative as 1, counting the number of single peaks contained in each overlapped peak in each second photoacoustic spectrum, and deriving the overlapped peak containing the most single peaks (only 1 peak in 1 wave band): if the number of single peaks obtained by derivation of the overlapping peaks including the maximum single peak is greater than or equal to the thresholdA value that takes the order of the derivative as the order of the derivative of each second photoacoustic spectrum; and if the number of the superposed peaks obtained by derivation of the superposed peaks containing the maximum number of the single peaks is smaller than the threshold, gradually increasing the order of the derivative according to the step length of 1 until the number of the superposed peaks obtained by derivation is larger than or equal to the threshold, and taking the order of the derivative as the order of the derivative of each second photoacoustic spectrum.
To better extract the features of the photoacoustic spectra, in step S103 of some embodiments of the present invention, extracting the maximum absorption position, the absorption depth, the symmetry, and the corresponding gas information of each wavelength band in each second photoacoustic spectrum and its derivative photoacoustic spectrum, and mapping them into a multidimensional vector comprises the steps of: extracting the maximum absorption position, the absorption depth, the symmetry and the corresponding gas information of each wave band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof; the gas information comprises a concentration or volume fraction of a gas; taking the maximum absorption position, the absorption depth and the symmetry degree of each wave band in each second photoacoustic spectrum and the derivative photoacoustic spectrum thereof as a first feature vector; the corresponding gas information is used as a second eigenvector; and fusing the first feature vector and the second feature vector and mapping the first feature vector and the second feature vector into a multi-dimensional vector. The absorption depth refers to a distance between a highest point (trough) of absorption intensity or absorption coefficient and the normalized envelope line within a certain waveband; the absorption width refers to the spectral bandwidth of half of the maximum absorption depth; the symmetry degree refers to the ratio of the area of the right region to the area of the left region, which is defined by the vertical line of the absorption position (usually, a single peak in a certain wave band is selected as a reference point).
Optionally, in addition to the maximum absorption position, the absorption depth, and the symmetry characteristic, the first feature vector further includes one or more characteristic parameters that can characterize the photoacoustic spectrum, such as an absorption width, an area enclosed by a waveform and a coordinate axis, a waveform slope, a slope direction, or an absorption index.
In some embodiments of the present invention, the target recognition neural network comprises a first YOLO neural network and a second YOLO (you Only Look one) neural network, the fully connected layer of the first YOLO neural network being interconnected with the second YOLO neural network, the first YOLO neural network identifying the components of the mixed gas; the second YOLO neural network is used for identifying the maximum absorption position, the depth and the symmetry degree of an absorption peak. Preferably, the second YOLO neural network is a YOLO V4 neural network. Optionally, the first and second neural networks are a YOLO V3 neural network or a YOLO V5 neural network.
Referring to fig. 3, in a second aspect of the present invention, there is provided a gas photoacoustic spectrum identification apparatus 1 based on deep learning, including an acquisition module 11, a determination module 12, an extraction module 13, a training module 14, and an identification module 15, where the acquisition module 11 is configured to acquire photoacoustic spectra of a plurality of mixed gases, and the photoacoustic spectra are taken as first photoacoustic spectra; carrying out Fourier deconvolution and bilateral filtering on the plurality of first photoacoustic spectrums in sequence to obtain a plurality of second photoacoustic spectrums; the determining module 12 is configured to determine the order of the derivative according to the number of the single peaks included in the overlapped peak in each second photoacoustic spectrum, so that the number of the overlapped peaks in the derivative photoacoustic spectrum of each second photoacoustic spectrum is lower than a threshold; the extraction module 13 is configured to extract a maximum absorption position, an absorption depth, a symmetry, and corresponding gas information of each wavelength band in each second photoacoustic spectrum and a derivative photoacoustic spectrum thereof, and map the maximum absorption position, the absorption depth, the symmetry, and the corresponding gas information into a multidimensional vector; the gas information includes a concentration of a gas; the training module 14 is configured to use the first photoacoustic spectrum and the multidimensional vector as a sample and a label, respectively, to construct a sample data set; training a target recognition neural network by using the sample data set until the error is lower than a threshold value and tends to be stable, and obtaining a trained target recognition neural network; the identification module 15 is configured to input the photoacoustic spectrum to be identified into a trained target identification neural network, so as to obtain identification information in the photoacoustic spectrum; the identification information includes the composition of the mixed gas, the maximum absorption position of the absorption peak, the absorption depth, and the degree of symmetry.
In some embodiments of the present invention, the identification module 15 includes a first identification module and a second identification module, the first identification module is used for identifying the components of the mixed gas of the photoacoustic spectrum; the second identification module is used for identifying the maximum absorption position, the depth and the symmetry of the absorption peak in the photoacoustic spectrum.
Referring to fig. 4, in a third aspect of the present invention, there is provided an electronic apparatus comprising: one or more processors; the storage device is used for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method provided by the first aspect of the invention.
The electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following devices may be connected to the I/O interface 505 in general: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; a storage device 508 including, for example, a hard disk; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in the figures may represent one device or a plurality of devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program, when executed by the processing device 501, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more computer programs which, when executed by the electronic device, cause the electronic device to:
computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, Python, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent replacements, improvements, etc. within the spirit and principle of the present invention should be included in the protection scope of the present invention.