Abstract
Cyber-physical systems (CPSs) use learning-enabled components (LECs) extensively to cope with various complex tasks under high-uncertainty environments. However, the dataset shifts between the training and testing phase may lead the LECs to become ineffective to make large-error predictions, and further, compromise the safety of the overall system. In our paper, we first provide the formal definitions for different types of dataset shifts in learning-enabled CPS. Then, we propose an approach to detect the dataset shifts effectively for regression problems. Our approach is based on the inductive conformal anomaly detection and utilizes a variational autoencoder for regression model which enables the approach to take into consideration both LEC input and output for detecting dataset shifts. Additionally, in order to improve the robustness of detection, layer-wise relevance propagation (LRP) is incorporated into our approach. We demonstrate our approach by using an advanced emergency braking system implemented in an open-source simulator for self-driving cars. The evaluation results show that our approach can detect different types of dataset shifts with a small number of false alarms while the execution time is smaller than the sampling period of the system.
Introduction
Cyber-Physical Systems (CPS), such as autonomous vehicles, increasingly integrate Learning-Enabled Components (LECs)—typically deep neural networks—to manage perception and control. These networks are generally trained under the assumption that the operational data will mirror the training distribution. However, real-world environments frequently violate this assumption through "dataset shifts," such as heavy rain, novel vehicle geometries, or unexpected traffic patterns. When an LEC encounters such shifts, its regression performance (e.g., estimating distance to an obstacle) can degrade significantly, posing severe safety risks. This paper addresses the challenge of detecting these shifts in real-time by monitoring both the inputs and outputs of the AI components.
Proposed Methodology
The core of the proposed detection framework is a multi-layered approach centered on a specialized Variational Autoencoder (VAE).
VAE for Regression (VAE-R)
Unlike standard VAEs that focus solely on input reconstruction, the VAE-R model is trained jointly with a regressor. This architecture ensures that the latent space—the internal representation of the data—is conditioned on the predicted output. This conditioning makes the anomaly detector sensitive to shifts that specifically impact the final regression task, rather than just raw input changes.
Robust Detection with LRP and ICAD
To enhance robustness, the system incorporates Layer-wise Relevance Propagation (LRP). LRP identifies which input features (e.g., specific pixels in a camera frame) are most relevant to the regressor's prediction. By weighting detection based on these relevance maps, the system can ignore benign environmental changes (like clouds) and focus on safety-critical features (like the lead vehicle).
Statistical grounding is provided by Inductive Conformal Anomaly Detection (ICAD), which generates a p-value for each data point to quantify its deviation from the training set. To prevent false alarms from transient noise, evidence is aggregated over time using Martingale tests and CUSUM detectors.
Experimental Evaluation
The approach was evaluated using an Advanced Emergency Braking System (AEBS) in the CARLA simulator. The model was trained on ~20,000 images in clear to light-rain conditions and tested against three shift types:
- Covariate Shift: Heavy rain levels (30–100) not present in training.
- Target Shift: Distances (15m–45m) intentionally omitted from the training set.
- Label Concept Shift: Introduction of a double-sized lead vehicle.
Results and Discussion
The system demonstrated high sensitivity across all shift types. In covariate shift scenarios, the baseline VAE-R achieved zero false positives, while the LRP-enhanced version maintained low false alarm rates while significantly accelerating detection speed.
Crucially, the entire pipeline operates in under 50ms, making it viable for real-time deployment within standard autonomous control loops. The integration of LRP proved particularly effective in "Target Shift" scenarios, reducing false negatives from 13/50 to just 2/50 compared to standard VAE-R models.
Conclusion
This work provides a robust framework for real-time safety monitoring in learning-enabled CPS. By conditioning anomaly detection on regression outputs and utilizing relevance maps, the system effectively identifies when an AI is operating outside its reliable domain. Future work will explore more complex multi-modal experiments and the integration of modern attention mechanisms to further refine feature weighting.
Summary updated