arXiv:2610.29875cs.CVOct 2026

Manuscript Offprint

arXiv:2610.29875

Stochastic Nonlinearities Improve Uncertainty Estimation

Mohammad Sarhangzadeh, Amirreza M. Shebly, Doruk Oner

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.

Introduction

Deep neural networks (DNNs) [☐] have driven major advances in computer vision, achieving state-of-the-art performance across image classification [☐], object detection [☐], semantic segmentation, and dense prediction tasks [☐, ☐]. Despite this progress, vision models frequently produce overconfident and poorly calibrated predictions [☐], even when confronted with ambiguous inputs, corrupted samples, or out-of-distribution data [☐]. This inability to reliably “know what it does not know” remains an obstacle to deploying deep learning systems in real-world visual recognition pipelines, where overconfident errors can lead to unreliable downstream decisions. Uncertainty estimation addresses this limitation by augmenting predictions with confidence measures that help identify unreliable outputs [☐].

© 2026. The copyright of this document resides with its authors. It may be distributed unchanged freely in print or electronic forms.

Figure

Figure 1: Uncertainty from stochastic nonlinearities. Stochastic forward passes are shown for a network trained to predict road maps. Clear roads produce similar outputs and low variance, while ambiguous roads and road-like buildings produce higher variance.

However, obtaining uncertainty estimates that are accurate, well-calibrated, computationally efficient, and compatible with modern architectures remains a challenging problem [1][1].

A common strategy for uncertainty estimation is to generate multiple predictions for the same input and measure their disagreement. Deep ensembles [64][64] achieve this by training multiple independent models and are often considered a strong baseline for predictive uncertainty. However, training and storing multiple models is computationally expensive. Single-model alternatives such as Monte Carlo dropout [19][19] reduce this cost by injecting stochasticity into the network during inference. Nevertheless, dropout-based methods obtain diversity by randomly suppressing features, which can disrupt information flow and degrade the intermediate representations required for accurate classification or dense prediction. This trade-off motivates the need for uncertainty estimation mechanisms that can induce predictive diversity without disrupting learned feature representations.

Stochastic activation functions have previously been explored as a means to improve gradient flow, introduce regularization, and increase predictive diversity in deep networks. Instead of using a fixed nonlinearity for each neuron or layer, stochastic activation methods allow activation units to randomly select from a predefined set of nonlinear functions during each forward pass. Prior work has used this randomness to improve robustness, alleviate the dead-unit problem, and encourage more diverse network behavior [16,2,64][16, 2, 64]. However, these methods have primarily been studied from the perspective of optimization and regularization, rather than a mechanism for uncertainty estimation.

In this work, we reframe stochastic activation functions as a mechanism for uncertainty quantification. Our main observation is that stochastic switching of nonlinearities can introduce useful predictive variation while preserving the flow of information through the network. Rather than removing features, the method keeps intermediate representations available and perturbs the nonlinear transformation applied to them. As a result, a single trained model can produce multiple plausible outputs without discarding intermediate information.

(Fig. 1). This property is particularly relevant for image classification and semantic segmentation, where preserving semantic and spatial structure is important for reliable predictions.

We propose a simple framework for uncertainty estimation based on stochastic activation switching. The method does not require training multiple models or substantially redesigning the underlying architecture. In our experiments, we apply it to both convolutional networks and transformer-based [2][2] vision models to evaluate its applicability across different model classes. At inference time, repeated stochastic forward passes produce a distribution of predictions from a single set of learned weights, enabling uncertainty to be estimated from predictive disagreement. Because the stochasticity is introduced through activation selection rather than feature removal, the proposed approach provides an efficient alternative to feature-masking methods while avoiding the computational burden of explicit ensembles.

We evaluate the framework on classification and segmentation across diverse datasets, modalities, scales, and in- and out-of-distribution settings. We compare against common uncertainty baselines and analyze task performance and uncertainty quality, with ablations on stochastic activation and inference settings. Results show competitive predictive performance and strong uncertainty estimates from a single trained model.

The main contributions of this work are as follows: (i) We propose stochastic nonlinearities as a computationally efficient and information-preserving approach for uncertainty estimation in image classification and semantic segmentation. (ii) We show that the proposed single-model approach achieves competitive uncertainty calibration and predictive performance compared with commonly used uncertainty estimation baselines, while avoiding the cost of training multiple models. (iii) We conduct extensive experiments and ablation across small, medium, and large-scale datasets, different visual modalities, convolutional and transformer-family architectures, and both in-distribution and out-of-distribution settings.

References (61)