Introduction
Standard Convolutional Neural Networks (CNNs) rely on millions of 32-bit floating-point parameters and billions of high-precision multiplications. While these models excel on powerful GPUs, they are often too slow and memory-hungry for "edge" devices like smartwatches or AR glasses. While network binarization (reducing values to -1 or 1) offers extreme speed, it often suffers from significant accuracy drops due to high quantization error.
This paper introduces TBN (Ternary-Binary Network), a "Goldilocks" approach that bridges the gap between full-precision networks and ultra-efficient binarized models. By utilizing ternary inputs (-1, 0, 1) and binary weights (-1, 1), TBN achieves a 32x reduction in memory and a 40x speedup in convolutional operations while significantly outperforming existing binary-only models like XNOR-Net.
Methodology: The TBConvolution
The core innovation of TBN lies in its specific quantization scheme and the mathematical acceleration of the dot product through bitwise operations.
1. Binary Weights and Ternary Inputs
Weights are constrained to $\{-1, 1\}$ and scaled by a factor $\alpha$, allowing for 32x compression compared to float32. Crucially, input signals are quantized to a ternary set $\{-1, 0, 1\}$. The inclusion of the zero state allows the network to represent sparsity and effectively "turn off" uninformative features, which drastically reduces the noise introduced by quantization compared to pure binary inputs.
2. Accelerated Bitwise Operations
Multiplying binary weights by ternary inputs is accelerated using hardware-friendly bitwise logic: XOR, AND, and bitcount. By decomposing the ternary input into two binary masks, the system can compute convolutions using operations that are significantly faster than standard floating-point multiplications.
3. Training with Straight-Through Estimator (STE)
Since quantization functions are non-differentiable, the authors employ the Straight-Through Estimator (STE) during backpropagation. This allows gradients to bypass the quantization layers, enabling standard training of the underlying network.
Experimental Results
The authors evaluated TBN across standard benchmarks including ImageNet (classification) and PASCAL VOC (object detection) using architectures like AlexNet and ResNet.
Key Performance Metrics
- Accuracy Boost: On ImageNet, TBN outperformed XNOR-Net by up to 5.5% in top-1 accuracy. For object detection on PASCAL VOC, it achieved a 4.4% higher mAP (mean Average Precision).
- Efficiency: TBN provides ~32x memory savings and ~40x faster convolutional operations compared to standard 32-bit floating-point networks.
- Sparsity Matters: A threshold ($\Delta$) of 0.4 for ternarization was found to be optimal, highlighting that the "sparsity" (number of zeros) in the inputs is a key driver of the model's success.
Conclusion
TBN demonstrates that allowing a zero state in input quantization provides a superior trade-off between efficiency and accuracy. While achieving the full 40x speedup requires optimized software kernels or specialized hardware, TBN sets a new standard for deploying high-performance deep learning models on resource-constrained edge devices.
Summary updated