SoFAr: Shortcut-based Fractal Architectures for Binary Convolutional Neural Networks

Baozhou Zhu, H. Peter Hofstee, Jinho Lee, Zaid Al-ArsarXiv 2020

TL;DR

This paper introduces "Shortcut-based Fractal Architectures" (SoFAr) for Binary Convolutional Neural Networks (BCNNs). By combining fractal network structures with established shortcut connections (like those in ResNet and DenseNet), SoFAr significantly improves BCNN accuracy without increasing computational cost, addressing a key challenge in deploying efficient deep learning models on resource-constrained devices.

What Problem Does This Paper Address?

Deep Convolutional Neural Networks (DCNNs) are powerful for visual recognition but are computationally expensive, making them unsuitable for mobile or embedded systems. Binary Convolutional Neural Networks (BCNNs) offer a solution by drastically reducing computational and memory requirements through the use of 1-bit weights and activations. However, this extreme quantization leads to a significant drop in accuracy compared to full-precision models. This accuracy degradation stems from binarization errors during forward passes and gradient mismatches during backward passes, making BCNNs notoriously difficult to train effectively. While existing methods like adding more shortcuts (e.g., Bi-real ResNet, BinaryDenseNet) and using fractal architectures have shown promise individually, this paper aims to unify these approaches to achieve superior performance for BCNNs.

Methods

The core contribution of this paper is the proposal of two novel architectures, collectively termed SoFAr:

  1. Residual Connection-based Fractal Architectures (RF-SoFAr): These adapt fractal architectures for binary ResNets. The base case of the fractal is defined as a convolutional layer combined with an identity mapping (residual connection). Subsequent fractal layers are built recursively by composing these base units. This approach leverages the deep supervision and lateral information flow benefits of fractal structures while integrating residual connections to facilitate gradient propagation in BCNNs.
  2. Dense Connection-based Fractal Architectures (DRF-SoFAr): These extend fractal concepts to binary DenseNets. Here, fractal architectures are used to generate new feature maps, which are then concatenated with feature maps from all preceding convolutional layers (dense connection). Additionally, convolutional layers within the fractal structure that maintain the same number of input and output channels incorporate residual connections. The base case is a single convolutional layer, and recursive definitions build the fractal structure.

Both SoFAr variants utilize the straight-through estimator (STE) for approximating gradients of the sign function during binarization, a standard practice in BCNN research.

Datasets

The paper evaluates its proposed architectures on two standard image classification benchmarks:

  • ImageNet: A large-scale dataset widely used for benchmarking deep learning models.
  • CIFAR-100: A smaller dataset commonly used for evaluating model performance, especially for networks with varying depths.

The authors do not introduce new datasets but rather demonstrate the effectiveness of their architectures on existing ones.

Key Insights and Ideas

  • Synergy of Shortcuts and Fractals: The paper's central idea is that combining shortcut connections (which improve gradient flow) with fractal architectures (which offer implicit deep supervision and lateral information flow) creates a powerful framework for training BCNNs. This synergy appears to be more effective than either approach alone.
  • Fractal Structures for BCNN Training: Fractal architectures, previously used for full-precision CNNs, are shown to be beneficial for BCNN training by providing effective pathways for gradients, mitigating the training difficulties inherent in binarization.
  • Unified Architecture Design: SoFAr provides a unified model that integrates the strengths of residual and dense connections with fractal principles, offering a more robust approach to BCNN architecture design.
  • Accuracy Gains without Overhead: A key finding is that these architectural improvements lead to significant accuracy gains without increasing the computational complexity (parameters or FLOPs) compared to existing shortcut-based BCNNs.

Key Results

The SoFAr architectures demonstrate improved performance on both ImageNet and CIFAR-100:

  • ImageNet:
    • RF-c4d8 ResNet37(41) achieved a Top-1 accuracy of 37.13%, outperforming Bi-real ResNet18(64) by 3.29%.
  • DRF-c2d2 DenseNet51(53) achieved a Top-1 accuracy of 36.73%, outperforming BinaryDenseNet51(32) by 1.41%.
  • These improvements were achieved with comparable computational complexity overhead.
  • CIFAR-100:
    • RF-c3d4 ResNet21(50) improved Top-1 accuracy by 2.14% compared to Bi-Real ResNet18(64).
  • DRF-c2d2 DenseNet51(48) showed a 0.44% improvement in Top-1 accuracy over BinaryDenseNet51(32).

An ablation study confirmed that the residual connections are crucial for the performance gains observed in SoFAr, with their removal leading to significant accuracy degradation.

Limitations and Future Work

  • Limitations:
    • The paper focuses on architectural modifications for BCNNs, acknowledging that value approximation techniques (e.g., minimizing quantization error) could potentially further enhance performance.
  • While computational complexity is matched, the exact trade-offs between different fractal configurations and their impact on inference speed on specific hardware are not deeply explored.
  • Future Work:
    • The authors suggest that their proposed architectures could be combined with value approximation methods for even greater accuracy improvements.
  • Exploring different fractal structures and their parameters could lead to further optimizations.
  • Investigating the application of SoFAr to other computer vision tasks beyond classification would be a natural extension.

Summary updated

