Gas classification method and equipment based on learnable sensor attention network

By employing a gas classification method based on a learnable sensor attention network and a modular sensor array, the deployment challenge of existing electronic noses on resource-constrained devices is solved. This achieves low-power, high-efficiency gas classification and detection, with strong adaptability, applicable to different detection targets, and improved detection accuracy and ease of operation.

CN122087500APending Publication Date: 2026-05-26SOUTHWEST UNIV +1
View PDF 2 Cites 0 Cited by

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

Technical Problem

Existing electronic noses are difficult to deploy on resource-constrained edge computing nodes. Traditional deep learning models have high computational costs, rely on tedious manual feature extraction, ignore asynchronous sensor response and multi-scale spatiotemporal dependence, resulting in low detection accuracy and poor versatility. They cannot adapt to different detection targets and lack air intake filtration and proportional compression functions.

Method used

A gas classification method based on learnable sensor attention networks is adopted. End-to-end feature extraction is performed through learnable parameter encoding module, dual-scale residual module and pulse attention module. Combined with sparse pulse transmission and modular sensor array, efficient fusion of heterogeneous sensor data and multi-scale feature extraction are achieved. A filter assembly and detection box are also provided to adapt to different detection targets.

Benefits of technology

It achieves low-power, high-efficiency gas classification, is highly adaptable, can be applied to different detection targets, improves detection accuracy and ease of operation, reduces investment costs, and is suitable for low-power hardware devices with limited resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122087500A_ABST
    Figure CN122087500A_ABST
Patent Text Reader

Abstract

The invention discloses a gas classification method and device based on a learnable sensor attention network. The gas classification method comprises a learnable parameter coding module, a dual-scale residual module and a pulse attention module. The learnable parameter coding module introduces a current change rate as an explicit dynamic feature, and endows neurons with the ability to acutely capture gas adsorption and desorption gradients. And the dual-scale residual module realizes multi-level feature extraction of the complex odor manifold through parallel multi-cavity convolution branch. The pulse attention module adaptively searches and enhances cross-channel causal association under the condition of tolerating inherent response delay of a heterogeneous sensor, so that the problem of feature dislocation caused by asynchronous response is effectively solved. Finally, the pulse neural network can deeply explore and fully utilize the spatial-temporal dynamic and potential coupling relation in the sensor array under a low-power-consumption pulse calculation normal form, the robustness of the features is remarkably enhanced, and the recognition performance in a complex scene is improved.
Need to check novelty before this filing date? Find Prior Art

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 learnable sensor attention network. Background Technology

[0002] The combination of gas detection technology based on electronic noses and deep learning provides an intelligent solution for variety identification and origin traceability of products (such as agricultural products like chili peppers), demonstrating significant advantages in improving detection efficiency and achieving objective quantitative evaluation.

[0003] However, in the practical application of product classification and origin traceability, existing technologies still face the following serious challenges: First, mainstream deep learning models (such as convolutional neural networks (CNNs)) are usually accompanied by high computational costs and a huge number of parameters. This over-reliance on high-performance computing resources makes it difficult to effectively deploy them on resource-constrained edge computing nodes, thus hindering the implementation of real-time field monitoring. Second, traditional machine learning methods often rely heavily on cumbersome manual feature extraction processes, which not only leads to complex and inefficient data processing but also limits the model's ability to generalize to complex odor data. Therefore, the current field urgently needs an innovative solution that can achieve end-to-end automatic feature extraction while meeting the requirements of low-power operation.

[0004] Furthermore, existing methods do not fully utilize the subtle dynamics inherent in the signals from electronic nose sensor arrays. Currently, mainstream network models primarily focus on extracting static amplitude features from a single timescale, neglecting the instantaneous rate of change during odor molecule adsorption and desorption, as well as the multi-scale spatiotemporal dependencies between sensors. In addition, these models often ignore the inherent response time differences of heterogeneous sensors, assuming all channels respond synchronously, thus losing crucial phase causal information. Finally, models based on traditional deep learning are often highly complex, relying on numerous floating-point parameters and requiring massive amounts of data for fitting. Given the high cost of electronic nose data acquisition, these cumbersome models also pose a significant challenge to low-power hardware integration and online real-time deployment.

[0005] Furthermore, due to the different detection targets or purposes, existing 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 dedicated 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] To address the technical problems of high energy consumption, lack of dynamic features, insufficient multi-scale modeling, and ineffective utilization of asynchronous sensor responses in existing methods, this invention provides a gas classification method and device based on a learnable sensor attention network.

[0009] The technical solution is as follows:

[0010] The first aspect of this application relates to a gas classification method based on a learnable sensor attention network, which is carried out according to the following steps:

[0011] S1. The electronic nose inhales the target sample. The various gas sensors of the electronic nose collect the gas response data of the target sample and convert the gas response data into a continuous analog signal sequence. ;

[0012] S2, at each time step The learnable parameter encoding module encodes the input continuous analog signal sequence through a learnable linear layer. Mapping to the basic input signal Based on the basic input signal Generate its first-order temporal difference term Based on the basic input signal First-order time difference term Construct a membrane potential dynamic model and generate an encoded pulse sequence. ;

[0013] S3, the encoded pulse sequence The input dual-scale residual module extracts local detail features and long-range dependency features through parallel standard convolutional branches and dilated convolutional branches, respectively. The signal obtained by weighted fusion of the local detail features and long-range dependency features is then processed. As input, the leakage integral triggering neurons of the spiking neural network output feature pulses rich in spatiotemporal information. ;

[0014] S4, Characteristic pulse The input spiking attention module first passes through the convolutional layers and leakage integrals of the spiking neural network, triggering neurons to be projected as query spiking features. Key pulse characteristics Sum pulse characteristics Then, the impulse characteristics are queried using the Hadamard product metric. Bond pulse characteristics The correlation between them to generate cumulative current Then accumulate the current Injection of gated leakage integrals triggers the accumulation of neurons to generate an attention mask. Finally, the attention mask Acting on value pulse characteristics To output fused features ;

