Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAIL: Multi-Modal Interactive Agent Layer for Few-Shot Universal Cross-Domain Retrieval and Beyond [NeurIPS 2025]

Official github repository for MAIL: Multi-Modal Interactive Agent Layer for Few-Shot Universal Cross-Domain Retrieval and Beyond

The code of applying MAIL to few-shot classification can be found at MAIL-for-classification

Erratum: Parameter Count in Fig. 1

We would like to clarify a minor error in the efficiency–accuracy comparison reported in Fig. 1 of the MAIL paper. The trainable parameter count of MAIL was originally reported as 0.50% at a retrieval performance of 62.05. This count inadvertently omitted the parameters of the final projection layer. The corrected point should therefore be (1.02, 62.05).

This correction affects only the reported parameter count and does not change the experimental performance or the conclusions of the paper.

For the comparison in the MAIL++ journal extension, we do not directly reuse this corrected value. Instead, we re-evaluate MAIL under the same configuration as MAIL++ for a fair comparison, with the final projection layer frozen and the bridge rank set to 16.

We sincerely apologize for any confusion this may have caused.

Requirements

  • Ubuntu 22.04.4
  • RTX4090D-24GB or better
  • CUDA 11.3
  • python 3.10.4
  • torch 1.12.1 py3.10_cuda11.3_cudnn8.3.2_0
  • torchvision 0.13.1 py310_cu113

Setups

  1. download the zip file.

  2. Install dependencies:

cd ./MAIL
conda env create -f MAIL.yaml
conda activate MAIL

Data Preparation

  1. Download DomainNet using scripts in MAIL/src/data/downloads.

    cd ./src/data/downloads
    bash download_domainnet.sh
  2. For Sketchy and TU-berlin, please refer to ProS.

  3. The directory is expected to be in the structure below:

    ├── DomainNet
    │   ├── clipart # images from clipart domain
    │   ├── clipart_test.txt # class names for testing
    │   ├── clipart_train.txt # class names for training
    │   ├── down.sh
    │   ├── infograph
    │   ├── infograph_test.txt
    │   ├── infograph_train.txt
    │   ├── painting
    │   ├── painting_test.txt
    │   ├── painting_train.txt
    │   ├── quickdraw
    │   ├── quickdraw_test.txt
    │   ├── quickdraw_train.txt
    │   ├── real
    │   ├── real_test.txt
    │   ├── real_train.txt
    │   ├── sketch
    │   ├── sketch_test.txt
    │   └── sketch_train.txt
    ├── Sketchy
    │   ├── extended_photo
    │   ├── photo
    │   ├── sketch
    │   └── zeroshot1
    └── TUBerlin
        ├── images
        └── sketches

Experiments

The algorithms are in ./src/algos

Be sure to modifiy the data_path and code_path in each main.py

baselines:

1: MaPLe+IVLP+VPT+VPT-D:

cd ./src/algos/1_PromptFamily
sh run.sh

2: MMA:

cd ./src/algos/2_MMA
sh run.sh

3: IVLA:

cd ./src/algos/3_IVLA
sh run.sh

4: LoRA:

cd ./src/algos/4_LoRA
sh run.sh

5: BitFit:

cd ./src/algos/5_BitFit
sh run.sh

6: ProS:

cd ./src/algos/6_ProS
sh run.sh

MAIL / MAIL++(Ours):

cd ./src/algos/MAIL
sh run.sh

cd ./src/algos/MAIL++
sh run.sh

BLIP: MAIL / MAIL++(Ours):

cd ./src/algos/BLIP_MAIL
# for blip zero shot
sh run_blip_zero_shot.sh
# for blip_ivlu
sh run_ivlu.sh
# for blip_mail
sh run_mail.sh
# for blip_mail++
sh run_mail++.sh

Acknowledgements

Our code implementation is based on CoOp, MaPle, MMA, CLIP-LoRA, and ProS. We thank all the authors for releasing their code.

About

[NeurIPS 2025] Official PyTorch Code for "Multi-Modal Interactive Agent Layer for Few-Shot Universal Cross-Domain Retrieval and Beyond"

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages