Manuscript Offprint
arXiv:2611.06015ChanSFormer: A Channel Agnostic Vision Transformer for Multi-Channel Cell Painting Images
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 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 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.
Self-supervised pretraining for multichannel imaging. Self-supervised pretraining for natural images has converged on joint-embedding frameworks such as DINO [16], iBOT [17], and DINOv2 [11], and on masked-image modelling as in MAE [18]. Extending these frameworks to multichannel imaging has followed several directions. Cell-DINO [19] applies DINOv2 to cellular microscopy with channel-aware augmentations but treats the channel stack as fixed. Cha-MAEViT [20] pairs masked autoencoding with a channel-aware multi-channel ViT, targeting cross-channel learning through the MAE objective. CA-MAE [9] also uses masked autoencoding but removes the channel embedding, giving an architecturally flexible ViT that accepts any channel subset at inference. BoC [10] pretrains a microscopy foundation model at scale with DINOv2 by running the backbone on each channel independently. IC-ViT [21] takes a two-stage route that uses masked-image pretraining on single channels followed by multi-channel finetuning, so cross-channel interactions are learned only at finetuning time.
To achieve channel agnosticism, prior methods adopt two opposing extremes. CA-MAE [9] removes channel embeddings while retaining global attention, severely compromising the model's ability to distinguish distinct channels. Conversely, BoC [10] processes each channel entirely independently, preserving channel identity but eliminating critical cross-channel information flow during feature extraction. ChanSFormer bridges this gap: by employing decomposed channel-spatial attention alongside individual channel CLS tokens, our architecture natively preserves both continuous cross-channel interactions and distinct channel identities without relying on fixed channel embeddings. Our decomposition is related to factorized attention in video [22] and multi-view [23] models, which encode each frame or view with shared transformer blocks and interleave attention across frames or views. Unlike frames, which are ordered in time, or views, which are related by camera geometry, microscopy channels are pixel-aligned but unordered; ChanSFormer therefore encodes no channel ordering, making the encoder permutation-equivariant along the channel axis (Appendix I).
3 Method
We present ChanSFormer, a Vision Transformer [5] designed to be channel-agnostic for multichannel imagery while remaining efficient and accurate. The model operates on an input , where and are the spatial dimensions and is the number of channels.
3.1 Overall architecture
Figure 1 (a) gives an overview, each of the input channels is independently processed by a shared patch-embedding layer with patch size and embedding dimension , producing spatial tokens per channel. A spatial positional embedding in is added, which is shared across channels. Individual channel class (CLS) tokens (Section 3.2) are prepended to each channel's tokens, producing the encoder input .
This encoder input is then fed into a stack of ChanSFormer encoders, each of which decomposes the global self-attention of a standard ViT encoder [5] into a channel and a spatial attention (Section 3.3). The output of the stack is ; we extract its channel CLS tokens as the per-channel representation. A dedicated channel sampling mechanism (Section 3.4) varies the number and identity of input channels during supervised training.
Two output heads consume depending on the training objective.
Supervised aggregation. As shown in Figure 1(b), for supervised classification tasks, we aggregate the channel CLS tokens into a single image token via a query-based attention pooling:
where is a single learnable query, and are learnable linear projections from to , and stacks the channel CLS tokens produced by the last encoder. A single query keeps the pool cost linear in .
Self-supervised adaptation. As shown in Figure 1(c), for DINOv2 [11] self supervised pretraining, we do not use an aggregator but feed all the channel CLS tokens directly to the student and teacher heads, treating as independent views of the input. The remaining patch tokens are