[0015] S5, Regarding the final fusion features After time aggregation, the result is used as the output. Based on the output, the target sample is classified to obtain the variety classification result and the origin traceability result of the target sample.

[0016] The gas classification method based on a learnable sensor attention network, as described above, has achieved the following technical results:

[0017] 1. Solving the problem of asynchronous response: The pulse attention mechanism utilizes synaptic traces and resonant potential energy to accurately assess the correlation strength of different sensors in the spatiotemporal dimension, effectively solving the problem of asynchronous response of heterogeneous sensors and realizing efficient fusion of multi-source data.

[0018] 2. Efficient multi-scale feature extraction: The dual-scale residual module, through the parallel collaborative work of standard convolution and dilated convolution, can simultaneously capture fine-grained local fluctuations and wide-area long-range dependencies in the gas response signal without significantly increasing the computational burden.

[0019] 3. Extremely high feasibility for engineering implementation: The pure event-driven computing model combined with sparse binary pulse transmission results in a small number of network parameters and eliminates the need for expensive floating-point multiplication operations, creating conditions for deployment on resource-constrained low-power neuromorphic hardware devices.

[0020] 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.

[0021] Using the above electronic equipment, all the advantages of the gas classification methods mentioned above are achieved.

[0022] 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.

[0023] Using the above computer-readable media, all the advantages of the gas classification methods described above are achieved.

[0024] The fourth aspect of this application relates to an electronic nose, the electronic nose comprising a detection box and a filter assembly;

[0025] The detection box includes a box body, one end of which is provided with an inlet and outlet port communicating with the interior. The box body is equipped with a first piston and a second piston arranged sequentially away from the inlet and outlet port, as well as a first piston actuator and a second piston actuator respectively used to drive the first piston and the second piston closer to or away from the inlet and outlet port. The first piston and the second piston together with the inner wall of the box body form a detection space. A pressure sensor is installed in the detection space. At least one gas detection thin film sensor is detachably installed on the circumferential outer wall of the box body and arranged side by side along its length. Each gas detection thin film sensor communicates with the detection space through multiple exposure holes opened on the box body. A solenoid valve connector with its inner end communicating with the detection space is installed on the first piston. The outer end of the solenoid valve connector can be connected to or separated from the inner end of the inlet and outlet port under the action of the first piston actuator.

[0026] 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 outer end of 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, and 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 all cut off by the on / off actuator.

[0027] The fifth aspect of this application relates to a control method for the aforementioned electronic nose, comprising the following steps:

[0028] 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:

[0029] A11. Air intake nozzle connects to air;

[0030] A12. The first piston moves to its limit position in the direction of the intake and exhaust ports, so that the outer end of the solenoid valve connector is connected to the inner end of the intake and exhaust ports.

[0031] A13. The on / off actuator connects the air intake channel to the air intake nozzle, and at the same time, puts the solenoid valve connector in the open state.

[0032] A14. The second piston moves to its limit position away from the intake and exhaust ports;

[0033] A15. The on / off actuator cuts off the exhaust passage and all intake passages;

[0034] A16. The second 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] A17. The on / off actuator keeps the intake passage connected to the first-stage filter unobstructed 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, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, and then proceeds to step A2; if no, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, and then proceeds 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 second piston moves to its limit position away from the intake and exhaust ports, it quickly moves towards the intake and exhaust ports until it comes into contact with the first piston. Then, it is determined whether the number of repetitions of step A22 is greater than the repetition threshold: if yes, the second 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 second 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 second piston moves to its limit position away from the intake and exhaust ports, it quickly moves towards the intake and exhaust ports until it comes into contact with the first piston. Then, it is determined whether the number of repetitions of step A25 is greater than the repetition threshold: if yes, the second 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 second 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 first-stage filter closest to the unobstructed intake passage is the first-stage filter: If yes, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, then proceed to step A3; if no, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, then the on / off actuator connects the intake passage connected to the previous stage 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 detection membrane sensor assembly installed in the chamber meets the testing requirements: if yes, proceed to step A33; if no, replace the gas detection membrane sensor assembly 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 second 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, after closing the solenoid valve connector, proceed to step A35; if no, after closing the solenoid valve connector, proceed to step A36.

[0050] A35. The first piston and / or the second piston move toward each other until the volume of the gas to be tested is compressed to the detection set value required for its detection.

[0051] A36. Depending on the type of gas being detected, the first piston and the second piston move synchronously and at equal distances to both sides of the required gas detection thin-film sensor combination.

[0052] A37. A gas detection thin-film sensor combination detects the gas being tested;

[0053] A38. The first piston moves to its limit position in the direction of the intake and exhaust ports, so that the outer end of the solenoid valve connector is connected to the inner end of the intake and exhaust ports, and the solenoid valve connector is kept open.

[0054] A39. The on / off actuator keeps the exhaust passage open until the second piston moves toward the direction of the intake and exhaust ports and comes into contact with the first piston.

[0055] A4. Perform self-cleaning of the testing space according to the following steps:

[0056] A41. Air intake nozzle connects to air;

[0057] A42. The on / off actuator keeps the intake passage connected to the last stage filter unobstructed;

[0058] A43. After the second piston moves away from the inlet and outlet ports to its limit position, it moves towards the inlet and outlet ports until it comes into contact with the first piston. Then, it is determined whether the response values ​​of all gas detection membrane sensors are the reference values: if yes, stop the machine; if no, repeat step A43.

[0059] The above electronic nose and its control method have achieved the following technical effects:

[0060] 1. It can adaptively adjust the type of each gas detection thin film sensor according to the type of gas being detected and the detection environment, forming a modularly combinable and replaceable sensor array, thereby achieving accurate analysis of the target gas. It is suitable for the detection of different targets and has excellent versatility, making this electronic nose a universal device applicable to different targets. This greatly reduces the investment cost of the electronic nose and is conducive to its application, promotion and popularization.

[0061] 2. The detection space is dynamically defined by the first piston and the second piston. Therefore, the detection space can be located at the position of any one or more adjacent gas detection film sensors. Thus, when detecting similar types of gases, the gas detection film sensor can be selected by changing the position of the detection space without disassembling and replacing the gas detection film sensor. This greatly improves the convenience of operation and reduces the frequency of disassembling and replacing the gas detection film sensor.

