Skip to content

Matt-Su/DR-Adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

May 12, 2024
6223dfd · May 12, 2024

History

6 Commits
May 12, 2024
May 12, 2024
May 12, 2024
May 12, 2024
May 12, 2024
May 12, 2024
May 12, 2024
May 12, 2024

Repository files navigation

Domain-Rectifying Adapter for Cross-domain Few-Shot Segmentation

The codebase contains the official code of our paper Domain-Rectifying Adapter for Cross-Domain Few-Shot Segmentation, CVPR 2024.

Introduction

In our research, we employ the plug-and-play Domain Adapter to investigate the Cross-Domain Few-Shot Segmentation (CDFSS) problem. By integrating the adapter into the initial stages of the baseline model, we aim to align images from various domains to a standardized source domain, thereby mitigating domain discrepancies across different domains.

The Cross-Domain Few-Shot Semantic Segmentation includes data from the Deepglobe [1], ISIC2018 [2-3], Chest X-ray [4-5], and FSS-1000 [6] datasets.

Data preparation

Download

You can follow PATNet to prepare the source domain and target domain datasets.

Source domain:

  • PASCAL VOC2012:

    Download PASCAL VOC2012 devkit (train/val data):

    wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar

    Download PASCAL VOC2012 SDS extended mask annotations from [Google Drive].

Target domains:

models:

Please place the "Ori_SSP_trained_on_VOC.pth", trained in SSP, under the directory "./outdir/models/", and put the "resnet50.pth" under "./outdir/models/pretrained/".

File Organization

    DR_Adapter                 # current (project) directory
       ├── codes               # various codes
       ├── ./outdir            # (dir)pretrained model and output model 
       │       ├── Ori_SSP_trained_on_VOC.pth
       │       ├── pretrained/
       │         └── resnet50.pth
       └── ./data
           ├── VOCdevkit/                # PASCAL VOC2012 devkit
           │    └── VOC2012/            
           │         ├── Annotations/
           │         ├── ImageSets/
           │         ├── ...
           │         └── SegmentationClassAug/
           ├── chest/           
           │    └── LungSegmentation      # lung benchmark
           │
           ├── fss
           │    └── FSS-1000/            # fss benchmark
           │        ├── abacus/   
           │        ├── ...
           │        └── zucchini/
           ├── ISIC
           │    └── ISIC/                # ISIC benchmark
           └── deepglobe
                └── Deepglobe/            # deepglobe benchmark

Run the code

Training

python train.py --train_datapath ./data/VOCdevkit
                --shot 1
                --benchmark pascal
                --bsz 8
                --logpath "your_experiment_name"

Testing

python test.py --test_datapath {./data/fss, ./data/chest, ./data/ISIC, ./data/deepglobe}
               --benchmark {fss,lung,isic,deepglobe}
               --nshot {1, 5} 
               --checkpoint_path "./outdir/models/pascal/best_model.pth"

Acknowledgement

This codebase is built based on SSP's baseline code and we borrow PATNet's evaluation protocol for the different dataset. We thank SSP and PATNet and other FSS works for their great contributions.

Citation

@article{su2024domain,
  title={Domain-Rectifying Adapter for Cross-Domain Few-Shot Segmentation},
  author={Su, Jiapeng and Fan, Qi and Lu, Guangming and Chen, Fanglin and Pei, Wenjie},
  journal={arXiv preprint arXiv:2404.10322},
  year={2024}
}

References

[1] Demir, I., Koperski, K., Lindenbaum, D., Pang, G., Huang, J., Basu, S., Hughes, F., Tuia, D., Raskar, R.: Deepglobe 2018: A challenge to parse the earth through satellite images. In: The IEEE Conference on Computer Vision and Pattern Recog- nition (CVPR) Workshops (June 2018)Li, X., Wei, T., Chen, Y.P., Tai, Y.W., Tang, C.K.: Fss-1000: A 1000-class dataset for few-shot segmentation. In: Proceedings of the IEEE/CVF Conference on Com- puter Vision and Pattern Recognition. pp. 2869–2878 (2020)

[2] Codella, N., Rotemberg, V., Tschandl, P., Celebi, M.E., Dusza, S., Gutman, D., Helba, B., Kalloo, A., Liopyris, K., Marchetti, M., et al.: Skin lesion analysis toward melanoma detection 2018: A challenge hosted by the international skin imaging collaboration (isic). arXiv preprint arXiv:1902.03368 (2019)

[3] Tschandl, P., Rosendahl, C., Kittler, H.: The ham10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions. Scientific data 5, 180161 (2018)

[4] Candemir, S., Jaeger, S., Palaniappan, K., Musco, J.P., Singh, R.K., Xue, Z., Karargyris, A., Antani, S., Thoma, G., McDonald, C.J.: Lung segmentation in chest radiographs using anatomical atlases with nonrigid registration. IEEE trans- actions on medical imaging 33(2), 577–590 (2013)

[5] Jaeger, S., Karargyris, A., Candemir, S., Folio, L., Siegelman, J., Callaghan, F., Xue, Z., Palaniappan, K., Singh, R.K., Antani, S., et al.: Automatic tuberculosis screening using chest radiographs. IEEE transactions on medical imaging 33(2), 233–245 (2013)

[6] Li, X., Wei, T., Chen, Y.P., Tai, Y.W., Tang, C.K.: Fss-1000: A 1000-class dataset for few-shot segmentation. In: Proceedings of the IEEE/CVF Conference on Com- puter Vision and Pattern Recognition. pp. 2869–2878 (2020)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages