Certifying Confidence via Randomized Smoothing

Aounon Kumar, Alexander Levine, Soheil Feizi, Tom Goldstein

TL;DR

Standard randomized smoothing tells us how far an input can be perturbed before its label changes, but it ignores how confident the model is in that prediction. This paper introduces a method to certify a radius within which a classifier’s prediction confidence (measured by average score or margin) is guaranteed to stay above a specific threshold. By leveraging the full distribution of prediction scores, the proposed method achieves much tighter bounds than previous naive approaches.

The Problem: Robustness Without Confidence

Deep neural networks are notoriously fragile; tiny, invisible "adversarial" tweaks to an image can easily flip a model's prediction. Randomized smoothing has emerged as a popular defense mechanism that makes models robust by adding Gaussian noise to an input and taking a "majority vote" of the resulting predictions to determine the final class.

However, standard randomized smoothing is inherently "lossy." It treats every vote as a binary 0 or 1. Whether a model predicts a class with 51% certainty or 99% certainty, the smoothing process records it as a single, equal vote for that class.

In high-stakes fields like medicine or autonomous driving, knowing the confidence of a prediction is just as important as the prediction itself. A model might have a large "certified radius" (meaning the label won't change easily under perturbation), but if its internal confidence is paper-thin, it may not be trustworthy. This paper fills that critical gap by providing a mathematical guarantee for the confidence score itself.

Methods: Certifying Confidence

The authors propose moving beyond binary voting to evaluate average prediction scores. They explore two specific measures of confidence:

  1. Average Prediction Score: The expected softmax output for a class under Gaussian noise.
  2. Margin: The gap between the average score of the top predicted class and the runner-up.
Illustration of the prediction margin

To certify these confidence measures, the researchers introduce two approaches:

  • The Baseline (Naive) Method: This approach uses the average confidence over the Gaussian distribution and applies Hoeffding’s inequality to bound how much that average can change when the input is perturbed. While it is a straightforward extension of existing work, it is mathematically "loose" and yields suboptimal radii.
  • The CDF-Based Certificate (Proposed): This is the core innovation of the paper. Instead of just looking at the mean score, the authors analyze the entire Cumulative Distribution Function (CDF) of the scores. By using the Dvoretzky–Kiefer–Wolfowitz (DKW) inequality, they can bound the entire distribution of scores. They then adapt the Neyman-Pearson lemma—the fundamental theorem used in standard randomized smoothing—to work with these continuous distributions rather than binary votes.
Comparison of Naive and CDF-based smoothing classifiers

By utilizing the full distributional information (knowing exactly how many samples had high versus low confidence), the CDF-based method can calculate a much larger, tighter radius where the confidence is guaranteed to remain high.

Key Insights

  • Radius $\neq$ Confidence: One of the most striking findings is that in standard models, the certified radius (how hard it is to change the label) correlates very little with the model's confidence. An image can be "robust" against label changes while the model remains totally unsure about it, or vice versa.
  • Don't Throw Away Data: The "aha moment" of this research is that binary voting discards valuable information. If a model predicts a class with 0.99 confidence across many noisy samples, that is a much stronger signal than if it predicts the same class with 0.51 confidence, even if the final "majority vote" looks identical.
  • The "Flat" Classifier Case: The authors point out a theoretical edge case: if a classifier always returns a score of 0.55, its average score will always be 0.55 regardless of the perturbation. A naive method would give this a tiny certified radius, but the CDF-based method correctly identifies that the confidence is perfectly stable, yielding an infinite certified radius for that specific confidence level.

Experimental Results

The researchers evaluated their method using standard computer vision benchmarks, including CIFAR-10 (using ResNet-110) and ImageNet (using ResNet-50), specifically trained for randomized smoothing.

  • Significant Gains in Accuracy: The CDF-based method consistently outperformed the naive baseline. For example, on CIFAR-10 at a perturbation radius of 0.25, the certified accuracy for a confidence threshold of 0.7 was significantly higher using the CDF method compared to the baseline.
  • Tightness: The authors proved mathematically that their bounds are "tight" for $\ell_2$ perturbations. This means you cannot find a better bound without extracting more specific information about the base classifier.
  • Scalability: Because the method relies on binary search and standard statistical inequalities, it scales easily to large datasets like ImageNet without introducing massive computational overhead compared to standard smoothing.

Limitations and Future Work

The authors honestly note a few limitations. Most importantly, while they can certify the score the model gives, they cannot guarantee that the score represents the true probability of being correct (calibration). If a model is "confident but wrong," this method will simply certify that misplaced confidence. Additionally, the quality of the certificate is heavily dependent on the underlying base classifier; if the base model is noisy or inconsistent, the certified radii will naturally be small.

Looking forward, the authors suggest that incorporating more information—such as the spatial distribution of votes or other specific properties of the base classifier—could lead to even stronger certificates. Ultimately, this work paves the way for more interpretable and reliable "risk scores" for AI systems deployed in the real world.

Summary updated

BibTeX
@inproceedings{kumar2020certifying,
  author = {Aounon Kumar and Alexander Levine and Soheil Feizi and Tom Goldstein},
  title = {{Certifying Confidence via Randomized Smoothing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=yLGv5FHumOH},
}
Figure