This paper, recently published in IEEE Transactions on Mobile Computing, introduces DeViT, a framework designed to bring the power of large-scale Vision Transformers (ViTs) to the "edge"—think drones, smart cameras, and IoT sensors—without the massive latency and power drain typically associated with these models.
TL;DR
DeViT enables real-time Vision Transformer inference on resource-constrained edge devices by decomposing a single "giant" model into multiple smaller models that run in parallel across a cluster of devices. Using a novel knowledge distillation algorithm (DEKD), it achieves significant speedups and energy savings (up to 55% less power) while maintaining accuracy levels comparable to state-of-the-art large models.
What Problem Does This Paper Address?
Vision Transformers (ViTs) have set new benchmarks in computer vision, but they are computationally "heavy." A standard model like ViT-L/16 requires over 1 GB of storage and 190 GFLOPs of computation. In contrast, a common edge device like a Raspberry Pi 4B only has 4 GB of RAM and a peak performance of 13.5 GFLOPS.
Existing solutions usually involve model compression (pruning or quantization) to fit a model onto a single device, which often leads to a steep drop in accuracy. Alternatively, collaborative inference usually partitions a model serially across devices (Device A runs layers 1-5, Device B runs 6-10). This creates a bottleneck: Device B must wait for Device A, and transmitting large intermediate feature maps over wireless networks adds massive latency.
Methods
The authors propose a "divide and conquer" approach through three main innovations:
- Model Decomposition: Instead of splitting the model by layers (serial), DeViT splits the model's "capacity" (parallel). It reduces the number of layers, attention heads, embedding dimensions, and MLP neurons to create $N$ small, homogeneous models.
- Data Partitioning & Sub-task Distillation: The original dataset is split into sub-tasks (e.g., Model A focuses on classes 1-25, Model B on 26-50). Each small model is trained using a large "teacher" ViT to learn fine-grained features specific to its assigned classes.
- DEKD (Decomposition-and-Ensemble Knowledge Distillation): To make these small models work together, the authors developed DEKD. It includes:
- Feature Matching Module: A clever trick to align the different dimensions of the large teacher model and the small student models using random sampling and linear mapping.
- Parallel Ensemble: During inference, all edge devices process the same image simultaneously. They only transmit their final
[class]tokens (tiny amounts of data) to a central node, which aggregates them to produce the final classification.
Datasets
The framework was evaluated on four widely-used computer vision benchmarks:
- CIFAR-100: 100 classes of common objects.
- Oxford 102 Flower: 102 categories of flowers.
- Stanford Cars: 196 classes of cars.
- ImageNet-1K: The gold standard for large-scale image classification (1,000 classes).
Key Insights and Ideas
- Parallelism over Serialism: By running models in parallel rather than in a chain, DeViT eliminates the "waiting" time inherent in traditional collaborative inference.
- Communication Efficiency: Most collaborative methods struggle with the "data explosion" of intermediate features. DeViT only sends the final class tokens, which are extremely small, making it robust even on slower Wi-Fi or Bluetooth connections.
- Importance-based Shrinking: The authors don't just cut the model randomly; they rank attention heads and neurons by their "importance" (contribution to the loss function) and prune the least significant ones first.
- The "Aha" Moment: The researchers found that as you add more devices (and thus more small models), the ensemble accuracy approaches the performance of the original giant model, but the latency stays nearly constant because the work is done in parallel.
Key Results
The authors tested DeViT on a real-world testbed of four NVIDIA Jetson Nano devices.
- Speed & Latency: On a GPU server, DeViT improved end-to-end latency by 2.89× compared to ViT-L/16 with only a 1.65% drop in accuracy.
- Edge Performance: Compared to MobileViT-S (a leading lightweight model), DeViT was 1.72× faster and used 55.28% less energy while being 3.54% more accurate on ImageNet-1K.
- Efficiency: On average, the framework reduced inference latency by 1.90× and energy consumption by 26.11% across various backbones.
Limitations and Future Work
- Homogeneous Hardware: The current study assumes all edge devices are identical. In the real world, an AIoT network might mix a Raspberry Pi with a Jetson Nano. The authors plan to explore heterogeneous decomposition in the future.
- Network Reliability: While the communication overhead is low, the system still relies on a stable central node to aggregate results.
- Task Variety: This paper focuses on image classification. Future work could extend this decomposition strategy to more complex tasks like object detection or image segmentation.
Summary updated