Early-Exit with Class Exclusion for Efficient Inference of Neural Networks

Jingcun Wang, Bing Li, Grace Li Zhang

TL;DR

This paper introduces a novel "class-exclusion early-exit" strategy for deep neural networks (DNNs) that significantly reduces computational cost during inference. By intelligently pruning irrelevant classes at intermediate layers, the network can make faster, more efficient decisions without sacrificing much accuracy.

What Problem Does This Paper Address?

Deep neural networks (DNNs) are incredibly powerful but computationally expensive, requiring a massive number of multiply-accumulate (MAC) operations. This makes deploying them on resource-constrained devices like edge devices a significant challenge. While "early-exit" strategies aim to reduce computation by allowing networks to make decisions at intermediate layers, they often discard previous computations if an early decision isn't made. This paper addresses the inefficiency of existing early-exit methods by proposing a way to leverage the learned features in earlier layers to actively exclude irrelevant classes, thereby narrowing down the possibilities for subsequent layers and enabling earlier, more confident exits.

Methods

The core innovation is the class-exclusion early-exit strategy. Instead of just deciding if a decision can be made at an early layer, this method focuses on deciding which classes are no longer plausible.

Here's how it works:

  • Class-Exclusion Networks: For each intermediate layer, small, fully-connected networks are trained. These networks take compressed feature maps (using global average pooling) and output a probability for each class using a Sigmoid activation function. This allows each class to be evaluated independently.
  • Class-Exclusion Aware Training: The backbone DNN is trained not only on its primary task but also to optimize these class-exclusion networks. A modified loss function combines the standard cross-entropy loss with losses from the class-exclusion networks.
  • Dynamic Class Exclusion: At each exit point, a dynamic threshold (based on the maximum Sigmoid output and a learned coefficient β) is used to identify and exclude irrelevant classes. A crucial feature is the "recovery" mechanism: if a class is excluded but later turns out to be the most probable, it's brought back into consideration. This prevents premature exclusion of the true target class.

Datasets

The proposed framework was evaluated on the following datasets:

  • CIFAR-10: A dataset with 10 classes.
  • CIFAR-100: A dataset with 100 classes.

Key Insights and Ideas

  • Leveraging "Negative" Information: The key insight is that early layers don't just learn features for positive identification but also learn features that strongly indicate a class is not present. This "negative" information is powerful for pruning the search space.
  • Independent Class Evaluation: Using Sigmoid activation for class-exclusion networks allows each class to be evaluated independently, avoiding the interdependencies inherent in SoftMax, which can lead to more robust exclusion.
  • Dynamic Thresholding: The use of a dynamic threshold (βx) makes the exclusion process adaptive to the confidence of the network at different layers and for different classes.
  • Class Difficulty Revealed: The experiments show that some classes are consistently excluded earlier than others, providing insights into their inherent difficulty and how easily they can be distinguished by early-layer features.

Key Results

  • Significant Computational Reduction: The proposed method achieved substantial reductions in computational cost. For example, ResNet50 on CIFAR100 saw a 33.06% reduction in FLOPs.
  • Minimal Accuracy Loss: Despite significant speedups, the accuracy drop was minimal. For instance, AlexNet on CIFAR10 only dropped from 90.54% to 89.34%.
  • Effective Early Exits: Figure 4 shows that a considerable number of images can be classified at intermediate exit points, demonstrating the effectiveness of the early-exit strategy.
  • High Class Exclusion Rates: Figure 6 indicates that a large number of classes can be excluded even at early layers, with some networks excluding up to 75 classes dynamically at the first exit point.

Limitations and Future Work

  • Accuracy Trade-off: While minimal, there is a slight accuracy degradation associated with the proposed method.
  • Search for Optimal β: The paper describes a search algorithm for the optimal class-exclusion coefficient (β), which adds a computational overhead during the training/tuning phase.
  • Future Work: The authors suggest that further research could explore more sophisticated class-exclusion network architectures or more advanced search strategies for the optimal β. The potential to apply this to other dynamic inference techniques is also implied.

Summary updated

BibTeX
@inproceedings{wang2024early,
  author = {Jingcun Wang and Bing Li and Grace Li Zhang},
  title = {{Early-Exit with Class Exclusion for Efficient Inference of Neural Networks}},
  booktitle = {AICAS},
  year = {2024},
  doi = {10.1109/aicas59952.2024.10595861},
}
Figure