Giter Site home page Giter Site logo

binwen6 / onlinelabelsmoothing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhangchbin/onlinelabelsmoothing

0.0 0.0 0.0 2.1 MB

The official code for the paper "Delving Deep into Label Smoothing", IEEE TIP 2021

Home Page: https://arxiv.org/abs/2011.12562

License: MIT License

Shell 0.27% Python 99.73%

onlinelabelsmoothing's Introduction

Online Label Smoothing

The code for the paper "Delving Deep into Label Smoothing"
I have only cleaned the code on the fine-grained datasets. Since I am not currently in school, I have not tested it. So if there are any bugs, please feel easy to contact me (zhangchbin AATT gmail Ddot com). avatar

Citation

@ARTICLE{zhang2021delving,
  author={Zhang, Chang-Bin and Jiang, Peng-Tao and Hou, Qibin and Wei, Yunchao and Han, Qi and Li, Zhen and Cheng, Ming-Ming},
  journal={IEEE Transactions on Image Processing}, 
  title={Delving Deep into Label Smoothing}, 
  year={2021},
  volume={30},
  number={},
  pages={5984-5996},
  doi={10.1109/TIP.2021.3089942}}

Performance

Classification for fine-grained datasets

avatar

Model ensemble on CIFAR-100

avatar

TODO

  • supporting for Jittor
  • training scripts for more network and datasets
  • EfficientNet for classification
  • SAN network for classification
  • training code on the ImageNet
  • training code on the Noisy-CIFAR
  • adversarial attack code on the ImageNet and CIFAR
  • training code on the CIFAR
  • the download link of CUB-200-2011, Flowers, Cars and dogs

Requirements

pytorch >= 1.0
torchvision
numpy
tensorboardX
apex
tqdm
efficientnet_pytorch
SAN_network

efficientnet_pytorch
SAN network

Data Preparation

Download all datasets to the data directory, note that we modify the division for datasets as shown in files in the data directory:

  • You can download the images from Cars. And the lists for training and validation are in the data directory.
  • You can download the images from Aircrafts. And the lists are in the data directory.
  • You can download the images from Flowers with 102 classes. And the lists are in the data directory.
  • You can download the images from Standford-dogs. And the lists are in the data directory.

Train and Validate

  1. download the ImageNet pretrained model to checkpoint
    MobileNet-v2, ResNet-50, Res2Net

  2. train the model with online label smoothing:

    CUDA_VISIBLE_DEVICES=1 python main.py \
    --mode train \
    --pretrained_model ./checkpoint/mobilenet_v2-b0353104.pth \
    --epochs 100 \
    --lr 0.01 \
    --arch mobilenetv2 \
    --dataset cub \
    --method ols \
    --batch_size 64 \
    

    (optional) test the model ensemble performance:

    python main.py \
    --mode ensemble \
    --ensemble 'runs/mobilenetv2_cub_ols/20.pth' 'runs/mobilenetv2_cub_ols/60.pth' \
    --epochs 100 \
    --lr 0.01 \
    --arch mobilenetv2 \
    --dataset aircraft \
    --method ols \
    --batch_size 64 \
    

Train on CIFAR

```
cd cifar
sh train_cifar_imagenetresnet34.sh
sh train_cifar_resnext29_2.sh
````

Other realated implementation

Thanks to the re-implementation in Kurumi233 and ankandrew

onlinelabelsmoothing's People

Contributors

zhangchbin 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.