Side4Video: Spatial-Temporal Side Network for Memory-Efficient Image-to-Video Transfer Learning

Huanjin Yao, Wenhao Wu, Zhiheng LiarXiv 2023

Abstract

Large pre-trained vision models achieve impressive success in computer vision. However, fully fine-tuning large models for downstream tasks, particularly in video understanding, can be prohibitively computationally expensive. Recent studies turn their focus towards efficient image-to-video transfer learning. Nevertheless, existing efficient fine-tuning methods lack attention to training memory usage and exploration of transferring a larger model to the video domain. In this paper, we present a novel Spatial-Temporal Side Network for memory-efficient fine-tuning large image models to video understanding, named Side4Video. Specifically, we introduce a lightweight spatial-temporal side network attached to the frozen vision model, which avoids the backpropagation through the heavy pre-trained model and utilizes multi-level spatial features from the original image model. Extremely memory-efficient architecture enables our method to reduce 75% memory usage than previous adapter-based methods. In this way, we can transfer a huge ViT-E (4.4B) for video understanding tasks which is 14.5x larger than ViT-L (304M). Our approach achieves remarkable performance on various video datasets across unimodal and cross-modal tasks (i.e., action recognition and text-video retrieval), especially in Something-Something V1&V2 (67.3% & 74.6%), Kinetics-400 (88.6%), MSR-VTT (52.3%), MSVD (56.1%) and VATEX (68.8%).

Introduction: The Memory Bottleneck in Video AI

In computer vision, scaling Vision Transformers (ViTs) to billions of parameters has yielded significant performance gains. However, adapting these massive image-centric models to video tasks like action recognition or retrieval presents a major challenge: memory consumption.

Standard fine-tuning is often impossible on consumer or even professional-grade GPUs due to the need for backpropagation. Even Parameter-Efficient Fine-Tuning (PEFT) methods, such as inserting small "adapters" into a frozen model, suffer from a hidden cost. To update these adapters, gradients must still flow back through the entire frozen backbone. This requires storing the activations of every single layer, consuming vast amounts of GPU memory. Consequently, researchers have largely been restricted to medium-sized models (like ViT-L), leaving the potential of truly massive models (like the 4.4B parameter ViT-E) untapped for video understanding.

The Side4Video Architecture

To overcome this bottleneck, we propose Side4Video, a novel architecture that shifts from internal adapters to an external side network.

Comparison of Adapter and Side-Tuning architectures showing how side-tuning avoids backpropagation through the frozen backbone.

The core idea is to attach a lightweight network alongside the pre-trained model. Crucially, the heavy backbone remains 100% frozen, and no gradients ever flow through it during training. This decoupling means the training memory footprint is no longer tied to the depth of the backbone.

The Side4Video network "peeks" at intermediate layers of the frozen model to extract rich, multi-level spatial features. These features are then processed by specialized blocks designed for temporal efficiency. These blocks utilize depth-wise separable temporal convolutions and a clever "[CLS] token shifting" mechanism, which injects temporal context into spatial self-attention by shifting global representations across adjacent frames.

Results and Scalability

Side4Video achieves a dramatic 75% reduction in memory usage compared to previous state-of-the-art adapter methods. This efficiency breakthrough allows us to scale to the ViT-E backbone, which is 14.5x larger than the previous standard, ViT-L.

Performance vs. memory footprint on SSv2, highlighting Side4Video's ability to scale to the massive ViT-E backbone.

Our approach sets new performance standards across several benchmarks:

  • Action Recognition: On the temporally-intensive Something-Something V2 dataset, Side4Video with ViT-E achieved 75.2% Top-1 accuracy. On Kinetics-400, it reached 88.6%.
  • Text-Video Retrieval: For tasks like MSR-VTT, our method improved the R@1 metric by 1.1 points while using 30% less memory than the CLIP4Clip baseline.

Conclusion

Side4Video demonstrates that the primary obstacle to using massive foundation models for video was not parameter count, but the memory overhead of backpropagation. By utilizing a side-network approach, we enable state-of-the-art video understanding on standard hardware, providing a scalable blueprint for future image-to-video transfer learning research.

Summary updated

BibTeX
@misc{yao2023side,
  author = {Huanjin Yao and Wenhao Wu and Zhiheng Li},
  title = {{Side4Video: Spatial-Temporal Side Network for Memory-Efficient Image-to-Video Transfer Learning}},
  year = {2023},
  eprint = {2311.15769},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.15769},
}
Figure