Skip to content

Bias Mimicking: A simple sampling approach for Bias Mitigation (CVPR 23)

Notifications You must be signed in to change notification settings

mqraitem/Bias-Mimicking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bias Mimicking: A simple sampling approach for Bias Mitigation

Official Pytorch implementation of Bias Mimicking: A simple sampling approach for Bias Mitigation.

Setup

Set up conda environment

conda create -n bias_mimicking python=3.8
conda activate bias_mimicking

Install packages

  • pytorch=1.10.1
  • scipy
  • tqdm
  • scikit-learn

Prepare dataset.

  • CelebA
    Download CelebA dataset under data/celeba

  • UTKFace
    Download UTKFace dataset under data/utk_face

  • CIFAR10
    Download CIFAR10 dataset under data/cifar10

As discussed in the paper, we train on subsampled versions of CelebA and UTKFace. The information required to reproduce the the splits are in data/[DATASET]/pickles. The code will automatically load the right splits.

Train.

From the main directory, run:

python train_[DATASET]/train_[DATASET]_[METHOD].py --seed [SEED]

To train our method on celeba, run:

python train_celeba/train_celeba_bm.py --mode [none/us/uw/os] --seed [SEED]

where mode refers to whether the distribution is left as is/undersampled/upweighted/oversampled when training the predictive linear layer.

Acknowledgements

The code for non sampling methods builds on this work. Furthermore, the code for GroupDRO is obtained from this work

Citation

If you find this repository useful please give it a star and cite as follows! :) :

    @inproceedings{qraitem2023bias,
      title={Bias Mimicking: A Simple Sampling Approach for Bias Mitigation},
      author={Qraitem, Maan and Saenko, Kate and Plummer, Bryan A},
      booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
      pages={20311--20320},
      year={2023}
    }

About

Bias Mimicking: A simple sampling approach for Bias Mitigation (CVPR 23)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages