Skip to content

aliasgharkhani/Masktune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MaskTune: Mitigating Spurious Correlations by Forcing to Explore, NeurIPS 2022

This is the official pytorch implementation of MaskTune: Mitigating Spurious Correlations by Forcing to Explore, NeurIPS 2022. MaskTune is a technique for mitigating shortcut learning in machine learning algorithms.

How to use

  1. Clone the code (now you should have a folder named MaskTune)
  2. Inside Masktune/ create datasets/ folder
  3. For catsvsdogs and inl9 (the Background Challenge) expriments, inside MaskTune/datasets/ create catsvsdogs/raw/ and in9l/raw/ folders. For other datasets ignore this step.
  4. Download the dataset you want (you don't need to download cifar10, mnist, and svhn because they will be downloaded automatically).
  5. For Waterbirds, please download the corrected version of the Waterbirds dataset from here (The original Waterbirds dataset has some label and image noise). Then extract it into the Masktune/datasets/Waterbirds/ (so inside this folder you should have images folder)
  6. For CelebA, please download img_align_celeba folder from here. After extracting it, you should see a folder named archive. Pass this folder's path to the --dataset_dir in the bash file.
  7. To run an experiment, use the bash files in MaskTune/bash_files. First, change the second line of the bash file to the path of MaskTune folder (e.g., downloads/MaskTune). You have to set base_dir to the path of MaskTune/ folder and dataset_dir to the path of corresponding dataset (e.g., for celebA set this to {base_dir}/datasets/CelebA/raw)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published