CellPainTR: Generalizable Representation Learning for Cross-Dataset Cell Painting Analysis

Cedric Caruzzo, Jong Chul Ye · 2025

Read CellPainTR: Generalizable Representation Learning for Cross-Dataset Cell Painting Analysis by Cedric Caruzzo, Jong Chul Ye (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2509-06986.txt.

Introduction

Cell images from different laboratories are unified by a transformer model in a 2025 computational biology paper by Cedric Caruzzo and one co-author. Cell painting assays photograph cells under many treatments, and consortia like JUMP have produced massive datasets. Batch effects and poor generalization across datasets block large-scale discovery.

Their model, CellPainTR, learns representations of cell shape and structure that resist batch effects. Source-specific context tokens let it adapt to each dataset's quirks while sharing the core representation, so it can generalize to entirely unseen datasets without fine-tuning. On the JUMP data it beat established correction methods at both batch integration and keeping biological signal. On an unseen dataset from another group, performance held up despite major domain and feature shifts. The authors frame it as a step toward foundation models for image-based profiling.

Catalog record

CREATORCedric Caruzzo, Jong Chul Ye
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE42 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2509-06986

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

CellPainTR: Generalizable Representation Learning for Cross-Dataset Cell Painting Analysis Cedric Caruzzo, Jong Chul Ye Abstract Large-scale biological discovery requires integrating massive, heterogeneous datasets like those from the JUMP Cell Painting consortium, but technical batch effects and a lack of generalizable models remain critical roadblocks. To address this, we introduce CellPainTR, a Transformer-based architecture designed to learn foundational representations of cellular morphology that are robust to batch effects. Unlike traditional methods that require retraining on new data, CellPainTR’s design, featuring source-specific context tokens, allows for effective out-of-distribution (OOD) generalization to entirely unseen datasets without fine-tuning. We validate CellPainTR on the large-scale JUMP dataset, where it outperforms established methods like ComBat and Harmony in both batch integration and biological signal preservation. Critically, we demonstrate its robustness through a challenging OOD task on the unseen Bray et al. dataset, where it maintains high performance despite significant domain and feature shifts. Our work represents a significant step towards creating truly foundational models for image-based profiling, enabling more reliable and scalable cross-study biological analysis. Figure 1: Conceptual Overview of the CellPainTR Framework and Training Curriculum. The standard Cell Painting workflow consists of (a) data preparation through cell seeding, perturbation, staining, and high-content screening (HCS), followed by (b) data generation, where raw cell images are processed by CellProfiler to produce high-dimensional feature vectors. Our novel contribution, shown in (c) , is the CellPainTR model, which processes these feature vectors. Key architectural components include a linear adaptor for continuous feature embedding and a learnable source context token ‘[SRC]‘ that provides the model with data provenance from a source codebook. The model is trained via a three-step curriculum, visualized by the UMAP embeddings on the right. Step 1 (Pre-training) learns a general representation of the morphological space. Step 2 (Intra-Source Batch Correction) refines the embedding to correct for technical noise within individual sources. Finally, Step 3 (Inter-Source Batch Correction) learns a globally consistent representation that integrates data across diverse sources, enabling robust cross-study analysis. 1 Introduction Cell Painting, a powerful high-content imaging technique, has emerged as a promising tool for biological research and drug discovery ( Bray et al. 2016 ; Gustafsdottir et al. 2013 ; Ljosa et al. 2013 ) . The method generates rich, multidimensional data capturing intricate cellular phenotypes, which are typically quantified into thousands of engineered features using software like CellProfiler ( Caicedo et al. 2017 ) . Our work deliberately operates on this feature space, as these features correspond to known morphological measurements, providing a layer of biological interpretability. This principled approach aims to anchor our model’s learning to established biology, a critical step towards building powerful yet reliable systems for cellular analysis. However, the full potential of large-scale initiatives like the JUMP Cell Painting consortium is severely hindered by batch effects—systematic, non-biological variations arising from differences in labs, equipment, and experimental conditions ( Singh et al. 2017 ; Carpenter et al. 2020 ) . These effects distort the data and confound downstream analysis, making robust integration a critical challenge. Classical methods such as ComBat and Harmony have been the standard for addressing this, adjusting the feature space of a given dataset to mitigate batch-specific noise ( Johnson et al. 2007 ; Korsunsky et al. 2019 ) . While effective for static datasets, these existing methods expose a deeper, more fundamental limitation: a lack of generalization. They function as static correctors, not as dynamic, reusable models. When a new study from a different laboratory is introduced, the entire combined dataset must be re-processed from scratch. This is not a scalable solution. This paradigm fundamentally prevents the creation of a true, cumulative "atlas" of cellular morphology, where new data can be seamlessly integrated and compared against a stable, pre-existing reference. This lack of generalizable models is the primary bottleneck preventing image-based profiling from reaching its full, federated potential. To overcome this critical barrier, we introduce CellPainTR, a new paradigm for learning generalizable and reusable representations of Cell Painting data. We frame our contributions as follows: 1. We propose a novel Transformer-based architecture, featuring Hyena operators for efficiency and learnable source-context tokens to explicitly model data provenance and enable generalization. 2. We design a multi-stage training curriculum that combines self-supervised masked feature prediction with supervised contrastive learning to effectively disentangle biological signals from technical artifacts. 3. We demonstrate that CellPainTR achieves state-of-the-art performance on the large-scale JUMP dataset, significantly outperforming existing benchmarks in both batch correction and biological signal preservation. 4. Critically, we provide demonstration of effective out-of-distribution (OOD) generalization, showing that a pre-trained CellPainTR can be directly applied to a completely unseen dataset and still outperform methods that were fit directly to that data. This work paves the way for more reliable and scalable analyses of Cell Painting data, accelerating progress towards robust, cross-study integration in drug discovery and cellular biology. 2 Related Work Classical Batch Correction Methods. The challenge of batch effects in high-dimensional biological data, particularly in the field of image-based profiling like Cell Painting, has been a significant focus of research in recent years ( Arevalo et al. 2024 ; Ando et al. 2017 ; Celik et al. 2022 ; Kraus et al. 2024 ; Borowa et al. 2024 ) . Several classical algorithms have been developed to address batch effects in biological data. One prominent example is ComBat, which uses a parametric empirical Bayes framework to adjust for batch effects ( Johnson et al. 2007 ) . The ComBat method models the batch effect as an additive and multiplicative effect on the data, and estimates these effects using an empirical Bayes approach. This can be expressed mathematically as: y_{ij}=\alpha_{i}+\beta_{i}x_{j}+\gamma_{b}+\delta_{b}x_{j}+\epsilon_{ij} (1) where y_{ij} is the observed data, x_{j} is the covariate of interest, \alpha_{i} and \beta_{i} are the sample-specific intercept and slope, \gamma_{b} and \delta_{b} are the batch-specific intercept and slope, and \epsilon_{ij} is the residual error. Another method, Harmony, uses iterative clustering and linear adjustment to correct batch effects in multi-modal single-cell data ( Korsunsky et al. 2019 ) . Harmony aims to identify a shared low-dimensional representation across batches by aligning cluster centroids in an iterative fashion. This can be expressed as: z_{i}=W_{b}h_{i}+b_{b} (2) where z_{i} is the corrected representation for sample i , h_{i} is the original high-dimensional representation, and W_{b} and b_{b} are the batch-specific linear transformation parameters. While these classical methods have demonstrated effectiveness in harmonizing static datasets, they are architecturally limited. They operate as one-time correctors on a fixed set of data rather than as reusable, learned models. Critically, they lack a mechanism for generalization; if a new batch of data from an unseen source is introduced, the entire dataset must be re-analyzed from scratch. This makes them fundamentally unsuitable for building the scalable, cumulative biological atlases envisioned by large-scale projects, a limitation that necessitates a new class of generalizable models. Self-Attention and the Hyena Operator. The self-attention operator ( Vaswani et al. 2017 ) is a fundamental mechanism of Transformers. Specifically, given a sequence x\in\mathbb{R}^{L\times D} with length L and D features, the self-attention operator A(x) is defined as: A(x)=\sigma(xW_{q})(xW_{k})^{T}(xW_{v}) (3) where W_{q},W_{k},W_{v}\in\mathbb{R}^{D\times D} are learnable projection matrices, and \sigma is a softmax operation. This allows the model to capture pairwise relationships between tokens in the sequence. However, one limitation is that self-attention becomes

Read the complete text