Spectral feature extraction method for synchronously detecting CO and VOCs in middle-infrared band
By configuring a reference sample gas and collecting spectral data at different temperatures, a support vector machine model was constructed, which solved the problem of distinguishing overlapping absorption peaks in the simultaneous detection of CO and VOCs in the mid-infrared band, and achieved accurate acquisition and spectral separation of gas components.
Patent Information
- Application Number
- CN202511305228.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-10-31
AI Technical Summary
Existing spectral feature extraction techniques have difficulty in accurately distinguishing the overlapping absorption peaks of CO and VOCs in the mid-infrared band, resulting in the inability to accurately obtain the composition of the mixed gas.
By configuring a reference sample gas, collecting spectral data at different temperatures, constructing a support vector machine model, and using absorption and spectral feature data to identify gas categories and perform spectral separation processing.
This technology enables the accurate acquisition of gas composition based on the changing characteristics of gas molecule absorption peaks during simultaneous detection of CO and VOCs, improving the spectral feature discrimination and model robustness, and reducing the risk of misjudgment.
Smart Images

Figure CN120870032A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectral feature extraction technology, specifically a method for spectral feature extraction of simultaneous detection of CO and VOCs in the mid-infrared band. Background Technology
[0002] Spectral feature extraction technology refers to a series of methods and techniques for extracting key information from spectral data that can effectively characterize the properties, state, or composition of substances. Its core objective is to eliminate redundant information and retain or enhance the most discriminative features through the analysis and processing of spectral data, thereby providing a foundation for subsequent applications such as substance identification, classification, and quantitative analysis.
[0003] Existing spectral feature extraction techniques for the simultaneous detection of CO and VOCs based on gas molecule characteristic absorption peaks suffer from overlapping spectral signals. CO has a characteristic absorption peak in the mid-infrared band, while some VOCs, such as aldehydes and ketones, also have absorption peaks in the mid-infrared or near-infrared bands. Furthermore, the functional groups of different VOC molecules may have similar absorption characteristics, causing the absorption peaks of different components in the gas mixture to mask each other, making it difficult to distinguish them using a single absorption peak. When the absorption peaks of CO and VOCs overlap, traditional methods struggle to directly distinguish the overlapping absorption peaks without knowing the specific gas composition of the mixture. For example, patent application CN110658156A discloses a near-infrared spectral feature extraction method and apparatus. While this scheme ensures data integrity and can extract features across the entire spectral range, it cannot accurately separate overlapping spectral signals. Therefore, existing spectral feature extraction techniques for the simultaneous detection of CO and VOCs based on gas molecule characteristic absorption peaks cannot accurately obtain the gas composition based on the changing characteristics of the gas molecule's characteristic absorption peaks, thus failing to directly distinguish overlapping absorption peaks. Summary of the Invention
[0004] This invention aims to at least partially solve one of the technical problems in the prior art. By configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures, reference spectral sequence data is obtained; absorption feature extraction and spectral feature extraction processing are performed to obtain absorption feature data and spectral feature data; a gas category identification model is constructed; the gas category composition of the detected gas is obtained based on the gas category identification model, and spectral separation processing is performed; this solves the problem that existing spectral feature extraction technologies, when simultaneously detecting CO and VOCs based on the characteristic absorption peaks of gas molecules, cannot accurately obtain the composition of the gas based on the changing characteristics of the characteristic absorption peaks of gas molecules, and thus cannot directly distinguish overlapping absorption peaks.
[0005] To achieve the above object, the present application provides a spectral feature extraction method for synchronous detection of CO and VOCs in the mid-infrared band, including the following steps: Configure a reference sample gas, and collect spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data; Perform absorption feature extraction processing and spectral feature extraction processing based on the reference spectral sequence data to obtain absorption feature data and spectral feature data; Based on the support vector machine model, construct a gas category recognition model by using the absorption feature data and the spectral feature data; Obtain the gas category composition of the detected gas based on the gas category recognition model, and perform spectral separation processing.
[0006] Further, configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data includes the following sub-steps: Record the VOCs to be detected as volatile gases, mix CO with different concentration gradients and volatile gases with different concentration gradients, and record the corresponding CO concentration and volatile gas concentration as the reference sample gas. For any portion of the reference sample gas, it is denoted as the first sample gas; Based on the mid-infrared gas detection device, divide the gas absorption cell of the mid-infrared gas detection device into three regions, which are sequentially denoted as the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region; and temperature control devices are respectively set in the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region.
[0007] Further, it is characterized in that configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data further includes the following sub-steps: Set the first temperature as WT1, the second temperature as WT2, and the third temperature as WT3; WT1 < WT2 < WT3; use the corresponding temperature control device to adjust the internal temperatures of the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region to WT1, WT2, and WT3 respectively; Denote any one of the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region as the first gas region; let the first sample gas pass through the first gas region, and when the first sample gas completely enters the first gas region and stays for the first time length, use the mid-infrared spectrometer to collect the spectral data of the first sample gas, which is denoted as the spectral data of the corresponding region; where the first time length is t1; Let the first sample gas pass through the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region in sequence, and obtain the corresponding low-temperature spectral data, normal-temperature spectral data, and high-temperature spectral data in sequence, which are marked as reference spectral sequence data.
[0008] Furthermore, the method is characterized by performing absorption feature extraction and spectral feature extraction processing based on reference spectral sequence data to obtain absorption feature data and spectral feature data, including the following sub-steps: For any gas absorption peak in the low-temperature spectral data, room-temperature spectral data, and high-temperature spectral data, it is denoted as the first absorption peak; the peak intensity and peak position of the first absorption peak in the low-temperature spectral data, room-temperature spectral data, and high-temperature spectral data are obtained respectively, and denoted as low-temperature peak intensity DQ, room-temperature peak intensity CQ, high-temperature peak intensity GQ, low-temperature peak position DW, room-temperature peak position CW, and high-temperature peak position GW; CQ and CW are marked as the original peak intensity YQ and the original peak position YW in sequence.
[0009] Furthermore, the method for extracting absorption features and spectral features based on reference spectral sequence data to obtain absorption feature data and spectral feature data further includes the following sub-steps: The rate of change of the peak intensity of the first absorption peak is calculated using the first formula, which is as follows: Where QB represents the peak intensity change rate; and the peak position shift of the first absorption peak is calculated using the second formula, which is as follows: Where WB represents the peak position offset; YQ, YW, QB, and WB are combined to form the first characteristic vector of the first absorption peak, denoted as MX={m1, m2, m3, m4}, where m1, m2, m3, and m4 represent YQ, YW, QB, and WB in order, respectively; the first characteristic vectors of all gas absorption peaks in the low-temperature spectral data, room-temperature spectral data, and high-temperature spectral data are repeatedly obtained and denoted as MX(1), MX(2), ..., MX(n) in order, respectively; MX(1), MX(2), ..., MX(n) are combined to form the corresponding absorption characteristic vector of the reference sample gas, denoted as HX={MX(1), MX(2), ..., MX(n)}; Repeatedly acquire the absorption feature vectors of all reference sample gases to obtain absorption feature data.
[0010] Furthermore, the process of extracting absorption features and spectral features based on reference spectral sequence data to obtain absorption feature data and spectral feature data includes the following sub-steps: Based on the room temperature spectral data of the first sample gas, the spectral range of the room temperature spectral data is uniformly divided into k1 intervals, which are sequentially denoted as spectral interval 1 to spectral interval r, and any spectral interval is denoted as spectral interval i, where k1 is the number of intervals set. Obtain the average, standard deviation, and maximum absorbance within spectral interval i, and denote them as UP, UB, and UM in order; then arrange all absorbance values within spectral interval i in ascending order, and obtain the difference between the 25th percentile absorbance and the 75th percentile absorbance, which is denoted as UC. Combine UP, UB, UM, and UC into the second eigenvector of interval i, denoted as MYi{e1,e2,e3,e4}, where e1,e2,e3,e4 represent UP, UB, UM, and UC in sequence. Repeat this process to obtain the second eigenvectors for all spectral intervals and combine them into the corresponding spectral eigenvector of the reference sample gas, denoted as HY={MY1, MY2, ...,MYr}. Repeatedly acquire the spectral eigenvectors of all reference sample gases to obtain spectral feature data.
[0011] Furthermore, the method is characterized by constructing a gas category identification model based on a support vector machine model and utilizing absorption feature data and spectral feature data, comprising the following sub-steps: The absorption feature data and spectral feature data are normalized according to their respective data types, scaling the values of all data in the absorption feature data and spectral feature data to [0,1]. After completion, normalized absorption data and normalized spectral data are obtained. The first original recognition model and the second original recognition model are constructed based on the support vector machine model.
[0012] Furthermore, the method of constructing a gas category identification model based on a support vector machine model and utilizing absorption feature data and spectral feature data further includes the following sub-steps: The input dimension of the first original recognition model is set to n*4, the kernel function of the first original recognition model is set to KE1, the regularization parameter is set to C1, the optimization tolerance is set to TO1, and the first original recognition model is trained using normalized absorption data. After completion, the first category recognition model is obtained. The input dimension of the first original recognition model is set to r*4. The kernel function of the second original recognition model is set to KE2, the regularization parameter is set to C2, and the optimization tolerance is set to TO2. The first original recognition model is trained using normalized spectral data. After the training is completed, the second category recognition model is obtained. The first category recognition model and the second category recognition model are denoted as the gas category recognition model.
[0013] Furthermore, the method of obtaining the gas category composition of the detected gas based on the gas category identification model and performing spectral separation processing includes the following sub-steps: For the mixed gas of CO and VOCs to be detected, denoted as the待检混合气体, collect the low-temperature spectral data, normal-temperature spectral data, and high-temperature spectral data corresponding to the待检混合气体, and perform absorption feature extraction processing and spectral feature extraction processing to obtain the corresponding absorption feature vectors and spectral feature vectors, and perform normalization processing, and then input them into the corresponding first-class recognition model and second-class recognition model to obtain the first recognition result and the second recognition result; If the first recognition result and the second recognition result are exactly the same, mark the first recognition result and the second recognition result as the gas composition result; If the first recognition result and the second recognition result are not exactly the same, obtain the part where the first recognition result and the second recognition result are the same, denoted as the相同组成结果, obtain the total number of gas categories in the相同组成结果, denoted as BZ0; and obtain the absorption peak ranges of all gases in the相同组成结果under standard conditions, and obtain the number of pairs of gases with overlapping absorption peak ranges, denoted as DZ0; If BZ0 > k2 and DZ0 < k3, then mark the second recognition result as the gas composition result, otherwise mark the first recognition result as the gas composition result, where k2 and k3 are the set threshold numbers.
[0014] Further, it is characterized in that obtaining the gas category composition of the detected gas based on the gas category recognition model and performing spectral separation processing further includes the following sub-steps: Denote the normal-temperature spectral data of the待检混合气体as the standard spectral data, obtain the gases with overlapping absorption peak ranges according to the absorption peak ranges of all gases in the corresponding gas composition result under standard conditions, denoted as the重叠气体; obtain the spectral matrix corresponding to the重叠气体in the standard spectral data, denoted as the混合光谱矩阵, and obtain the standard spectral matrix of the重叠气体; use the least squares method to fit the混合光谱矩阵and the standard spectral matrix to obtain the spectral absorption peaks of the overlapping gases respectively.
[0015] Advantages of the present invention: By configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures, the reference spectral sequence data is obtained; based on the reference spectral sequence data, absorption feature extraction processing and spectral feature extraction processing are performed to obtain absorption feature data and spectral feature data; based on the support vector machine model, a gas category recognition model is constructed using the absorption feature data and the spectral feature data; based on the gas category recognition model, the gas category composition of the detected gas is obtained and spectral separation processing is performed; when synchronously detecting CO and VOCs based on the characteristic absorption peaks of gas molecules, the composition components of the gas can be accurately obtained according to the change characteristics of the characteristic absorption peaks of gas molecules, and then the problem of directly distinguishing overlapping absorption peaks can be solved; This invention divides the gas absorption cell into three regions: low temperature, normal temperature, and high temperature. Temperature and acquisition time are controlled by peak difference characteristics and peak position fluctuations. The advantages are: utilizing the differences in the thermal motion of gas molecules at different temperatures improves the distinguishability of spectral features and ensures that the spectral differences of different gases at high and low temperatures are maximized, eliminating the interference of temperature fluctuations on feature stability; by dividing the spectral range into multiple intervals and extracting features from each interval to form a feature vector MYi, the global spectral distribution features can be captured, enhancing the model's overall pattern recognition capability for complex mixed gases; and by constructing two category recognition models based on absorption feature data and spectral feature data, the risk of misjudgment due to feature bias in a single model can be reduced, improving model robustness. Attached Figure Description
[0016] Figure 1 This is a flowchart of the steps of the method of the present invention; Figure 2 This is a flowchart of the absorption feature extraction process of the present invention; Figure 3 This is a flowchart of the gas composition result determination process of the present invention; Figure 4 This is a schematic diagram of the electronic device of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Example 1, please refer to Figure 1 As shown, this application provides a method for spectral feature extraction for simultaneous detection of CO and VOCs in the mid-infrared band, comprising the following steps: Step S1 involves configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data. Step S1 includes the following sub-steps: Step S101: The VOCs to be detected are denoted as volatile gases. CO of different concentration gradients is mixed with volatile gases of different concentration gradients, and the corresponding CO concentration and volatile gas concentration are recorded and denoted as reference sample gas. Any reference sample gas is denoted as the first sample gas. VOCs, or volatile organic compounds, are a class of organic compounds that are highly volatile at room temperature and pressure. Step S102: Based on the mid-infrared gas detection device, divide the gas absorption cell of the mid-infrared gas detection device into three regions on average, and denote them as the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region in sequence; and set temperature control devices in the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region respectively; The gas absorption cell is an optical device for spectral analysis or gas detection, and its core function is to increase the interaction path length between light and substances (such as gases, liquids) to improve the detection sensitivity; Step S103: Obtain the ambient temperature in real time, denoted as HT; set the first temperature and the second temperature; preset multiple temperature values for the first temperature and the second temperature, where the first temperature < HT < the second temperature; obtain all combinations of the first temperature and the second temperature, denoted as high-low temperature combinations; denote any high-low temperature combination as the first temperature combination, and denote the corresponding first temperature as WT1 and the second temperature as WT2; use the corresponding temperature control devices to adjust the internal temperatures of the low-temperature gas region and the high-temperature gas region to WT1 and WT2 respectively; For example, preset the first temperature to 0°C, 3°C, 6°C, 9°C, 12°C, and 15°C, and preset the second temperature to 30°C, 33°C, 36°C, 39°C, 42°C, and 45°C; then there are 36 combinations of the first temperature and the second temperature; When presetting the temperature, it is necessary to ensure that the gas properties of the reference sample gas are basically unchanged at this temperature; Step S104: Let the first sample gas pass through the low-temperature gas region and the high-temperature gas region, and when the first sample gas completely enters the low-temperature gas region and the high-temperature gas region and stays for the first time length, use the mid-infrared spectrometer to collect the spectral data of the first sample gas; obtain the first spectral data and the second spectral data respectively, where the first time length is t1; The first time length cannot be too short, and it is necessary to ensure that the temperature of the first sample gas can reach the corresponding region temperature after staying for the first time length. In this embodiment, the first time length t1 is 2 minutes; Step S105: For any gas absorption peak in the first spectral data and the second spectral data, denoted as the spectral absorption peak; obtain the peak positions of the spectral absorption peak in the first spectral data and the second spectral data respectively, and calculate the absolute value of the difference, denoted as the absolute peak position difference of the spectral absorption peak. Repeat to obtain the absolute peak position differences of all gas absorption peaks and sum them to obtain the peak difference characteristic value corresponding to the first temperature combination; The peak position of the absorption peak refers to the position of the wavelength or wavenumber corresponding to the maximum absorbance in the absorption spectrum. In this embodiment, the peak position unit is the wavenumber unit; Step S106: Repeatedly obtain the peak difference characteristic value of all high and low temperature combinations, and record the high and low temperature combination corresponding to the largest peak difference characteristic value as the optimal temperature combination. Record the first temperature and the second temperature corresponding to the optimal temperature combination as the optimal low temperature and the optimal high temperature respectively in order. If there are multiple high and low temperature combinations with the largest peak difference characteristic value, select the combination with the smaller difference between the first temperature and the second temperature as the optimal temperature combination, which can save the cost of heating and cooling to a certain extent. Step S107: Adjust the internal temperature of the room temperature gas region to HT using the corresponding temperature control device. After the first sample gas completely enters the room temperature gas region, collect the spectral data of the first sample gas at a first time interval and record it as the third spectral data. The first time interval is t2. In this embodiment, the first time interval t2 is 1 second. Step S108: For any gas absorption peak in the third spectral data, record it as a room temperature absorption peak, obtain the peak position of the room temperature absorption peak, and calculate the difference between it and the peak position of the corresponding room temperature absorption peak in the previously acquired third spectral data. This difference is recorded as the peak position fluctuation of the room temperature absorption peak. Repeat this process for each acquired third spectral data to obtain the peak position fluctuation of all room temperature absorption peaks. If the peak position fluctuation of all room temperature absorption peaks is less than FB, record the residence time of the first sample gas completely entering the room temperature gas region at this time, and mark it as the optimal time length. In this embodiment, FB is the set peak position fluctuation threshold; the peak position fluctuation threshold FB is 0.5 cm. -1 The reason why FB is not set to 0 is that, due to limitations in instrument accuracy and environmental influences, peak fluctuations cannot be zero. Step S109: Using the corresponding temperature control device, adjust the internal temperatures of the low-temperature gas region, the room-temperature gas region, and the high-temperature gas region to the optimal low temperature, HT, and optimal high temperature, respectively; designate any one of the low-temperature gas region, the room-temperature gas region, and the high-temperature gas region as the first gas region; allow the first sample gas to pass through the first gas region, and after the first sample gas has completely entered the first gas region and stayed for the optimal time length, use a mid-infrared spectrometer to collect the spectral data of the first sample gas, and record it as the spectral data of the corresponding region; for the optimal low temperature, optimal high temperature, and optimal time length, it is not necessary to repeatedly acquire the spectral data of the corresponding region each time, it is only necessary to acquire it once, and to ensure the stability of the acquired spectral data, it can also be acquired and replaced periodically; Step S110: The first sample gas is passed through the low temperature gas region, the normal temperature gas region and the high temperature gas region in sequence to obtain the corresponding low temperature spectral data, normal temperature spectral data and high temperature spectral data in order, which are marked as reference spectral sequence data. In the specific implementation process, the gas absorption cell is divided into three regions: low temperature, normal temperature, and high temperature. The combination of high and low temperatures is optimized. By utilizing the differences in the thermal motion of gas molecules at different temperatures, the absorption peak intensity and peak position of CO and VOCs are made to have temperature-sensitive differences, which significantly improves the feature discrimination. The optimal temperature combination is selected by calculating the peak difference characteristic value to ensure that the spectral differences of different gases at high and low temperatures are maximized. At the same time, the acquisition time is controlled by the peak position fluctuation in the normal temperature region to eliminate the interference of ambient temperature fluctuations on spectral stability and improve data reliability.
[0019] Step S2 involves performing absorption feature extraction and spectral feature extraction processing based on the reference spectral sequence data to obtain absorption feature data and spectral feature data. Step S2 includes the following sub-steps: For step S201, please refer to... Figure 2 As shown, any gas absorption peak in the low-temperature spectral data, room-temperature spectral data, and high-temperature spectral data is denoted as the first absorption peak. The peak intensity and peak position of the first absorption peak in the low-temperature spectral data, room-temperature spectral data, and high-temperature spectral data are obtained respectively and denoted as low-temperature peak intensity DQ, room-temperature peak intensity CQ, high-temperature peak intensity GQ, low-temperature peak position DW, room-temperature peak position CW, and high-temperature peak position GW. CQ and CW are marked as the original peak intensity YQ and the original peak position YW in sequence. The peak intensity of the absorption peak refers to the strength of the absorption peak in spectral analysis, and is generally expressed by absorbance, molar absorptivity, or transmittance. In this embodiment, the peak intensity is expressed by absorbance. Step S202: Calculate the rate of change of the peak intensity of the first absorption peak using the first formula, which is as follows: Where QB represents the peak intensity change rate; and the peak position shift of the first absorption peak is calculated using the second formula, which is as follows: Where WB represents the peak position offset; Step S203: Combine YQ, YW, QB and WB into the first feature vector of the first absorption peak, denoted as MX={m1, m2, m3, m4}, where m1, m2, m3 and m4 represent YQ, YW, QB and WB respectively in order; repeatedly obtain the first feature vectors of all gas absorption peaks in the low temperature spectral data, room temperature spectral data and high temperature spectral data, and denoted as MX(1), MX(2), ..., MX(n) respectively in order; combine MX(1), MX(2), ..., MX(n) into the corresponding absorption feature vector of the reference sample gas, denoted as HX={MX(1), MX(2), ..., MX(n)}; Step S204: Repeatedly acquire the absorption feature vectors of all reference sample gases to obtain absorption feature data; Step S205: Based on the room temperature spectral data of the first sample gas, the spectral range of the room temperature spectral data is uniformly divided into k1 intervals, which are sequentially labeled as spectral interval 1 to spectral interval r, and any one of the spectral intervals is labeled as spectral interval i, where k1 is the set number; k1 can be set according to the spectral range of the spectral data. In this embodiment, every 100cm -1 For an interval; Step S206: Obtain the average value, standard deviation, and maximum value of absorbance within spectral interval i, and denote them as UP, UB, and UM respectively in order; arrange all absorbance values within spectral interval i in ascending order, and obtain the difference between the 25th percentile absorbance and the 75th percentile absorbance, denoted as UC; divide the spectral data into intervals and obtain their characteristics. The advantage is that there is no need to pre-locate characteristic peaks, which is suitable for complex spectra with unknown components. Step S207: Combine UP, UB, UM and UC into the second feature vector of interval i, denoted as MYi{e1, e2, e3, e4}, where e1, e2, e3 and e4 represent UP, UB, UM and UC in order. Repeat the acquisition of the second feature vectors of all spectral intervals and combine them into the spectral feature vector of the corresponding reference sample gas, denoted as HY={MY1, MY2, ..., MYr}. Step S208: Repeatedly acquire the spectral feature vectors of all reference sample gases to obtain spectral feature data; In the specific implementation process, for each gas absorption peak, the original peak intensity, original peak position, peak intensity change rate, and peak position shift are extracted to form a feature vector MX, which directly reflects the spectral response characteristics of gas molecules and is suitable for finely distinguishing gases with overlapping feature peaks. Dividing the spectral range into multiple intervals, extracting the features of each interval, and forming a feature vector MYi can capture the global spectral distribution features and is suitable for the overall classification and identification of complex mixed gases.
[0020] Step S3 involves constructing a gas category identification model based on a support vector machine model and utilizing absorption feature data and spectral feature data. Step S3 includes the following sub-steps: Step S301: Normalize the absorption feature data and spectral feature data according to their respective data types, scaling the values of all data in the absorption feature data and spectral feature data to [0, 1]. After completion, normalized absorption data and normalized spectral data are obtained. Step S302: Construct the first original recognition model and the second original recognition model based on the support vector machine model, respectively; Step S303: Set the input dimension of the first original recognition model to n*4, i.e., the dimension of the absorbed feature vector; set the kernel function of the first original recognition model to KE1, the regularization parameter to C1, and the optimization tolerance to TO1; train the first original recognition model using normalized absorbed data to obtain the first category recognition model; the regularization parameter is used to control the balance between classification margin and classification error, and the optimization tolerance is used to control the error threshold at which iterative optimization stops, i.e., the allowed range of classification error; in this embodiment, C1=1; TO1=10 -3 ; Step S304: Set the input dimension of the first original recognition model to r*4, which is the dimension of the spectral feature vector; set the kernel function of the second original recognition model to KE2, the regularization parameter to C2, and the optimization tolerance to TO2; train the first original recognition model using normalized spectral data to obtain the second category recognition model; the kernel function KE2 can be set according to the actual application scenario; in this embodiment, C2=1; TO2=10 -3 ; Kernel functions KE1 and KE2 can be set according to the actual application scenario. For nonlinear scenarios, radial basis functions can be selected to adapt to the nonlinear combination of peak position and temperature response in absorption characteristics, and there may be nonlinear correlation in spectral interval characteristics. Step S305: The first category recognition model and the second category recognition model are denoted as the gas category recognition model; In the specific implementation process, a first-class recognition model and a second-class recognition model are constructed based on absorption feature data and spectral feature data, respectively. By cross-validating the results of the two models, the risk of misjudgment caused by feature bias of a single model can be reduced.
[0021] Step S4 involves obtaining the gas category composition of the detected gas based on the gas category identification model and performing spectral separation processing. Step S4 includes the following sub-steps: Step S401: For the mixed gas of CO and VOCs to be detected, denoted as the mixed gas to be detected, collect the low temperature spectral data, room temperature spectral data and high temperature spectral data corresponding to the mixed gas to be detected, and perform absorption feature extraction processing and spectral feature extraction processing to obtain the corresponding absorption feature vector and spectral feature vector, and perform normalization processing, and then input the corresponding first category recognition model and second category recognition model to obtain the first recognition result and the second recognition result. For step S402, please refer to... Figure 3 As shown, if the first identification result is completely consistent with the second identification result, then the first identification result and the second identification result are marked as gas composition results; Step S403: If the first recognition result and the second recognition result are not completely identical, obtain the identical part of the first recognition result and the second recognition result, denoted as the identical composition result, and obtain the total number of gas categories in the identical composition result, denoted as BZ0; and obtain the absorption peak ranges of all gases in the identical composition result under standard conditions, and obtain the number of pairs of gases with overlapping absorption peak ranges, denoted as DZ0; that is, obtain that there are multiple pairs of gases with overlapping absorption peak ranges. Step S404: If BZ0 > k2 and DZ0 < k3, mark the second recognition result as the gas composition result; otherwise, mark the first recognition result as the gas composition result, where k2 and k3 are the set threshold values; in this embodiment, k2 = 5 and k3 = 2. Step S405: Denote the room-temperature spectral data of the to-be-detected mixed gas as the standard spectral data. According to the absorption peak ranges of all gases in the corresponding gas composition result under standard conditions, obtain the gases with overlapping absorption peak ranges, denoted as the overlapping gases; obtain the spectral matrix corresponding to the overlapping gases in the standard spectral data, denoted as the mixed spectral matrix, and obtain the standard spectral matrices of the overlapping gases respectively; use the least squares method to fit the mixed spectral matrix and the standard spectral matrices to obtain the spectral absorption peaks of the overlapping gases respectively; the mixed spectral matrix refers to a matrix composed of spectral data measured after mixing two or more substances; the standard spectral matrix refers to a matrix composed of spectral data measured by a pure substance or a single substance with a known concentration, also known as the reference spectral matrix or the library spectral matrix. In the specific implementation process, because the spectral feature model depends on the statistical characteristics of the spectral interval and is sensitive to the overall spectral distribution; it is suitable for distinguishing gas components with significantly different spectral forms, and is applicable to detection scenarios with many gas types, few spectral overlaps, and gentle concentration changes; the absorption feature model depends on the dynamic changes of the characteristic peaks and is sensitive to the characteristic absorption behavior of specific gases; it is applicable to scenarios where the spectral overlaps of gas components are severe and temperature-dependent characteristics need to be relied on for distinction; therefore, when the first recognition result and the second recognition result are not completely identical, select the output result of one model as the gas composition result according to the identical composition result.
[0022] Example 2, please refer to Figure 4 as shown in Figure 4A schematic diagram of an electronic device is provided, which may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can call these instructions. When the processor executes a computer-readable instruction, it performs steps such as those in a spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band, to achieve the following functions: configuring a reference sample gas and acquiring spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data; performing absorption feature extraction and spectral feature extraction processing based on the reference spectral sequence data to obtain absorption feature data and spectral feature data; constructing a gas category recognition model based on a support vector machine model and utilizing the absorption feature data and spectral feature data; and obtaining the gas category composition of the detected gas based on the gas category recognition model and performing spectral separation processing.
[0023] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0024] Example 3: This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it performs the steps of the above-described method for simultaneous detection of CO and VOCs in the mid-infrared band, to achieve the following functions: configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data; performing absorption feature extraction and spectral feature extraction processing based on the reference spectral sequence data to obtain absorption feature data and spectral feature data; constructing a gas category recognition model based on a support vector machine model and utilizing the absorption feature data and spectral feature data; obtaining the gas category composition of the detected gas based on the gas category recognition model and performing spectral separation processing.
[0025] Based on the above description of the embodiments, the embodiments of the present invention can be provided as methods, systems, or computer program products. Based on this understanding, the above technical solutions, in essence or in terms of their contribution to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or certain parts of the embodiments.
[0026] In the embodiments provided in this application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces. The indirect coupling or communication connection between systems, modules, and units may be electrical, mechanical, or other forms.
[0027] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for extracting spectral features for simultaneous detection of CO and VOCs in the mid-infrared band, characterized in that, It includes the following steps: Configure a reference sample gas, and collect spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data; Perform absorption feature extraction processing and spectral feature extraction processing based on the reference spectral sequence data to obtain absorption feature data and spectral feature data; Based on the support vector machine model, construct a gas category recognition model using the absorption feature data and the spectral feature data; Obtain the gas category composition of the detected gas based on the gas category recognition model, and perform spectral separation processing.
2. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 1, characterized in that, Configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data includes the following sub-steps: Record the VOCs to be detected as volatile gases, mix CO with different concentration gradients with volatile gases with different concentration gradients, and record the corresponding CO concentration and volatile gas concentration as the reference sample gas. For any portion of the reference sample gas, it is denoted as the first sample gas; Based on the mid-infrared gas detection device, divide the gas absorption cell of the mid-infrared gas detection device into three regions, which are sequentially denoted as the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region; and set temperature control devices in the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region respectively.
3. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 2, characterized in that, Configuring a reference sample gas and collecting spectral data of the reference sample gas at different temperatures to obtain reference spectral sequence data further includes the following sub-steps: Obtain the ambient temperature in real time, denoted as HT; set the first temperature and the second temperature; preset multiple temperature values for the first temperature and the second temperature, where the first temperature < HT < the second temperature; obtain all combinations of the first temperature and the second temperature, denoted as the high-low temperature combinations; denote any one of the high-low temperature combinations as the first temperature combination, and denote the corresponding first temperature as WT1 and the second temperature as WT2; use the corresponding temperature control devices to adjust the internal temperatures of the low-temperature gas region and the high-temperature gas region to WT1 and WT2 respectively; Let the first sample gas pass through the low-temperature gas region and the high-temperature gas region, and when the first sample gas completely enters the low-temperature gas region and the high-temperature gas region and stays for the first time length, collect the spectral data of the first sample gas using the mid-infrared spectrometer; obtain the first spectral data and the second spectral data respectively, where the first time length is t1; For any gas absorption peak in the first spectral data and the second spectral data, it is denoted as the spectral absorption peak; respectively obtain the peak positions of the spectral absorption peak in the first spectral data and the second spectral data, and calculate the absolute value of the difference, denoted as the absolute peak position difference of the spectral absorption peak. Repeat to obtain the absolute peak position differences of all gas absorption peaks and sum them to obtain the peak difference characteristic value corresponding to the corresponding first temperature combination; Repeat to obtain the peak difference characteristic values of all high-low temperature combinations, and denote the high-low temperature combination corresponding to the maximum peak difference characteristic value as the optimal temperature combination, and denote the first temperature and the second temperature corresponding to the optimal temperature combination as the optimal low temperature and the optimal high temperature in sequence; The internal temperature of the room temperature gas region is adjusted to HT using a corresponding temperature control device. After the first sample gas completely enters the room temperature gas region, the spectral data of the first sample gas is collected at a first time interval and recorded as the third spectral data. For any gas absorption peak in the third spectral data, it is recorded as the room temperature absorption peak. The peak position of the room temperature absorption peak is obtained and the difference between it and the peak position of the corresponding room temperature absorption peak in the previously collected third spectral data is recorded as the peak position fluctuation of the room temperature absorption peak. The peak position fluctuation of all room temperature absorption peaks in each collected third spectral data is repeatedly obtained. If the peak position fluctuation of all room temperature absorption peaks is less than FB, the residence time of the first sample gas completely entering the room temperature gas region is recorded and marked as the optimal time length. The first time interval is t2, and FB is the set peak position fluctuation threshold.
4. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 3, characterized in that, Preparing a reference sample gas and acquiring its spectral data at different temperatures to obtain the reference spectral sequence data also includes the following sub-steps: The internal temperatures of the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region are adjusted using corresponding temperature control devices to be the optimal low temperature, HT, and optimal high temperature, respectively. Any one of the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region is designated as the first gas region. The first sample gas is passed through the first gas region, and after the first sample gas has completely entered the first gas region and stayed there for the optimal time, the spectral data of the first sample gas is collected using a mid-infrared spectrometer and recorded as the spectral data of the corresponding region. The first sample gas is passed sequentially through the low-temperature gas region, the normal-temperature gas region, and the high-temperature gas region to obtain the corresponding low-temperature spectral data, normal-temperature spectral data, and high-temperature spectral data, which are then labeled as reference spectral sequence data.
5. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 4, characterized in that, The absorption feature extraction and spectral feature extraction processes based on reference spectral sequence data, resulting in absorption feature data and spectral feature data, include the following sub-steps: For any gas absorption peak in the low-temperature spectral data, room-temperature spectral data, and high-temperature spectral data, it is denoted as the first absorption peak; the peak intensity and peak position of the first absorption peak in the low-temperature spectral data, room-temperature spectral data, and high-temperature spectral data are obtained respectively, and denoted as low-temperature peak intensity DQ, room-temperature peak intensity CQ, high-temperature peak intensity GQ, low-temperature peak position DW, room-temperature peak position CW, and high-temperature peak position GW; CQ and CW are marked as the original peak intensity YQ and the original peak position YW in sequence.
6. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 5, characterized in that, The absorption feature extraction and spectral feature extraction processes based on reference spectral sequence data, to obtain absorption feature data and spectral feature data, also include the following sub-steps: The rate of change of the peak intensity of the first absorption peak is calculated using the first formula, which is as follows: Where QB represents the peak intensity change rate; and the peak position shift of the first absorption peak is calculated using the second formula, which is as follows: Where WB represents the peak position offset; Combine YQ, YW, QB and WB to form the first characteristic vector of the first absorption peak, denoted as MX={m1, m2, m3, m4}, where m1, m2, m3 and m4 represent YQ, YW, QB and WB respectively in order; repeatedly obtain the first characteristic vectors of all gas absorption peaks in low temperature spectral data, room temperature spectral data and high temperature spectral data, and denot them as MX(1), MX(2), ..., MX(n) respectively in order; combine MX(1), MX(2), ..., MX(n) to form the absorption characteristic vector of the corresponding reference sample gas, denoted as HX={MX(1), MX(2), ..., MX(n)}; Repeatedly acquire the absorption feature vectors of all reference sample gases to obtain absorption feature data.
7. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 6, characterized in that, Based on the reference spectral sequence data, absorption feature extraction and spectral feature extraction are performed to obtain absorption feature data and spectral feature data. Point a includes the following sub-steps: Based on the room temperature spectral data of the first sample gas, the spectral range of the room temperature spectral data is evenly divided into k1 intervals, which are sequentially denoted as spectral interval 1 to spectral interval r, and any spectral interval is denoted as spectral interval i, where k1 is the number of intervals set. Obtain the average, standard deviation, and maximum absorbance within spectral interval i, and denote them as UP, UB, and UM in order; then arrange all absorbance values within spectral interval i in ascending order, and obtain the difference between the 25th percentile absorbance and the 75th percentile absorbance, which is denoted as UC. Combine UP, UB, UM, and UC into the second feature vector of interval i, denoted as MYi{e1, e2, e3, e4}, where e1, e2, e3, and e4 represent UP, UB, UM, and UC in order. Repeat this process to obtain the second feature vectors of all spectral intervals and combine them into the corresponding spectral feature vector of the reference sample gas, denoted as HY={MY1, MY2, ..., MYr}. Repeatedly acquire the spectral feature vectors of all reference sample gases to obtain spectral feature data.
8. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 7, characterized in that, The gas category identification model based on the support vector machine model, and utilizing absorption feature data and spectral feature data, includes the following sub-steps: The absorption feature data and spectral feature data are normalized according to their respective data types, scaling the values of all data in the absorption feature data and spectral feature data to [0, 1]. After completion, normalized absorption data and normalized spectral data are obtained. The first original recognition model and the second original recognition model are constructed based on the support vector machine model, respectively. The input dimension of the first original recognition model is set to n*4, the kernel function of the first original recognition model is set to KE1, the regularization parameter is set to C1, the optimization tolerance is set to TO1, and the first original recognition model is trained using normalized absorption data. After completion, the first category recognition model is obtained. Set the input dimension of the first original recognition model to r*4, set the kernel function of the second original recognition model to KE2, the regularization parameter to C2, and the optimization tolerance to TO2. Use the normalized spectral data to train the first original recognition model, and after completion, obtain the second category recognition model; Denote the first category recognition model and the second category recognition model as the gas category recognition model.
9. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 8, characterized in that, Based on the gas category recognition model, obtain the gas category composition of the detected gas, and perform spectral separation processing, including the following sub-steps: For the mixed gas of CO and VOCs to be detected, denoted as the to-be-detected mixed gas, collect the low-temperature spectral data, normal-temperature spectral data, and high-temperature spectral data corresponding to the to-be-detected mixed gas, and perform absorption feature extraction processing and spectral feature extraction processing to obtain the corresponding absorption feature vectors and spectral feature vectors, and perform normalization processing, and then input them into the corresponding first category recognition model and second category recognition model to obtain the first recognition result and the second recognition result; If the first recognition result and the second recognition result are exactly the same, mark the first recognition result and the second recognition result as the gas composition result; If the first recognition result and the second recognition result are not completely the same, obtain the same part of the first recognition result and the second recognition result, denoted as the same composition result, obtain the total number of gas categories in the same composition result, denoted as BZ0; and obtain the absorption peak range of all gases in the same composition result under standard conditions, and obtain the logarithm of the gases with overlapping absorption peak ranges, denoted as DZ0; If BZ0>k2 and DZ0<k3, mark the second recognition result as the gas composition result, otherwise mark the first recognition result as the gas composition result, where k2 and k3 are the set threshold numbers.
10. The spectral feature extraction method for simultaneous detection of CO and VOCs in the mid-infrared band according to claim 9, characterized in that, Based on the gas category recognition model, obtain the gas category composition of the detected gas, and the spectral separation processing also includes the following sub-steps: Denote the normal-temperature spectral data of the to-be-detected mixed gas as the standard spectral data. According to the absorption peak range of all gases in the corresponding gas composition result under standard conditions, obtain the gases with overlapping absorption peak ranges, denoted as the overlapping gases; obtain the spectral matrix corresponding to the overlapping gases in the standard spectral data, denoted as the mixed spectral matrix, and obtain the standard spectral matrices of the overlapping gases respectively; use the least squares method to fit the mixed spectral matrix and the standard spectral matrices to obtain the spectral absorption peaks of the overlapping gases respectively.
Citation Information
Patent Citations
Near-infrared spectrum feature extraction method and device
CN110658156A