NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Data Dependent Randomized Smoothing

Motasem Alfarra, Adel Bibi, Philip Torr, Bernard Ghanem

Abstract

Randomized smoothing is a leading technique for training certifiably robust deep neural networks. Traditionally, the parameters of the smoothing distribution (e.g., the variance $\sigma$ of a Gaussian) are set as global hyperparameters, independent of the input data. This work introduces Data-Dependent Randomized Smoothing (DDRS), a framework that optimizes the smoothing parameters for each individual input to maximize the certification radius. To overcome the theoretical challenges of input-dependent noise, we propose a memory-enhanced classifier that ensures mathematical soundness by construction. Our approach is parameter-free and easily integrates into existing smoothing pipelines, yielding significant improvements in certified accuracy on CIFAR-10 and ImageNet.

The Problem: One-Size-Fits-All Noise

Deep Neural Networks (DNNs) are vulnerable to adversarial attacks—small, intentional perturbations that cause misclassification. Randomized smoothing mitigates this by classifying the expected output of a model under random noise. This process yields a "certified radius" within which the prediction is guaranteed to remain constant.

However, standard methods use a fixed noise level ($\sigma$) for every image. This is inherently suboptimal. An image far from the decision boundary (an "easy" case) could tolerate higher noise to achieve a much larger safety radius. Conversely, an image near the boundary (a "hard" case) requires low noise to avoid being pushed across the boundary and misclassified. A global $\sigma$ forces a compromise that under-certifies easy images and risks misclassifying hard ones.

Transitioning from a fixed global noise level $\sigma$ to data-dependent noise levels $\sigma_x$ allows for larger certification radii for easy inputs while maintaining accuracy for those near decision boundaries.

Methodology

Per-Input Optimization

DDRS treats $\sigma$ as a local parameter to be optimized for each input $x$. Using stochastic gradient ascent and the reparameterization trick, the framework finds the optimal $\sigma^*$ that maximizes the theoretical certification radius. This "sweet spot" balances the noise level with the prediction gap (the margin between the top class and the runner-up).

Memory-Enhanced Certification

A significant challenge arises when $\sigma$ depends on the input: the standard proofs for randomized smoothing soundness no longer hold. If two different inputs have overlapping certified regions but different labels, the mathematical guarantee is violated.

To resolve this, we introduce a memory-based classifier. This system maintains a record of previously certified regions. When a new input is processed, the algorithm checks for overlaps with existing regions. If a conflict occurs (different labels in overlapping space), the regions are "clipped" or adjusted to ensure they remain disjoint and consistent. This restores the mathematical validity of the certificates.

To maintain mathematical soundness, the memory-enhanced classifier adjusts overlapping certified regions with conflicting labels, ensuring no point in space is assigned two different guaranteed classes.

Data-Dependent Training ($DS^2$)

Beyond inference, we integrate optimized noise levels into the training loop. By training models (e.g., MACER or SmoothAdv) with varying, data-dependent noise, the network learns to be robust across a wider spectrum of perturbations.

Key Results and Impact

Our framework was evaluated on CIFAR-10 and ImageNet, demonstrating that data-dependent noise consistently outperforms fixed-noise baselines:

  • Certified Accuracy: DDRS achieved a 9% improvement on CIFAR-10 and a 6% improvement on ImageNet for a radius of 0.5 compared to the strongest baselines.
  • Average Certified Radius (ACR): The overall "safety zone" increased significantly. On CIFAR-10, the ACR rose from 0.591 to 0.784.
  • Generality: The framework is distribution-agnostic, showing success with both $\ell_2$ (Gaussian) and $\ell_1$ (Uniform) certificates.

Conclusion

Data-Dependent Randomized Smoothing shifts the paradigm from global hyperparameter tuning to local, input-specific optimization. While it introduces a modest computational overhead for $\sigma$ optimization, the gains in certified robustness are substantial. DDRS provides a plug-and-play framework that can immediately upgrade the performance of existing randomized smoothing models, making them more resilient and reliable for real-world deployment.

Summary updated

BibTeX
@inproceedings{alfarra2022data,
  author = {Motasem Alfarra and Adel Bibi and Philip Torr and Bernard Ghanem},
  title = {{Data Dependent Randomized Smoothing}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=rbNL4ILsqeq},
}
Figure