Stochastic Nonlinearities Improve Uncertainty Estimation
Organizations: NeuraVision Lab, Bilkent University Ankara, Turkey
Abstract
Reliable uncertainty estimation is important across visual recognition tasks, providing information about the confidence and reliability of model predictions. Many uncertainty estimation methods obtain predictive diversity through mechanisms that can suppress intermediate features, perturb the input, or require substantial additional computation. Stochastic activation functions, where network units randomly select between multiple nonlinearities during a forward pass, have previously been used to improve optimization behavior, mitigate limitations of fixed ReLU activations, and increase output diversity. In this work, we reframe stochastic activation switching as a lightweight mechanism for uncertainty estimation. The proposed method samples between nonlinear activation functions, inducing predictive diversity while keeping intermediate feature pathways active. This enables uncertainty estimation from a single trained model without the training cost of ensembles, task-specific uncertainty heads, or architectural redesign. We evaluate the proposed approach across classification, semantic segmentation, and out-of-distribution detection using convolutional and transformer-based architectures on diverse datasets. Across these settings, stochastic activation switching improves uncertainty quality while preserving competitive primary-task performance, showing that stochastic nonlinearities provide an effective and information-preserving source of predictive variation for visual recognition.
Figures & tables
| Dataset | Method | Correct. (↑) | Complete. (↑) | Qual. (↑) | F1 (↑) |
|---|---|---|---|---|---|
| Massachusetts | MC Dropout | 91.00 | 87.20 | 81.90 | 78.62 |
| DDU | 91.44 | 86.10 | 80.52 | 79.23 | |
| TTA | 91.46 | 86.73 | 81.19 | 79.43 | |
| Masksembles | 81.63 | 87.67 | 81.94 | 80.02 | |
| Deep Ensemble | 92.37 | 88.11 | 82.67 | 80.54 | |
| Laplace Redux | 91.45 | 86.11 | 80.52 | 79.23 |
| Dataset | Method | Corr. (↑) | ECE (↓) | Brier (↓) | Train | Infer |
|---|---|---|---|---|---|---|
| Massachusetts | MC Dropout | 79.73 | 0.026 | 0.033 | ||
| DDU | 75.64 | 0.027 | 0.031 | – | ||
| TTA | 79.90 | 0.025 | 0.029 | |||
| Masksembles | 79.62 | 0.024 | 0.031 | |||
| Deep Ensemble | 80.03 | 0.024 | 0.027 | |||
| Laplace Redux | 77.51 | 0.034 | 0.034 | – |
| Method | Mass. RoadTracer | DRIVE CHASE | CREMI ISBI | |||
|---|---|---|---|---|---|---|
| AUROC (↑) | AUPR (↑) | AUROC (↑) | AUPR (↑) | AUROC (↑) | AUPR (↑) | |
| MC Dropout | 53.07 | 48.51 | 82.21 | 53.07 | 87.34 | 94.64 |
| DDU | 54.63 | 52.54 | 85.99 | 61.77 | 88.79 | 94.82 |
| TTA | 55.05 | 56.62 | 89.94 | 67.31 | 93.10 | 94.88 |
| Masksembles | 54.00 | 51.91 | 86.35 | 64.51 | 87.72 | 94.14 |
| Deep Ensemble | 57.32 | 57.85 | 89.56 | 66.33 | 85.73 | 94.69 |
| Dataset | Method | Acc (↑) | ECE (↓) | Brier (↓) | AUC (↑) | AUPR (↑) | FPR95 (↓) |
|---|---|---|---|---|---|---|---|
| CIFAR-10 | MC Dropout | 93.54 | 0.011 | 0.094 | 84.22 | 87.36 | 27.10 |
| DDU | 94.12 | 0.018 | 0.090 | 85.20 | 89.26 | 24.11 | |
| TTA | 94.23 | 0.011 | 0.083 | 93.64 | 97.29 | 17.97 | |
| Masksembles | 94.61 | 0.011 | 0.080 | 91.69 | 92.88 | 18.47 | |
| Deep Ensemble | 94.94 | 0.009 | 0.074 | 91.92 | 93.15 | 14.70 | |
| Laplace Redux | 93.83 | 0.090 | 0.103 | 92.60 | 94.98 | 18.83 |
| Granularity | Acc. (↑) | NLL (↓) | ECE (↓) | Brier (↓) |
|---|---|---|---|---|
| Layer-level | 93.04 | 0.204 | 0.005 | 0.101 |
| Channel-level | 93.66 | 0.200 | 0.009 | 0.094 |
| Node-level | 94.68 | 0.162 | 0.009 | 0.088 |
| Activation Pair | Acc. (↑) | NLL (↓) | ECE (↓) | Brier (↓) |
|---|---|---|---|---|
| ReLU + Tanh [ LeCun et al.(2002)LeCun, Bottou, Orr, and Müller ] | 94.43 | 0.176 | 0.008 | 0.085 |
| ReLU + SiLU [ Elfwing et al.(2018)Elfwing, Uchibe, and Doya ] | 94.68 | 0.162 | 0.009 | 0.088 |
| ReLU + GELU [ Hendrycks(2016) ] | 94.12 | 0.184 | 0.012 | 0.095 |
| ReLU + Mish [ Misra(2020) ] | 93.98 | 0.192 | 0.014 | 0.101 |
| ReLU + ELU [ Clevert et al.(2016)Clevert, Unterthiner, and Hochreiter ] | 93.67 | 0.206 | 0.018 | 0.109 |
| Passes | Accuracy (↑) | NLL (↓) | ECE (↓) | Brier (↓) | Time (s) |
|---|---|---|---|---|---|
| 1 | 93.81 | 0.223 | 0.026 | 0.096 | 3.11 |
| 3 | 94.26 | 0.186 | 0.013 | 0.085 | 7.06 |
| 5 | 94.68 | 0.162 | 0.009 | 0.088 | 11.06 |
| 10 | 94.37 | 0.176 | 0.007 | 0.082 | 20.99 |
| Backbone | Dataset | Optimizer | Batch | LR / schedule | Epochs |
|---|---|---|---|---|---|
| U-Net | Massachusetts | Adam [ Diederik(2014) ] | 32 | , cosine | 200 |
| U-Net | DRIVE | Adam | 8 | , cosine | 200 |
| U-Net | LiTS | Adam | 64 | , cosine | 200 |
| Swin-V2 | CREMI | AdamW [ Loshchilov and Hutter(2017) ] | 32 | 200 | |
| ResNet-18 | CIFAR-10 | SGD ( ) | 256 | , cosine | 200 |
| ResNet-50 | MiniImageNet | SGD ( ) | 128 | , cosine | 200 |
| Method | Training Time (s) | Inference Time (s) |
|---|---|---|
| Deterministic | 40.05 | 2.83 |
| MC Dropout | 40.97 | 13.66 |
| DDU | 49.93 | 2.86 |
| TTA | 40.05 | 18.43 |
| Masksembles | 43.30 | 3.16 |
| Deep Ensemble | 194.52 | 13.27 |
| Method | Massachusetts | DRIVE | LiTS | CREMI | ||||
|---|---|---|---|---|---|---|---|---|
| Train | Infer. | Train | Infer. | Train | Infer. | Train | Infer. | |
| Deterministic | 54.41 | 1.52 | 37.30 | 24.30 | 28.27 | 10.98 | 36.98 | 9.22 |
| MC Dropout | 54.54 | 4.46 | 38.28 | 140.43 | 32.92 | 55.78 | 39.27 | 52.90 |
| DDU | 74.41 | 3.01 | 51.70 | 26.40 | 48.38 | 11.09 | 52.45 | 9.36 |
| Masksembles | 57.91 | 1.90 | 39.40 | 29.60 | 33.73 | 12.51 | 37.64 | 12.51 |
| Deep Ensemble | 261.79 | 4.25 | 214.74 | 135.11 | 103.84 | 54.47 | 189.48 | 49.42 |
| Severity | Method | Acc. (↑) | NLL (↓) | ECE (↓) | Brier (↓) |
|---|---|---|---|---|---|
| 1 | MC Dropout | 82.95 | 0.517 | 0.015 | 0.243 |
| Deep Ensemble | 84.96 | 0.486 | 0.042 | 0.220 | |
| TTA | 29.20 | 3.030 | 0.401 | 1.019 | |
| Laplace Redux | 28.29 | 2.315 | 0.213 | 0.872 | |
| Ours | 83.96 | 0.521 | 0.040 | 0.217 | |
| 3 | MC Dropout | 43.89 | 1.889 | 0.184 | 0.756 |
Uncertainty Quantification
Uncertainty quantification estimates how reliable predictions and scientific inferences are, and how uncertainty propagates into decisions.
See all 652 papers