Home

Awesome

Masked Unsupervised Self-training for Zero-shot Image Classification

This is the PyTorch code of the MUST paper. The repository supports finetuning a CLIP model on unlabeled images from a target domain.

Requirements

Dataset Setup

Dataset paths are stored in dataset_catalog.json, which need to be modified to local paths. The imagenet dataset follows the standard folder structure. For other datasets, please refer to the scrips from VISSL to download and prepare. CLIP's labels and prompt templates are stored in classes.json and templates.json.

Training

Run the following code on 16 A100 GPUs:

<pre>python -m torch.distributed.run --nproc_per_node=16 train.py --dataset [name_of_dataset] --clip_model ViT-B/16 </pre>

Results

ViT-B/16:

MethodImageNetSUN397Food101GTSRBDTDUCF101
CLIP68.364.488.743.444.768.8
MUST77.771.892.765.554.181.1

ViT-L/14:

MethodImageNetSUN397Food101GTSRBDTDUCF101
CLIP75.567.492.950.655.477.0
MUST82.174.695.368.762.685.7

Citation

<pre> @inproceedings{li2022masked, title={Masked Unsupervised Self-training for Label-Free Image Classification}, author={Junnan Li and Silvio Savarese and Steven C. H. Hoi}, year={2023}, booktitle={ICLR}, } </pre>