Official Pytorch implementation of "Unbiased Classification Through Bias-Contrastive and Bias-Balanced Learning (NeurIPS 2021)

Overview

Unbiased Classification Through Bias-Contrastive and Bias-Balanced Learning (NeurIPS 2021)

Official Pytorch implementation of Unbiased Classification Through Bias-Contrastive and Bias-Balanced Learning (NeurIPS 2021)

Setup

This setting requires CUDA 11. However, you can still use your own environment by installing requirements including PyTorch and Torchvision.

  1. Install conda environment and activate it
conda env create -f environment.yml
conda activate biascon
  1. Prepare dataset.
  • Biased MNIST
    By default, we set download=True for convenience.
    Thus, you only have to make the empty dataset directory with mkdir -p data/biased_mnist and run the code.

  • CelebA
    Download CelebA dataset under data/celeba

  • UTKFace
    Download UTKFace dataset under data/utk_face

  • ImageNet & ImageNet-A
    We use ILSVRC 2015 ImageNet dataset.
    Download ImageNet under ./data/imagenet and ImageNet-A under ./data/imagenet-a

Biased MNIST (w/ bias labels)

We use correlation {0.999, 0.997, 0.995, 0.99, 0.95, 0.9}.

Bias-contrastive loss (BiasCon)

python train_biased_mnist_bc.py --corr 0.999 --seed 1

Bias-balancing loss (BiasBal)

python train_biased_mnist_bb.py --corr 0.999 --seed 1

Joint use of BiasCon and BiasBal losses (BC+BB)

python train_biased_mnist_bc.py --bb 1 --corr 0.999 --seed 1

CelebA

We assess CelebA dataset with target attributes of HeavyMakeup (--task makeup) and Blonde (--task blonde).

Bias-contrastive loss (BiasCon)

python train_celeba_bc.py --task makeup --seed 1

Bias-balancing loss (BiasBal)

python train_celeba_bb.py --task makeup --seed 1

Joint use of BiasCon and BiasBal losses (BC+BB)

python train_celeba_bc.py --bb 1 --task makeup --seed 1

UTKFace

We assess UTKFace dataset biased toward Race (--task race) and Age (--task age) attributes.

Bias-contrastive loss (BiasCon)

python train_utk_face_bc.py --task race --seed 1

Bias-balancing loss (BiasBal)

python train_utk_face_bb.py --task race --seed 1

Joint use of BiasCon and BiasBal losses (BC+BB)

python train_utk_face_bc.py --bb 1 --task race --seed 1

Biased MNIST (w/o bias labels)

We use correlation {0.999, 0.997, 0.995, 0.99, 0.95, 0.9}.

Soft Bias-contrastive loss (SoftCon)

  1. Train a bias-capturing model and get bias features.
python get_biased_mnist_bias_features.py --corr 0.999 --seed 1
  1. Train a model with bias features.
python train_biased_mnist_softcon.py --corr 0.999 --seed 1

ImageNet

We use texture cluster information from ReBias (Bahng et al., 2020).

Soft Bias-contrastive loss (SoftCon)

  1. Train a bias-capturing model and get bias features.
python get_imagenet_bias_features.py --seed 1
  1. Train a model with bias features.
python train_imagenet_softcon.py --seed 1
Owner
Youngkyu
Machine Learning Engineer / Backend Engineer
Youngkyu
This tool converts a Nondeterministic Finite Automata (NFA) into a Deterministic Finite Automata (DFA)

This tool converts a Nondeterministic Finite Automata (NFA) into a Deterministic Finite Automata (DFA)

Quinn Herden 1 Feb 04, 2022
Codebase for arXiv preprint "NeRF++: Analyzing and Improving Neural Radiance Fields"

NeRF++ Codebase for arXiv preprint "NeRF++: Analyzing and Improving Neural Radiance Fields" Work with 360 capture of large-scale unbounded scenes. Sup

Kai Zhang 722 Dec 28, 2022
AutoML library for deep learning

Official Website: autokeras.com AutoKeras: An AutoML system based on Keras. It is developed by DATA Lab at Texas A&M University. The goal of AutoKeras

Keras 8.7k Jan 08, 2023
Modular Probabilistic Programming on MXNet

MXFusion | | | | Tutorials | Documentation | Contribution Guide MXFusion is a modular deep probabilistic programming library. With MXFusion Modules yo

Amazon 100 Dec 10, 2022
Using NumPy to solve the equations of fluid mechanics together with Finite Differences, explicit time stepping and Chorin's Projection methods

Computational Fluid Dynamics in Python Using NumPy to solve the equations of fluid mechanics ๐ŸŒŠ ๐ŸŒŠ ๐ŸŒŠ together with Finite Differences, explicit time

Felix Kรถhler 4 Nov 12, 2022
An OpenAI-Gym Package for Training and Testing Reinforcement Learning algorithms with OpenSim Models

Authors: Utkarsh A. Mishra and Dr. Dimitar Stanev Advisors: Dr. Dimitar Stanev and Prof. Auke Ijspeert, Biorobotics Laboratory (BioRob), EPFL Video Pl

Utkarsh Mishra 16 Dec 13, 2022
Data and codes for ACL 2021 paper: Towards Emotional Support Dialog Systems

Emotional-Support-Conversation Copyright ยฉ 2021 CoAI Group, Tsinghua University. All rights reserved. Data and codes are for academic research use onl

126 Dec 21, 2022
202 Jan 06, 2023
A PoC Corporation Relationship Knowledge Graph System on top of Nebula Graph.

Corp-Rel is a PoC of Corpartion Relationship Knowledge Graph System. It's built on top of the Open Source Graph Database: Nebula Graph with a dataset

Wey Gu 20 Dec 11, 2022
Activating More Pixels in Image Super-Resolution Transformer

HAT [Paper Link] Activating More Pixels in Image Super-Resolution Transformer Xiangyu Chen, Xintao Wang, Jiantao Zhou and Chao Dong BibTeX @article{ch

XyChen 270 Dec 27, 2022
Neural models of common sense. ๐Ÿค–

Unicorn on Rainbow Neural models of common sense. This repository is for the paper: Unicorn on Rainbow: A Universal Commonsense Reasoning Model on a N

AI2 60 Jan 05, 2023
[NeurIPS 2021 Spotlight] Code for Learning to Compose Visual Relations

Learning to Compose Visual Relations This is the pytorch codebase for the NeurIPS 2021 Spotlight paper Learning to Compose Visual Relations. Demo Imag

Nan Liu 88 Jan 04, 2023
Official Pytorch implementation of "DivCo: Diverse Conditional Image Synthesis via Contrastive Generative Adversarial Network" (CVPR'21)

DivCo: Diverse Conditional Image Synthesis via Contrastive Generative Adversarial Network Pytorch implementation for our DivCo. We propose a simple ye

64 Nov 22, 2022
[CVPR'21] DeepSurfels: Learning Online Appearance Fusion

DeepSurfels: Learning Online Appearance Fusion Paper | Video | Project Page This is the official implementation of the CVPR 2021 submission DeepSurfel

Online Reconstruction 52 Nov 14, 2022
(ICCV 2021) Official code of "Dressing in Order: Recurrent Person Image Generation for Pose Transfer, Virtual Try-on and Outfit Editing."

Dressing in Order (DiOr) ๐Ÿ‘š [Paper] ๐Ÿ‘– [Webpage] ๐Ÿ‘— [Running this code] The official implementation of "Dressing in Order: Recurrent Person Image Gene

Aiyu Cui 277 Dec 28, 2022
Companion code for the paper "Meta-Learning the Search Distribution of Black-Box Random Search Based Adversarial Attacks" by Yatsura et al.

META-RS This is the companion code for the paper "Meta-Learning the Search Distribution of Black-Box Random Search Based Adversarial Attacks" by Yatsu

Bosch Research 7 Dec 09, 2022
University of Rochester 2021 Summer REU focusing on music sentiment transfer using CycleGAN

Music-Sentiment-Transfer University of Rochester 2021 Summer REU focusing on music sentiment transfer using CycleGAN Poster: Music Sentiment Transfer

Miles Sigel 2 Jan 24, 2022
UA-GEC: Grammatical Error Correction and Fluency Corpus for the Ukrainian Language

UA-GEC: Grammatical Error Correction and Fluency Corpus for the Ukrainian Language This repository contains UA-GEC data and an accompanying Python lib

Grammarly 226 Dec 29, 2022
Code for "3D Human Pose and Shape Regression with Pyramidal Mesh Alignment Feedback Loop"

PyMAF This repository contains the code for the following paper: 3D Human Pose and Shape Regression with Pyramidal Mesh Alignment Feedback Loop Hongwe

Hongwen Zhang 450 Dec 28, 2022
A python library to artfully visualize Factorio Blueprints and an interactive web demo for using it.

Factorio Blueprint Visualizer I love the game Factorio and I really like the look of factories after growing for many hours or blueprints after tweaki

Piet Brรถmmel 124 Jan 07, 2023