Masked Autoencoders for Microscopy are Scalable Learners of Cellular Biology

Oren Kraus, Kian Kenyon-Dean, Saber Saberian, Maryam Fallah, Peter McLean, Jess Leung, Vasudev Sharma, Ayla Khan, Jia Balakrishnan, Safiye Celik, Dominique Beaini, Maciej Sypetkowski, Chi Vicky Cheng, Kristen Morse, Maureen Makes, Ben Mabey, Berton Earnshaw

Introduction

In modern drug discovery, High Content Screening (HCS) utilizes automated microscopy to capture millions of images of cells treated with various genetic (e.g., CRISPR) or chemical perturbations. The primary challenge lies in extracting biologically meaningful representations from these images to determine how different treatments relate to one another.

Historically, researchers relied on customized, brittle image processing pipelines or Weakly Supervised Learning (WSL)—training models to predict specific perturbations. However, WSL models are highly sensitive to label quality and often plateau when scaled to massive, noisy, real-world datasets. This research introduces a scalable, self-supervised alternative: Masked Autoencoders (MAEs) trained on up to 93 million microscopy images.

Methods

The authors utilize Masked Autoencoders with Vision Transformer (ViT) and U-Net backbones. The model learns by masking a large portion of an image and attempting to reconstruct the missing patches, forcing it to learn robust cellular morphology without relying on curated labels.

Fourier Domain Reconstruction Loss

When training large-scale models (like ViT-L/8), standard pixel-level L2 loss often fails to capture fine cellular textures or leads to training instability. To address this, the researchers introduced an L1 loss in the frequency (Fourier) domain. This addition stabilized training and compelled the model to learn high-frequency morphological details essential for biological accuracy.

Comparison of training loss with and without Fourier domain reconstruction loss (L_FT), demonstrating improved convergence and stability.

Channel-Agnostic MAE (CA-MAE)

Microscopy setups vary significantly between laboratories, differing in the number and type of fluorescent channels used. Standard architectures require a fixed number of input channels, necessitating bespoke models for every lab. The authors introduced the Channel-Agnostic MAE (CA-MAE), which treats each channel as a separate modality. By applying shared linear projections and positional embeddings to all channels, the model creates a flexible sequence of tokens. This allows a model trained on 6-channel data to be evaluated on 5-channel or 8-channel data at inference time without retraining.

Overview of the CA-MAE pipeline, illustrating the channel-agnostic tokenization during training and the downstream identification of biological relationships.

Datasets and Scaling

The models were evaluated across five datasets of increasing scale:

  • RxRx1 & RxRx1-2M: Standard Cell Painting datasets (~125K to 1.6M images).
  • RxRx3: 2.2M images featuring CRISPR knockouts.
  • RPI-52M & RPI-93M: Massive proprietary datasets containing up to 92.7 million images, spanning fluorescence and brightfield modalities.
  • JUMP-CP: A public dataset used for zero-shot transfer evaluation to test the CA-MAE's flexibility across different channel structures.

Key Insights and Results

  • Scaling Laws in Biology: Unlike WSL, which degraded when moving to larger, noisier datasets like RxRx3, MAE performance consistently improved as model and dataset size increased.
  • Biological Relationship Recall: The top-performing model (ViT-L/8+ trained on RPI-93M) achieved an 11.5% relative improvement over the best WSL model in recalling known biological relationships from the hu.MAP database.
  • Superior Transferability: On the unseen JUMP-CP dataset, the CA-MAE model achieved an Average Precision (AP) of 0.95 for perturbation retrieval, significantly outperforming the traditional CellProfiler baseline (0.53) and WSL (0.84).
  • Morphological Richness: MAE embeddings showed a 148% improvement over WSL in predicting traditional "Intensity" features, proving they capture a much richer set of biological information than models trained simply to classify perturbations.

Limitations and Future Work

Despite the success, the computational cost is significant; training the largest model required over 20,000 GPU hours. Additionally, treating every channel as a separate token sequence leads to a "token explosion" that limits the use of very small patch sizes in large architectures. Future work will explore more efficient attention mechanisms, such as SWIN transformers, to handle these massive sequence lengths. Finally, while MAEs are highly resolved, they can be over-sensitive to phenotypic differences between biologically related perturbations, suggesting a need for future alignment techniques to better group similar biological mechanisms.

Summary updated

BibTeX
@inproceedings{kraus2024masked,
  author = {Oren Kraus and Kian Kenyon-Dean and Saber Saberian and Maryam Fallah and Peter McLean and Jess Leung and Vasudev Sharma and Ayla Khan and Jia Balakrishnan and Safiye Celik and Dominique Beaini and Maciej Sypetkowski and Chi Vicky Cheng and Kristen Morse and Maureen Makes and Ben Mabey and Berton Earnshaw},
  title = {{Masked Autoencoders for Microscopy are Scalable Learners of Cellular Biology}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  doi = {10.1109/cvpr52733.2024.01117},
}
Figure