Certified Robustness to Label-Flipping Attacks via Randomized Smoothing

Elan Rosenfeld, Ezra Winston, Pradeep Ravikumar, J. Zico Kolter

TL;DR

This paper introduces a novel framework for pointwise certified robustness against data poisoning attacks. By applying randomized smoothing to the training process rather than just the test-time input, the authors create classifiers that come with a strict mathematical guarantee: their prediction for a specific test point will remain unchanged even if an adversary flips a certain number of labels in the training set.

The Threat of Data Poisoning

Machine learning models are notoriously vulnerable to data poisoning, where an attacker injects or modifies training data to manipulate the model's eventual behavior. While many heuristic defenses exist, they often fail against adaptive attackers who understand the defense mechanism.

Existing "certified" defenses—which provide mathematical guarantees of safety—typically focus on test-time attacks (like changing pixels in an image) or provide only population-level guarantees (e.g., "the average error won't exceed X"). This paper addresses the critical gap in pointwise certification for training-time attacks. It provides a guarantee for each individual prediction, ensuring it is robust against a worst-case adversary who can target that specific test point by flipping training labels.

Methodology: Smoothing the Training Pipeline

The authors leverage Randomized Smoothing (RS), a technique traditionally used to defend against test-time adversarial examples, and adapt it for the training phase.

  1. Smoothing the Training Procedure: Instead of adding noise to a test image, the authors "smooth" the learning algorithm itself. They treat the entire pipeline—training a model and then making a prediction—as a single function $\phi$ that takes training labels as input.
  2. Label Randomization: During training, labels are independently flipped with a probability $q$. The "smoothed" classifier $g$ is the majority vote of models trained on these noisy labels.
  3. Analytical Bounds via Linear Models: Standard RS requires expensive Monte Carlo sampling to estimate the majority vote. To make this tractable, the authors restrict the classifier $\phi$ to linear least-squares. Because the prediction of a linear model is a linear function of the labels, they can use the Chernoff inequality to derive a deterministic, analytical lower bound on the majority vote probability.
  4. Deterministic Certificates: Unlike previous work that provided probabilistic certificates (e.g., "robust with 99% confidence"), this method provides a truly deterministic certificate $r$—the exact number of training labels an attacker can flip without changing the prediction.

Datasets and Evaluation

The authors evaluated their approach on several standard benchmarks to demonstrate its versatility across domains:

  • MNIST 1/7: A binary classification subset of the handwritten digits dataset.
  • Full MNIST: The complete 10-class digit classification task.
  • CIFAR-10: A 10-class image dataset, using features extracted via SimCLR (unsupervised learning).
  • Dogfish: A binary classification challenge from ImageNet (dogs vs. fish), using features from a pre-trained ResNet-50.
  • IMDB Review Sentiment: A text dataset for binary sentiment analysis, using Word2Vec embeddings.

Key Insights

  • RS is a General Tool: The paper shows that Randomized Smoothing is a general framework for any binary-valued function, not just image classifiers. By viewing the training process as the function to be smoothed, they unlock a new class of defenses.
  • Linearity is a Feature, Not a Bug: While deep learning is the standard, the linear structure of least-squares classification allows for the derivation of closed-form, analytical certificates. This sidesteps the "sampling error" issues that plague other randomized smoothing methods.
  • Feature Engineering is the Bridge: To handle complex data like ImageNet or CIFAR-10 with linear models, the authors use transfer learning or unsupervised feature extraction. This demonstrates that you can have the power of deep features combined with the provable robustness of linear certificates.
  • Pointwise vs. Population Robustness: For sensitive applications (like loan approvals or parole decisions), population-level guarantees aren't enough. Every individual deserves a guarantee that their specific outcome wasn't manipulated by a malicious actor.

Key Results

The proposed defense demonstrates significant resilience against label-flipping attacks compared to undefended baselines.

Certified accuracy on Binary and Full MNIST datasets under varying label flip budgets.
  • MNIST Performance: On the MNIST 1/7 task, the model achieved a certified accuracy of 94.5% (compared to 99.1% for an undefended model), providing a high level of security with a relatively small "robustness tax" on accuracy. As shown in the figure above, the certified accuracy degrades gracefully as the number of label flips increases, whereas undefended models plummet rapidly.
  • Dogfish (ImageNet): An undefended model's accuracy could be reduced to less than 1% by a simple attack. The proposed certified model maintained 81.3% certified accuracy against an adversary flipping a significant number of labels.
  • Efficiency: Because the bounds are analytical, the algorithm's runtime complexity is only linearly higher than standard classification, making it much faster than sampling-based smoothing methods.
  • Multi-class Extension: The paper provides the first multi-class classification algorithm that is certifiably robust to label-flipping attacks.

Limitations and Future Work

  • Linear Model Constraint: The current analytical certificate relies on the classifier being a linear function of the labels (least-squares). While deep features help, the "training" part of the smoothed function must remain linear.
  • Label-Flipping Focus: While the framework is general, the specific implementation in this paper is tailored to label-flipping. Extending this to "clean-label" attacks (where inputs are subtly perturbed) or general data poisoning (where both inputs and labels change) is a suggested next step.
  • Computational Cost for Large $n$: Although more efficient than sampling, the method still incurs a linear cost relative to the number of training points for each test prediction, which could be a bottleneck for massive datasets.

Summary updated

BibTeX
@inproceedings{rosenfeld2020certified,
  author = {Elan Rosenfeld and Ezra Winston and Pradeep Ravikumar and J. Zico Kolter},
  title = {{Certified Robustness to Label-Flipping Attacks via Randomized Smoothing}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
}
Figure