Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
N

negative-label-smoothing

> 编程语言
Open source

[ICML2022 Long Talk] Official Pytorch implementation of "To Smooth or Not? When Label Smoothing Meets Noisy Labels"

99 stars0 likes2 views
WebsiteGitHub

About

[ICML2022 Long Talk] Official Pytorch implementation of "To Smooth or Not? When Label Smoothing Meets Noisy Labels"

To Smooth or Not? When Label Smoothing Meets Noisy Labels

This repository is the official Pytorch implementation of "To Smooth or Not? When Label Smoothing Meets Noisy Labels" accepted by ICML2022 (Oral).

Plug-in implementation of (Generalized) Label Smoothing in PyTorch

…

Required Packages & Environment

We recommend readers build an virtual environment and install required packages in requirements.txt.

Experiments on synthetic noisy CIFAR dataset

Direct training on CIFAR-10

For Vanilla Loss and PLS, direct training works better when learning with symmetric noisy labels under noise rate 0.2. Run the code bellow to reproduce our results:

CUDA_VISIBLE_DEVICES=0 python3 main_GLS_direct_train.py --noise_type symmetric --noise_rate 0.2

Warm-up with CE loss

When noise rates are large, warming up with CE loss makes PLS and NLS reaches a better performance. Run the code bellow to generate the warm-up model:

CUDA_VISIBLE_DEVICES=0 python3 main_warmup.py --noise_type symmetric --noise_rate 0.2

After the warming up, proceed with GLS:

CUDA_VISIBLE_DEVICES=0 python3 main_GLS_load.py --noise_type symmetric --noise_rate 0.2

Experiments on CIFAR-N dataset

You may want to refer to "CIFAR-N Github Page", and modify the file loss.py by referring to the loss_gls plug-in implementation specified above.

Details of key arguments:

In experiments, we formulate GLS as wa * Vanilla Loss + wb * GLS.

  • --lr: learning rate
  • --noise_rate: the error rate in symmetric noise model
  • --n_epoch: number of epochs
  • --wa: the weight of Vanilla Loss (default is 0)
  • --wb: the weight of GLS (default is 1)
  • --smooth_rate: the smooth rate in GLS

Citation

If you use our code, please cite the following paper:

@inproceedings{Wei2022ToSO,
  title={To Smooth or Not? When Label Smoothing Meets Noisy Labels},
  author={Jiaheng Wei and Hangyu Liu and Tongliang Liu and Gang Niu and Yang Liu},
  booktitle={ICML},
  year={2022}
}

Thanks for watching!

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonlabel-noiselabel-smoothingnoisy-label-learningnoisy-labels

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言