Adaptive resampling for improved machine learning in imbalanced single-cell datasets

Zeinab Navidi, Akshaya Thoutam, Madeline Hughes, Srivatsan Raghavan, Peter Winter, Lorin Crawford, Ava P. AminibioRxiv 2025

TL;DR

This paper introduces an "Adaptive Resampling" (AR) technique that helps machine learning models better learn from imbalanced single-cell data. By intelligently adjusting which data points the model sees during training, AR significantly improves performance on tasks like gene expression reconstruction, cell type classification, and predicting cellular responses to perturbations, especially for rare cell types.

What Problem Does This Paper Address?

Single-cell RNA sequencing (scRNA-seq) generates incredibly rich data about cellular heterogeneity, but this data is often imbalanced. This means some cell types or states are much rarer than others. Standard machine learning models trained on such data tend to perform poorly on these underrepresented cell populations, limiting their biological discovery potential. This is a major hurdle for tasks like identifying rare disease-driving cells or understanding subtle cellular responses. Existing methods to address this imbalance often rely on manual data manipulation or predefined annotations, which can be labor-intensive and introduce biases.

Methods

The core innovation is the Adaptive Resampling (AR) algorithm. Instead of feeding all data points equally in each training epoch, AR dynamically adjusts the "sampling weight" of each data point. Here's how it works:

  1. Latent Space Projection: During training, the model projects the high-dimensional gene expression data into a lower-dimensional "latent space." This latent space captures the underlying structure and relationships between cells.
  2. Density Estimation: AR estimates the density of data points within this latent space. Cells in sparse regions (low density) are considered underrepresented.
  3. Resampling Weight Calculation: Based on these densities, AR assigns higher resampling weights to underrepresented cells and lower weights to overrepresented ones. This is done in an unsupervised manner, relying solely on the learned latent structure.
  4. Adaptive Training: In each training iteration, the model samples data points with replacement according to these calculated weights. This means underrepresented cells are seen more frequently, allowing the model to learn from them more effectively. The weights are updated adaptively as the model's latent space representation evolves.

This approach is integrated into existing variational autoencoder (VAE) frameworks like scVI and scGen, making it broadly applicable.

Datasets

The study utilized several datasets:

  • scTab: A large-scale dataset (22.2 million cells) serving as the primary source for training and evaluation.
  • Blood cells (base): A subset of scTab used as a foundational training cohort.
  • Atlas cells (spiked-in): Cells from various tissues within scTab, used to simulate different levels of imbalance.
  • Heart, Kidney, Neuron datasets: Subsets of scTab used for evaluating gene expression reconstruction and cell type classification.
  • Species, PBMC, and H. poly datasets: Publicly available datasets used for evaluating perturbation response prediction.

Key Insights and Ideas

  • Unsupervised Imbalance Handling: AR tackles data imbalance without requiring prior knowledge of cell types or other metadata, relying solely on the learned latent structure. This makes it more generalizable and less prone to annotation biases.
  • Latent Space as a Guide: The latent space learned by VAEs is crucial. AR leverages the density within this space to identify and upweight underrepresented cells, demonstrating the power of learned representations for addressing data challenges.
  • Improved Embeddings: AR not only boosts downstream task performance but also enhances the quality of learned cellular embeddings, making them more structured and discriminative.
  • Broad Applicability: The method is designed to be integrated into any model with an encoder, suggesting it can be a versatile tool across various single-cell ML applications.

Key Results

  • Gene Expression Reconstruction: AR significantly improved reconstruction accuracy, especially when dealing with very few atlas cells (as few as 10 cells, or 0.01% of the training data), whereas standard training required thousands of cells to see similar gains.
  • Cell Type Classification: AR-trained models consistently outperformed standard models across heart, kidney, and neuron datasets, with noticeable improvements appearing with as few as 100 atlas cells.
  • Perturbation Response Prediction: AR demonstrated substantial improvements in predicting cellular responses to perturbations, particularly for rare or unseen cell groups. In some cases, R² values nearly doubled compared to standard training.
  • Stabilized Performance: AR-trained models showed more consistent performance with smaller variance across independent trials, suggesting a degree of stabilization and regularization.
  • Enhanced Latent Space: UMAP visualizations showed that AR-derived embeddings were less mixed and more regularized, better preserving biological distinctions between cell states.

Limitations and Future Work

  • VAE Focus: The current study primarily focused on VAE architectures. The authors suggest exploring AR's integration with other neural network architectures, like transformers.
  • Resampling Strategy: While AR was applied at the beginning of each epoch, future work could explore computing resampling weights at the start of training using a frozen or pre-trained model, which could be useful for large foundation models.
  • Combining with Supervised Methods: AR could potentially be combined with supervised methods that leverage cell type labels to achieve even greater performance gains.
  • Multimodal Data: With the rise of multi-omic single-cell datasets, extending AR to the multimodal setting is a promising future direction.

Summary updated

Abstract

While machine learning models trained on single-cell transcriptomics data have shown great promise in providing biological insights, existing tools struggle to effectively model underrepresented and out-of-distribution cellular features or states. We present a generalizable Adaptive Resampling (AR) approach that addresses these limitations and enhances single-cell representation learning by resampling data based on its learned latent structure in an online, adaptive manner concurrent with model training. Experiments on gene expression reconstruction, cell type classification, and perturbation response prediction tasks demonstrate that the proposed AR training approach leads to significantly improved downstream performance across datasets and metrics. Additionally, it enhances the quality of learned cellular embeddings compared to standard training methods. Our results suggest that AR may serve as a valuable technique for improving representation learning and predictive performance in single-cell transcriptomic models.
BibTeX
@misc{navidi2025adaptive,
  author = {Zeinab Navidi and Akshaya Thoutam and Madeline Hughes and Srivatsan Raghavan and Peter Winter and Lorin Crawford and Ava P. Amini},
  title = {{Adaptive resampling for improved machine learning in imbalanced single-cell datasets}},
  year = {2025},
  doi = {10.1101/2025.11.04.686583},
  howpublished = {bioRxiv},
}
Figure