Practical overview
When it fits
Use it when investigating class imbalance in image-classification training and you can work with the repository's listed Python and TensorFlow versions or adapt its code.
Who it is for
- Researchers comparing loss functions for long-tailed classification.
- Machine-learning practitioners adapting class-balanced weighting in TensorFlow image-classification training.
Documented uses
- Train and evaluate on original or long-tailed CIFAR using the provided scripts.
- Compare standard training and effective-number-based class balancing on long-tailed CIFAR.
- Prepare and run the documented TPU training workflows for ImageNet and iNaturalist datasets.
- Inspect class distributions and effective sample numbers using the included notebook.
Requirements & limits
The public GitHub repository is MIT-licensed. The README lists Python 3.6 and TensorFlow 1.14 dependencies.
- The documented CIFAR workflows use shell scripts and .tfrecords data.
- The larger-scale TPU workflow requires dataset preparation, TFRecord conversion, Google Cloud Storage, and updates to image normalization and input size.
- The repository lists TensorFlow 1.14, so users should account for that dependency when planning an environment.
- The repository includes links to pretrained ResNet-50 models and TensorBoard logs for ImageNet 2012 and iNaturalist 2018.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run the long-tailed CIFAR class-balanced training script
Use the repository's provided script for training and evaluation on long-tailed CIFAR with the proposed class-balanced loss.
Before you start
- Python 3.6 and TensorFlow 1.14, as listed by the repository.
- Long-tailed CIFAR data in the repository's expected .tfrecords format; the README links a dataset prepared for the paper.
Steps
Obtain the repository and the linked long-tailed CIFAR .tfrecords data.
Run
./cifar_im_trainval_cb.sh, settingBETAto a non-zero value as specified in the README.To visualize results, run
tensorboard --logdir=./results --port=6006.
Expected outcome
The provided training and evaluation script uses class-balanced loss on long-tailed CIFAR; TensorBoard can visualize results in `./results`.
Guide limitations
- The README does not provide a complete environment setup procedure or specify hardware requirements.
- The documented TensorBoard command covers visualization, not a guarantee of training results.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 17 October 2026
- Original website title
- richardaecn/class-balanced-loss · Official homepage title · retained in its source language

