Thanks for Nothing: Predicting Zero-Valued Activations with Lightweight Convolutional Neural Networks

Gil Shomron, Ron Banner, Moran Shkolnik, Uri Weiser

TL;DR

Researchers have developed a "Zero Activation Predictor" (ZAP) that uses lightweight CNNs to guess which neurons in a neural network will output a zero. By skipping the heavy math for these "nothing" values, they can slash computational costs by up to 40% with negligible impact on accuracy.

What Problem Does This Paper Address?

Modern Convolutional Neural Networks (CNNs) are computational gluttons, often requiring billions of multiply-accumulate (MAC) operations to process a single image. This translates directly to high power consumption and slower execution times on hardware.

However, a huge chunk of this work is essentially wasted. Because most CNNs use the ReLU activation function—which turns any negative value into a zero—roughly 50% of the activations in a typical network end up being zero. The authors argue that if we could predict which activations will be zero before doing the expensive convolution math, we could simply skip those calculations. The challenge is doing this prediction so efficiently that the "predictor" doesn't cost more than the math it's trying to save.

Methods

The authors propose a three-step dynamic prediction mechanism called ZAP:

  1. Partial Computation: Instead of computing the entire output feature map (OFM), the network only computes a small, pre-defined subset of pixels (e.g., a checkerboard pattern).
  2. Lightweight Prediction: A tiny, auxiliary CNN (the ZAP) looks at these sparsely computed pixels. Leveraging the fact that neighboring pixels in an image are usually similar (spatial correlation), it predicts which of the missing pixels are likely to be non-zero.
  3. Targeted Computation: The main network then computes only the pixels ZAP flagged as "probably non-zero," skipping the rest.
Illustration of the three-step ZAP process

The ZAP itself is incredibly lean, using depthwise convolutions that impose almost zero overhead. Crucially, ZAPs are trained in a "teacher-student" fashion: they learn to mimic the outputs of the original, un-pruned layers. This means training is label-free, parallelizable, and doesn't require modifying the original model's weights.

Datasets

The researchers evaluated their method using two standard computer vision benchmarks:

  • CIFAR-100: A dataset of small images across 100 classes.
  • ILSVRC-2012 (ImageNet): The industry-standard large-scale image classification dataset.

They tested ZAP across several popular architectures, including AlexNet, VGG-16, and ResNet-18.

Key Insights and Ideas

  • Spatial Correlation is Key: The core "aha" moment is that you don't need to see a pixel to guess its value if you know its neighbors. This allows for very sparse initial sampling (as low as 33% of the pixels).
  • Linear Error Accumulation: The authors proved, both mathematically and empirically, that for small errors, the total drop in model accuracy is linear relative to the sum of local prediction errors across layers. This makes it much easier to tune the system.
  • Tunable "Knobs": Unlike many pruning methods that require a full retrain for every new efficiency target, ZAP is tunable on-the-fly. By adjusting a threshold ($\sigma$), a user can trade a bit more accuracy for significantly more speed without touching the weights.
  • Smart Mispredictions: Interestingly, when ZAP does make a mistake (predicting a non-zero value as zero), it usually happens on very small activation values. This means ZAP naturally acts like a "magnitude-based" pruner, which is known to be effective for maintaining accuracy.
Linear relationship between misprediction error and accuracy decrease

Key Results

ZAP consistently outperformed previous state-of-the-art methods for dynamic activation pruning:

  • AlexNet on CIFAR-100: Achieved a 32.4% MAC reduction with only a 0.7% drop in top-1 accuracy. With a bit of fine-tuning, this improved to a 40.3% reduction for a 0.8% drop.
  • VGG-16 on ImageNet: Reached a 44.5% MAC reduction with a 1.27% top-1 accuracy drop (after fine-tuning), significantly better than prior methods like PerforatedCNNs.
  • ResNet-18 on ImageNet: Achieved a 23.8% MAC reduction with a 1.86% top-1 drop.

The overhead of running the ZAP predictor is mathematically negligible, roughly $1/c_i$ (where $c_i$ is the number of input channels), which is typically less than 1% of the original layer's cost.

Limitations and Future Work

  • Hardware Realities: While the theoretical MAC savings are high, standard GPUs are designed for dense, regular math. They aren't naturally good at skipping individual pixels (unstructured sparsity). To see the full speedup, ZAP would likely need specialized hardware accelerators like SCNN.
  • Uniform Patterns: Currently, the same sampling pattern is used for every layer. The authors suggest that "mixing and matching" patterns based on specific layer characteristics could yield even better results.
  • Comparison with Heavyweight Methods: While ZAP is much faster to train than competitors like Dong et al., it doesn't quite match their accuracy on complex models like ResNet-18, highlighting a trade-off between training time and final performance.

Summary updated

BibTeX
@inproceedings{shomron2020thanks,
  author = {Gil Shomron and Ron Banner and Moran Shkolnik and Uri Weiser},
  title = {{Thanks for Nothing: Predicting Zero-Valued Activations with Lightweight Convolutional Neural Networks}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58607-2\_14},
}
Figure