Abstract
Deep Neural Networks (DNNs) have been widely deployed for many Machine Learning applications. Recently, CapsuleNets have overtaken traditional DNNs, because of their improved generalization ability due to the multi-dimensional capsules, in contrast to the single-dimensional neurons. Consequently, CapsuleNets also require extremely intense matrix computations, making it a gigantic challenge to achieve high performance. In this paper, we propose CapsAcc, the first specialized CMOS-based hardware architecture to perform CapsuleNets inference with high performance and energy efficiency. State-of-the-art convolutional DNN accelerators would not work efficiently for CapsuleNets, as their designs do not account for key operations involved in CapsuleNets, like squashing and dynamic routing, as well as multi-dimensional matrix processing. Our CapsAcc architecture targets this problem and achieves significant improvements, when compared to an optimized GPU implementation. Our architecture exploits the massive parallelism by flexibly feeding the data to a specialized systolic array according to the operations required in different layers. It also avoids extensive load and store operations on the on-chip memory, by reusing the data when possible. We further optimize the routing algorithm to reduce the computations needed at this stage. We synthesized the complete CapsAcc architecture in a 32nm CMOS technology using Synopsys design tools, and evaluated it for the MNIST benchmark to ensure consistent and fair comparisons. This work enables highly-efficient CapsuleNets inference on embedded platforms.
Introduction
While Convolutional Neural Networks (CNNs) dominate computer vision, they have a fundamental flaw: they often lose the "pose" information (position, orientation, scale) of objects. Capsule Networks (CapsNets) solve this by using multi-dimensional "capsules" instead of single-dimensional neurons. However, this spatial intelligence comes at a high computational cost. CapsNets rely on a "routing-by-agreement" algorithm and a unique "squashing" activation function that standard CNN hardware accelerators—and even high-end GPUs—are not optimized to handle. In standard GPU implementations, the final "ClassCaps" layer and the squashing operation become massive performance bottlenecks.
The CapsAcc Architecture
CapsAcc is a specialized hardware architecture tailored to the specific data-flow requirements of CapsuleNets, addressing the limitations of general-purpose processors.
Specialized Systolic Array
At the heart of CapsAcc is a 16x16 array of Processing Elements (PEs). Unlike standard arrays, these are designed with flexible data-flow mapping to handle the different requirements of convolutional layers, primary capsule layers, and the complex ClassCaps layers. The architecture minimizes expensive on-chip memory accesses by using internal registers within the PEs to store and reuse weights and data during different stages of the routing process.
Algorithmic and Hardware Optimization
The researchers optimized the routing-by-agreement process by directly initializing coupling coefficients, skipping the first softmax operation without sacrificing accuracy. CapsAcc includes dedicated hardware units for taxing operations:
- Squashing Unit: Uses Look-Up Tables (LUTs) to perform the complex squashing activation much faster than a general-purpose processor.
- Normalization and Softmax Units: Custom units designed to handle the vector-based operations inherent in capsule processing.
Experimental Results
The architecture was evaluated using the MNIST dataset, synthesized in a 32nm CMOS technology. CapsAcc demonstrated significant performance leaps over a high-end Nvidia GeForce GTX 1070 GPU:
- Overall Speedup: 6x faster inference for the entire network.
- Layer-Specific Gains: 12x speedup in the ClassCaps layer.
- Operation-Specific Gains: A massive 172x speedup for the squashing activation function.
- Efficiency: The design operates at 250MHz with a power consumption of only 202mW, making it suitable for embedded and edge-AI applications.
Conclusion
CapsAcc represents a significant step toward making Capsule Networks viable for real-time, low-power applications. By addressing the specific computational bottlenecks of CapsNets—namely dynamic routing and non-linear squashing—through specialized hardware and data reuse strategies, CapsAcc achieves substantial speedups and energy efficiency gains over general-purpose GPU implementations. Future work will focus on scaling the architecture for more complex datasets and exploring training-phase acceleration.
Summary updated