Stitched ViTs are Flexible Vision Backbones

Zizheng Pan, Jing Liu, Haoyu He, Jianfei Cai, Bohan Zhuang
6/30/2023
cs.CVcs.AIcs.LG

Official code: ziplab/SN-Netv2 (29 stars, Apache-2.0, last commit 2024-01-23).

Abstract

Large pretrained plain vision Transformers (ViTs) have been the workhorse for many downstream tasks. However, existing works utilizing off-the-shelf ViTs are inefficient in terms of training and deployment, because adopting ViTs with individual sizes requires separate trainings and is restricted by fixed performance-efficiency trade-offs. In this paper, we are inspired by stitchable neural networks (SN-Net), which is a new framework that cheaply produces a single model that covers rich subnetworks by stitching pretrained model families, supporting diverse performance-efficiency trade-offs at runtime. Building upon this foundation, we introduce SN-Netv2, a systematically improved model stitching framework to facilitate downstream task adaptation. Specifically, we first propose a two-way stitching scheme to enlarge the stitching space. We then design a resource-constrained sampling strategy that takes into account the underlying FLOPs distributions in the space for better sampling. Finally, we observe that learning stitching layers as a low-rank update plays an essential role on downstream tasks to stabilize training and ensure a good Pareto frontier. With extensive experiments on ImageNet-1K, ADE20K, COCO-Stuff-10K and NYUv2, SN-Netv2 demonstrates superior performance over SN-Netv1 on downstream dense predictions and shows strong ability as a flexible vision backbone, achieving great advantages in both training efficiency and deployment flexibility. Code is available at https://github.com/ziplab/SN-Netv2.

View on arXivView PDF

Code Implementations(1)

ziplab/SN-Netv2Official100%
Apache-2.0

[ECCV 2024] This is the official implementation of "Stitched ViTs are Flexible Vision Backbones".

291Shell, PythonJun 29, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{pan2023stitched,
  title  = {Stitched ViTs are Flexible Vision Backbones},
  author = {Zizheng Pan and Jing Liu and Haoyu He and Jianfei Cai and Bohan Zhuang},
  year   = {2023},
  eprint = {2307.00154},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.00154v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.00154.svg)](https://codeofpaper.com/paper/2307.00154)

Discussion