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
Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)

Karate Club is an unsupervised machine learning extension library for NetworkX. Please look at the Documentation, relevant Paper, Promo Video, and Ext

Benedek Rozemberczki 1.8k Jan 07, 2023
ML-Ensemble – high performance ensemble learning

A Python library for high performance ensemble learning ML-Ensemble combines a Scikit-learn high-level API with a low-level computational graph framew

Sebastian Flennerhag 764 Dec 31, 2022
Official implementation of the paper Chunked Autoregressive GAN for Conditional Waveform Synthesis

PyEmits, a python package for easy manipulation in time-series data. Time-series data is very common in real life. Engineering FSI industry (Financial

Descript 150 Dec 06, 2022
Differentiable molecular simulation of proteins with a coarse-grained potential

Differentiable molecular simulation of proteins with a coarse-grained potential This repository contains the learned potential, simulation scripts and

UCL Bioinformatics Group 44 Dec 10, 2022
ToFFi - Toolbox for Frequency-based Fingerprinting of Brain Signals

ToFFi Toolbox This repository contains "before peer review" version of the software related to the preprint of the publication ToFFi - Toolbox for Fre

4 Aug 31, 2022
fklearn: Functional Machine Learning

fklearn: Functional Machine Learning fklearn uses functional programming principles to make it easier to solve real problems with Machine Learning. Th

nubank 1.4k Dec 07, 2022
ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation.

ENet This work has been published in arXiv: ENet: A Deep Neural Network Architecture for Real-Time Semantic Segmentation. Packages: train contains too

e-Lab 344 Nov 21, 2022
Official Implementation for Fast Training of Neural Lumigraph Representations using Meta Learning.

Fast Training of Neural Lumigraph Representations using Meta Learning Project Page | Paper | Data Alexander W. Bergman, Petr Kellnhofer, Gordon Wetzst

Alex 39 Oct 08, 2022
Film review classification

Film review classification Решение задачи классификации отзывов на фильмы на положительные и отрицательные с помощью рекуррентных нейронных сетей 1. З

Nikita Dukin 3 Jan 21, 2022
POCO: Point Convolution for Surface Reconstruction

POCO: Point Convolution for Surface Reconstruction by: Alexandre Boulch and Renaud Marlet Abstract Implicit neural networks have been successfully use

valeo.ai 93 Dec 29, 2022
DeepSTD: Mining Spatio-temporal Disturbances of Multiple Context Factors for Citywide Traffic Flow Prediction

DeepSTD: Mining Spatio-temporal Disturbances of Multiple Context Factors for Citywide Traffic Flow Prediction This is the implementation of DeepSTD in

5 Sep 26, 2022
An implementation of the AlphaZero algorithm for Gomoku (also called Gobang or Five in a Row)

AlphaZero-Gomoku This is an implementation of the AlphaZero algorithm for playing the simple board game Gomoku (also called Gobang or Five in a Row) f

Junxiao Song 2.8k Dec 26, 2022
Title: Graduate-Admissions-Predictor

The purpose of this project is create a predictive model capable of identifying the probability of a person securing an admit based on their personal profile parameters. Simplified visualisations hav

Akarsh Singh 1 Jan 26, 2022
Code for Mesh Convolution Using a Learned Kernel Basis

Mesh Convolution This repository contains the implementation (in PyTorch) of the paper FULLY CONVOLUTIONAL MESH AUTOENCODER USING EFFICIENT SPATIALLY

Yi_Zhou 35 Jan 03, 2023
A PyTorch implementation of "Signed Graph Convolutional Network" (ICDM 2018).

SGCN ⠀ A PyTorch implementation of Signed Graph Convolutional Network (ICDM 2018). Abstract Due to the fact much of today's data can be represented as

Benedek Rozemberczki 251 Nov 30, 2022
2021 credit card consuming recommendation

2021 credit card consuming recommendation

Wang, Chung-Che 7 Mar 08, 2022
Sharing of contents on mitochondrial encounter networks

mito-network-sharing Sharing of contents on mitochondrial encounter networks Required: R with igraph, brainGraph, ggplot2, and XML libraries; igraph l

Stochastic Biology Group 0 Oct 01, 2021
A Data Annotation Tool for Semantic Segmentation, Object Detection and Lane Line Detection.(In Development Stage)

Data-Annotation-Tool How to Run this Tool? To run this software, follow the steps: git clone https://github.com/Autonomous-Car-Project/Data-Annotation

TiVRA AI 13 Aug 18, 2022
pybaum provides tools to work with pytrees which is a concept burrowed from JAX.

pybaum provides tools to work with pytrees which is a concept burrowed from JAX.

Open Source Economics 9 May 11, 2022
A programming language written with python

Kaoft A programming language written with python How to use A simple Hello World: c="Hello World" c Output: "Hello World" Operators: a=12

1 Jan 24, 2022