Figure 1: (a) Overall framework of ChanSFormer. Each channel of an input image is independently projected by a shared patch embedding; a shared spatial positional embedding is added, and individual channel class (CLS) tokens, copied from a single learnable CLS token, are concatenated. The resulting tokens pass through L ChanSFormer encoders. (b) Supervised classification. The channel CLS tokens are aggregated via attention into an image-level representation. (c) Self-supervised DINOv2 pretraining. The channel CLS tokens are treated as distinct samples to generate the DINO loss [11], while the remaining patch tokens generate the iBOT [17] loss. (d) Architecture of the ChanSFormer encoder. A single global attention block is replaced by channel attention (across channels, per spatial position) followed by spatial attention (across spatial positions, per channel).
used to generate the iBOT [17] loss. This setup is closely related to BoC [10], where each channel is independently embedded, except that our ChanSFormer encoder still allows cross-channel information exchange inside the backbone. Using channel CLS tokens rather than a single aggregated token also yields more supervision per image for the self-distillation objective, increasing the effective batch size and the diversity within the batch.
3.2 Individual channel class tokens
The first important design of ChanSFormer is the individual channel class token. In standard ViT, a class token is used to aggregate information across spatial positions. For multi-channel images, ideally each channel should have its own learnable class token. However, to keep the model channel-agnostic, we instantiate a single learnable CLS token and copy it into channels at the input, so that for all . The tokens are initially identical, but because each interacts only with its own channel's spatial tokens during spatial attention (Section 3.3), they evolve through the stack and come to represent features of one channel each.
This departs from the convention in TimeSformer [22], which pools or averages a single global CLS across time frames. Averaging is appropriate when slices carry highly correlated information (e.g., frames of a video or RGB channels) but is lossy when each slice is semantically distinct, as in multichannel fluorescence microscopy where different channels image different cellular components. Keeping one CLS per channel preserves the channel-specific information for the downstream heads described in Section 3.1.
Apart from its primary role as a channel-agnostic aggregator, the channel CLS token has two other important uses. First, in self-supervised learning, as mentioned in Section 3.1, it serves as an independent image view for each channel, effectively increasing the batch size and within-batch diversity. Second, in supervised learning, it allows us to sample channels according to the relationships among these channel CLS tokens, which we detail in Section 3.4 to drive channel sampling. This sampling role is analogous to the learnable channel embedding used in channel-specific ViTs [8].
3.3 Disentangled channel-spatial attention
As shown in Figure 1 (d), each ChanSFormer encoder replaces the multi-head self-attention block in a standard ViT [5] with two attentions applied sequentially: first a channel attention, then a spatial attention. The rest of the block (MLP, layer normalization, residual structure) remain unchanged. Let be the input.
Channel attention. At each spatial position , we attend across the channel tokens. Let denote the tokens at position , the channel-attention is
with learnable linear projections and denoting layer normalization. Information crosses the channel axis but not the spatial axis at this step.
Spatial attention. Then, for each channel , we attend across the spatial tokens of that channel. Let denote the tokens for channel , the spatial-attention is
with learnable linear projections from to shared across all channels. Compared with a global self-attention over tokens, one ChanSFormer encoder costs instead of . The saving is pronounced when is large (small patch size) or is moderate, the regime typical of multichannel microscopy.
Hardware-aware channel attention optimization. Channel attention operates in a regime that breaks the assumptions of standard attention implementations. Modern attention algorithms, including Memory Efficient Attention [24], assume a high hardware occupancy originating from long input sequence length, such as in spatial attention or in global attention. However, channel attention operates over a sequence length of (typically < 16), which is too short to saturate NVIDIA TensorCores for matrix multiplication. Meanwhile, existing algorithms require the sequence length dimension at a fixed location. Thus, channel attention must conduct excessive tensor permutations to meet this requirement. As a result, when applied trivially to channel attention, existing algorithms will suffer from degraded throughput due to low hardware occupancy and excessive memory operations.
To resolve these problems, we fuse the entire channel attention computation into a single Triton kernel and batch multiple short instances together, so that the memory overheads are amortized across hundreds of attention operations rather than paid per instance. Furthermore, our attention kernel adapts its internal computation to the channel size . At small sizes that are unable to saturate TensorCores, we fall back to CUDA cores for a higher throughput (see Table 4); at larger sizes, we engage the TensorCores for matrix multiplication, as in regular attention algorithms. These novel design choices place our kernel in a complementary regime to FlashAttention [25, 26]: where FlashAttention optimizes a moderate number of long sequences, ours optimizes an excessive number of short sequences.
3.4 Representation based channel sampling
Randomly sampling the input channel set during training is an effective regularizer for channel-adaptive ViTs [6, 8], improving models' robustness. DiChaViT [8] demonstrated that guiding this sampling using the pairwise distances among learned channel embeddings outperforms uniform random sampling (HCS [6]). However, this strategy tightly couples the sampler to the channel embedding, the very component we removed to make ChanSFormer channel-agnostic.
We therefore need a sampling signal that does not depend on a fixed, input-time lookup. The channel CLS tokens (Section 3.2) naturally fill this role: as they process data, they accumulate channel-specific representations. To establish a stable, dataset-level metric of channel relationships, we maintain an exponential moving average (EMA) matrix computed from the channel CLS tokens at a designated backbone layer :
where denotes the pairwise cosine similarity function, and is a momentum close to 1 so that reflects stable relations across many batches. The update happens inside the forward method and is decoupled from any downstream loss.
During training, we draw a subset size , and use the relation matrix , scaled by a temperature , to probabilistically guide the selection of the channels, biasing the sampler away from purely uniform draws. This allows us to retain the sampling benefits of representation-based subset sampling while remaining channel-agnostic. Channel sampling is disabled at inference.
4 Experiments
We evaluate ChanSFormer in supervised classification and self-supervised pretraining regimes on two multi-channel cell benchmarks, CHAMMI, JUMP-CP and a multi-channel satellite benchmark, So2Sat. Because our decomposed spatial-channel attention introduces additional weights in channel attention, we ensure a fair comparison against all small-scale baselines by reducing our backbone's embedding dimension from standard 384 to 320 and the number of attention heads to 5. This adjustment keeps ChanSFormer's total parameter count slightly below the baseline models.
4.1 Datasets and metrics
CHAMMI [12] is a multichannel microscopy benchmark comprising roughly 220K images drawn from three sources: the Allen/WTC-11 cell dataset (3 channels), the Human Protein Atlas (HPA, 4 channels), and Cell Painting (CP, 5 channels). To evaluate domain generalization, we follow the established protocol [8] by extracting feature representations and using a 1-Nearest Neighbour classifier to compute the macro-average F1-score for each task. Following [8], we report the averaged score of the metric from the WTC and HPA subsets.
JUMP-CP [27] features single-cell images subjected to diverse chemical and genetic perturbations. Our evaluation isolates the compound perturbation plate BR00116991 [28], encompassing 161 classes (160 specific treatments plus one control). Each image contains 8 channels in total: 5 capturing fluorescence and 3 capturing brightfield information. Following [6, 8], we use the official train/val/test split and report the top-1 classification accuracy both on the full 8-channel input and on the 5-channel fluorescence-only subset.
So2Sat [29] consists of satellite image patches categorized into 17 distinct local climate zones. The data spans 18 channels per patch, combining 8 Sentinel-1 synthetic aperture radar (SAR) channels and 10 Sentinel-2 multispectral channels. Adopting the city-split partition, our setup uses 352K images for training, 24K for validation and 24K for testing. We report the top-1 classification accuracy under two settings [8]: Full (all 18 channels) and Sen-1 (the 8 Sentinel-1 radar channels).
4.2 Implementation details
For supervised tasks, we follow the training recipe of DiChaViT [8]. For self-supervised pretraining, we utilize DINOv2 [11] combined with the iBOT [17] objective, where we do not use KoLeo regularizer and we use a low weight (0.6) on iBOT loss to stabilize training on small-sized models. We use PyTorch and train all models from scratch. Model training is conducted on distinct hardware setups based on dataset scale: JUMP-CP on 4× RTX PRO 6000 GPUs, So2Sat on 4× A100 GPUs, and CHAMMI on a single Quadro RTX 8000 GPU. Throughput is evaluated on a Quadro RTX 8000. Detailed hyper-parameters are listed in the Appendix.
4.3 Results
4.3.1 Supervised tasks
We first evaluate ChanSFormer on supervised classification tasks across the three datasets. We compare our approach against a comprehensive suite of channel-adaptive baselines: HyperViT [15], DepthwiseViT [12], TemplateViT [13, 14], ChAda-ViT [7], ChannelViT [6], and DiChaViT [8]. As detailed in Table 1, ChanSFormer establishes a new SOTA on both JUMP-CP and So2Sat. On JUMP-CP, our model surpasses DiChaViT by 3.93% to 4.27%. It demonstrates similarly consistent improvements on So2Sat (1.40% to 1.99%). Notably, these performance gains are achieved using a more compact backbone (20.1M parameters compared to the 21.5M of recent ViT baselines), proving our architectural efficiency. On the CHAMMI benchmark, we perform marginally behind DiChaViT by 0.85%. This is expected as we omit its embedding-dependent Channel Diversification
Table 1: Supervised classification on three multichannel benchmarks. For JUMP-CP and So2Sat, Full evaluates on all channels, Flu. evaluates on the fluorescence channels for JUMP-CP and Sen-1 evaluates on the Sentinel-1 channels for So2Sat. The highest number is bold, the second highest is underlined. #Params is the number of parameters. The reported numbers are the mean of 3 runs.
| Method | #Params | CHAMMI | JUMP-CP | So2Sat | ||
|---|---|---|---|---|---|---|
| Avg | Full | Flu. | Full | Sen-1 | ||
| HyperViT [15] | 24.7M | 54.54 | 47.07 | 42.43 | 60.73 | 41.88 |
| DepthwiseViT [12] | 22.6M | 60.94 | 49.86 | 44.98 | 60.41 | 43.41 |
| TemplateViT [13, 14] | 21.5M | 57.02 | 52.48 | 43.85 | 55.86 | 37.28 |
| ChAda-ViT [7] | 21.5M | 63.88 | 65.03 | 42.15 | 56.98 | 12.38 |
| ChannelViT [6] | 21.5M | 64.90 | 67.51 | 56.49 | 62.75 | 47.70 |
| DiChaViT [8] | 21.5M | 69.68 | 69.19 | 57.98 | 63.36 | 47.76 |
| ChanSFormer | 20.1M | 68.83 | 73.46 | 61.91 | 64.76 | 49.75 |
Loss, without which DiChaViT's score drops to 68.07% [8], falling below ChanSFormer's 68.83%. This minor performance trade-off is well worth the architectural flexibility gained for seamlessly handling varying channel configurations.
4.3.2 Self-supervised tasks
Besides its superior performance in supervised tasks, we evaluate ChanSFormer's representations in a self-supervised regime. We compare DINOv2 pretrained our approach against two baselines: BoC [10], which achieves channel-agnosticism by processing channels independently, and ChannelViT [6], which models cross-channel interactions but relies on channel embeddings. So2Sat is excluded from the pretraining because of its small resolution. To allow dynamic adaptation to varying number of channels, we randomly sample 2 channels for each image during training. As shown in Table 2, ChanSFormer outperforms both baselines in nearly all settings. For in-domain linear probing, our model surpasses BoC by 1.32% on CHAMMI and 2.91% on JUMP-CP. The advantage largely persists during cross-dataset transfer, where ChanSFormer leads BoC by up to 2.72%. On the other hand, ChannelViT suffers a performance degradation during cross-dataset transfer, lagging behind ChanSFormer by up to 16.88%. This collapse occurs because ChannelViT's learned representations are tied to its pretraining channel configuration, forcing it to zero-pad the embeddings for unseen channels in the target dataset. This gap is further exacerbated by a train-eval mismatch, as we sample only two channels in training but use full channels in evaluation. These phenomena demonstrate ChanSFormer's strong generalization to novel channel sets because of its channel-agnostic design.
Table 2: Self-supervised linear-probe transfer across multichannel datasets. Models are pretrained with DINOv2 [11] on the dataset listed in the Pretrain column, then evaluated by linear probe on the target dataset. Flu. and Sen-1 represent the fluorescence and Sentinel-1 channels respectively. For ChannelViT, the channel embeddings for unseen channels are zero-padded. † marks evaluations involving channels absent from SSL pretraining.
| Pretrain | Method | CHAMMI | JUMP-CP | So2Sat | ||
|---|---|---|---|---|---|---|
| Avg | Full | Flu. | Full | Sen-1 | ||
| CHAMMI | BoC [10] | 48.92 | 39.36† | 36.42† | 67.50† | 46.46† |
| ChannelViT [6] | 44.29 | 23.94† | 24.71† | 66.65† | 44.54† | |
| ChanSFormer | 50.24 | 40.82† | 39.14† | 68.08† | 46.23† | |
| JUMP-CP Flu. | BoC [10] | 40.85† | 46.00† | 42.24 | 65.47† | 45.28† |
| ChannelViT [6] | 32.88† | 30.72† | 32.97 | 65.00† | 44.47† | |
| ChanSFormer | 42.86† | 46.13† | 45.15 | 66.33† | 45.34† | |
4.3.3 Computational efficiency
Model-level throughput. Table 3 demonstrates the throughput improvement yielded by ChanS-Former's overall architecture. By disentangling the global attention into sequential
Table 3: Model-level throughput (images/sec). Higher is better. Benchmarked on 8 channel 224×224 inputs. ChanSFormer speeds up both training and inference over global attention. Naive is naive attention as in Table 4.
| Mode | Model | Patch 16 | Patch 8 |
|---|---|---|---|
| Inference | ChannelViT | 72.2 | 7.7 |
| ChanSFormer (naive) | 106.7 | 22.0 | |
| ChanSFormer | 112.0 | 22.9 | |
| Training | ChannelViT | 16.3 | 1.5 |
| ChanSFormer (naive) | 30.8 | 5.8 | |
| ChanSFormer | 33.9 | 6.2 |
Table 4: Speed and GPU memory for channel attention. Benchmarked on input tensors of shape . Lower is better. Our optimized attention reduces execution time and GPU memory footprint compared to standard implementations.
| Method | Inference | Training | ||
|---|---|---|---|---|
| Speed | Memory | Speed | Memory | |
| Naive attention | 7.1 ms | 1029 MB | 26.3 ms | 1117 MB |
| Mem-efficient | 6.0 ms | 797 MB | 18.6 ms | 2283 MB |
| Ours | 4.9 ms | 634 MB | 12.1 ms | 877 MB |
channel and spatial attention with complexity, ChanSFormer alleviates the primary computational bottleneck. This reduction alone, measured with naive channel attention, accelerates inference by 48%–186% and training by 89%–286% over ChannelViT. Our optimized kernel, which amortizes the fixed overheads of short channel sequences, adds a further 4%–10% over the naive implementation. Together, they increase the inference throughput of the full model by 55% at patch size 16 and 197% at patch size 8, and the training throughput by 108% to 313%. The performance advantage widens drastically as the spatial sequence length grows, matching the predicted scaling for multichannel processing.
Hardware-aware channel attention. Table 4 isolates the performance of our optimized channel attention kernel with an input of 8 channels (). Standard hardware-aware implementations, such as memory-efficient attention [24], are heavily optimized for long sequences. They struggle with our extremely short channel sequence regime, which inflates their training workspace memory to 2283 MB due to the fixed overheads discussed in Section 3.3. Our optimized kernel sidesteps these issues by fusing operations and adapting to small tile sizes. It reduces the running time during the full training step by 35% to 54%, while simultaneously reducing the memory footprint by 20% to 62%.
4.3.4 Robustness to missing and novel channels
Following [6, 8], we further evaluate the model's robustness by testing its supervised classification performance on partial channels of the JUMP-CP dataset. We systematically drop channels and report the average accuracy across all combinations of available channels. As shown in Table 5, ChanSFormer outperforms the baselines whenever at least two channels are available, leading DiChaViT by 0.20% to 3.70% with 2–7 channels, highlighting the robustness of our channel-agnostic design to missing channels. This setting removes subsets of channels that were observed during training, and therefore measures robustness to missing channels rather than generalization to channels with unseen semantics.
Table 5: Test accuracy under partial channels of JUMP-CP. Each column reports the mean std over all combinations of available channels out of 8 [6, 8]. ChanSFormer achieves comparable or better performance in all 8 cases.
| Method | Number of channels for evaluation () | |||||||
|---|---|---|---|---|---|---|---|---|
| 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | |
| ChannelViT [6] | 67.51 | 60.369.1 | 52.7412.2 | 44.8913.2 | 36.8812.3 | 29.369.3 | 23.705.0 | 20.781.6 |
| DiChaViT [8] | 69.19 | 61.919.3 | 54.4912.4 | 46.3513.4 | 38.0012.4 | 30.099.3 | 23.974.9 | 20.901.6 |
| ChanSFormer | 73.46 | 65.6110.0 | 57.3212.8 | 48.5213.7 | 39.5012.5 | 30.929.2 | 24.174.6 | 20.651.3 |
We next evaluate the generalization of ChanSFormer to novel channels in the self-supervised setting. Unlike the partial-channel setting above, which only removes channels observed during training, the cross-dataset transfer in Table 2, following CA-MAE [9] and BoC [10], already evaluates transfer to channels whose semantics are absent from pretraining (marked by ). In addition, we conduct an experiment on CHAMMI in which either HPA or Allen is excluded from SSL pretraining, using the
Table 6: Leave-one-source-out self-supervised transfer. Models are pretrained with DINOv2 [11] on CHAMMI with one source held out, then evaluated by linear probe (JUMP-CP) or the official CHAMMI protocol. All evaluations in this table involve channels absent from SSL pretraining. Bold denotes the best result under each pretraining source.
| Pretrain | Method | CHAMMI | JUMP-CP | |
|---|---|---|---|---|
| Avg | Full | Flu. | ||
| CHAMMI: Allen + CP(HPA held out) | BoC [10] | 35.72 | 19.63 | 19.65 |
| ChannelViT [6] | 33.92 | 19.54 | 19.53 | |
| ChanSFormer | 46.00 | 38.38 | 37.25 | |
| CHAMMI: HPA + CP(Allen held out) | BoC [10] | 46.76 | 37.75 | 35.67 |
| ChannelViT [6] | 40.93 | 19.62 | 19.62 | |
| ChanSFormer | 44.38 | 38.58 | 37.58 | |
Table 7: Ablation on channel embeddings and cross-channel interactions. Channel embeddings are not critical for ChanSFormer compared with ChannelViT with global attention, and cross-channel interactions prove essential. Flu. and Sen-1 represents the fluorescence and Sentinel-1 channels respectively.
| Method | CHAMMI | JUMP-CP | So2Sat | ||
|---|---|---|---|---|---|
| Avg | Full | Flu. | Full | Sen-1 | |
| ChanSFormer | 68.83 | 73.46 | 61.91 | 64.76 | 49.75 |
| w. channel embedding | 69.03 | 73.78 | 62.36 | 64.78 | 49.55 |
| ChannelViT [6] | 64.90 | 67.51 | 56.49 | 62.75 | 47.70 |
| w/o channel embedding (CA-MAE [9]) | 50.37 | 61.93 | 51.56 | 62.58 | 46.73 |
| Spatial-only (BoC [10] + CLS channel attn) | 61.73 | 41.56 | 39.10 | 63.41 | 47.70 |
same pretraining recipe as in Section 4.3.2. Every evaluation in this setting therefore involves channels that are absent from pretraining. As shown in Table 6, ChanSFormer outperforms both baselines in five of the six settings and remains far ahead of ChannelViT, whose zero-padded embeddings for unseen channels leave it near 19.5% on JUMP-CP. Thus, the advantage of ChanSFormer extends beyond robustness to missing channels to the novel-channel transfer regime that motivates this work.
4.3.5 Ablation studies
Ablation on channel embeddings. Table 7 shows the reliance of different architectures to fixed channel embeddings. Adding channel embeddings to ChanSFormer yields only marginal improvements. In stark contrast, removing them from ChannelViT causes a catastrophic performance degradation (e.g., a 14.53 drop on CHAMMI). Note that this embedding-free ChannelViT represents the architectural backbone of CA-MAE [9], an existing channel-agnostic method. These results demonstrate that our decomposed attention and individual CLS tokens natively preserve channel identities, rendering hard-coded embeddings obsolete.
Ablation on cross-channel interactions. We further ablate the necessity of modeling cross-channel correlations. The “Spatial-only” baseline in Table 7 processes spatial patches independently, effectively adapting the channel-agnostic approach of BoC [10] to supervised tasks by utilizing the same query-based attention pooling described in Section 3.1. The severe performance degradation observed across all datasets confirms that late-stage feature aggregation is insufficient for complex multi-channel data. These results demonstrate that cross-channel correlations are vital for robust modeling of multi-channel imagery.
Ablation on channel sampling and CLS tokens. The first three rows of Table 8 sequentially ablate our architectural components in the supervised setting. First, replacing our representation-based sampling with purely uniform sampling (HCS [6]) causes a consistent performance drop (2.66% on CHAMMI, 0.65% on JUMP-CP Full, and 0.13% on JUMP-CP Flu.). Next, building upon this HCS baseline, we replace the individual channel CLS tokens with a single CLS token [22]. In this TimeSformer-style baseline, the CLS token is copied during spatial attention and subsequently
Table 8: Ablation of ChanSFormer's design choices. The Setting column distinguishes between supervised classification and DINOv2 linear probes. For the DINOv2 ablation, models are pretrained on either CHAMMI or JUMP-CP (indicated as PT) to compare feature granularity. Flu. represents the fluorescence channels.
| Setting | Method | CHAMMI | JUMP-CP Full | JUMP-CP Flu. |
|---|---|---|---|---|
| Supervised | ChanSFormer | 68.83 | 73.46 | 61.91 |
| w. HCS [6] channel sampling | 66.17 | 72.81 | 61.78 | |
| w. HCS [6] w/o channel CLS token [22] | 64.58 | 69.77 | 58.00 | |
| DINOv2(PT: CHAMMI) | ChanSFormer (channel-level) | 50.24 | 40.82 | 39.14 |
| w/ attention pooling (image-level) | 48.61 | 38.97 | 38.52 | |
| DINOv2(PT: JUMP-CP Flu.) | ChanSFormer (channel-level) | 42.86 | 46.13 | 45.15 |
| w/ attention pooling (image-level) | 41.84 | 45.95 | 45.10 |
averaged across channels. This modification further degrades accuracy across all datasets. Because individual channels carry highly heterogeneous information, average pooling them into a single token forcibly destroys critical modality-specific features. Therefore, maintaining independent channel tokens is essential for cell painting images.
Ablation on SSL feature granularity. We further ablate the granularity of the supervisory signals in our self-supervised learning (SSL) framework, comparing channel-independent tokens against an aggregated image-level token. As shown in the lower half of Table 8, our approach consistently achieves superior linear-probe performance, regardless of the pretraining dataset (CHAMMI or JUMP-CP). This advantage stems from the fact that different channels carry highly heterogeneous information. Retaining independent CLS tokens allows the model to utilize this heterogeneity as distinct, modality-specific supervisory signals during pretraining. This provides a richer supervisory signal per sample and increases the diversity of training signals within each batch, thus improving the performance. This comparison also separates the contribution of the backbone from that of the supervision granularity. With image-level attention pooling, ChanSFormer is trained with the same supervision granularity as ChannelViT, yet it outperforms ChannelViT (Table 2) in all six settings, mostly by a large margin, indicating that the backbone provides the main improvement. Channel-level supervision then adds a further gain in all six settings.
5 Conclusion
We presented ChanSFormer, a highly efficient, channel-agnostic Vision Transformer that replaces rigid channel embeddings with decomposed spatial-channel attention and individual channel CLS tokens. This design preserves distinct channel identities and cross-channel interactions naturally, while also unlocking superior self-supervised representation learning. Empirically, ChanSFormer achieves comparable or superior performance compared to SOTA methods across two biology multi-channel datasets and one satellite dataset. Furthermore, it demonstrates exceptional cross-dataset transferability and accelerates model throughput. By eliminating the need for channel-specific retraining, our model provides a unified, flexible backbone that paves the way for adaptable foundation models in multi-channel imaging.
Limitations. While our channel-agnostic design provides architectural flexibility, omitting fixed channel embeddings precludes the direct use of auxiliary channel-diversity losses [8], leading to slightly lower performance on CHAMMI. Adapting them is nontrivial: they are defined over static embeddings, whereas our channel CLS tokens are data-dependent representations, and directly forcing them apart may suppress meaningful cross-channel correlations. Developing a channel-agnostic diversification objective is a promising direction. Furthermore, due to resource constraints, scaling ChanSFormer to the data and model size of foundation models like BoC [10] is left to future work.
Acknowledgments and Disclosure of Funding
This work builds upon a preliminary version presented at the ImageOmics workshop at NeurIPS 2025, which was conducted while Jingwei Zhang was interning at Insitro. The subsequent extensions and analyses at Stony Brook University were supported by USA NSF grants IIS-2123920 [D.S.], IIS-2212046 [D.S.].
Disclosure of Funding and Competing Interests: Srinivasan Sivanandan is employed by Insitro and may hold equity in the company. Insitro has filed a patent application related to the preliminary work with Jingwei Zhang and Srinivasan Sivanandan listed as inventors. The remaining author declares no competing financial interests.
References
[1] L. Von Chamier, R. F. Laine, J. Jukkala, C. Spahn, D. Krentzel, E. Nehme, M. Lerche, S. Hernández-Pérez, P. K. Mattila, E. Karinou, et al., “Democratising deep learning for microscopy with zerocostd14mic,” Nature communications, vol. 12, no. 1, p. 2276, 2021.
[2] F. Vincent, A. Nueda, J. Lee, M. Schenone, M. Prunotto, and M. Mercola, “Phenotypic drug discovery: recent successes, lessons learned and new directions,” Nature Reviews Drug Discovery, vol. 21, no. 12, pp. 899–914, 2022.
[3] M. Boutros, F. Heigwer, and C. Laufer, “Microscopy-based high-content screening,” Cell, vol. 163, no. 6, pp. 1314–1325, 2015.
[4] M.-A. Bray, S. Singh, H. Han, C. T. Davis, B. Borgeson, C. Hartland, M. Kost-Alimova, S. M. Gustafsdottir, C. C. Gibson, and A. E. Carpenter, “Cell painting, a high-content image-based assay for morphological profiling using multiplexed fluorescent dyes,” Nature protocols, vol. 11, no. 9, pp. 1757–1774, 2016.
[5] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al., “An image is worth 16x16 words: Transformers for image recognition at scale,” arXiv preprint arXiv:2010.11929, 2020.
[6] Y. Bao, S. Sivanandan, and T. Karaletsos, “Channel vision transformers: an image is worth 1 x 16 x 16 words,” arXiv preprint arXiv:2309.16108, 2023.
[7] N. Bourriez, I. Bendidi, E. Cohen, G. Watkinson, M. Sanchez, G. Bollot, and A. Genovesio, “Chada-vit: Channel adaptive attention for joint representation learning of heterogeneous microscopy images,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11556–11565, 2024.
[8] C. Pham and B. Plummer, “Enhancing feature diversity boosts channel-adaptive vision transformers,” Advances in Neural Information Processing Systems, vol. 37, pp. 89782–89805, 2024.
[9] O. Kraus, K. Kenyon-Dean, S. Saberian, M. Fallah, P. McLean, J. Leung, V. Sharma, A. Khan, J. Balakrishnan, S. Celik, et al., “Masked autoencoders for microscopy are scalable learners of cellular biology,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11757–11768, 2024.
[10] A. V. De Lorenci, S. E. Yi, T. Moutakanni, P. Bojanowski, C. Couprie, J. C. Caicedo, and W. M. A. Pernice, “Scaling channel-adaptive self-supervised learning,” Transactions on Machine Learning Research, 2025.
[11] M. Oquab, T. Darcet, T. Moutakanni, H. Vo, M. Szafraniec, V. Khalidov, P. Fernandez, D. Haziza, F. Massa, A. El-Nouby, et al., “Dinov2: Learning robust visual features without supervision,” arXiv preprint arXiv:2304.07193, 2023.
[12] Z. S. Chen, C. Pham, S. Wang, M. Doron, N. Moshkov, B. Plummer, and J. C. Caicedo, “Chammi: A benchmark for channel-adaptive models in microscopy imaging,” Advances in Neural Information Processing Systems, vol. 36, pp. 19700–19713, 2023.
[13] B. A. Plummer, N. Dryden, J. Frost, T. Hoefler, and K. Saenko, “Neural parameter allocation search,” in International Conference on Learning Representations (ICLR), 2022.
[14] P. Savarese and M. Maire, “Learning implicitly recurrent CNNs through parameter sharing,” in International Conference on Learning Representations (ICLR), 2019.
[15] D. Ha, A. Dai, and Q. Le, “Hypernetworks,” in International Conference on Learning Representations (ICLR), 2016.
[16] M. Caron, H. Touvron, I. Misra, H. Jégou, J. Mairal, P. Bojanowski, and A. Joulin, “Emerging properties in self-supervised vision transformers,” in Proceedings of the International Conference on Computer Vision (ICCV), 2021.
[17] J. Zhou, C. Wei, H. Wang, W. Shen, C. Xie, A. Yuille, and T. Kong, "ibot: Image bert pre-training with online tokenizer," arXiv preprint arXiv:2111.07832, 2021.
[18] K. He, X. Chen, S. Xie, Y. Li, P. Dollár, and R. Girshick, "Masked autoencoders are scalable vision learners," in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16000–16009, 2022.
[19] T. Moutakanni, C. Couprie, S. Yi, M. Doron, Z. S. Chen, N. Moshkov, E. Gardes, M. Caron, H. Touvron, A. Joulin, et al., "Cell-dino: Self-supervised image-based embeddings for cell fluorescent microscopy," PLOS Computational Biology, vol. 21, no. 12, p. e1013828, 2025.
[20] C. Pham, J. C. Caicedo, and B. A. Plummer, "Cha-maevit: Unifying channel-aware masked autoencoders and multi-channel vision transformers for improved cross-channel learning," in The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.
[21] W. Lian, P. Micke, J. Lindblad, and N. Sladoje, "Isolated channel vision transformers: from single-channel pretraining to multi-channel finetuning," arXiv preprint arXiv:2503.09826, 2025.
[22] G. Bertasius, H. Wang, and L. Torresani, "Is space-time attention all you need for video understanding?," in Proceedings of the 38th International Conference on Machine Learning (ICML), vol. 139 of Proceedings of Machine Learning Research, pp. 813–824, 2021.
[23] Q. Miao, V. R. Golani, J. Xu, P. P. Dutta, M. Hoai, and D. Samaras, "Multi-view gaze target estimation," in Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 5371–5381, 2025.
[24] B. Lefaudeux, F. Massa, D. Liskovich, W. Xiong, V. Caggiano, S. Naren, M. Xu, J. Hu, M. Tintore, S. Zhang, P. Labatut, D. Haziza, L. Wehrstedt, J. Reizenstein, and G. Sizov, "xformers: A modular and hackable transformer modelling library." https://github.com/facebookresearch/xformers, 2022.
[25] T. Dao, D. Fu, S. Ermon, A. Rudra, and C. Ré, "Flashattention: Fast and memory-efficient exact attention with io-awareness," Advances in neural information processing systems, vol. 35, pp. 16344–16359, 2022.
[26] T. Dao, "Flashattention-2: Faster attention with better parallelism and work partitioning," arXiv preprint arXiv:2307.08691, 2023.
[27] S. N. Chandrasekaran, B. A. Cimini, A. Goodale, L. Miller, M. Kost-Alimova, N. Jamali, J. G. Doench, B. Fritchman, A. Skepner, M. Melanson, et al., "Three million images and morphological profiles of cells treated with matched chemical and genetic perturbations," Nature Methods, vol. 21, no. 6, pp. 1114–1121, 2024.
[28] Y. Bao and T. Karaletsos, "Contextual vision transformers for robust representation learning," arXiv preprint arXiv:2305.19402, 2023.
[29] X. X. Zhu, J. Hu, C. Qiu, Y. Shi, J. Kang, L. Mou, H. Bagheri, M. Haberle, Y. Hua, R. Huang, et al., "So2sat lcz42: A benchmark data set for the classification of global local climate zones [software and data sets]," IEEE Geoscience and Remote Sensing Magazine, vol. 8, no. 3, pp. 76–89, 2020.
A Details of the channel attention kernel
We provide here the design and implementation details of the channel attention kernel. The kernel is written in Triton and supports both the forward and backward passes, with full autograd integration. Our channel size ranges from 1 to 18 in practice, which sits well below the granularity at which mainstream attention kernels are tuned. We organize the discussion around three design choices: (i) a -adaptive dispatch between two kernel paths, (ii) instance batching to amortize memory traffic, and (iii) a stride-aware launch interface that eliminates layout-conversion copies.
C-adaptive dispatch. NVIDIA TensorCores require the inner dimensions of a matrix multiplication to be at least 16 in order to issue a single MMA instruction; below this threshold, the operands must be padded, and the padded lanes contribute no useful work. For channel attention with , the score matrix and the output matmul both fall into this regime, so a naive use of TensorCores wastes most of the issued FLOPs on padding. We therefore dispatch according to the length of channel sequences at kernel-launch time. For short channel sequences (), we avoid using TensorCores entirely and instead use the general-purpose CUDA cores, which have no minimum-shape requirement and are not bottlenecked at this scale. For longer sequences (), we revert to the standard TensorCores as they are faster at this scale. The crossover between paths is determined empirically on our target hardware, an NVIDIA Quadro RTX 8000: we benchmark both paths across the practical channel-count range and select the point at which the TensorCore path becomes faster. On this GPU, the small path remains faster up through , after which the large path takes over. Because both the padding overhead and the TensorCore throughput depend on the GPU architecture, this threshold is hardware-dependent. On other devices, it can be selected by a lightweight device-specific microbenchmark at installation or initialization time.
Instance batching for short-sequence amortization. A single channel attention call in our model spawns hundreds to thousands of independent attention instances (one per spatial position, per head, across the batch). If each instance were launched as a separate GPU program, as in a direct port of FlashAttention [25], the per-instance computation would be far too small to amortize the fixed costs of kernel launch, register allocation, and shared memory setup. To eliminate this overhead on the small- path, we let each program process a batch of instances together, with the batch size automatically tuned for each (, HEAD_DIM) configuration. All operations—loading queries, keys, and values, the softmax reduction, and writing the result—are then executed in a batched manner, so that the launch cost is roughly divided by the batch size. When becomes large, a single instance already provides enough parallelism to fully occupy the GPU's compute units, and batching is no longer needed; we fall back to processing one instance per program. We further prune any configuration that our cost model predicts will exceed register capacity and cause spilling.
Stride-aware launch interface. A subtle but important source of overhead in channel attention stems from layout conversion. Most attention kernels require the attention axis to occupy a fixed tensor dimension, which in our case would force an explicit permutation and a contiguous copy on every call, together with a symmetric copy when restoring the original shape. At the batch sizes we use, these copies already cost on par with the attention computation itself. We remove this overhead by making the kernel stride-aware. The launch wrapper inspects the input strides and passes the necessary stride metadata to the kernel. The kernel then uses that stride information to compute load and store offsets, handling both standard layouts and the native multidimensional layout of our queries, keys, and values with zero data movement.
Backward pass. The backward pass mirrors the forward dispatch. Following the standard FlashAttention recurrence, we save only the log-sum-exp statistics from the forward pass and recompute , , and inside the backward kernel; this trades a modest amount of additional FLOPs for a substantial reduction in saved-activation memory. The three gradient tensors , , are computed in a single fused kernel per path.
B Extended implementation details
Supervised Training Hyperparameters. For supervised classification tasks, we optimize all models using AdamW. For JUMP-CP and So2Sat, we apply a cosine learning rate schedule with a 10 epoch linear warmup, a base learning rate of , and a weight decay of 0.04. They are trained for 100 epochs using standard cross-entropy loss, with batch sizes of 256 (patch size 16) and 128 (patch size 8), respectively. For CHAMMI, we use a cosine learning rate schedule with a 3 epoch linear warmup, a learning rate of and train for 60 epochs with a batch size of 64, a patch size of 16 and proxy loss. For the representation-based channel sampling applied across these experiments, we use an EMA momentum of , a scaling temperature of for CHAMMI. We use an EMA momentum of , a scaling temperature of for So2Sat. We use an EMA momentum of , a scaling temperature of for JUMP-CP. Following DiChaViT [8], is selected separately for each dataset on its validation set; its sensitivity is analyzed in Table 13.
Representation-based channel sampling. Varying the input channel set during training serves as an effective regularizer for our channel-agnostic backbone. The prior method DiChaViT [8] samples a random channel and then sample additional ones based on their dissimilarity to that initial selection. However, we observe that this heuristic often leads to an unintended outcome: selected channels may be distant from the initial anchor while remaining highly similar to each other. Our empirical analysis of this process confirms that the vast majority of channel pairs selected by this approach are indeed similar pairs. Consequently, in our representation-based sampling, we intentionally and directly sample subsets of similar channels. As demonstrated in Table 8, this strategy effectively regularizes the training process and yields superior performance. Specifically, we compute channel similarities at layer . We find that representations from initial or very late layers yield slightly inferior performance, while the middle-to-late range (layers 6–9) provides the better signal for representation-based sampling. Moreover, the diagonal entries of S in Eq. (4), which represent self-similarity, are excluded from sampling. On CHAMMI, whose three sources contribute disjoint channel sets (Allen: 3 channels, HPA: 4, CP: 5), we follow the channel indexing of DiChaViT [8] and assign the channels distinct global indices, giving C = 12. Although S is stored as a single buffer, it is updated and queried only within the block that corresponds to the source of the current image. S therefore effectively consists of three independent , , and similarity matrices, with an effective C of 3, 4, or 5 depending on the source; cross-source entries are never updated or used for sampling. S is a non-trainable buffer: the channel CLS tokens are detached before the similarities are computed, so no gradient flows through S or the sampling operation. In distributed training, the batch similarity matrix is averaged across all workers before the EMA update, so that every worker maintains the same S; since S is at most , the synchronization overhead is negligible.
Self-Supervised Pretraining Hyperparameters. In our self-supervised framework based on DINOv2 [11] with iBOT [17], we adapt the default loss weighting to accommodate the presence of multiple independent channel CLS tokens. Specifically, the KoLeo regularizer weight is removed to prevent NaN and improve performance. The iBOT loss weight is reduced to 0.6 to ensure stable training. We sample only 2 channels for each image. This allows dynamic adaptation to varying numbers of channels, enlarges the batch size under a fixed memory budget, and provides a unified protocol across datasets whose images contain different numbers of channels (e.g., 3, 4, or 5 on CHAMMI). The batch size is set to 1024 for BoC and 512 for ChannelViT and ChanSFormer, so that the three models see the same number of channels per iteration. We use a schedule of 100 channel-epochs on CHAMMI and JUMP-CP. The channel-epoch refers to the number of iterations that allows the model to see the total number of channels in the dataset (e.g., assuming every sample has 4 channels, 100 channel-epochs is 200 epochs as we sample 2 channels for each sample). The base learning rate is set to 0.002 with a batch size of 1024 and the same square root scaling rule for learning rate as the vanilla DINOv2. Although each pretraining view contains only two channels, the frozen backbone is evaluated with up to 8 channels on JUMP-CP and 18 channels on So2Sat (Table 2). ChanSFormer imposes no maximum channel count, because its patch embedding, spatial positional embedding, and attention operations are all shared across the channel axis, so it operates on substantially more channels than it has observed simultaneously during pretraining.
For linear-probe evaluations on the JUMP-CP and So2Sat dataset, we use concatenated channel cls tokens from the last 4 layers and follow the same protocol in the vanilla DINOv2. For ChannelViT where we do not have the channel level cls tokens, we use the averaged-pooled token of each channel along with the single global cls token. On the CHAMMI dataset, we also concatenate channel level cls tokens but only use the features from the last layer and we follow the standard evaluation protocol as [8].
C Standard deviation of the supervised results
Here we reported the standard deviations of our method in Table 9.
Table 9: Standard deviation of ChanSFormer on 3 datasets.
| Method | CHAMMI | JUMP-CP Full | JUMP-CP Flu. | So2Sat Full | So2Sat Sen-1 |
|---|---|---|---|---|---|
| ChanSFormer | 68.83 ± 0.51 | 73.46 ± 0.14 | 61.91 ± 0.62 | 64.76 ± 0.30 | 49.75 ± 0.33 |
D Subset results on the CHAMMI dataset
We detail the subset evaluation on the CHAMMI dataset, as shown in Table 10 and Table 11. In supervised learning, we surpass ChannelViT in average accuracy. We achieved a bit lower performance on the Allen and CP subsets compared with DiChaViT, which we attribute to the inability to leverage auxiliary channel-diversity losses when fixed channel embeddings are omitted. In the DINOv2 linear-probe setting, our approach demonstrates superior performance on the HPA subset and yields the highest overall accuracy across both in-domain and cross-dataset evaluations.
Table 10: Detailed breakdown of performance on CHAMMI subsets (Allen, HPA, and CP). The Avg column represents the mean of Allen and HPA. Baseline results are reported from DiChaViT [8].
| Method | #Params | Allen | HPA | CP | Avg |
|---|---|---|---|---|---|
| HyperViT [15] | 24.7M | 45.17 | 63.90 | 26.23 | 54.54 |
| DepthwiseViT [12] | 22.6M | 50.35 | 71.52 | 27.74 | 60.94 |
| TemplateViT [13] | 21.5M | 49.51 | 64.52 | 25.65 | 57.02 |
| ChAda-ViT [7] | 21.5M | 67.08 | 60.67 | 24.60 | 63.88 |
| ChannelViT [6] | 21.5M | 67.66 | 62.14 | 27.62 | 64.90 |
| DiChaViT [8] | 21.5M | 75.69 | 63.67 | 28.98 | 69.68 |
| ChanSFormer | 20.1M | 69.00 | 68.67 | 27.31 | 68.83 |
Table 11: Detailed breakdown of performance on CHAMMI subsets (Allen, HPA, and CP) for DINOv2 linear-probe. The Avg column represents the mean of Allen and HPA.
| Pretrain | Method | Allen | HPA | CP | Avg |
|---|---|---|---|---|---|
| CHAMMI | BoC [10] | 49.88 | 47.96 | 27.91 | 48.92 |
| ChannelViT [6] | 46.60 | 41.98 | 26.93 | 44.29 | |
| ChanSFormer | 48.96 | 51.51 | 25.10 | 50.24 | |
| JUMP-CP Flu. | BoC [10] | 43.31 | 38.40 | 27.83 | 40.85 |
| ChannelViT [6] | 32.48 | 33.29 | 28.77 | 32.88 | |
| ChanSFormer | 44.48 | 41.25 | 27.99 | 42.86 |
E Supervised results with ImageNet pretraining
The main paper trains all models from scratch (Table 1). Here we additionally report results when models are initialized from an ImageNet pretrained ViT-S/16, which is the more common setting on general benchmarks. We use the same training recipe as Section 4.2 with shorter schedules and lower learning rates suitable for fine-tuning: 45 epochs on CHAMMI (lr , 3 epoch warmup, batch size 64), 50 epochs on JUMP-CP (lr , 5 epoch warmup, batch size 256), and 20 epochs on So2Sat (lr , 2 epoch warmup, batch size 256). We did not include ChAda-ViT as it is ChannelViT without HCS in this case. To make the spatial-attention weights compatible with the ImageNet ViT-S/16 checkpoint, ChanSFormer in this setting uses the standard ViT-S embedding dimension rather than the used in the main paper; this raises its parameter count to 28.9M. Table 12 summarizes the results on the full channel set of each dataset. ChanSFormer achieves the highest accuracy on all three datasets, surpassing the best baselines by 0.76% to 1.5%.
The disentangled architecture transfers well from natural-image pretraining and remains the strongest channel-adaptive ViT in this setting without relying on a learnable channel embedding.
Table 12: Supervised classification with ImageNet ViT-S/16 pretraining. Top-1 accuracy on the full channel set of each dataset. The highest number per column is bold and the second highest is underlined.
| Method | #Params | CHAMMI | JUMP-CP | So2Sat |
|---|---|---|---|---|
| HyperViT [15] | 24.7M | 62.28 | 39.64 | 61.22 |
| DepthwiseViT [12] | 22.6M | 76.52 | 46.97 | 61.55 |
| TemplateViT [13, 14] | 21.5M | 70.30 | 35.01 | 60.84 |
| ChannelViT [6] | 21.5M | 80.68 | 80.81 | 68.01 |
| DiChaViT [8] | 21.5M | 78.83 | 82.99 | 67.18 |
| ChanSFormer | 28.9M | 82.18 | 84.11 | 68.77 |
F Sensitivity to the sampling temperature
The temperature controls how strongly the learned channel relations shape the sampling distribution: large values approach uniform HCS sampling, whereas small values concentrate the samples on the channel combinations favored by . Table 13 varies around the selected value on each dataset. On So2Sat, and 1.0 achieve nearly identical overall performance, while is slightly lower, mainly on Sentinel-1. On JUMP-CP, and 10 perform similarly, while leads to a noticeable drop. On CHAMMI, and 0.1 are comparable, whereas and 1.0 perform worse. Performance is therefore stable within an appropriate range for each dataset, while excessively concentrating or flattening the sampling distribution reduces it. The selected values differ across datasets partly because has a different contrast on each: the standard deviation of its off-diagonal entries is 0.134–0.174 on the three CHAMMI sources, 0.203 on So2Sat, and 0.295 on JUMP-CP. This roughly two-fold difference does not fully account for the two orders of magnitude spanned by the selected , since also determines how strongly the learned relations are sharpened. Similarly, although JUMP-CP and So2Sat share a coarse two-block structure in (Figures 2 and 3), this does not imply the same optimal . The ten-fold difference between their selected values does not indicate sharply different optima, however: performs well on both datasets, nearly matching on So2Sat and giving the best result on JUMP-CP.
Table 13: Sensitivity to the sampling temperature in supervised training. The selected value for each dataset is shown in bold in the column; bold numbers denote the best result in each column.
| So2Sat Full | Sen-1 | |
|---|---|---|
| 0.01 | 64.85 | 48.35 |
| 0.1 | 64.76 | 49.75 |
| 1.0 | 64.99 | 49.46 |
| JUMP-CP Full | Flu. | |
|---|---|---|
| 0.1 | 71.41 | 58.39 |
| 1.0 | 73.46 | 61.91 |
| 10 | 73.12 | 61.18 |
| CHAMMI | |
|---|---|
| 0.001 | 67.34 |
| 0.01 | 68.83 |
| 0.1 | 68.40 |
| 1.0 | 66.26 |
G Number of channels per view in self-supervised pretraining
To examine the effect of using more channels per view, we additionally pretrain on JUMP-CP Flu, with four channels per image, reducing the image batch size from 512 to 256 so that the total number of channel views per iteration is unchanged. As shown in Table 14, four-channel pretraining consistently improves both ChannelViT and ChanSFormer over the two-channel setting, and ChanSFormer remains substantially better than ChannelViT in every evaluation setting.
Table 14: Number of channels per view in DINOv2 pretraining on JUMP-CP Flu., evaluated as in Table 2. The image batch size is halved for four channels to keep the number of channel views per iteration fixed.
| Method | # Channels per view | CHAMMI | JUMP-CP | |
|---|---|---|---|---|
| Avg | Full | Flu. | ||
| ChannelViT [6] | 2 | 32.88 | 30.72 | 32.97 |
| 4 | 34.09 | 31.97 | 35.53 | |
| ChanSFormer | 2 | 42.86 | 46.13 | 45.15 |
| 4 | 45.04 | 48.18 | 46.49 | |
H Adapting ChannelViT’s channel embeddings to unseen channels
In Table 2, ChannelViT handles channels that are absent from pretraining by zero-padding their channel embeddings. A stronger baseline is to learn embeddings for the unseen channels on the target dataset. We therefore train the embeddings of the unseen channels together with the linear head and keep all other pretrained weights fixed. This is considerably more expensive than linear probing: computing gradients for the embeddings requires full forward and backward passes through the backbone, whereas linear probing trains a linear head on features extracted once, and several probe configurations can share the same cached features. One adaptation run is about 20× slower than a linear-probe run in our implementation, and each hyperparameter configuration requires a separate run. As shown in Table 15, adapting the channel embeddings slightly improves ChannelViT over zero-padding, but it remains below ChanSFormer in all seven unseen-channel settings. We omit in-domain settings, where the pretraining and evaluation channels are identical and no embedding needs to be adapted, and CHAMMI as a target, since its official protocol uses feature-space 1-NN classification without trainable downstream parameters.
Table 15: Zero-padded vs. adapted channel embeddings for ChannelViT [6] on unseen-channel transfer. Models are pretrained with DINOv2 on the SSL source and evaluated by linear probe on the Target.
| SSL source | Target | ChannelViT (zero-pad) | ChannelViT (CE adapt.) | ChanSFormer |
|---|---|---|---|---|
| CHAMMI | JUMP-CP Full | 23.94 | 25.54 | 40.82 |
| JUMP-CP Flu. | 24.71 | 24.99 | 39.14 | |
| So2Sat Full | 66.65 | 66.91 | 68.08 | |
| So2Sat Sen-1 | 44.54 | 45.14 | 46.23 | |
| JUMP-CP Flu. | JUMP-CP Full | 30.72 | 31.10 | 46.13 |
| So2Sat Full | 65.00 | 65.19 | 66.33 | |
| So2Sat Sen-1 | 44.47 | 44.60 | 45.34 |
I Relation to factorized space–time attention
Our channel–spatial factorization is related to the space–time factorization of TimeSformer [22], but serves a different purpose. TimeSformer factorizes attention mainly for efficient video modeling, whereas we use the factorization to remove the dependence on fixed channel embeddings while still allowing information to flow across channels. Moreover, unlike video frames, whose temporal order is meaningful, the order of microscopy channels is arbitrary, so the encoder should be permutation-equivariant along the channel axis and the image-level prediction permutation-invariant. ChanSFormer satisfies both by construction: all operations are shared across channels and no channel ordering is encoded, so channel identity is preserved structurally through the explicit channel axis rather than through learned channel embeddings, and the attention pooling over the channel CLS tokens does not depend on their order. The two designs also differ in how the per-slice representations are aggregated. TimeSformer copies a single CLS token across frames and merges it, which suits highly correlated slices; with the channel CLS tokens replaced by such a shared token, accuracy drops by 1.59%–3.78% under the same HCS sampling (Table 8), as averaging the heterogeneous channels of microscopy images is lossy.
J Learned channel relations
Figure 2 visualizes, on JUMP-CP, the channel-similarity matrix learned by our sampler (Section 3.4) and the channel-attention weights of the trained model. shows a clear two-block structure. The three brightfield channels are nearly interchangeable (pairwise similarity 0.95–0.97), whereas their similarity to the fluorescence channels is substantially lower. The channel attention reflects this structure mainly through the fluorescence queries, which attend mainly to other fluorescence channels and assign each brightfield channel only about 0.07 of their attention, below the uniform level of 0.125, whereas the brightfield queries attend nearly uniformly across channels. This is qualitatively consistent with the imaging modalities: fluorescence channels capture complementary stain-specific cellular structures, while the brightfield channels provide a different transmitted-light view. It also agrees with the channel correlation structure reported by ChannelViT [6]. Although all channel CLS tokens are initialized identically, the learned is far from uniform, indicating that they do not collapse to the same representation. On So2Sat (Figure 3), likewise shows a two-block structure aligned with the two sensors, Sentinel-1 (SAR) and Sentinel-2 (multispectral), again consistent with ChannelViT.


Figure 2: Learned channel relations on JUMP-CP. Left: the EMA channel-similarity matrix used by our sampler. Right: channel-attention weights (row: query, column: key) at patch positions, averaged over all heads, all 12 layers, and the full test set with all 8 channels present; each row sums to 1 (uniform = 0.125). White lines separate the fluorescence (Mito, AGP, RNA, ER, DNA) and brightfield (HighZBF, LowZBF, Brightfield) channels.


Figure 3: Learned channel relations on So2Sat. Left: the EMA channel-similarity matrix used by our sampler. Right: channel-attention weights (row: query, column: key) at patch positions, averaged over all heads, all 12 layers, and the full test set with all 18 channels present; each row sums to 1. White lines separate the 8 Sentinel-1 channels from the 10 Sentinel-2 bands. Sentinel-1: real (re) and imaginary (im) parts of the unfiltered VH and VV channels, intensity (int) of the refined-Lee-filtered VH and VV channels, and real and imaginary parts of the refined-Lee-filtered covariance-matrix off-diagonal element (Cov).