[0062] 3. It can use two or more gas detection thin-film sensors of the same type and with identical parameter settings, 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 above gas classification methods and obtains high-precision detection results, but also greatly improves testing efficiency and the convenience of detection operation.

[0063] 4. 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;

[0064] 5. 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 during self-cleaning and other air intake processes, shortening the air intake time. 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 detection film sensor, and thus improving the detection accuracy of the electronic nose.

[0065] 6. 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 need to be increased in concentration before they can be accurately detected, thus further improving the applicability and versatility of the electronic nose.

[0066] 7. 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.

[0067] 8. Step A4 enables the air to self-clean the detection space, preventing residual gas from the previous test from interfering with the next test and effectively improving detection accuracy. Attached Figure Description

[0068] Figure 1 This is a schematic diagram illustrating the principle of a gas classification method.

[0069] Figure 2 This is a schematic diagram of the three-dimensional structure of the electronic nose;

[0070] Figure 3 This is a schematic diagram of the planar structure of the electronic nose;

[0071] Figure 4 for Figure 3 Sectional view at point AA;

[0072] Figure 5 A schematic diagram of the structure after removing all the flexible quick-change sealing plates for the electronic nose;

[0073] Figure 6 A schematic diagram of the structure after removing all flexible quick-change sealing plates and gas detection film sensors from the electronic nose. Detailed Implementation

[0074] The present invention will be further described below with reference to the embodiments and accompanying drawings.

[0075] Example 1:

[0076] like Figure 1 As shown, a gas classification method based on a learnable sensor attention network is performed according to the following steps:

[0077] S1. The electronic nose inhales the target sample (gas). The various gas sensors of the electronic nose collect the gas response data of the target sample and convert the gas response data into a continuous analog signal sequence. The pulsed neural network acquires the continuous analog signal sequences output by each gas sensor of the electronic nose. Among them, the continuous analog signal sequence output by all gas sensors Record .

[0078] S2, at each time step The Learnable Parameter Encoding Module (LPE) uses a learnable linear layer to encode the input continuous analog signal sequence. Mapping to the basic input signal Based on the basic input signal Generate its first-order temporal difference term Based on the basic input signal First-order time difference term Construct a membrane potential dynamic model and generate an encoded pulse sequence. .

[0079] Specifically, step S2 is performed according to the following steps:

[0080] S21, at each time step The learnable parameter encoding module encodes the input continuous analog signal sequence through a learnable linear layer. Mapping to the basic input signal :

[0081] ;

[0082] In the above formula, and These represent the scaling gain and bias parameter vectors of the channel, respectively. It represents the Hadamardi (or Hadama) stack.

[0083] This process aims to map heterogeneous physical quantities uniformly to a current domain suitable for neuromorphic computation.

[0084] S22, Based on basic input signal Generate its first-order temporal difference term :

[0085] ;

[0086] In the above formula, This represents the input signal at the previous moment.

[0087] S23, Based on basic input signal First-order time difference term Constructing neuronal membrane potential The dynamic model generates the encoded pulse sequence. :

[0088] ;

[0089] ;

[0090] In the above formula, Indicates the membrane time constant; This represents the membrane potential at the previous moment; This represents the learnable momentum factor; Indicates the membrane potential threshold; This indicates the output pulse from the previous moment; This represents the Heaviside step function, which is used to generate the encoded pulse sequence. .

[0091] In constructing neuronal membrane potential In the process of dynamic modeling, the basic input signal First-order time difference term It represents the instantaneous changing trend of the input characteristics and directly participates in the accumulation process of membrane potential as an "injected current". In the neuron's membrane potential... In the dynamic model, the basic input signal As an intensity term, the driving neuron reflects the current absolute concentration of the gas; As a gradient injection term, this design is physically equivalent to a proportional controller: when the base input signal... Rapid rise (first-order time difference term) When the gradient term provides additional positive excitation, it accelerates pulse delivery; conversely, when the base input signal is low, the gradient term provides additional positive excitation, accelerating pulse delivery. Decrease (first-order time difference term) When the gradient term is applied, it rapidly suppresses the membrane potential and reduces noise interference.

[0092] Therefore, in order to enable the spiking neural network (SNN) to sensitively capture subtle temporal changes in the gas sensor response, step S2 designs a learnable parameter encoding strategy. The core idea of ​​this strategy is that the membrane potential of the neuron is not only driven by the current input intensity, but also explicitly regulated by the rate of change of the input current, thereby establishing a predictive encoding mechanism with "advanced sensing" capability.

[0093] S3. The encoded pulse sequence output from the learnable parameter encoding module. The input dual-scale residual module (DSR-Block) is split into two parallel convolutional branches: one is a standard convolutional branch used to capture small fluctuations between adjacent time steps. Its expansion rate The other is the dilated convolution branch used to capture long-range dependencies. Its expansion rate .

[0094] Local detail features and long-range dependency features are extracted by parallel standard convolutional branches and dilated convolutional branches, respectively, and then the local detail features and long-range dependency features are weighted and fused to obtain the signal. The relation is:

[0095] ;

[0096] In the above formula, This represents the standard convolution branch, and its dilation rate. ; This represents the standard convolution branch, and its dilation rate. .

[0097] As input, leaky integral-triggered neurons (LIF neurons) of the spiking neural network are injected, and they output characteristic pulses rich in spatiotemporal information. .

[0098] Therefore, in order to enable spiking neural networks (SNNs) to capture both fine-grained local features and wide-area contextual dependencies in the gas sensor response without significantly increasing computational overhead, a dual-scale residual module is designed in step S3. This module not only expands the receptive field using multi-dip convolution but also introduces parameterized neuron dynamics to achieve adaptive feature integration.

[0099] S4, Characteristic pulse The input spiking attention module (SA) first projects query spiking features through convolutional layers and LIF neurons of a spiking neural network. Key pulse characteristics Sum pulse characteristics The relationship is as follows:

[0100] ;

[0101] In the above formula, This represents the convolutional layer of a spiking neural network. Represents LIF neurons in a spiking neural network; where the query pulse feature is... Key pulse characteristics Sum pulse characteristics All of them are binary pulse characteristics.

[0102] Then, the impulse characteristics are queried using the Hadamard product metric. Bond pulse characteristics The correlation between them, in neuromorphic hardware, is equivalent to an efficient AND gate operation: only if the query impulse feature is true. Bond pulse characteristics An activation current, i.e., an accumulated current, is generated only when pulses are emitted simultaneously at the same spatiotemporal location. The relationship is as follows:

[0103] ;

[0104] In the above formula, This represents the scaling factor.

[0105] Next, the accumulated current will be... An attention mask is generated after the injection of gated LIF neurons accumulates. The relationship is as follows:

[0106] ;

[0107] In the above formula, This refers to gated LIF neurons, which act as temporal accumulators. They only fire impulses to generate sparse attention masks when the cross-modal correlation is strong enough and persistent. .

[0108] Finally, the attention mask Acting on value pulse characteristics It also introduces residual connections to preserve the original features in order to output fused features. The relationship is as follows:

[0109] .

[0110] Therefore, in order to effectively fuse heterogeneous sensor features under low power consumption constraints, a pulse-state attention module was designed in step S4. This module utilizes the spatiotemporal coincidence of pulses to calculate attention weights, thereby avoiding the expensive Softmax operation and floating-point multiplication in traditional attention mechanisms.

[0111] S5, Regarding the final fusion features After time aggregation, the result is used as the output. Based on the output, the target sample is classified to obtain the variety classification result and the origin traceability result of the target sample.

[0112] In summary, the spiking neural network (SNN) used in the gas classification method of this embodiment mainly consists of three core modules: a learnable parameter encoding module (LPE), a dual-scale residual module (DSR-Block), and a spiking attention module (SA).

[0113] Given the dramatic transient changes in volatile gas signals upon contact with the sensor, this embodiment proposes an innovative learnable parameter encoding mechanism. This mechanism aims not only to encode the absolute intensity of the signal but also, by introducing current gradient injection, allows neurons to keenly perceive the "rate of change" and dynamic trends of the signal. By doing so, it effectively overcomes the lag of traditional encoding at the rising and falling edges of the signal, endowing the network with a predictive, forward-looking perception capability, thereby helping the spiking neural network to identify the most distinctive gas fingerprint features early on. This enables the model to more accurately capture the adsorption and desorption dynamics of odor molecules, thus laying a high-fidelity temporal foundation for subsequent processing.

[0114] Considering that odor features often simultaneously contain short-term dramatic fluctuations and long-term sustained accumulations, this embodiment also relates to a backbone feature extraction structure embedded with a dual-scale residual module. These structures aim to capture multi-scale spatiotemporal dependencies. The dual-scale residual module, through parallel multi-dilated convolutional branches, focuses on extracting features from different receptive fields within the same time window, aiming to fuse fine-grained local textures with broader contextual patterns. By modeling feature interactions across different time spans, this structure can capture rich multi-scale dependencies, which is crucial for understanding complex mixed gas data. In contrast, single-scale convolutions are often limited by local perspectives, while this dual-scale design enhances the model's ability to represent complex odor manifolds.

[0115] Finally, to address the inherent asynchronous response among heterogeneous sensor arrays, this embodiment also incorporates a pulse attention module. This module adaptively searches for and enhances resonant features across modalities. This architecture enhances the model's ability to align heterogeneous signals along the time axis, achieving more robust feature fusion by suppressing non-resonant noise and amplifying strongly correlated multi-sensor signals.

[0116] By combining dynamic encoding from LPE and multi-scale features from DSR, the SCMA module helps the model integrate multi-source views, thereby significantly improving the overall performance of agricultural product classification and traceability tasks. These three modules complement each other, enabling the model to effectively utilize all sensor data, from micro-gradients to macro-resonance, to obtain more accurate and reliable predictions.

[0117] Therefore, the gas classification method in this embodiment outperforms mainstream deep learning methods in various gas identification tasks. Simultaneously, the model boasts extremely low computational power consumption, a small number of parameters, and strong noise resistance, making it more practically valuable than traditional artificial neural networks. This invention is the first to combine a biomimetic pulse coding mechanism with cross-modal resonant attention, successfully completing both agricultural product variety classification and origin traceability tasks. Specific advantages are as follows:

[0118] 1. The pulse attention mechanism utilizes synaptic traces and resonant potential energy to accurately assess the correlation strength of different sensors in the spatiotemporal dimension, effectively solving the problem of asynchronous response of heterogeneous sensors and realizing efficient fusion of multi-source data and extraction of key information.

[0119] 2. The dual-scale residual module, through the parallel collaborative operation of standard convolution and dilated convolution, can simultaneously capture fine-grained local fluctuations and wide-area long-range dependencies in the gas response signal without increasing the computational burden, and efficiently and quickly extract the core temporal features of product (chili) data.

[0120] 3. The pure event-driven computing model combined with sparse binary pulse propagation results in fewer network parameters and eliminates the need for expensive floating-point multiplication operations, creating conditions for deployment on resource-constrained low-power neuromorphic hardware devices and making it highly feasible for engineering implementation.

[0121] Example 2:

[0122] 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.

[0123] 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.

[0124] 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.

[0125] 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).

[0126] 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.

[0127] 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.

[0128] Example 3:

[0129] 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.

[0130] 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).

[0131] 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.

[0132] 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.

[0133] Example 4:

[0134] Please see Figures 2-6 An electronic nose, comprising a detection box and a filter assembly 10.

[0135] The testing box includes a box body 9b, one end of which is provided with an inlet and outlet 9a. The inner end of the inlet and outlet 9a is connected to the interior of the box body 9b. In this embodiment, the box body 9b is preferably a cylindrical structure.

