Layer-specific Optimization for Mixed Data Flow with Mixed Precision in FPGA Design for CNN-based Object Detectors

Duy Thanh Nguyen, Hyun Kim, Hyuk-Jae Lee · DOI

Abstract

Convolutional neural networks (CNNs) require both intensive computation and frequent memory access, which lead to a low processing speed and large power dissipation. Although the characteristics of the different layers in a CNN are frequently quite different, previous hardware designs have employed common optimization schemes for them. This paper proposes a layer-specific design that employs different organizations that are optimized for the different layers. The proposed design employs two layer-specific optimizations: layer-specific mixed data flow and layer-specific mixed precision. The mixed data flow aims to minimize the off-chip access while demanding a minimal on-chip memory (BRAM) resource of an FPGA device. The mixed precision quantization is to achieve both a lossless accuracy and an aggressive model compression, thereby further reducing the off-chip access. A Bayesian optimization approach is used to select the best sparsity for each layer, achieving the best trade-off between the accuracy and compression. This mixing scheme allows the entire network model to be stored in BRAMs of the FPGA to aggressively reduce the off-chip access, and thereby achieves a significant performance enhancement. The model size is reduced by 22.66-28.93 times compared to that in a full-precision network with a negligible degradation of accuracy on VOC, COCO, and ImageNet datasets. Furthermore, the combination of mixed dataflow and mixed precision significantly outperforms the previous works in terms of both throughput, off-chip access, and on-chip memory requirement.

Introduction

Convolutional Neural Networks (CNNs) are the backbone of modern object detection, yet their deployment on edge devices is hindered by high computational and memory demands. In FPGA-based hardware accelerators, the primary bottleneck is often the frequent data movement between the chip and off-chip DRAM, which consumes significant power and limits throughput. Traditional designs typically apply a uniform optimization strategy across all layers. However, CNN layers exhibit distinct characteristics: early layers are dominated by large feature maps, while deeper layers are dominated by massive parameter counts.

Layer-Specific Optimization Strategies

To address these varying requirements, this paper introduces a layer-specific design approach. By analyzing the distribution of parameters versus feature map sizes across the network, the architecture can be partitioned into distinct groups optimized for different bottlenecks.

Figure 4: Analysis of parameter count vs. feature map size across layers, motivating the split between Scheme 3 (early layers) and Scheme 2 (late layers).

Mixed Data Flow

The network is divided into two groups based on a calculated "boundary layer":

  1. Group 1 (Early Layers): These layers utilize a row-based pipelined data flow. By processing data row-by-row, intermediate feature maps can be kept entirely on-chip, eliminating the need for DRAM access for these large tensors.
  2. Group 2 (Late Layers): These layers employ a "full weight reuse" scheme. Since these layers have smaller feature maps but millions of weights, the weights are loaded once and reused extensively, maximizing efficiency for parameter-heavy computations.

Intra-layer Mixed Precision

Beyond data flow, the design employs a coarse-grained intra-layer mixed precision scheme. Most weights are quantized to 1-bit (binary) to minimize storage and computation, while critical "outlier" weights are preserved at 8-bit precision. This hybrid approach maintains near-lossless accuracy while achieving massive compression. A Bayesian optimization process using Gaussian Processes automatically determines the optimal sparsity ratio (the balance of 1-bit vs. 8-bit weights) for each layer.

Hardware Architecture

The proposed FPGA architecture is designed to handle these mixed-precision and mixed-data-flow requirements concurrently. It features parallel processing elements for dense 1-bit and sparse 8-bit kernels, integrated with a sophisticated buffering system to manage shortcuts and pipelined execution.

Figure 5: High-level system architecture showing the integration of pipelined layers, main layer processing, and DRAM management.

Experimental Results

The architecture was evaluated on PASCAL VOC, MS COCO, and ImageNet datasets using models like YOLOv3 and Sim-YOLO-v2. Key findings include:

  • Compression: Model sizes were reduced by 22.66x to 28.93x compared to 32-bit baselines.
  • Accuracy: Accuracy degradation was negligible, with only a 0.46% mAP drop for YOLOv3 on COCO.
  • Efficiency: The combined optimizations resulted in a 3.2x speedup and a 12.95x reduction in off-chip memory access compared to unified designs. The implementation achieved 1877 GOPS on a Virtex-7 FPGA.

Conclusion

By abandoning the "one-size-fits-all" approach in favor of layer-specific optimizations, this design significantly mitigates the memory bottleneck in CNN accelerators. The combination of mixed data flow and intra-layer mixed precision allows complex models to be stored primarily in on-chip BRAM, paving the way for high-performance, low-power object detection on FPGAs.

Summary updated

BibTeX
@article{nguyen2020layer,
  author = {Duy Thanh Nguyen and Hyun Kim and Hyuk-Jae Lee},
  title = {{Layer-specific Optimization for Mixed Data Flow with Mixed Precision in FPGA Design for CNN-based Object Detectors}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2020},
  doi = {10.1109/tcsvt.2020.3020569},
}
Figure