Giter Site home page Giter Site logo

zhihengli-ur / debian Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 3.0 440 KB

Official code of "Discover and Mitigate Unknown Biases with Debiasing Alternate Networks" (ECCV 2022)

License: GNU General Public License v3.0

Python 99.28% Shell 0.72%
bias-detection bias-mitigation computer-vision responsible-ai trustworthy-ai

debian's Introduction

Discover and Mitigate Unknown Biases with Debiasing Alternate Networks [ECCV 2022]

Paper

Zhiheng Li, Anthony Hoogs, Chenliang Xu

University of Rochester, Kitware, Inc.

Contact: Zhiheng Li (email: [email protected], homepage: https://zhiheng.li)

abdf

TL;DR: We introduce Debiasing Alternate Networks (DebiAN) to discover and mitigate unknown biases of an image classifier. DebiAN alternately trains two networks—a discover and a classifier. Discoverer actively identifies classifier’s unknown biases. At the same time, the classifier mitigates the biases identified by the discoverer.

Multi-Color MNIST Dataset

abdf

In this work, we propose the Multi-Color MNIST dataset to better benchmark debiasing methods under the multi-bias setting. It contains two bias attributes—left color and right color.

Download and Untar Multi-Color MNIST Dataset

cd data

wget https://github.com/zhihengli-UR/DebiAN/releases/download/v1.0/multi_color_mnist.tar.gz -O multi_color_mnist.tar.gz

tar xvzf multi_color_mnist.tar.gz

Generate Multi-Color MNIST Dataset

If you want to generate other bias-aligned ratio combinations between left color and right color bias attributes, you can use the following command:

bash scripts/make_multi_color_mnist.sh

Data Preparation

Put each dataset in a folder under the data directory as follows:

data
├── bar
├── bffhq
├── celeba
├── lsun
├── multi_color_mnist
└── places365

Biased Action Recognition (BAR): download BAR dataset from here and unzip it to data/bar

bFFHQ: download bFFHQ dataset from here and unzip it to data/bffhq

CelebA: download CelebA dataset from here and unzip it to data/celeba

LSUN: download the LSUN dataset from here and unzip it to data/lsun

Places365: download the Places365 dataset from here and unzip it to data/places365

Dependencies

pytorch

torchvision

lmdb

imageio

Training and Evaluation

bash scripts/${DATASET_NAME}_debian.sh  # ${DATASET_NAME} = bar, bffhq, celeba_blond, celeba_gender, multi_color_mnist, or scene

Add your method

This code base can be used to add future methods for training and evaluation. To achieve that, simply create a new Trainer class for your method that inherits the BaseTrainer class in each experiment folder (e.g., bffhq_exp).

Citation

Please cite our work if you use DebiAN or the Multi-Color MNIST dataset.

@inproceedings{Li_2022_ECCV,
  title = {Discover and {{Mitigate Unknown Biases}} with {{Debiasing Alternate Networks}}},
  booktitle = {The {{European Conference}} on {{Computer Vision}} ({{ECCV}})},
  author = {Li, Zhiheng and Hoogs, Anthony and Xu, Chenliang},
  year = {2022}
}

debian's People

Contributors

zhihengli-ur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.