Papers
Topics
Authors
Recent
Search
2000 character limit reached

RBNN: Rotated Binary Neural Network

Updated 17 March 2026
  • Rotated Binary Neural Networks (RBNN) are quantized frameworks that leverage learned orthogonal rotations and adjustable interpolation to reduce angular bias and quantization error in 1-bit neural networks.
  • They overcome standard BNN limitations by aligning full-precision weights with binary counterparts, thereby maximizing weight flip rates and enhancing representational capacity.
  • Empirical evaluations on benchmarks such as CIFAR-10 and ImageNet demonstrate that RBNN consistently outperforms existing state-of-the-art methods in classification accuracy.

Rotated Binary Neural Network (RBNN) is a quantized deep learning framework that addresses the limitations of conventional Binary Neural Networks (BNNs), especially the persistent quantization error induced by angular bias. RBNN systematically aligns the full-precision weight vectors with their binary counterparts through learned orthogonal rotations, coupled with an adjustable interpolation mechanism and a training-aware sign approximation. This architecture advances the representational capacity and empirical accuracy of 1-bit neural networks, consistently outperforming state-of-the-art BNNs on large-scale classification benchmarks (Lin et al., 2020).

1. Limitations of Standard Binary Neural Networks

Binary Neural Networks binarize the weight vector wRnw\in\mathbb{R}^n by applying an elementwise sign function, producing b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n. To compensate for the loss of norm, a scaling factor α\alpha is often learned, minimizing the error E=wαb22E = \|w - \alpha b\|_2^2. However, this approach cannot address the angular discrepancy between ww and bb. The resulting cosine similarity is cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2), yielding a lower bound on the quantization error:

minαwαb22wsinθ22\min_\alpha \|w - \alpha b\|_2^2 \geq \|w\sin\theta\|_2^2

Thus, a large angular bias θ\theta imposes an irreducible error. Standard BNNs display both a substantial norm gap and angular misalignment, leading to a marked decline in classification accuracy. Furthermore, the binarization process in these models results in a low “weight flip” rate—empirically 5–10%—which severely under-utilizes the full combinatorial capacity of the weight space, limiting information gain (Lin et al., 2020).

2. Rotation-Based Angular Alignment

RBNN addresses angular bias by seeking an orthogonal matrix RRn×nR\in\mathbb{R}^{n\times n} (b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n0) that rotates b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n1 such that b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n2 is closely aligned with a binary vector b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n3. The optimization problem is posed as:

b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n4

Maximizing the cosine similarity between b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n5 and b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n6 is equivalent to maximizing

b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n7

Direct optimization of a dense b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n8 is computationally prohibitive (b=sign(w){1,+1}nb = \operatorname{sign}(w)\in\{-1, +1\}^n9 time and storage). RBNN circumvents this by factorizing α\alpha0 as a Kronecker product of two smaller orthogonal matrices, α\alpha1 and α\alpha2, where α\alpha3:

α\alpha4

This “bi-rotation” formulation substantially reduces optimization complexity while retaining expressive rotational flexibility.

The corresponding optimization alternates between:

  • B-step: Update α\alpha5.
  • α\alpha6-step: SVD-based update maximizing α\alpha7 with α\alpha8.
  • α\alpha9-step: SVD-based update maximizing E=wαb22E = \|w - \alpha b\|_2^20 with E=wαb22E = \|w - \alpha b\|_2^21.

Typically, three cycles of alternating minimization suffice per epoch.

3. Adjustable Rotated Weight Vector

Merely rotating E=wαb22E = \|w - \alpha b\|_2^22 may not ensure optimal binarization, as E=wαb22E = \|w - \alpha b\|_2^23 may over- or under-shoot the desired binary vertex. RBNN interposes an adjustable interpolation between E=wαb22E = \|w - \alpha b\|_2^24 and E=wαb22E = \|w - \alpha b\|_2^25:

E=wαb22E = \|w - \alpha b\|_2^26

Here, E=wαb22E = \|w - \alpha b\|_2^27 is a learnable parameter scheduled by back-propagation (specifically, E=wαb22E = \|w - \alpha b\|_2^28 with E=wαb22E = \|w - \alpha b\|_2^29 trained), starting near zero in early training and increasing to one, which mitigates local minima and enables dynamically controlled rotation exploitation. This mechanism improves training convergence and further reduces quantization error.

4. Training-Aware Sign Function Approximation

The sign function’s derivative is zero almost everywhere, impeding gradient propagation. To address this, RBNN introduces a smooth, epoch-dependent proxy function ww0 for use in the forward pass:

ww1

where the sharpness parameter ww2 evolves from ww3 to ww4 over training, ww5 is the current epoch, ww6 is the total number of epochs, and ww7. The gradient for backpropagation is

ww8

As training progresses, ww9, ensuring binary-valued weights. The chain rule is used to propagate gradients through both bb0 and bb1: \begin{align*} \partial\mathcal{L}/\partial w &= \partial\mathcal{L}/\partial F(\tilde{w}) \cdot F'(\tilde{w}) \cdot [ (1-\alpha)I + \alpha R\top ] \ \partial\mathcal{L}/\partial \alpha &= \sum_j [ (\partial\mathcal{L}/\partial F(\tilde{w}))_j \cdot F'(\tilde{w})_j ( (R\top w - w)_j ) ] \end{align*}

