Home

Awesome

Exploring Model Transferability through the Lens of Potential Energy

Official pytorch implementation of "Exploring Model Transferability through the Lens of Potential Energy" in International Conference on Computer Vision (ICCV) 2023.

By Xiaotong Li, Zixuan Hu, Yixiao Ge, Ying Shan, Ling-Yu Duan.

Introduction

Transfer learning has become crucial in computer vision tasks due to the vast availability of pre-trained deep learning models. However, selecting the optimal pre-trained model from a diverse pool for a specific downstream task remains a challenge. Existing methods for measuring the transferability of pre-trained models rely on statistical correlations between encoded static features and task labels, but they overlook the impact of underlying representation dynamics during fine-tuning, leading to unreliable results, especially for self-supervised models. In this paper, we present an insightful physics-inspired approach named PED to address these challenges. We reframe the challenge of model selection through the lens of potential energy and directly model the interaction forces that influence fine-tuning dynamics. By capturing the motion of dynamic representations to decline the potential energy within a force-driven physical model, we can acquire an enhanced and more stable observation for estimating transferability. The experimental results on 10 downstream tasks and 12 self-supervised models demonstrate that our approach can seamlessly integrate into existing ranking techniques and enhance their performances, revealing its effectiveness for the model selection task and its potential for understanding the mechanism in transfer learning.

Overview

Comparisons of weighted Kendall's tau on 11 downstream classification datasets when selecting 11 pretrained self-supervised models.

MethodReferenceAircraftCaltech101CarsCifar10Cifar100FlowersVOCPetsFoodDTD
$\mathcal{N}$LEEPCVPR'21-0.0290.5250.486-0.0440.2760.534-0.1010.7920.5740.641
PARCNIPS'21-0.030.1960.4240.147-0.1360.6220.6180.4960.3590.447
LogMEICML'210.2230.0510.3750.295-0.0080.6040.1580.6840.5700.627
LogME+Oursthis paper0.5090.5050.5160.5110.6670.7150.6200.7950.6500.780
SFDAECCV'220.2540.5230.5150.6190.5480.7730.5680.5860.6850.749
SFDA+Oursthis paper0.4640.6140.6470.6730.5680.7770.5830.4620.5810.907
GBCCVPR'220.048-0.180.4240.008-0.2490.532-0.0410.6550.2680.05
GBC+Oursthis paper0.4620.2850.5470.0170.3590.768-0.0350.6840.4020.576

Getting Started

Requirements

conda install pytorch==1.7.1 torchvision==0.8.2 cudatoolkit=10.1 -c pytorch
pip install timm==0.4.9

Preparation

Pipeline of Model selection using transferability

python finetune.py -m byol -d cifar10
python forward_feature.py -m byol -d cifar10
python forward_feature.py -m byol -d imagenet
python evaluate_metric_cpu.py -me PED -d cifar10
python tw.py -me PED -d cifar10

Acknowledgement

This repository is built using the SFDA and ssl-transfer repository. Thanks for their excellent projects!

Reference

@InProceedings{Li_2023_ICCV,
    author    = {Li, Xiaotong and Hu, Zixuan and Ge, Yixiao and Shan, Ying and Duan, Ling-Yu},
    title     = {Exploring Model Transferability through the Lens of Potential Energy},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2023},
    pages     = {5429-5438}
}