GithubHelp home page GithubHelp logo

boat's Introduction

BOAT

This is PyTorch implementation of Boosting Consistency in Dual Training for Long-Tailed Semi-Supervised Learning. Our conference paper published in CVPR 2023 is available at ACR.

Abstract

While long-tailed semi-supervised learning (LTSSL) has received tremendous attention in many real-world classification problems, existing LTSSL algorithms typically assume that the class distributions of labeled and unlabeled data are almost identical. Those LTSSL algorithms built upon the assumption can severely suffer when the class distributions of labeled and unlabeled data are mismatched since they utilize biased pseudo-labels from the model. To alleviate this problem, we propose a new simple method that can effectively utilize unlabeled data from unknown class distributions through Boosting cOnsistency in duAl Training (BOAT). Specifically, we construct the standard and balanced branch to ensure the performance of the head and tail classes, respectively. Throughout the training process, the two branches incrementally converge and interact with each other, eventually resulting in commendable performance across all classes. Despite its simplicity, we show that BOAT achieves state-of-the-art performance on a variety of standard LTSSL benchmarks, e.g., an averaged 2.7% absolute increase in test accuracy against existing algorithms when the class distributions of labeled and unlabeled data are mismatched. Even when the class distributions are identical, BOAT consistently outperforms many sophisticated LTSSL algorithms. We carry out extensive ablation studies to tease apart the factors that are the most important to the success of BOAT.

Requirements

  • Python 3.7.13
  • PyTorch 1.12.0+cu116
  • torchvision
  • numpy

Dataset

The directory structure for datasets looks like:

datasets
├── cifar-10
├── cifar-100
└── stl-10

Usage

Train our proposed BOAT for different settings.

For CIFAR-10:

# run consistent setting
python train.py --dataset cifar10 --num-max 500 --num-max-u 4000 --arch wideresnet --batch-size 64 --lr 0.03 --seed 0 --imb-ratio-label 100 --imb-ratio-unlabel 100 --tau 1.0 --ema-u 0.99 --tau3 2.0 --tau4 1.0

# run uniform setting
python train.py --dataset cifar10 --num-max 500 --num-max-u 4000 --arch wideresnet --batch-size 64 --lr 0.03 --seed 0 --imb-ratio-label 100 --imb-ratio-unlabel 1 --tau 1.0 --ema-u 0.99 --tau3 2.0 --tau4 1.0

# run reversed setting
python train.py --dataset cifar10 --num-max 500 --num-max-u 4000 --arch wideresnet --batch-size 64 --lr 0.03 --seed 0 --imb-ratio-label 100 --imb-ratio-unlabel 100 --tau 1.0 --ema-u 0.99 --tau3 2.0 --tau4 1.0 --flag-reverse-LT 1

For CIFAR-100:

# run consistent setting
python train.py --dataset cifar100 --num-max 50 --num-max-u 400 --arch wideresnet --batch-size 64 --lr 0.03 --seed 0 --imb-ratio-label 10 --imb-ratio-unlabel 10 --tau 2.0 --ema-u 0.99 --tau3 2.0 --tau4 1.0

# run uniform setting
python train.py --dataset cifar100 --num-max 50 --num-max-u 400 --arch wideresnet --batch-size 64 --lr 0.03 --seed 0 --imb-ratio-label 10 --imb-ratio-unlabel 1 --tau 2.0 --ema-u 0.99 --tau3 2.0 --tau4 1.0

# run reversed setting
python train.py --dataset cifar100 --num-max 50 --num-max-u 400 --arch wideresnet --batch-size 64 --lr 0.03 --seed 0 --imb-ratio-label 10 --imb-ratio-unlabel 10 --tau 2.0 --ema-u 0.99 --tau3 2.0 --tau4 1.0 --flag-reverse-LT 1

Acknowledge

Our code of BOAT is based on the implementation of FixMatch. We thank the authors of the FixMatch for making their code available to the public.

Citation

For journal version:

@article{gan2024boosting,
  title={Boosting Consistency in Dual Training for Long-Tailed Semi-Supervised Learning},
  author={Gan, Kai and Wei, Tong and Zhang, Min-Ling},
  journal={arXiv preprint arXiv:2406.13187},
  year={2024}
}

For conference version:

@InProceedings{Wei_2023_CVPR,
    author    = {Wei, Tong and Gan, Kai},
    title     = {Towards Realistic Long-Tailed Semi-Supervised Learning: Consistency Is All You Need},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2023},
    pages     = {3469-3478}
}

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.