5. Training Procedure and Algorithmic Outline

The RBNN training process alternates between rotation optimization and weight interpolation:

  1. Epoch-level Rotation: For each layer bb2 at the start of epoch bb3:
    • Freeze bb4.
    • Run three cycles of the alternating update steps for bb5, bb6 and bb7.
    • Compose bb8.
  2. Mini-batch Processing: For each mini-batch:
    • Compute bb9 per layer.
    • Forward: binarize using cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)0; compute convolutions via XNOR/bitcount.
    • Backward: compute gradients using cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)1; update cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)2 and cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)3 (cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)4).

Notably, convolutional and fully connected layers (excluding the first and last) are binarized with cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)5-bit weights/activations in all reported experiments.

6. Empirical Evaluation

RBNN demonstrates consistent accuracy improvements over contemporary BNN approaches on standard benchmarks. Key results are summarized below.

CIFAR-10 Top-1 Accuracy

Network Method W/A Accuracy
ResNet-18 FP (32/32) 32/32 93.0%
RAD 1/1 90.5%
IR-Net 1/1 91.5%
RBNN 1/1 92.2%
ResNet-20 FP (32/32) 32/32 91.7%
DoReFa 1/1 79.3%
DSQ 1/1 84.1%
IR-Net 1/1 85.4%
RBNN 1/1 86.5%
IR-Net* (Bi-Real) 1/1 86.5%
RBNN* (Bi-Real) 1/1 87.8%
VGG-small FP (32/32) 32/32 91.7%
LAB 1/1 87.7%
XNOR-Net 1/1 89.8%
BNN 1/1 89.9%
RAD 1/1 90.0%
IR-Net 1/1 90.4%
RBNN 1/1 91.3%

ImageNet Top-1 / Top-5 Accuracy

Network Method W/A Top-1 Top-5
ResNet-18 FP (32/32) 32/32 69.6% 89.2%
ABC-Net 1/1 42.7% 67.6%
XNOR-Net 1/1 51.2% 73.2%
BNN+ 1/1 53.0% 72.6%
DoReFa 1/2 53.4%
Bi-Real 1/1 56.4% 79.5%
XNOR++ 1/1 57.1% 79.9%
IR-Net 1/1 58.1% 80.0%
RBNN 1/1 59.9% 81.9%
ResNet-34 FP (32/32) 32/32 73.3% 91.3%
ABC-Net 1/1 52.4% 76.5%
Bi-Real 1/1 62.2% 83.9%
IR-Net 1/1 62.9% 84.1%
RBNN 1/1 63.1% 84.4%

Compared to XNOR-Net and IR-Net, RBNN improves top-1 ImageNet accuracy by approximately 1.8% and 1.1%, respectively, with analogous gains on CIFAR-10.

RBNN also produces significantly higher weight flip rates—about 50% per layer—maximizing the entropy and fully exploiting the cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)6-state binary capacity, as opposed to 5–10% for standard BNNs. The reduction in angular bias and quantization error is evident per layer, and RBNN weight distributions exhibit pronounced bimodality at cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)7.

7. Implementation and Reproducibility

RBNN is implemented in PyTorch. Principal modules include:

  • rotation.py (bi-rotation optimization),
  • adjustable_weight.py (computing cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)8 and cosθ=(wb)/(w2b2)\cos\theta = (w^\top b)/(\|w\|_2\|b\|_2)9 scheduling),
  • sign_approx.py (forward minαwαb22wsinθ22\min_\alpha \|w - \alpha b\|_2^2 \geq \|w\sin\theta\|_2^20 and backward minαwαb22wsinθ22\min_\alpha \|w - \alpha b\|_2^2 \geq \|w\sin\theta\|_2^21),
  • training.py (overall training workflow).

Reproducibility is ensured through fixed random seeds and configuration files specifying hyperparameter schedules (including learning rate, minαwαb22wsinθ22\min_\alpha \|w - \alpha b\|_2^2 \geq \|w\sin\theta\|_2^22, and minαwαb22wsinθ22\min_\alpha \|w - \alpha b\|_2^2 \geq \|w\sin\theta\|_2^23). Pre-trained full-precision models and all source artifacts are available at https://github.com/lmbxmu/RBNN. The training setups involve SGD with momentum (0.9), weight decay (minαwαb22wsinθ22\min_\alpha \|w - \alpha b\|_2^2 \geq \|w\sin\theta\|_2^24), and standardized schedules for learning rate and batch size (Lin et al., 2020).

Distinctively, RBNN rotates and binarizes all convolutional and fully connected layers except the network’s first and last, following prevailing best practices for 1-bit DNN quantization.


RBNN systematically addresses quantization error in binarized neural networks through angular alignment, maximized weight flips, and an adjustable binarization surrogate. The empirical evaluation confirms notable accuracy advantages and higher information capacity compared to existing 1-bit quantization methods (Lin et al., 2020).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Rotated Binary Neural Network (RBNN).