Improving the Robustness of Deep Neural Networks via Stability Training

Stephan Zheng, Yang Song, Thomas Leung, Ian J. Goodfellow

TL;DR

This paper introduces "stability training," a novel method to make deep neural networks more robust to common image distortions like compression and resizing. By training networks to produce consistent outputs for slightly altered inputs, they achieve state-of-the-art performance on tasks like near-duplicate detection and image classification, even on noisy, real-world datasets.

What Problem Does This Paper Address?

Deep neural networks have achieved remarkable success in computer vision tasks. However, their performance can be surprisingly brittle. Even imperceptible changes to an input image, often introduced by common image processing techniques like JPEG compression, resizing, or cropping, can drastically alter the network's output (e.g., its feature embeddings or predicted class). This "output instability" is a significant hurdle for deploying these models on large-scale, uncurated datasets, where such distortions are ubiquitous. For instance, distinguishing near-duplicate images becomes challenging when a slight compression can make two visually identical images appear very different to the network.

Methods

The core contribution is stability training, a general technique to improve model robustness. It works by adding a stability objective to the standard training loss. This objective encourages the network's output (e.g., feature embeddings or class probabilities) to remain consistent between an original input image ($x$) and a slightly perturbed version of it ($x'$).

The key aspects of their method are:

  • Stability Objective: The stability loss ($L_{stability}$) directly measures the difference between the network's outputs for $x$ and $x'$. For feature embeddings, this is often an L2 distance; for classification, it's KL-divergence between probability distributions.
  • Perturbation Generation: Instead of relying on carefully curated "adversarial examples," they use a general approach of adding pixel-wise uncorrelated Gaussian noise to the input image. This simulates a broad range of natural distortions.
  • Preventing Underfitting: Crucially, they do not re-evaluate the original task loss ($L_o$) on the perturbed images ($x'$). This prevents the model from "forgetting" how to perform the original task and avoids the underfitting sometimes seen with standard data augmentation. The stability loss is applied to $x'$ while the original loss is applied to $x$.

Datasets

  • Training: The paper mentions using training data from ImageNet for classification and data from [13] for feature embeddings used in near-duplicate detection and similar-image ranking.
  • Evaluation:
    • Near-duplicate detection and Similar-image ranking: Evaluated on datasets constructed from Google Image Search queries, including pairs of near-duplicates (original and distorted versions) and dissimilar images. Distortions include JPEG compression, thumbnail resizing, and random cropping.
  • Image Classification: Evaluated on the ImageNet dataset (1,000 classes, 1.2 million images), specifically using a JPEG-50 version of the validation set.

Key Insights and Ideas

  • Natural Distortions are the Real Problem: The paper convincingly argues that the instability observed with contrived "adversarial examples" also occurs naturally due to common image processing. This shifts the focus from purely academic attacks to practical robustness.
  • Gaussian Noise as a General Perturbation: Using simple Gaussian noise for perturbation generation proved surprisingly effective. It acts as a proxy for a wide range of natural distortions, leading to improved robustness across different types of corruptions.
  • The Importance of Not Re-evaluating $L_o$ on Perturbed Data: This is a critical methodological insight. By separating the original task loss from the stability loss's application to perturbed data, they achieve both robustness and maintain high performance on the original task, avoiding the common pitfall of data augmentation leading to underfitting.
  • Stability Training is Task-Agnostic: The method is presented as a general technique that can be applied to various network architectures and tasks (classification, ranking, detection) by simply adjusting the distance metric ($D$) and the original loss ($L_o$).

Key Results

  • Near-Duplicate Detection: Stabilized features significantly improved precision across various distortions (thumbnail resizing, JPEG compression, random cropping), increasing recall by up to 3.0% at high precision levels.
  • Similar Image Ranking: Stability training improved ranking scores on both original and distorted datasets, with stabilized models outperforming baseline models even on the original, undistorted data.
  • Image Classification (ImageNet): While performance on the original ImageNet dataset was comparable, stabilized models showed significantly higher precision on distorted (JPEG-50) versions, with performance gaps of 5-6% in top-1 and top-5 precision at higher distortion levels.
  • Qualitative Results: Visualizations showed that stabilized features were much more consistent for near-duplicate pairs that were previously confused by baseline models.

Limitations and Future Work

  • Computational Cost: Stability training effectively doubles the batch size during the forward pass, increasing computational cost. The authors mitigate this by fine-tuning only the final layers or starting stability training in a fine-tuning phase.
  • Hyperparameter Tuning: The method introduces new hyperparameters (regularization coefficient $\alpha$, noise standard deviation $\sigma$) that require tuning, for which they provide search ranges.
  • Future Work: The paper implicitly suggests exploring other types of natural perturbations and further investigating the theoretical underpinnings of why stability training is so effective. The general applicability of the method also opens doors for its use in many other computer vision and machine learning domains.

Summary updated

BibTeX
@inproceedings{zheng2016improving,
  author = {Stephan Zheng and Yang Song and Thomas Leung and Ian J. Goodfellow},
  title = {{Improving the Robustness of Deep Neural Networks via Stability Training}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2016},
  doi = {10.1109/cvpr.2016.485},
}
Figure