Intelligent electronic nose device for auxiliary diagnosis of lung cancer disease
By using the data processing module of the electronic nose device to perform drift-robust representation learning and feature interaction fusion, the sensor drift problem was solved, the stability and accuracy of lung cancer auxiliary diagnosis were improved, and more efficient lung cancer detection was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING TECH & BUSINESS UNIV
- Filing Date
- 2026-05-25
- Publication Date
- 2026-07-24
AI Technical Summary
Existing electronic noses face sensor drift issues in lung cancer auxiliary diagnosis under conditions of batch, device, and environmental disturbance, and their reliance on shallow features makes it difficult to fully characterize the dynamic response process, resulting in a decline in auxiliary diagnostic performance.
A data processing module is used for drift-robust representation learning and feature extraction. Through drift-robust reconstruction, temporal representation reconstruction and time-frequency feature reconstruction, calibration feature vectors and time-frequency depth feature vectors are generated. These feature vectors are then interactively fused through a feature fusion module to finally output the auxiliary diagnostic results for lung cancer.
It improves the cross-device stability and anti-drift capability of the electronic nose in the auxiliary diagnosis of lung cancer, enhances the ability to characterize the dynamic patterns of lung cancer-related VOCs, and improves the reliability and reproducibility of diagnostic results.
Smart Images

