Skip to content
AI.info

Research

Variational Autoencoder for Calibration: A New Approach

Overview Research area: Machine learning for sensor calibration, specifically a new use of Variational Autoencoders (VAEs) for low-cost air-quality gas sensors. Technical level: Intermediate. The pape

Variational Autoencoder for Calibration: A New Approach
arXiv
2511.00475
Published
2025-11-01
Authors
Travis Barrett, Amit Kumar Mishra, Joyce Mwangama

AI summary

Overview

Research area: Machine learning for sensor calibration, specifically a new use of Variational Autoencoders (VAEs) for low-cost air-quality gas sensors.

Technical level: Intermediate. The paper assumes familiarity with autoencoders, latent spaces, and standard regression metrics, but the architecture itself is deliberately small and simple.

Scope: A proof-of-concept demonstration that the latent space of a VAE can be trained to serve as a calibration output while the model simultaneously retains its reconstruction (autoencoding) function.

What This Paper Is About

Low-cost gas sensors drift over time and suffer from cross-sensitivities, so their readings need calibration against a trusted reference analyzer to be useful. The authors propose a twist on the standard Variational Autoencoder: instead of using the latent space only as a compressed representation, they constrain a one-dimensional latent space to directly predict the calibrated "truth" value. The goal is to show that a single model can act as a calibrator and an autoencoder at the same time, tested on an existing multi-sensor gas dataset.

Key Contributions

  1. A new VAE architecture for calibration in which the latent space sampling value (Z) is repurposed as the calibration prediction (Y′), forcing the latent space to fit the calibrated data characteristics.
  2. A dual-purpose model: the encoder becomes a predictor (uncalibrated input to calibrated output) while the decoder retains the standard VAE reconstruction role (latent vector back to expected inputs).
  3. A proof-of-concept on an existing dataset — the De Vito et al. multi-sensor gas dataset — with four separate models trained to calibrate CO, NMHC, NOx, and NO2.
  4. A quantitative and statistical comparison of both the calibration output and the reconstruction output against their respective truth data using MAE, percentage accuracy, R², Kullback-Leibler divergence, and Jensen-Shannon divergence.

Main Findings

  • Calibration accuracy varies by target gas. The CO model achieved an MAE of 0.29 with an R² of 0.9319 against CO(GT). The NO2 model achieved an MAE of 11.7 with an R² of 0.7606. The NOx model achieved an MAE of 26.76 with an R² of 0.8284.
  • NMHC was the weakest calibration. The NMHC model (Table II) reported an order of magnitude higher Kullback-Leibler and Jensen-Shannon divergence than the other models, with an NMHC(GT) accuracy of 43.19 percent and an R² of 0.6596, the lowest of the four calibration targets.
  • Reconstruction stayed strong across all models. Input reconstruction scores were consistently high — for example, PT08.S4(NO2) reconstruction reached 0.9664 R² in the NOx model and 96.98 percent accuracy in the CO model — indicating the VAE still functions as a standard VAE under the added calibration constraint.
  • Statistical properties were broadly preserved. Kullback-Leibler divergences for the MOS sensor reconstructions ranged from 0.00604 to 0.02322, and Jensen-Shannon divergences from 0.00151 to 0.00579, showing the outputs are statistically similar to their truth data.
  • Distributional differences were observed. In the NO2 model, the MOS sensor input (PT08.S4(NO2)) did not follow a Gaussian distribution but was more similar to a Rayleigh distribution. The predicted NO2(GT) and the reconstructed PT08.S4(NO2) had a narrower range of values and appeared more uniformly distributed, though both fell within the bounds of their counterparts.
  • Comparison with prior work. The authors note that their CO calibration MAE of 0.29 is almost on par with the DeepCM model's MAE of 0.288 reported by Yu et al. on the same dataset, which was the best performer among the methods they tested. The authors state the models are very different and that Yu et al. were able to use more of the dataset.

Methodology in Plain English

