Ternary MobileNets via Per-Layer Hybrid Filter Banks

Dibakar Gope, Jesse G. Beu, Urmish Thakker, Matthew Mattina

Introduction

MobileNets have revolutionized on-device AI by providing efficient depthwise-separable convolutions. However, the demand for even more compact models for ultra-constrained edge devices persists. Ternary quantization, which restricts weights to $\{-1, 0, 1\}$, offers a path to significant energy savings by replacing multiplications with additions. Yet, applying standard ternary quantization to MobileNets often results in severe accuracy degradation or an unexpected explosion in computational overhead. This paper introduces Per-Layer Hybrid Filter Banks, a novel quantization method that selectively applies ternary quantization to tolerant filters while keeping sensitive ones in full precision.

The 1x1 Convolution Trap

A significant challenge in quantizing MobileNets lies in their architecture, which is dominated by 1x1 pointwise convolutions. While techniques like StrassenNets can approximate 3x3 convolutions efficiently, they fail when applied to 1x1 kernels. In a 1x1 convolution, the number of additions required by the Strassen approximation can double compared to the original operations, negating any gains from removing multiplications. Naive attempts to recover accuracy by widening these layers can lead to an explosion in addition operations (over 317%), wiping out energy benefits.

The 1x1 convolution trap: StrassenNets significantly increase addition operations for 1x1 kernels compared to 3x3 kernels.

Proposed Method: Per-Layer Hybrid Filter Banks

To solve the compute-inefficiency of fully quantized MobileNets, the authors propose a hybrid approach. Instead of forcing an entire layer to quantize, the network splits the workload into two parallel pathways:

  1. Full-Precision Pathway: A fraction of the output channels (determined by a hyperparameter $\alpha$) are generated using standard 16-bit floating-point filters.
  2. Ternary Pathway: The remaining channels are generated using ternary filters via Strassen's matrix multiplication approximation with narrow hidden layers.
Architecture of the Per-Layer Hybrid Filter Bank, showing parallel full-precision and ternary pathways followed by channel concatenation.

During end-to-end training, the network naturally learns to route "difficult-to-quantize" features (like sharp edges) through the full-precision filters, while redundant features are handled by the compressed ternary filters. Knowledge distillation from an uncompressed teacher model further aids the student network's training.

Key Results and Insights

The authors found an optimal configuration with $\alpha = 0.5$ (50% full-precision, 50% ternary). This balance allows the network to act as a dynamic routing mechanism based on precision requirements, similar to how Inception modules route by spatial scale.

  • Accuracy: Achieved 64.69% Top-1 accuracy on ImageNet, a negligible 0.51% drop from the 16-bit baseline.
  • Compression: Reduced model size by 51.07% (from ~2.59 MB to ~1.26 MB).
  • Efficiency: Reduced multiplications by 46.4%, translating to a 27.98% energy savings per inference on specialized hardware without degrading throughput.

Conclusion

Per-Layer Hybrid Filter Banks provide a robust framework for quantizing MobileNets. By acknowledging that not all filters need high precision, the method achieves substantial compression and energy efficiency with minimal impact on accuracy. Future work may explore quantizing activations to 8-bit and tuning the precision ratio per layer to further optimize the accuracy-to-cost trade-off.

Summary updated

BibTeX
@inproceedings{gope2020ternary,
  author = {Dibakar Gope and Jesse G. Beu and Urmish Thakker and Matthew Mattina},
  title = {{Ternary MobileNets via Per-Layer Hybrid Filter Banks}},
  booktitle = {Workshops @ CVPR},
  year = {2020},
  doi = {10.1109/cvprw50498.2020.00362},
}
Figure