Efficient Out-of-Distribution Detection Using Latent Space of β-VAE for Cyber-Physical Systems

Shreyas Ramakrishna, Zahra RahimiNasab, Gabor Karsai, Arvind Easwaran, Abhishek Dubey

Introduction

Deep Neural Networks (DNNs) are the cornerstone of perception in modern Cyber-Physical Systems (CPS), such as autonomous vehicles. However, these systems are only as reliable as their training data. When a vehicle encounters an Out-of-Distribution (OOD) scenario—a situation unseen during training—DNNs often produce highly confident but erroneous predictions.

Current OOD detection methods face significant hurdles: they are often computationally expensive, requiring separate classifiers for every environmental feature, and they typically lack "reasoning" capabilities, failing to explain why a situation is considered OOD. This research introduces a highly efficient method using a single $\beta$-Variational Autoencoder ($\beta$-VAE) to detect and diagnose OOD events in real-time.

The $\beta$-VAE Methodology

The core of the proposed approach is the $\beta$-VAE, which uses a gating parameter ($\beta$) to control information flow and encourage the "disentanglement" of latent variables. By isolating independent physical features (like precipitation or brightness) into specific dimensions of the latent space, the model can act as a "reasoner."

Latent space visualization showing the effect of increasing $\beta$ on feature disentanglement.

As illustrated in the figure above, increasing $\beta$ allows the model to isolate specific features into distinct clusters. The authors demonstrate that partial disentanglement is sufficient for robust OOD detection, significantly reducing the computational burden compared to traditional classifier chains.

The design pipeline involves:

  • Automated Hyperparameter Tuning: Using Bayesian Optimization to find the optimal $\beta$ and number of latent variables ($n$).
  • Latent Variable Mapping: Identifying which latent dimensions are sensitive to specific physical features using a KL-divergence-based heuristic.
  • Runtime Detection: Combining Inductive Conformal Prediction (ICP) with Martingales (CUSUM) to identify abrupt distribution shifts.

Experimental Evaluation

The framework was tested on the CARLA Simulator and the real-world nuImages dataset. Using a custom Scenario Description Language, the researchers generated OOD scenes involving extreme weather and novel road segments.

CARLA simulation scenes and the hierarchical structure of environmental features used for OOD detection.

In these tests, the $\beta$-VAE detector achieved an F1-score of 96.98%. Notably, the system could pinpoint the specific cause of the OOD signal. For example, if the "precipitation reasoner" spiked while others remained stable, the system could confidently attribute the confusion to weather conditions.

Key Results and Efficiency

The proposed method offers substantial improvements in efficiency:

  • Speed: Inference time was approximately 74.09 ms, well within the 100ms real-time requirement for autonomous control.
  • Memory: For a complex dataset with 38 labels, the single $\beta$-VAE approach requires only 10.96 GB of memory, compared to the 136.8 GB required by a traditional VAE chain.
  • Robust Reasoning: In "New Road" tests, the system correctly identified that the OOD was not caused by weather or lighting, effectively flagging an "out-of-set" feature with 46% precision.

Conclusion

By leveraging the latent space of a $\beta$-VAE, this research provides a path toward safer and more interpretable autonomous systems. The ability to not only detect OOD data but also provide a "reason" for the detection allows for more sophisticated contingency plans, such as switching sensor modalities in response to specific environmental challenges. Future work will focus on further automating threshold selection and refining performance on noisy, real-world datasets.

Summary updated

BibTeX
@article{ramakrishna2022efficient,
  author = {Shreyas Ramakrishna and Zahra RahimiNasab and Gabor Karsai and Arvind Easwaran and Abhishek Dubey},
  title = {{Efficient Out-of-Distribution Detection Using Latent Space of β-VAE for Cyber-Physical Systems}},
  journal = {ACM Trans. Cyber Phys. Syst.},
  year = {2022},
  doi = {10.1145/3491243},
}
Figure