# A Sensor Drift Compensation Method with a Masked Autoencoder Module
## 3 Experiment and Results  
### Experiment Setting  
We designed five different models to compare with the MLP-CFE. The first is the MLP-normal model, which is an MLP consisting of an input layer, hidden layers, and an output layer. Only sensor values are used as input; the hidden layers include 12 layers with 32 nodes, 9 layers with 16 nodes, and a dropout layer. The output layer has one node for predicting the gas concentration. The second model is a partial least squares (PLS) model which is a representative linear technique method. We chose this model since PLS is a popular linear feature extractor [36; 37; 38]. We trained the PLS model on each gas and chose the optimal number of principal components based on the accuracy for each gas. The third model is the MLP-PLS, which has the same structure as the MLP-CFE except for the input dimension. As the MLP-PLS model uses a trained PLS model as a feature extractor to compensate for sensor drift, the input dimension is \(128+k\), where \(k\) is the number of principal components in the PLS model for each gas, which is 30, 31, 7, 32, 28, and 28 for ethanol, ethylene, ammonia, acetaldehyde, acetone, and toluene, respectively. The fourth model is an MLP-AE which shares the same architecture and utilizes the same training dataset as the MLP-CFE, but the autoencoder is unmasked during training. The fifth model is the MLP-tuned model, which has the same structure as the MLP-normal model but whole layers with transfer samples from new sensor data are fine-tuned. We tested the MLP-CFE and MLP-AE models using an encoder module with different latent space dimensions (\(n=2,3,4\), where \(n\) denotes the latent space dimension). We used comparable numbers of parameters for the models that include an MLP for the sake of a fair comparison; see Table 2 for the number of parameters used. The MLP-encoder model in the table includes both the MLP-CFE and MLP-AE models, but the number of parameters is the sum of the encoder module parameters and the MLP parameters. The MLP-tuned model has the same number of parameters as the MLP-normal model because they have the same architecture. All algorithms were implemented in Python and Pytorch. All models, except for the MLP-tuned, were trained, validated, and tested using samples from dataset-A, while the training, validation, and test data were partitioned in a 7:2:1 ratio. A total of 10 percent of samples from dataset-B and dataset-C were set aside as the second and third test sets, respectively, to analyze the drift compensation ability of these models. All the test sets were normalized using standard normalization with the training set of dataset-A because the models were trained with this dataset. MLP-tuned was trained through the following three steps. For data from 1-20 months, it was trained, validated, and tested using samples from dataset-A. For data from 21-23 months, it was trained, validated, and tested with samples from dataset-B using the parameters of the model initialized based on the parameters from the previous step. Finally, for data from 24-36 months, MLP-tuned undergoes the same process as that of the second step with samples from dataset-C. The samples at each step are normalized by performing standard normalization of the training sets of each dataset. During this training process, the fine-tuning process is implemented with new transfer samples. Figure 4 shows a schematic diagram of training for MLP-tuned. When training the autoencoder models and PLS, transfer samples are randomly selected from dataset-A.