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
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.
- 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
-
download the zip file.
-
Install dependencies:
cd ./MAIL
conda env create -f MAIL.yaml
conda activate MAIL-
Download DomainNet using scripts in
MAIL/src/data/downloads.cd ./src/data/downloads bash download_domainnet.sh -
For Sketchy and TU-berlin, please refer to ProS.
-
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
The algorithms are in ./src/algos
Be sure to modifiy the data_path and code_path in each main.py
cd ./src/algos/1_PromptFamily
sh run.shcd ./src/algos/2_MMA
sh run.shcd ./src/algos/3_IVLA
sh run.shcd ./src/algos/4_LoRA
sh run.shcd ./src/algos/5_BitFit
sh run.shcd ./src/algos/6_ProS
sh run.shcd ./src/algos/MAIL
sh run.sh
cd ./src/algos/MAIL++
sh run.sh
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
Our code implementation is based on CoOp, MaPle, MMA, CLIP-LoRA, and ProS. We thank all the authors for releasing their code.