The authors take an existing dataset of hourly averaged readings from five metal oxide chemical sensors plus co-located reference analyzer ground truth, collected in a polluted Italian city between March 2004 and February 2005.

They pick four MOS sensors that show strong correlation (high cross-sensitivity) as model inputs: PT08.S1(CO), PT08.S2(NMHC), PT08.S3(NOx), and PT08.S4(NO2). These four values are compressed by an encoder into a single latent value, which doubles as the calibration prediction. A decoder then expands that single value back into four numbers, reconstructing the original inputs.

Four separate models are trained, one per target pollutant (CO, NMHC, NOx, NO2), each with its matching ground-truth reference sensor as the calibration target. The training objective combines two mean-squared-error terms — one for reconstruction, one for calibration — weighted equally (α = 1, β = 1), with the Kullback-Leibler divergence term switched off (γ = 0) because including it reduced performance with Gaussian distributions.

Implementation details: built in Google Colab with TensorFlow and Keras, dense layers with sigmoid activations, four nodes in the encoder and decoder, single nodes for the mean and standard deviation branches, a Lambda layer for the standard normal sampling, and the Adam optimizer. After filtering for complete readings, 827 complete rows remained. Each sensor's data was min-max normalized individually. The models were trained on the first 300 values, shuffled into batches of 16, so that most evaluated data was unseen during training.

Why This Matters

Impact on research. The paper opens a different route for using VAEs in sensing: rather than treating the latent space purely as a compressed representation or as a generative source, it makes the latent space carry the calibration semantics directly. If the model's weights and biases can later be tied to drift over time, this architecture could become a foundation for drift compensation rather than just one-off calibration.

Real-world applications:

  • Air quality monitoring networks, where hundreds of low-cost gas sensors need periodic recalibration against sparse reference-grade instruments.
  • Urban environmental compliance, where road-level pollutant measurements (CO, NOx, NO2, benzene) must remain trustworthy over long deployment periods.
  • Industrial and process sensing, where soft sensors infer hard-to-measure quantities from correlated easy-to-measure signals.
  • IoT and smart-city deployments, where a single compact model that both cleans up sensor data and reconstructs it reduces the compute footprint compared with running separate calibration and validation models.

Industry relevance. Low-cost sensor deployments are only as valuable as their data quality, and the paper cites the position that failure to invest in calibration leaves large uncertainties in retrieved data. A model that performs calibration and autoencoding in one pass is attractive for edge devices with limited power and memory.

Future Directions

  1. Explore different loss functions, including statistics-based losses, after further statistical analysis of the input data to find losses better suited to non-Gaussian (Rayleigh-like) sensor distributions.
  2. Analyze the model weights and biases across different training time windows, with the hope of using those changes to compensate for sensor drift.
  3. Test on new datasets, including the dataset developed in the authors' own previous work, to better understand the model's capability as a calibration model.
  4. Investigate the missing KLD term: since the Kullback-Leibler divergence loss was excluded from training because it degraded performance with Gaussian distributions, the question of what effect a properly tuned or reformulated KLD term would have remains open.

Target Audience

This paper is most useful for machine learning and sensor-systems researchers working on calibration, drift compensation, and low-cost air-quality monitoring; practitioners building or maintaining environmental sensor networks; and engineers interested in compact, multi-purpose neural architectures. Readers already comfortable with autoencoders and regression metrics will get the most from it, though the clear structure makes it accessible to graduate students entering the field.

Authors’ abstract

In this paper we present a new implementation of a Variational Autoencoder (VAE) for the calibration of sensors. We propose that the VAE can be used to calibrate sensor data by training the latent space as a calibration output. We discuss this new approach and show a proof-of-concept using an existing multi-sensor gas dataset. We show the performance of the proposed calibration VAE and found that it was capable of performing as calibration model while performing as an autoencoder simultaneously. Additionally, these models have shown that they are capable of creating statistically similar outputs from both the calibration output as well as the reconstruction output to their respective truth data. We then discuss the methods of future testing and planned expansion of this work.

Read the original paper