Giter Club home page Giter Club logo

robust-loss-mlml's Introduction

Simple and Robust Loss Design for Multi-Label Learning with Missing Labels

Official PyTorch Implementation of the paper Simple and Robust Loss Design for Multi-Label Learning with Missing Labels

Youcai Zhang, Yuhao Cheng, Xinyu Huang, Fei Wen, Rui Feng, Yaqian Li, Yandong Guo
OPPO Research Institute, Shanghai Jiao Tong University, Fudan University

Abstract

Multi-label learning in the presence of missing labels(MLML) is a challenging problem. Existing methods mainly focus on the design of network structures or training schemes, which increase the complexity of implementation. This work seeks to fulfill the potential of loss function in MLML without increasing the procedure and complexity. Toward this end, we propose two simple yet effective methods via robust loss design based on an observation that a model can identify missing labels during training with a high precision. The first is a novel robust loss for negatives, namely the Hill loss, which re-weights negatives in the shape of a hill to alleviate the effect of false negatives. The second is a self-paced loss correction (SPLC) method, which uses a loss derived from the maximum likelihood criterion under an approximate distribution of missing labels. Comprehensive experiments on a vast range of multi-label image classification datasets demonstrate that our methods can remarkably boost the performance of MLML and achieve new state-of-the-art loss functions in MLML.

Credit to previous work

This repository is built upon the code base of ASL, thanks very much!

Datasets

We construct the training sets of missing labels by randomly dropping positive labels of each training image with different ratios.

samples classes Labels avg. label/img File
COCO-full labels 82,081 80 241,035 2.9 coco_train_full.txt
COCO-75% labels left 82,081 80 181,422 2.2 coco_train_0.75left.txt
COCO-40% labels left 82,081 80 96,251 1.2 coco_train_0.4left.txt
COCO-single label 82,081 80 82,081 1.0 coco_train_singlelabel.txt
NUS-full label 119,103 81 289,460 2.4 nus_train_full.txt
NUS-single label 119,103 81 289,460 1.0 nus_train_singlelabel.txt

Loss Implementation

In this PyTorch file, we provide implementations of our loss functions: Hill and SPLC. The loss functions take logits (predicted logits before sigmoid) and targets as input, and return the loss. Note that SPLC also takes current training epoch as input.

  • class Hill(nn.Module)
  • class SPLC(nn.Module)

Training Code

Training models by selecting different losses on MS-COCO:

python train.py --loss Hill --data {path to MS-COCO} --dataset {select training dataset}
python train.py --loss SPLC --data {path to MS-COCO} --dataset {select training dataset}

For example:

python train.py --loss Hill --data '/home/MSCOCO_2014/' --dataset './dataset/coco_train_0.4left.txt'

Note that when SPLC is used on COCO-75% labels left, the threshold is set 0.65, and the hyperparameters in other cases are set by default.

Training models by selecting different losses on NUS-wide:

python train_nus.py --loss Hill --data {path to NUS-wide}
python train_nus.py --loss SPLC --data {path to NUS-wide} 

Validation Code

We provide validation code that reproduces results reported in the paper on MS-COCO:

python validate.py --model_path {path to model to validate} --data {path to dataset}

Citation

  @misc{zhang2021simple,
        title={Simple and Robust Loss Design for Multi-Label Learning with Missing Labels}, 
        author={Youcai Zhang and Yuhao Cheng and Xinyu Huang and Fei Wen and Rui Feng and Yaqian Li and Yandong Guo},
        year={2021},
        eprint={2112.07368},
        archivePrefix={arXiv},
        primaryClass={cs.LG}
  }

robust-loss-mlml's People

Contributors

xinyu1205 avatar coler1994 avatar majinyu666 avatar cyh-sj 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.