Code for the paper "M2m: Imbalanced Classification via Major-to-minor Translation" (CVPR 2020)

Related tags

Deep Learning M2m
Overview

M2m: Imbalanced Classification via Major-to-minor Translation

This repository contains code for the paper "M2m: Imbalanced Classification via Major-to-minor Translation" by Jaehyung Kim*, Jongheon Jeong* and Jinwoo Shin.

Dependencies

  • python3
  • pytorch >= 1.1.0
  • torchvision
  • tqdm

Scripts

Please check out run.sh for all the scripts to reproduce the CIFAR-10-LT results reported.

Training procedure of M2m

  1. Train a baseline network g for generating minority samples
python train.py --no_over --ratio 100 --decay 2e-4 --model resnet32 --dataset cifar10 \
--lr 0.1 --batch-size 128 --name 'ERM' --warm 200 --epoch 200   
  1. Train another network f using M2m with the pre-trained g
python train.py -gen -r --ratio 100 --decay 2e-4 --model resnet32 --dataset cifar10 \
--lr 0.1 --batch-size 128 --name 'M2m' --beta 0.999 --lam 0.5 --gamma 0.9 \
--step_size 0.1 --attack_iter 10 --warm 160 --epoch 200 --net_g ./checkpoint/pre_trained_g.t7 

We also provide a pre-trained ResNet-32 model of g at checkpoint/erm_r100_c10_trial1.t7, so one can directly use M2m without pre-training as follows:

python train.py -gen -r --ratio 100 --decay 2e-4 --model resnet32 --dataset cifar10 \
--lr 0.1 --batch-size 128 --name 'M2m' --beta 0.999 --lam 0.5 --gamma 0.9 \
--step_size 0.1 --attack_iter 10 --warm 160 --epoch 200 --net_g ./checkpoint/erm_r100_c10_trial1.t7
Comments
  • train M2m

    train M2m

    great work! it seems to should add "--resume" when training M2m. (load ckpt_g) friendly warning. by the way, do you apply M2m on larger dataset, such as Imagenet?

    opened by wangjl1993 4
  • Could you provide the processed CelebA-5 dataset?

    Could you provide the processed CelebA-5 dataset?

    Hi,

    Thanks for your interesting work. I'd like to reproduce the experiments on CelebA-5, but it needs to be processed based on the official version as described in your paper. Could you please share a copy of the processed dataset or the script for processing?

    Best Regards, Hongxin

    opened by hongxin001 2
  • Loss function used to train baseline classifier g

    Loss function used to train baseline classifier g

    Hello,

    Great work guys,

    I have a small question regarding the baseline classifier g.

    Which loss are you using to train it? Is it Vanilla CE Loss? Because when analyzing accuracy per class on the unbalanced training data using the baseline classifier g with the weights that you provided, I found these already good accuracy values for unbalanced training: [99.8200, 99.8332, 99.2205, 97.8644, 98.6047, 97.1576, 97.8448, 99.2806, 97.5904, 96.0000].

    Does it make sense to train it on more sophisticated losses like Weighted CE or so, to allow the model pick the features related to the minority samples better? Because on my dateset, the baseline classifier trained with CE performs really badly with a low accuracy near 5% on the minority sample of the training set. i.e. How well should the baseline classifier perform on the minority samples of the training data?

    It would be great if you share the training procedure for reproducing the baseline classifier g (schedule, sampling methods, loss..).

    I look forward to hearing from.

    Many many thanks Best, Hssan

    opened by hssandriss 1
  • How to reproduce the results on CIFAR10 and CIFAR100?

    How to reproduce the results on CIFAR10 and CIFAR100?

    Hello All,

    This is Sourav Das, currently working as a Project-Linked Person at Indian Statistical Institute, Kolkata.

    I went through your CVPR 2020 paper, titled "M2m: Imbalanced Classification via Major-to-minor Translation" and would like to reproduce the result on CIFAR10 and CIFAR100 datasets.

    I cloned the GitHub repo https://github.com/alinlab/M2m but I don't know

    1. In which path to keep the CIFAR10 or CIFAR100 datasets?
    2. In which format should the datasets be present?
    3. Will it run with CIFAR10 and CIFAR100 datasets, directly downloaded from the site: https://www.cs.toronto.edu/~kriz/cifar.html or do I need to do some pre-processing to the datasets?

    Awaiting an early response from you.

    Thanks & Regards, Sourav Das

    opened by SodaCoder 1
  • Guidence is needed to reproduce the results ? ?

    Guidence is needed to reproduce the results ? ?

    i have recently learnt python and went through the some MOOCS of machine learning and deep learning. I have downloaded the whole code from this site. Any one kindly guide me how to run the code and reproduce the results ??

    opened by sagheer-ahmed 1
  • Parameter for cifar10/100-r10/100

    Parameter for cifar10/100-r10/100

    Hi, great work! I have trained cifar10_r10, cifar100_r10 and cifar100_r100. ALL the bACC of 3 ERM models is better but cifar100_r100 M2m model has SOTA performance. Can you tell me how to do to improve my model performance of c10_r10 and c100_r10?

    opened by Huangszz 1
This repository contains the code for the CVPR 2020 paper "Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision"

Differentiable Volumetric Rendering Paper | Supplementary | Spotlight Video | Blog Entry | Presentation | Interactive Slides | Project Page This repos

