Mini-batch sampling improves rare class accuracy in image classification
Mini-batch Sampling Strategies for Long-Tailed Image Classification: An Empirical Study on CIFAR-100-LT
Computer Vision and Pattern RecognitionMachine Learning
Summary
Real-world image datasets often have many classes but most pictures come from a few common classes, making it hard for computer programs to learn about less common classes. This paper studies different ways to pick small groups of images during training to help the computer learn better, especially about these rare classes. The authors found that a strategy called progressive sampling improves accuracy on rare classes by 25% compared to picking images uniformly at random. They also show that rebalancing data too much or at the wrong time can hurt overall learning.
What this means in practice
- •For machine learning engineers: Select better mini-batch sampling strategies during training to improve recognition of rare image classes in imbalanced datasets.
- •For data scientists in healthcare: Improve model performance when rare disease categories are underrepresented in medical image datasets by applying progressive sampling during training.
Authors
Siyu Yuan
Abstract
Real-world datasets often exhibit long-tailed class distributions, where a few head classes contain a large number of training samples while a large number of tail classes have only a few. The composition of each mini-batch, determined by the sampling strategy, governs which classes contribute to the stochastic gradient estimate, and therefore affects convergence behaviour and generalisation across the whole class spectrum. We provide a systematic theoretical and empirical comparison of four mini-batch sampling strategies for long-tailed image classification: uniform instance sampling, class-balanced sampling, square-root sampling, and progressively balanced sampling. We place all four in a unified bias-variance framework describing their effect on gradient estimation, which exposes the tension between unbiased optimisation of the empirical loss and fair representation of rare classes. We then evaluate them under controlled conditions using ResNet-32 on CIFAR-100-LT at three imbalance ratios (rho = 10, 50, 100), with every strategy sharing the same long-tailed subsets and initialisation within a seed. Progressive sampling improves tail-class accuracy by 25% relative to the uniform baseline at rho = 100 (13.5% versus 10.8%), consistently across all three seeds, while its overall accuracy is not distinguishable from that of uniform sampling given the seed-to-seed variation (40.0% versus 39.7%); the tail-class gain, not the overall gain, is the robust effect. At rho = 100, class-balanced sampling degrades accuracy on every class group, including the tail classes it is designed to help, which we attribute to overfitting caused by extreme oversampling of scarce data; at rho = 50 this failure is confined to head and medium classes. These results indicate that when rebalancing is applied during training matters as much as how much rebalancing is applied.