Dual Memory Networks: A Versatile Adaptation Approach for Vision-Language Models

Yabin Zhang, Wenjie Zhu, Hui Tang, Zhiyuan Ma, Kaiyang Zhou +1 more
3/26/2024
cs.CVcs.AIcs.LG

No official code found. Best implementation: YBZh/DMN (97 stars, MIT, last commit 2024-07-04).

Abstract

With the emergence of pre-trained vision-language models like CLIP, how to adapt them to various downstream classification tasks has garnered significant attention in recent research. The adaptation strategies can be typically categorized into three paradigms: zero-shot adaptation, few-shot adaptation, and the recently-proposed training-free few-shot adaptation. Most existing approaches are tailored for a specific setting and can only cater to one or two of these paradigms. In this paper, we introduce a versatile adaptation approach that can effectively work under all three settings. Specifically, we propose the dual memory networks that comprise dynamic and static memory components. The static memory caches training data knowledge, enabling training-free few-shot adaptation, while the dynamic memory preserves historical test features online during the testing process, allowing for the exploration of additional data insights beyond the training set. This novel capability enhances model performance in the few-shot setting and enables model usability in the absence of training data. The two memory networks employ the same flexible memory interactive strategy, which can operate in a training-free mode and can be further enhanced by incorporating learnable projection layers. Our approach is tested across 11 datasets under the three task settings. Remarkably, in the zero-shot scenario, it outperforms existing methods by over 3\% and even shows superior results against methods utilizing external training data. Additionally, our method exhibits robust performance against natural distribution shifts. Codes are available at \url{https://github.com/YBZh/DMN}.

View on arXivView PDF

Code Implementations(1)

YBZh/DMNCommunity100%
MIT

CVPR2024: Dual Memory Networks: A Versatile Adaptation Approach for Vision-Language Models

974CSS, HTMLDec 19, 20232 years agoMIT
dual-memory-networkmodel-adaptationvision-language-model

Similar Papers

Cite this paper

@article{zhang2024dual,
  title  = {Dual Memory Networks: A Versatile Adaptation Approach for Vision-Language Models},
  author = {Yabin Zhang and Wenjie Zhu and Hui Tang and Zhiyuan Ma and Kaiyang Zhou and Lei Zhang},
  year   = {2024},
  eprint = {2403.17589},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.17589v1},
  journal = {CVPR 2024 2024}
}

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

Discussion