Supervised Fine-tuning in turn Improves Visual Foundation Models

Xiaohu Jiang, Yixiao Ge, Yuying Ge, Chun Yuan, Ying ShanarXiv 2024 · DOI

Abstract

Vision foundation models (VFMs) like CLIP excel at global image-text alignment but often lack fine-grained spatial and semantic understanding. We present ViSFT (Vision Supervised Fine-tuning), a two-stage methodology that adapts the instruction-tuning paradigm from NLP to the vision domain. By fine-tuning a pretrained backbone on a small set of high-quality annotated tasks—specifically object detection, instance segmentation, and image captioning—using Low-Rank Adaptation (LoRA), we demonstrate significant performance gains on diverse out-of-domain tasks such as OCR and VQA. Our findings suggest that fine-grained knowledge is often latent in VFMs and can be effectively "unleashed" through targeted supervised fine-tuning.

Introduction: The Fine-Grained Gap in Vision Models

Vision foundation models (VFMs) have revolutionized computer vision by learning from massive datasets of image-text pairs. However, these models often exhibit a significant weakness: they struggle with "fine-grained" details, such as precise object localization or reading small text. This is largely because their pretraining objective focuses on global, image-level descriptions rather than localized features.

Comparison of the standard NLP paradigm and the proposed ViSFT paradigm for vision models.

While incorporating region-level data during pretraining is a potential solution, scaling high-quality, localized data (e.g., bounding boxes) is prohibitively expensive compared to raw image-caption pairs. Inspired by the success of instruction tuning in NLP, we ask: Can we "nudge" a pretrained vision model to recognize fine-grained details using a small, high-quality dataset?

Methodology: The ViSFT Framework

We propose ViSFT, a two-stage approach designed to transfer fine-grained knowledge from specific tasks into a general-purpose vision backbone without compromising its original capabilities.

Overview of the ViSFT framework, including pretraining, in-domain supervised fine-tuning, and out-of-domain evaluation.

Stage 1: Head Initialization

To avoid disrupting the pretrained features, we first attach specialized "task heads" (e.g., for detection or segmentation) to a frozen vision backbone (specifically, the EVA-CLIP model). We train only these heads on the COCO dataset, ensuring they become compatible with the backbone's existing feature space before any weights in the backbone are modified.

Stage 2: Joint Learning with LoRA

In the second stage, the task heads are frozen, and the backbone is partially unfrozen using LoRA (Low-Rank Adaptation). By training the backbone on multiple tasks simultaneously (detection, segmentation, and captioning) while keeping the heads fixed, the model is forced to update its internal representations to support these diverse, fine-grained requirements. This prevents "domain conflict" and ensures the new knowledge is integrated into the backbone's weights rather than being isolated in task-specific heads.

Experimental Setup and Results

The model was trained exclusively on the COCO dataset. To evaluate its generalization capabilities, we tested it on several "out-of-domain" tasks for which it received no specific fine-tuning, including OCR benchmarks (IC03, IC15, SVT), Grounded Object Identification (M3IT), and Visual Question Answering (OK-VQA).

Key Insights

  • The "Unleashing" Hypothesis: Fine-grained information, such as object boundaries, appears to be latent within models like CLIP. ViSFT acts as a mechanism to unlock and make this knowledge accessible for downstream tasks.
  • Task Diversity is Essential: Ablation studies showed that removing any of the core training tasks (detection, segmentation, or captioning) led to a performance drop. Similar to NLP instruction tuning, a variety of "instructions" is key to generalization.
  • Efficiency: We successfully fine-tuned a 4.4 billion parameter model using only 8 V100 GPUs in under two days, proving that significant improvements do not always require massive compute.

Performance Gains

  • OCR: Accuracy improved by 2.5 to 3.2 percentage points across various benchmarks.
  • Robustness: Zero-shot accuracy on ImageNet-A (adversarial) increased from 82.1% to 82.4%.
  • VQA: Performance on OK-VQA rose from 31.5% to 32.8%.
  • Retrieval: Image retrieval on COCO within the BLIP-2 architecture improved by 1.1%.

Conclusion and Future Work

ViSFT demonstrates that supervised fine-tuning on a small set of diverse, high-quality tasks can significantly enhance the general capabilities of vision foundation models. While this study focused on the vision transformer, future work could explore applying SFT to the text encoder to further enhance vision-linguistic tasks. Additionally, scaling to larger, more diverse annotated datasets may push performance boundaries even further, potentially identifying an "optimal" mix of vision tasks for general-purpose SFT.

Summary updated

Abstract

Image-text training like CLIP has dominated the pretraining of vision foundation models in recent years. Subsequent efforts have been made to introduce region-level visual learning into CLIP's pretraining but face scalability challenges due to the lack of large-scale region-level datasets. Drawing inspiration from supervised fine-tuning (SFT) in natural language processing such as instruction tuning, we explore the potential of fine-grained SFT in enhancing the generation of vision foundation models after their pretraining. Thus a two-stage method ViSFT (Vision SFT) is proposed to unleash the fine-grained knowledge of vision foundation models. In ViSFT, the vision foundation model is enhanced by performing visual joint learning on some in-domain tasks and then tested on out-of-domain benchmarks. With updating using ViSFT on 8 V100 GPUs in less than 2 days, a vision transformer with over 4.4B parameters shows improvements across various out-of-domain benchmarks including vision and vision-linguistic scenarios.
BibTeX
@misc{jiang2024supervised,
  author = {Xiaohu Jiang and Yixiao Ge and Yuying Ge and Chun Yuan and Ying Shan},
  title = {{Supervised Fine-tuning in turn Improves Visual Foundation Models}},
  year = {2024},
  eprint = {2401.10222},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.10222},
}
Figure