[0136] The housing 9b is equipped with a first piston 9c and a second piston 9h arranged sequentially away from the inlet and outlet 9a, as well as a first piston actuator 9d and a second piston actuator 9i for driving the first piston 9c and the second piston 9h closer to or away from the inlet and outlet 9a, respectively. The first piston 9c and the second piston 9h together with the inner wall of the housing 9b form a detection space 9b1. Therefore, by driving the first piston 9c and the second piston 9h through the first piston actuator 9d and the second piston actuator 9i, both the volume of the detection space 9b1 and the position of the detection space 9b1 in the axial direction of the housing 9b can be adjusted.

[0137] 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.

[0138] Furthermore, a solenoid valve connector 12 is installed on the first piston 9c, with its inner end communicating with the detection space 9b1. The outer end of the solenoid valve connector 12 can communicate with or separate from the inner end of the inlet / outlet port 9a under the action of the first piston actuator 9d. When the outer end of the solenoid valve connector 12 is communicating with the inner end of the inlet / outlet port 9a and the solenoid valve connector 12 is in the open state, if the second piston actuator 9i drives the second piston 9h away from the first piston 9c, the external gas enters the detection space 9b1 sequentially through the inlet / outlet port 9a and the solenoid valve connector 12. If the second piston actuator 9i drives the second piston 9h closer to the first piston 9c, the gas in the detection space 9b1 is discharged sequentially through the solenoid valve connector 12 and the inlet / outlet port 9a. When the solenoid valve connector 12 is in the closed state, the gas is sealed in the detection space 9b1.

[0139] In this embodiment, at least one gas detection film sensor 5 is detachably mounted on the circumferential outer wall of the housing 9b, arranged side by side along its length. Each gas detection film sensor 5 communicates with the detection space 9b1 through multiple exposure holes 9b2 opened on the housing 9b. Therefore, this embodiment can not only adapt the type of each gas detection film sensor 5 according to the type of gas being detected and the detection environment, forming a modularly combinable and replaceable sensor array, thereby achieving accurate analysis of the target gas, adapting to the detection of different targets, and having excellent versatility, making this electronic nose a universal device applicable to different targets, greatly reducing the investment cost of the electronic nose, and facilitating its application, promotion, and popularization; moreover, the detection space 9b1 is dynamically defined by the first piston 9c and the second piston 9h, so the detection space 9b1 can be positioned at the location of any one or more adjacent gas detection film sensors 5. This allows for the selection of the gas detection film sensor 5 by changing the position of the detection space 9b1 when detecting similar types of gases, eliminating the need to disassemble and replace the gas detection film sensor 5. This significantly improves operational convenience and reduces the frequency of disassembly and replacement of the gas detection film sensor 5. Furthermore, by using two or more gas detection film sensors 5 with identical types and parameter settings, a single test of the detection space 9b1 achieves the effect of multiple redundant tests. This satisfies the data acquisition requirements of the aforementioned gas classification methods, obtaining high-precision detection results, while also greatly improving testing efficiency and operational convenience. It should be noted that each gas detection film sensor 5 typically integrates multiple gas sensors, which can be of the same or different types.

[0140] 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 recessed and arranged side by side along its length. Each thin-film sensor positioning groove 9b3 is an annular or semi-circular structure adapted to the gas detection thin-film sensor 5. Each thin-film sensor positioning groove 9b3 is an ultra-thin strip structure adapted to the corresponding gas detection thin-film sensor 5. Each gas detection thin-film sensor 5 is 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 positioning groove 9b3 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.

[0141] 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 gas detection thin-film sensor 5 into the thin-film sensor positioning groove 9b3, thereby enabling the replacement and maintenance of the gas detection 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.

[0142] 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 gas detection thin film sensor 5 into the corresponding thin film sensor positioning groove 9b3.

[0143] Furthermore, the adjacent thin-film sensor positioning slots 9b3 are separated by positioning ribs 9b8, which can not only ensure the stability and reliability of the installation of the elastic quick-change sealing plate 1, but also guide and limit the installation of the gas detection thin-film sensor 5.

[0144] Please see Figure 4 At least one of the first piston 9c and the second piston 9h is provided with at least one universal gas sensor 2 on its sidewall that is close to each other. That is, all universal gas sensors 2 are provided on the first piston 9c, or all universal gas sensors 2 are provided on the second piston 9h, or both the first piston 9c and the second piston 9h are provided with universal gas sensors 2. Therefore, in this embodiment, the universal gas sensors 2, which are versatile and do not need to be replaced frequently, are installed on the first piston 9c and / or the second piston 9h (replacing them would be troublesome); the gas detection thin film sensors 5, which need to be adaptively adjusted for different detection targets, are 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.

[0145] Furthermore, in this embodiment, all general-purpose gas sensors 2 are preferably disposed on the side wall of the second piston 9h near the first piston 9c. Simultaneously, a sensor circuit board 7, electrically connected to the pressure sensor 11 and all general-purpose gas sensors 2, is mounted on the side wall of the second piston 9h away from the first piston 9c. This design facilitates wiring, as detailed below:

[0146] Please see Figures 2-4A control box 3 is installed on the circumferential side wall of the detection box 9. A control circuit board 6 is installed in the control box 3. The connectors of each gas detection 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 the signal acquisition of each gas detection thin-film sensor 5 and process the signals acquired by each gas detection thin-film sensor 5. Correspondingly, the solenoid valve connector 12, the first piston actuator 9d, the second piston actuator 9i, and the sensor circuit board 7 are all electrically connected to the control circuit board 6. Therefore, the control circuit board 6 can both control the signal acquisition of each general-purpose gas sensor 2 and process the signals acquired by each general-purpose gas sensor 2, and also control the solenoid valve connector 12, the first piston actuator 9d, and the second piston actuator 9i. In summary, the control circuit board 6 can achieve the coordinated control of various electrical components.

[0147] In this embodiment, both the first piston actuator 9d and the second piston actuator 9i preferably adopt high-precision electric actuators, which can accurately control the position of the first piston 9c and the second piston 9h.

