Electronic nose fault-tolerant classification self-repairing method and system
By using a visual Transformer mask autoencoder and vaccine-like fine-tuning technology, simulated faults are dynamically injected to enable self-repair of the electronic nose system. This solves the problem of decreased accuracy in gas classification under sensor faults and achieves efficient sensor signal recovery and gas classification.
Patent Information
- Application Number
- CN202611377991.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-07
- Publication Date
- 2026-11-27
AI Technical Summary
Existing electronic nose systems struggle to maintain reliable gas sorting performance under sensor failures, especially in cases of multi-sensor failures. Current repair methods are costly or ineffective, failing to restore the functionality of the sensor channels.
A visual Transformer-based mask autoencoder is adopted. Through self-supervised pre-training and vaccine-like fine-tuning, simulated faults are dynamically injected. Combined with fault masks, hybrid self-repair is performed, which reconstructs only the faulty channels and retains the intact readings to form a repaired sensor signal sequence.
Even when multiple sensors fail, the system's recognition accuracy remains relatively stable, the results are consistent when the diagnostic mask is correct, the accuracy is higher than that of traditional methods, and it has low sensitivity to false positive mask errors.
Smart Images

Figure CN123179076A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gas monitoring technology, specifically to an electronic nose fault-tolerant classification self-repair method and system. Background Technology
[0002] Inspired by the olfactory system of mammals, the electronic nose (E-nose) has evolved into a versatile analytical instrument applicable to industrial safety monitoring, environmental pollutant detection, food quality assessment, and medical diagnostics. At the heart of these systems is an array of cross-sensitive chemical sensors, most commonly metal oxide (MOX) gas sensors. The responses of different sensors to volatile organic compounds (VOCs) often overlap significantly. Electronic nose methods rely on pattern recognition algorithms, ranging from traditional PCA / SVM to deep neural networks, to decode the multidimensional array's "fingerprint" into gas categories. However, this approach implicitly assumes that all sensors in the array must function correctly. In long-term field deployments, this assumption is often difficult to meet.
[0003] MOX sensors gradually degrade due to factors such as sensitive layer poisoning, microheater aging, contact degradation, and electromagnetic interference. Field studies have shown that after several months of continuous operation in highly corrosive or complex chemical environments, sensors may exhibit significant drift or channel failure. As the number of faulty sensors increases, the impact evolves from a slight decrease in accuracy to a significant collapse in system performance: when multiple channels simultaneously output abnormal signals, the feature space learned by the model is severely distorted, and classification boundaries become unreliable. In large-scale sensor networks, concurrent multi-sensor failures are not uncommon but rather a real-world operational situation that must be addressed.
[0004] Existing fault mitigation strategies have certain limitations. Hardware redundancy, i.e., deploying duplicate sensors for each channel, multiplies cost, size, and power consumption, making it unsuitable for portable or IoT edge applications. Statistical interpolation methods such as k-nearest neighbors (KNN) and spline interpolation can estimate isolated missing values, but when the entire time series of a sensor channel is corrupted, such structural missing values are difficult to recover effectively using traditional interpolation. Traditional deep learning classifiers such as CNN, LSTM, and denoising autoencoders generally perform well on clean data, but reconstructing completely lost sensor channels based solely on cross-channel context remains challenging. To date, a unified framework is lacking that can automatically repair damaged channels without prior knowledge of the fault type and maintain reliable gas classification under concurrent multi-sensor fault conditions.
[0005] In recent years, masked autoencoders (MAEs) have been able to reconstruct high-proportion missing inputs from partial observations, providing a new approach to sensor signal recovery. We note a structural correspondence between the two: faulty sensor channels in an electronic nose array are functionally similar to occluded patches in the MAE framework; therefore, the "occlusion-reconstruction" paradigm is naturally suitable for sensor signal restoration. However, applying MAE to this problem still faces two challenges. First, standard MAEs typically perform full reconstruction, replacing all input signals, including normal signals, with model-generated approximations, potentially introducing unnecessary errors into unaffected channels. Second, domain differences exist between clean training data and partially reconstructed data during the inference stage, which may degrade the performance of downstream classifiers. Summary of the Invention
[0006] In view of this, the primary objective of this invention is to provide a fault-tolerant self-repairing method for electronic nose classification. Based on the Modeling Effect (MAE), and drawing analogy to the mechanism of biological vaccination, a simulated sensor fault is intentionally injected during the fine-tuning stage, termed "vaccine-like fine-tuning," which enhances the classifier's adaptability to distribution shifts caused by reconstructed features. Combining this with a hybrid repair strategy that reconstructs only faulty channels while retaining intact readings helps overcome the shortcomings of directly applying MAE.
[0007] To achieve the above objectives, the specific technical solution adopted by the present invention is as follows:
[0008] A self-repairing method for error-tolerant classification in electronic noses, the key of which includes the following steps:
[0009] S1: Construct an electronic nose model based on a visual Transformer mask autoencoder;
[0010] S2: Self-supervised pre-training with clean sample data enables the masked autoencoder to capture dependencies in the sensor cross-response differential feature space;
[0011] S3: Dynamically inject simulated zeroing faults, and fine-tune the electronic nose model through vaccine-like methods to adapt the classifier to the input distribution after the original and reconstructed patches are mixed;
[0012] S4: Based on the input tile sequence and binary fault mask, perform hybrid self-healing inference, specifically including:
[0013] S41: Separate the health map blocks using the logical complement of the fault mask;
[0014] S42: Input the visible tiles into the encoder to extract the latent representation;
[0015] S43: Insert a learnable mask marker at the position indicated by the binary fault mask to restore the complete sequence to the original position order, and reconstruct the complete tile sequence by the decoder;
[0016] S44: The repaired sequence is formed by merging the original physical measurements and the reconstructed values generated by the model;
[0017] S45: Input the repaired sequence back into the encoder to extract the classification markers, and then send it into the classifier to obtain the classification result.
[0018] Optionally, the encoder in the mask autoencoder contains 6 Transformer blocks with an embedding dimension of 256 and uses 8 attention heads; the decoder in the mask autoencoder contains 2 Transformer blocks with an embedding dimension of 128 and uses 4 attention heads.
[0019] Optionally, the classifier is configured with a layer normalization module and a multilayer perceptron with dimensions of 256→256→128→7, and uses the GELU activation function and Dropout mechanism between layers.
[0020] Optionally, the electronic nose is configured with a sensor array of 16 metal oxide gas sensors, covering four models: TGS2600, TGS2602, TGS2610 and TGS2620, with four of each model. The 16 channels are organized into two identical groups of eight sensors each.
[0021] Optionally, before the electronic nose sensor signal enters the electronic nose model, a multi-stage preprocessing process is performed, including: calculating the absolute difference response between any two sensors to obtain 120 difference features, and concatenating them with the original features of 16 sensors to form a 136-dimensional feature vector; standardizing each feature by the mean and standard deviation at the corresponding time step, and segmenting it according to a fixed window of length 128 time steps and step size 64 to form a two-dimensional feature map of shape 136×128; and tile processing to form non-overlapping 8×8 tiles, so that each sample obtains a corresponding 272 tiles.
[0022] Optionally, during self-supervised training in step S2, 75% of the tiles are randomly masked. The decoder reconstructs the masked tiles based on the visible tiles and calculates the reconstruction loss using the mean square error on the masked tiles.
[0023] Optionally, the specific steps of fine-tuning the vaccine-like process in step S3 are as follows: randomly select 1-4 sensors with a probability of 0.5 and set their corresponding absolute differential response features to zero.
[0024] Optionally, the sensor fault state can be identified by an external fault detection device, and the binary fault mask can be generated.
[0025] Based on the above method, the present invention also provides an electronic nose fault-tolerant classification self-repair system, the key of which is that when the sensor in the system malfunctions, it is repaired by the electronic nose fault-tolerant classification self-repair method described above.
[0026] Optionally, the sensor fault includes any one of the following: zero-value stuck fault, fixed initial value fault, Gaussian noise fault, linear drift fault, random spike fault, and constant bias fault.
[0027] Because of the adoption of the above technical solution, the present invention has the following advantages:
[0028] This invention proposes an electronic nose fault-tolerant classification self-repair method and system, which fully integrates self-supervised reconstruction, fine-tuning based on simulated faults, and element-level selective repair. Under the condition of using grouped block partitioning and standardization based only on training blocks, even if multiple sensors fail, the system's recognition accuracy remains relatively stable; when the diagnostic mask is correct, the results are consistent under different fault waveforms; its accuracy is higher than that of traditional repair methods; and it is less sensitive to false positive mask errors compared to false negative mask errors. Attached Figure Description
[0029] The accompanying drawings of this invention are described below.
[0030] Figure 1 This is a flowchart illustrating the construction of the sensor response diagram and fault mask in a specific embodiment of the present invention;
[0031] Figure 2 This is a flowchart of selective repair of the mask autoencoder in a specific embodiment of the present invention;
[0032] Figure 3 This is a diagram illustrating the internal architecture of the mask autoencoder in a specific embodiment of the present invention.
[0033] Figure 4 The diagram shows the comparison of classification performance under the condition of zero feature failure. Part (a) shows the accuracy curves of Baseline ViT and HealMAE as the number of faulty sensors increases, and the error bars represent the changes between different sensor combinations. Part (b) shows the comparison of the accuracy of traditional repair methods and HealMAE when 8 sensors fail.
[0034] Figure 5 The diagram shows the effect of model components and fault introduction probability. Part (a) shows the accuracy of each ablation configuration under different fault levels; Part (b) shows the accuracy under fault-free conditions and fixed sensor failure conditions (0 to 7) when different fault introduction probabilities are used during fine-tuning.
[0035] Figure 6 The results are for individual sensor failure and simulated fault waveforms; (a) is the accuracy when each sensor fails individually; (b) is the accuracy under 6 fault waveforms when sensors 0 to 3 constitute a fixed fault set.
[0036] Figure 7 The results show the performance comparison under progressive sensor loss conditions; part (a) shows the accuracy of Baseline ViT and HealMAE, and the macro-F1 of HealMAE, from 0 to 15 sensor failures. Error bars represent the variation between the five sensor failure sequences. Part (b) shows the number of remaining physical sensors and the unaffected feature rows.
[0037] Figure 8 The HealMAE accuracy is given when there are false negatives, false positives and mixed errors in the element mask. Part (a) shows the test results with 4 sensor failures, using sensors 0 to 3, and part (b) shows the test results with 8 sensor failures, using sensors 0 to 7. Detailed Implementation
[0038] To better understand the working principle and technical effects of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0039] like Figure 1 , Figure 2 and Figure 3 As shown, this embodiment provides a self-repairing method for electronic nose error-correction classification, including the following steps:
[0040] S1: Construct an electronic nose model based on a visual Transformer mask autoencoder; in the subsequent description, the mask autoencoder proposed in this invention will be defined as HealMAE;
[0041] S2: Self-supervised pre-training with clean sample data enables the masked autoencoder to capture dependencies in the sensor cross-response differential feature space;
[0042] S3: Dynamically inject simulated zeroing faults, and fine-tune the electronic nose model through vaccine-like methods to adapt the classifier to the input distribution after the original and reconstructed patches are mixed;
[0043] S4: Based on the input tile sequence and binary fault mask, perform hybrid self-healing inference, specifically including:
[0044] S41: Separate the health map blocks using the logical complement of the fault mask;
[0045] S42: Input the visible tiles into the encoder to extract the latent representation;
[0046] S43: Insert a learnable mask marker at the position indicated by the binary fault mask to restore the complete sequence to the original position order, and reconstruct the complete tile sequence by the decoder;
[0047] S44: The repaired sequence is formed by merging the original physical measurements and the reconstructed values generated by the model;
[0048] S45: Input the repaired sequence back into the encoder to extract the classification markers, and then send it into the classifier to obtain the classification result.
[0049] In this embodiment, the electronic nose is equipped with a sensor array of 16 metal oxide gas sensors, covering four models: TGS2600, TGS2602, TGS2610 and TGS2620, with 4 of each model. The 16 channels are organized into two identical 8-sensor groups.
[0050] This example uses the UCI dataset "Gassensor array under dynamic gas mixtures" collected by Fonollosa et al. for continuous monitoring of dynamic binary gas mixtures. This dataset contains two approximately 12-hour records, both acquired by a MOS array consisting of 16 sensors. One record contains a mixture of ethylene (C2H4) and carbon monoxide (CO), and the other contains a mixture of ethylene and methane (CH4). Gas concentrations vary over time. Each file contains 19 columns: time, two concentration setpoints, and 16 sensor readings. The array includes four Figaro sensor types: TGS2602, TGS2600, TGS2610, and TGS2620, with four cells for each type. The channel sequence is TGS2602, TGS2602, TGS2600, TGS2600, TGS2610, TGS2610, TGS2620, and TGS2620, repeated twice. According to the dataset description, the sensor conductivity is sampled at 100 Hz within a 60 mL cavity, and the gas flow rate is constant at 300 mL / min.
[0051] Seven gas states were defined by averaging the concentration setpoints within each window and applying a threshold of 0.1 ppm. These states include: background air, carbon monoxide only, ethylene only in the carbon monoxide record, a mixture of ethylene and carbon monoxide, methane only, ethylene only in the methane record, and a mixture of ethylene and methane. Since the two ethylene states came from different experimental records, they were retained as two separate categories: one record involving carbon monoxide and the other involving methane. Therefore, this task should be understood as classifying the seven gas states under this baseline scheme, rather than identifying seven chemically distinct gases. Table 1 summarizes the dataset and preprocessing workflow.
[0052] Table 1. Datasets and Preprocessing Schemes
[0053]
[0054] The preprocessing workflow transforms the raw time series data from 16 sensors into sensor response maps with features as rows and time as columns. Let... Indicates sensor At any moment The response. The absolute differential sensor response (ADSR) characteristics between all sensor pairs are calculated as follows:
[0055]
[0056] At each time point, the complete feature vector is:
[0057]
[0058] Differential channels describe the relative response differences between sensors. These paired features can mitigate common-mode variations to some extent and highlight differences in sensor selectivity. They also introduce deterministic relationships between feature rows, which are beneficial for reconstruction. When a sensor fails, its original row and the 15 differential rows involving that sensor are affected, while the remaining differential rows are not directly affected by that sensor.
[0059] For each original record, the mean and standard deviation of each feature are estimated using only the training block. The same values are then applied to the training, validation, and test blocks.
[0060]
[0061] First, each standardized record is divided into 1,024 consecutive time-point data blocks. Then, within each data block, windows of length 128 time points with a step size of 64 are independently generated. This order ensures that no window crosses the boundaries of a data block or subset. Each window forms a 136 × 128 response map, which is divided into 272 non-overlapping 8 × 8 tiles. Figure 1 shows the response map construction process in section (a), and sections (b) and (c) show how sensor faults determine the affected feature rows and the masks used for repair. The 17 × 16 grid in section (c) represents the tile locations. In the implementation, each location contains an 8 × 8 binary mask.
[0062] To verify whether the system proposed in this invention can meet the various fault repair requirements of the sensor, fault simulation was conducted in the following manner during the experiment.
[0063] like Figure 1 As shown in section (b), a fault in the physical sensor can propagate to the ADSR feature. Let... This represents the set of faulty sensors. Affected characteristic behaviors:
[0064]
[0065] for The number of affected feature rows for each faulty sensor is:
[0066]
[0067] One faulty sensor affects 16 of the 136 feature rows, four faulty sensors affect 58 rows, and eight faulty sensors affect 100 rows. After tile division, the affected rows are converted into binary masks. A 17 × 16 grid identifies the tile locations, and an 8 × 8 mask is stored at each location to identify the affected values. Therefore, when a healthy value and an affected row are located in the same tile, the healthy value is still preserved.
[0068] This embodiment evaluated six simulated fault waveforms, representing zero output, frozen output, noise, monotonic drift, impulse disturbance, and bias. Faults were incorporated into the normalized raw feature row and ADSR feature row associated with the faulty sensor. All waveform parameters are expressed in normalized units. Table 2 lists these waveforms.
[0069] Table 2. Simulated sensor fault waveforms used in this study
[0070]
[0071] Where τ represents the time when the fault begins. It is a feature The fault value, It is the standardized value before the feature malfunctions. This represents Gaussian noise. (Variable) It follows a Bernoulli distribution and is used to determine whether a peak occurs; For N(0, 5) 2 The replacement value extracted from ) . Parameters α and b represent the drift rate and bias magnitude, respectively. In the "last value hold" test, It is set as the second point for each window, and the first point is considered the last valid value.
[0072] During fine-tuning, only fixed-zero faults were used; the other five waveforms were used for evaluation. HealMAE uses the identification information of the faulty sensor as input to the repair process. This identification information can be provided by hardware health monitoring, signal range checks, or anomaly detection methods. This study evaluates repair and classification assuming this information is available.
[0073] In practice, the encoder contains 6 Transformer blocks with an embedding dimension of 256 and uses 8 attention heads; the decoder in the mask autoencoder contains 2 Transformer blocks with an embedding dimension of 128 and uses 4 attention heads. The classifier is configured with a layer normalization module and a multilayer perceptron with dimensions 256→256→128→7, using the GELU activation function and Dropout mechanism between layers. During the pre-training phase, the encoder processes visible patches, and the decoder reconstructs masked patches. During the repair phase, all patches are input along with the diagnostic mask. During fine-tuning, all parameters of the encoder and classifier heads are updated.
[0074] For step S2, let This represents a sequence of patches obtained from a sensor response map. Indicates the first Each sequence contains 272 non-overlapping tiles, each tile consisting of 64 values within an 8 × 8 region. Each tile is projected into the latent space in the following form:
[0075]
[0076] in, For learnable location embeddings, during self-supervised pre-training, 75% of the tiles are randomly masked. The decoder reconstructs the masked tiles from the visible tiles and calculates the reconstruction loss using the mean squared error on the masked tiles.
[0077]
[0078] in, This represents the set of tiles that were masked during pre-training. The original tile vector, The reconstructed results are then used. Pre-training is performed using random masks to learn general temporal relationships and inter-sensor dependencies. In contrast, the fault mask used in the repair phase is generated based on known relationships between physical sensors and derived features.
[0079] Pre-training was performed using AdamW with a learning rate of 1 × 10⁻⁶. -3 The weight decay was 0.05, beta values were 0.9 and 0.95, the batch size was 64, and training lasted for 100 epochs. The first 10 epochs were used for learning rate warm-up, followed by cosine decay. MAE pre-training used only windows from the training blocks. The validation window was used to select checkpoints, while the test window was reserved for final evaluation. Subsequent experiments used checkpoints that minimized the reconstruction loss on the validation set under a fixed mask mode.
[0080] After pre-training, a classification head is applied to the [CLS] token output by the encoder. This classification head consists of LayerNorm and a multilayer perceptron with dimensions of 256 → 256 → 128 → 7, using the GELU activation function and dropout between layers.
[0081] During supervised fine-tuning, each mini-batch remains intact or is faulted with a probability of 0.5. For faulty batches, 1 to 4 physical sensors are randomly selected, and the normalized raw values and ADSR values associated with these sensors are set to zero. An element-level binary mask is then generated within an existing 8 × 8 tile. The learnable projection of this mask is added to the token embedding and input into the instigation model. The instigated response map is then classified. Insufficient batches bypass the instigation step and are classified directly.
[0082]
[0083] in, For the number of gas states, It is the first Each element belongs to the one-hot encoded real label vector. ; For category The predicted probability. The pseudocode for the above fine-tuning process is as follows:
[0084] Algorithm 1. Fine-tuning based on simulated sensor faults
[0085]
[0086] Fine-tuning was performed using AdamW with a learning rate of 1 × 10⁻⁶. -4 The weight decay was 0.01, the batch size was 64, and the training lasted for 50 epochs. Cosine annealing was used for the learning rate, and the gradient norm was constrained to 1.0. Finally, the checkpoint with the highest macro-F1 score on the full validation set was retained.
[0087] The fault mask comprises 17 × 16 tile locations, each containing an 8 × 8 binary mask. Before repair, values diagnosed as faulty are set to zero, while healthy values within the same tile remain unchanged. A learnable projection of the binary mask is incorporated into the tile embedding, enabling the encoder to distinguish between masked and valid values. Subsequently, the encoder and decoder estimate the complete tile sequence.
[0088]
[0089] Selective repair uses decoder estimates only for masked elements; all unmasked values are directly copied from the input. The repaired sequence is then fed into the encoder and classification head. Therefore, this method preserves valid measurements even when valid and faulty rows are located in the same 8×8 tile.
[0090]
[0091] When no faulty sensor is identified, the reconstruction step is bypassed and the input is directly classified. Figure 2 summarizes the repair and classification process. Figure 2 The 17 × 16 grid represents the tile locations. The mask used by the model also contains 8 × 8 values within each tile.
[0092] To evaluate algorithm performance, each record segment was divided into 1,024 contiguous data blocks. The complete data blocks were randomly allocated to the training, validation, and test subsets at a ratio of 70%, 10%, and 20%, respectively. Windows were generated after the data blocks were allocated to ensure that overlapping windows in different subsets did not share the original time points. Ultimately, each subset contained 85,999 training windows, 12,285 validation windows, and 24,570 test windows, respectively. The standardized statistics for each record segment were estimated solely using its training block.
[0093] The primary assessment covered all 16 possible scenarios for single sensor failure. For tests involving 2, 4, and 8 sensor failures, 10 unique sensor combinations were randomly selected without replacement. The same combinations were used for all methods. Results for each failure level were averaged over the corresponding combinations. Diagnostic masking error testing employed false negative, false positive, and mixed-element error rates of 5%, 10%, and 20%.
[0094] Accuracy was used as the primary metric. To account for class imbalance, macro-F1 was also calculated.
[0095]
[0096] in, and These represent the precision and recall for category c, respectively. The primary evaluation considers 0, 1, 2, 4, and 8 sensor failures. The primary comparison focuses on reported precision, while the macro-F1 is also provided in the progressive sensor loss analysis. Furthermore, five fixed failure sequences were tested for 0 to 15 sensor failures. The standard deviations in Table 3 reflect variations across different sensor combinations.
[0097] Table 3 compares the HealMAE proposed in this invention with two existing methods. One method is a Vision Transformer trained from random initialization, denoted as Baseline ViT. The other method is a classifier pre-trained using MAE but not trained with simulated faults, denoted as MAE-FT. The accuracy of Base ViT decreased from 91.34% with no faults to 23.27% with 8 sensor failures, a reduction of 68.07%. The accuracy of HealMAE decreased from 90.78% to 73.93%, a reduction of 16.85%. The standard deviation at non-zero fault levels reflects the changes between different sensor combinations. (Table...)
[0098] Table 3. Test accuracy (%) under solid zero characteristic failure conditions.
[0099]
[0100] In the table, results for non-zero fault levels are expressed as mean ± standard deviation; all 16 cases are counted when a single sensor fails, and the remaining fault levels are counted using 10 sampled sensor combinations. MAE-FT maintains high accuracy for complete inputs, but accuracy drops significantly after introducing faults. This result indicates that mask pre-training alone cannot adapt the classifier to the repaired response map. Without faults, HealMAE is 0.56 percentage points lower than Baseline ViT; when 8 sensors fail, HealMAE is 50.66 percentage points higher. Part (a) of Figure 4 shows the change in accuracy with the number of faulty sensors.
[0101] Table 4 compares HealMAE with traditional repair methods. The values in Table 4 are averaged over the same sensor combinations used in Table 3. When all eight sensors failed, cubic spline interpolation achieved the highest accuracy of 29.37% in the traditional method, while HealMAE reached 73.93%. These results indicate that for the structural feature destruction considered in this invention, simple filling and local reconstruction methods recover less effective information. Part (b) of Figure 4 summarizes the results when all eight sensors failed.
[0102] Table 4. Accuracy (%) of traditional repair methods versus HealMAE
[0103]
[0104] Furthermore, ablation experiments further evaluated full reconstruction, element-level selective repair, and fault-based fine-tuning. Full reconstruction replaces valid measurements with decoder estimates, thus resulting in lower accuracy under fault conditions. Selective repair without fault-based fine-tuning improved accuracy when only one sensor failed, but the improvement gradually decreased with the number of failed sensors. The full HealMAE configuration achieved the highest accuracy across all non-zero fault levels. When eight sensors failed, HealMAE reached 73.93%, while selective repair without fault-based fine-tuning only achieved 26.61%.
[0105] Table 5. Ablation results with accuracy (%) under solid zero characteristic destruction conditions
[0106]
[0107] The values in Table 5 are averaged over the sensor combinations used in Table 3. These results indicate that reconstruction and supervised training based on the repaired response map are complementary. Reconstruction is responsible for estimating the affected values, while fine-tuning based on simulated faults allows the classifier to utilize the repaired representation.
[0108] During fine-tuning, the probability of introducing faults balances the accuracy between complete and faulty inputs. Without simulating faults, the accuracy is 38.64% when all 8 sensors fail. Setting the probability to 0.25 improves this accuracy to 70.25%. The default probability of 0.5 achieves 90.78% accuracy without faults and 71.02% accuracy when sensors 0 through 7 (used in this analysis) fail. At probabilities of 0.75 and 1.0, the accuracy for faulty inputs increases to 72.46% and 72.67%, respectively, but the accuracy for complete inputs decreases to 89.65% and 88.88%, respectively. The default setting strikes a balance between the two conditions. Figure 5 The ablation results and the impact of this probability were summarized.
[0109] pass Figure 6 It can also be seen that when individual sensors are disabled one by one, the accuracy of Baseline ViT decreases by 11.77 to 27.37 percentage points. The accuracy of HealMAE ranges from 87.96% to 89.81%, a decrease of only 0.97 to 2.82 percentage points relative to the full running state. This narrower range indicates that element-level fixes reduce the model's dependence on any single sensor.
[0110] HealMAE was trained using fixed-zero faults and evaluated under six fault waveforms with a fixed fault set of sensors 0 to 3. When four sensors failed, HealMAE achieved 85.87% accuracy across all waveforms. The accuracy of Baseline ViT varied with the waveform, ranging from 43.58% to 89.53%. HealMAE achieved consistent results for each waveform because the diagnostic mask removes values diagnosed as faults before reconstruction; therefore, the specific waveforms assigned to these values do not enter the repair model. In this evaluation, when the diagnostic mask was correct, the classification result did not depend on the fault waveform corresponding to the diagnosed fault values.
[0111] Progressive sensor loss was evaluated using five fixed sensor failure sequences. When eight sensors failed, HealMAE achieved an accuracy of 72.86 ± 5.32%, compared to 25.45 ± 4.84% for Baseline ViT. HealMAE's accuracy remained above 60% until nine sensors failed. Thereafter, accuracy began to decline as the number of available raw and ADSR rows decreased further.
[0112] This decline is related to the structure of the ADSR representation. When a large number of sensors fail, their original rows and most of the associated paired feature rows become unavailable. For example, when 12 sensors fail, the remaining 4 sensors provide only 4 original rows and 6 ADSR rows. Figure 7 correlates classification performance with the amount of information that remains unaffected.
[0113] Sensitivity analysis introduced false negatives, false positives, and mixed errors into the element mask with error rates of 5%, 10%, and 20%. Tests with four sensor failures used sensors 0 through 3, and tests with eight sensor failures used sensors 0 through 7. Results for each error setting were averaged from five trials.
[0114] Compared to false negative errors, HealMAE is less affected by false positive errors. With 8 sensor failures, the accuracy using the correct mask is 71.02%. At an error rate of 20%, the accuracy is 69.17% under false positive conditions, 61.98% under false negative conditions, and 66.42% under mixed error conditions. False positives result in the replacement of some valid values, while false negatives leave some damaged values in the repaired response map. These results indicate that reducing missed fault values is particularly important.
[0115] When all four sensors fail, the accuracy drops from 85.87% under the correct mask to 85.40% under the 20% false positive condition and 83.97% under the 20% false negative condition. Figure 8 Complete analysis results are given for cases with 4 and 8 sensors failing.
[0116] Regarding computational efficiency and practical applications, HealMAE contains 5.46 million parameters, and completing the repair and classification of a single sample requires approximately 6.42 GFLOPs. On an NVIDIA GeForce RTX 3090 with a batch size of 1, after 20 warm-up runs and over 200 timing cycles, the average inference time is 3.40 ms. Under the same conditions, Baseline ViT requires approximately 3.05 GFLOPs and 0.93 ms. The additional computational cost mainly comes from the decoder and the second forward propagation of the encoder.
[0117] HealMAE requires a diagnostic module to identify faulty sensors before repair. The necessary information can be obtained through sensor health monitoring, signal range checks, or anomaly detection. Future work will combine this repair method with online fault diagnosis, extend the assessment to physically degraded sensors, and investigate lightweight implementations for embedded electronic nose systems.
[0118] The overview shows that this invention proposes an electronic nose fault-tolerant classification self-repair method and system, which fully combines self-supervised reconstruction, fine-tuning based on simulated faults, and element-level selective repair. Under the condition of using block partitioning and standardization based only on training blocks, when 8 out of 16 sensors fail, HealMAE achieves an accuracy of 73.93%, while Baseline ViT is 23.27%. Ablation studies show that both reconstruction and fine-tuning based on simulated faults contribute to performance. Additional tests also revealed that: accuracy changes little when a single sensor fails; results are consistent across different fault waveforms when the diagnostic mask is correct; its accuracy is higher than traditional repair methods; and it is less sensitive to false positive mask errors compared to false negative mask errors.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A self-repairing method for error-tolerant classification of electronic noses, characterized in that, Includes the following steps: S1: Construct an electronic nose model based on a visual Transformer mask autoencoder; S2: Self-supervised pre-training with clean sample data enables the masked autoencoder to capture dependencies in the sensor cross-response differential feature space; S3: Dynamically inject simulated zeroing faults, and fine-tune the electronic nose model through vaccine-like fine-tuning to adapt the classifier to the input distribution after the original and reconstructed patches are mixed; S4: Based on the input tile sequence and binary fault mask, perform hybrid self-healing inference, specifically including: S41: Separate the health map blocks using the logical complement of the fault mask; S42: Input the visible tiles into the encoder to extract the latent representation; S43: Insert a learnable mask marker at the position indicated by the binary fault mask to restore the complete sequence to the original position order, and reconstruct the complete tile sequence by the decoder; S44: The repaired sequence is formed by merging the original physical measurements and the reconstructed values generated by the model; S45: Input the repaired sequence back into the encoder to extract the classification markers, and then send it into the classifier to obtain the classification result.
2. The electronic nose error-tolerant classification self-repair method according to claim 1, characterized in that, The encoder in the mask autoencoder contains 6 Transformer blocks with an embedding dimension of 256 and uses 8 attention heads; the decoder in the mask autoencoder contains 2 Transformer blocks with an embedding dimension of 128 and uses 4 attention heads.
3. The electronic nose error-tolerant classification self-repair method according to claim 1 or 2, characterized in that, The classifier is configured with a layer normalization module and a multilayer perceptron with dimensions of 256→256→128→7, and uses the GELU activation function and Dropout mechanism between layers.
4. The electronic nose error-tolerant classification self-repair method according to claim 3, characterized in that, The electronic nose is equipped with a sensor array of 16 metal oxide gas sensors, covering four models: TGS2600, TGS2602, TGS2610 and TGS2620, with four of each model. The 16 channels are organized into two identical groups of 8 sensors each.
5. The electronic nose error-tolerant classification self-repair method according to claim 4, characterized in that, Before the electronic nose sensor signals enter the electronic nose model, a multi-stage preprocessing process is performed, including: calculating the absolute difference response between any two sensors to obtain 120 difference features, and concatenating them with the original features of 16 sensors to form a 136-dimensional feature vector; standardizing each feature by the mean and standard deviation at the corresponding time step, and segmenting it according to a fixed window of length 128 time steps and step size 64 to form a two-dimensional feature map of shape 136×128; and tile processing to form non-overlapping 8×8 tiles, so that each sample obtains a corresponding 272 tiles.
6. The electronic nose error-tolerant classification self-repair method according to claim 5, characterized in that, During self-supervised training in step S2, 75% of the tiles are randomly masked. The decoder reconstructs the masked tiles based on the visible tiles and calculates the reconstruction loss using the mean square error on the masked tiles.
7. The electronic nose error-tolerant classification self-repair method according to claim 5, characterized in that, The specific steps for fine-tuning the vaccine-like process described in step S3 are as follows: randomly select 1-4 sensors with a probability of 0.5 and set their corresponding absolute differential response features to zero.
8. The electronic nose error-tolerant classification self-repair method according to claim 5, characterized in that, The sensor fault status is identified by an external fault detection device, and the binary fault mask is generated.
9. An electronic nose error-tolerant classification self-repair system, characterized in that, When a sensor in the system malfunctions, it is repaired using the electronic nose fault-tolerant classification self-repair method as described in any one of claims 1-8.
10. The electronic nose error-tolerant classification self-repair system according to claim 9, characterized in that, Sensor faults include any one of the following: zero-value stuck fault, fixed initial value fault, Gaussian noise fault, linear drift fault, random spike fault, and constant bias fault.
