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
Manim is an engine for precise programmatic animations, designed for creating explanatory math videos

Manim is an engine for precise programmatic animations, designed for creating explanatory math videos. Note, there are two versions of manim. This rep

Grant Sanderson 49k Jan 09, 2023
Neural Scene Graphs for Dynamic Scene (CVPR 2021)

Implementation of Neural Scene Graphs, that optimizes multiple radiance fields to represent different objects and a static scene background. Learned representations can be rendered with novel object

151 Dec 26, 2022
Gesture recognition on Event Data

Event based Gesture Recognition Gesture recognition on Event Data usually involv

2 Feb 14, 2022
Code for Robust Contrastive Learning against Noisy Views

Robust Contrastive Learning against Noisy Views This repository provides a PyTorch implementation of the Robust InfoNCE loss proposed in paper Robust

Ching-Yao Chuang 53 Jan 08, 2023
Introducing neural networks to predict stock prices

IntroNeuralNetworks in Python: A Template Project IntroNeuralNetworks is a project that introduces neural networks and illustrates an example of how o

Vivek Palaniappan 637 Jan 04, 2023
Official implementation of the Neurips 2021 paper Searching Parameterized AP Loss for Object Detection.

Parameterized AP Loss By Chenxin Tao, Zizhang Li, Xizhou Zhu, Gao Huang, Yong Liu, Jifeng Dai This is the official implementation of the Neurips 2021

46 Jul 06, 2022
PyTorch implementation of Tacotron speech synthesis model.

tacotron_pytorch PyTorch implementation of Tacotron speech synthesis model. Inspired from keithito/tacotron. Currently not as much good speech quality

Ryuichi Yamamoto 279 Dec 09, 2022
Direct design of biquad filter cascades with deep learning by sampling random polynomials.

IIRNet Direct design of biquad filter cascades with deep learning by sampling random polynomials. Usage git clone https://github.com/csteinmetz1/IIRNe

Christian J. Steinmetz 55 Nov 02, 2022
The code succinctly shows how our ensemble learning based on deep learning CNN is used for LAM-avulsion-diagnosis.

deep-learning-LAM-avulsion-diagnosis The code succinctly shows how our ensemble learning based on deep learning CNN is used for LAM-avulsion-diagnosis

1 Jan 12, 2022
This framework implements the data poisoning method found in the paper Adversarial Examples Make Strong Poisons

Adversarial poison generation and evaluation. This framework implements the data poisoning method found in the paper Adversarial Examples Make Strong

31 Nov 01, 2022
ICCV2021 Paper: AutoShape: Real-Time Shape-Aware Monocular 3D Object Detection

ICCV2021 Paper: AutoShape: Real-Time Shape-Aware Monocular 3D Object Detection

Zongdai 107 Dec 20, 2022
This is the code for Deformable Neural Radiance Fields, a.k.a. Nerfies.

Deformable Neural Radiance Fields This is the code for Deformable Neural Radiance Fields, a.k.a. Nerfies. Project Page Paper Video This codebase conta

Google 1k Jan 09, 2023
'Aligned mixture of latent dynamical systems' (amLDS) for stimulus decoding probabilistic manifold alignment across animals. P. Herrero-Vidal et al. NeurIPS 2021 code.

Across-animal odor decoding by probabilistic manifold alignment (NeurIPS 2021) This repository is the official implementation of aligned mixture of la

Pedro Herrero-Vidal 3 Jul 12, 2022
source code the paper Fast and Robust Iterative Closet Point.

Fast-Robust-ICP This repository includes the source code the paper Fast and Robust Iterative Closet Point. Authors: Juyong Zhang, Yuxin Yao, Bailin De

yaoyuxin 320 Dec 28, 2022
Seg-Torch for Image Segmentation with Torch

Seg-Torch for Image Segmentation with Torch This work was sparked by my personal research on simple segmentation methods based on deep learning. It is

Eren Gölge 37 Dec 12, 2022
Spatial Temporal Graph Convolutional Networks (ST-GCN) for Skeleton-Based Action Recognition in PyTorch

Reminder ST-GCN has transferred to MMSkeleton, and keep on developing as an flexible open source toolbox for skeleton-based human understanding. You a

sijie yan 1.1k Dec 25, 2022
Clairvoyance: a Unified, End-to-End AutoML Pipeline for Medical Time Series

Clairvoyance: A Pipeline Toolkit for Medical Time Series Authors: van der Schaar Lab This repository contains implementations of Clairvoyance: A Pipel

van_der_Schaar \LAB 89 Dec 07, 2022
Streaming over lightweight data transformations

Description Data augmentation libarary for Deep Learning, which supports images, segmentation masks, labels and keypoints. Furthermore, SOLT is fast a

Research Unit of Medical Imaging, Physics and Technology 256 Jan 08, 2023
The official implementation of You Only Compress Once: Towards Effective and Elastic BERT Compression via Exploit-Explore Stochastic Nature Gradient.

You Only Compress Once: Towards Effective and Elastic BERT Compression via Exploit-Explore Stochastic Nature Gradient (paper) @misc{zhang2021compress,

46 Dec 07, 2022