[0148] In this embodiment, to facilitate wiring and balance the internal pressure of the housing 9b, a multi-purpose channel 9e is provided at the end of the housing 9b away from the inlet / outlet 9a. Correspondingly, a first wiring harness through-hole 3a and a second wiring harness through-hole 3b are provided on the control box 3. The wiring harness of the sensor circuit board 7 passes through the 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. Similarly, a third wiring harness through-hole 9b5 communicating with the control box 3 is provided on the housing 9b. The wiring harness of the solenoid valve connector 12 enters the control box 3 through the third wiring harness through-hole 9b5 and connects to the control circuit board 6.

[0149] Furthermore, on the side wall of the first piston 9c and the second piston 9h that are close to each other, a sealing ring 9f is installed at its outer edge. 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.

[0150] Furthermore, the outer end of the solenoid valve connector 12 has an outer conical joint section with a conical structure, and the inner end of the inlet / outlet port 9a has an inner conical joint section with a conical structure. When the outer end of the solenoid valve connector 12 is connected to the inner end of the inlet / outlet port 9a, the outer conical joint section and the inner conical joint section are conically matched, which not only ensures the airtightness of the connection position between the two, but also makes the connection process smoother and avoids jamming problems.

[0151] Please see Figures 2-6The filter assembly 10 is installed at the outer end of the inlet / outlet port 9a. The filter assembly 10 includes an assembly housing 10a, on which an exhaust nozzle 10d for exhaust, an air inlet nozzle 10c for air intake, 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 inlet / outlet passage 10b communicating with the inlet / outlet port 9a, an exhaust passage 10e communicating with the inlet / outlet passage 10b and the exhaust nozzle 10d, and a filter passage 10f communicating with the inlet / outlet passage 10b. The filter passage 10f is provided with the same number of filters 10g as the detection inlet nozzle 10j and the air inlet nozzle 10c. Specifically, the filter passage 10f is provided with at least two stages of filters 10g. The filter 10g farthest from the inlet / outlet passage 10b is the first stage filter 10g, and the filter 10g closest to the inlet / outlet 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.

[0152] 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.

[0153] Therefore, the electronic nose air intake mechanism can not only connect and disconnect the corresponding air intake channel 10h 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 the detection accuracy.

[0154] 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.

[0155] 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.

[0156] Please see Figure 4The 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.

[0157] 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.

[0158] Example 5:

[0159] The control method of the electronic nose in Embodiment 4 is carried out according to the following steps:

[0160] 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:

[0161] A11, Air inlet nozzle 10c connects to air;

[0162] A12. The first piston 9c moves to its limit position in the direction of approaching the inlet and outlet ports 9a, so that the outer end of the solenoid valve connector 12 is connected to the inner end of the inlet and outlet ports 9a.

[0163] A13. The on / off actuator 10i connects the air intake channel 10h connected to the air intake nozzle 10c, and at the same time, puts the solenoid valve connector 12 in the open state.

[0164] A14. The second piston 9h moves to its limit position in a direction away from the intake and exhaust ports 9a, and the detection space 9b1 is filled with air.

[0165] A15. The on / off actuator 10i cuts off the exhaust passage 10e and all intake passages 10h;

[0166] A16. The second piston 9h moves toward the inlet and outlet 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 reaches the self-test set value.

[0167] A17. The on / off actuator 10i keeps the intake passage 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 the second piston 9h moves towards the direction of the intake and exhaust port 9a until it abuts against the first piston 9c, and then proceeds to step A2; if no, it means that the filter element of the filter 10g is in good condition, and the second piston 9h moves towards the direction of the intake and exhaust port 9a until it abuts against the first piston 9c, and then proceeds to step A3.

[0168] A2. Clean the 10g filter cartridges of each stage of the electronic nose air intake mechanism according to the following steps:

[0169] A21. The on / off actuator 10i connects to the intake passage 10h, which is connected to the last stage filter 10g;

[0170] A22. After the second piston 9h moves to its limit position away from the intake and exhaust ports 9a, the second piston 9h quickly moves towards the intake and exhaust ports 9a until it comes into contact with the first piston 9c. Then, it is determined whether the number of repetitions of step A22 is greater than the repetition threshold: if yes, the second piston 9h moves to its limit position away from the intake and exhaust ports 9a (the detection space 9b1 is filled with air), and then proceeds to step A23; if no, step A22 is repeated. The purpose of the second piston 9h quickly moving towards the intake and exhaust ports 9a until it comes into contact with the first piston 9c is to be able to quickly reverse the discharge of the residue on the filter element of the last stage filter 10g through the air pressure impact force.

[0171] A23. After the on / off actuator 10i cuts off the exhaust passage 10e and all intake passages 10h, the second piston 9h 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.

[0172] 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.

[0173] A25. After the second piston 9h moves to its limit position away from the intake and exhaust ports 9a, the second piston 9h quickly moves towards the intake and exhaust ports 9a until it comes into contact with the first piston 9c. It is then determined whether the number of repetitions of step A25 is greater than the repetition threshold: if yes, the second piston 9h moves to its limit position away from the intake and exhaust ports 9a (the detection space 9b1 is filled with air), and then proceeds to step A26; otherwise, step A25 is repeated. The purpose of the second piston 9h quickly moving towards the intake and exhaust ports 9a until it comes into contact with the first piston 9c is to be able to quickly reverse the discharge of the residue on the filter element of the last stage filter 10g through the air pressure impact force.

[0174] A26. After the on / off actuator 10i cuts off the exhaust passage 10e and all intake passages 10h, the second piston 9h 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.

[0175] 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.

[0176] A28. Determine whether the first-stage filter 10g closest to the unobstructed intake passage 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 second piston 9h moves towards the intake and exhaust ports 9a and comes into contact with the first piston 9c, proceed to step A3. If no, after the second piston 9h moves towards the intake and exhaust ports 9a and comes into contact with the first piston 9c, the on / off actuator 10i connects the intake passage 10h connected to the previous first-stage filter 10g, and then returns to step A25.

[0177] A3. To test the gas, follow these steps:

[0178] 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.

