Improved Techniques for Training Adaptive Deep Networks

Hao Li, Hong Zhang, Xiaojuan Qi, Ruigang Yang, Gao Huang

TL;DR

Adaptive deep networks save computation by allowing "easy" images to exit early through intermediate classifiers, but training them jointly introduces gradient conflicts and missed opportunities for collaboration. This paper introduces three model-agnostic training techniques—Gradient Equilibrium, Inline Subnetwork Collaboration, and One-for-all Knowledge Distillation—that significantly improve the accuracy-efficiency tradeoff of multi-exit networks across major image benchmarks.

What Problem Does This Paper Address?

Standard deep neural networks use the same amount of computation for every input, whether it is a crystal-clear, obvious image or a highly blurred, ambiguous one. Adaptive inference solves this inefficiency by dynamically adjusting the network's structure per input, typically by embedding multiple "early exits" (intermediate classifiers) throughout the network.

However, training these multi-exit models effectively is notoriously difficult due to two main challenges:

  1. Gradient Conflicts: Jointly optimizing multiple classifiers leads to an imbalance where early and late classifiers interfere with each other's learning objectives, causing high gradient variance and unstable training.
  2. Lack of Collaboration: Intermediate classifiers are traditionally trained in isolation, failing to share predictive insights or leverage the superior representations of deeper layers during the training process.

Methods

The authors propose three orthogonal techniques to optimize the training of multi-exit networks, illustrated in the overview below:

Figure 1. Overview of the proposed training strategies for adaptive inference on a deep convolutional network. Gradient Equilibrium (GE) is applied to resolve the gradients conflict among different exits. Inline Subnetwork Collaboration (ISC) and One-for-all Knowledge Distillation (OFA) are proposed to enhance the collaboration of different classifiers.
  • Gradient Equilibrium (GE): To prevent gradient variance from exploding as backward passes accumulate through overlapping subnetworks, GE introduces gradient re-scaling modules. This stabilizes training by ensuring gradients maintain a constant, bounded scale across the entire network.
  • Inline Subnetwork Collaboration (ISC): A forward knowledge transfer mechanism where the prediction logits of an early classifier are passed directly to the subsequent classifier as a prior. This allows later exits to perform residual learning on top of earlier predictions.
  • One-for-all Knowledge Distillation (OFA): A backward knowledge transfer mechanism. Because the final, deepest classifier has the highest capacity and accuracy, it acts as an online teacher, distilling its soft class probabilities into all intermediate "student" exits using Kullback-Leibler (KL) divergence.

Datasets

The methods were evaluated using the state-of-the-art Multi-Scale Dense Network (MSDNet) architecture on three standard image classification benchmarks:

  • CIFAR-10: 50,000 training and 10,000 test images across 10 classes.
  • CIFAR-100: 50,000 training and 10,000 test images across 100 classes.
  • ImageNet (ILSVRC 2012): A large-scale dataset containing 1.2 million training images and 50,000 validation images across 1,000 classes.

No new datasets or benchmarks were introduced in this work.

Key Insights and Ideas

  • The Gradient Tug-of-War: Jointly training multiple exits creates a complex backward graph. Without normalization, early layers get overwhelmed by accumulated gradients from later exits. Bounding this scale via GE drastically stabilizes convergence and improves final accuracy.
  • Cooperative Exits: Instead of treating intermediate classifiers as independent bystanders, passing predictions forward (ISC) and distilling knowledge backward (OFA) forces the network to act as a cohesive ensemble rather than a collection of competing heads.
  • Self-Distillation Efficiency: Using the network's own deepest layer as a teacher eliminates the need to train a separate, cumbersome teacher model beforehand, making the distillation process highly efficient and entirely online.

Key Results

When integrated into MSDNet, the proposed techniques consistently improved the accuracy-speed tradeoff across all computational budgets:

  • Computation Reductions: On CIFAR-100, the proposed approach achieved the same accuracy as a standard static DenseNet while requiring half the computation, and matched ResNet performance using only 1/3 of the computation.
  • Accuracy Boosts: On ImageNet, given a fixed computational budget ($1 \times 10^8$ FLOPs), the method improved top-1 accuracy by approximately 0.5% over the baseline MSDNet and outperformed standard static ResNet and DenseNet models by more than 6%.

The performance gains on CIFAR-10 across various average computational budgets are highlighted in the figure below:

Figure 2. Accuracy (top-1) of budgeted batch classification as a function of average computational budget per image on the CIFAR-10.

Limitations and Future Work

While the proposed techniques are model-agnostic, this study focused primarily on multi-exit architectures (specifically MSDNet) evaluated on image classification tasks.

The authors suggest two main directions for future research:

  1. Alternative Adaptive Architectures: Extending these training strategies to other forms of adaptive inference, such as spatially adaptive networks where computational budgets vary across different regions of an individual image.
  2. Broader Vision Tasks: Applying these techniques beyond classification to more complex computer vision challenges, including object detection, semantic segmentation, and image generation.

Summary updated

BibTeX
@misc{li2019improved,
  author = {Hao Li and Hong Zhang and Xiaojuan Qi and Ruigang Yang and Gao Huang},
  title = {{Improved Techniques for Training Adaptive Deep Networks}},
  year = {2019},
  eprint = {1908.06294},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.06294},
}
Figure