Code Monkey home page Code Monkey logo

distributionbalancedloss's Introduction

Distribution-Balanced Loss

[Paper]

The implementation of our paper Distribution-Balanced Loss for Multi-Label Classification in Long-Tailed Datasets (ECCV2020 Spotlight).

Tong WuQingqiu HuangZiwei LiuYu WangDahua Lin

Requirements

Installation

git clone [email protected]:wutong16/DistributionBalancedLoss.git
cd DistributionBalancedLoss

Quick start

Training

COCO-MLT

python tools/train.py configs/coco/LT_resnet50_pfc_DB.py 

VOC-MLT

python tools/train.py configs/voc/LT_resnet50_pfc_DB.py 

Testing

COCO-MLT

bash tools/dist_test.sh configs/coco/LT_resnet50_pfc_DB.py work_dirs/LT_coco_resnet50_pfc_DB/epoch_8.pth 1

VOC-MLT

bash tools/dist_test.sh configs/voc/LT_resnet50_pfc_DB.py work_dirs/LT_voc_resnet50_pfc_DB/epoch_8.pth 1

Pre-trained models

COCO-MLT

Backbone Total Head Medium Tail Download
ResNet-50 53.55 51.13 57.05 51.06 model

VOC-MLT

Backbone Total Head Medium Tail Download
ResNet-50 78.94 73.22 84.18 79.30 model

Datasets

Use our dataset

The long-tail multi-label datasets we use in the paper are created from MS COCO 2017 and Pascal VOC 2012. Annotations and statistics data resuired when training are saved under ./appendix in this repo.

appendix
  |--coco
    |--longtail2017
      |--class_freq.pkl
      |--class_split.pkl
      |--img_id.pkl
  |--VOCdevkit
    |--longtail2012
      |--class_freq.pkl
      |--class_split.pkl
      |--img_id.pkl

Try your own

You can also create a new long-tailed dataset by downloading the annotations, terse_gt_2017.pkl for COCO and terse_gt_2012.pkl for VOC, from here and move them into the right folders as below.

appendix
  |--coco
    |--longtail2017
      |--terse_gt_2017.pkl
  |--VOCdevkit
    |--longtail2012
      |--terse_gt_2012.pkl

Then run the following command, adjust the parameters as you like to control the distribution.

python tools/create_longtail_dataset.py

To update the corresponding class_freq.pkl files, please refer to def _save_info in .\mllt\datasets\custom.py.

License and Citation

The use of this software is RESTRICTED to non-commercial research and educational purposes.

@inproceedings{DistributionBalancedLoss,
  title={Distribution-Balanced Loss for Multi-Label Classification in Long-Tailed Datasets},
  author={Wu, Tong and Huang, Qingqiu and Liu, Ziwei and Wang, Yu and Lin, Dahua},
  booktitle={European Conference on Computer Vision (ECCV)},
  year={2020}
}

TODO

  • Distributed training is not supported currently
  • Evaluation with single GPU is not supported currently
  • test pytorch 0.4.0

Contact

This repo is currently maintained by @wutong16 and @hqqasw

distributionbalancedloss's People

Contributors

wutong16 avatar hqqasw avatar liuziwei7 avatar

Watchers

James Cloos 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.