[0179] A32. Based on the type of the gas being tested, determine whether the gas detection membrane sensor 5 assembly installed in the housing 9b meets the detection requirements: if yes, proceed to step A33; if no, replace the gas detection membrane sensor 5 assembly corresponding to the gas being tested, and then proceed to step A33; thereby, by combining the types of each general gas sensor 2 with each gas detection membrane sensor 5, a modular sensor array capable of accurately analyzing the gas being tested is formed.

[0180] A33. Depending on the type of gas being tested, the on / off actuator 10i keeps the intake passage 10h corresponding to the detection intake nozzle 10j connected to the gas being tested unobstructed until the second piston 9h moves to its limit position away from the intake and exhaust ports 9a, and the detection space 9b1 is filled with the gas being tested.

[0181] 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, after closing the solenoid valve connector 12, proceed to step A35; otherwise, after closing the solenoid valve connector 12, proceed to step A36.

[0182] A35, the first piston 9c and / or the second piston 9h move toward each other until the volume of the gas to be tested is compressed to the detection set value required for its detection;

[0183] A36. Depending on the type of gas being detected, the first piston 9c and the second piston 9h move synchronously at equal distances to both sides of the gas detection thin film sensor 5 combination to be used, that is: the gas detection thin film sensor 5 combination to be used is located in the detection space 9b1.

[0184] A37. The general-purpose gas sensor 2 and the gas detection thin-film sensor 5 are combined to detect the gas to be detected;

[0185] A38. The first piston 9c moves to its limit position in the direction of approaching the inlet and outlet ports 9a, so that the outer end of the solenoid valve connector 12 is connected to the inner end of the inlet and outlet ports 9a, and the solenoid valve connector 12 is kept open.

[0186] A39. The on / off actuator 10i keeps the exhaust passage 10e unobstructed until the second piston 9h moves toward the inlet / outlet port 9a and comes into contact with the first piston 9c, thus venting the gas being tested.

[0187] A4. Perform self-cleaning on the detection space 9b1 according to the following steps:

[0188] A41, Air inlet nozzle 10c connects to air;

[0189] A42. The on / off actuator 10i keeps the intake passage 10h, which is connected to the last stage filter 10g, unobstructed.

[0190] A43. After the second piston 9h moves away from the inlet and outlet ports 9a to its limit position, the second piston 9h moves towards the inlet and outlet ports 9a until it comes into contact with the first piston 9c. Then, it is determined whether the response values ​​of all gas detection membrane sensors 5 are the reference values: if yes, it means that the self-cleaning of the detection space 9b1 is completed and the machine is stopped; if no, it means that there is still residual gas in the detection space 9b1 and step A43 is repeated.

[0191] Further, step A37 is performed according to the following steps:

[0192] A371. Record the response values ​​of all general-purpose gas sensors 2 and gas detection thin-film sensors 5;

[0193] A372. After waiting for the set interval time, record the response values ​​of all general gas sensors 2 and gas detection thin film sensors 5 at the current moment;

[0194] A373. Determine whether the average rate of change of the response values ​​of all general gas sensors 2 and gas detection thin-film sensors 5 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 general gas sensors 2 and gas detection thin-film sensors 5 at the current moment, and then proceed to step A38; if no, return to step A372.

[0195] For example, a total of 6 sensors are set up, and the response values ​​of the 6 sensors are respectively Ra, Rb, Rc, Rd, Re, and Rf, with response values ​​at the current time (time t) respectively. Ra t 、Rb t 、Rc t 、Rd t Re t 、Rf t The response values ​​at the previous time step (t-1) were respectively Ra t-1 、Rb t-1 、Rc t-1 、Rd t-1 Re t-1 、Rf t-1 The rates of change of the current response values ​​of the six sensors compared to the previous response values ​​are Ka = (Ra) t -Ra t-1 ) / Ra t-1 Kb=(Rb) t -Rb t-1 ) / Rb t-1 Ka=(Rc t -Rc t-1 ) / Rc t-1Kd=(Rd) t -Rd t-1 ) / Rd t-1 Ke=(Re t -Re t-1 ) / Re t-1 Kf=(Rf) t -Rf t-1 ) / Rf t-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.

[0196] 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 learnable sensor attention network, characterized in that, Follow these steps: S1. The electronic nose inhales the target sample. The various gas sensors of the electronic nose collect the gas response data of the target sample and convert the gas response data into a continuous analog signal sequence. ; S2, at each time step The learnable parameter encoding module encodes the input continuous analog signal sequence through a learnable linear layer. Mapping to the basic input signal Based on the basic input signal Generate its first-order temporal difference term Based on the basic input signal First-order time difference term Construct a membrane potential dynamic model and generate an encoded pulse sequence. ; S3, the encoded pulse sequence The input dual-scale residual module extracts local detail features and long-range dependency features through parallel standard convolutional branches and dilated convolutional branches, respectively. The signal obtained by weighted fusion of the local detail features and long-range dependency features is then processed. As input, the leakage integral triggering neurons of the spiking neural network output feature pulses rich in spatiotemporal information. ; S4, Characteristic pulse The input spiking attention module first passes through the convolutional layers and leakage integrals of the spiking neural network, triggering neurons to be projected as query spiking features. Key pulse characteristics Sum pulse characteristics Then, the impulse characteristics are queried using the Hadamard product metric. Bond pulse characteristics The correlation between them to generate cumulative current Then accumulate the current Injection of gated leakage integrals triggers the accumulation of neurons to generate an attention mask. Finally, the attention mask Acting on value pulse characteristics To output fused features ; S5, Regarding the final fusion features After time aggregation, the result is used as the output. Based on the output, the target sample is classified to obtain the variety classification result and origin traceability result of the target sample.

2. The gas classification method according to claim 1, characterized in that, Step S2 is performed according to the following steps: S21, at each time step The learnable parameter encoding module encodes the input continuous analog signal sequence through a learnable linear layer. Mapping to the basic input signal : ; In the above formula, and These represent the scaling gain and bias parameter vectors of the channel, respectively. It represents the Hadamardi (or Hadama) stack; S22, Based on basic input signal Generate its first-order temporal difference term : ; In the above formula, This represents the input signal from the previous moment; S23, Based on basic input signal First-order time difference term Constructing neuronal membrane potential The dynamic model generates the encoded pulse sequence. : ; ; In the above formula, Indicates the membrane time constant. This represents the membrane potential at the previous moment. This represents the learnable momentum factor. Indicates the membrane potential threshold. This represents the output pulse from the previous moment. This represents the Heaviside step function.

3. The gas classification method according to claim 1, characterized in that, In step S3, local detail features and long-range dependency features are extracted using parallel standard convolutional branches and dilated convolutional branches, respectively, and the local detail features and long-range dependency features are weighted and fused to obtain the signal. The relation is: ; In the above formula, This represents the standard convolution branch, and its dilation rate. ; This represents the standard convolution branch, and its dilation rate. .

4. The gas classification method according to claim 1, characterized in that, In step S4, the convolutional layers and leakage integral trigger neurons of the spiking neural network are projected onto query spiking features. Key pulse characteristics Sum pulse characteristics The relation is: ; In the above formula, This represents the convolutional layer of a spiking neural network. This represents the leakage integral triggering neuron in a spiking neural network; Using the Hadamard product to query impulse characteristics Bond pulse characteristics The correlation between them generates cumulative current The relation is: ; In the above formula, Indicates the scaling factor; Accumulated current Injection of gated leakage integrals triggers the accumulation of neurons to generate an attention mask. The relation is: ; In the above formula, This indicates that the gated leakage integral triggers the neuron; Attention mask Acting on value pulse characteristics Output fusion features The relation is: 。 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 body, one end of which is provided with an inlet and outlet port communicating with the interior. The box body is equipped with a first piston and a second piston arranged sequentially away from the inlet and outlet port, as well as a first piston actuator and a second piston actuator respectively used to drive the first piston and the second piston closer to or away from the inlet and outlet port. The first piston and the second piston together with the inner wall of the box body form a detection space. A pressure sensor is installed in the detection space. At least one gas detection thin film sensor is detachably installed on the circumferential outer wall of the box body and arranged side by side along its length. Each gas detection thin film sensor communicates with the detection space through multiple exposure holes opened on the box body. A solenoid valve connector with its inner end communicating with the detection space is installed on the first piston. The outer end of the solenoid valve connector can be connected to or separated from the inner end of the inlet and outlet port under the action of the first piston actuator. 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 outer end of 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, and 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 all cut off by the on / off actuator.

8. The electronic nose according to claim 7, characterized in that, At least one of the first piston and the second piston has at least one universal gas sensor disposed on the side wall of the piston that is close to each other. 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 gas detection 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 gas detection thin-film sensor in the thin-film sensor positioning groove.

9. The electronic nose according to claim 7, characterized in that, The on / off actuator includes an actuator push rod and an actuator motor for controlling the back-and-forth movement of the actuator push rod. The actuator push rod has an exhaust port and an intake port. When the actuator motor connects the exhaust port of the actuator push rod to the exhaust channel, the intake port is not connected to any intake channel. When the actuator motor connects the intake port of the actuator push rod to any intake channel, the exhaust port is not connected to the exhaust channel.

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 first piston moves to its limit position in the direction of the intake and exhaust ports, so that the outer end of the solenoid valve connector is connected to the inner end of the intake and exhaust ports. A13. The on / off actuator connects the air intake channel to the air intake nozzle, and at the same time, puts the solenoid valve connector in the open state. A14. The second piston moves to its limit position away from the intake and exhaust ports; A15. The on / off actuator cuts off the exhaust passage and all intake passages; A16. The second 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. A17. The on / off actuator keeps the intake passage connected to the first-stage filter unobstructed 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, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, and then proceeds to step A2; if no, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, and then proceeds 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 second piston moves to its limit position away from the intake and exhaust ports, it quickly moves towards the intake and exhaust ports until it comes into contact with the first piston. Then, it is determined whether the number of repetitions of step A22 is greater than the repetition threshold: if yes, the second 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 second 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 second piston moves to its limit position away from the intake and exhaust ports, it quickly moves towards the intake and exhaust ports until it comes into contact with the first piston. Then, it is determined whether the number of repetitions of step A25 is greater than the repetition threshold: if yes, the second 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 second 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 first-stage filter closest to the unobstructed intake passage is the first-stage filter: If yes, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, then proceed to step A3; if no, the second piston moves towards the direction of the intake and exhaust ports until it comes into contact with the first piston, then the on / off actuator connects the intake passage connected to the previous stage 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 detection membrane sensor assembly installed in the chamber meets the testing requirements: if yes, proceed to step A33; if no, replace the gas detection membrane sensor assembly 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 second 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, after closing the solenoid valve connector, proceed to step A35; if no, after closing the solenoid valve connector, proceed to step A36. A35. The first piston and / or the second piston move toward each other until the volume of the gas to be tested is compressed to the detection set value required for its detection. A36. Depending on the type of gas being detected, the first piston and the second piston move synchronously and at equal distances to both sides of the required gas detection thin-film sensor combination. A37. A gas detection thin-film sensor combination detects the gas being tested; A38. The first piston moves to its limit position in the direction of the intake and exhaust ports, so that the outer end of the solenoid valve connector is connected to the inner end of the intake and exhaust ports, and the solenoid valve connector is kept open. A39. The on / off actuator keeps the exhaust passage open until the second piston moves toward the direction of the intake and exhaust ports and comes into contact with the first piston. A4. Perform self-cleaning of the testing space according to the following steps: A41. Air intake nozzle connects to air; A42. The on / off actuator keeps the intake passage connected to the last stage filter unobstructed; A43. After the second piston moves away from the inlet and outlet ports to its limit position, it moves towards the inlet and outlet ports until it comes into contact with the first piston. Then, it is determined whether the response values ​​of all gas detection membrane sensors are the reference values: if yes, stop the machine; if no, repeat step A43.

Citation Information

Patent Citations

  • Electronic nose device

    CN119936122A

  • Electronic nose system for monitoring indoor air quality

    CN119959474A