Table of Contents
Fetching ...

Scalable Batch Correction for Cell Painting via Batch-Dependent Kernels and Adaptive Sampling

Aditya Narayan Ravi, Snehal Vadvalkar, Abhishek Pandey, Ilan Shomorony

TL;DR

This work introduces BALANS, a scalable batch-correction method for Cell Painting data that integrates batch-aware local kernel scaling with adaptive landmark sampling. By constructing a sparse affinity operator from a small, coverage-proportionate subset of points and applying a low-rank smoothing, BALANS achieves near-linear runtime while preserving biological signal across highly heterogeneous batches. Theoretical results guarantee coverage across biological clusters and provide a spectral error bound for the recovered affinity, underpinning empirical gains. Extensive experiments on real JUMP and BBBC datasets, plus synthetic benchmarks, demonstrate BALANS's superior or competitive performance relative to existing methods with substantial scalability benefits, enabling robust batch correction at multi-million-point scales.

Abstract

Cell Painting is a microscopy-based, high-content imaging assay that produces rich morphological profiles of cells and can support drug discovery by quantifying cellular responses to chemical perturbations. At scale, however, Cell Painting data is strongly affected by batch effects arising from differences in laboratories, instruments, and protocols, which can obscure biological signal. We present BALANS (Batch Alignment via Local Affinities and Subsampling), a scalable batch-correction method that aligns samples across batches by constructing a smoothed affinity matrix from pairwise distances. Given $n$ data points, BALANS builds a sparse affinity matrix $A \in \mathbb{R}^{n \times n}$ using two ideas. (i) For points $i$ and $j$, it sets a local scale using the distance from $i$ to its $k$-th nearest neighbor within the batch of $j$, then computes $A_{ij}$ via a Gaussian kernel calibrated by these batch-aware local scales. (ii) Rather than forming all $n^2$ entries, BALANS uses an adaptive sampling procedure that prioritizes rows with low cumulative neighbor coverage and retains only the strongest affinities per row, yielding a sparse but informative approximation of $A$. We prove that this sampling strategy is order-optimal in sample complexity and provides an approximation guarantee, and we show that BALANS runs in nearly linear time in $n$. Experiments on diverse real-world Cell Painting datasets and controlled large-scale synthetic benchmarks demonstrate that BALANS scales to large collections while improving runtime over native implementations of widely used batch-correction methods, without sacrificing correction quality.

Scalable Batch Correction for Cell Painting via Batch-Dependent Kernels and Adaptive Sampling

TL;DR

This work introduces BALANS, a scalable batch-correction method for Cell Painting data that integrates batch-aware local kernel scaling with adaptive landmark sampling. By constructing a sparse affinity operator from a small, coverage-proportionate subset of points and applying a low-rank smoothing, BALANS achieves near-linear runtime while preserving biological signal across highly heterogeneous batches. Theoretical results guarantee coverage across biological clusters and provide a spectral error bound for the recovered affinity, underpinning empirical gains. Extensive experiments on real JUMP and BBBC datasets, plus synthetic benchmarks, demonstrate BALANS's superior or competitive performance relative to existing methods with substantial scalability benefits, enabling robust batch correction at multi-million-point scales.

Abstract

Cell Painting is a microscopy-based, high-content imaging assay that produces rich morphological profiles of cells and can support drug discovery by quantifying cellular responses to chemical perturbations. At scale, however, Cell Painting data is strongly affected by batch effects arising from differences in laboratories, instruments, and protocols, which can obscure biological signal. We present BALANS (Batch Alignment via Local Affinities and Subsampling), a scalable batch-correction method that aligns samples across batches by constructing a smoothed affinity matrix from pairwise distances. Given data points, BALANS builds a sparse affinity matrix using two ideas. (i) For points and , it sets a local scale using the distance from to its -th nearest neighbor within the batch of , then computes via a Gaussian kernel calibrated by these batch-aware local scales. (ii) Rather than forming all entries, BALANS uses an adaptive sampling procedure that prioritizes rows with low cumulative neighbor coverage and retains only the strongest affinities per row, yielding a sparse but informative approximation of . We prove that this sampling strategy is order-optimal in sample complexity and provides an approximation guarantee, and we show that BALANS runs in nearly linear time in . Experiments on diverse real-world Cell Painting datasets and controlled large-scale synthetic benchmarks demonstrate that BALANS scales to large collections while improving runtime over native implementations of widely used batch-correction methods, without sacrificing correction quality.
Paper Structure (57 sections, 10 theorems, 73 equations, 9 figures, 11 tables, 5 algorithms)

This paper contains 57 sections, 10 theorems, 73 equations, 9 figures, 11 tables, 5 algorithms.

Key Result

Theorem 2.4

Let $T_k$ denote the number of sampled rows from $\mathcal{C}_k$. Then given a constant $\delta > 0$, there exists another constant $C:=C(\delta)$ such that if $m \geq Ct K \log K$, then $\mathbb{P} \left( T_k \geq t, \;\forall\; k \right) \geq 1 - \delta.$

Figures (9)

  • Figure 1: (a) Standard Cell Painting analysis pipeline based on extracting features for each of the $n$ cells. (b) Before correction: when UMAP plot is colored by compound labels (top), we see multiple clusters corresponding to same compound. When colored by batch, we see that the different clusters for the same compound correspond to different batches. The affinity heatmap reveals block patterns aligned with batches. (c) After BALANS: Clusters corresponding to different compounds sharpen, batches mix, and affinities align with compound labels. Heatmap rows are ordered by batch (left color bar), columns by label (top color bar).
  • Figure 2: Figure 3: UMAP visualizations for JUMP 1. (a) Colored by biological cluster, illustrating separation across a few representative compounds. (b) Colored by source lab. (c) Colored by microscope. These panels demonstrate how batch effects manifest across different technical sources. Notably, BALANS yields a tight and coherent biological clusters while substantially reducing separation across labs.
  • Figure 3: Runtime comparison on synthetic data (10 compounds, 5 batches, 10 features). Left: all methods. Right: fastest methods only. X-axis: number of data points (log scale); Y-axis: runtime in seconds.
  • Figure 4: Sensitivity of BALANS to the hyperparameter $k$ across three datasets: JUMP 1, DEEP 1, and Synthetic. Each curve shows the overall score for varying values of $k$, demonstrating robustness across a wide range.
  • Figure 5: UMAP visualizations for JUMP 3. (a) Colored by biological cluster, illustrating separation across a few representative compounds. (b) Colored by batch.
  • ...and 4 more figures

Theorems & Definitions (19)

  • Definition 2.1: Batch-dependent local scale; Affinity
  • Theorem 2.4: Cluster Coverage Guarantee
  • Theorem 2.5: Spectral Approximation of $A_0$
  • Theorem 3.1: Computational Complexity of BALANS
  • Theorem 1: Cluster Coverage Guarantee, restated
  • proof
  • Lemma 1.3: Coupon collector with a partial target, boneh1997coupon
  • proof
  • Remark 1.4
  • Remark 1.5
  • ...and 9 more