Skip to content

johnsonandjohnson/DeepCellMorpho

Repository files navigation

Advancing Morphological Profiling with Self-Supervised Learning: Comparative Insights into Representation Learning of Cellular Perturbations

Authors: Walid M. Abdelmoula, Tomé Albuquerque, Steffen Jaensch, Pushpak Pati, Michiel Van Dyck, Samantha J. Allen, Litao Zhang, Tommaso Mansi and Rui Liao

contact: the corresponding author

Summary

This repository benchmarks state-of-the-art self-supervised learning (SSL) models for Cell Painting phenotypic profiling. We evaluate four foundation models: MAE, iTPN, DINO and DINOv2, covering contrastive, masked, and hybrid learning mechanisms.

Models were pretrained on the JUMP-CP dataset and compared against a CellProfiler baseline, with generalization tested across three independent datasets spanning four additional cell types.

Key results:

  • On JUMP-Target-2 compounds iTPN, DINO, and DINOv2 significantly outperform CellProfiler on compound–replicate retrieval (p ≤ 0.001).
  • DINO and DINOv2 generalize well to unseen cell types and improve MoA retrieval by 20–30% (HepG2, EU‑OPENSCREEN).
  • Contrastive and hybrid SSL models show stronger robustness than masked-only approaches.

Additionally, we provide pretrained model weights for inference on new datasets, as well as JUMP‑CP-Target-2 embeddings, enabling straightforward application and further research.

Overall, SSL foundation models show the potential to provide more informative and generalizable representations than traditional feature engineering, supporting progress in phenotypic profiling for drug discovery.

1. Getting started

1.1. System requirements

All code presented in this repo supports Python 3.8+ and should work with all modern operating systems.

1.2. Dependencies

pip install -r requirements.txt

1.3. Repository Structure

├── 📄 CODE LICENSE.txt
├── 📄 MODELS_EMBEDDINGS  LICENSE.txt
├── 📄 README.md
├── 📄 requirements.txt
├── 📁 data/
│   ├── 📁 figure_02/
│   ├── 📁 figure_03/
│   └── 📁 ...
├── 📁 illustrations/
│   ├── 📁 figure_02/
│   ├── 📁 figure_03/
│   └── 📁 ...
├── 📁 tables/
│   ├── 📁 table_01/
│   ├── 📁 table_03/
│   └── 📁 ...
├── 📁 models/
│   ├── 📁 weights/
│   ├── 📄 run_inference.ipynb
│   └── ...
├── 📁 embeddings/
│   ├── 📁 MAE_ViT_B16/
│   ├── 📁 DINOv2_ViT_B16/
│   ├── 📁 metadata/
│   └── ...
├── 📁 utils/
│   ├── 📄 __init__.py
│   ├── 📄 figures_utils.py
│   ├── 📄 tables_utils.py
│   └── ...
└── 📁 notebooks/
    ├── 📁 figures/
    │   ├── 📄 figure_02_post_processing_ablation.ipynb
    │   ├── 📄 figure_03_reproducibility_task.ipynb
    │   └── 📄  ...
    └── 📁 tables/
        ├── 📄 table_01_dataset_stats.ipynb
        ├── 📄 table_03_evaluation_RxRx1.ipynb
        └── 📄  ...

2. Usage Instructions

2.1. Generating Figures

Use the notebooks located in /deepcellmorpho/notebooks/figures/ to reproduce the figures from the paper.

2.2. Generating Tables

Use the notebooks located in /deepcellmorpho/notebooks/tables/ for table generation and analysis.

2.3. SSL models inference

For model inference, an example notebook is provided in /deepcellmorpho/models/run_inference.ipynb. This allows you to run inference using any of the four pretrained SSL models. Please make sure that you adapt your dataloader according to your needs. Before running inference, check the recommended input image dimensions below. To preserve morphological details, avoiding resizing is generally preferred. Instead, consider using the recommended crop sizes - for example, a 960 x 960 x 5 image can be split into four 480 x 480 x 5 crops and processed individually.

2.4. Pre-trained Models

2.4.1. Baseline SSL Models

SSL Model Input Size Weights Location
MAE ViT-B16 224 x 224 x 5 /models/weights/pre_trained_MAE_ViT_B16.pth
iTPN HiViT-B16 224 x 224 x 5 /models/weights/pre_trained_iTPN_HiViT_B16.pth
DINO ViT-B16 ⭐ 480 x 480 x 5 /models/weights/pre_trained_DINO_ViT_B16.pth
DINOv2 ViT-B16 ⭐ 480 x 480 x 5 /models/weights/pre_trained_DINOv2_ViT_B16.pth

2.4.2. DINOv2 ablation SSL Models

SSL Model Input Size Weights Location
DINOv2 ViT-B8 480 x 480 x 5 /models/weights/pre_trained_DINOv2_ViT_B8.pth
DINOv2 ViT-S16 480 x 480 x 5 /models/weights/pre_trained_DINOv2_ViT_S16.pth
DINOv2 ViT-B16 480 x 480 x 5 /models/weights/pre_trained_DINOv2_ViT_B16.pth
DINOv2 ViT-B16 (short-sequence) 192 x 192 x 5 /models/weights/pre_trained_DINOv2_ViT_B16_short_sequence.pth
DINOv2 ViT-B16 (cross-batch) ⭐ 480 x 480 x 5 /models/weights/pre_trained_DINOv2_ViT_B16_cross_batch.pth

(⭐ – denotes the top-performing SSL models)

2.5. JUMP-CP-Target-2 Embeddings

Precomputed JUMP-CP-Target-2 embeddings (and also entire source 6) are available for download and can be found in the /deepcellmorpho/embeddings/ directory. These embeddings are generated using our four SSL models. These embeddings serve as compact, information‑rich descriptors of cellular morphology, enabling different downstream tasks. The metada files used for pre-training and testing of our models are also provided in /deepcellmorpho/embeddings/metadata/ directory.

3. License

Please note that different components of this project are distributed under different licensing terms.

The model weights provided in /deepcellmorpho/models/weights/ and the model embeddings in /deepcellmorpho/embeddings/ are intended for non-commercial use only. These model weights/embeddings are licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC-SA 4.0) license.

The code is distributed under the APACHE 2.0 License, which grants users the freedom to use, modify, and distribute the code with certain obligations and limitations. Please refer to the CODE LICENSE file for detailed information regarding the terms and conditions.

4. Citation

If you find this work useful for your research, please cite our paper:

@article{Abdelmoula2025deepcellmorpho,
  author       = {Abdelmoula, Walid M. and Albuquerque, Tomé and Jaensch, Steffen and Pati, Pushpak and Van Dyck, Michiel and J. Allen, Samantha and Zhang, Litao Zhang and Mansi, Tommaso and Liao, Rui},
  title        = {Advancing Morphological Profiling with Self-Supervised Learning: Comparative Insights into Representation Learning of Cellular Perturbations},
  journal      = {Nature Methods},
  year         = {2026},
  volume       = {0000},
  number       = {0},
  pages        = {},
  doi          = {},
  url          = {},
  issn         = {}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages