CUPID: A Plug-in Framework for Joint Aleatoric and Epistemic Uncertainty Estimation with a Single Model
Organizations: Lee Kong Chian School of Medicine, Nanyang Technological University, Singapore · College of Computing and Data Science, Nanyang Technological University, Singapore · Centre for Medical Technologies & Innovations, National Health Group, Singapore
Abstract
Accurate estimation of uncertainty in deep learning is critical for deploying models in high-stakes domains such as medical diagnosis and autonomous decision-making, where overconfident predictions can lead to harmful outcomes. In practice, understanding the reason behind a model's uncertainty and the type of uncertainty it represents can support risk-aware decisions, enhance user trust, and guide additional data collection. However, many existing methods only address a single type of uncertainty or require modifications and retraining of the base model, making them difficult to adopt in real-world systems. We introduce CUPID (Comprehensive Uncertainty Plug-in estImation moDel), a general-purpose module that jointly estimates aleatoric and epistemic uncertainty without modifying or retraining the base model. CUPID can be flexibly inserted into any layer of a pretrained network. It models aleatoric uncertainty through a learned Bayesian identity mapping and captures epistemic uncertainty by analyzing the model's internal responses to structured perturbations. We evaluate CUPID across a range of tasks, including classification, regression, and out-of-distribution detection. The results show that it consistently delivers competitive performance while offering layer-wise insights into the origins of uncertainty. By making uncertainty estimation modular, interpretable, and model-agnostic, CUPID supports more transparent and trustworthy AI. Related code and data are available at https://github.com/a-Fomalhaut-a/CUPID.
Figures & tables
| Method | GLV2 | HAM10000 | ||||
|---|---|---|---|---|---|---|
| AUC ( ) | AURC ( ) | Spearman ( ) | AUC ( ) | AURC ( ) | Spearman ( ) | |
| CUPID Alea. | 0.870 ± 0.002 | 0.018 ± 0.001 | 0.941 ± 0.004 | 0.769 ± 0.023 | 0.067 ± 0.007 | 0.722 ± 0.014 |
| CUPID Epis. | 0.769 ± 0.015 | 0.034 ± 0.002 | 0.701 ± 0.051 | 0.855 ± 0.006 | 0.047 ± 0.001 | 0.907 ± 0.001 |
| MC Dropout | 0.768 ± 0.006 | 0.027 ± 0.001 | 0.888 ± 0.005 | 0.829 ± 0.001 | 0.076 ± 0.001 | 0.861 ± 0.002 |
| Rate-in | 0.815 ± 0.006 | 0.024 ± 0.001 | 0.816 ± 0.004 | 0.846 ± 0.001 | 0.048 ± 0.000 | 0.915 ± 0.000 |
| IGRUE | 0.642 ± 0.007 | 0.058 ± 0.002 | 0.199 ± 0.004 | 0.548 ± 0.004 | 0.157 ± 0.002 | 0.027 ± 0.018 |
| Method | PAPILA | ACRIMA | CIFAR10 | |||
|---|---|---|---|---|---|---|
| AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | |
| CUPID Alea. | 0.379 ± 0.027 | 0.333 ± 0.007 | 0.717 ± 0.029 | 0.661 ± 0.027 | 0.983 ± 0.005 | 0.998 ± 0.001 |
| CUPID Epis. | 0.877 ± 0.032 | 0.854 ± 0.027 | 0.978 ± 0.010 | 0.984 ± 0.007 | 0.898 ± 0.054 | 0.991 ± 0.005 |
| MC Dropout | 0.733 ± 0.002 | 0.586 ± 0.007 | 0.869 ± 0.003 | 0.816 ± 0.009 | 0.887 ± 0.004 | 0.986 ± 0.001 |
| Rate-in | 0.328 ± 0.005 | 0.329 ± 0.008 | 0.363 ± 0.003 | 0.390 ± 0.003 | 0.620 ± 0.001 | 0.927 ± 0.002 |
| IGRUE | 0.636 ± 0.114 | 0.486 ± 0.097 | 0.941 ± 0.008 | 0.944 ± 0.008 | 0.978 ± 0.005 | 0.998 ± 0.001 |
| Method | Set5 | Set14 | ||||
|---|---|---|---|---|---|---|
| Pearson ( ) | AUSE ( ) | UCE ( ) | Pearson ( ) | AUSE ( ) | UCE ( ) | |
| CUPID Alea. | 0.528 ± 0.006 | 0.010 ± 0.000 | 0.045 ± 0.018 | 0.527 ± 0.002 | 0.012 ± 0.000 | 0.049 ± 0.005 |
| CUPID Epis. | 0.416 ± 0.004 | 0.018 ± 0.001 | 0.266 ± 0.007 | 0.449 ± 0.005 | 0.019 ± 0.000 | 0.226 ± 0.003 |
| BayesCap | 0.485 ± 0.038 | 0.010 ± 0.000 | 0.098 ± 0.001 | 0.422 ± 0.064 | 0.012 ± 0.000 | 0.100 ± 0.000 |
| in-rotate | 0.493 ± 0.000 | 0.010 ± 0.000 | 0.071 ± 0.000 | 0.490 ± 0.000 | 0.013 ± 0.000 | 0.072 ± 0.000 |
| in-noise | 0.370 ± 0.006 | 0.019 ± 0.000 | 0.051 ± 0.035 | 0.354 ± 0.001 | 0.022 ± 0.000 | 0.826 ± 0.006 |
| Method | PAPILA | ACRIMA | CIFAR10 | ||||
|---|---|---|---|---|---|---|---|
| AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | ||
| Max | Alea. | 0.379 ± 0.027 | 0.333 ± 0.007 | 0.717 ± 0.029 | 0.661 ± 0.027 | 0.983 ± 0.005 | 0.998 ± 0.001 |
| No max | Alea. | 0.389 ± 0.026 | 0.338 ± 0.009 | 0.739 ± 0.042 | 0.696 ± 0.055 | 0.988 ± 0.003 | 0.999 ± 0.000 |
| Max | Epis. | 0.877 ± 0.032 | 0.854 ± 0.027 | 0.978 ± 0.010 | 0.984 ± 0.007 | 0.898 ± 0.054 | 0.991 ± 0.005 |
| No max | Epis. | 0.839 ± 0.017 | 0.790 ± 0.054 | 0.977 ± 0.006 | 0.982 ± 0.005 | 0.875 ± 0.024 | 0.989 ± 0.002 |
| Model | Aleatoric | Epistemic | ||||
|---|---|---|---|---|---|---|
| AUC ( ) | AURC ( ) | Spearman ( ) | AUC ( ) | AURC ( ) | Spearman ( ) | |
| Joint | 0.870 ± 0.002 | 0.018 ± 0.001 | 0.941 ± 0.004 | 0.769 ± 0.015 | 0.034 ± 0.002 | 0.701 ± 0.051 |
| Seperate | 0.863 ± 0.003 | 0.019 ± 0.001 | 0.899 ± 0.035 | 0.744 ± 0.017 | 0.043 ± 0.005 | 0.699 ± 0.014 |
| Model | PAPILA | ACRIMA | CIFAR10 | ||||
|---|---|---|---|---|---|---|---|
| AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | ||
| Alea. | Joint | 0.379 ± 0.027 | 0.333 ± 0.007 | 0.717 ± 0.029 | 0.661 ± 0.027 | 0.983 ± 0.005 | 0.998 ± 0.001 |
| Alea. | Seperate | 0.508 ± 0.097 | 0.385 ± 0.052 | 0.739 ± 0.071 | 0.661 ± 0.066 | 0.969 ± 0.027 | 0.995 ± 0.005 |
| Epis. | Joint | 0.877 ± 0.032 | 0.854 ± 0.027 | 0.978 ± 0.010 | 0.984 ± 0.007 | 0.898 ± 0.054 | 0.991 ± 0.005 |
| Epis. | Seperate | 0.771 ± 0.051 | 0.707 ± 0.073 | 0.972 ± 0.010 | 0.978 ± 0.009 | 0.844 ± 0.049 | 0.986 ± 0.005 |
Appendix figures & tables26 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameters | Predicted Model | CUPID |
|---|---|---|
| Epoch | 50 | 50 |
| Batch size | 256 | 256 |
| Learning rate | 0.001 | 0.0001 |
| / | 0.001 | |
| / | 0.01 |
| Method | CUPID Alea. | CUPID Epis. | MC Dropout |
|---|---|---|---|
| AUC( ) | 0.965 ± 0.000 | - | - |
| Accuracy( ) | 0.837 ± 0.000 | - | - |
| AUC ( ) | 0.769 ± 0.006 | 0.688 ± 0.005 | 0.563 ± 0.001 |
| AURC ( ) | 0.060 ± 0.001 | 0.088 ± 0.002 | 0.138 ± 0.000 |
| Spearman ( ) | 0.812 ± 0.017 | 0.627 ± 0.012 | 0.365 ± 0.001 |
| Hyperparameters | Predicted Model | CUPID |
|---|---|---|
| Max epoch | 50 | 50 |
| Batch size | 16 | 8 |
| Learning rate | 0.001 | 0.001 |
| / | 0.001 | |
| / | 0.01 |
| Dataset | Noise ( ) | SNR ( ) | Classes | Class balanced |
|---|---|---|---|---|
| GLV2 | 0.024 | 5.44 dB | 2 | True |
| HAM10000 | 0.022 | 12.78 dB | 7 | False |
| Hyperparameters | GLV2 | HAM10000 | ||
|---|---|---|---|---|
| Predicted | CUPID | Predicted | CUPID | |
| Max epoch | 10 | 15 | 10 | 15 |
| Batch size | 4 | 4 | 8 | 4 |
| Learning rate | 0.00001 | 0.00001 | 0.0001 | 0.00001 |
| Decay step size | 1 | 1 | 4.5 | 1 |
| Decay | 0.8 | 0.9 | 0.75 | 0.9 |
| Method | GLV2 | HAM10000 | ||
|---|---|---|---|---|
| AUC( ) | Acc( ) | AUC( ) | Acc( ) | |
| CUPID/IGRUE/Rate-in | 0.970 0.000 | 0.909 0.000 | 0.952 0.000 | 0.821 0.000 |
| MC Dropout | 0.979 0.000 | 0.921 0.000 | 0.946 0.000 | 0.765 0.002 |
| PostNet | 0.789 ± 0.004 | 0.718 ± 0.010 | 0.865 0.002 | 0.664 0.008 |
| BNN | 0.966 0.005 | 0.914 0.004 | 0.929 0.004 | 0.742 0.011 |
| DEC | 0.875 0.002 | 0.878 0.003 | 0.922 0.014 | 0.768 0.009 |
| Hyperparameters | Predicted Model | CUPID |
|---|---|---|
| Max iteration | 300000 | 300000 |
| Batch size | 16 | 16 |
| Learning rate | 0.0001 | 0.00001 |
| / | 0.0001 | |
| / | 0.01 |
| Dataset | SSIM( ) | PSNR( ) |
|---|---|---|
| Set5 | 0.828 | 28.533 |
| Set14 | 0.684 | 24.865 |
| BSDS100 | 0.631 | 23.539 |
| IXI | 0.806 | 33.142 |
| Class Position | GLV2 | HAM10000 | ||||
|---|---|---|---|---|---|---|
| AUC ( ) | AURC ( ) | Spearman ( ) | AUC ( ) | AURC ( ) | Spearman ( ) | |
| Aleatoric (4) | 0.870 ± 0.002 | 0.018 ± 0.001 | 0.941 ± 0.004 | 0.769 ± 0.023 | 0.067 ± 0.007 | 0.722 ± 0.014 |
| Aleatoric (3) | 0.843 ± 0.008 | 0.022 ± 0.001 | 0.851 ± 0.006 | 0.751 ± 0.004 | 0.072 ± 0.003 | 0.624 ± 0.024 |
| Aleatoric (2) | 0.805 ± 0.014 | 0.026 ± 0.001 | 0.772 ± 0.019 | 0.749 ± 0.011 | 0.103 ± 0.006 | 0.675 ± 0.021 |
| Epistemic (4) | 0.769 ± 0.015 | 0.034 ± 0.002 | 0.701 ± 0.051 | 0.855 ± 0.006 | 0.047 ± 0.001 | 0.907 ± 0.001 |
| Epistemic (3) | 0.786 ± 0.003 | 0.033 ± 0.004 | 0.696 ± 0.015 | 0.869 ± 0.005 | 0.045 ± 0.000 | 0.898 ± 0.004 |
| Method | GLV2 | PAPILA | ACRIMA | CIFAR10 | |
| rAULC ( ) | UCE ( ) | OOD-UCE ( ) | |||
| CUPID Alea. | 0.840 ± 0.003 | 0.042 ± 0.004 | 0.308 ± 0.026 | 0.226 ± 0.079 | 0.273 ± 0.004 |
| CUPID Epis. | 0.649 ± 0.031 | 0.033 ± 0.008 | 0.115 ± 0.016 | 0.240 ± 0.006 | 0.633 ± 0.017 |
| MC Dropout | 0.682 ± 0.009 | 0.052 ± 0.019 | 0.257 ± 0.001 | 0.307 ± 0.045 | 0.699 ± 0.021 |
| Rate-in | 0.762 ± 0.011 | 0.038 ± 0.009 | 0.309 ± 0.009 | 0.411 ± 0.008 | 0.826 ± 0.019 |
| IGRUE | 0.375 ± 0.024 | 0.145 ± 0.012 | 0.154 ± 0.046 | 0.252 ± 0.016 | 0.596 ± 0.010 |
| Method | Aleatoric | Epistemic | |||||
|---|---|---|---|---|---|---|---|
| AUC ( ) | AURC ( ) | Spearman ( ) | AUC ( ) | AURC ( ) | Spearman ( ) | ||
| Block | 12 | 0.725 ± 0.028 | 0.098 ± 0.010 | 0.614 ± 0.027 | 0.890 ± 0.003 | 0.052 ± 0.001 | 0.889 ± 0.004 |
| 14 | 0.725 ± 0.013 | 0.107 ± 0.003 | 0.604 ± 0.035 | 0.902 ± 0.004 | 0.055 ± 0.003 | 0.886 ± 0.001 | |
| 16 | 0.749 ± 0.011 | 0.103 ± 0.006 | 0.675 ± 0.021 | 0.901 ± 0.004 | 0.058 ± 0.001 | 0.888 ± 0.005 | |
| 18 | 0.735 ± 0.024 | 0.100 ± 0.010 | 0.628 ± 0.049 | 0.895 ± 0.004 | 0.054 ± 0.002 | 0.886 ± 0.001 | |
| Loss | Aleatoric | Epistemic | ||||
|---|---|---|---|---|---|---|
| AUC ( ) | AURC ( ) | Spearman ( ) | AUC ( ) | AURC ( ) | Spearman ( ) | |
| Max | 0.749 ± 0.011 | 0.103 ± 0.006 | 0.675 ± 0.021 | 0.901 ± 0.004 | 0.058 ± 0.001 | 0.888 ± 0.005 |
| No max | 0.748 ± 0.005 | 0.098 ± 0.006 | 0.671 ± 0.025 | 0.898 ± 0.002 | 0.056 ± 0.003 | 0.888 ± 0.002 |
| Method | Aleatoric | Epistemic | |||||
|---|---|---|---|---|---|---|---|
| AUC ( ) | AURC ( ) | Spearman ( ) | AUC ( ) | AURC ( ) | Spearman ( ) | ||
| 0.02 | 0.868 ± 0.001 | 0.018 ± 0.000 | 0.929 ± 0.019 | 0.743 ± 0.044 | 0.045 ± 0.013 | 0.676 ± 0.021 | |
| 0.01 | 0.870 ± 0.002 | 0.018 ± 0.001 | 0.941 ± 0.004 | 0.769 ± 0.015 | 0.034 ± 0.002 | 0.701 ± 0.051 | |
| 0.001 | 0.868 ± 0.005 | 0.018 ± 0.001 | 0.936 ± 0.010 | 0.754 ± 0.014 | 0.042 ± 0.005 | 0.674 ± 0.031 | |
| Method and | PAPILA | ACRIMA | CIFAR10 | ||||
|---|---|---|---|---|---|---|---|
| AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | AUC( ) | AUPR( ) | ||
| Alea. | 0.02 | 0.457 ± 0.087 | 0.362 ± 0.043 | 0.727 ± 0.124 | 0.651 ± 0.149 | 0.973 ± 0.017 | 0.996 ± 0.003 |
| 0.01 | 0.379 ± 0.027 | 0.333 ± 0.007 | 0.717 ± 0.029 | 0.661 ± 0.027 | 0.983 ± 0.005 | 0.998 ± 0.001 | |
| 0.001 | 0.389 ± 0.030 | 0.342 ± 0.016 | 0.718 ± 0.046 | 0.669 ± 0.062 | 0.984 ± 0.006 | 0.999 ± 0.001 | |
| Epis. | 0.02 | 0.802 ± 0.039 | 0.743 ± 0.058 | 0.904 ± 0.058 | 0.921 ± 0.046 | 0.528 ± 0.293 | 0.923 ± 0.063 |
| 0.01 | 0.877 ± 0.032 | 0.854 ± 0.027 | 0.978 ± 0.010 | 0.984 ± 0.007 | 0.898 ± 0.054 | 0.991 ± 0.005 | |
| Trunk Num | Set5 | Set14 | |||||
|---|---|---|---|---|---|---|---|
| Pearson ( ) | AUSE ( ) | UCE ( ) | Pearson ( ) | AUSE ( ) | UCE ( ) | ||
| Aleatoric | 3 | 0.525 ± 0.002 | 0.010 ± 0.000 | 0.017 ± 0.007 | 0.527 ± 0.002 | 0.012 ± 0.000 | 0.049 ± 0.014 |
| 4 | 0.528 ± 0.006 | 0.010 ± 0.000 | 0.045 ± 0.018 | 0.527 ± 0.002 | 0.012 ± 0.000 | 0.049 ± 0.005 | |
| 5 | 0.527 ± 0.007 | 0.010 ± 0.000 | 0.041 ± 0.019 | 0.527 ± 0.001 | 0.012 ± 0.000 | 0.047 ± 0.015 | |
| 6 | 0.528 ± 0.003 | 0.010 ± 0.000 | 0.045 ± 0.020 | 0.524 ± 0.003 | 0.012 ± 0.000 | 0.039 ± 0.006 | |
| Epistemic | 3 | 0.416 ± 0.004 | 0.020 ± 0.000 | 0.254 ± 0.024 | 0.428 ± 0.005 | 0.020 ± 0.000 | 0.217 ± 0.003 |
| Loss | Set5 | Set14 | |||||
|---|---|---|---|---|---|---|---|
| Pearson ( ) | AUSE ( ) | UCE ( ) | Pearson ( ) | AUSE ( ) | UCE ( ) | ||
| Aleatoric | Raw | 0.528 ± 0.006 | 0.010 ± 0.000 | 0.045 ± 0.018 | 0.527 ± 0.002 | 0.012 ± 0.000 | 0.049 ± 0.005 |
| Add Lipis | 0.512 ± 0.006 | 0.010 ± 0.001 | 0.031 ± 0.010 | 0.518 ± 0.009 | 0.013 ± 0.001 | 0.051 ± 0.015 | |
| Epistemic | Raw | 0.416 ± 0.005 | 0.018 ± 0.001 | 0.266 ± 0.007 | 0.449 ± 0.005 | 0.019 ± 0.000 | 0.226 ± 0.003 |
| Add Lipis | 0.389 ± 0.007 | 0.019 ± 0.000 | 0.253 ± 0.035 | 0.399 ± 0.003 | 0.021 ± 0.000 | 0.230 ± 0.016 | |
| Set5 | Set14 | ||||||
|---|---|---|---|---|---|---|---|
| Pearson ( ) | AUSE ( ) | UCE ( ) | Pearson ( ) | AUSE ( ) | UCE ( ) | ||
| Aleatoric | 0.001 | 0.527 ± 0.002 | 0.010 ± 0.000 | 0.034 ± 0.014 | 0.528 ± 0.001 | 0.012 ± 0.000 | 0.064 ± 0.016 |
| 0.0001 | 0.528 ± 0.006 | 0.010 ± 0.000 | 0.045 ± 0.018 | 0.527 ± 0.002 | 0.012 ± 0.000 | 0.049 ± 0.005 | |
| 0.00001 | 0.529 ± 0.002 | 0.010 ± 0.000 | 0.037 ± 0.017 | 0.529 ± 0.002 | 0.012 ± 0.000 | 0.076 ± 0.011 | |
| Epistemic | 0.001 | 0.423 ± 0.004 | 0.018 ± 0.000 | 0.264 ± 0.012 | 0.455 ± 0.010 | 0.018 ± 0.000 | 0.205 ± 0.009 |
| 0.0001 | 0.416 ± 0.005 | 0.018 ± 0.001 | 0.266 ± 0.007 | 0.449 ± 0.005 | 0.019 ± 0.000 | 0.226 ± 0.003 | |
| Uncertainty | Error | Set5 | Set14 | ||
|---|---|---|---|---|---|
| Spearman ( ) | Pearson ( ) | Spearman ( ) | Pearson ( ) | ||
| Aleatoric | 0.643 ± 0.002 | 0.560 ± 0.001 | 0.607 ± 0.002 | 0.569 ± 0.001 | |
| 0.647 ± 0.002 | 0.487 ± 0.003 | 0.611 ± 0.002 | 0.514 ± 0.004 | ||
| Epistemic | 0.229 ± 0.007 | 0.258 ± 0.005 | 0.312 ± 0.006 | 0.327 ± 0.005 | |
| 0.229 ± 0.008 | 0.209 ± 0.005 | 0.312 ± 0.006 | 0.254 ± 0.003 | ||
| Uncertainty | Error | Set5 | Set14 | ||
|---|---|---|---|---|---|
| AUSE ( ) | UCE ( ) | AUSE ( ) | UCE ( ) | ||
| Aleatoric | 0.009 ± 0.000 | 0.034 ± 0.007 | 0.011 ± 0.000 | 0.017 ± 0.008 | |
| 0.002 ± 0.000 | 0.358 ± 0.004 | 0.002 ± 0.000 | 0.269 ± 0.021 | ||
| Epistemic | 0.026 ± 0.000 | 0.320 ± 0.004 | 0.023 ± 0.000 | 0.231 ± 0.005 | |
| 0.005 ± 0.000 | 0.420 ± 0.001 | 0.004 ± 0.000 | 0.411 ± 0.001 | ||
| Operation | Training Time (s) | Testing Time (s) |
|---|---|---|
| CUPID | 4776.38 | 10.06 |
| MC Dropout | / | 49.57 |
| Rate-in | 2.85 | 48.46 |
| IGRUE | 5292.41 | 11.26 |
| PostNet | 49932.08 | 51.04 |
| BNN | 54974.84 | 217.06 |
| Operation | Training Time (s) | Testing Time (s) |
|---|---|---|
| CUPID | 26511.74 | 1.02 |
| BayesCap | 81158.45 | 0.79 |
| in-rotate | / | 2.03 |
| in-noise | / | 2.86 |
| med-dropout | / | 2.28 |
| med-noise | / | 2.47 |
Uncertainty Quantification
Uncertainty quantification estimates how reliable predictions and scientific inferences are, and how uncertainty propagates into decisions.
See all 649 papers