Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to CycleMix

This is the official code for the "CycleMix: Mixing Source Domains for Domain Generalization in Style-Dependent Data" paper, to be published in the proceedings of the 13th Hellenic Conference on Artificial Intelligence (SETN 2024). The preprint is available here.

Method

In this work, we tackle the Domain Generalization (DG) problem by training a robust feature extractor which disregards features attributed to image-style but infers based on style-invariant image representations. To achieve this, we train CycleGAN models to learn the different styles present in the training data and randomly mix them together to create samples with novel style attributes to improve generalization.

drawing

CycleGAN Weights

The weights for each model can be found here.

Quick start

Download the datasets:

python3 -m domainbed.scripts.download \
       --data_dir=./domainbed/data

Train a model:

python3 -m domainbed.scripts.train\
       --data_dir=./domainbed/data/MNIST/\
       --algorithm CYCLEMIX\
       --dataset PACS\
       --test_env 2

Launch a sweep:

python -m domainbed.scripts.sweep launch\
       --data_dir=/my/datasets/path\
       --output_dir=/my/sweep/output/path\
       --command_launcher local\
       --algorithms CYCLEMIX\
       --datasets PACS\
       --n_hparams 2\
       --n_trials 1

To view the results of your sweep:

python -m domainbed.scripts.collect_results\
       --input_dir=/my/sweep/output/path

License

This source code is released under the MIT license, included here.

Cite Us

If you use the above code or pre-trained CycleGAN weights for your research please cite our paper:

@misc{ballas2024cyclemixmixingsourcedomains,
      title={CycleMix: Mixing Source Domains for Domain Generalization in Style-Dependent Data}, 
      author={Aristotelis Ballas and Christos Diou},
      year={2024},
      eprint={2407.13421},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2407.13421}, 
}

About

This is the official code repository for CycleMix. CycleMix uses pretrained CycleGAN models to create novel styles for input samples.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages