Abstract
Binary Neural Networks (BNNs) offer significant potential for model compression and acceleration by restricting weights and activations to 1-bit values. However, the traditional static binarization process often leads to substantial information loss. This paper introduces DySign, a dynamic thresholding method that adapts the binarization process to the statistics of individual input samples. By replacing fixed thresholds with dynamic, input-dependent ones, DySign significantly improves the representational power of BNNs. Experimental results on ImageNet demonstrate that DySign-enhanced models achieve state-of-the-art performance, reaching 71.2% top-1 accuracy on MobileNetV1 and narrowing the gap between 1-bit and full-precision models in both CNNs and Vision Transformers.
Introduction
The pursuit of efficient deep learning has led to the development of Binary Neural Networks (BNNs), which represent the extreme of model quantization. By using 1-bit representations (-1, +1), BNNs can achieve up to 64x speedups on specialized hardware and drastic reductions in memory footprint. Despite these advantages, BNNs typically suffer from a significant accuracy gap compared to their full-precision counterparts.
A primary cause of this performance degradation is the rigidity of the "Sign" function used for binarization. Most existing BNNs employ a fixed threshold (usually zero) or a learned static threshold that remains constant across all input images. This "one-size-fits-all" approach fails to account for the diverse feature distributions present in different images. As shown in Figure 1, a static threshold might preserve the essential features of one object while completely obscuring those of another, leading to severe information loss.
Methodology
The core contribution of this work is the DySign (Dynamic Sign) module. Instead of relying on a static threshold, we treat threshold generation as a lightweight, input-dependent sub-task.
The DySign Module
For each layer, the DySign module computes a unique threshold $\alpha$ for each channel based on the global statistics of the current input feature map. The module utilizes a small computational unit consisting of Global Average Pooling (GAP) followed by two fully connected layers. The binarization process then becomes $B = \text{Sign}(X + \alpha)$, where $\alpha$ is the dynamically generated threshold vector. This allows the network to adapt its quantization levels to the specific content of each image.
Dynamic Activation and Architectures
We extend this dynamic logic to the activation function, introducing DyPReLU, where both the shift and slope parameters are input-dependent. We apply these modules to two distinct architectures:
- DyBCNN: A binarized CNN framework based on ResNet and MobileNet.
- DyBinaryCCT: A binarized Vision Transformer based on the Compact Convolutional Transformer (CCT). CCT is utilized because its convolutional "patching" helps preserve local spatial information, which is often lost in standard binarized ViTs.
Experimental Results
We evaluated DySign on several benchmarks, including ImageNet (ILSVRC12), CIFAR-10, and CIFAR-100.
Performance on ImageNet
DySign sets new benchmarks for 1-bit models. As shown in the comparison table, DyBCNN achieves 71.2% top-1 accuracy on MobileNetV1 and 67.4% on ResNet18, outperforming the previous state-of-the-art, ReActNet, by 1.8% and 1.5% respectively.
Vision Transformers and Efficiency
For Vision Transformers, DyBinaryCCT reached 56.1% accuracy on ImageNet, representing a massive 9% improvement over baseline binarized Transformers. Crucially, the computational overhead of the DySign module is negligible, adding less than 2% to the total operations (OPs), making it a highly efficient enhancement for BNNs.
Conclusion
DySign demonstrates that sample-dependent thresholding is a powerful tool for boosting BNN performance. By allowing the binarization process to adapt to input statistics, we can preserve significantly more information with minimal computational cost. Future work will focus on addressing the performance bottlenecks in 1x1 convolutions and improving knowledge distillation techniques for 1-bit networks.
Summary updated