Weight Copy and Low-Rank Adaptation for Few-Shot Distillation of Vision Transformers

Diana-Nicoleta Grigore, Mariana-Iuliana Georgescu, Jon Alvarez Justo, Tor Johansen, Andreea Iuliana Ionescu +1 more
4/14/2024
cs.CVcs.AIcs.LG

Official code: dianagrigore/WeCoLoRA (8 stars, last commit 2024-11-02).

Abstract

Few-shot knowledge distillation recently emerged as a viable approach to harness the knowledge of large-scale pre-trained models, using limited data and computational resources. In this paper, we propose a novel few-shot feature distillation approach for vision transformers. Our approach is based on two key steps. Leveraging the fact that vision transformers have a consistent depth-wise structure, we first copy the weights from intermittent layers of existing pre-trained vision transformers (teachers) into shallower architectures (students), where the intermittence factor controls the complexity of the student transformer with respect to its teacher. Next, we employ an enhanced version of Low-Rank Adaptation (LoRA) to distill knowledge into the student in a few-shot scenario, aiming to recover the information processing carried out by the skipped teacher layers. We present comprehensive experiments with supervised and self-supervised transformers as teachers, on six data sets from various domains (natural, medical and satellite images) and tasks (classification and segmentation). The empirical results confirm the superiority of our approach over state-of-the-art competitors. Moreover, the ablation results demonstrate the usefulness of each component of the proposed pipeline. We release our code at https://github.com/dianagrigore/WeCoLoRA.

View on arXivView PDF

Code Implementations(1)

WeCoLoRA

80Python, Jupyter NotebookOct 30, 20241 years agoNOASSERTION

Similar Papers

Cite this paper

@article{grigore2024weight,
  title  = {Weight Copy and Low-Rank Adaptation for Few-Shot Distillation of Vision Transformers},
  author = {Diana-Nicoleta Grigore and Mariana-Iuliana Georgescu and Jon Alvarez Justo and Tor Johansen and Andreea Iuliana Ionescu and Radu Tudor Ionescu},
  year   = {2024},
  eprint = {2404.09326},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.09326v3}
}

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/2404.09326.svg)](https://codeofpaper.com/paper/2404.09326)

Discussion