Gas classification method and device based on multi-scale gradient spiking neural network
By using a multi-scale slope pulse neural network, combined with heterogeneous coding and array attention fusion modules, the robustness and versatility issues of existing electronic noses in complex gas signal processing are solved, achieving high-precision, low-power gas classification and detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTHWEST UNIV
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-26
AI Technical Summary
Existing electronic noses lack multi-scale dynamics and heterogeneous coding in complex gas signal processing, resulting in poor robustness, difficulty in achieving high-precision classification, low versatility and detection efficiency, susceptibility to environmental noise interference, and inability to adapt to different detection targets.
A multi-scale slope spiking neural network is employed, which combines a heterogeneous fusion pulse coding module, a multi-scale slope sensing module, and an array attention fusion module with leakage integral triggering neurons, integral triggering neurons, and Izhekevich neuron models to perform multi-scale feature extraction and array importance assessment, thereby achieving high-precision classification of gas response signals.
It improves the robustness and accuracy of gas classification, reduces power consumption, adapts to different detection targets, improves detection efficiency and equipment versatility, has redundant detection functions and air intake filtration capabilities, and enhances adaptability to complex environments.
Smart Images

Figure CN122087528A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic nose gas recognition technology, specifically to a gas classification method and device based on a multi-scale slope pulse neural network. Background Technology
[0002] The event-driven nature of spiking neural networks (SNNs) provides a new paradigm for efficient decoding and real-time analysis of gas sensor arrays, aligning with the development trends of neuromorphic computing and edge intelligence.
[0003] However, in the refined representation of complex gas signals, existing systems struggle to achieve high robustness at extremely low power consumption due to the lack of dedicated models that take into account multi-scale dynamics and heterogeneous coding. They typically rely on simple encoding using a single neuron model (such as leakage integral-triggered neurons or integral-triggered neurons). However, this approach fails to fully preserve information when faced with real gas responses exhibiting "sawtooth" fluctuations. Furthermore, this static architecture, lacking frequency adaptability, struggles to capture the complex temporal characteristics of gas signals where transient changes and long-term drift coexist.
[0004] Furthermore, existing methods do not fully exploit the key "slope" shape and multi-scale temporal characteristics in the gas response curve during the design process, nor do they consider the dynamic range limitations of a single encoding mechanism when processing heterogeneous signals. In addition, due to the neglect of the response differences between sensor arrays, spiking neural networks are prone to noise amplification and masking of key information during feature aggregation, resulting in limited global feature representation capabilities and thus restricting the improvement of gas classification performance.
[0005] Furthermore, due to the different detection targets or purposes, electronic noses require specific combinations of gas sensors for detection. Therefore, please refer to Chinese patent applications with publication numbers CN119936122A and CN119959474A, etc. Existing electronic noses are all specialized devices, capable of detecting only one type of target or a broad category of targets, and classifying them into smaller subcategories based on the collected information. This results in very poor versatility. Different electronic noses need to be prepared specifically for different detection targets or purposes, incurring huge costs and limiting the application and promotion of electronic noses. At the same time, existing miniaturized and compact electronic noses lack redundant detection capabilities (redundant arrangement). To meet the requirements of processing algorithms and ensure detection accuracy, multiple repeated measurements are required, leading to low detection efficiency and poor operational convenience.
[0006] Furthermore, existing electronic noses lack the capability to proportionally compress the gas being tested. Consequently, for certain characteristic gases that are extremely rarefied, sensor readings are prone to being too low or exhibiting excessive fluctuations, leading to insufficient detection accuracy. Additionally, current electronic noses lack any air intake filtration mechanism, relying solely on the direct inhalation and detection of the gas. This allows certain non-target gases and impurities to interfere with the gas sensor's recognition signal, further reducing the electronic nose's accuracy. Therefore, existing electronic noses are unsuitable for high-precision applications and certain specific detection targets.
[0007] Solving these problems is now a top priority. Summary of the Invention
[0008] In view of this, the present invention provides a gas classification method and device based on a multi-scale slope pulse neural network to overcome the shortcomings of existing technologies in terms of insufficient feature representation, weak multi-scale dynamic modeling capability, and coarse array information fusion, so as to achieve high-precision, low-power, and robust classification of complex gas response signals.
[0009] The technical solution is as follows:
[0010] The first aspect of this application relates to a gas classification method based on a multi-scale slope spiking neural network, which is carried out according to the following steps:
[0011] S1. The electronic nose inhales the target sample, and the pulse neural network obtains the continuous analog signals output by the N gas sensor arrays of the electronic nose.
[0012] S2. The heterogeneous fusion pulse coding module first models each continuous analog signal as a two-dimensional matrix. Then, it linearly maps the two-dimensional matrix corresponding to each gas sensor array to a synaptic input current vector. Subsequently, it introduces a leakage integral trigger neuron model, an integral trigger neuron model, and a Jizhikevich neuron model, respectively, and performs parallel integration and firing on the synaptic input current vector corresponding to each gas sensor array. Finally, it performs a logical "OR" operation on the binary pulses generated by the leakage integral trigger neuron model, the integral trigger neuron model, and the Jizhikevich neuron model corresponding to each gas sensor array at each time step to obtain the final fused pulse vector corresponding to each gas sensor array at the current time step. The final fused pulse vectors at all time steps are stacked along the time axis to obtain the pulse feature matrix corresponding to each gas sensor array.
[0013] S3. The pulse feature matrix corresponding to each gas sensor array is fed in parallel into three one-dimensional convolution branches with different kernel sizes of the multi-scale slope sensing module, and the fast-scale feature tensor, meso-scale feature tensor, and slow-scale feature tensor corresponding to each gas sensor array are extracted respectively. Then, through the scale attention mechanism, the global statistics are calculated to dynamically allocate the scale attention weights corresponding to the three branches. Finally, the output features of the three branches are weighted and summed according to the scale attention weights to obtain the aggregated features corresponding to each gas sensor array.
[0014] S4. The array attention fusion module first concatenates the aggregated features of all gas sensor arrays along the channel dimension and performs a global pooling operation to generate a global context descriptor containing the joint distribution information of all gas sensor arrays. Then, it processes the global context descriptor through a nonlinear mapping network to generate an N-dimensional array importance weight vector. Finally, it adopts a weighted strategy to obtain the global fusion feature tensor based on the aggregated features of all gas sensor arrays and their corresponding importance weights.
[0015] S5. Input the global fusion feature tensor into the backbone network of the spiking neural network and output the results. Based on the output results, classify the target samples to obtain the variety classification results and origin traceability results of the target samples.
[0016] The gas classification method based on a multi-scale slope pulse neural network, as described above, has achieved the following technical results:
[0017] 1. Multi-dynamic heterogeneous coding improves information fidelity: The heterogeneous fusion pulse coding module uses parallel fusion coding of three types of neuron models: leakage integral triggering neuron, integral triggering neuron, and Izhekevich neuron. It takes into account the transient response, steady-state accumulation and nonlinear dynamics of the signal, and significantly enhances the ability of the pulse sequence to represent the original gas response waveform.
[0018] 2. Module collaboration for efficient extraction of core spatiotemporal features: The heterogeneous fusion pulse coding module and the multi-scale slope sensing module work together to efficiently and quickly extract the core spatiotemporal features of gas response data by capturing the high-dimensional correlation between microscopic neural dynamics and macroscopic sawtooth waveforms.
[0019] 3. Enhanced robustness through array attention mechanism: The array attention fusion module dynamically evaluates the contribution weight of each sensor array, automatically suppresses the interference of redundant arrays with low signal-to-noise ratio or failed channels, and improves the stability and generalization ability of the system in complex environments.
[0020] 4. Multi-scale slope perception enhances temporal modeling: The multi-scale slope perception module explicitly models the slope changes of the "sawtooth wave" under different time windows, adaptively focusing on the most discriminative slope features. At the same time, thanks to the combination of multi-scale filtering and dynamic attention mechanism, it can better adapt to the baseline drift and environmental noise interference commonly encountered in real application scenarios.
[0021] 5. Lightweight and hardware-friendly overall architecture: The entire network is based on impulse event driving, with sparse computation and few parameters, making it easy to deploy on neuromorphic chips or edge computing devices, meeting the requirements of low-power and real-time applications.
[0022] A second aspect of this application relates to an electronic device, including at least one processor and a memory communicatively connected to the at least one processor, the memory storing a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the gas classification method described above.
[0023] Using the above electronic equipment, all the advantages of the gas classification methods mentioned above are achieved.
[0024] A third aspect of this application relates to a computer-readable medium storing computer instructions for causing at least one processor to execute the gas classification method described above.
[0025] Using the above computer-readable media, all the advantages of the gas classification methods described above are achieved.
[0026] The fourth aspect of this application relates to an electronic nose, the electronic nose comprising a detection box and a filter assembly;
[0027] The detection box includes a box with an internal detection space and an inlet / outlet located at one end of the box. The inlet / outlet communicates with the interior of the box. A piston and a piston actuator for moving the piston closer to or away from the inlet / outlet are installed in the box. A multi-purpose channel is provided on the box on the side of the piston away from the inlet / outlet. A pressure sensor is installed in the detection space. At least one set of gas sensor arrays arranged side by side along the length of the box are detachably installed on the circumferential outer wall of the box. Each gas sensor array is integrated on a corresponding thin-film sensor. Each thin-film sensor communicates with the detection space through multiple exposure holes opened on the box.
[0028] The filter assembly includes an assembly housing, which integrates an exhaust nozzle, at least one detection air inlet, an air inlet, an intake / exhaust duct communicating with the intake / exhaust port, an exhaust passage connecting the intake / exhaust duct and the exhaust nozzle, and a filter passage communicating with the intake / exhaust duct. The filter passage is sequentially equipped with filters equal in number to the detection air inlet and the air inlet. The intake end of the last stage filter is connected to the corresponding air inlet via a corresponding intake passage. The intake ends of the remaining stages of filters are connected to the corresponding detection air inlet via corresponding intake passages. The assembly housing is equipped with an on / off actuator for switching the on / off states of the exhaust passage and each intake passage. When the on / off actuator keeps the exhaust passage open, all intake passages are cut off by the on / off actuator. When the on / off actuator keeps any intake passage open, the exhaust passage and the remaining intake passages are cut off by the on / off actuator.
[0029] The fifth aspect of this application relates to a control method for the aforementioned electronic nose, comprising the following steps:
[0030] A1. Check the condition of the filter elements of each stage of the electronic nose air intake mechanism to ensure they are functioning properly, following these steps:
[0031] A11. Air intake nozzle connects to air;
[0032] A12. The on / off actuator connects the air intake passage to the air intake nozzle until the piston moves to its limit position away from the air intake and exhaust ports.
[0033] A13. The on / off actuator cuts off the exhaust passage and all intake passages;
[0034] A14. The piston moves toward the direction of the intake and exhaust ports until the pressure sensor detects that the internal air pressure of the detection space has reached the self-test set value.
[0035] A15. The on / off actuator keeps the air intake passage connected to the first-stage filter open until the internal air pressure of the detection space returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, after the piston empties the air in the detection space, proceed to step A2; if no, after the piston empties the air in the detection space, proceed to step A3.
[0036] A2. Clean the filter elements of each stage of the electronic nose air intake mechanism according to the following steps:
[0037] A21. The on / off actuator connects the air intake passage that is connected to the last stage filter;
[0038] A22. After the piston moves to its limit position away from the intake and exhaust ports, the piston quickly empties the air in the detection space and determines whether the number of repetitions of step A22 is greater than the repetition threshold: if yes, the piston moves to its limit position away from the intake and exhaust ports and proceeds to step A23; otherwise, step A22 is repeated.
[0039] A23. After the on / off actuator cuts off the exhaust passage and all intake passages, the piston moves toward the direction of the intake and exhaust ports until the pressure sensor detects that the internal air pressure of the detection space reaches the self-test set value.
[0040] A24. The on / off actuator connects to the air intake channel connected to the last stage filter until the internal air pressure of the detection space returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, replace the filter element of the last stage filter first, and then the on / off actuator connects to the air intake channel connected to the previous stage filter, and proceed to step A25; if no, the on / off actuator connects to the air intake channel connected to the previous stage filter, and proceed to step A25.
[0041] A25. After the piston moves to its limit position away from the intake and exhaust ports, the piston quickly empties the air in the detection space and determines whether the number of repetitions of step A25 is greater than the repetition threshold: if yes, the piston moves to its limit position away from the intake and exhaust ports and proceeds to step A26; otherwise, step A25 is repeated.
[0042] A26. After the on / off actuator cuts off the exhaust passage and all intake passages, the piston moves toward the direction of the intake and exhaust ports until the pressure sensor detects that the internal air pressure of the detection space reaches the self-test set value.
[0043] A27. The on / off actuator connects the previously connected air intake channel until the internal air pressure of the detection space returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, replace the filter element of the first-stage filter closest to the unobstructed air intake channel, and then proceed to step A28; otherwise, proceed to step A28.
[0044] A28. Determine whether the primary filter closest to the unobstructed intake passage is the first-stage filter: If yes, after the piston empties the air in the detection space, proceed to step A3; if no, after the piston empties the air in the detection space, the on / off actuator connects the intake passage connected to the previous primary filter, and then returns to step A25.
[0045] A3. To test the gas, follow these steps:
[0046] A31. Depending on the type of gas being tested, a corresponding detection inlet is connected to the gas being tested.
[0047] A32. Based on the type of gas being tested, determine whether the gas sensor array installed in the chamber meets the testing requirements: if yes, proceed to step A33; if no, replace the gas sensor array corresponding to the gas being tested and proceed to step A33.
[0048] A33. Depending on the type of gas being tested, the on / off actuator keeps the intake passage corresponding to the gas being tested through the detection inlet until the piston moves to its limit position away from the inlet and outlet ports.
[0049] A34. Based on the type of gas being tested, determine whether it is necessary to compress the gas inside the testing space: if yes, proceed to step A35; otherwise, proceed to step A37.
[0050] A35. The on / off actuator cuts off the exhaust passage and all intake passages;
[0051] A36. The piston moves toward the inlet and outlet ports until the volume of the gas to be tested is compressed to the required detection set value.
[0052] A37. The gas sensor array detects the gas being tested;
[0053] A38. The on / off actuator keeps the exhaust passage open until the piston empties the gas being tested from the test space.
[0054] Therefore, by adopting the above electronic nose and its control method, the following technical effects have been achieved:
[0055] 1. It can adaptively adjust the type of each gas sensor array according to the type of gas being detected and the detection environment to achieve accurate analysis of the target gas. It is suitable for the detection of different targets and has excellent versatility. This makes the electronic nose a universal device that can be applied to different targets, which greatly reduces the investment cost of the electronic nose and is conducive to the application, promotion and popularization of the electronic nose.
[0056] 2. It can use two or more gas sensor arrays with identical types and parameters, all located in the detection space, so that a single test is equivalent to multiple redundant tests. This not only meets the data acquisition requirements of the processing algorithm and obtains high-precision detection results, but also greatly improves testing efficiency and the convenience of detection operation.
[0057] 3. The filter assembly has the function of self-inspection and self-cleaning of the filter elements of each stage, further ensuring the accuracy of the test;
[0058] 4. By setting at least two stages of filters, with the most versatile filter placed in the last stage, it filters moisture and particulate impurities. This not only filters the air, thus protecting the internal gas sensor from corrosion by moisture and particulate impurities during self-cleaning and other air intake processes, thereby extending the service life and detection accuracy of the gas sensor, but also improves the air intake efficiency and shortens the air intake time during self-cleaning and other air intake processes. Furthermore, it filters the gas being detected. Meanwhile, other stages of filters can be adaptively combined and adjusted according to the type of gas being detected and the detection environment to filter out interfering gases and impurities, thereby effectively improving the recognition accuracy of the subsequent gas sensor array and thus improving the detection accuracy of the electronic nose.
[0059] 5. It can compress the gas to be tested according to the type of gas and the detection requirements, so as to meet the needs of some specific gases that can only be accurately detected after the concentration is increased, which further improves the applicability and versatility of the electronic nose.
[0060] 6. The structure of this electronic nose is extremely compact, meeting the application requirements of miniaturization and modularization. It has high integration and excellent portability. At the same time, the gas is in a static and stable state in the detection space before detection, which can effectively improve the detection accuracy of the electronic nose. Attached Figure Description
[0061] Figure 1 This is a schematic diagram illustrating the principle of a gas classification method.
[0062] Figure 2 This is a schematic diagram of the three-dimensional structure of the electronic nose;
[0063] Figure 3 This is a schematic diagram of the planar structure of the electronic nose;
[0064] Figure 4 for Figure 3 Sectional view at point AA;
[0065] Figure 5 A schematic diagram of the structure after removing all the flexible quick-change sealing plates for the electronic nose;
[0066] Figure 6 A schematic diagram of the structure after removing all flexible quick-change covers and thin-film sensors from the electronic nose. Detailed Implementation
[0067] The present invention will be further described below with reference to the embodiments and accompanying drawings.
[0068] Example 1:
[0069] like Figure 1 As shown, a gas classification method based on a multi-scale slope spiking neural network is performed according to the following steps:
[0070] S1. The electronic nose inhales the target sample (gas), and the pulse neural network acquires the continuous analog signals output by the N gas sensor arrays of the electronic nose.
[0071] S2. The heterogeneous fusion pulse coding module (FSN) first models each continuous analog signal as a two-dimensional matrix. Then, it linearly maps the two-dimensional matrix corresponding to each gas sensor array to a synaptic input current vector. Subsequently, it introduces the leakage integral triggering neuron (LIF neuron), integral triggering neuron (IF neuron), and Izhikevich neuron models respectively. The synaptic input current vector corresponding to each gas sensor array is integrated and fired in parallel. Finally, the binary pulses generated by the LIF neuron, IF neuron, and Izhikevich neuron models corresponding to each gas sensor array at each time step are logically ORed to obtain the final fused pulse vector corresponding to each gas sensor array at the current time step. The final fused pulse vectors at all time steps are stacked along the time axis to obtain the pulse feature matrix corresponding to each gas sensor array.
[0072] Specifically, the set of two-dimensional matrices corresponding to N gas sensor arrays is denoted as... For any number of A gas sensor array is modeled as a two-dimensional matrix. , ;
[0073] First, in the encoding stage, corresponding to the first A two-dimensional matrix of gas sensor arrays Linearly mapped to the synaptic input current vector at the current moment The expression is:
[0074] ;
[0075] In the above formula, , This represents a learnable linear projection weight matrix; the process aims to uniformly map physical signals to a current domain suitable for neuromorphic computation.
[0076] Subsequently, in the modeling of membrane potential dynamics, we introduced the LIF neuron model, the IF neuron model, and the Izhikevich neuron model in parallel.
[0077] The LIF neuron model incorporates a membrane potential leakage term, which represents the neuron's "forgetting" mechanism of historical information. Therefore, a dynamic model of the LIF neuron is constructed, with the following dynamic equation:
[0078] ;
[0079] In the above formula, express The membrane potential vector of the LIF neuron at time t; This represents the membrane potential time decay constant, which determines the rate at which information is forgotten; express The cumulative state of membrane potential in LIF neurons at any given time; The threshold for issuance is expressed in scalar form; express The binary pulse vector output by the LIF neuron at time t is used to achieve hard reset.
[0080] The binary pulse vector output by the LIF neuron at the current time. The expression is:
[0081] ;
[0082] In the above formula, This represents the Heaviside step function, which outputs 1 when the input is greater than 0, and 0 otherwise. In one branch of the LIF neuron model, This makes neurons highly sensitive to high-frequency transients.
[0083] The IF neuron model removes the membrane potential leakage term, aiming to establish a lossless integration mechanism. The expression for the IF neuron model is:
[0084] ;
[0085] In the above formula, express The membrane potential vector of the IF neuron at time 1. express The binary pulse vector output by the IF neuron at time t.
[0086] Then the binary pulse vector output by the IF neuron at the current time. The expression is:
[0087] ;
[0088] The IF neuron model removes the attenuation term and acts as a pure integrator, driving the neuron to reflect long-term signal strength.
[0089] The Izhikevich neuron model introduces a nonlinear second-order dynamic equation, utilizing additional recovery variables to regulate the membrane potential state, simulating the complex firing patterns (such as cluster firing) of biological neurons. Its expression is:
[0090] ;
[0091] ;
[0092] In the above formula, This represents the membrane potential vector of the Izhikevich neuron at the current moment; express The membrane potential vector of the Izhikevich neuron at time t; express The recovery variable vector at time step, which is used to provide negative feedback regulation; express The recovery variable vector at time step; 0.04, 5, and 140 are the standard dynamic coefficients of this model; and Both represent dimensionless learnable parameters, which respectively control the time scale and sensitivity of the recovery variable.
[0093] when When the voltage exceeds a set peak value (e.g., 30mV), the Izhikevich neuron outputs... Binary pulse vector at time t This triggers a reset. This design endows the model with the ability to distribute nonlinear clusters.
[0094] Finally, the one corresponding to the first Three binary pulse vectors of a gas sensor array , and By using the logical "OR" operation, we obtain the result corresponding to the first... A gas sensor array in The final fused pulse vector at time step The expression is:
[0095] ;
[0096] In the above formula, , This represents the element-wise logical OR operation.
[0097] The final fused pulse vector at all moments Stacked along the time axis, we get the corresponding to the first... Pulse characteristic matrix of a gas sensor array .
[0098] Therefore, in order to enable the spiking neural network (SNN) to take into account both transient high-frequency fluctuations and steady-state long-term memory in the gas sensor response, a heterogeneous fusion pulse coding strategy was designed in step S2. The core idea of this strategy is that a single neuron model is difficult to cover the complex dynamic range of signals simultaneously. Therefore, we introduce three neurons with complementary dynamic characteristics to perform parallel integration and firing of the input current, thereby establishing an information coding mechanism with "full-spectrum sensing" capability.
[0099] S3. The pulse feature matrix corresponding to each gas sensor array is fed in parallel into three one-dimensional convolution branches with different kernel sizes of the multi-scale slope sensing module (MSRB). The fast-scale feature tensor, meso-scale feature tensor, and slow-scale feature tensor corresponding to each gas sensor array are extracted respectively. Then, through the scale attention mechanism, the global statistics are calculated to dynamically allocate the scale attention weights corresponding to the three branches. Finally, the output features of the three branches are weighted and summed according to the scale attention weights to obtain the aggregated features corresponding to each gas sensor array.
[0100] Specifically, firstly, the corresponding to the first Pulse characteristic matrix of a gas sensor array The data is fed in parallel into three one-dimensional convolutional branches. This process aims to extract multi-band features through convolutional operations at different scales, resulting in a fast-scale feature tensor. Mesoscale feature tensor and slow-scale feature tensor The expression is:
[0101] ;
[0102] ;
[0103] ;
[0104] In the above formula, This represents a one-dimensional convolution operation. Represents the convolutional spiking neuron; , and These represent convolution weight matrices with kernel sizes of 1, 3, and 5, respectively, corresponding to fast, medium, and slow feature extraction.
[0105] Subsequently, to adaptively integrate these features, a scale attention mechanism is introduced to dynamically allocate weights. The expression for dynamically allocating scale attention weights corresponding to the three branches by calculating global statistics is as follows:
[0106] ;
[0107] ;
[0108] In the above formula, This indicates that global average pooling is used. The scale description vector obtained by adding elements one by one; This represents a multilayer perceptron used for feature mapping; Represents the normalization function; Denotes the generated scale attention weight vector, where, , and These represent the weight coefficients corresponding to the three branches.
[0109] Finally, the output features of the three branches are weighted and summed according to the scale attention weights to obtain the value corresponding to the first branch. Aggregation characteristics of gas sensor arrays The expression is:
[0110] .
[0111] This design is equivalent to an adaptive frequency domain filter: when the signal changes drastically, the model automatically increases... To focus on local details; conversely, to increase To focus on overall trends.
[0112] Therefore, for the unique "sawtooth wave" shape in the gas sensor response curve, the core point of step S3 is to use convolution kernels with different receptive fields to decouple the slope characteristics of the signal at different frequencies.
[0113] S4. The Array Attention Fusion Module (AAF) first concatenates the aggregated features of all gas sensor arrays along the channel dimension and performs a global pooling operation to generate a global context descriptor containing the joint distribution information of all gas sensor arrays. Then, it processes the global context descriptor through a nonlinear mapping network to generate an N-dimensional array importance weight vector. Finally, it adopts a weighted strategy to obtain the global fusion feature tensor based on the aggregated features of all gas sensor arrays and their corresponding importance weights.
[0114] Specifically, firstly, the aggregated features of all gas sensor arrays are concatenated along the channel dimension and then subjected to global pooling to generate a global context descriptor containing the joint distribution information of all gas sensor arrays. The relationship is as follows:
[0115] ;
[0116] In the above formula, This indicates a feature concatenation operation along the channel dimension; Represents global pooling operations; global context descriptor It is a compressed global context vector that contains the joint distribution information of all arrays.
[0117] Subsequently, the global context descriptor is processed through a non-linear mapping network. Generate an N-dimensional array importance weight vector. The relation is:
[0118] ;
[0119] In the above formula, This represents a multilayer perceptron; Indicates the use of limiting the output to Activation functions between; ,in, This represents the importance weight of the Nth gas sensor array.
[0120] Finally, a weighted strategy is adopted to obtain the global fusion feature tensor based on the aggregated features of all gas sensor arrays and their corresponding importance weights. The relation is:
[0121] ;
[0122] In the above formula, 1 represents the index of the gas sensor array; 1 represents the identity term of the residual connection, ensuring gradient propagation of the feature.
[0123] Therefore, given the differences in selectivity of heterogeneous sensor arrays to different gases, step S4 designs an array attention fusion module, which aims to evaluate the contribution of each array to the current classification task from a global perspective.
[0124] S5. Input the global fusion feature tensor into the backbone network of the spiking neural network and output the results. Based on the output results, classify the target samples to obtain the variety classification results and origin traceability results of the target samples.
[0125] In summary, the spiking neural network (SNN) used in the gas classification method of this embodiment mainly consists of three core modules: heterogeneous fusion pulse coding module (FSN), multi-scale slope sensing module (MSRB), and array attention fusion module (AAF).
[0126] Given the significant differences in the sensitivity of different sensor arrays to various gas molecules, we propose an innovative array attention fusion mechanism in this work. This mechanism adaptively adjusts the weights of each array based on the relevance of its extracted feature map to the specific classification task to be solved. By doing so, it effectively reduces interference from low-response or faulty arrays, which could introduce noise into the feature space, and helps the network focus on the most discriminative sensor signals. This allows the model to more accurately amplify key gas fingerprint features, thereby improving overall recognition performance. The array attention fusion module enables the model to prioritize array branches with the most information, ensuring that the system utilizes the most relevant data while minimizing the influence of less useful or noisy sensor inputs.
[0127] Considering the strong coupling between the microscopic neuronal firing dynamics and the macroscopic waveform evolution in gas response signals, this gas classification method also proposes a heterogeneous fusion pulse coding module and a multi-scale slope sensing module. These two modules aim to capture fine-grained pulse dynamics information and a broader temporal context pattern.
[0128] The heterogeneous fusion coding module focuses on the information interaction between internal potentials and firing patterns of different neuron models (LIF, IF, Izhikevich), aiming to extract fine-grained local features that are typically crucial for converting continuous analog signals into discrete neuromorphic data. By modeling the interactions between different dynamic properties (such as leakage, integration, and even cluster firing), this structure can capture microsecond-level local dependencies, which is essential for understanding short-range correlations and transient dynamics in pulse sequences.
[0129] In contrast, the multi-scale slope-aware module transcends the limitations of single time steps and single neurons, enabling the model to adaptively search for optimal combinations across different time spans (fast, medium, and slow) for more comprehensive and in-depth sawtooth wave feature extraction. This structure enhances the model's ability to capture long-term dependencies and cross-scale geometric features, which is crucial for understanding the broader context of gas sensor response curves, such as rise slope and baseline drift. By combining convolutional features from different time scales, the multi-scale aware structure helps the model integrate multiple temporal perspectives, achieving more robust feature extraction and improving overall performance for tasks such as gas species classification.
[0130] The heterogeneous fusion pulse coding module and the multi-scale slope sensing module complement each other, enabling the model to effectively utilize all sensor data from micro pulses to macro waveforms, thereby obtaining more accurate and reliable predictions.
[0131] Therefore, the gas classification method in this embodiment outperforms mainstream spiking neural networks and traditional deep learning methods in various gas identification scenarios. Simultaneously, the model has extremely low computational energy consumption and strong anti-interference capabilities, making it more practically valuable than most mainstream methods. This invention is the first to combine multi-scale slope sensing with heterogeneous pulse coding, achieving accurate classification in complex gas environments. Specific advantages are as follows:
[0132] 1. The array attention fusion mechanism can accurately assess the importance of each sensor array in the global feature aggregation and decision-making process, and effectively suppress the interference of redundant arrays;
[0133] 2. The heterogeneous fusion coding module and the multi-scale slope sensing module work together to efficiently and quickly extract the core spatiotemporal features of gas response data by capturing the high-dimensional correlation between microscopic neural dynamics and macroscopic sawtooth waveforms.
[0134] 3. The network utilizes the sparse computing characteristics of spiking neurons, with minimal computational overhead and parameter count, creating conditions for deployment on resource-constrained neuromorphic chips or edge hardware devices, and has extremely high feasibility for implementation.
[0135] 4. Strong noise resistance: thanks to the combination of multi-scale filtering and dynamic attention mechanism, it can better adapt to baseline drift and environmental noise interference commonly encountered in real-world application scenarios.
[0136] Example 2:
[0137] An electronic device includes at least one processor and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which enables the at least one processor to perform the aforementioned gas classification method.
[0138] It should be noted that electronic devices are intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0139] A processor can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processors include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor performs the various methods and processes described above, such as gas classification methods.
[0140] In some embodiments, the gas classification method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the gas classification method described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform the gas classification method by any other suitable means (e.g., by means of firmware).
[0141] Various implementations of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0142] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0143] Example 3:
[0144] Computer-readable storage media can be tangible media that may contain or store computer programs for use by or in conjunction with an instruction execution system, apparatus, or device. Computer-readable storage media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0145] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0146] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0147] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0148] Example 4:
[0149] Please see Figures 2-6 An electronic nose includes a detection box 9 and a filter assembly 10.
[0150] The detection chamber 9 has an inlet / outlet 9a and includes a chamber body 9b. In this embodiment, the chamber body 9b is preferably cylindrical. A detection space 9b1 is provided inside the chamber body 9b. The inlet / outlet 9a is located at one end of the chamber body 9b, and its inner end communicates with the interior of the chamber body 9b. A piston 9c and a piston actuator 9d are installed in the chamber body 9b to move the piston 9c closer to or away from the inlet / outlet 9a. A multi-purpose channel 9e is provided on the chamber body 9b on the side of the piston 9c away from the inlet / outlet 9a. Therefore, by controlling the movement of the piston 9c through the piston actuator 9d, the detection space 9b1 can be vented and vented. Specifically, when the piston actuator 9d moves the piston 9c away from the inlet / outlet 9a, external gas enters the detection space 9b1 through the inlet / outlet 9a; when the piston actuator 9d moves the piston 9c closer to the inlet / outlet 9a, the gas in the detection space 9b1 is discharged through the inlet / outlet 9a.
[0151] A pressure sensor 11 is installed in the detection space 9b1. By setting the pressure sensor 11, the pressure of the gas in the detection space 9b1 can be monitored in real time.
[0152] In this embodiment, at least one set of gas sensor arrays arranged side-by-side along its length are detachably mounted on the circumferential outer wall of the housing 9b. Each gas sensor array is integrated onto a corresponding thin-film sensor 5, and each thin-film sensor 5 is connected to the detection space 9b1 through multiple exposure holes 9b2 opened on the housing 9b. Therefore, this embodiment can not only adaptively adjust the type of each thin-film sensor 5 according to the type of gas being detected and the detection environment, thereby enabling complete replacement of sensor arrays to achieve accurate analysis of the target gas, adapting to the detection of different targets, and exhibiting excellent versatility, making this electronic nose a universal device applicable to different targets, significantly reducing the investment cost of the electronic nose and facilitating its application, promotion, and popularization; but also, it can use two or more thin-film sensors 5 with identical sensor array types and parameter settings, so that a single test of the detection space 9b1 is equivalent to the effect of multiple redundant tests, satisfying the data acquisition requirements of the processing algorithm, obtaining high-precision detection results, and significantly improving testing efficiency and operational convenience. It should be noted that each thin-film sensor 5 typically integrates multiple gas sensor arrays, and the types of gas sensor arrays can be the same or different.
[0153] Please see Figure 2 , Figure 5 and Figure 6 The outer circumferential wall of the housing 9b has at least one thin-film sensor positioning groove 9b3 arranged side by side along its length. Each thin-film sensor positioning groove 9b3 is an annular or semi-circular structure adapted to the thin-film sensor 5. Each thin-film sensor positioning groove 9b3 is an ultra-thin strip structure adapted to the corresponding thin-film sensor 5. Each thin-film sensor 5 can be detachably embedded in the thin-film sensor positioning groove 9b3. Specifically, each thin-film sensor positioning groove 9b3 is laid on the bottom of the corresponding thin-film sensor positioning groove 9b3. At the same time, the bottom of each thin-film sensor positioning groove 9b3 is provided with multiple exposure holes 9b2, so that each thin-film sensor 5 is exposed to the detection space 9b1 through the corresponding exposure holes 9b2, thereby enabling the detection of the gas to be detected in the detection space 9b1.
[0154] Meanwhile, each slot of the thin-film sensor positioning groove 9b3 is fitted with a flexible quick-change sealing plate 1 for pressing the corresponding thin-film sensor 5 into the thin-film sensor positioning groove 9b3, thereby enabling the replacement and maintenance of the thin-film sensor 5 by removing and installing the flexible quick-change sealing plate 1. Furthermore, the flexible quick-change sealing plate 1 is installed in an embedded manner, making installation and removal simple and convenient.
[0155] Furthermore, the flexible quick-change sealing plate 1 is a semi-circular thin plate structure and is made of elastic material, which is convenient for assembly and disassembly by deformation and can reliably press the thin film sensor 5 into the corresponding thin film sensor positioning groove 9b3.
[0156] Furthermore, the adjacent thin-film sensor positioning slots 9b3 are separated by positioning ribs 9b8, which can ensure the stability and reliability of the installation of the elastic quick-change sealing plate 1, and also guide and limit the installation of the thin-film sensor 5.
[0157] Please see Figure 4 At least one gas sensor array composed of first metal oxide gas sensors 2 is installed on the side of piston 9c near the inlet / outlet port 9a. That is, one or more gas sensor arrays are installed on the side of piston 9c near the inlet / outlet port 9a. At least one gas sensor array composed of second metal oxide gas sensors 4 is installed on the inner wall of the detection space 9b1 facing piston 9c. That is, one or more gas sensor arrays are installed on the inner wall of the detection space 9b1 facing piston 9c. Therefore, in this embodiment, the first metal oxide gas sensor 2 and the second metal oxide gas sensor 4, which are versatile and do not require frequent replacement, are installed in the detection space 9b1 (replacing them would be relatively troublesome). The metal gas sensor 5, which requires adaptive adjustment for different detection targets, is installed in the thin-film sensor positioning groove 9b3 on the circumferential outer wall of the housing 9b. This allows the electronic nose to have as many sensor placement positions as possible, further improving its versatility.
[0158] Please see Figures 2-4 A control box 3 is provided on the circumferential side wall of the detection box 9. A control circuit board 6 is installed in the control box 3. The plug terminals of each thin film sensor 5 extend into the control box 3 and are electrically connected to the control circuit board 6. Thus, the control circuit board 6 can both control each thin film sensor 5 to collect signals and process the signals collected by each thin film sensor 5.
[0159] Correspondingly, a first sensor circuit board 7, electrically connected to all first metal oxide gas sensors 2, is installed on the side of piston 9c away from the inlet and outlet ports 9a. A circuit board mounting ring groove 9b4 surrounding the inlet and outlet ports 9a is provided in the housing 9b. A second sensor circuit board 8, electrically connected to the pressure sensor 11 and all second metal oxide gas sensors 4, is installed in the circuit board mounting ring groove 9b4. The piston actuator 9d, the first sensor circuit board 7, and the second sensor circuit board 8 are all electrically connected to the control circuit board 6. Thus, the control circuit board 6 can control the signals collected by each first metal oxide gas sensor 2 and second metal oxide gas sensor 4, process the signals collected by each first metal oxide gas sensor 2 and second metal oxide gas sensor 4, and control the piston actuator 9d. In general, the control circuit board 6 can realize the linkage control of various electrical components.
[0160] Please see Figure 4The end of the housing 9b away from the inlet / outlet port 9a is separated by a support partition 9b5 to form an actuator mounting cavity 9b6. A belt connecting seat 9c1 is provided on the side of the piston 9c away from the inlet / outlet port 9a. The piston actuator 9d includes a compression spring 9d1 elastically supported between the support partition 9b5 and the piston 9c, an actuator bracket 9d2 installed in the actuator mounting cavity 9b6, and a piston drive motor 9d3, a reducer 9d7, and at least one belt guide pulley 9d4 all mounted on the actuator bracket 9d2. The piston drive motor 9d3 can drive the drive pulley 9d5 to rotate via the reducer 9d7. A belt 9d6 is wound on the drive pulley 9d5. Guided by the belt guide pulleys 9d4, the belt 9d6 passes through the actuator mounting cavity 9b6, and its outer end connects to the belt connecting seat 9c1. Therefore, the displacement of the piston 9c can be controlled by the forward and reverse rotation of the motor shaft of the piston drive motor 9d3. Specifically, when the motor shaft of the piston drive motor 9d3 rotates forward, the belt 9d6 wound on the drive pulley 9d5 increases, and the piston 9c moves closer to the intake and exhaust port 9a under the action of the compression spring 9d1; when the motor shaft of the piston drive motor 9d3 rotates in reverse, the belt 9d6 wound on the drive pulley 9d5 decreases, and the belt 9d6 pulls the piston 9c away from the intake and exhaust port 9a, while the compression spring 9d1 is compressed.
[0161] In this embodiment, the multi-purpose channel 9e of the housing serves to route wiring and balance the internal pressure of the housing 9b. Specifically, the support partition 9b5 also has a multi-purpose channel 9b51 connecting the balancing housing 9b and the actuator mounting cavity 9b6, and the control box 3 has a first wiring harness through-hole 3a and a second wiring harness through-hole 3b. The wiring harness of the first sensor circuit board 7 passes through the multi-purpose channel 9b51, the housing multi-purpose channel 9e, and the first wiring harness through-hole 3a in sequence before entering the control box 3 and connecting to the control circuit board 6. The wiring harness of the piston drive motor 9d3 passes through the housing multi-purpose channel 9e and the first wiring harness through-hole 3a in sequence before entering the control box 3 and connecting to the control circuit board 6. The wiring harness of the second sensor circuit board 8 exits the circuit board mounting ring groove 9b4, enters the control box 3 through the second wiring harness through-hole 3b, and connects to the control circuit board 6. The above design achieves reasonable wiring routing while ensuring the airtightness of the detection space 9b1.
[0162] Furthermore, the multi-purpose channel 9b51 of the partition and the multi-purpose channel 9e of the housing have the function of balancing the internal pressure of the housing 9b. Specifically, when the piston 9c is close to the inlet and outlet port 9a, the external gas enters through the multi-purpose channel 9e of the housing and the multi-purpose channel 9b51 of the partition in sequence. When the piston 9c is away from the inlet and outlet port 9a, the internal gas is discharged through the multi-purpose channel 9b51 of the partition and the multi-purpose channel 9e of the housing in sequence.
[0163] Furthermore, a sealing ring 9f is installed on the outer edge of the side wall of the piston 9c near the intake and exhaust ports 9a. The sealing ring 9f is interference-fitted with the inner wall of the detection space 9b1, thereby ensuring the airtightness of the detection space 9b1.
[0164] Please see Figures 2-6 The filter assembly 10 is installed at the outer end of the intake and exhaust ports 9a.
[0165] In this embodiment, the filter assembly 10 includes an assembly housing 10a, on which an exhaust nozzle 10d for exhausting air, an air inlet nozzle 10c for intake air, and at least one detection inlet nozzle 10j for intake of the gas to be tested are installed. The interior of the assembly housing 10a integrates an intake / exhaust passage 10b communicating with the intake / exhaust port 9a, an exhaust passage 10e communicating with the intake / exhaust passage 10b and the exhaust nozzle 10d, and a filter passage 10f communicating with the intake / exhaust passage 10b. The filter passage 10f is provided with filters 10g in sequence, the same number as the number of detection inlet nozzles 10j and air inlet nozzles 10c. Specifically, the filter passage 10f is provided with at least two stages of filters 10g, the filter 10g farthest from the intake / exhaust passage 10b is the first stage filter 10g, and the filter 10g closest to the intake / exhaust passage 10b is the last stage filter 10g. Meanwhile, the air intake end of the last stage filter 10g is connected to the corresponding air intake nozzle 10c through the corresponding air intake channel 10h, and the air intake ends of the other stages of filters 10g are connected to the corresponding detection air intake nozzles 10j through the corresponding air intake channels 10h. An on / off actuator 10i is installed on the assembly housing 10a to switch the on / off states of the exhaust channel 10e and each air intake channel 10h.
[0166] Therefore, when the on / off actuator 10i keeps the exhaust passage 10e open, all intake branches 10h are cut off by the on / off actuator 10i. At this time, the gas in the detection space 9b1 is discharged outward through the exhaust nozzle 10d. When the on / off actuator 10i keeps any intake branch 10h open, the exhaust passage 10e and the other intake branches 10h are all cut off by the on / off actuator 10i. At this time, outside gas is drawn into the detection space 9b1 through the open intake branch 10h. If the open intake branch 10h is the intake branch 10h connected to the first-stage filter 10g... The inhaled gas will be filtered sequentially through all filters 10g before being drawn into the detection space 9b1. If the unobstructed air intake branch 10h is connected to the last filter 10g, the inhaled gas will be filtered sequentially through only the last filter 10g before being drawn into the detection space 9b1. If the unobstructed air intake branch 10h is connected to one of the intermediate filters 10g, the inhaled gas will be filtered sequentially through the corresponding first filter 10g to the last filter 10g before being drawn into the detection space 9b1.
[0167] Therefore, the electronic nose air intake mechanism can not only connect and disconnect the corresponding air intake channel 10h via the actuator 10i according to the type of gas being tested and the detection environment, so that the gas being tested can be filtered sequentially through the corresponding filters 10g at each stage while being drawn into the detection space 9b1, removing interfering gases and impurities, thereby effectively improving the recognition accuracy of the subsequent gas detection membrane sensor and thus improving the detection accuracy of the electronic nose; but also can proportionally compress the gas being tested according to the type of gas being tested and the detection requirements, meeting the need for some specific gases to be accurately detected only after increasing their concentration (some characteristic gases are very rarefied, and proportional compression of the gas can increase the concentration, avoiding excessively low sensor detection values or excessive data fluctuations), further improving the detection stability and accuracy of the electronic nose, and enhancing its applicability and versatility; at the same time, the filter assembly 10 has the function of self-inspection and self-cleaning of the filter elements of each stage of the filter 10g, further ensuring detection accuracy; please refer to the following text for details.
[0168] Regarding the 10g filters at each stage, the most versatile 10g filter is placed in the last stage. It filters moisture and particulate impurities, serving not only to filter air but also to protect the internal gas sensor from moisture and particulate corrosion during self-cleaning and other air intake processes, extending the sensor's lifespan and detection accuracy. It also improves air intake efficiency and shortens intake time during self-cleaning and other air intake processes, and can even filter the gas being tested, making it extremely versatile. Conversely, the least versatile 10g filter is placed in the first stage, with the versatility of the intermediate 10g filters increasing progressively towards the last stage. The 10g filter element can be a physical filter element capable of removing solids, liquids, and aerosols, or a chemical adsorbent filter element capable of removing specific chemical gases, such as activated carbon.
[0169] It should be noted that, please refer to Figure 2 and Figure 4 The assembly housing 10a is equipped with a removable housing cover plate 10a1, which allows the filter element of the filter 10g to be replaced and maintained by removing the housing cover plate 10a1.
[0170] Please see Figure 4 The on / off actuator 10i includes an actuator push rod 10i1 and an actuator motor 10i2 for controlling the reciprocating movement of the actuator push rod 10i1. The actuator push rod 10i1 has an exhaust port 10i11 and an intake port 10i12. When the actuator motor 10i2 connects the exhaust port 10i11 of the actuator push rod 10i1 to the exhaust channel 10e, the intake port 10i12 is not connected to any intake channel 10h. When the actuator motor 10i2 connects the intake port 10i12 of the actuator push rod 10i1 to any intake channel 10h, the exhaust port 10i11 is not connected to the exhaust channel 10e. Furthermore, the actuator motor 10i2 can also cause the actuator push rod 10i1 to simultaneously block the exhaust channel 10e and all intake branches 10h, thereby achieving precise control of the on / off state of the exhaust channel 10e and each intake branch 10h.
[0171] The on / off actuators 10i are all electrically connected to the control circuit board 6. The wiring harness of the actuator motor 10i2 enters the control box 3 through the second wiring harness through hole 3b and is connected to the control circuit board 6. This not only achieves reasonable wiring, but also enables the control circuit board 6 to control the on / off actuators 10i.
[0172] Example 5:
[0173] A control method for an electronic nose according to Embodiment 4 is performed according to the following steps:
[0174] A1. Check the condition of the 10g filter cartridges in each stage of the electronic nose air intake mechanism to ensure they are functioning properly, following these steps:
[0175] A11, Air inlet nozzle 10c connects to air;
[0176] A12. The on / off actuator 10i connects the air intake passage 10h connected to the air intake nozzle 10c until the piston 9c moves to its limit position away from the air intake and exhaust ports 9a, and the detection space 9b1 is filled with air.
[0177] A13. The on / off actuator 10i cuts off the exhaust passage 10e and all intake passages 10h;
[0178] A14. Piston 9c moves toward the inlet and outlet port 9a, and the air in the detection space 9b1 is compressed until the pressure sensor 11 detects that the internal air pressure of the detection space 9b1 has reached the self-test set value.
[0179] A15. The on / off actuator 10i keeps the air intake channel 10h connected to the first-stage filter 10g unobstructed until the internal air pressure of the detection space 9b1 returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, it means that the filter element of the filter 10g is not in good condition, and after the piston 9c empties the air in the detection space 9b1, proceed to step A2; if no, it means that the filter element of the filter 10g is in good condition, and after the piston 9c empties the air in the detection space 9b1, proceed to step A3.
[0180] A2. Clean the 10g filter cartridges of each stage of the electronic nose air intake mechanism according to the following steps:
[0181] A21. The on / off actuator 10i connects to the intake passage 10h, which is connected to the last stage filter 10g;
[0182] A22. After piston 9c moves to its limit position away from the inlet / outlet port 9a, piston 9c quickly empties the air in the detection space 9b1 and determines whether the number of repetitions of step A22 is greater than the repetition threshold: if yes, piston 9c moves to its limit position away from the inlet / outlet port 9a, and after the detection space 9b1 is filled with air, proceed to step A23; otherwise, repeat step A22. The purpose of piston 9c quickly emptying the air in the detection space 9b1 is to quickly reverse the discharge of the residue on the filter element of the last stage filter 10g through air pressure impact.
[0183] A23. After the on / off actuator 10i cuts off the exhaust passage 10e and all intake passages 10h, the piston 9c moves toward the direction of the intake and exhaust ports 9a until the pressure sensor 11 detects that the internal air pressure of the detection space 9b1 reaches the self-test set value.
[0184] A24. The on / off actuator 10i connects to the air intake channel 10h connected to the last stage filter 10g until the internal air pressure of the detection space 9b1 returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, it means that the filter element of the last stage filter 10g cannot be restored to a good state through self-cleaning, so the filter element of the last stage filter 10g is replaced first, and then the on / off actuator 10i connects to the air intake channel 10h connected to the previous stage filter 10g, and proceeds to step A25; if no, it means that the filter element of the last stage filter 10g has been restored to a good state through self-cleaning, and the on / off actuator 10i connects to the air intake channel 10h connected to the previous stage filter 10g, and proceeds to step A25.
[0185] A25. After piston 9c moves to its limit position away from the intake and exhaust ports 9a, piston 9c quickly empties the air in the detection space 9b1 and determines whether the number of repetitions of step A25 is greater than the repetition threshold: if yes, piston 9c moves to its limit position away from the intake and exhaust ports 9a, and the detection space 9b1 is filled with air, then proceed to step A26; otherwise, repeat step A25. The purpose of piston 9c quickly emptying the air in the detection space 9b1 is to quickly expel the residue on the filter element of the primary filter 10g, which is closest to the unobstructed intake passage 10h, through the air pressure impact force.
[0186] A26. After the on / off actuator 10i cuts off the exhaust passage 10e and all intake passages 10h, the piston 9c moves toward the direction of the intake and exhaust ports 9a until the pressure sensor 11 detects that the internal air pressure of the detection space 9b1 reaches the self-test set value.
[0187] A27. The on / off actuator 10i connects the previously connected air intake channel 10h until the internal air pressure of the detection space 9b1 returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, it means that the filter element of the first-stage filter 10g closest to the unobstructed air intake channel 10h cannot be restored to a good state through self-cleaning, so after replacing the filter element of the first-stage filter 10g closest to the unobstructed air intake channel 10h, proceed to step A28; if no, it means that the filter element of the first-stage filter 10g closest to the unobstructed air intake channel 10h has been restored to a good state through self-cleaning, and proceed to step A28.
[0188] A28. Determine whether the primary filter 10g closest to the unobstructed air intake channel 10h is the first-stage filter 10g: If yes, it means that the filter elements of all filters 10g are in good condition. After the piston 9c empties the air in the detection space 9b1, proceed to step A3. If no, after the piston 9c empties the air in the detection space 9b1, the on / off actuator 10i connects the air intake channel 10h connected to the previous primary filter 10g, and then returns to step A25.
[0189] A3. To test the gas, follow these steps:
[0190] A31. Based on the type of gas being tested, determine how many stages of filters (10g) are needed for filtration, and then connect the corresponding test inlet (10j) to the gas being tested.
[0191] A32. Determine whether the sensor array combination installed in the housing 9b meets the detection requirements: If yes, proceed to step A33; if no, replace the sensor array combination corresponding to the gas being tested, and then proceed to step A33. Thus, by combining the types of each first general-purpose gas sensor 2, each second general-purpose gas sensor 4, and each sensor array, a modular sensor array capable of accurately analyzing the gas being tested is formed.
[0192] A33. Depending on the type of gas being tested, the on / off actuator 10i keeps the intake passage 10h corresponding to the detection inlet 10j connected to the gas being tested unobstructed until the piston 9c moves to its limit position away from the inlet and outlet ports 9a and the detection space 9b1 is filled with the gas being tested.
[0193] A34. Based on the type of gas being tested, determine whether it is necessary to compress the gas inside the testing space 9b1: if yes, proceed to step A35; otherwise, proceed to step A37.
[0194] A35, the on / off actuator 10i cuts off the exhaust passage 10e and all intake passages 10h;
[0195] A36. Piston 9c moves toward the inlet and outlet ports 9a until the volume of the gas to be tested is compressed to the detection set value required for its detection.
[0196] A37. Each first general-purpose gas sensor 2, each second general-purpose gas sensor 4, and each sensor array detect the gas to be tested.
[0197] A38. The on / off actuator 10i keeps the exhaust passage 10e unobstructed until the piston 9c empties the gas being tested from the detection space 9b1.
[0198] Furthermore, it also includes step A4, which performs self-cleaning on the detection space 9b1, according to the following steps:
[0199] A41, Air inlet nozzle 10c connects to air;
[0200] A42. The on / off actuator 10i keeps the intake passage 10h, which is connected to the last stage filter 10g, unobstructed.
[0201] A43. After piston 9c moves to its limit position away from the inlet and outlet ports 9a, piston 9c empties the air in the detection space 9b1. Then, it is determined whether the response values of all sensor arrays, the first universal gas sensor 2, and the second universal gas sensor 4 are all reference values: if yes, it indicates that the self-cleaning of the detection space 9b1 is complete, and the machine is stopped; if no, it indicates that there is still residual gas to be detected in the detection space 9b1, and step A43 is repeated.
[0202] Therefore, the ability to use air to self-clean the detection space avoids interference from residual gas from the previous test, thus effectively improving detection accuracy.
[0203] Further, step A37 is performed according to the following steps:
[0204] A371. Record the response values of all first general-purpose gas sensors 2, each second general-purpose gas sensor 4, and the sensor array;
[0205] A372. After waiting for the set interval time, record the response values of all first general gas sensors 2, each second general gas sensor 4, and the sensor array at the current moment.
[0206] A373. Determine whether the average rate of change of the response values of all first general-purpose gas sensors 2, each second general-purpose gas sensor 4 and the sensor array at the current moment compared with the response values at the previous moment is less than the set rate of change value: If yes, record the response values of all first general-purpose gas sensors 2, each second general-purpose gas sensor 4 and the sensor array at the current moment, and then proceed to step A38; if no, return to step A372.
[0207] For example, a total of 6 sensors are set up, and the response values of the 6 sensors are Ra, Rb, Rc, Rd, Re, and Rf, respectively. The response values at the current time (time t) are Rat, Rbt, Rct, Rdt, Ret, and Rft, respectively, and the response values at the previous time (time t-1) are Rat-1, Rbt-1, Rct-1, Rdt-1, Ret-1, and Rf, respectively. At time t-1, the rates of change of the response values of the six sensors at the current moment compared to the response values at the previous moment are Ka=(Rat-Rat-1) / Rat-1, Kb=(Rbt-Rbt-1) / Rbt-1, Ka=(Rct-Rct-1) / Rct-1, Kd=(Rdt-Rdt-1) / Rdt-1, Ke=(Ret-Ret-1) / Ret-1, and Kf=(Rft-Rft-1) / Rft-1. The average rate of change of the response values of the six sensors at the current moment compared to the response values at the previous moment is M=(Ka+Kb+Kc+Kd+Ke+Kf) / 6. If M is less than the set rate of change value, it indicates that the gas is currently in a stable and uniform state, and the response values of the sensors at the current moment can be used for gas identification. This design further improves the detection accuracy of the electronic nose and is suitable for detection scenarios with high precision requirements.
[0208] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention. Those skilled in the art, under the guidance of the present invention, can make various similar representations without departing from the spirit and claims of the present invention, and such modifications all fall within the protection scope of the present invention.
Claims
1. A gas classification method based on a multi-scale slope spiking neural network, characterized in that, Follow these steps: S1. The electronic nose inhales the target sample, and the pulse neural network obtains the continuous analog signals output by the N gas sensor arrays of the electronic nose. S2. The heterogeneous fusion pulse coding module first models each continuous analog signal as a two-dimensional matrix. Then, it linearly maps the two-dimensional matrix corresponding to each gas sensor array to a synaptic input current vector. Subsequently, it introduces a leakage integral trigger neuron model, an integral trigger neuron model, and a Jizhikevich neuron model, respectively, and performs parallel integration and firing on the synaptic input current vector corresponding to each gas sensor array. Finally, it performs a logical "OR" operation on the binary pulses generated by the leakage integral trigger neuron model, the integral trigger neuron model, and the Jizhikevich neuron model corresponding to each gas sensor array at each time step to obtain the final fused pulse vector corresponding to each gas sensor array at the current time step. The final fused pulse vectors at all time steps are stacked along the time axis to obtain the pulse feature matrix corresponding to each gas sensor array. S3. The pulse feature matrix corresponding to each gas sensor array is fed in parallel into three one-dimensional convolution branches with different kernel sizes of the multi-scale slope sensing module, and the fast-scale feature tensor, meso-scale feature tensor, and slow-scale feature tensor corresponding to each gas sensor array are extracted respectively. Then, through the scale attention mechanism, the global statistics are calculated to dynamically allocate the scale attention weights corresponding to the three branches. Finally, the output features of the three branches are weighted and summed according to the scale attention weights to obtain the aggregated features corresponding to each gas sensor array. S4. The array attention fusion module first concatenates the aggregated features of all gas sensor arrays along the channel dimension and performs a global pooling operation to generate a global context descriptor containing the joint distribution information of all gas sensor arrays. Then, it processes the global context descriptor through a nonlinear mapping network to generate an N-dimensional array importance weight vector. Finally, it adopts a weighted strategy to obtain the global fusion feature tensor based on the aggregated features of all gas sensor arrays and their corresponding importance weights. S5. Input the global fusion feature tensor into the backbone network of the spiking neural network and output the results. Based on the output results, classify the target samples to obtain the variety classification results and origin traceability results of the target samples.
2. The gas classification method according to claim 1, characterized in that, In step S2, the set of two-dimensional matrices corresponding to the N gas sensor arrays is denoted as... For any number of A gas sensor array is modeled as a two-dimensional matrix. , ; Corresponding to the A two-dimensional matrix of gas sensor arrays Linearly mapped to the synaptic input current vector at the current moment The expression is: ; In the above formula, , Represents the learnable linear projective weight matrix; The dynamic equation for the leakage integral-triggered neuron model is: ; In the above formula, express The leakage integral triggers the neuron's membrane potential vector. This represents the time decay constant of the membrane potential. express The leakage integral at any given moment triggers the accumulation of membrane potential in neurons. Represents the distribution threshold in scalar form. express The time-leaking integral triggers the binary pulse vector output by the neuron; The current time step leak integral triggers the binary pulse vector output by the neuron. The expression is: ; In the above formula, This represents the Heaviside step function, which outputs 1 when the input is greater than 0, and 0 otherwise. The expression for the integral-triggered neuron model is: ; In the above formula, express The time-integration triggers the membrane potential vector of the neuron. express The integral at time step triggers the binary impulse vector output by the neuron; The binary impulse vector that triggers the neuron's output at the current time step is then integrated. The expression is: ; The expression for the Izhikevich neuron model is: ; ; In the above formula, express The membrane potential vector of the Izhikevich neuron at time t; express The membrane potential vector of the Izhikevich neuron at time t; express The recovered variable vector at time step; express The recovered variable vector at time step; and Both represent dimensionless learnable parameters, which respectively control the time scale and sensitivity of the recovery variable; when When the threshold is exceeded, the Izhikevich neuron outputs a binary pulse vector for the current moment. And trigger a reset; The corresponding to the first Three binary pulse vectors of a gas sensor array , and By using the logical "OR" operation, we obtain the result corresponding to the first... The final fused pulse vector of the gas sensor array at the current moment The expression is: ; In the above formula, , Represents an element-wise logical "OR" operation; The final fused pulse vector at all moments Stacked along the time axis, we get the corresponding to the first... Pulse characteristic matrix of a gas sensor array .
3. The gas classification method according to claim 2, characterized in that, In step S3, the corresponding to the first Pulse characteristic matrix of a gas sensor array The data is fed into three one-dimensional convolutional branches in parallel to obtain the fast-scale feature tensor. Mesoscale feature tensor and slow-scale feature tensor The expression is: ; ; ; In the above formula, This represents a one-dimensional convolution operation. This represents the spiking neuron after convolution. , and These represent convolution weight matrices with kernel sizes of 1, 3, and 5, respectively. The expression for dynamically allocating scale attention weights corresponding to the three branches by calculating global statistics using the scale attention mechanism is as follows: ; ; In the above formula, This indicates that global average pooling is used. The scale description vector obtained by adding elements one by one; This represents a multilayer perceptron used for feature mapping; Represents the normalization function; Denotes the generated scale attention weight vector, where, , and These represent the weight coefficients corresponding to the three branches; The output features of the three branches are weighted and summed according to the scale attention weights to obtain the value corresponding to the first branch. Aggregation characteristics of gas sensor arrays The expression is: 。 4. The gas classification method according to claim 3, characterized in that, In step S4, the aggregated features of all gas sensor arrays are concatenated along the channel dimension and a global pooling operation is performed to generate a global context descriptor containing the joint distribution information of all gas sensor arrays. The relation is: ; In the above formula, This indicates a feature concatenation operation along the channel dimension. This indicates a global pooling operation; Global context descriptors are processed through a non-linear mapping network. Generate an N-dimensional array importance weight vector. The relation is: ; In the above formula, This represents a multilayer perceptron; Indicates the use of limiting the output to Activation functions between; ,in, This represents the importance weight of the Nth gas sensor array; A weighted strategy is employed to obtain a global fusion feature tensor based on the aggregated features of all gas sensor arrays and their corresponding importance weights. The relation is: ; In the above formula, The index represents the gas sensor array, and 1 represents the identity term of the residual connection.
5. An electronic device, characterized in that, It includes at least one processor and a memory communicatively connected to the at least one processor, the memory storing a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the gas classification method according to any one of claims 1 to 4.
6. A computer-readable medium, characterized in that, The computer-readable medium stores computer instructions for causing the at least one processor of claim 5 to perform the gas sorting method of any one of claims 1 to 4.
7. An electronic nose according to any one of claims 1 to 4, characterized in that, The electronic nose includes a detection box and a filter assembly; The detection box includes a box with an internal detection space and an inlet / outlet located at one end of the box. The inlet / outlet communicates with the interior of the box. A piston and a piston actuator for moving the piston closer to or away from the inlet / outlet are installed in the box. A multi-purpose channel is provided on the box on the side of the piston away from the inlet / outlet. A pressure sensor is installed in the detection space. At least one set of gas sensor arrays arranged side by side along the length of the box are detachably installed on the circumferential outer wall of the box. Each gas sensor array is integrated on a corresponding thin-film sensor. Each thin-film sensor communicates with the detection space through multiple exposure holes opened on the box. The filter assembly includes an assembly housing, which integrates an exhaust nozzle, at least one detection air inlet, an air inlet, an intake / exhaust duct communicating with the intake / exhaust port, an exhaust passage connecting the intake / exhaust duct and the exhaust nozzle, and a filter passage communicating with the intake / exhaust duct. The filter passage is sequentially equipped with filters equal in number to the detection air inlet and the air inlet. The intake end of the last stage filter is connected to the corresponding air inlet via a corresponding intake passage. The intake ends of the remaining stages of filters are connected to the corresponding detection air inlet via corresponding intake passages. The assembly housing is equipped with an on / off actuator for switching the on / off states of the exhaust passage and each intake passage. When the on / off actuator keeps the exhaust passage open, all intake passages are cut off by the on / off actuator. When the on / off actuator keeps any intake passage open, the exhaust passage and the remaining intake passages are cut off by the on / off actuator.
8. The electronic nose according to claim 7, characterized in that, At least one thin-film sensor positioning groove is recessed on the circumferential outer wall of the housing and arranged side by side along its length. The bottom of each thin-film sensor positioning groove is provided with multiple exposure holes. Each thin-film sensor is detachably embedded in the thin-film sensor positioning groove. Each opening of the thin-film sensor positioning groove is fitted with an elastic quick-change sealing plate for pressing the corresponding thin-film sensor in the thin-film sensor positioning groove.
9. The electronic nose according to claim 7, characterized in that, At least one gas sensor array consisting of a first metal gas sensor is installed on the side of the piston near the intake and exhaust ports, and at least one gas sensor array consisting of a second metal oxide gas sensor is also installed on the inner wall of the detection space on the side facing the piston.
10. A control method for an electronic nose according to any one of claims 7 to 9, characterized in that, Follow these steps: A1. Check the condition of the filter elements of each stage of the electronic nose air intake mechanism to ensure they are functioning properly, following these steps: A11. Air intake nozzle connects to air; A12. The on / off actuator connects the air intake passage to the air intake nozzle until the piston moves to its limit position away from the air intake and exhaust ports. A13. The on / off actuator cuts off the exhaust passage and all intake passages; A14. The piston moves toward the direction of the intake and exhaust ports until the pressure sensor detects that the internal air pressure of the detection space has reached the self-test set value. A15. The on / off actuator keeps the air intake passage connected to the first-stage filter open until the internal air pressure of the detection space returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, after the piston empties the air in the detection space, proceed to step A2; if no, after the piston empties the air in the detection space, proceed to step A3. A2. Clean the filter elements of each stage of the electronic nose air intake mechanism according to the following steps: A21. The on / off actuator connects the air intake passage that is connected to the last stage filter; A22. After the piston moves to its limit position away from the intake and exhaust ports, the piston quickly empties the air in the detection space and determines whether the number of repetitions of step A22 is greater than the repetition threshold: if yes, the piston moves to its limit position away from the intake and exhaust ports and proceeds to step A23; otherwise, step A22 is repeated. A23. After the on / off actuator cuts off the exhaust passage and all intake passages, the piston moves toward the direction of the intake and exhaust ports until the pressure sensor detects that the internal air pressure of the detection space reaches the self-test set value. A24. The on / off actuator connects to the air intake channel connected to the last stage filter until the internal air pressure of the detection space returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, replace the filter element of the last stage filter first, and then the on / off actuator connects to the air intake channel connected to the previous stage filter, and proceed to step A25; if no, the on / off actuator connects to the air intake channel connected to the previous stage filter, and proceed to step A25. A25. After the piston moves to its limit position away from the intake and exhaust ports, the piston quickly empties the air in the detection space and determines whether the number of repetitions of step A25 is greater than the repetition threshold: if yes, the piston moves to its limit position away from the intake and exhaust ports and proceeds to step A26; otherwise, step A25 is repeated. A26. After the on / off actuator cuts off the exhaust passage and all intake passages, the piston moves toward the direction of the intake and exhaust ports until the pressure sensor detects that the internal air pressure of the detection space reaches the self-test set value. A27. The on / off actuator connects the previously connected air intake channel until the internal air pressure of the detection space returns to normal pressure, and determines whether the time to return to normal pressure is greater than the time threshold: if yes, replace the filter element of the first-stage filter closest to the unobstructed air intake channel, and then proceed to step A28; otherwise, proceed to step A28. A28. Determine whether the primary filter closest to the unobstructed intake passage is the first-stage filter: If yes, after the piston empties the air in the detection space, proceed to step A3; if no, after the piston empties the air in the detection space, the on / off actuator connects the intake passage connected to the previous primary filter, and then returns to step A25. A3. To test the gas, follow these steps: A31. Depending on the type of gas being tested, a corresponding detection inlet is connected to the gas being tested. A32. Based on the type of gas being tested, determine whether the gas sensor array installed in the chamber meets the testing requirements: if yes, proceed to step A33; if no, replace the gas sensor array corresponding to the gas being tested and proceed to step A33. A33. Depending on the type of gas being tested, the on / off actuator keeps the intake passage corresponding to the gas being tested through the detection inlet until the piston moves to its limit position away from the inlet and outlet ports. A34. Based on the type of gas being tested, determine whether it is necessary to compress the gas inside the testing space: if yes, proceed to step A35; otherwise, proceed to step A37. A35. The on / off actuator cuts off the exhaust passage and all intake passages; A36. The piston moves toward the inlet and outlet ports until the volume of the gas to be tested is compressed to the required detection set value. A37. The gas sensor array detects the gas being tested; A38. The on / off actuator keeps the exhaust passage open until the piston empties the gas being tested from the test space.