
AI
Uncertainty quantification in object detection: Bayesian, MC-Dropout, ensembles or external method?

Uncertainty quantification in object detection falls into four families: Bayesian networks, MC-Dropout, deep ensembles, and external methods on a single deterministic network. Only the external family is compatible with real time and plug-and-play integration. It requires neither retraining, multiple passes, nor access to weights.
This answer comes from a published classification: the taxonomy from the survey by Gawlikowski et al. (2023).
The rest of this article puts it to the test. We implemented the four families on the same detector, evaluated them on the KITTI benchmark, and measured two things: uncertainty quality and its cost in milliseconds. One method outperforms ours on one metric. We show that as well.
TrustalAI built a new trust layer for Physical AI. Its core component, T-Vision, the technical name of TrustalAI Vision, belongs to the external family.
Why does an object detector need uncertainty estimation?
An object detector needs uncertainty estimation because its outputs do not state how wrong they might be. A bounding box and a class score tell the system what the model saw. They do not tell it whether it can act on it.
The confidence score from a softmax or sigmoid does not do this job. It ranks categories. It says little about the position of the bounding box, and it often remains high on inputs the model has never seen. Two pedestrian detections can display the same confidence score even if one is misplaced. A detector with a solid mAP on its validation set still produces highly confident false positives and false negatives on the image it processes.
Feng et al. (2022) surveyed probabilistic object detection for autonomous driving and compared several methods on KITTI. Their survey serves as a reminder of what is seen in every perception pipeline: detection accuracy and uncertainty quality are two distinct properties. The latter is measured separately.
Two types of uncertainty matter here:
Aleatoric uncertainty stems from the data: occlusion, distance, rain, motion blur, sparse LiDAR point clouds. More training does not make it disappear.
Epistemic uncertainty stems from the model. It increases on out-of-distribution inputs and when the scene drifts from the training set, where model drift appears first.
Uncertainty quantification consists of estimating, for each prediction, the potential discrepancy between output and reality, so the system can decide whether it can act on it. In autonomous driving as in robotics, this estimation feeds the rest of the downstream pipeline: sensor fusion, tracking, planning, and control. Functional safety frameworks (ISO 26262, SOTIF) ask how perception fails. Per-prediction reliability answers part of that question in real time, detection by detection.
Four families of uncertainty quantification methods
The survey by Gawlikowski et al. classifies methods according to how they obtain the estimate. In object detection, four families matter. Each pays its cost in a different place: at training, at inference, or in memory.
Bayesian networks
A Bayesian network is a network whose weights are probability distributions rather than fixed values. At inference, it samples multiple sets of weights and interprets the variance of the outputs as uncertainty. Blundell et al. (2015) made this practical with variational training, "Bayes by Backprop." The cost is twofold. The detector must be retrained in a Bayesian version, and each prediction requires multiple sampled passes.
MC-Dropout
MC-Dropout is a method that keeps dropout active at inference and runs the same input N times through the network. Gal and Ghahramani (2016) showed that this approximates Bayesian inference. The variance across the N passes provides the uncertainty. The method is easy to add if the architecture already includes dropout layers. It also multiplies the inference cost by N and alters the behavior of the deployed model.
Deep ensembles
A deep ensemble is a group of N independently trained models, starting from different initializations, whose disagreement measures uncertainty. Lakshminarayanan, Pritzel, and Blundell (2017) showed that ensembles provide solid and well-calibrated estimates. The price: N training runs, N sets of weights to store, and N inferences per image.
External methods on a single deterministic network
An external method is an estimator that leaves the original network intact and calculates uncertainty from its outputs in a single pass. The detector remains deterministic and keeps its weights. In Gawlikowski's taxonomy, this is the "single network deterministic methods, external methods" branch. This is a recognized category in the scientific literature, not a marketing label. T-Vision falls into this category. It reads the detector's predictions and returns a σ (sigma) for each.
Family | Retraining | Passes per image | Access to weights | Real-time, plug-and-play |
|---|---|---|---|---|
Bayesian network | Yes | Multiple (sampling) | Yes | No |
MC-Dropout | Yes if the model has no dropout | N | Yes | No |
Deep ensemble | Yes, N times | N | Yes | No |
External method | No | One | No (black-box) | Yes |
How to compare uncertainty quantification methods: NLL, AUPR, AUROC, AURC
Four metrics are used to compare uncertainty methods. Each answers a different question, and none measures detection accuracy.
NLL (negative log-likelihood) measures the probabilistic quality of a prediction: what probability the method assigned to what actually occurred. Lower is better.
AUROC (area under the ROC curve) measures the ability of uncertainty to separate correct predictions from incorrect ones. Higher is better.
AUPR (area under the precision-recall curve) measures the same separation and remains robust when errors are rare compared to correct predictions. Higher is better.
AURC (area under the risk-coverage curve) measures the error remaining when the most uncertain predictions are discarded first. Lower is better.
Hendrycks and Gimpel (2017) established AUROC and AUPR as the baseline for evaluating error detection from a model's scores. Geifman, Uziel, and El-Yaniv (2019) use the risk-coverage curve and AURC for selective prediction, the case where a system has the option to abstain.
For a deployed system, this distinction matters. AUROC, AUPR, and AURC answer an operational decision question: can I distinguish good predictions from bad ones before acting? NLL answers a modeling question: does the predicted distribution have the right shape overall? Calibration lies between the two.
The KITTI benchmark: protocol
We conducted the comparison on the KITTI benchmark suite, the public autonomous driving dataset published by Geiger, Lenz, and Urtasun (2012). The protocol was identical for all methods:
Baseline: a single fine-tuned YOLOv8 detector (Ultralytics), common to all four methods.
Methods: YOLOv8 + T-Vision, YOLOv8-BNN (Bayesian), YOLOv8-MCDropout, and YOLOv8-Ensemble.
Data: 1,493 KITTI images.
Labels: 10,049.
Timing hardware: NVIDIA L4 GPU (24 GB).
A common baseline isolates the uncertainty method. Detections are the same for everyone. Only the way uncertainty is estimated changes.
Results: uncertainty quality and latency on KITTI
On KITTI, T-Vision achieves the best uncertainty estimation quality on AUPR, AUROC, and AURC among the evaluated methods. MC-Dropout maintains the best NLL. T-Vision is also, by far, the fastest method.
Quality of uncertainty estimation
Method | NLL ↓ | AUPR ↑ | AUROC ↑ | AURC ↓ |
|---|---|---|---|---|
YOLOv8 + T-Vision (TrustalAI) | 13.78 | 0.84 | 0.86 | 2.76 |
YOLOv8-BNN (Bayesian) | 44.67 | 0.73 | 0.71 | 3.59 |
YOLOv8-MCDropout | 11.85 | 0.78 | 0.76 | 3.46 |
YOLOv8-Ensemble | 20.33 | 0.83 | 0.82 | 3.26 |
T-Vision reaches an AUROC of 0.86 on this protocol. Its AUPR is 0.84. Its AURC is 2.76, the lowest of the four. The ensemble is closest in terms of separation. MC-Dropout leads on NLL, with 11.85 compared to 13.78 for T-Vision.
Latency on NVIDIA L4 (ms)
Method | Mean | Median | 95th percentile |
|---|---|---|---|
YOLOv8 + T-Vision (TrustalAI) | (5.89) + 8.79 ≈ 14.7 | (5.92) + 8.54 ≈ 14.5 | (6.21) + 13.38 ≈ 19.6 |
YOLOv8-BNN | 356.67 | 356.15 | 363.91 |
YOLOv8-MCDropout | 191.48 | 191.00 | 198.79 |
YOLOv8-Ensemble | 71.63 | 71.25 | 75.27 |
How to read the T-Vision row: the figure in parentheses corresponds to YOLOv8 alone; the second term represents what T-Vision adds. The other rows give the total time for each method, detector included.
T-Vision adds 8.8 ms on average on the L4 GPU.
The complete pipeline, detector plus T-Vision, takes approximately 14.7 ms per image.
This is roughly 13 times faster than MC-Dropout.
This is roughly 24 times faster than the Bayesian network.
This is roughly 5 times faster than the ensemble.
On CPU, T-Vision adds less than 20 ms.
A word of caution, the same we would ask of anyone else: this is a benchmark on a public dataset, with a given baseline. Results on your detector and your data must be measured, not assumed. The final section explains how.
What MC-Dropout's superior NLL really means
MC-Dropout's better NLL indicates that averaging N passes produces a well-shaped predictive distribution. It does not indicate that MC-Dropout better separates good detections from bad ones. On that question, AUROC, AUPR, and AURC tell a different story.
NLL penalizes misplaced confidence across the entire distribution. A method that is confident and wrong pays heavily. A method that spreads probability reasonably, even if slightly off, pays less. MC-Dropout averages N stochastic passes, and this averaging smooths the distribution. That is precisely what NLL rewards; the result is hardly surprising.
The cost appears in the latency table. MC-Dropout takes 191 ms per image on the L4. This is far beyond the per-frame budget of an embedded perception pipeline, where tracking and planning must also run downstream. For a robot or vehicle making real-time decisions, the method is unusable.
So, which metric should guide the choice? For a system that acts on each detection, the operational decision metrics are AUROC and AURC: can I separate good predictions from bad ones, and at what cost? NLL remains a useful metric. It indicates how well a method models the entire distribution. We publish it for that reason, including the column where we come in second.
Real-time and plug-and-play: why the uncertainty quantification method matters
The method family dictates what can be deployed. Three constraints are decisive, and only the external family satisfies them all.
No retraining. A Bayesian network or an ensemble is a new model, requiring a new validation campaign. With an external method, the validated detector remains completely untouched. The mechanism is detailed in vision model reliability without retraining.
A single pass. MC-Dropout and ensembles multiply inference. An external method reads a single set of outputs: its latency is added once, not multiplied.
No access to weights. Sampling methods require opening up the network. An external method works on a black-box model. For an OEM or software vendor, this is the difference between a partnership and an IP transfer, as explained in the AI reliability layer for OEMs and software vendors.
Latency also holds on embedded hardware. On an NVIDIA Jetson Orin AGX, T-Vision computes a σ per prediction in about 5 ms. This measurement is distinct from the L4 benchmark above, conducted on a different target. Edge keeps decision-making on-device; our article on edge AI reliability at 20 ms details the hardware trade-offs.
Per-prediction reliability vs. aggregate monitoring
The method family also determines when the estimate arrives. Monitoring tools evaluate a model after many predictions. An external method scores each prediction before decision or action.
Aggregate monitoring | Per-prediction reliability | |
|---|---|---|
Principle | Waits for many predictions, then computes statistics | Computes a reliability metric on each prediction |
Timing | Post-execution | Pre-decision |
Execution time | Not real-time | Under 100 ms, 20 ms on edge CPU |
Others analyze post-execution: the decision has already been made, the action already taken. TrustalAI delivers reliability at the moment of prediction, before the decision.
In practice, the σ travels alongside each detection through the pipeline. Sensor fusion can weight each source using it. A tracker can assign less weight to a measurement when σ is high. A planner can slow down. That is the role of a reliability layer: providing each downstream block with a number it can act on. The principle is laid out in our pillar article on AI prediction reliability.
This benchmark was announced as "in preparation" in Robotic perception: one box, two detections. Here it is. For use cases, see autonomous systems and industrial production and robotics. To understand the cost of perception failures on the road, read AI perception errors and autonomous vehicles.
FAQ
What is uncertainty quantification in object detection?
Uncertainty quantification in object detection estimates, for each detected object, the potential discrepancy between the bounding box, the class, and reality. It goes beyond the confidence score: it tells a robot or vehicle whether it can act on a detection. Four families exist: Bayesian networks, MC-Dropout, deep ensembles, and external methods on a single deterministic network. Only the external family operates in a single pass, without retraining.
Why not simply use MC-Dropout to estimate uncertainty?
MC-Dropout is a solid method, and it achieves the best NLL among the four methods tested on KITTI. Its weakness is its cost. It runs N passes per image. On an NVIDIA L4 GPU, it takes approximately 191 ms per frame in this benchmark. It also requires dropout layers in the deployed model. For a perception pipeline that must make decisions in real time, this cost rules it out.
What do AUROC and AURC measure for uncertainty?
AUROC measures the ability of an uncertainty score to separate correct predictions from incorrect ones. A perfect separation is 1.0; random guessing is 0.5. AURC is the area under the risk-coverage curve. It measures the remaining error when the most uncertain predictions are rejected first: lower is better. Together, they answer the deployment question: does the system know which detections to trust?
Does an external uncertainty method require retraining the detector?
No. An external method leaves the detector and its weights intact and only reads its outputs. T-Vision requires three inputs: the model's predictions, a labeled ground truth sample for calibration, and context descriptors such as images or point clouds. It has access neither to the model, nor to the weights, nor to the training data. The validated detector remains as is.
Can uncertainty quantification run on a CPU or an embedded GPU?
Yes, with an external method. T-Vision adds less than 20 ms per image on a CPU. On an NVIDIA Jetson Orin AGX, it computes a σ per prediction in about 5 ms. Sampling-based methods, such as MC-Dropout, deep ensembles, and Bayesian networks, multiply inference: their embedded cost scales with the number of passes they require.
Sources
Gawlikowski, J. et al. (2023). A survey of uncertainty in deep neural networks. Artificial Intelligence Review, 56 (Suppl. 1), 1513-1589. https://doi.org/10.1007/s10462-023-10562-9
Gal, Y. & Ghahramani, Z. (2016). Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning. ICML, PMLR 48. https://proceedings.mlr.press/v48/gal16.html
Lakshminarayanan, B., Pritzel, A. & Blundell, C. (2017). Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles. NeurIPS. https://proceedings.neurips.cc/paper/2017/hash/9ef2ed4b7fd2c810847ffa5fa85bce38-Abstract.html
Geiger, A., Lenz, P. & Urtasun, R. (2012). Are we ready for autonomous driving? The KITTI vision benchmark suite. CVPR. https://www.cvlibs.net/datasets/kitti/
Blundell, C. et al. (2015). Weight Uncertainty in Neural Networks. ICML.
Hendrycks, D. & Gimpel, K. (2017). A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks. ICLR.
Geifman, Y., Uziel, G. & El-Yaniv, R. (2019). Bias-Reduced Uncertainty Estimation for Deep Neural Classifiers. ICLR.
Feng, D. et al. (2022). A Review and Comparative Study on Probabilistic Object Detection in Autonomous Driving. IEEE Transactions on Intelligent Transportation Systems.
Run the same comparison on your detector
We do not ask you to take our figures for granted. We invite you to replicate them. Bring your detector and a labeled sample of your data. We run the same comparison, and your team verifies the results against your own ground truth.
Share
Related articles



