Manuscript Offprint

arXiv:2611.06015

ChanSFormer: A Channel Agnostic Vision Transformer for Multi-Channel Cell Painting Images

Jingwei Zhang, Srinivasan Sivanandan, Dimitris Samaras

Abstract

High-content multi-channel imaging, from Cell Painting assays to remote sensing, is central to modern scientific pipelines. Because these channels are highly heterogeneous and experimental configurations frequently evolve, a practical vision backbone must be fundamentally channel-agnostic. Current channel-adaptive vision transformers rely on global self-attention with learnable channel embeddings, which can be computed only for previously known channels. Attempts to overcome this limitation of new channels either discard the embeddings, losing channel identity, or process each channel independently, thereby eliminating critical cross-channel interactions. To address this, we introduce ChanSFormer, an efficient Vision Transformer that replaces rigid embeddings with disentangled spatial-channel attention and individual channel CLS tokens. This architecture natively preserves both distinct channel identities and cross-channel information flow. Furthermore, the individual channel class token design unlocks more informative feature representations for self-supervised learning and enables representation-based channel sampling while remaining channel-agnostic. We evaluate ChanSFormer on two biology multi-channel datasets, CHAMMI, JUMP-CP and a satellite dataset, So2Sat. Experimental results show that ChanSFormer outperforms state-of-the-art methods by 3.93%–4.27% on JUMP-CP in classification accuracy. It also demonstrates exceptional cross-dataset transferability under a self-supervised setting, outperforming previous methods by up to 2.72% in accuracy in the same classification tasks. Furthermore, the disentangled attention reduces the quadratic complexity of channel × spatial sequence length of the global attention baseline, thus improving throughput by 55%–313%. Code is available at https://github.com/cvlab-stonybrook/ChanSFormer.

1 Introduction

High-content imaging using the Cell Painting assay is a cornerstone of modern drug discovery [1–3]. This technique generates images with multiple channels, typically five or more, where each channel uses a specific fluorescent dye to reveal a distinct cellular component such as the nucleus, mitochondria, or cytoskeleton. Because every channel carries a different layer of biological information, the resulting data is highly heterogeneous across channels [4]. Compounding this, research pipelines often evolve through experiments that use varying numbers of channels or introduce novel fluorescent markers. A practical vision backbone for this setting must therefore be flexible and channel-agnostic, i.e., invariant to the number and ordering of input channels.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Vision Transformers (ViTs) [5] help analyze these complex images, but they still have their limitations. Given the heterogeneous nature of the channels, standard ViTs on cell images tokenize each channel independently [6–9] and then employ a single, global self-attention mechanism that processes the concatenated tokens from all channels. To distinguish between tokens originating from different channels within this shared computational space, a learnable channel embedding is added to each token [6, 8]. Although this solves the channel-identity problem, it introduces a critical limitation: the model becomes channel-specific, hard-coded to the initial channel configuration and unable to adapt to experimental setups with potential new channels.

Some methods [9, 10] try to address this channel-specificity by modifying the transformer architecture. However, they either drop the channel embedding [9], so that global self-attention can no longer distinguish tokens from different channels, or embed each channel independently [10], so that the backbone never models cross-channel interactions.

Another limitation of the global-attention template is computational. Concatenating tokens from all channels dramatically increases the input sequence length: a 224×224224 \times 224 image with 8 channels yields 8 times more tokens than a natural RGB image at the same resolution. This exacerbates the quadratic complexity of self-attention and slows both training and inference [6].

To address these limitations, we introduce ChanSFormer, a Vision Transformer designed from the outset to be fundamentally channel-agnostic. Our main contributions are:

• Disentangled channel-spatial attention. We replace monolithic global attention with separate channel attention and spatial attention. Channel attention natively preserves cross-channel interactions without requiring hard-coded channel embeddings.

• Individual channel CLS tokens. We introduce individual channel CLS tokens that dynamically carry distinct channel information by copying a single learnable CLS token to each channel before the first layer and then allowing the tokens to evolve in later layers through the disentangled attention. This individual token design also unlocks a more informative representation for self-supervised learning.

• Higher throughput. The disentangled attention reduces the quadratic complexity of channel ×\times spatial sequence length in the global attention to the quadratic complexity of channel length plus the quadratic complexity of spatial length for faster training and inference.

Extensive experiments in both supervised and self-supervised (DINOv2 [11]) regimes validate our approach on two biology multi-channel datasets, CHAMMI, JUMP-CP and a satellite dataset, So2Sat. ChanSFormer achieves comparable or superior accuracy compared to the state-of-the-art (SOTA) methods [8, 6] in the supervised classification, outperforming them by 3.93%–4.27% on JUMP-CP in classification accuracy. Moreover, it demonstrates exceptional cross-dataset transferability under a self-supervised protocol, outperforming SOTA methods by up to 2.72% in accuracy in the same classification tasks. Finally, the disentangled attention accelerates throughput by 55%–313% compared to the global-attention baseline.

References (28)