Introduction to Cellpose#

In this section, we dive into Cellpose, a state-of-the-art deep learning tool for biological image segmentation. You’ll learn how it works, what makes it unique compared to other models like U-Net and StarDist, and how to use it via its easy-to-use web interface (GUI). We’ll conclude by setting the stage for using Cellpose in Google Colab for more flexible and scalable workflows.


What is Cellpose?#

Cellpose is a deep learning model for segmenting biological images. It was released in 2021 by Stringer et al. with a specific goal: to create a model that works well on many types of microscopy data without needing retraining.

Unlike tools like U-Net or StarDist that often require dataset-specific training, Cellpose was designed as a generalist model. It was trained on a large, diverse set of images—fluorescent images, phase contrast, cells with or without nuclei, cytoplasmic markers, and more.


The Core Innovation: Flow Fields#

Key Idea#

Cellpose predicts spatial flow fields instead of binary masks. Each pixel in the image is assigned a vector that “points” toward the center of its object. After these flows are computed, the pixels are grouped based on how they flow together—like tracking water to a drain.

How it Works (Conceptually)#

  1. Input: An image of cells, nuclei, or tissue.

  2. Model predicts:

    • A probability map: which pixels are likely to belong to any object.

    • A flow field: where each pixel would move if it were pulled toward its object’s center.

  3. Pixels are grouped: Based on where they flow, pixels are grouped into instances (cells).


Cellpose Training Data and Generalization#

Cellpose was trained on over 70,000 manually annotated cells across various imaging modalities, including:

  • Fluorescence (cytoplasmic, nuclear, and membrane markers)

  • Brightfield

  • Phase contrast

  • Tissue sections

This diversity is what makes Cellpose a generalist—you often don’t need to retrain it on your own data.

Key strength, Cellpose allows custom training if needed, which is something we’ll briefly touch on later.


Cellpose Timeline#

Version

Release Date

Name / Paper

Key Features & Innovations

Use Cases / Impact

Cellpose 1.0

December 2020

[Stringer et al., Nat. Methods (2020)]

- Introduced flow-based segmentation
- Generalist model trained on a wide range of image types
- Pretrained on nuclei and cytoplasm
- GUI and command-line interface (CLI) support

- Ready-to-use for diverse cell types
- No need for custom training
- Reproducible and scalable

Cellpose 2.0

April 2022

[Pachitariu & Stringer, Nat. Methods (2022)]

- Enabled human-in-the-loop training
- Easy custom model training without code
- Introduced model zoo for diverse pretrained options
- Improved GUI with model selection and training support

- Great for labs with specific cell types
- Enables personalized models for better accuracy
- More flexible for experimental variation

Cellpose 3.0

February 2024

[Stringer & Pachitariu, Nat. Methods (2025)]

- Added image restoration before segmentation
- Enhanced segmentation quality for noisy/low-contrast data
- Integration into GUI/API/CLI
- Preprocessing saved as _seg.npy

- Particularly effective for challenging or degraded images
- One-click enhancement for better masks

Cellpose-SAM

May 2025

[Pachitariu, Rariden & Stringer, bioRxiv (2025)]

- Achieves superhuman generalization
- Works on 2D and 3D data
- Handles noise, blur, contrast inversion, variable scales
- Compatible with Hugging Face online batch processing

- Broadest generalization across datasets
- Ideal for complex, noisy, real-world images
- Scalable deployment with cloud integration


Using Cellpose via the GUI#

Cellpose comes with a graphical user interface (GUI) that lets you segment images without any coding. It’s one of the easiest ways to get started.

Accessing the GUI#

You can access the Cellpose GUI in two main ways:

Option 1: Online Web Tool Cellpose developers provide a web-based GUI:

Note: The web app uses limited resources and is best for trying out single images.

Option 2: Local Install (Desktop App) If you want better performance:

  • Install Cellpose on your local computer

  • Launch the GUI using cellpose from the command line

Instructions for installation are available on MouseLand/cellpose

Hide code cell source
%%HTML
<iframe width="900" height="506" src="https://www.youtube.com/embed/2ANILvqca6Q?si=jAhAuVYPoyXGuo1M" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>