BiDense: Binarization for Dense Prediction

Rui Yin, Haotong Qin, Yulun Zhang, Wenbo Li, Yong Guo, Jianjun Zhu, Cheng Wang, Biao JiaarXiv 2024 · DOI

Abstract

Binary Neural Networks (BNNs) provide a promising path toward deploying deep learning models on resource-constrained edge devices by compressing weights and activations to a single bit. However, their application to dense prediction tasks—such as semantic segmentation and monocular depth estimation—has been limited by significant accuracy degradation. We present BiDense, a framework that bridges this gap using a Distribution-adaptive Binarizer (DAB) and a Channel-adaptive Full-precision Bypass (CFB). BiDense achieves performance remarkably close to 32-bit models while reducing memory usage by up to 32× and theoretical computation by 58×.

Introduction

Dense prediction tasks require a model to generate a prediction for every pixel in an input image, making them fundamental to applications like autonomous driving and medical imaging. These models are typically "heavy," demanding substantial memory and compute resources. While BNNs offer extreme efficiency, the information loss inherent in binarization often proves catastrophic for the fine-grained details required in dense prediction.

Previous attempts to mitigate this loss utilized full-precision bypasses (skip connections), but these were often restricted to architectures where channel counts remained constant or followed simple scaling rules. BiDense introduces a generalized approach that enables high-performance binarization across diverse network architectures and tasks.

Methodology

The BiDense framework introduces two primary innovations to make BNNs suitable for dense prediction.

Distribution-adaptive Binarizer (DAB)

Standard BNNs typically employ fixed, learned thresholds for binarization. However, the diverse nature of image data in dense prediction tasks suggests that a static approach is insufficient. DAB dynamically computes binarization thresholds and scaling factors for each input based on its mean and Mean Absolute Deviation (MAD). By adapting to the input distribution on the fly, DAB maximizes the information entropy of the binary signal, preserving more detail than traditional methods.

Channel-adaptive Full-precision Bypass (CFB)

Skip connections are critical for maintaining signal quality in deep networks. In dense prediction, models frequently alter channel dimensions during upsampling or downsampling stages. CFB introduces "fusion-down" (pooling) and "fusion-up" (channel repetition) mechanisms to ensure that a full-precision signal can always bypass binary layers, regardless of dimension mismatches. This architecture allows binary layers to focus on learning residual details rather than the entire signal.

Overview of the BiDense architecture, highlighting the Distribution-adaptive Binarizer (DAB) and the Channel-adaptive Full-precision Bypass (CFB) with fusion-up/down mechanisms.

Experiments and Results

BiDense was evaluated across four major benchmarks covering semantic segmentation (ADE20K, PASCAL VOC 2012) and monocular depth estimation (NYUv2, KITTI). Notably, this work represents the first successful application of binarization to the monocular depth estimation task.

Performance Highlights

  • Semantic Segmentation: On the ADE20K dataset, BiDense achieved an mIoU of 18.75%, nearly doubling the 9.22% achieved by ReActNet and approaching the full-precision (FP32) baseline of 20.39%.
  • Depth Estimation: On NYUv2, BiDense reached an AbsRel of 0.189, outperforming previous quantized models and even surpassing a randomly-initialized FP32 baseline.
  • Efficiency: Compared to a standard ConvNeXt-Tiny model, BiDense utilizes only 1.6M parameters (a 25× reduction) and significantly fewer operations, facilitating real-time deployment on low-power hardware.
Qualitative results for semantic segmentation and monocular depth estimation, comparing BiDense with the full-precision ConvNeXt baseline and ground truth.

Discussion and Conclusion

The success of BiDense stems from its focus on information entropy. By keeping the distribution of binary values closer to a 50/50 split, the model maximizes the information density of its 1-bit representations. Furthermore, the "residual philosophy" enabled by CFB allows the binary layers to act as refinement mechanisms, while the bypass carries the primary signal.

While BiDense shows exceptional performance for Convolutional Neural Networks (CNNs), its application to Vision Transformers (ViTs) remains a challenge. Initial experiments with DAB in self-attention layers led to overfitting, suggesting that weight binarization for attention mechanisms requires further specialized techniques. Nonetheless, BiDense stands as a state-of-the-art solution for efficient dense prediction in resource-constrained environments.

Summary updated

BibTeX
@misc{yin2024bidense,
  author = {Rui Yin and Haotong Qin and Yulun Zhang and Wenbo Li and Yong Guo and Jianjun Zhu and Cheng Wang and Biao Jia},
  title = {{BiDense: Binarization for Dense Prediction}},
  year = {2024},
  eprint = {2411.10346},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.10346},
}
Figure