Abstract

Binary Convolutional Neural Networks (BCNNs) can significantly improve the efficiency of Deep Convolutional Neural Networks (DCNNs) for their deployment on resource-constrained platforms, such as mobile and embedded systems. However, the accuracy degradation of BCNNs is still considerable compared with their full precision counterpart, impeding their practical deployment. Because of the inevitable binarization error in the forward propagation and gradient mismatch problem in the backward propagation, it is nontrivial to train BCNNs to achieve satisfactory accuracy. To ease the difficulty of training, the shortcut-based BCNNs, such as residual connection-based Bi-real ResNet and dense connection-based BinaryDenseNet, introduce additional shortcuts in addition to the shortcuts already present in their full precision counterparts. Furthermore, fractal architectures have been also been used to improve the training process of full-precision DCNNs since the fractal structure triggers effects akin to deep supervision and lateral student-teacher information flow. Inspired by the shortcuts and fractal architectures, we propose two Shortcut-based Fractal Architectures (SoFAr) specifically designed for BCNNs: 1. residual connection-based fractal architectures for binary ResNet, and 2. dense connection-based fractal architectures for binary DenseNet. Our proposed SoFAr combines the adoption of shortcuts and the fractal architectures in one unified model, which is helpful in the training of BCNNs. Results show that our proposed SoFAr achieves better accuracy compared with shortcut-based BCNNs. Specifically, the Top-1 accuracy of our proposed RF-c4d8 ResNet37(41) and DRF-c2d2 DenseNet51(53) on ImageNet outperforms Bi-real ResNet18(64) and BinaryDenseNet51(32) by 3.29% and 1.41%, respectively, with the same computational complexity overhead.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
ImageNet-1K · ImageNetDRF-c2d2 DenseNet51(53)Top-1 accuracy36.73%Image Classification · from-scratch · epochs=100 · backbone=DenseNet51 · architecture=DRF-c2d2 · weights-activations=binary
Source quote
L348: As shown in Table~\ref{table8}, we compare with state-of-the-art BCNNs on ImageNet. Except for the Real-to-Bin ResNet18 \cite{martinez2020training}, the Top-1 accuracy of our DRF-c2d2 DenseNet51(53) and DRF-c2d2 DenseNet69(48) achieve 36.73% and 35.20%, respectively, and outperforms others by a large margin. More importantly, Real-to-Bin focuses on the minimization of quantization error between the BCNNs and their full precision counterparts, while our SoFAr work towards the architecture design for BCNNs. Thus, it is reasonable to expect that the performance of Real-to-Bin can be improved further when applying our proposed architectures.
ImageNet-1K · ImageNetDRF-c2d2 DenseNet69(48)Top-1 accuracy35.20%Image Classification · from-scratch · epochs=100 · backbone=DenseNet69 · architecture=DRF-c2d2 · weights-activations=binary
Source quote
L348: As shown in Table~\ref{table8}, we compare with state-of-the-art BCNNs on ImageNet. Except for the Real-to-Bin ResNet18 \cite{martinez2020training}, the Top-1 accuracy of our DRF-c2d2 DenseNet51(53) and DRF-c2d2 DenseNet69(48) achieve 36.73% and 35.20%, respectively, and outperforms others by a large margin. More importantly, Real-to-Bin focuses on the minimization of quantization error between the BCNNs and their full precision counterparts, while our SoFAr work towards the architecture design for BCNNs. Thus, it is reasonable to expect that the performance of Real-to-Bin can be improved further when applying our proposed architectures.
CIFAR-100RF-c3d4 ResNet21(50)Top-126.34%Image Classification · backbone=ResNet21 · architecture=RF-c3d4 · weights-activations=binary
Source quote
L213: RF-c3d4 ResNet21(50) │ b=1 │ 26.34% │ 7.89% │ 18.07Mbit │ 1.53 × 10^7
CIFAR-100DRF-c2d2 DenseNet51(48)Top-126.72%Image Classification · backbone=DenseNet51 · architecture=DRF-c2d2 · weights-activations=binary
Source quote
L235: DRF-c2d2 DenseNet51(48) │ b=1 │ 26.72% │ 7.51% │ 17.51Mbit │ 5.32 × 10^7
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
CIFAR-100Bi-Real ResNet18(64) baselineTop-128.48%Image Classification · backbone=ResNet18 · weights-activations=binary
Source quote
L210: Bi-Real ResNet18(64) │ b=1 │ 28.48% │ 8.65% │ 18.18Mbit │ 1.67 × 10^7
CIFAR-100BinaryDenseNet51(32) baselineTop-127.16%Image Classification · backbone=DenseNet51 · weights-activations=binary
Source quote
L233: BinaryDenseNet51(32) │ b=1 │ 27.16% │ 7.27% │ 17.65Mbit │ 5.13 × 10^7
BibTeX
@misc{zhu2020sofar,
  author = {Baozhou Zhu and H. Peter Hofstee and Jinho Lee and Zaid Al-Ars},
  title = {{SoFAr: Shortcut-based Fractal Architectures for Binary Convolutional Neural Networks}},
  year = {2020},
  eprint = {2009.05317},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.05317},
}
Figure