null 697 Jan 6, 2023
Source code for CVPR 2020 paper "Learning to Forget for Meta-Learning"

L2F - Learning to Forget for Meta-Learning Sungyong Baik, Seokil Hong, Kyoung Mu Lee Source code for CVPR 2020 paper "Learning to Forget for Meta-Lear

Sungyong Baik 29 May 22, 2022
[CVPR 2022] CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation

CoTTA Code for our CVPR 2022 paper Continual Test-Time Domain Adaptation Prerequisite Please create and activate the following conda envrionment. To r

Qin Wang 87 Jan 8, 2023
PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization using Augmented-Self Reference and Dense Semantic Correspondence) and pre-trained model on ImageNet dataset

Reference-Based-Sketch-Image-Colorization-ImageNet This is a PyTorch implementation of CVPR 2020 paper (Reference-Based Sketch Image Colorization usin

Yuzhi ZHAO 11 Jul 28, 2022
Code accompanying "Dynamic Neural Relational Inference" from CVPR 2020

Code accompanying "Dynamic Neural Relational Inference" This codebase accompanies the paper "Dynamic Neural Relational Inference" from CVPR 2020. This

Colin Graber 48 Dec 23, 2022
Official code for "End-to-End Optimization of Scene Layout" -- including VAE, Diff Render, SPADE for colorization (CVPR 2020 Oral)

End-to-End Optimization of Scene Layout Code release for: End-to-End Optimization of Scene Layout CVPR 2020 (Oral) Project site, Bibtex For help conta

Andrew Luo 41 Dec 9, 2022
UDP++ (ECCVW 2020 Oral), (Winner of COCO 2020 Keypoint Challenge).

UDP-Pose This is the pytorch implementation for UDP++, which won the Fisrt place in COCO Keypoint Challenge at ECCV 2020 Workshop. Top-Down Results on

null 20 Jul 29, 2022
Code for paper ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization in the Loop.

Who Left the Dogs Out? Evaluation and demo code for our ECCV 2020 paper: Who Left the Dogs Out? 3D Animal Reconstruction with Expectation Maximization

Benjamin Biggs 29 Dec 28, 2022
TensorFlow code for the neural network presented in the paper: "Structural Language Models of Code" (ICML'2020)

SLM: Structural Language Models of Code This is an official implementation of the model described in: "Structural Language Models of Code" [PDF] To ap

null 73 Nov 6, 2022
Learning to Simulate Dynamic Environments with GameGAN (CVPR 2020)

Learning to Simulate Dynamic Environments with GameGAN PyTorch code for GameGAN Learning to Simulate Dynamic Environments with GameGAN Seung Wook Kim,

null 199 Dec 26, 2022
An official implementation of "SFNet: Learning Object-aware Semantic Correspondence" (CVPR 2019, TPAMI 2020) in PyTorch.

PyTorch implementation of SFNet This is the implementation of the paper "SFNet: Learning Object-aware Semantic Correspondence". For more information,

CV Lab @ Yonsei University 87 Dec 30, 2022
Unofficial implementation of "TTNet: Real-time temporal and spatial video analysis of table tennis" (CVPR 2020)

TTNet-Pytorch The implementation for the paper "TTNet: Real-time temporal and spatial video analysis of table tennis" An introduction of the project c

Nguyen Mau Dung 438 Dec 29, 2022
git《Investigating Loss Functions for Extreme Super-Resolution》(CVPR 2020) GitHub:

Investigating Loss Functions for Extreme Super-Resolution NTIRE 2020 Perceptual Extreme Super-Resolution Submission. Our method ranked first and secon

Sejong Yang 0 Oct 17, 2022
Block-wisely Supervised Neural Architecture Search with Knowledge Distillation (CVPR 2020)

DNA This repository provides the code of our paper: Blockwisely Supervised Neural Architecture Search with Knowledge Distillation. Illustration of DNA

Changlin Li 215 Dec 19, 2022
《Train in Germany, Test in The USA: Making 3D Object Detectors Generalize》(CVPR 2020)

Train in Germany, Test in The USA: Making 3D Object Detectors Generalize This paper has been accpeted by Conference on Computer Vision and Pattern Rec

Xiangyu Chen 101 Jan 2, 2023
《Where am I looking at? Joint Location and Orientation Estimation by Cross-View Matching》(CVPR 2020)

This contains the codes for cross-view geo-localization method described in: Where am I looking at? Joint Location and Orientation Estimation by Cross-View Matching, CVPR2020.

null 41 Oct 27, 2022
From Fidelity to Perceptual Quality: A Semi-Supervised Approach for Low-Light Image Enhancement (CVPR'2020)

Under-exposure introduces a series of visual degradation, i.e. decreased visibility, intensive noise, and biased color, etc. To address these problems, we propose a novel semi-supervised learning approach for low-light image enhancement.

Yang Wenhan 117 Jan 3, 2023
Pixel Consensus Voting for Panoptic Segmentation (CVPR 2020)

Implementation for Pixel Consensus Voting (CVPR 2020). This codebase contains the essential ingredients of PCV, including various spatial discretizati

Haochen 23 Oct 25, 2022
The official implementation of Equalization Loss v1 & v2 (CVPR 2020, 2021) based on MMDetection.

The Equalization Losses for Long-tailed Object Detection and Instance Segmentation This repo is official implementation CVPR 2021 paper: Equalization

Jingru Tan 129 Dec 16, 2022