Skip to main content
QUICK REVIEW

[Paper Review] Compressing Vision Transformers for Low-Resource Visual Learning

Eric Youn, Sai Mitheran J.|arXiv (Cornell University)|Sep 5, 2023
Advanced Neural Network ApplicationsComputer Science3 citations
TL;DR

This paper proposes a hybrid compression framework for Vision Transformers to enable efficient deployment on low-resource edge devices like the NVIDIA Jetson Nano (4GB RAM), combining structured pruning, knowledge distillation, and post-training quantization. The approach achieves Swin Transformer-level accuracy with minimal latency and memory usage, enabling real-time semantic segmentation in resource-constrained scenarios such as UAV-based disaster monitoring.

ABSTRACT

Vision transformer (ViT) and its variants have swept through visual learning leaderboards and offer state-of-the-art accuracy in tasks such as image classification, object detection, and semantic segmentation by attending to different parts of the visual input and capturing long-range spatial dependencies. However, these models are large and computation-heavy. For instance, the recently proposed ViT-B model has 86M parameters making it impractical for deployment on resource-constrained devices. As a result, their deployment on mobile and edge scenarios is limited. In our work, we aim to take a step toward bringing vision transformers to the edge by utilizing popular model compression techniques such as distillation, pruning, and quantization. Our chosen application environment is an unmanned aerial vehicle (UAV) that is battery-powered and memory-constrained, carrying a single-board computer on the scale of an NVIDIA Jetson Nano with 4GB of RAM. On the other hand, the UAV requires high accuracy close to that of state-of-the-art ViTs to ensure safe object avoidance in autonomous navigation, or correct localization of humans in search-and-rescue. Inference latency should also be minimized given the application requirements. Hence, our target is to enable rapid inference of a vision transformer on an NVIDIA Jetson Nano (4GB) with minimal accuracy loss. This allows us to deploy ViTs on resource-constrained devices, opening up new possibilities in surveillance, environmental monitoring, etc. Our implementation is made available at https://github.com/chensy7/efficient-vit.

Motivation & Objective

  • To enable deployment of Vision Transformers on memory-constrained, battery-powered edge devices such as UAVs equipped with NVIDIA Jetson Nano (4GB RAM).
  • To maintain high segmentation accuracy comparable to Swin Transformer while minimizing model size and inference latency.
  • To develop a practical, end-to-end compression pipeline combining structured pruning, distillation, and post-training quantization for edge deployment.
  • To evaluate the framework on real-world disaster scene parsing using the LPCV dataset under strict memory and latency constraints.

Proposed method

  • Applying structured pruning to remove redundant attention heads and neurons in linear layers, reducing parameter count without altering computational graph structure.
  • Using a multi-stage distillation strategy: logit knowledge transfer at prediction head, feature mimicking in early layers, and generation-based distillation in deeper layers.
  • Employing post-training quantization (PTQ) to reduce model size and memory footprint, despite limited PyTorch support for quantized CUDA operations.
  • Combining distillation with iterative fine-tuning after pruning to stabilize performance and improve generalization.
  • Using a stronger Swin-v2-T model as a teacher to guide knowledge transfer to a smaller MobileViT student network.
  • Evaluating the compressed model on the LPCV dataset with mean Intersection over Union (mIoU) as the primary metric.
Figure 1: Our framework for edge-oriented, rapid on-device disaster scene parsing
Figure 1: Our framework for edge-oriented, rapid on-device disaster scene parsing

Experimental results

Research questions

  • RQ1Can structured pruning of attention heads and linear layer weights effectively reduce model size without significant accuracy drop on edge devices?
  • RQ2How effective is knowledge distillation with multi-stage supervision (logits, features, generation) in transferring performance from a large teacher to a compact student ViT?
  • RQ3To what extent can post-training quantization reduce memory usage and latency on the Jetson Nano while preserving segmentation accuracy?
  • RQ4How do class imbalance and fine-grained visual distinctions (e.g., mudflow vs. dirt road) affect the performance of compressed models in real-world disaster scenes?
  • RQ5Can iterative pruning with fine-tuning improve compression efficiency compared to bulk pruning?

Key findings

  • The final compressed model achieved Swin Transformer-level accuracy on the LPCV dataset with only 4GB of system RAM, meeting the edge deployment constraint.
  • Pruning attention heads from 4 to 2 had minimal impact on performance, reducing parameters significantly while maintaining high mIoU.
  • Post-training quantization reduced memory usage substantially, though PyTorch’s limited support for quantized CUDA operations constrained further gains.
  • The model performed well on dominant classes but struggled with fine-grained, low-frequency classes such as mudflow and dirt roads, highlighting class imbalance challenges.
  • Iterative pruning provided only marginal improvements over bulk pruning, suggesting limited benefit for this specific architecture and compression goal.
  • The framework successfully enabled real-time semantic segmentation on the Jetson Nano, demonstrating feasibility for UAV-based disaster monitoring.
Figure 2: Samples from the LPCV dataset (CVPR 2023 challenge)
Figure 2: Samples from the LPCV dataset (CVPR 2023 challenge)

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.