Gas detection method and gas detection device
By converting gas spectral data into two-dimensional spectral data through quantum cascade laser and Hilbert space mapping technology, combined with lightweight convolutional neural network, the problems of high equipment cost, complex operation and poor real-time performance of existing gas detection technology are solved, and efficient, accurate and real-time monitoring of trace gases is achieved.
Patent Information
- Application Number
- CN202510615343.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-05-14
AI Technical Summary
Existing gas detection technologies have problems such as high equipment cost, complex operation, inability to achieve real-time online monitoring, and high destructiveness to samples when detecting trace gases. They are unable to meet the high timeliness requirements of modern industrial and environmental monitoring.
Quantum cascade laser is used to acquire gas spectrum data, and the one-dimensional gas spectrum data is converted into two-dimensional target spectrum data through the Hilbert space mapping method. The data is then input into a lightweight convolutional neural network for gas concentration detection, achieving efficient and accurate measurement of gas concentration.
It achieves high-sensitivity, low-cost, real-time monitoring of trace gases, is suitable for on-site detection and mobile monitoring, and improves the accuracy and timeliness of gas concentration detection.
Smart Images

Figure CN120142193B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of gas detection and data processing, and more specifically, to a gas detection method, a gas detection device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Gas detection is crucial in areas such as environmental protection, industrial production, and medical diagnosis. With the rapid development of industrialization and urbanization, air pollution is becoming increasingly severe, and the need for accurate detection of trace gases (gases with concentrations below one part per million) is becoming increasingly urgent. For example, changes in the concentration of trace gases such as methane and carbon monoxide in the atmosphere directly affect the greenhouse effect and air quality. Real-time monitoring of these gases is key to assessing environmental conditions and developing emission reduction strategies. Trace gas detection also plays an irreplaceable role in natural gas leak detection, chemical process control, and early disease diagnosis.
[0003] In the process of realizing the concept of this application, it was found that when the related technology performs gas detection, the concentration of the gas to be detected obtained is quite different from the actual concentration, which makes it difficult to accurately reflect the actual situation of the gas. Summary of the Invention
[0004] In view of this, the present application provides a gas detection method, a gas detection device, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] One aspect of the present application provides a gas detection method, comprising:
[0006] Acquiring gas spectrum data, wherein the gas spectrum data is obtained by detecting a mixed gas in a gas pool using a quantum cascade laser, the mixed gas including the gas to be detected;
[0007] Iterate steps 1 to 3:
[0008] Step 1: obtaining a plurality of local index information based on the global index information of the gas spectrum data, wherein one local index information corresponds to one coordinate system quadrant, and the global index information represents the coordinate curves of the plurality of signals in the gas spectrum data in the coordinate system;
[0009] Step 2: Based on the Hilbert space mapping method, perform quadrant flipping and rotation processing on the coordinate system quadrant of at least one of the above local index information to obtain the initial global coordinates;
[0010] Step 3: Using the initial global coordinates as new global index information to calculate new initial global coordinates, and determining the new initial global coordinates corresponding to the target order of the Hilbert curve as target spectral data;
[0011] The target spectrum data is input into the gas concentration detection model, and the gas concentration information of the gas to be detected is output.
[0012] Another aspect of the present application provides a gas detection device, comprising:
[0013] an acquisition module for acquiring gas spectrum data, wherein the gas spectrum data is obtained by detecting a mixed gas in a gas pool using a quantum cascade laser, wherein the mixed gas includes the gas to be detected;
[0014] Iteration module, used to iteratively execute steps 1 to 3:
[0015] Step 1: Obtain multiple local index information based on the global index information of the gas spectrum data, wherein each local index information corresponds to a coordinate system quadrant, and the global index information represents the coordinate curves of multiple signals in the gas spectrum data in different coordinate system quadrants;
[0016] Step 2: Based on the Hilbert space mapping method, perform quadrant flipping and rotation processing on the coordinate system quadrant of at least one of the above local index information to obtain the initial global coordinates;
[0017] Step 3: Using the initial global coordinates as new global index information to calculate new initial global coordinates, and determining the new initial global coordinates corresponding to the target order of the Hilbert curve as target spectral data;
[0018] The detection module is used to input the above-mentioned target spectrum data into the gas concentration detection model and output the gas concentration information of the above-mentioned gas to be detected.
[0019] Another aspect of the present application provides an electronic device, comprising:
[0020] one or more processors;
[0021] a memory for storing one or more programs,
[0022] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.
[0023] Another aspect of the present application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described above when executed.
[0024] Another aspect of the present application provides a computer program product, which includes computer-executable instructions. When the instructions are executed, the instructions are used to implement the method described above.
[0025] According to an embodiment of the present application, local index information corresponding to different coordinate system quadrants is obtained based on the global index information of the gas spectral data. The coordinate system quadrants of the local index information are quadrant-flipped and rotated based on the Hilbert space mapping method to obtain initial global coordinates. After multiple iterations, the new initial global coordinates corresponding to the target order of the Hilbert curve are determined as target spectral data. The target spectral data is input into a gas concentration detection model, and gas concentration information of the gas to be detected is output. Because the global index information based on the gas spectral data is divided into local index information and quadrant-flipped and rotated, the one-dimensional gas spectral data can be converted into two-dimensional target spectral data, thereby fully expressing the characteristic information in the gas spectral data, thereby improving the accuracy of gas concentration detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The above and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:
[0027] Figure 1 An exemplary system architecture to which a gas detection method according to an embodiment of the present application can be applied is shown;
[0028] Figure 2 A flow chart of a gas detection method according to an embodiment of the present application is shown;
[0029] Figure 3 A schematic diagram showing gas spectrum data according to an embodiment of the present application is shown;
[0030] Figure 4 A training flow chart of a gas concentration detection model according to an embodiment of the present application is shown;
[0031] Figure 5 A schematic diagram showing global index information according to an embodiment of the present application is shown;
[0032] Figure 6 A schematic diagram showing target spectrum data according to an embodiment of the present application is shown;
[0033] Figure 7 A block diagram of a gas detection device according to an embodiment of the present application is shown;
[0034] Figure 8 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0035] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.
[0036] The terms used herein are only for describing specific embodiments and are not intended to limit this application. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0037] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0038] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0039] Traditional trace gas detection technologies, such as gas chromatography (GC) and mass spectrometry (MS), although they perform well in terms of detection sensitivity and accuracy, have many limitations in practical applications. First, these technologies usually rely on large and precise instruments, which are expensive to purchase and maintain, making them difficult to popularize in resource-limited scenarios. Second, the operation process is complicated and requires professionals to perform sample pretreatment and instrument calibration, which is time-consuming and labor-intensive. More importantly, most traditional methods are offline detection technologies that cannot achieve real-time online monitoring and cannot meet the high timeliness requirements for rapid changes in gas concentrations in modern industrial production and environmental monitoring. In addition, traditional technologies are highly destructive to samples and cannot be applied to certain scenarios requiring non-destructive testing.
[0040] In view of this, an embodiment of the present application provides a gas detection method and a gas detection device, which include acquiring gas spectral data, wherein the gas spectral data is obtained by a quantum cascade laser detecting a mixed gas in a gas pool, and the mixed gas includes a gas to be detected; iteratively performing the following operations: according to the global index information of the gas spectral data, obtaining multiple local index information, wherein one local index information corresponds to a coordinate system quadrant, and the global index information represents the coordinate curves of multiple signals in the gas spectral data in different coordinate system quadrants; based on the Hilbert space mapping method, performing quadrant flipping and rotation processing on the coordinate system quadrant of at least one local index information to obtain an initial global coordinate; using the initial global coordinate as a new global index information to calculate a new initial global coordinate, and determining the new initial global coordinate corresponding to the target order of the Hilbert curve as the target spectral data; inputting the target spectral data into a gas concentration detection model, and outputting the gas concentration information of the gas to be detected.
[0041] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of all data involved (including, but not limited to, user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and maintain the security of user personal information and network security.
[0042] Figure 1 FIG. 1 shows an exemplary system architecture 100 to which a gas detection method according to an embodiment of the present application can be applied. It should be noted that, Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present application can be applied, to help those skilled in the art understand the technical content of the present application, but does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.
[0043] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, a server 105, and a quantum cascade laser 106. The network 104 is used as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, the server 105, and the quantum cascade laser 106. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0044] A user may use a first terminal device 101, a second terminal device 102, or a third terminal device 103 to interact with a server 105 via a network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, or the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software (for example only).
[0045] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0046] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.
[0047] The quantum cascade laser (QCL) 106 is a laser based on a semiconductor quantum well structure. Its operating wavelength spans the mid-infrared to far-infrared range, perfectly matching the characteristic absorption lines of many gases. This characteristic gives the QCL high sensitivity and selectivity, enabling precise identification and concentration measurement of specific gases. Furthermore, the QCL offers the advantage of fast response, enabling real-time monitoring of gas concentrations within milliseconds, meeting the needs of online testing. Furthermore, the QCL's compact size and low power consumption make it easy to integrate into portable detection equipment, making it suitable for scenarios such as on-site testing and mobile monitoring. The quantum cascade laser 106 can detect mixed gases in a gas pool to obtain gas spectral data.
[0048] It should be noted that the gas detection method provided in the embodiment of the present application can generally be executed by the server 105. Accordingly, the gas detection device provided in the embodiment of the present application can generally be set in the server 105. The gas detection method provided in the embodiment of the present application can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the gas detection device provided in the embodiment of the present application can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the gas detection method provided in the embodiment of the present application can also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or can also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the gas detection device provided in the embodiment of the present application can also be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.
[0049] It should be understood that Figure 1 The number of terminal devices, networks, servers, and quantum cascade lasers in the embodiment is merely illustrative. Any number of terminal devices, networks, servers, and quantum cascade lasers may be provided as required.
[0050] Figure 2 A flow chart of a gas detection method according to an embodiment of the present application is shown. Figure 3 A schematic diagram of gas spectrum data according to an embodiment of the present application is shown.
[0051] like Figure 2 As shown, the gas detection method includes operations S201 to S205.
[0052] In operation S201 , gas spectrum data is acquired, wherein the gas spectrum data is obtained by using a quantum cascade laser to detect a mixed gas in a gas pool, where the mixed gas includes a gas to be detected.
[0053] Iteratively perform operations S202 to S204:
[0054] In operation S202 , a plurality of local index information is obtained based on the global index information of the gas spectrum data, wherein one local index information corresponds to one coordinate system quadrant, and the global index information represents the coordinate curves of the plurality of signals in the gas spectrum data in the coordinate system, i.e., step 1.
[0055] In operation S203 , based on the Hilbert space mapping method, quadrant flipping and rotation processing is performed on the coordinate system quadrant of at least one local index information to obtain initial global coordinates, that is, step 2.
[0056] In operation S204 , the initial global coordinates are used as new global index information to calculate new initial global coordinates, and the new initial global coordinates corresponding to the target order of the Hilbert curve are determined as target spectrum data, ie, step 3 .
[0057] In operation S205 , the target spectrum data is input into a gas concentration detection model, and gas concentration information of the gas to be detected is output.
[0058] According to an embodiment of the present application, the gas to be detected may be a trace gas in the air with a concentration lower than one part per million, such as methane, carbon monoxide, etc. in the air.
[0059] In a specific embodiment, taking carbon monoxide as an example of the gas to be detected, the interior of the gas pool adopts a high-precision polishing design and is equipped with a real-time temperature and pressure monitoring module to ensure a stable experimental environment and reduce the impact of external condition fluctuations on the detection results. High-purity nitrogen is used to dilute a CO standard gas of known concentration, and a gas sample with a concentration range of 50 ppb to 1000 ppb is configured and flushed into the above-mentioned gas pool. It should be noted that in the actual use of the gas detection method, the gas to be detected of unknown concentration in any mixed gas can be detected. The above example is only for verifying the accuracy of the gas detection method of the embodiment of the present application.
[0060] In a specific embodiment, a quantum cascade laser is used as a mid-infrared light source, with a central wavelength of 4.6 μm, corresponding to the characteristic absorption peak of CO. Thus, the quantum cascade laser can obtain the gas spectrum data of the mixed gas. The gas spectrum data is a one-dimensional time series signal, such as Figure 3 As shown, Figure 3 The horizontal axis is time and the vertical axis is light intensity.
[0061] According to an embodiment of the present application, based on the global index information of the gas spectrum data, it is divided into local index information corresponding to different coordinate system quadrants. For each coordinate system quadrant, the quadrant flipping and rotation method of the coordinate system quadrant is determined according to the local index information, so as to calculate the initial global coordinates. The initial global coordinates are repeatedly used as new global index information, thereby dividing a new global index information into four new local index information again, and then obtaining new initial global coordinates, until the number of iterations reaches the target order n of the Hilbert curve, thereby determining the new initial global coordinates corresponding to the target order n as the target spectrum data.
[0062] It should be noted that the target order n ranges from 4 to 8, and the specific value can be set according to actual needs, for example, it can be 6.
[0063] In a specific embodiment, the global index information of the gas spectrum data is one-dimensional data, and the Hilbert space mapping method can be used to obtain a one-dimensional data. n In this way, the spatial correlation of gas spectral data can be preserved.
[0064] According to an embodiment of the present application, the target spectrum data is input into a trained gas concentration detection model to obtain the gas concentration information of the gas to be detected.
[0065] According to an embodiment of the present application, local index information corresponding to different coordinate system quadrants is obtained based on the global index information of the gas spectral data. The coordinate system quadrants of the local index information are quadrant-flipped and rotated based on the Hilbert space mapping method to obtain initial global coordinates. After multiple iterations, the new initial global coordinates corresponding to the target order of the Hilbert curve are determined as target spectral data. The target spectral data is input into a gas concentration detection model, and gas concentration information of the gas to be detected is output. Because the global index information based on the gas spectral data is divided into local index information and quadrant-flipped and rotated, the one-dimensional gas spectral data can be converted into two-dimensional target spectral data, thereby fully expressing the characteristic information in the gas spectral data, thereby improving the accuracy of gas concentration detection.
[0066] According to an embodiment of the present application, quadrant flipping and rotation processing is performed on a coordinate system quadrant of at least one local index information to obtain initial global coordinates, including: for each coordinate system quadrant, determining the quadrant flipping and rotation method of the coordinate system quadrant according to the local index information to calculate the initial coordinates corresponding to the coordinate system quadrant; generating the initial global coordinates of the current number of iterations based on multiple initial coordinates corresponding to different coordinate system quadrants.
[0067] According to the embodiments of the present application, different coordinate system quadrants have different quadrant flipping and rotation methods. For example, they can be rotated clockwise by an angle or counterclockwise by an angle. Therefore, for each coordinate system quadrant, it is necessary to determine the corresponding quadrant flipping and rotation method based on its local index information, so as to determine the initial coordinates of the coordinate system quadrant. By integrating the initial coordinates of different coordinate system quadrants, the initial global coordinates of the current number of iterations can be obtained.
[0068] According to an embodiment of the present application, the quadrant flipping and rotation method of the coordinate system quadrant is determined based on the local index information, including: performing a quadrant rotation operation of a first angle on the first quadrant of multiple coordinate system quadrants; performing a quadrant rotation operation of a second angle on the second quadrant of multiple coordinate system quadrants.
[0069] According to an embodiment of the present application, the first quadrant may refer to a coordinate system quadrant formed by x < 0 and y > 0 in a Cartesian coordinate system, and the second quadrant may refer to a coordinate system quadrant formed by x > 0 and y < 0. The first quadrant and the second quadrant may also be other quadrants in a Cartesian coordinate system.
[0070] According to an embodiment of the present application, a clockwise rotation of a first angle can be performed on the first quadrant, and a counterclockwise rotation of a second angle can be performed on the second quadrant. The values of the first angle and the second angle can be set according to actual needs. For example, the values of the first angle and the second angle can both be 90 degrees or 0.
[0071] In a specific embodiment, at the first iteration, the initial global coordinate H1 is as shown in formula (1):
[0072] H1 = (1)
[0073] in, Represents the first quadrant after the quadrant rotation operation, Represents the second quadrant after the quadrant rotation operation.
[0074] According to an embodiment of the present application, in the subsequent iteration process, the initial global coordinate H of the i-th iteration i As shown in formula (2):
[0075] H i = (2)
[0076] in, Indicates a 90-degree clockwise rotation. Indicates a 90-degree counterclockwise rotation. 、 、 、 Represent the initial global coordinates at the i-1th iteration The quadrant coordinate values at the upper left, upper right, lower left, and lower right positions in , for example, when i=2, That is, in formula (1) .
[0077] It should be noted that the quadrant flipping and rotation may be performed on only some of the four coordinate system quadrants, and it is not necessary to perform the operation on all the coordinate system quadrants.
[0078] According to an embodiment of the present application, the initial global coordinates are used as new gas spectrum data to calculate new initial global coordinates, and the new initial global coordinates corresponding to the target order of the Hilbert curve are determined as target spectrum data, including: when the number of iterations is less than the numerical value of the target order, the initial global coordinates are used as new global index information to calculate new initial global coordinates; when the number of iterations is equal to the numerical value of the target order, the new initial global coordinates are determined as the target spectrum data.
[0079] According to an embodiment of the present application, when the number of iterations i is less than the value n of the target order, the initial global coordinate H i As the new global index information to calculate the new initial global coordinate H i+1 , when the number of iterations i is equal to the target order value n, the new initial global coordinate H n The target spectrum data can be expressed as follows:
[0080] (x,y)=Hilbert(d,n)(3)
[0081] Among them, (x, y) is the coordinate point on the Hilbert curve, d is the global index information of the one-dimensional gas spectrum data, and n is the target order of the Hilbert curve. When n=6, in this way, the one-dimensional gas spectrum data is mapped to 2 6 ×2 6 =64×64 two-dimensional image M (i.e., target spectrum data), the grayscale value of each pixel in M corresponds to the amplitude of the gas spectrum data.
[0082] According to an embodiment of the present application, before generating multiple local index information, it also includes: denoising the gas spectral data based on the wavelet transform method to obtain denoised gas spectral data; normalizing the denoised gas spectral data to obtain new gas spectral data, so as to generate target spectral data based on the new gas spectral data.
[0083] According to embodiments of the present application, wavelet transforms can be used to denoise raw gas spectral data, eliminating high-frequency noise and baseline drift while preserving the effective characteristics of the spectral signal. The denoised gas spectral data can then be normalized to scale the signal amplitude to the range [0, 1], thereby eliminating the effects of QCL gain and background light intensity on the gas spectral data.
[0084] Figure 4A training flow chart of a gas concentration detection model according to an embodiment of the present application is shown.
[0085] According to an embodiment of the present application, a method for training a gas concentration detection model includes operations S401 to S406.
[0086] In operation S401 , a training data set is acquired, wherein the training data set includes a plurality of training spectral data obtained by detecting at least one training gas cell and label concentration data corresponding to each training spectral data.
[0087] In operation S402 , for each piece of training spectrum data, a convolution process is performed on the training spectrum data using a standard convolution layer to obtain a first convolution feature.
[0088] In operation S403, the first convolutional features are normalized using the first batch of normalization layers to obtain first normalized features.
[0089] In operation S404, the first normalized features are processed using m depth-wise separation convolutional networks to obtain target pooled features.
[0090] In operation S405, the target pooling features are processed using a fully connected layer to obtain predicted concentration information, wherein the initial concentration detection model includes a standard convolutional layer, a first batch of normalization layers, and m depth-separated convolutional networks.
[0091] In operation S406 , the model parameters of the initial concentration detection model are iteratively adjusted according to the predicted concentration information and the label concentration data to obtain a trained gas concentration detection model.
[0092] In a specific embodiment, for each training spectral data, which can be a 64×64 spectral grayscale image, the training spectral data is first convolved using a standard convolution layer to obtain a first convolution feature. The standard convolution layer can be a standard 3×3 convolution layer with 16 convolution kernels and a step size of 1. Then, the first convolution feature is normalized using the first batch of normalization layers, combined with the ReLU activation function to enhance the feature expression ability and accelerate the training process, thereby obtaining the first normalized feature. Then, m deep separation convolution networks are used to process the first normalized feature to obtain the target pooled feature.
[0093] In one specific embodiment, after feature extraction, the regression prediction phase begins. This phase uses a fully connected layer to regress the gas concentration. First, a fully connected layer containing 128 neurons receives the target pooled features and applies a nonlinear transformation using the ReLU activation function to enhance feature learning. Finally, a fully connected layer containing one neuron performs the final regression prediction of the gas concentration. This layer uses a linear activation function to output the gas concentration value, i.e., the predicted concentration information.
[0094] According to an embodiment of the present application, the predicted concentration information and the labeled concentration data are input into a loss function to calculate a loss result, where the loss function can be a mean square error loss function, a cross entropy loss function, etc. The model parameters of the initial concentration detection model are then iteratively adjusted based on the loss result to obtain a trained gas concentration detection model.
[0095] According to an embodiment of the present application, the initial concentration detection model is a lightweight convolutional neural network that optimizes computational complexity, reduces the number of parameters, and improves inference speed while ensuring high recognition accuracy, enabling it to run in real time on embedded devices or edge computing platforms.
[0096] According to an embodiment of the present application, m depth-wise separation convolutional networks are used to process the first normalized feature to obtain the target pooled feature, including: in the case of i≠m, for the i-th depth-wise separation convolutional network, the first depth-wise convolutional layer is used to process the input data to obtain the second convolutional feature, and the input data includes the first normalized feature or the first pooled feature output by the i-1-th depth-wise separation convolutional network; the second convolutional feature is processed by the second batch normalization layer to obtain the second normalized feature; the second normalized feature is processed by the first point-by-point convolutional layer to obtain the third convolutional feature; the third convolutional feature is processed by the maximum pooling layer to obtain the first pooled feature; in the case of i=m, the first pooled feature output by the m-1-th depth-wise separation convolutional network is processed by the m-th depth-wise separation convolutional network to obtain the target pooled feature.
[0097] According to an embodiment of the present application, the number of depth separation convolutional networks can be specifically set according to actual needs, for example, it can be 4. Among them, the first three depth separation convolutional networks use the maximum pooling layer, and the last depth separation convolutional network uses the global average pooling layer.
[0098] In a specific embodiment, for the first deep separation convolutional network, the first deep convolutional layer is first used to process the input data, which can be the first normalized feature. The first deep convolutional layer can be a deep convolutional layer including 16 3×3 deep convolution kernels. The second batch normalization layer is used to process the second convolutional feature, combined with the ReLU activation function to extract the local features of the training spectral data to obtain the second normalized feature. Then, the first point-by-point convolutional layer is used to process the second normalized feature to obtain the third convolutional feature. The first point-by-point convolutional layer is a 1×1 point-by-point convolutional layer, which can expand the number of channels to 32 to increase the information interaction capability between channels. In order to further compress the data scale and enhance the robustness of the features, the network adds a maximum pooling layer during the feature extraction process. The pooling window of the first maximum pooling layer is 2×2, with a step size of 2, which reduces the feature map size of the third convolutional feature to 32×32, which can reduce the amount of calculation while removing redundant information.
[0099] According to an embodiment of the present application, for the second depth separation convolutional network, the first depth convolutional layer processes the first pooled feature output by the first depth separation convolutional network. The first depth convolutional layer contains 32 3×3 convolution kernels to obtain the second convolutional feature. The second convolutional feature is processed by the second batch normalization layer to obtain the second normalized feature. The second normalized feature is then processed by the first point-by-point convolutional layer to obtain the third convolutional feature. The first point-by-point convolutional layer can expand the number of channels to 64 to enhance the multi-channel feature expression capability in the spectral image of the training spectral data. Subsequently, the feature map size of the third convolutional feature is further reduced to 16×16 through a 2×2 maximum pooling layer to compress the data dimension while reducing the computational burden.
[0100] According to an embodiment of the present application, for the third depth separation convolutional network, the first depth convolutional layer is used to process the first pooled feature output by the second depth separation convolutional network to obtain the second convolutional feature. The first depth convolutional layer contains 64 3×3 convolution kernels, which are sequentially passed through the second batch normalization layer and the first point-by-point convolutional layer to obtain the third convolutional feature. The first point-by-point convolutional layer can expand the number of channels to 128, and then the 2×2 maximum pooling layer is used to reduce the feature map size of the third convolutional feature to 8×8, thereby obtaining the first pooled feature.
[0101] According to an embodiment of the present application, the target pooling feature can be obtained by processing the first pooling feature output by the third depth separation convolutional network through the last depth separation convolutional network.
[0102] According to an embodiment of the present application, the mth depth separation convolutional network is used to process the first pooling feature output by the m-1th depth separation convolutional network to obtain the target pooling feature, including: using the second depth convolutional layer to process the first pooling feature output by the m-1th depth separation convolutional network to obtain the fourth convolutional feature; using the third batch normalization layer to process the fourth convolutional feature to obtain the third normalized feature; using the second point-by-point convolutional layer to process the third normalized feature to obtain the fifth convolutional feature; using the global average pooling layer to process the fifth convolutional feature to obtain the target pooling feature; wherein, during the training process of the gas concentration detection model, model optimization processing is performed based on preset pruning and quantization methods to obtain the optimized gas concentration detection model.
[0103] According to an embodiment of the present application, for the last depth separation convolutional network, in the final stage of feature extraction, the second depth convolutional layer uses 128 3×3 convolution kernels to process the first pooled feature output by the previous depth separation convolutional network to obtain the fourth convolutional feature, and uses the third batch normalization layer to process the fourth convolutional feature to obtain the third normalized feature, and uses the second point-by-point convolutional layer to process the third normalized feature to obtain the fifth convolutional feature. The second point-by-point convolutional layer expands the number of channels to 256 through point-by-point convolution, and converts the feature map of the fifth convolutional feature into a channel dimension of 1×1×256 through the global average pooling layer. Global average pooling can reduce model parameters, improve the global representation capability of features, and avoid the large amount of parameter redundancy caused by traditional fully connected layers.
[0104] According to an embodiment of the present application, in order to further optimize the gas concentration detection model and make it suitable for resource-constrained devices, this embodiment adopts model pruning and quantization strategies for optimization in the later stages of training. Model pruning technology reduces redundant calculations and improves inference speed by removing channels and weights that have little impact on predictions, while maintaining the overall performance of the model. Quantization technology reduces model storage usage and accelerates the inference process by converting floating-point weights into 8-bit fixed-point numbers. The preset pruning and quantization methods for model optimization processing are specifically shown as follows:
[0105] In a specific embodiment, the specific steps of the preset pruning and quantization method are: comprehensively evaluate the gas concentration detection model on the development board, calculate the inference time and parameter quantity, and analyze it through the torchsummary tool. It is found that the parameter distribution of the second deep separation convolutional network has obvious fluctuations, and the L1 norm standard deviation reaches ±0.18. This value suggests that the deep separation convolutional network has a large pruning space, and a progressive structured pruning strategy can be adopted. For example, the first deep convolution layer of 16 channels can be analyzed first. It is found that the activity of the 3rd, 7th, and 12th channels is significantly low, and its L1 norm is 35% lower than the mean. In the first round of pruning, PyTorch's prune.ln_structured interface can be used to remove redundant channels. At the same time, to ensure the stability of the model, only the first two first deep convolutional layers are processed and the pruning ratio is controlled within 15%. After completing the initial pruning, 10% of the data volume of the original training data set is used for short-term fine-tuning. As the pruning process deepens, the pruning range is gradually expanded in subsequent rounds, but the second deep convolutional layer with 256 channels in the last deep separation convolutional network is protected, and at least 192 channels are always retained to maintain the key feature extraction capability.
[0106] According to an embodiment of the present application, gas spectrum data is collected in the following manner: a target drive signal is generated based on a triangular wave signal of a first frequency and a sinusoidal signal of a second frequency, wherein the second frequency is greater than the first frequency; when the target drive signal is applied to a quantum cascade laser, the quantum cascade laser emits a detection light signal to pass through the mixed gas in the gas pool; the detection light signal passing through the mixed gas is reflected by a reflective lens with a target reflectivity to obtain a reflected light signal; and the reflected light signal is processed by a mercury cadmium telluride detector to obtain gas spectrum data.
[0107] According to the embodiments of this application, in terms of laser drive and modulation, a low-frequency triangular wave signal at a first frequency (e.g., 20 Hz) can be used to drive the QCL for wavelength scanning, covering the characteristic absorption peak of CO and ensuring complete acquisition of the spectral information of the gas to be detected. A high-frequency sinusoidal wave signal at a second frequency (e.g., 10 kHz) is used to amplitude modulate the QCL, enhancing the extraction efficiency of the absorption signal of the gas to be detected while suppressing low-frequency noise interference. A high-precision current amplifier integrated in the laser drive circuit, along with temperature compensation and overcurrent protection, ensures the stability of the output wavelength and intensity of the detection optical signal.
[0108] According to an embodiment of the present application, the quantum cascade laser is driven by a target drive signal generated based on a triangular wave signal and a sinusoidal signal. The quantum cascade laser emits a detection light signal to pass through the mixed gas in the gas pool. At this time, the optical path is enhanced by a reflective lens with a target reflectivity, further improving the detection sensitivity and ensuring the effective capture of weak absorption signals. A mercury cadmium telluride detector is then used, which has a response time of less than 500 ns and can quickly capture the reflected light signal under high-frequency modulation, thereby obtaining gas spectrum data. The specific value of the target reflectivity can be set according to specific needs, for example, the reflectivity is 99.99923%.
[0109] Figure 5 A schematic diagram of global index information according to an embodiment of the present application is shown. Figure 6 A schematic diagram of target spectral data according to an embodiment of the present application is shown.
[0110] According to an embodiment of the present application, the gas spectrum data includes a plurality of detection signals with different light intensities.
[0111] According to an embodiment of the present application, global index information is generated in the following manner: based on the light intensity of each detection signal, the target point corresponding to each detection signal is determined in the initial coordinate system; for each coordinate system quadrant in the initial coordinate system, based on the distance between each target point and the associated point, multiple target points are connected to obtain an initial curve; based on the initial curves of multiple coordinate system quadrants, global index information is obtained.
[0112] According to the embodiment of the present application, the gas spectrum data can be divided into multiple detection signals according to the acquisition time, and the light intensity of each detection signal is different, see Figure 3 .
[0113] According to an embodiment of the present application, based on the light intensity of each detection signal, the target point position corresponding to each detection signal is determined in the initial coordinate system, such as Figure 5 For each coordinate system quadrant in the initial coordinate system, based on the distance between each target point and the associated point, multiple target points are connected to obtain the initial curve, that is, Figure 5 The blue curve in each box in . Based on the initial curves of multiple coordinate system quadrants, we can get Figure 5 Shown global index information. Figure 5 The horizontal and vertical coordinates have no actual physical meaning and only represent the coordinates.
[0114] According to an embodiment of the present application, in the process of generating the above-mentioned initial curve, the order of the target points is determined according to the space filling path of the Hilbert curve, thereby ensuring efficient data compression and feature preservation. The target spectral data calculated based on the global index information is presented in the form of a grayscale image, such as Figure 6 As shown in the figure, brighter areas correspond to strong absorption features in the spectral signal, while lower brightness areas correspond to noise or background signals. This graphical representation not only compresses the data size but also presents the characteristic information of gas spectral data in an intuitive form, providing efficient input data for subsequent gas concentration detection models. Figure 6 Different colors represent different light intensities.
[0115] According to an embodiment of the present application, in order to evaluate the performance of the gas concentration detection model, this embodiment conducted experiments on a certain gas spectrum dataset and compared it with traditional CNN and ResNet models. The experimental results show that while ensuring the recognition accuracy, the gas concentration detection model significantly reduces its computational complexity and improves the inference speed. For example, compared with the 1.2 GFLOPs computational complexity of the traditional CNN model, the gas concentration detection model only requires 0.25 GFLOPs, and the inference time is shortened from 35ms to 12ms, and the root mean square error (RMSE) of the gas concentration is maintained at 0.014, which is comparable to complex models such as ResNet-18, but the computational cost is much lower than the latter. Therefore, the gas concentration detection model can run efficiently on embedded devices or edge computing platforms and is suitable for real-time gas concentration detection tasks.
[0116] Figure 7 A block diagram of a gas detection device according to an embodiment of the present application is shown.
[0117] like Figure 7 As shown, the gas detection device 700 includes an acquisition module 710 , an iteration module 720 , and a detection module 730 .
[0118] The acquisition module 710 is used to acquire gas spectrum data, wherein the gas spectrum data is obtained by using a quantum cascade laser to detect a mixed gas in a gas pool, where the mixed gas includes the gas to be detected.
[0119] The iteration module 720 is used to iteratively perform the following operations: obtaining multiple local index information based on the global index information of the gas spectral data, wherein one local index information corresponds to a coordinate system quadrant, and the global index information represents the coordinate curve of multiple signals in the gas spectral data in the coordinate system; based on the Hilbert space mapping method, performing quadrant flipping and rotation processing on the coordinate system quadrant of at least one local index information to obtain initial global coordinates; using the initial global coordinates as new global index information to calculate new initial global coordinates, and determining the new initial global coordinates corresponding to the target order of the Hilbert curve as the target spectral data.
[0120] The detection module 730 is used to input the target spectrum data into the gas concentration detection model and output the gas concentration information of the gas to be detected.
[0121] According to an embodiment of the present application, local index information corresponding to different coordinate system quadrants is obtained based on the global index information of the gas spectral data. The coordinate system quadrants of the local index information are quadrant-flipped and rotated based on the Hilbert space mapping method to obtain initial global coordinates. After multiple iterations, the new initial global coordinates corresponding to the target order of the Hilbert curve are determined as target spectral data. The target spectral data is input into a gas concentration detection model, and gas concentration information of the gas to be detected is output. Because the global index information based on the gas spectral data is divided into local index information and quadrant-flipped and rotated, the one-dimensional gas spectral data can be converted into two-dimensional target spectral data, thereby fully expressing the characteristic information in the gas spectral data, thereby improving the accuracy of gas concentration detection.
[0122] According to an embodiment of the present application, quadrant flipping and rotation processing is performed on a coordinate system quadrant of at least one local index information to obtain initial global coordinates, including: for each coordinate system quadrant, determining the quadrant flipping and rotation method of the coordinate system quadrant according to the local index information to calculate the initial coordinates corresponding to the coordinate system quadrant; generating the initial global coordinates of the current number of iterations based on multiple initial coordinates corresponding to different coordinate system quadrants.
[0123] According to an embodiment of the present application, the quadrant flipping and rotation method of the coordinate system quadrant is determined based on the local index information, including: performing a quadrant rotation operation of a first angle on the first quadrant of multiple coordinate system quadrants; performing a quadrant rotation operation of a second angle on the second quadrant of multiple coordinate system quadrants.
[0124] According to an embodiment of the present application, the initial global coordinates are used as new gas spectrum data to calculate new initial global coordinates, and the new initial global coordinates corresponding to the target order of the Hilbert curve are determined as target spectrum data, including: when the number of iterations is less than the numerical value of the target order, the initial global coordinates are used as new global index information to calculate new initial global coordinates; when the number of iterations is equal to the numerical value of the target order, the new initial global coordinates are determined as the target spectrum data.
[0125] According to an embodiment of the present application, the gas detection device 700 further includes a transformation module and a first normalization module.
[0126] The transformation module is used to perform denoising on the gas spectrum data based on the wavelet transform method to obtain denoised gas spectrum data.
[0127] The first normalization module is used to perform normalization processing on the denoised gas spectrum data to obtain new gas spectrum data, so as to generate target spectrum data according to the new gas spectrum data.
[0128] According to an embodiment of the present application, a training device for a gas concentration detection model includes a second acquisition module, a first convolution module, a second normalization module, a second convolution module, a prediction module, and an adjustment module.
[0129] The second acquisition module is used to acquire a training data set, wherein the training data set includes a plurality of training spectral data obtained by detecting at least one training gas pool and label concentration data corresponding to each training spectral data.
[0130] The first convolution module is used to perform convolution processing on each training spectrum data using a standard convolution layer to obtain a first convolution feature.
[0131] The second normalization module is used to normalize the first convolutional features using the first batch of normalization layers to obtain first normalized features.
[0132] The second convolution module is used to process the first normalized features using m depth-separated convolutional networks to obtain target pooled features.
[0133] The prediction module is used to process the target pooling features using the fully connected layer to obtain the predicted concentration information. The initial concentration detection model includes a standard convolutional layer, a first batch of normalization layers and m depth separation convolutional networks.
[0134] The adjustment module is used to iteratively adjust the model parameters of the initial concentration detection model according to the predicted concentration information and the label concentration data to obtain a trained gas concentration detection model.
[0135] According to an embodiment of the present application, the second convolution module includes a first convolution unit, a normalization unit, a second convolution unit, a pooling unit, and an obtaining unit.
[0136] The first convolution unit is used to process the input data using the first depth convolution layer for the i-th depth separation convolution network when i≠m, to obtain the second convolution feature, where the input data includes the first normalized feature or the first pooled feature output by the i-1th depth separation convolution network.
[0137] The normalization unit is used to process the second convolutional features using a second batch of normalization layers to obtain second normalized features.
[0138] The second convolution unit is used to process the second normalized feature using the first point-by-point convolution layer to obtain a third convolution feature.
[0139] The pooling unit is used to process the third convolution feature using the maximum pooling layer to obtain the first pooling feature.
[0140] The obtained unit is used to process the first pooled feature output by the m-1th depth separation convolutional network using the m-th depth separation convolutional network when i=m, and obtain the target pooled feature.
[0141] According to an embodiment of the present application, the obtaining unit includes a first convolution subunit, a normalization subunit, a second convolution subunit, and a pooling subunit.
[0142] The first convolution subunit is used to process the first pooled feature output by the m-1th depth separation convolutional network using the second depth convolutional layer to obtain the fourth convolution feature.
[0143] The normalization subunit is used to process the fourth convolutional features using the third batch of normalization layers to obtain third normalized features.
[0144] The second convolution subunit is used to process the third normalized feature using the second point-by-point convolution layer to obtain a fifth convolution feature.
[0145] The pooling subunit is used to process the fifth convolutional feature using the global average pooling layer to obtain the target pooling feature.
[0146] According to an embodiment of the present application, during the training process of the gas concentration detection model, model optimization processing is performed based on preset pruning and quantization methods to obtain an optimized gas concentration detection model.
[0147] According to an embodiment of the present application, gas spectrum data is collected by a generation unit, a detection unit, a reflection unit, and a first obtaining unit.
[0148] The generating unit is configured to generate a target driving signal according to a triangular wave signal of a first frequency and a sine wave signal of a second frequency, wherein the second frequency is greater than the first frequency.
[0149] The detection unit is used for causing the quantum cascade laser to emit a detection light signal to pass through the mixed gas in the gas pool when a target driving signal acts on the quantum cascade laser.
[0150] The reflection unit is used to reflect the detection light signal passing through the mixed gas by using a reflection lens with a target reflectivity to obtain a reflected light signal.
[0151] The first obtaining unit is used to process the reflected light signal using the mercury cadmium telluride detector to obtain gas spectrum data.
[0152] According to an embodiment of the present application, the gas spectrum data includes a plurality of detection signals with different light intensities.
[0153] According to an embodiment of the present application, the global index information is generated by a determining unit, a connecting unit, and a second obtaining unit.
[0154] The determination unit is used to determine the target point position corresponding to each detection signal in the initial coordinate system based on the light intensity of each detection signal.
[0155] The connection unit is used for connecting multiple target points based on the distance between each target point and the associated point in each coordinate system quadrant in the initial coordinate system to obtain an initial curve.
[0156] The second obtaining unit is used to obtain global index information according to the initial curves of the multiple coordinate system quadrants.
[0157] According to the embodiments of the present application, any number of modules, submodules, units, and subunits, or at least part of the functions of any number of them, can be implemented in one module. According to the embodiments of the present application, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present application, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present application, one or more of the modules, submodules, units, and subunits can be at least partially implemented as a computer program module, which can perform the corresponding functions when the computer program module is executed.
[0158] For example, any multiple of the acquisition module 710, the iteration module 720, and the detection module 730 can be combined into a single module / unit / sub-unit, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functionality of one or more of these modules / units / sub-units can be combined with at least part of the functionality of other modules / units / sub-units and implemented in a single module / unit / sub-unit. According to an embodiment of the present application, at least one of the acquisition module 710, the iteration module 720, and the detection module 730 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented in hardware or firmware by any other reasonable means of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the acquisition module 710 , the iteration module 720 , and the detection module 730 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.
[0159] It should be noted that the gas detection device part in the embodiment of the present application corresponds to the gas detection method part in the embodiment of the present application. The description of the gas detection device part specifically refers to the gas detection method part and will not be repeated here.
[0160] Figure 8 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present application is shown. Figure 8 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0161] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory 802 or a program loaded from a storage unit 808 into a random access memory 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present application.
[0162] Various programs and data required for the operation of the electronic device 800 are stored in the random access memory 803. The processor 801, the read-only memory 802, and the random access memory 803 are connected to each other via a bus 804. The processor 801 performs various operations of the method flow according to the embodiment of the present application by executing the programs in the read-only memory 802 and / or the random access memory 803. It should be noted that the program can also be stored in one or more memories other than the read-only memory 802 and the random access memory 803. The processor 801 can also perform various operations of the method flow according to the embodiment of the present application by executing the programs stored in the one or more memories.
[0163] According to an embodiment of the present application, electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to bus 804. Electronic device 800 may also include one or more of the following components connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 808 including a hard disk; and a communication section 809 including a network interface card such as a LAN card or modem. Communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. Removable media 811, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 810 as needed, so that computer programs read from the removable media can be installed into storage section 808 as needed.
[0164] According to an embodiment of the present application, the method flow according to the embodiment of the present application can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above-mentioned functions defined in the system of the embodiment of the present application are executed. According to an embodiment of the present application, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0165] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of this application is implemented.
[0166] According to embodiments of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples include, but are not limited to, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0167] For example, according to an embodiment of the present application, the computer-readable storage medium may include the read-only memory 802 and / or the random access memory 803 described above and / or one or more memories other than the read-only memory 802 and the random access memory 803 .
[0168] An embodiment of the present application also includes a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiment of the present application. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiment of the present application.
[0169] When the computer program is executed by the processor 801, the above functions defined in the system / device of the embodiment of the present application are performed. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0170] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0171] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0172] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It will be understood by those skilled in the art that the features described in the various embodiments of the present application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments of the present application may be combined and / or coupled in various ways, and all of these combinations and / or couplings fall within the scope of the present application.
[0173] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. The present application does not depart from the scope of the present application, and those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present application.
Claims
1. A gas detection method, characterized in that: include: Acquiring gas spectral data, wherein the gas spectral data is obtained by detecting a mixed gas in a gas pool using a quantum cascade laser, the mixed gas including the gas to be detected, and the gas spectral data includes a plurality of detection signals having different light intensities; Iterate steps 1 to 3: Step 1: obtaining a plurality of local index information according to the global index information of the gas spectrum data, wherein one local index information corresponds to a coordinate system quadrant, and the global index information represents the coordinate curves of the plurality of signals in the gas spectrum data in the coordinate system; Step 2: Based on the Hilbert space mapping method, perform quadrant flipping and rotation processing on the coordinate system quadrant of at least one of the local index information to obtain an initial global coordinate; Step 3: Using the initial global coordinates as new global index information to calculate new initial global coordinates, and determining the new initial global coordinates corresponding to the target order of the Hilbert curve and the amplitude of the corresponding gas spectrum data as target spectrum data, wherein the target spectrum data represents one-dimensional gas spectrum data mapped to image data of a two-dimensional image through the Hilbert space mapping method; Inputting the target spectral data into a gas concentration detection model and outputting gas concentration information of the gas to be detected, wherein the gas concentration detection model is constructed based on a standard convolutional layer and a depth-wise separation convolutional network; The global index information is generated in the following manner: Determining a target point position corresponding to each detection signal in an initial coordinate system based on the light intensity of each detection signal; For each coordinate system quadrant in the initial coordinate system, based on the distance between each target point and the associated point, a plurality of target points are connected to obtain an initial curve; The global index information is obtained according to a plurality of initial curves of the coordinate system quadrants.
2. The method according to claim 1, characterized in that Performing quadrant flipping and rotation processing on at least one coordinate system quadrant of the local index information to obtain an initial global coordinate includes: For each of the coordinate system quadrants, determining a quadrant flipping and rotation mode of the coordinate system quadrant according to the local index information, so as to calculate an initial coordinate corresponding to the coordinate system quadrant; Generate an initial global coordinate for the current number of iterations according to the multiple initial coordinates corresponding to different quadrants of the coordinate system; The method of determining the quadrant flipping and rotation of the coordinate system quadrant according to the local index information includes: performing a quadrant rotation operation of a first angle on a first quadrant of the plurality of coordinate system quadrants; A quadrant rotation operation of a second angle is performed on a second quadrant of the plurality of coordinate system quadrants.
3. The method according to claim 1 or 2, characterized in that The method further comprises: using the initial global coordinates as new global index information to calculate new initial global coordinates, and determining the new initial global coordinates corresponding to the target order of the Hilbert curve and the amplitude of the corresponding gas spectrum data as target spectrum data. When the number of iterations is less than the target order, the initial global coordinates are used as new global index information to calculate new initial global coordinates; When the number of iterations is equal to the value of the target order, the amplitude of the new initial global coordinates and the corresponding gas spectrum data are determined as the target spectrum data.
4. The method according to claim 1, wherein Before generating the plurality of local index information, the method further includes: Based on the wavelet transform method, the gas spectrum data is subjected to denoising processing to obtain denoised gas spectrum data; Normalization processing is performed on the denoised gas spectrum data to obtain new gas spectrum data, so as to generate the target spectrum data according to the new gas spectrum data.
5. The method according to claim 1, wherein The gas concentration detection model is trained in the following way: Acquire a training data set, wherein the training data set includes a plurality of training spectral data obtained by detecting at least one training gas pool and label concentration data corresponding to each of the training spectral data; For each of the training spectral data, convolution processing is performed on the training spectral data using a standard convolution layer to obtain a first convolution feature; Normalizing the first convolutional features using a first batch of normalization layers to obtain first normalized features; Processing the first normalized features using m depth-separated convolutional networks to obtain target pooled features; Processing the target pooling features using a fully connected layer to obtain predicted concentration information, wherein the initial concentration detection model includes the standard convolutional layer, the first batch of normalization layers, and m of the depth separation convolutional networks; The model parameters of the initial concentration detection model are iteratively adjusted according to the predicted concentration information and the label concentration data to obtain a trained gas concentration detection model.
6. The method according to claim 5, characterized in that The first normalized features are processed using m depth-separated convolutional networks to obtain target pooled features, including: If i≠m, for the i-th depthwise separation convolutional network, process the input data using the first depthwise convolutional layer to obtain a second convolutional feature, where the input data includes the first normalized feature or the first pooled feature output by the i-1-th depthwise separation convolutional network; Processing the second convolutional features using a second batch of normalization layers to obtain second normalized features; Processing the second normalized features using a first point-by-point convolutional layer to obtain a third convolutional feature; Processing the third convolutional feature using a maximum pooling layer to obtain the first pooling feature; When i=m, the first pooling feature output by the m-1th depth separation convolutional network is processed by the m-th depth separation convolutional network to obtain the target pooling feature.
7. The method according to claim 6, characterized in that Using the mth depth separation convolutional network to process the first pooled feature output by the m-1th depth separation convolutional network to obtain the target pooled feature, including: Use the second depth convolutional layer to process the first pooled feature output by the m-1th depth separation convolutional network to obtain the fourth convolutional feature; Processing the fourth convolutional features using a third batch of normalization layers to obtain third normalized features; Processing the third normalized feature using a second point-by-point convolutional layer to obtain a fifth convolutional feature; Processing the fifth convolutional feature using a global average pooling layer to obtain the target pooling feature; In the process of training the gas concentration detection model, model optimization processing is performed based on preset pruning and quantization methods to obtain an optimized gas concentration detection model.
8. The method according to claim 1, characterized in that The gas spectrum data is collected in the following manner: generating a target driving signal according to a triangular wave signal of a first frequency and a sine wave signal of a second frequency, wherein the second frequency is greater than the first frequency; When the target driving signal acts on the quantum cascade laser, the quantum cascade laser emits a detection light signal to pass through the mixed gas in the gas pool; The detection light signal passing through the mixed gas is reflected by a reflective lens with a target reflectivity to obtain a reflected light signal; The reflected light signal is processed using a mercury cadmium telluride detector to obtain the gas spectrum data.
9. A gas detection device, characterized in that: include: an acquisition module, configured to acquire gas spectrum data, wherein the gas spectrum data is obtained by detecting a mixed gas in a gas pool using a quantum cascade laser, the mixed gas including the gas to be detected, and the gas spectrum data includes a plurality of detection signals having different light intensities; Iteration module, used to iteratively execute steps 1 to 3: Step 1: obtaining a plurality of local index information according to the global index information of the gas spectrum data, wherein one local index information corresponds to a coordinate system quadrant, and the global index information represents the coordinate curves of the plurality of signals in the gas spectrum data in the coordinate system; Step 2: Based on the Hilbert space mapping method, perform quadrant flipping and rotation processing on the coordinate system quadrant of at least one of the local index information to obtain an initial global coordinate; Step 3: Using the initial global coordinates as new global index information to calculate new initial global coordinates, and determining the new initial global coordinates corresponding to the target order of the Hilbert curve and the amplitude of the corresponding gas spectrum data as target spectrum data, wherein the target spectrum data represents one-dimensional gas spectrum data mapped to image data of a two-dimensional image through the Hilbert space mapping method; a detection module, configured to input the target spectral data into a gas concentration detection model and output gas concentration information of the gas to be detected, wherein the gas concentration detection model is constructed based on a standard convolutional layer and a depthwise separation convolutional network; The global index information is generated by a determining unit, a connecting unit, and a second obtaining unit: The determining unit is used to determine the target point position corresponding to each detection signal in the initial coordinate system based on the light intensity of each detection signal; The connecting unit is used for connecting multiple target points based on the distance between each target point and the associated point in each coordinate system quadrant in the initial coordinate system to obtain an initial curve; The second obtaining unit is used to obtain global index information according to the initial curves of multiple coordinate system quadrants.
Citation Information
Patent Citations
Vector-quantization-based overall and local color image searching method
CN103440348A
Atmospheric telemetry method for chemical imaging combined with hyperspectrum
CN110793920A