The present application relates to gas detection and identification, and more particularly to a method for detecting and identifying toxic and harmful gases based on machine olfaction.
Gas leak often occurs in industrial processes and leads to serious hazard to persons and property when leaked gas is toxic, harmful, flammable and explosive gases. For example, on 12 Aug. 2015, a series of explosions occurred in Binhai New Area of Tianjin, China; and on 21 Jul. 2017, gas blast occurred in West Lack District of Hangzhou, China, Therefore, it is of great significance to develop a method for timely detecting and identifying toxic, harmful, flammable and explosive gases.
Currently, toxic and harmful gases are detected mainly through PH test paper method, photochemical method, as well as devices such as gas chromatographs, gas sensors and related instruments.
Gao Daqi et al. disclosed “Small-scale automated machine olfactory device and odor analysis method” (Chinese Patent ZL200710036260.4), where the machine olfactory device includes a test box, a thermostatic cup, an automatic sampling lifting device, a computer, a display device, and an oxygen cylinder. The odor analysis method involves the use of head-space sampling manner and 16 gas sensors. 4 thermostatic cups are provided in the machine olfactory device to achieve continuous measurement.
Li Taixi et al. disclosed “Device and method for judging odor perception” (Chinese Patent Application No. 201510784670.1), where the sensor array includes two or more sensors which are capable of detecting VOCs, H2S, NH3, H2, EtOH, trimethylamine, ethanol, solvent vapor, methane, COCFC's, CO2, O3, NO2, etc.
These methods list several detection means, but they fail to describe a specific gas detection method and the related process. Therefore, there is an urgent need to realize the real-time detection and identification of toxic and harmful gases.
This invention provides a method for detecting and identifying toxic and harmful gases based on machine olfaction to overcome at least one of the drawbacks in the prior art. Information about the toxic and harmful gases is collected through a machine olfactory system and analyzed through a Selected Linear Discriminate Analysis (SLDA) combined with a two-dimensional distance discriminant method to construct an odor information base, thereby identifying various toxic and harmful gases.
The technical solution of the invention is described as follows.
A method for detecting and identifying toxic and harmful gases based on machine olfaction, comprising:
(1) collecting and storing a gas sample in a sampling bag through an electric air pump, and delivering the gas sample in the sampling bag via a gas valve to a gas chamber provided in a constant temperature and humidity device;
(2) delivering the gas sample to a sensor chamber through a hole of the sampling bag to contact a sensor array to obtain measurement data; performing A/D conversion on the measurement data through an A/D acquisition card; transferring the converted data to a computer and saving the data as Sdata;
(3) performing data feature extraction on the collected data Sdata, and obtaining a recognition feature matrix Mtrain through a selected linear discriminate analysis; and
(4) repeating steps (1)-(3) to obtain a recognition feature matrix Mtest of a gas sample; and comparing Mtest and Mtrain by using a two-dimensional distance discriminant method to identify the type of the gas sample.
In some embodiments, in step (1), a hole diameter of the gas valve is 5 mm; a volume of the sampling bag is 600 ml; a volume of the gas chamber is 600 ml; the gas is delivered to the gas chamber at a flow rate of 5 ml/s; the constant temperature and humidity device is Type ZH-TH-80 with an internal dimension of 400×500×400 mm and an external dimension of 1050×1650×980 mm, and is set with a temperature of 30° C., and a relative humidity of 50-60%.
In some embodiments, in step (2), the sensor array consists of 10 metal oxide gas sensors which are uniformly arranged in a circle with a diameter of 10.2 cm; a gas sampling time is 120 s; and the A/D acquisition card is Type AD7705.
In some embodiments, the selected linear discriminate analysis in step (3) comprises the following steps:
(1) classifying gas samples into K types each having N gas samples; setting the collected and measured data of single gas sample as Sdata1, wherein Sdata1∈R120×10, and Sdata1 has 120 rows and 10 columns; selecting and saving data from rows 55-69 of Sdata1 as Sij, wherein Sij∈R15×10, and Sij has 15 rows and 10 columns; calculating a mathematical characteristic, a mean matrix μ for each column of Sij of the single gas sample according to the following equation;
wherein q is the number of rows of Sij of the single gas sample, and q=15;
(2) obtaining mean matrices μ of Sij of all gas samples according to step (1) to form a matrix P of all gas samples, wherein P={X1N, X2N, ΛXkN}; XkN∈RN×10, and XkN has N rows and 10 columns; P∈RM·N×10, and the matrix P has M·N rows and 10 columns;
calculating a mathematical characteristic, a mean matrix μj for columns of XkN of a single type of gas samples according to the following equation:
then calculating a mean matrix μk of the matrix P of all gas samples according to the following equation;
then calculating a within-class scatter matrix JW and a between-class scatter matrix JB of the matrix P of all gas samples according to the following equations;
and calculating an objective optimization function ϕ(ω) of the matrix P,
wherein ϕ(ω) is expressed as
when ϕ(ω) takes the maximum value, the eigenvalue ω satisfies a maximum JB value and a minimum JW value, so that conditions for the optimization of the matrix P are satisfied;
setting the eigenvalue as λ, plugging ωJWωT=1 into the equation (6), as shown in formula (7),
thus converting the equation (6) by Lagrange multiplier method to obtain the following equation:
ϕ(ω)′=ωJBωT−λ(ωJWωT−1) (8)
performing derivation on ω on both sides of the equation (8) to solve the eigenvalue of the matrix formed from JB and JW, as shown in the following equation:
and
(3) calculating a recognition feature matrix Mtrain according to the following equation:
Mtrain=P×λ,Mtrain∈RM·N×10 (11).
In some embodiments, the two-dimensional distance discriminant method in step (4) comprises the following steps:
(1) setting a recognition feature matrix of trained gas samples as Mtrain, and setting a recognition feature matrix of each type of trained gas samples as Mtraink, and calculating a mean matrix Atraink for all columns of Mtraink according to the following equation:
extracting the first two columns of Atraink to obtain Atraink12 which is expressed as
Atraink12=(xi1,xi2) (13);
(2) setting a recognition feature matrix of gas samples to be tested as Mtest, and extracting the first two columns of Mtest as Atestk12, which is expressed as:
Atestk12=(xj1,xj2) (14);
and
(3) calculating a two-dimensional spatial distance d of Atraink12 and Atestk12 according to the following equation:
d=√{square root over ((xj1−xi1)2+(xj2−xi2)2)} (15);
wherein d being close to 0 indicates a close spatial distance, indicating that the gas sample to be tested and the trained gas sample are identified as the same type of gas.
Compared with the prior art, the invention has the following beneficial effects.
This invention provides a method for detecting and identifying toxic and harmful gases based on machine olfactory, where the information about the toxic and harmful gases is collected through the machine olfactory system and analyzed through the Selected Linear Discriminate Analysis (SLDA) combined with the Markov two-dimensional distance discriminant method to identify various toxic and harmful gases. The algorithm disclosed in the invention extracts the characteristic information of the sample data, and then fast processes and identifies the information as a linear recognition algorithm does, having wide applications in the field of machine olfaction, especially in detecting and identifying the toxic and harmful gases in real-time based on machine olfaction. The algorithm involves low complexity and high recognition efficiency.
The accompanying drawings are only for illustration and are not intended to limit the present invention;
In order to better illustrate the embodiments, some components in the drawings may be omitted, enlarged or reduced, and do not present the actual size of the product.
It will be understood by those skilled in the art that some well-known structures in the drawings and the descriptions thereof may be omitted.
The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
Common toxic and harmful gases such as CO2, CH4, NH3 and VOCs were measured and identified in this embodiment. Each of these 4 types gases had 20 samples, among these 20 samples, 10 samples were chosen for training, and 2 samples were randomly chosen for the measurement. A method for detecting and identifying toxic and harmful gases based on machine olfaction included the following steps, as shown in
(1) 4 types of gas samples were collected and stored in a 600 ml gas sampling bag through an electric air pump, and then delivered to a gas chamber via a gas valve at a flow rate of 5 ml/s, where a hole diameter of the gas valve is 5 mm; a volume of the gas chamber is 600 ml, and the gas chamber was provided in a constant temperature and humidity device which was Type ZH-TH-80 with an internal dimension of 400×500×400 mm and an external dimension of 1050×1650×980 mm. The constant temperature and humidity device was set with a temperature of 30° C., and a relative humidity of 50-60%.
(2) The 4 types of gas samples passed through a hole of the gas sampling bag and entered into a sensor chamber to contact a sensor array and obtain measurement data. The sensor array consisted of 10 metal oxide gas sensors which were uniformly arranged in a circle with a diameter of 10.2 cm. A gas sampling time was 120 s. A/D conversion was performed on the measurement data through an A/D acquisition card which was Type AD7705. The converted data were transferred to a computer and saved as Sdata.
(3) Data feature extraction was performed on the collected data Sdata, and then a recognition feature matrix Mtrain was obtained through a selected linear discriminate analysis (SLDA).
In this embodiment, the selected linear discriminate analysis in Step (3) further included the following steps.
(1) 4 types of gas samples including CO2, CH4, NH3 and VOCs were collected, and each type had 10 gas samples. A single gas sample was randomly chosen among the 10 gas samples and was measured to obtain data Sdata1, where Sdata1∈R120×10, and Sdata1 had 120 rows and 10 columns, as shown in Table 1.
Firstly, data from rows 55-69 of Sdata1 were selected and saved as Sij, where Sij∈R15×10, and Sij had 15 rows and 10 columns, as shown in Table 2.
A mathematical characteristic, a mean matrix μ for each column of Sij of the single gas sample was calculated according to the following equation;
in this embodiment, q was the number of rows of Sij of the single gas sample, and q=15;
(2) Mean matrices μ of Sij of all gas samples were obtained according to step (1) to form a matrix P of all gas samples, wherein P={X1N, X2N, ΛXkN}; XkN∈R10×10, and XkN has 10 rows and 10 columns; P∈R40×10, and the matrix P has M·N rows (M·N=40) and 10 columns, as shown in Table. 3.
Secondly, a mathematical characteristic, a mean matrix μj for columns of XkN of a single type of gas samples was calculated according to the following equation;
the mean matrix μj was shown in Table 4.
A mean matrix μk of the matrix P of all gas samples was calculated according to the following equation;
the mean matrix μk was shown in Table 5.
A within-class scatter matrix JW and a between-class scatter matrix JB of the matrix P of all gas samples were respectively calculated according to the following equations:
the matrix JW was shown in Table 6 and the matrix JB was shown in Table 7.
Finally, an objective optimization function ϕ(ω) of the matrix P was calculated, wherein ϕ(ω) was expressed as
When ϕ(ω) took the maximum value, the eigenvalue ω satisfied a maximum JB value and a minimum JW value, so that conditions for the optimization of the matrix P were satisfied.
The eigenvalue was set as λ, and ωJWωT=1 was plugged into the equation (6), as shown in formula (7),
Thus, the equation (6) was converted by Lagrange multiplier method to obtain the following equation:
ϕ(ω)′=ωJBωT−λ(ωJWωT−1) (8)
The derivation was performed on ω on both sides of the equal sign of the equation (8) to solve the eigenvalue of the matrix formed from JB and JW, as shown in the following equation:
The eigenvalue λ of the optimization function was shown in Table 8.
(3) A recognition feature matrix Mtrain was calculated according to the following equation:
Mtrain=P×λ,Mtrain∈RM·N×10 (11).
The first two columns of the recognition feature matrix Mtrain were selected for two-dimensional classification purpose, as shown in Table 9. As shown in
(4) Each type of gas samples remained 10 gas samples. Among these 10 gas samples, 2 gas samples were randomly selected for test purpose, thus there were 4 types of gas samples to be tested, and each type had 2 samples. A recognition feature matrix Mtest of the gas samples to be tested was obtained by repeating steps (1)-(3) of the selected linear discriminate analysis. By using a two-dimensional distance discriminant method and comparing Mtest and Mtrain, the type of the gas samples to be tested was identified.
In this embodiment, the two-dimensional distance discriminant method in step (4) further included the following steps.
(1) A recognition feature matrix of trained gas samples was set as Mtrain, and a recognition feature matrix of each type of trained gas samples was set as Mtraink, and then a mean matrix Atraink for all columns of Mtraink were calculated according to the following equation:
the first two columns of Atraink were extracted and saved as Atraink12 which was expressed as
Atraink12=(xi1,xi2) (13);
The matrix Atrain12 was shown in Table 10.
(2) A recognition feature matrix of gas samples to be tested was set as Mtest, and the first two columns of Mtest were saved as Atestk12 which was expressed as the following equation:
Atestk12=(xj1,xj2) (14);
The matrix Mtestk was shown in Table 11.
(3) A two-dimensional spatial distance d of Atraink12 and Atestk12 was calculated according to the following equation:
d=√{square root over ((xj1−xi1)2+(xj2−xi2)2)} (15);
and d values and identification results were shown in table 12.
In this embodiment, two-dimensional spatial distances d of the matrix Atestk of the gas samples to be test and the matrix Atraink of the trained gas samples were respectively calculated, where d being close to 0 indicated that the gas sample to be tested and the trained gas sample are identified as the same type of gas. It can be seen from Table 12, the first type of the gas samples to be tested was VOCs, and the second type of the gas samples to be tested was CH4, the third type of the gas samples to be tested was NH3, and the fourth type of the gas samples to be tested was CO2. In
The same or similar reference numerals correspond to the same or similar parts.
The terms for describing the positional relationship in the drawings are illustrative only, and are not intended to limit the present invention;
Obviously, the above are some exemplary embodiments of the invention, which are merely for the purpose of illustration, and are not intended to limit the present invention. Other modifications or variations can be made by those skilled in the art based on the above descriptions. All these modifications, equivalent replacements and improvements made within the spirit and principle of the present invention shall fall within the scope of the appended claims of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
201710785985.7 | Aug 2017 | CN | national |
This application is a continuation of International Patent Application No. PCT/CN2017/107087, filed on Oct. 20, 2017, which claims the benefit of priority from Chinese Application No. 201710785985.7, filed on Aug. 30, 2017. The content of the aforementioned applications, including any intervening amendments thereto, are incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
7693049 | Joseph et al. | Apr 2010 | B2 |
9643186 | Ahmad | May 2017 | B1 |
20010027678 | Mottram | Oct 2001 | A1 |
20040006257 | Burch | Jan 2004 | A1 |
20040181346 | Sunshine | Sep 2004 | A1 |
20090261987 | Sun | Oct 2009 | A1 |
20160061761 | Shim | Mar 2016 | A1 |
20180011066 | Loubet | Jan 2018 | A1 |
Number | Date | Country |
---|---|---|
102279213 | Dec 2011 | CN |
103499608 | Jan 2014 | CN |
104102818 | Oct 2014 | CN |
105954412 | Sep 2016 | CN |
Number | Date | Country | |
---|---|---|---|
20200200724 A1 | Jun 2020 | US |
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2017/107087 | Oct 2017 | US |
Child | 16804477 | US |