Designed Dithering Sign Activation for Binary Neural Networks

Brayan Monroy, Juan Estupiñán, Tatiana Gelvez-Barrera, Jorge Bacca, Henry Arguello

Abstract

Binary Neural Networks (BNNs) represent a critical frontier for edge computing, offering up to 32x memory savings and 52x computational acceleration by utilizing 1-bit weights and activations. However, the standard Sign activation function typically used in BNNs causes significant information loss, leading to a performance gap compared to full-precision counterparts. This paper introduces DeSign, a novel activation function that employs spatially periodic dithering thresholds to preserve fine-grained structural details in feature maps. By optimizing threshold kernels to maximize Total Variation (TV) and ensuring channel diversity through DeSign3D, the proposed method achieves accuracy gains of up to 4.51% on standard benchmarks without increasing the computational cost of binary operations.

Introduction

The primary bottleneck in BNN performance is the "meat cleaver" effect of the standard Sign activation. By using a global threshold (usually zero) to binarize values, the network discards subtle textures and spatial correlations essential for learning complex patterns. This loss is particularly detrimental in the middle and deep layers of a network where features become increasingly abstract.

Inspired by digital dithering—a technique used to represent high-bit-depth images with limited palettes—DeSign replaces the static global threshold with a "Designed Dithering Sign." This approach allows the network to encode spatial information directly into the binary output, effectively tricking the subsequent layers into perceiving gradients and textures that would otherwise be lost.

Methodology

The DeSign Activation Function

DeSign modifies the standard binarization process by introducing a spatially periodic threshold kernel ($T$). The activation is defined as:

$$X_b = \text{Sign}(X_s - T)$$

where $X_s$ is the input feature map and $T$ is the threshold pattern applied across a local grid. This shift ensures that adjacent pixels with similar values may be binarized differently, preserving local contrast.

Optimal Kernel Selection and Scaling

To determine the most effective threshold patterns, the researchers utilized a brute-force optimization strategy focused on Total Variation (TV). Kernels (typically $2 \times 2$ or $3 \times 3$) were selected based on their ability to maximize the structural differences between adjacent pixels. Interestingly, this optimization naturally converged toward patterns resembling Bayer filters, the mosaic patterns used in digital camera sensors, validating the application of classic imaging principles to deep learning.

To ensure compatibility with the network's statistical distribution, the authors employed K-means clustering. This aligns the threshold values with the Gaussian distribution typically produced by Batch Normalization layers, preventing the dithering from being neutralized by learned scale and bias parameters.

DeSign3D: Channel Diversity

To prevent redundant information across feature channels, the authors introduced DeSign3D. This extension uses circular shifts and complements of the optimized kernels across the channel dimension. By ensuring that different channels utilize different versions of the threshold pattern, the network captures a more diverse set of spatial features.

Experimental Results

Performance Benchmarks

The authors evaluated DeSign using VGG-small and ResNet-18 architectures across three major datasets:

  • STL-10: DeSign demonstrated its most significant impact here, improving baseline BNN accuracy from 68.51% to 73.09%.
  • CIFAR-10: When integrated with the Rectified Clamp Unit (ReCU) method, DeSign achieved 92.9% accuracy, surpassing existing state-of-the-art (SOTA) methods such as IR-Net and RBNN.
  • CIFAR-100: Consistent improvements were observed, confirming the robustness of the dithering approach in finer-grained classification tasks.

Visual Fidelity and Efficiency

Qualitative analysis of feature maps revealed that while standard Sign activations often result in "salt and pepper" noise in deeper layers, DeSign preserves recognizable silhouettes of objects. Crucially, because the threshold shift is a simple subtraction that can be folded into existing operations, DeSign provides these benefits with zero additional computational overhead during inference.

Conclusion and Future Work

DeSign effectively bridges the performance gap between binary and full-precision networks by recognizing that pixels are not isolated islands but part of a spatial neighborhood. By encoding spatial correlation into the binarization process, DeSign achieves SOTA results on multiple benchmarks.

Future research may address the complexity of the current brute-force kernel search. Potential avenues include using decision trees or end-to-end evolutionary learning to discover optimal dithering patterns dynamically for specific layers or complex tasks like object detection and semantic segmentation.

Summary updated

BibTeX
@article{monroy2024designed,
  author = {Brayan Monroy and Juan Estupiñán and Tatiana Gelvez-Barrera and Jorge Bacca and Henry Arguello},
  title = {{Designed Dithering Sign Activation for Binary Neural Networks}},
  journal = {IEEE J. Sel. Top. Signal Process.},
  year = {2024},
  doi = {10.1109/jstsp.2024.3467926},
}
Figure