You can have your ensemble and run it too - Deep Ensembles Spread Over Time

Isak Meding, Alexander Bodin, Adam Tonderski, Joakim Johnander, Christoffer Petersson, Lennart Svensson

Introduction

Deep Ensembles (DEs) represent the gold standard for uncertainty quantification in neural networks. By training multiple models with different initializations, they provide high-quality estimates of a system's confidence—a critical requirement for safety-critical applications like autonomous driving. However, the linear computational cost of DEs often makes them impractical for real-time robotics on embedded hardware.

This paper introduces Deep Ensembles Spread Over Time (DESOT), a method that achieves the performance and robustness of a full ensemble at the computational cost of a single model. By distributing ensemble members across a sequence of video frames, DESOT leverages temporal redundancy to provide ensemble-grade benefits without the associated compute penalty.

Methods: Distributing Computation Over Time

The core innovation of DESOT lies in how it handles model inference across a video sequence. While a standard Deep Ensemble runs all $M$ models on every frame, DESOT runs only one ensemble member per frame.

Comparison of Single Model (a), Deep Ensemble (b), and DESOT (c) architectures.

As shown in the figure above:

  1. Single Model: Processes each frame with the same model.
  2. Deep Ensemble: Processes each frame with $M$ models simultaneously, followed by ensemble fusion.
  3. DESOT: Cycles through ensemble members (e.g., Model 1 on Frame 1, Model 2 on Frame 2). The final prediction is derived through Temporal Fusion, where categorical output distributions (softmax scores) are averaged over a sliding window of frames.

This approach is architecture-agnostic and requires no specialized training, allowing for easy integration into existing pipelines by simply changing the inference schedule.

Experimental Setup and Datasets

The authors evaluated DESOT using the Zenseact Open Dataset (ZOD), a large-scale multi-modal dataset specifically designed for autonomous driving research.

Sample traffic signs from the Zenseact Open Dataset (ZOD) used for training and evaluation.

The training phase utilized 446,000 unique traffic signs. For temporal evaluation, a sequence dataset of 30,000 signs was created, with each sign tracked over 11 frames at 15Hz. To benchmark Out-of-Distribution (OOD) detection, the researchers introduced a "NotListed" class and applied synthetic corruptions such as motion blur and Gaussian noise to simulate challenging real-world environments.

Key Insights

  • Exploiting Temporal Redundancy: Adjacent frames in a video stream are highly correlated. DESOT trades instantaneous ensemble power for temporal ensemble power, effectively getting a "free lunch" from the data's redundancy.
  • Uncertainty Reduction: DESOT addresses both aleatoric uncertainty (data noise) and epistemic uncertainty (model ignorance) simultaneously by aggregating different model perspectives over time.
  • Robustness on the Long Tail: Interestingly, DESOT outperformed full ensembles on rare "minority classes." Spreading different models over different views of a rare object appears to provide a more expressive representation than a single-frame ensemble.
  • Efficiency Sweet Spot: Results suggest that an ensemble size of $M=5$ provides the best balance, as increasing to $M=10$ yielded diminishing returns for OOD detection.

Results and Performance

DESOT demonstrates that computational efficiency does not have to come at the cost of performance:

  • Accuracy: On the ZOD sequence dataset, DESOT with 5 members (DESOT$_5$) achieved 97.60% accuracy, nearly matching the full DE$_5$ (97.64%) while being 5x faster. Both methods significantly outperformed the single-model baseline (97.34%).
  • OOD Robustness: DESOT matched the high-entropy (high uncertainty) behavior of traditional deep ensembles when encountering OOD data, far surpassing single models or MC-dropout.
  • Calibration: While temporal averaging can sometimes lead to overconfidence in single models, both DESOT and DEs significantly improved sequence calibration compared to the baseline.

Limitations and Future Outlook

While promising, DESOT is fundamentally a sequential method and cannot provide ensemble-grade uncertainty for isolated images. Additionally, while it saves on FLOPs, it requires sufficient VRAM to keep multiple models in memory to avoid latency from model swapping.

Future work may explore more sophisticated temporal fusion techniques, such as Kalman Filters, or investigate optimal temperature scaling for temporal sequences to further refine calibration.

Summary updated

Abstract

Ensembles of independently trained deep neural networks yield uncertainty estimates that rival Bayesian networks in performance. They also offer sizable improvements in terms of predictive performance over single models. However, deep ensembles are not commonly used in environments with limited computational budget -- such as autonomous driving -- since the complexity grows linearly with the number of ensemble members. An important observation that can be made for robotics applications, such as autonomous driving, is that data is typically sequential. For instance, when an object is to be recognized, an autonomous vehicle typically observes a sequence of images, rather than a single image. This raises the question, could the deep ensemble be spread over time? In this work, we propose and analyze Deep Ensembles Spread Over Time (DESOT). The idea is to apply only a single ensemble member to each data point in the sequence, and fuse the predictions over a sequence of data points. We implement and experiment with DESOT for traffic sign classification, where sequences of tracked image patches are to be classified. We find that DESOT obtains the benefits of deep ensembles, in terms of predictive and uncertainty estimation performance, while avoiding the added computational cost. Moreover, DESOT is simple to implement and does not require sequences during training. Finally, we find that DESOT, like deep ensembles, outperform single models for out-of-distribution detection.
BibTeX
@inproceedings{meding2023you,
  author = {Isak Meding and Alexander Bodin and Adam Tonderski and Joakim Johnander and Christoffer Petersson and Lennart Svensson},
  title = {{You can have your ensemble and run it too - Deep Ensembles Spread Over Time}},
  booktitle = {Workshops @ ICCV},
  year = {2023},
  doi = {10.1109/iccvw60793.2023.00434},
}
Figure