Figure CN122451584A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of medical testing and intelligent auxiliary diagnosis technology, and relates to an auxiliary diagnostic device for lung cancer, particularly an intelligent electronic nose device for auxiliary diagnosis of lung cancer. Background Technology
[0002] Against the backdrop of an increasingly urgent need for precision diagnosis and treatment of lung cancer, early screening and auxiliary diagnosis of lung cancer have become important directions in clinical and translational medicine. Early-stage lung cancer often lacks typical symptoms, and clinical screening and diagnosis typically rely on low-dose CT scans, imaging follow-up, bronchoscopy, percutaneous biopsy, and pathological examination. However, these methods still have practical gaps in terms of convenience, non-invasiveness, repeatable monitoring, and rapid assessment. In recent years, the detection approach based on the compositional patterns of volatile organic compounds (VOCs) in exhaled breath has received widespread attention: lung cancer-related exhaled breath components are related to physiological and pathological processes such as tumor metabolic reprogramming, inflammatory responses, lipid peroxidation, and oxidative stress, potentially forming a lung cancer-related "odor fingerprint." Electronic noses (eNose) respond to VOCs through a gas sensor array and combine this with pattern recognition algorithms for discrimination. They feature fast response, real-time monitoring, portability, and ease of use, and have application potential in the non-invasive auxiliary diagnosis of lung cancer.
[0003] Existing research on exhaled electronic noses has shown that the overall VOCs response patterns in the exhaled breath of lung cancer patients differ from those in non-lung cancer individuals. Electronic noses can assist in lung cancer risk assessment using exhaled breath fingerprints formed by sensor arrays. Lung cancer-related VOCs are often associated with processes such as tumor metabolic reprogramming, lipid peroxidation, oxidative stress, and the inflammatory microenvironment, and commonly exhibit differences in responses across multiple categories, including aldehydes, alkanes and their oxidized derivatives, ketones, aromatic hydrocarbons, and sulfur / nitrogen-containing compounds. Therefore, auxiliary diagnosis of lung cancer does not rely on the concentration of a single biomarker, but is better suited to extracting stable odor fingerprints using multi-channel gas-sensitive response sequences and pattern recognition methods.
[0004] However, current applications of electronic noses for lung cancer assisted diagnosis still face significant engineering and algorithmic bottlenecks, particularly in terms of insufficient stability and generalization under conditions of cross-batch (time drift), cross-environment (differences in temperature, humidity, and background air), and cross-device (individual sensor differences and gas path differences). In real-world scenarios, differences in sampling conditions and devices can cause shifts in response sequence distribution, leading to fluctuations in model performance and thus affecting the usability and reproducibility of electronic nose-assisted diagnosis.
[0005] At the data processing level of electronic noses, the raw response sequences often suffer from noise interference, baseline fluctuations, response drift, and cross-device differences, resulting in inconsistent data distribution across different times, devices, or sites. Drift is a significant obstacle for electronic noses in transitioning from research prototypes to large-scale clinical applications. Without effective data processing and drift compensation procedures, system performance will degrade significantly over time.
[0006] At the feature extraction level, existing electronic nose medical auxiliary diagnostic methods still generally suffer from insufficient feature representation, poor robustness to drift / domain shift, and static fusion methods. Traditional methods often rely on statistical features or shallow models, which are difficult to fully characterize the dynamic response of electronic nose signals; even when deep learning is introduced, the models often face the problem of insufficient transferability due to data distribution shift.
[0007] Therefore, given the technical shortcomings of existing technologies, there is an urgent need for a new type of intelligent electronic nose device for disease-aided diagnosis. Summary of the Invention
[0008] To overcome the shortcomings of existing technologies, this invention proposes an intelligent electronic nose device for the auxiliary diagnosis of lung cancer. This device can solve the problems that electronic noses are prone to sensor drift under long-term use, different equipment and environmental disturbances, and that relying solely on shallow features makes it difficult to fully characterize the dynamic response process, thus leading to a decline in auxiliary diagnostic performance.
[0009] To achieve the above objectives, the present invention provides the following technical solution: A smart electronic nose device for auxiliary diagnosis of lung cancer, characterized in that it comprises: The data acquisition module is used to collect multi-channel response signals of volatile organic compounds in the exhaled gas of the test subject and form a response sequence; The data processing module is used to perform drift robust representation learning and feature extraction on the response sequence, generate a calibration feature vector, and output a low-dimensional time-domain feature vector and a time-frequency depth feature vector. The feature fusion module is used to concatenate the low-dimensional time-domain feature vector and the time-frequency depth feature vector, and perform interactive fusion under the conditional injection of the calibration feature vector to form a fused feature vector. The classification module is used to output the classification result of lung cancer auxiliary diagnosis based on the fused feature vector.
[0010] Preferably, the data processing module includes: The drift robust reconstruction submodule is used to perform mask reconstruction learning on the response sequence, extract calibration representations containing sensor drift states, and generate calibration feature vectors. The temporal representation reconstruction submodule is used to perform low-level latent representation learning on the response sequence and suppress redundancy through sparse constraints to obtain a low-dimensional temporal feature vector. The time-frequency feature reconstruction submodule is used to standardize and dynamically enhance the response sequence, convert it into a dynamically enhanced time-frequency spectrogram, and jointly model the time-domain and frequency-domain information through time-frequency attention and extract time-frequency depth features through a convolutional network to form a time-frequency depth feature vector that is complementary to the low-dimensional time-domain feature vector.
[0011] Preferably, the drift robust reconstruction submodule includes: A masking unit, which is used to generate a binary mask matrix for the response sequence and obtain a masked response sequence based on the binary mask matrix; An encoder is used to extract a sequence-level latent representation from the masked response sequence to obtain a calibration characterization; A first decoder is used to reconstruct the calibration characterization to form a mask reconstruction constraint; A pooling and projection unit is used to perform global pooling and projection on the calibration representation to obtain a calibration feature vector.
[0012] Preferably, the time-domain representation reconstruction submodule includes: A time-domain encoder is used to learn low-level latent representations from the response sequence to obtain low-level latent representations. A sparse constraint unit is used to impose sparsity constraints on the lower-level potential representation through a sparse constraint mechanism to obtain a sparse representation. A second decoder is used to reconstruct the sparse representation to form sparse reconstruction constraints. A low-dimensional representation output unit is used to pool the sparse representation to obtain a low-dimensional temporal feature vector.
[0013] Preferably, the sparse constraint unit employs a mean activation deviation penalty mechanism to implement sparsity constraints on the low-level potential representation.
[0014] Preferably, the time-frequency feature reconstruction submodule includes: A time-spectrum generation unit is used to convert the response sequence into a two-dimensional time-spectrum based on the short-time Fourier transform; A time-frequency attention convolutional block is used to simultaneously capture key features in the time and frequency dimensions of the time-frequency spectrum and adaptively enhance the weights of discriminative features to obtain an attention-enhanced time-frequency feature map. The residual convolutional unit is used to extract the preserved discriminative information in the attention-enhanced time-frequency feature map and alleviate gradient vanishing in the deep convolution to obtain the convolutional feature map. A convolution and pooling unit is used to perform convolution and pooling processing on the convolutional feature map to obtain a time-frequency depth feature vector.
[0015] Preferably, the time-frequency attention convolutional block includes: A frequency attention branch unit is used to capture the importance of different frequency components in the time-spectrum graph, adaptively enhance the weight of the characteristic frequency components related to lung cancer to obtain a frequency attention weight map, and multiply the frequency attention weight map element-wise with the time-spectrum graph to obtain a frequency attention weighted feature map. The temporal attention branch unit is used to capture the importance of different time stages in the temporal spectrum, adaptively enhance the feature weights of key stages of the sensor response to obtain a temporal attention weight map, and multiply the temporal attention weight map element by element with the temporal spectrum to obtain a temporal attention weighted feature map. The feature fusion unit is used to add the frequency-attention-weighted feature map and the time-attention-weighted feature map element by element, and then pass them through a convolutional layer and a batch normalization layer to obtain an attention-enhanced time-frequency feature map that incorporates time-frequency attention.
[0016] Preferably, the feature fusion module includes: The feature splicing submodule is used to map the low-dimensional time-domain feature vector and the time-frequency depth feature vector to the same dimensional space to form two dimension-aligned features, and to stack the two dimension-aligned features in the branch dimension to form the input feature matrix. The interactive fusion submodule includes a convolutional attention unit and a cross-domain self-attention unit. The convolutional attention unit is used to model the local correlation of the input feature matrix and generate gating weights to obtain the attention-enhanced feature matrix based on the gating weights. The cross-domain self-attention unit is used to establish a bidirectional attention mapping between the sensor channel domain and the temporal dynamic domain to achieve cross-domain information interaction and complementary enhancement, thereby outputting a fused feature vector.
[0017] Preferably, the training is performed using a pre-training and joint fine-tuning approach. In the pre-training stage, the drift robust reconstruction submodule, the temporal representation reconstruction submodule, and the time-frequency feature reconstruction submodule are pre-trained respectively. In the joint fine-tuning stage, the pre-trained drift robust reconstruction submodule, temporal representation reconstruction submodule, and time-frequency feature reconstruction submodule are connected with the feature fusion module and the classification module to form an end-to-end network, and joint optimization is performed using a unified total loss.
[0018] Preferably, in the pre-training stage, the drift-robust reconstruction submodule is pre-trained using pre-training losses based on mask reconstruction constraints, feature consistency, and drift regularization constraints; the temporal representation reconstruction submodule is pre-trained using pre-training losses based on sparse reconstruction constraints and sparsity constraints; and the time-frequency feature reconstruction submodule is pre-trained using pre-training losses based on supervised classification loss and L2 regularization. In the joint fine-tuning stage, the total loss is:
[0019] in, The cross-entropy loss is calculated between the output of the classification module and the lung cancer label. The pre-training loss for the drift-robust reconstruction submodule; The pre-training loss for the temporal representation reconstruction submodule; The pre-training loss for the time-frequency feature reconstruction submodule; L2 weight decay; These are the weighting coefficients.
[0020] Compared with the prior art, the intelligent electronic nose device for auxiliary diagnosis of lung cancer of the present invention has one or more of the following beneficial technical effects: 1. Improve the cross-device stability and anti-drift capability of electronic nose in the auxiliary diagnosis of lung cancer.
[0021] This invention introduces a drift-robust representation learning mechanism based on reconstruction tasks in the feature learning stage, and injects drift-related information into the subsequent feature learning and fusion process in the form of calibration feature vectors. This enables the electronic nose to maintain more consistent feature expression under different collection batches, different equipment and environmental disturbances, thereby improving the reliability and reproducibility of lung cancer diagnosis results.
[0022] 2. Achieve deep feature mining with time-domain and time-frequency complementarity to enhance the characterization ability of dynamic patterns of VOCs related to lung cancer.
[0023] This invention simultaneously constructs a time-domain representation reconstruction branch and a time-frequency feature reconstruction branch: the sparse-constrained time-domain low-dimensional representation suppresses redundant responses and highlights key dynamic changes, while the time-frequency attention and convolutional network extract key frequency bands and deep patterns of time segments in the time-spectrum map; the two features are spliced together to form a more complete electronic nose representation, which can more fully characterize the differences of lung cancer-related VOCs in response curves and spectral domains.
[0024] 3. By implementing a three-level fusion strategy of conditional modulation, intra-branch enhancement, and cross-branch interaction through the ACCM interaction module, the robustness and generalization of discriminative features are significantly improved.
[0025] Under the conditional injection of calibrated feature vectors, this invention first enhances the time-domain and time-frequency branches through convolutional attention units, adaptively highlighting the discriminative feature dimensions within each branch. Furthermore, it establishes a bidirectional attention mapping between the low-dimensional time-domain representation branch and the time-frequency deep feature branch through cross-domain self-attention, enabling the two feature paths to select from and complement each other. Finally, under complex noise, drift perturbations, and cross-device differences, it forms a more stable and discriminative fusion feature, significantly improving the robustness of the classification boundary.
[0026] 4. Forming an end-to-end closed loop of electronic nose data features → classifier → lung cancer auxiliary diagnosis results facilitates clinical deployment and interpretation.
[0027] This invention organically integrates robust reconstruction learning, time-domain / time-frequency feature mining, and interactive fusion, ultimately outputting a unified-dimensional electronic nose data feature vector. This vector is then mapped to a disease category space via a classification head / classifier to output lung cancer auxiliary diagnostic results. This makes the device structure clear and its responsibilities well-defined, facilitating its engineering deployment and parameter updates within a medical auxiliary diagnostic system. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention.
[0029] Figure 2 This is a schematic diagram of the overall data processing flow of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention.
[0030] Figure 3 This is a schematic diagram of the data processing module of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention.
[0031] Figure 4 This is a schematic diagram of the drift robust reconstruction submodule of the data processing module of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention.
[0032] Figure 5 This is a schematic diagram of the temporal representation reconstruction submodule of the data processing module of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention.
[0033] Figure 6 This is a schematic diagram of the time-frequency feature reconstruction submodule of the data processing module of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention.
[0034] Figure 7 This is a schematic diagram of the feature fusion module of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention.
[0035] Figure 8This is a schematic diagram of the edge AI hardware deployment process for the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention. Detailed Implementation
[0036] Before detailing any embodiment of the invention, it should be understood that the invention, in its application, is not limited to the details of the construction and arrangement of the components set forth in the following description or illustrated in the following figures. The invention can have other embodiments and can be practiced or carried out in various ways. Furthermore, it should be understood that the wording and terminology used herein are for descriptive purposes and should not be considered limiting. The use of “comprising” or “having” and variations thereof in this invention is intended to cover the items set forth below and their equivalents, as well as any additional items. Unless otherwise specified or limited, the terms “installation,” “connection,” “support,” and “linkage,” and variations thereof are used broadly and cover both direct and indirect installation, connection, support, and linking. Moreover, “connection” and “linkage” are not limited to physical or mechanical connections or links. Furthermore, firstly, in the disclosure of this invention, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the above terms should not be construed as limiting this invention. Secondly, the term "a" should be understood as "at least one" or "one or more," that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple. The term "a" should not be construed as a limitation on the quantity.
[0037] To address the shortcomings of existing technologies, this invention provides an intelligent electronic nose device for the auxiliary diagnosis of lung cancer. This device solves the problems that electronic noses are prone to sensor drift under long-term use, different equipment and environmental disturbances, and the inability to fully characterize the dynamic response process by relying solely on shallow features, which leads to a decline in auxiliary diagnostic performance. This improves feature consistency and discrimination performance across batches, devices and environmental disturbances, and facilitates engineering deployment and subsequent parameter updates.
[0038] Figure 1 A schematic diagram of the intelligent electronic nose device for auxiliary diagnosis of lung cancer of the present invention is shown. Further, Figure 2 The overall data processing flow of the intelligent electronic nose device for lung cancer auxiliary diagnosis of the present invention is shown. Figure 2As shown, VOCs in the exhaled gas of the test subject are processed by a sensor, a depletion layer, and signal acquisition to form a response sequence. This response sequence then undergoes drift robust reconstruction, time-domain characterization reconstruction, and time-frequency feature reconstruction processes to obtain a calibration feature vector, a low-dimensional time-domain feature vector, and a time-frequency depth feature vector. Subsequently, feature splicing and calibration are interactively fused to form electronic nose data features, and a classifier outputs the classification result for lung cancer auxiliary diagnosis. The intelligent electronic nose device for lung cancer auxiliary diagnosis of this invention includes: I. Data Acquisition Module.
[0039] The data acquisition module is used to collect multi-channel response signals of volatile organic compounds in the exhaled gas of the test subject and form a response sequence.
[0040] Specifically, similar to existing smart electronic noses, the data acquisition module includes a gas sensor array unit, a gas path control unit, a depletion layer unit, and a signal acquisition unit.
[0041] The gas sensor array unit is the core sensing component of the data acquisition module, used to convert VOCs composition information in the exhaled breath sample into measurable electrical signals. For disease-diagnostic VOCs (including alkanes, aldehydes, ketones, aromatic hydrocarbons, sulfur-containing compounds, nitrogen-containing compounds, etc.), the gas sensor array unit selects gas sensors with corresponding sensitive materials to achieve specific responses to target VOCs. The gas path control unit is used to realize quantitative injection of the exhaled breath sample, carrier gas purification, gas path switching, and precise flow control, providing a stable and consistent detection environment for the gas sensor array unit and eliminating detection errors caused by airflow fluctuations, background gas interference, and sample cross-contamination. The depletion layer unit is a core unit based on the metal-oxide-semiconductor gas sensing principle, realizing the conversion of resistance signals during the adsorption / desorption of VOCs molecules. When the target VOCs come into contact with the sensor's sensitive material, the carrier concentration on the material surface changes, and the thickness of the depletion layer adjusts accordingly. This change directly corresponds to the change in the resistance value of the sensitive element. This unit can calibrate the basic resistance of the sensitive element, suppress baseline drift, and convert the physical changes of the depletion layer into a stable and measurable resistance change signal, providing accurate electrical input for subsequent signal acquisition. The signal acquisition unit is used to synchronously acquire and convert the multi-channel resistance change signals output by the gas sensor array unit into analog-to-digital signals. It can amplify weak resistance signals with low noise, filter and deduce interference, convert analog signals into standardized digital signals, and then synchronously transmit them to the subsequent data processing module, ensuring the integrity and accuracy of the original response data.
[0042] II. Data Processing Module.
[0043] The data is used to perform drift robust representation learning and feature extraction on the response sequence, generate a calibration feature vector, and output a low-dimensional time-domain feature vector and a time-frequency depth feature vector.
[0044] In this invention, the data processing module adopts a multi-branch parallel architecture, and, as... Figure 3 As shown, the data processing module includes a drift robust reconstruction submodule, which outputs a calibration representation and generates a calibration feature vector for subsequent alignment modulation; a time-domain representation reconstruction submodule, which outputs a low-dimensional time-domain feature vector; and a time-frequency feature reconstruction submodule, which outputs a time-frequency depth feature vector.
[0045] 1. Drift Robust Reconstruction Submodule.
[0046] The drift robust reconstruction submodule is used to perform mask reconstruction learning on the response sequence, extract calibration characteristics containing sensor drift states, and generate calibration feature vectors.
[0047] In this invention, the core objective of the drift-robust reconstruction submodule is to suppress response offset issues caused by sensor time drift and environmental interference, and to enhance feature consistency and anti-drift capability under different device conditions. The drift-robust reconstruction submodule forces the network to learn the contextual dependencies of the response sequence through a mask reconstruction task, thereby extracting a calibration representation containing drift state information and generating a calibration feature vector for conditional injection in the subsequent feature fusion stage.
[0048] like Figure 4 As shown, the drift robust reconstruction submodule consists of a mask unit and an encoder. First decoder and pooling and projection units g( It consists of four core parts.
[0049] (1) Mask unit.
[0050] The masking unit is used to generate a binary mask matrix for the response sequence and obtain the masked response sequence based on the binary mask matrix.
[0051] Specifically, for the response sequence ( The time step length, (For the number of sensor channels), first generate a binary mask matrix. To simulate sensor malfunction or partial drift, this invention employs a random patch masking strategy. The masked response sequence... The calculation is as follows:
[0052] in, This represents element-wise multiplication; It is a learnable mask embedding vector used to fill in the masked areas, with the mask ratio set to 50%-75%, forcing it to infer the overall signal shape using only the remaining unmasked segments.
[0053] (2) Encoder.
[0054] The encoder is used to extract a sequence-level latent representation from the masked response sequence to obtain a calibration characterization.
[0055] Specifically, the encoder Lightweight Transformer blocks or one-dimensional convolutional networks can be used. This invention employs a three-layer Transformer Encoder, and the masked response sequence... After position encoding, it enters the encoder to output calibration characterization. .
[0056]
[0057] The output calibration characterization It is not used directly for disease classification, but rather as a calibration characterization. Since drift typically manifests as an overall shift in signal baseline or sensitivity, the current sensor state or drift pattern must be implicitly learned in order to recover the original waveform from incomplete data.
[0058] (3) First decoder.
[0059] The first decoder is used to reconstruct the calibration representation to form a mask reconstruction constraint.
[0060] Specifically, the first decoder The calibration characterization Mapping back to the original signal space This is to facilitate the establishment of mask reconstruction constraints.
[0061]
[0062] (4) Pooling and projection units.
[0063] The pooling and projection unit is used to perform global pooling and projection on the calibration representation to obtain the calibration feature vector.
[0064] Specifically, during the inference phase or downstream task training phase, the pooling and projection units... Calibration characterization of the encoder output Processing is performed. This invention addresses the calibration characterization... First, perform global pooling to obtain channel-level statistical vectors. Then, a calibration feature vector is generated through nonlinear projection mapping. Global pooling can employ global average pooling or a combination of average pooling and max pooling to enhance robust characterization of different drift patterns. Nonlinear projection is used to transform channel-level statistical vectors... Mapped to the same dimensional space as the subsequent feature fusion module.
[0065]
[0066]
[0067] The calibration feature vector This will be used as a drift prompt, injected into the subsequent feature fusion stage, to dynamically adjust the classification boundary.
[0068] 2. Temporal representation reconstruction submodule.
[0069] The temporal representation reconstruction submodule is used to perform low-level latent representation learning on the response sequence and suppress redundancy through sparse constraints to obtain a low-dimensional temporal feature vector.
[0070] In this invention, the core objective of the time-domain characterization reconstruction submodule is to extract stable low-dimensional time-domain features that reflect the dynamic process of exhaled VOCs and sensor response from the time-series data of sensor response. By suppressing redundant information and random noise through sparse constraints, the module captures the differences in response time-series patterns corresponding to different lung cancer categories, thereby improving the transferability and robustness against interference of the features.
[0071] like Figure 5 As shown, the time-domain representation reconstruction submodule consists of a time-domain encoder. sparse constraint unit Second decoder and low-dimensional representation output unit It consists of four core parts.
[0072] (1) Time-domain encoder.
[0073] The time-domain encoder This is used to perform low-level latent representation learning on the response sequence to obtain low-level latent representations.
[0074] Specifically, for the response sequence X, it is first processed by the time-domain encoder. Low-level latent representation extraction is performed to obtain low-level latent representations. .
[0075] .
[0076] The time-domain encoder is used to extract and compress low-level dynamic patterns from the response sequence, and outputs low-level latent representations. This is to preserve key trends in VOCs response dynamics and suppress high-frequency noise.
[0077] (2) Sparse constraint unit.
[0078] The sparse constraint unit is used to apply sparsity constraints to the low-level latent representation through a sparse constraint mechanism to obtain a sparse representation. .
[0079] Specifically, based on the low-level potential representation , by the sparse constraint unit Generate sparse representations .
[0080] .
[0081] In this invention, the sparse constraint unit is used for the low-level potential representation. Apply sparsity constraints and generate sparse representations This is to highlight a few key dynamic factors and suppress redundant responses.
[0082] The sparse constraint unit is used to sparsify the low-level latent representation output by the time-domain encoder, so that most neurons are in an inhibited state and only a few neurons related to VOCs response dynamics are activated, thereby learning the sparse and highly discriminative feature representation of the input response sequence and suppressing redundant noise and non-specific interference.
[0083] (3) Second decoder.
[0084] The second decoder Used to reconstruct the sparse representation to obtain the reconstruction output. And form sparse reconstruction constraints.
[0085] .
[0086] The reconstruction output It is only used to form sparse reconstruction constraints to avoid potential characterization degradation.
[0087] (4) Low-dimensional representation output unit.
[0088] The low-dimensional representation output unit Used for the sparse characterization Pooling is performed to obtain low-dimensional temporal feature vectors. .
[0089]
[0090] In one alternative implementation, to further enhance the low-dimensional time-domain feature vector Its robustness and transferability can be applied to the low-dimensional time-domain feature vectors. Quantile normalization is performed, and representation consistency constraints are imposed on samples with slight temporal perturbations. Specifically, this includes: applying a constraint to the low-dimensional temporal feature vector of the output. Quantile normalization is performed based on the statistical features of the training set to eliminate the differences in response amplitude between different sensor channels and improve the low-dimensional time-domain feature vector. Robustness to differences in sensor sensitivity. For slightly temporally perturbed data of the same sample (such as time axis shift or small amplitude scaling), constrain the low-dimensional temporal feature vector of its output. The cosine similarity is no less than 0.95, further improving the low-dimensional time-domain feature vector. It has strong resistance to temporal random noise and enhances transferability across datasets.
[0091] 3. Time-frequency feature reconstruction submodule.
[0092] The time-frequency feature reconstruction submodule is used to convert the response sequence into a time-frequency representation input and generate a time-frequency spectrum. It also uses time-frequency attention to jointly model the time-domain and frequency-domain information and extracts time-frequency depth features through a convolutional network to form a time-frequency depth feature vector that is complementary to the low-dimensional time-domain feature vector.
[0093] In this invention, the core objective of the time-frequency feature reconstruction submodule is to convert one-dimensional time-series response data to the time-frequency domain, extract the joint time-frequency features of the sensor response at different times and frequency bands, capture local transient changes and periodic patterns in the time-series data, and supplement the fine-grained time-frequency information that cannot be captured by time-domain features.
[0094] For the auxiliary diagnosis of lung cancer, time-spectrum graphs can further represent the local changes in sensor response at different time segments and frequency components. They are suitable for capturing fine-grained patterns such as transient response, slow recovery and local fluctuations caused by lung cancer-related VOCs combinations, thereby supplementing information that is difficult to express by simple time-domain statistical features.
[0095] like Figure 6 As shown, the time-frequency feature reconstruction submodule consists of four core parts: a time-frequency spectrum generation unit, a time-frequency attention convolution block, a residual convolution unit, and a convolution and pooling unit.
[0096] (1) Time spectrum generation unit.
[0097] The time-spectrum generation unit is used to convert the response sequence into a two-dimensional time-spectrum based on the short-time Fourier transform.
[0098] Specifically, the time-spectrum generation unit employs a dynamically enhanced short-time Fourier transform to convert the one-dimensional time-series response sequence of each sensor channel into a two-dimensional dynamically enhanced time-spectrum. This invention achieves time-frequency domain decomposition of the response signal. To highlight the rise, stabilization, recovery, and local transient changes in the electronic nose response curve, it introduces a first-order dynamic change term from adjacent sampling points before the short-time Fourier transform and standardizes the channel response to obtain a dynamically enhanced time-frequency spectrum. The STFT calculation formula is as follows:
[0099] in:
[0100]
[0101] In the formula, This represents the response value of the input response sequence at time τ; This represents the standardized response signal; and These represent the mean and standard deviation of the response sequence, respectively. To prevent extremely small constants with a denominator of zero; This represents the first-order dynamic change between adjacent sampling points; The weighting coefficients for the dynamically changing terms; w For window functions; It is a time variable; For frequency variables.
[0102] In this invention, the specific implementation parameters of STFT are set as follows: ① Window function: Hanning window is adopted. This window function has good frequency resolution and sidelobe suppression capability, which can effectively reduce spectral leakage; ② Window length: set to 256 sampling points, corresponding to a time length of 25.6 seconds, to ensure that the window contains sufficient response signal information; ③ Overlap length: set to 128 sampling points, i.e., 50% window overlap rate, to ensure the continuity of time resolution and avoid loss of information in the time dimension; ④ Number of Fourier transform points (FFT points): set to 512 points to ensure that the frequency resolution meets the requirements; ⑤ Sampling frequency: consistent with the data acquisition frequency.
[0103] To improve the quality of the time spectrum, this invention can also preprocess the generated time spectrum, including: ① Amplitude normalization: normalize the amplitude of the time spectrum of each channel, mapping the amplitude to the [0,1] interval to eliminate amplitude differences between different channels; ② Denoising: use a wavelet threshold denoising algorithm to denoise the time spectrum, remove background noise in the time spectrum, and retain effective signal components; ③ Contrast enhancement: use an adaptive histogram equalization algorithm to enhance the local contrast of the time spectrum and highlight weak feature components in the time spectrum.
[0104] (2) Time-frequency attention convolution block.
[0105] The time-frequency attention convolutional block is used to simultaneously capture key features in the time and frequency dimensions of the time-frequency spectrum and adaptively enhance the weights of the discriminative features to obtain an attention-enhanced time-frequency feature map.
[0106] In this invention, the time-frequency attention (TFA) convolutional block can simultaneously capture the time-frequency spectrum. The key features in the time and frequency dimensions are adaptively enhanced to increase the weight of discriminative features and suppress redundant features and noise. The time-frequency attention (TFA) convolutional block consists of three parts: a frequency attention branch unit, a time attention branch unit, and a feature fusion unit, with the specific structure as follows: ① Frequency Attention Branch Unit: Used to capture the time-spectrum graph The importance of different frequency components is determined, and the weight of the characteristic frequency components related to lung cancer is adaptively enhanced to obtain a frequency attention weight map. The frequency attention weight map is then multiplied element-wise with the time-spectrum map to obtain a frequency attention-weighted feature map.
[0107] The implementation steps of the frequency attention branch unit are as follows: For the input time spectrum... ,in For the number of channels, For frequency dimension, For the time dimension, along the time dimension Perform global average pooling and global max pooling to obtain two dimensions. The time-frequency spectra of the two pooled time-frequency spectra are concatenated and processed by a... Convolutional layer, with the number of output channels being After passing through the Sigmoid activation function, the frequency attention weight map is obtained. Frequency attention weight map Time spectrum of the original input Element-wise multiplication is performed to obtain the frequency-attention-weighted feature map. .
[0108] ②Time attention branch unit: used to capture the time spectrum. The importance of different time stages is determined, and the feature weights of key stages of the sensor response (such as the rise stage, the stabilization stage, and the recovery stage) are adaptively enhanced to obtain a time attention weight map. The time attention weight map is then multiplied element-wise with the time spectrum map to obtain a time attention-weighted feature map.
[0109] The implementation steps of the time attention branch unit are as follows: For the input time spectrum... Along the frequency dimension Perform global average pooling and global max pooling to obtain two dimensions. The feature maps; concatenate the two pooled feature maps, and then... Convolutional layer, with the number of output channels being After passing through the Sigmoid activation function, the temporal attention weight map is obtained. Time attention weight map Time spectrum of the original input Element-wise multiplication is performed to obtain the time-attention-weighted feature map. .
[0110] ③ Feature fusion unit: used to fuse the frequency attention-weighted feature map Feature map with time attention weighting Perform element-by-element addition, then go through a... Convolutional layers and batch normalization layers are used to obtain attention-enhanced time-frequency feature maps that incorporate time-frequency attention. This enables joint attention enhancement across the time and frequency dimensions.
[0111] (3) Residual convolution unit.
[0112] The residual convolutional unit is used to extract the preserved discriminative information in the attention-enhanced time-frequency feature map and alleviate gradient vanishing in deep convolution to obtain the convolutional feature map.
[0113] In this invention, the input of the residual convolutional unit is the attention-enhanced time-frequency feature map output by the time-frequency attention convolutional block. Its output is a convolutional feature map. This is used to preserve discriminative information and mitigate gradient vanishing during deep convolution extraction. The residual convolutional unit can be multiple, with each residual convolutional unit consisting of two... The system consists of convolutional layers, two batch normalization layers, a ReLU activation function, and residual jump connections. The convolutional layers use zero padding to ensure that the input and output feature maps are the same size.
[0114] (4) Convolution and pooling units.
[0115] The convolution and pooling units are used to perform convolution and pooling processing on the convolutional feature map to obtain a time-frequency depth feature vector.
[0116] Specifically, the convolutional feature map is processed by the convolution and pooling units. Extraction is performed to obtain high-level time-frequency feature maps, and time-frequency depth feature vectors are output through global average pooling. This is used to perform two-way concatenation with the low-dimensional time-domain feature vector and input it into the feature fusion module described later.
[0117] III. Feature Fusion Module.
[0118] The feature fusion module is used to concatenate the low-dimensional time-domain feature vector and the time-frequency depth feature vector, and perform interactive fusion under the conditional injection of the calibration feature vector to form a fused feature vector.
[0119] like Figure 7 As shown, the feature fusion module includes a feature splicing submodule and an interactive fusion submodule.
[0120] 1. Feature splicing submodule.
[0121] The feature splicing submodule is used to map the low-dimensional time-domain feature vector and the time-frequency depth feature vector to the same dimensional space to form two dimension-aligned features, and to stack the two dimension-aligned features in the branch dimension to form the input feature matrix.
[0122] Specifically, due to the low-dimensional time-domain feature vector With time-frequency depth feature vector The dimensions may be inconsistent; therefore, firstly, the two features (i.e., the low-dimensional time-domain feature vector) are processed. With time-frequency depth feature vector Dimension alignment is performed to map the two feature paths to the same dimensional space (e.g., 256 dimensions), resulting in... .
[0123]
[0124]
[0125] in, These are two independent linear transformation layers used to achieve dimension alignment.
[0126] Then, the two feature paths after dimension alignment The input feature matrix is formed by stacking the branches along their dimensions. , where 2 is the number of feature branches and 256 is the feature dimension.
[0127] The stacking is only used to tensor the two features into a unified branch dimension input representation so that convolutional attention and cross-domain attention operations can be performed in parallel within the same computation graph. The stacking operation does not introduce new information, and its semantics are equivalent to an ordered combination of the two features as input.
[0128] In this invention, when performing feature stitching, the calibration feature vector can be... As a conditional vector input, it is used to generate gating / modulation parameters and apply them to the input feature matrix. This enables alignment modulation across device / platform differences.
[0129] Specifically, Conditional Layer Normalization (CLN) is used to normalize the input feature matrix. Perform global distribution alignment. Align the calibration feature vectors. The scaling factor for conditional layer normalization is generated through two independent linear projection layers. and offset factor Then, on the input feature matrix Perform conditional normalization to obtain the normalized input feature matrix. :
[0130] Where ⊙ represents element-wise multiplication; LayerNorm( This is a standard layer normalization operation. Therefore, the global distribution of features can be dynamically adjusted according to the current device drift state, eliminating baseline offset and sensitivity differences between different devices.
[0131] 2. Interactive Integration Submodule.
[0132] The interactive fusion submodule is the ACCM (Anchor Consistency Check Module) interactive module. Its core objective is to achieve deep interactive fusion of two feature paths, low-dimensional time-domain feature vector and time-frequency deep feature vector, under the conditional injection of calibration feature vector. It adaptively learns the correlation and complementarity between the two feature paths, and improves the stability and discriminativeness of the fused features under drift and cross-device difference conditions. Specifically, it includes convolutional attention units and cross-domain cross self-attention units.
[0133] (1) Convolutional attention unit.
[0134] The convolutional attention unit is used to model the local correlation of the input feature matrix and generate gating weights, so as to obtain the attention-enhanced feature matrix based on the gating weights.
[0135] The convolutional attention unit is used to enhance local features in each feature branch, adaptively learn key features within each branch, enhance the discriminative feature representation of different branches, and provide a more stable branch input representation for subsequent cross-domain attention. Specifically, the convolutional attention unit uses two parallel convolutional branches, corresponding to a low-dimensional temporal domain feature vector branch and a time-frequency depth feature vector branch, respectively. Each branch consists of... The system consists of a convolutional transform sublayer composed of convolutional layers, batch normalization layers, and ReLU activation functions, as well as a channel attention gating sublayer. The channel attention gating sublayer employs a compression-activation structure, generating channel gating weights in the range of (0,1) through fully connected mapping and sigmoid activation, thereby highlighting the discriminative dimension and suppressing redundant dimensions. The specific implementation steps are as follows: First, input feature matrix (or The feature is split into two branches along the branch dimension, and each branch feature has a dimension of [missing information]. For each branch feature, it is processed through a... The convolutional layer, with 256 output channels, enhances the feature representation capability of each branch, yielding the branch features after convolution. .
[0136] Then, the branch features are... Convolution is followed by batch normalization and ReLU activation to obtain intermediate features. Then, a channel attention mechanism is introduced to gating and calibrate the feature dimensions. This channel attention mechanism employs a compression-activation (SE) structure: first, global average pooling is performed on the intermediate features to obtain a compressed vector; then, two fully connected layers (the first layer compresses the dimension and applies ReLU, the second layer restores the dimension and applies Sigmoid) are used to obtain channel gating weights; finally, these gating weights are multiplied element-wise with the intermediate features to obtain the attention-weighted branch features. Batch normalization and ReLU are used for stable training and non-linear representation of the convolutional feature transformation, while Sigmoid is used to output channel weights in the (0,1) range to achieve suppression and highlighting.
[0137] Finally, the attention-weighted branch features are re-stacked to obtain the attention-enhanced feature matrix. This feature matrix enhances the key discriminative features within each branch.
[0138] (2) Cross-domain self-attention unit.
[0139] The cross-domain self-attention unit is used to establish a bidirectional attention mapping between the sensor channel domain and the time dynamic domain to achieve cross-domain information interaction and complementary enhancement, thereby outputting a fused feature vector.
[0140] In this invention, the cross-domain self-attention unit is used to establish a bidirectional attention mapping between two feature domains: it calculates interactive enhancement using a low-dimensional time-domain feature vector as the query and a time-frequency depth feature vector as the key; and it performs reverse interaction using a time-frequency depth feature vector as the query and a low-dimensional time-domain feature vector as the key, thereby achieving complementary enhancement of the two feature domains. The specific implementation steps are as follows: First, linear mapping is performed on the two features to generate queries, keys, and values: queries are generated using low-dimensional time-domain feature vectors. Generate keys using time-frequency deep feature vectors .
[0141] Will , Each attention head is divided into h attention heads, where h=4 in this invention, and the dimension of each attention head is... / h=64 enables multi-granularity feature interaction capture.
[0142] For each attention head, calculate the cross-attention weights. The formula for calculating the cross-attention weights is:
[0143] in Let h be the query, key, and value corresponding to the h-th attention head. Through this cross-attention weight calculation, bidirectional information interaction between the two feature domains is achieved, enabling the low-dimensional time-domain feature vector and the time-frequency deep feature vector to select from and complement each other for enhancement.
[0144] Then, the output features of the four attention heads are concatenated along the channel dimension to obtain a dimension of Multi-head attention output features.
[0145] Finally, the multi-head attention output features are compared with the attention-enhanced feature matrix. The residuals are summed, then normalized, and input into the interactive feedforward sub-network FFN. The FFN is a position-wise nonlinear transformation sub-layer within the cross-domain cross-attention unit, used for feature shaping and stable training of the attention output. The output dimension is consistent with the input dimension after passing through the GELU activation function. After another residual connection and layer normalization, the feature matrix after cross-domain interaction is obtained, i.e., the fused feature vector. This will serve as the input for the subsequent classification module.
[0146] Meanwhile, the feature vector can be calibrated in this invention. As a conditional vector input, it is used to generate modulation parameters and apply them to cross-attention weights, thereby achieving aligned modulation under cross-device / cross-platform differences.
[0147] Specifically, the calibration feature vector In the calculation of cross-attention weights injected into the cross-domain cross-self-attention unit, the calibrated feature vector is used. The drift conditional bias matrix is generated by projection and then normalized. Simultaneously, the calibration eigenvectors are used... A drift modulation intensity coefficient is generated, allowing calibration information under different drift states to be applied to the cross-attention score with an adaptive intensity. The attention score is then calibrated and modulated. It can be represented as:
[0148]
[0149] in, b represents the interaction direction from one feature to another. In this invention, b corresponds to the low-dimensional time-domain feature branch and the time-frequency depth feature branch, respectively; Indicates by the first The query matrix obtained by linear mapping of road features; These represent the key matrices obtained by the b-th eigenlinear mapping; The dimension of the key vector; The calibration feature vector output by the drift robust reconstruction submodule; A learnable projection matrix, used to... The mapping is a drift conditional bias matrix with the same dimension as the attention score matrix; and These represent the calculations of the mean and standard deviation, respectively. To prevent extremely small constants with a denominator of zero; and These are learnable parameters; For calibration feature vector The generated drift modulation intensity coefficients are used to control the degree of influence of drift condition bias on cross-attention scores.
[0150] Therefore, the attention weights between time-domain and time-frequency features can be adaptively adjusted according to the drift state, highlighting disease-related discriminative features and suppressing interference from drift noise.
[0151] IV. Classification Module.
[0152] The classification module is used to output classification results for disease-assisted diagnosis based on the fused feature vector.
[0153] Specifically, the classification module is a multilayer perceptron (MLP) classification head, and the fused feature vector... The data is fed into a multilayer perceptron (MLP) classification head. The MLP consists of two fully connected layers, with the middle layer using the GELU activation function and Dropout (dropout rate of 0.5).
[0154]
[0155] in, This is the fused feature vector after cross-domain interaction; ( ) is the activation function of the Gaussian error linear unit; Here are the weight matrices for the first and second fully connected layers of the classification module, and here are the trainable weights of the network. , These are the bias vectors for the first and second fully connected layers of the classification module, respectively.
[0156] Finally, the probability of belonging to each category is output through the Softmax function, thereby achieving auxiliary diagnosis of lung cancer.
[0157] In the implementation of lung cancer auxiliary diagnosis, the Softmax output can be mapped to the probability of lung cancer risk, the probability of non-lung cancer, or the malignancy risk level of pulmonary nodules. The output results are used to assist medical personnel in risk stratification and further examination recommendations, and do not replace imaging, pathology, or comprehensive clinical judgment.
[0158] In this invention, the entire intelligent electronic nose device for lung cancer auxiliary diagnosis adopts a training organization method of "phased pre-training + joint fine-tuning" to solve the problem that each module provides a loss function but lacks a unified training objective. The first stage (pre-training stage) involves pre-training the drift robust reconstruction submodule, the temporal representation reconstruction submodule, and the time-frequency feature reconstruction submodule. Specifically, the drift robust reconstruction submodule is pre-trained using pre-training losses based on mask reconstruction constraints, feature consistency, and drift regularization constraints; the temporal representation reconstruction submodule is pre-trained using pre-training losses based on sparse reconstruction constraints and sparsity constraints; and the time-frequency feature reconstruction submodule is pre-trained using pre-training losses based on supervised classification loss and L2 regularization. The second stage (joint fine-tuning stage): In the joint fine-tuning stage, the pre-trained drift robust reconstruction submodule, temporal representation reconstruction submodule, and time-frequency feature reconstruction submodule are connected with the feature fusion module and classification module to form an end-to-end network. A unified total loss is used for joint optimization, with classification loss as the main factor, while a small number of reconstruction / sparse constraints are retained as auxiliary regularization to stabilize training.
[0159] 1. Pre-training of the drift robust reconstruction submodule.
[0160] The loss of the drift-robust reconstruction submodule during the pre-training phase consists of three parts: mask reconstruction loss, feature consistency loss, and drift regularization loss. The total loss formula is as follows:
[0161] in, Loss due to mask reconstruction; For feature consistency loss; The loss is for drift regularization; α and β are balance coefficients, and in this invention, α can be set to 0.5 and β to 0.3. The total loss is as follows. This total loss is used for the first stage of pre-training; during the second stage of joint fine-tuning, it is used for... As By weight Incorporated into total loss .
[0162] To avoid symbolic ambiguity, a unified convention is now made for the inputs, outputs, and intermediate quantities of the drift-robust reconstruction submodule: For the nth sample in the batch, the multi-channel response sequence is denoted as... ,in This represents the observation value of the i-th sensor channel at the j-th time step. The masking mechanism independently generates a binary mask matrix for each sample. ,in This indicates that the location is obscured. 0 indicates reserved. The mask input is... Encoder output sequence-level calibration characterization The first decoder reconstructs the output. ,in To reconstruct the value of the matrix at (i,j). Get by global pooling Then through the projection unit Obtain the calibration feature vector .
[0163] (1) Mask reconstruction loss.
[0164] The mask reconstruction loss is the core loss term of the drift-robust reconstruction submodule, used to constrain the signal reconstruction accuracy of the decoder in the masked region. It is calculated only for the reconstruction error at the mask position, using the mean square error (MSE) as the loss function, and the formula is:
[0165] Where N is the batch sample size; The value of the i-th sensor channel at time step j in the original response sequence of the n-th sample is acquired by the data acquisition module. The numerical values corresponding to the reconstructed response sequence are determined by the first decoder. ( The output is obtained; It is a binary mask matrix.
[0166] By using masked reconstruction loss constraints, the drift robust reconstruction submodule can learn the core distribution pattern of the response sequence and explicitly model the influence of drift and perturbation on the signal.
[0167] (2) Feature consistency loss.
[0168] Feature consistency loss is used to ensure that the latent representations extracted by the encoder of the drift-robust reconstruction submodule retain the core discriminative information of the original data, avoiding the loss of key features related to lung cancer diagnosis during reconstruction learning. For the unmasked original sequence and the masked sequence of the same sample, two sets of latent representations are obtained by inputting them into the encoder, and cosine similarity is used to constrain the consistency of the two sets of representations.
[0169] Specifically, for the unmasked input of the same sample With mask input Each is fed into the same encoder. Obtain sequence-level calibration characterization and To ensure that the consistency constraint applies to a comparable vector space, isomorphic global pooling is performed on both. , The cosine similarity is used to constrain the consistency between the two.
[0170]
[0171] in, and These are vectors obtained by global pooling of the calibration representations of the same sample output by the encoder under unmasked and masked inputs, respectively.
[0172] Feature consistency loss is used to suppress the risk of "overfitting only to mask patterns" and ensure that the calibrated characterization remains stable for disease-related response patterns.
[0173] (3) Drift regularization loss.
[0174] The drift regularization loss is used to constrain the fusion representation distribution after modulation of the calibrated feature vector, thereby improving the classification stability of the drift robust reconstruction submodule under different drift conditions.
[0175] Specifically, for samples of the same target category but under different drift conditions, instead of directly compressing their calibration feature vector p, the fused representation modulated by p is constrained to remain compact within the class. Thus, the calibration feature vector p can retain the drift state information of the current sample, which can be used for dynamic calibration in subsequent feature fusion modules. Simultaneously, the modulated classification representation can mitigate intra-class differences caused by drift. The formula for the drift regularization loss is:
[0176] Where C represents the number of lung cancer diagnostic categories; For the set of all samples of disease type c; This corresponds to the number of samples; The encoder output is used to calibrate and characterize the nth sample. The calibration feature vector obtained by global pooling and projection; This is the calibration feature vector for another drift conditional sample under the lung cancer category.
[0177] By using drift regularization loss, intra-class feature differences caused by drift can be further isolated, improving the drift invariance of features. Different degrees of drift can be characterized by batch labels, device numbers, environmental condition labels, or artificially constructed drift perturbation samples.
[0178] 2. Pre-training of the temporal representation reconstruction submodule.
[0179] The loss of the temporal representation reconstruction submodule during the pre-training phase consists of the sparse reconstruction loss and the sparse constraint term, as shown in the formula:
[0180] in, Loss due to sparse reconstruction; For sparse constraint terms; As the weighting coefficients for sparse constraints, in this invention, can be Set to 0.2 to balance reconstruction loss and sparsity constraints.
[0181] The above-mentioned pre-training loss Used for the first stage of training; in the second stage of joint fine-tuning, it is incorporated into the overall loss as an auxiliary regularization term with weights, that is, this loss... As During the joint fine-tuning phase, weights were used. Incorporated into total loss .
[0182] (1) Sparse reconstruction loss.
[0183] In this invention, sparse reconstruction loss Mean squared error is used to constrain the reconstruction accuracy of the second decoder, ensuring that the representation retains the core information of the original time-series data. The formula is as follows:
[0184] in, The input is the original response sequence; This is the reconstructed response sequence output by the second decoder.
[0185] (2) Sparse constraint terms.
[0186] This invention employs mean-activated deviation penalty to achieve sparsity constraints. The sparse representation output by the sparse constraint unit is denoted as... , Let be the number of latent dimensions. Averaging the batch samples in the time dimension and the sample dimension yields the _th_ ... Average batch activations of potential units:
[0187] in, Indicates the first Each sample at time step Place, No. The activation values of each potential unit; It is the total number of time steps; This represents the total number of samples in the batch.
[0188] Specifically, for the low-level potential representation The average activation of each potential unit is calculated on the batch dimension. and with target sparsity To constrain the degree of deviation, the sparse constraint term can be expressed as:
[0189] in, The number of potential dimensions; For the first The average activation value of each potential unit; Target sparsity.
[0190] This sparsity constraint keeps most potential elements in low activation, with only a few elements responding to key dynamic modes, thereby suppressing redundancy and highlighting discriminative dynamic structures.
[0191] 3. Pre-training of the time-frequency feature reconstruction submodule.
[0192] To obtain stable time-frequency discriminative features and improve generalization ability, random data augmentation can be performed on the obtained time-frequency spectrograms of the training set to expand the diversity of training samples. The time-frequency feature reconstruction submodule is trained in a supervised manner, and the specific implementation steps are as follows: the time-frequency spectrograms of the training set samples are used as input, and the corresponding lung cancer category labels are used as output, and the samples are divided into batches of 32. Cross-entropy loss is used as the classification loss, and an L2 regularization term is added to suppress overfitting. The regularization coefficient is set to 1e-4, and the calculation formula of the loss function is as follows:
[0193] in, The classification cross-entropy loss is used for the time-frequency feature reconstruction submodule. L2 regularization terms for all trainable parameters of the time-frequency feature reconstruction submodule during the pre-training phase; This is the regularization coefficient.
[0194] (1) Classification cross-entropy loss.
[0195] Classification cross-entropy loss Using a labeled, smoothed cross-entropy function:
[0196] in, The predicted probability that the nth sample belongs to the kth class is independently output by the time-frequency feature reconstruction submodule during the training phase; The label smoothing coefficient can be set to 0.1 in this invention, and this value has been widely verified as optimal in electronic nose classification tasks. This represents the batch sample size. Number of lung cancer categories; This represents the true label indication for the nth sample.
[0197] (2) L2 regularization term.
[0198]
[0199] in, The square of the i-th weight parameter in the time-frequency feature reconstruction submodule; This represents all the weight parameters of the time-frequency feature reconstruction submodule.
[0200] In this invention, the AdamW optimizer can be used, with an initial learning rate set to 1e-3. A cosine annealing learning rate scheduling strategy is employed, with the learning rate dynamically decreasing with the number of iterations, and a minimum learning rate set to 1e-6. The total number of iterations is set to 150 epochs, and an early stopping mechanism is added: training stops when the classification accuracy on the validation set does not improve for 15 consecutive epochs. A Dropout layer is also added with a deactivation rate of 0.5 to further suppress overfitting. Optionally, to improve the diversity of training samples, random data augmentation can be performed on the temporal spectrogram of the training set.
[0201] During the online inference / use phase, the time-frequency feature reconstruction submodule no longer calculates the training loss, but only performs the feature extraction process.
[0202] 4. Total loss.
[0203] In the joint fine-tuning stage, the pre-trained drift robust reconstruction submodule, temporal representation reconstruction submodule, and time-frequency feature reconstruction submodule are connected with the feature fusion module and classification module to form an end-to-end network. A unified total loss is used for joint optimization, with classification loss as the main factor, while a small number of reconstruction / sparse constraints are retained as auxiliary regularization to stabilize training.
[0204] The total loss can be expressed as:
[0205] in, The cross-entropy loss is calculated between the output of the classification module and the lung cancer label. The pre-trained loss for the drift-robust reconstruction submodule, as mentioned above. ; The pre-training loss for the temporal representation reconstruction submodule, i.e., the aforementioned ; The supervised loss for the time-frequency feature reconstruction submodule; , which is the weighting coefficient used to balance the classification objective and auxiliary constraints.
[0206] The classification loss during the joint fine-tuning stage, used to measure the difference between the classification module output and the lung cancer label, is expressed in the form of cross-entropy:
[0207] in, This represents the batch sample size. Number of lung cancer categories; This represents the true label indication for the nth sample. This represents the predicted probability of the nth sample belonging to the kth class by the classification module.
[0208]
[0209] in, This represents the set of trainable parameters that participate in the joint fine-tuning phase, preferably including parameters from each encoder, ACCM interaction module, and classification module. When the first and second decoders are set to frozen, their parameters are not included. .
[0210] During the joint fine-tuning phase, the first decoder and the second decoder can be optionally frozen, and only the parameters of each encoder, interactive fusion module and classification module are updated to ensure that the reconstruction branch provides stable constraints without interfering with classification convergence.
[0211] like Figure 8 As shown, to meet the requirements of low latency and portable operation, the intelligent electronic nose device for lung cancer auxiliary diagnosis of this invention can be deployed and run on an edge AI hardware platform to complete inference output on the device side. The classification model is an optional module for engineering implementation, used to support low-latency inference on the edge side, and does not affect the implementation of the core algorithm module of this invention. The edge AI hardware platform can be an embedded computing unit with GPU acceleration capabilities, such as Jetson Orin NX or similar platforms. Such platforms typically support providing edge-side AI inference computing power with low power consumption, suitable for completing deep learning inference tasks locally and reducing dependence on the network environment. To facilitate deployment and maintenance, this invention decouples training updates from inference: the training phase is completed on the PC / server side, and the deployment phase is converted and distributed to the edge. The specific steps are as follows: In the implementation of lung cancer auxiliary diagnosis, the edge AI hardware platform can be deployed in thoracic oncology clinics, respiratory clinics, physical examination and screening scenarios, or follow-up management scenarios, enabling breath sampling, edge-side inference, and risk alerts to be completed locally in a closed loop, thereby supporting rapid, non-invasive, and repeatable auxiliary assessment of lung cancer risk.
[0212] 1. Training and Evaluation: The invention is trained or updated on the training side based on clinical or experimental data to obtain model parameters for the auxiliary diagnosis of lung cancer; then the accuracy is evaluated on validation / test data, and a baseline for inference latency is established for version freezing and release decisions.
[0213] 2. Export and Verification: Export the trained electronic nose device from the training framework as an ONNX format file; after export, perform consistency verification, that is, compare the consistency between the ONNX inference output and the training framework output under the same input (alignment check) to reduce the deployment risk caused by export inconsistencies.
[0214] 3. Deployment and Construction: The ONNX model is input into TensorRT for graph optimization, operator fusion, and memory / bandwidth optimization to build the inference engine. In resource-constrained scenarios, INT8 mixed precision is selected to further reduce inference latency and GPU memory usage. When using INT8 mode, INT8 calibration can be optionally performed based on representative sample data to determine the scaling factor required for quantization. The completed inference engine is serialized and saved as an engine plan file (e.g., .engine or .plan file), and containerized together with preprocessing / postprocessing programs and inference services to form a deployable artifact.
[0215] 4. AI Hardware Platform: Configure the Linux system and JetPack software stack on the edge AI hardware platform to provide runtime support for components such as CUDA / cuDNN / TensorRT; the device side starts the above containerized inference service through the container runtime. When the service starts, it loads the serialized engine plan file and completes engine initialization, and provides local interfaces (such as local API or in-process calls) for upper layer calls.
[0216] 5. Online Operation and Data Flow: During the online inference phase, the data acquisition module collects multi-channel VOCs response signals. After analog-to-digital conversion by the signal acquisition unit, the digitized response sequence is input into the electronic nose's data processing module for denoising, normalization, segmentation, and time-frequency transformation, generating an input tensor consistent with the training phase. This input is then fed into the containerized inference service, where the edge-side TensorRT inference engine performs inference calculations and outputs category probabilities or risk scores. The feature fusion module and classification module then output auxiliary diagnostic results. To ensure interpretability and traceability, the edge device records key metadata for this inference (including sampling batch, model version, timestamp, and confidence level) and stores it along with the output results. When a network connection is available, the results can be uploaded to a host computer / information system for aggregation and management.
[0217] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Those skilled in the art can modify or make equivalent substitutions to the technical solutions of the present invention based on the concept of the present invention, without departing from the essence and scope of the technical solutions of the present invention.
Claims
1. A smart electronic nose device for auxiliary diagnosis of lung cancer, characterized in that, include: The data acquisition module is used to collect multi-channel response signals of volatile organic compounds in the exhaled gas of the test subject and form a response sequence; The data processing module is used to perform drift robust representation learning and feature extraction on the response sequence, generate a calibration feature vector, and output a low-dimensional time-domain feature vector and a time-frequency depth feature vector. The feature fusion module is used to concatenate the low-dimensional time-domain feature vector and the time-frequency depth feature vector, and perform interactive fusion under the conditional injection of the calibration feature vector to form a fused feature vector. The classification module is used to output classification results for the auxiliary diagnosis of lung cancer based on the fused feature vector.
2. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 1, characterized in that, The data processing module includes: The drift robust reconstruction submodule is used to perform mask reconstruction learning on the response sequence, extract calibration representations containing sensor drift states, and generate calibration feature vectors. The temporal representation reconstruction submodule is used to perform low-level latent representation learning on the response sequence and suppress redundancy through sparse constraints to obtain a low-dimensional temporal feature vector. The time-frequency feature reconstruction submodule is used to convert the response sequence into a time-frequency representation input and generate a time-frequency spectrum. It also uses time-frequency attention to jointly model the time-domain and frequency-domain information and extracts time-frequency depth features through a convolutional network to form a time-frequency depth feature vector that is complementary to the low-dimensional time-domain feature vector.
3. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 2, characterized in that, The drift robust reconstruction submodule includes: A masking unit, which is used to generate a binary mask matrix for the response sequence and obtain a masked response sequence based on the binary mask matrix; An encoder is used to extract a sequence-level latent representation from the masked response sequence to obtain a calibration characterization; A first decoder is used to reconstruct the calibration characterization to form a mask reconstruction constraint; A pooling and projection unit is used to perform global pooling and projection on the calibration representation to obtain a calibration feature vector.
4. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 2, characterized in that, The temporal representation reconstruction submodule includes: A time-domain encoder is used to learn low-level latent representations from the response sequence to obtain low-level latent representations. A sparse constraint unit is used to impose sparsity constraints on the lower-level potential representation through a sparse constraint mechanism to obtain a sparse representation. A second decoder is used to reconstruct the sparse representation to form sparse reconstruction constraints. A low-dimensional representation output unit is used to pool the sparse representation to obtain a low-dimensional temporal feature vector.
5. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 4, characterized in that, The sparse constraint unit employs a mean-activated deviation penalty mechanism to constrain the sparsity of the low-level potential representation.
6. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 2, characterized in that, The time-frequency feature reconstruction submodule includes: A time-spectrum generation unit is used to standardize the response sequence and convert the response sequence into a dynamically enhanced time-spectrum based on a short-time Fourier transform enhanced by dynamic change terms. A time-frequency attention convolutional block is used to simultaneously capture key features in the time and frequency dimensions of the time-frequency spectrum and adaptively enhance the weights of discriminative features to obtain an attention-enhanced time-frequency feature map. The residual convolutional unit is used to extract the preserved discriminative information in the attention-enhanced time-frequency feature map and alleviate gradient vanishing in the deep convolution to obtain the convolutional feature map. A convolution and pooling unit is used to perform convolution and pooling processing on the convolutional feature map to obtain a time-frequency depth feature vector.
7. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 6, characterized in that, The time-frequency attention convolutional block includes: The frequency attention branch unit is used to capture the importance of different frequency components in the time-spectrum graph, adaptively enhance the weight of disease-related feature frequency components to obtain a frequency attention weight map, and multiply the frequency attention weight map element-wise with the time-spectrum graph to obtain a frequency attention-weighted feature map. The temporal attention branch unit is used to capture the importance of different time stages in the temporal spectrum, adaptively enhance the feature weights of key stages of the sensor response to obtain a temporal attention weight map, and multiply the temporal attention weight map element by element with the temporal spectrum to obtain a temporal attention weighted feature map. The feature fusion unit is used to add the frequency-attention-weighted feature map and the time-attention-weighted feature map element by element, and then pass them through a convolutional layer and a batch normalization layer to obtain an attention-enhanced time-frequency feature map that incorporates time-frequency attention.
8. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 1, characterized in that, The feature fusion module includes: The feature splicing submodule is used to map the low-dimensional time-domain feature vector and the time-frequency depth feature vector to the same dimensional space to form two dimension-aligned features, and to stack the two dimension-aligned features in the branch dimension to form the input feature matrix. The interactive fusion submodule includes a convolutional attention unit and a cross-domain self-attention unit. The convolutional attention unit is used to model the local correlation of the input feature matrix and generate gating weights to obtain the attention-enhanced feature matrix based on the gating weights. The cross-domain self-attention unit is used to establish a bidirectional attention mapping between the sensor channel domain and the temporal dynamic domain to achieve cross-domain information interaction and complementary enhancement, thereby outputting a fused feature vector.
9. The intelligent electronic nose device for auxiliary diagnosis of diseases according to claim 2, characterized in that, It employs a pre-training and joint fine-tuning approach for training. In the pre-training phase, the drift robust reconstruction submodule, the temporal representation reconstruction submodule, and the time-frequency feature reconstruction submodule are pre-trained separately. In the joint fine-tuning phase, the pre-trained drift robust reconstruction submodule, temporal representation reconstruction submodule, and time-frequency feature reconstruction submodule are connected with the feature fusion module and the classification module to form an end-to-end network, and a unified total loss is used for joint optimization.
10. The intelligent electronic nose device for auxiliary diagnosis of lung cancer according to claim 9, characterized in that, During the pre-training phase, the drift-robust reconstruction submodule is pre-trained using pre-training losses based on mask reconstruction constraints, feature consistency, and drift regularization constraints; the temporal representation reconstruction submodule is pre-trained using pre-training losses based on sparse reconstruction constraints and sparsity constraints; and the time-frequency feature reconstruction submodule is pre-trained using pre-training losses based on supervised classification loss and L2 regularization. During the joint fine-tuning phase, the total loss is: in, The cross-entropy loss is calculated between the output of the classification module and the disease label. The pre-training loss for the drift-robust reconstruction submodule; The pre-training loss for the temporal representation reconstruction submodule; The pre-training loss for the time-frequency feature reconstruction submodule; L2 weight decay; These are the weighting coefficients.