Open-source project
MouseLand/cellpose avatar
MouseLand/cellpose

Cellpose: A Generalist Cell Segmentation Model with Human-in-the-Loop Training

a generalist algorithm for cellular segmentation with human-in-the-loop capabilities

2,383 stars649 forksPythonBSD-3-Clause

At a glance

What is it?
Cellpose is a Python package for cellular segmentation that ships pretrained generalist models, a GUI for correcting masks, and a training path for your own labeled data. The current line, Cellpose-SAM and the Cellpose4 DINOv3 models, is powerful but carries a CC-BY-NC training-data constraint that rules out commercial use of the weights.
Who is it for?
Cellpose fits labs that segment cells or nuclei from 2D and 3D microscopy and are willing to correct masks in the GUI or fine-tune on their own labels. Skip it if you need permissively licensed weights for a commercial product, since the README states all Cellpose models and the annotated dataset are trained on CC-BY-NC data.
Can I use it commercially?
Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 108 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Cellpose solves and who it is for

Segmenting cells from microscopy images has traditionally meant either hand-tuning classical filters per dataset or training a network from scratch on labeled masks. Cellpose is built around the opposite premise: one generalist model that transfers across imaging modalities, so a new dataset gets usable masks before anyone annotates anything. The README describes Cellpose-SAM as offering "superhuman generalization" and lists the conditions it is meant to survive: shot noise, anisotropic blur, undersampling, contrast inversions, arbitrary channel order and varying object sizes.

The audience is experimental biologists and imaging facility staff who need masks for counting, tracking or morphometry, plus computational people who want a segmentation step they can script. The package is Python, installable from PyPI, and it also ships a GUI for interactive correction. The human-in-the-loop story matters more than the headline model: Cellpose 2.0 introduced training your own model from a small number of corrected images, and the repository keeps a training notebook for that workflow.

It is not a general image-analysis framework. It segments cells and nuclei. Anything downstream of the mask is your problem, and the README points to the documentation rather than describing analysis features.

How Cellpose-SAM and the Cellpose4 models fit together

The current architecture rests on a foundation model backbone rather than a bespoke segmentation network. The README states that the Cellpose4 models added in the v4.2 release are based on DINOv3, with the model names `cpdino` and `cpdino-vitb`, and that the CellposeSAM model was updated to `cpsam_v2`, which "now predicts fewer spurious masks in low-contrast regions." That is a concrete behavioural change worth noting: false positives in dim regions were a known annoyance, and the update targets exactly that.

There is a dependency consequence. Using the new models requires installing DINOv3 separately, which the README gives as `pip install git+https://github.com/facebookresearch/dinov3`. That is a direct install from a GitHub repository, not a pinned PyPI release, so reproducibility depends on whatever that repository's default branch contains at install time. For a lab that needs to reproduce a segmentation run months later, that is a real risk and the README does not document a version pin.

The package also carries `segment_anything` as a core dependency, which is consistent with the SAM lineage named in the model. The rest of the dependency list in `setup.py` is unremarkable for scientific Python: numpy, scipy, tifffile, torch and torchvision, opencv-python-headless, fastremap, imagecodecs, roifile and fill-voids.

Installing Cellpose and running a first segmentation in Python

The README points to the installation section and to the documentation at cellpose.readthedocs.io. The package is distributed on PyPI, and the v4.2 update note gives the upgrade command directly. Note that `setup.py` removes the explicit torch pin when it detects a suitable installed torch, so the PyTorch you already have may be reused rather than replaced.

To install or upgrade, run:

bash
pip install cellpose --upgrade

If you intend to use the Cellpose4 DINOv3-based models, the README adds a second install step from the DINOv3 repository:

bash
pip install git+https://github.com/facebookresearch/dinov3

For a first run, the repository provides `notebooks/run_Cellpose-SAM.ipynb`, which the README describes as running Cellpose-SAM on your own data mounted in Google Drive, and `notebooks/test_Cellpose-SAM.ipynb`, which runs on example data in 2D and 3D. Those notebooks are the shortest path to a working call, and they are also the place to read the exact model name and parameters for your version.

There is no command-line invocation documented in the README excerpt. If you want a CLI, check the documentation rather than assuming flags exist. The GUI is the other entry point, and the README links a video of human-in-the-loop training for that workflow.

The CC-BY-NC training data is the constraint that matters most

The README states plainly that all Cellpose models are trained on data licensed under CC-BY-NC, and that the annotated dataset is CC-BY-NC as well. The repository's own code is BSD-3-Clause, and the README badge references GPL v3, so the licensing picture is layered: permissive code, non-commercial weights. That distinction is easy to miss when you see a permissive licence on the source tree.

For academic labs this is usually fine. For anyone building a commercial product, a clinical pipeline, or a hosted service around the pretrained models, the pretrained weights are the part you would be shipping, and the README's statement about their training data is the relevant fact. I am not giving legal advice here; the point is that the constraint is stated in the README and it is not a formality. If you need permissively licensed segmentation weights, Cellpose's pretrained models are the wrong choice, and the human-in-the-loop training path does not automatically fix that, since the base model you fine-tune from is the same pretrained model.

A second limitation is scope. The README's generalization claims are about image conditions, not about object classes. Cellpose segments cells and nuclei. It is not a tool for segmenting tissue compartments, organs or arbitrary biological structures, and nothing in the README suggests it should be.

Alternatives and where the approach differs

The closest comparison inside the repository's own dependency list is `segment_anything`, the Segment Anything Model that Cellpose lists as a core dependency and whose lineage the Cellpose-SAM name references. The difference in approach is the prompt. SAM is designed around user-supplied prompts such as points or boxes that indicate what to segment, which makes it interactive and general but not automatic for a plate of images. Cellpose is built to produce masks for every cell in an image without per-object prompting, and its human-in-the-loop feature is about correcting and retraining on whole images rather than prompting individual objects. If your workflow is a human clicking through a handful of images, SAM-style prompting is a reasonable fit. If it is hundreds of fields of view that need masks tonight, Cellpose's design is the one aimed at that.

Compared with training a U-Net on your own annotated data, Cellpose trades peak accuracy on a narrow domain for a model that works before you annotate. That trade is the whole point, and it is also its cost: on a very specific modality where you have thousands of labeled masks, a purpose-trained network can beat a generalist. Cellpose's answer is fine-tuning, which the repository supports through the training notebook.

Maintenance, upgrade cost and what to verify

The repository is not archived, and the last push was on 2026-06-14, the same day as the v4.2.1.1 release. The release cadence visible in the repository is roughly quarterly, with v4.1.0 in March 2026 and v4.2.1.1 in June 2026. That is recent enough that the project is being worked on, and the v4.2 notes describe both a model update and new model families, which means an upgrade can change your masks rather than just fix bugs.

That is the upgrade cost to plan for. Switching from an earlier CellposeSAM model to `cpsam_v2` changes segmentation output by design, since the stated goal is fewer spurious masks in low-contrast regions. Any downstream count or measurement derived from masks will shift. The README does not document a rollback path for model versions, and the DINOv3 dependency is installed from a Git repository rather than a released package, so pinning is left to you.

On licence, the code is BSD-3-Clause per the repository metadata and the setup.py `license="BSD"` field, while the README's badge references GPL v3 and the models and annotated dataset are CC-BY-NC. Read the LICENSE file and the model terms before redistributing anything.

Editorial conclusion

Cellpose fits labs that segment cells or nuclei from 2D and 3D microscopy and are willing to correct masks in the GUI or fine-tune on their own labels. Skip it if you need permissively licensed weights for a commercial product, since the README states all Cellpose models and the annotated dataset are trained on CC-BY-NC data. Before committing, verify which model name your pipeline loads, whether your GPU and PyTorch version satisfy the install, and whether your institution's licence position allows the pretrained weights.

Frequently asked questions

What does Cellpose do?

It segments cells and nuclei in microscopy images using pretrained generalist models, and it lets you correct masks and train a model on your own labeled data. The README describes Cellpose-SAM as handling shot noise, anisotropic blur, undersampling, contrast inversions, arbitrary channel order and varying object sizes.

How do I install Cellpose?

The package is on PyPI, and the v4.2 update note gives the upgrade command as pip install cellpose --upgrade. To use the Cellpose4 DINOv3-based models you also need pip install git+https://github.com/facebookresearch/dinov3.

How to run Cellpose on GPU?

The README does not give a dedicated GPU instruction. It lists torch and torchvision as core dependencies and notes better support for Mac Silicon chips via MPS, so GPU use depends on your PyTorch install rather than a Cellpose-specific flag.

How to reference Cellpose?

The README specifies different citations by component: the Cellpose-SAM paper for Cellpose-SAM, the Cellpose 1.0 Nature Methods paper for versions 1 to 3, the Cellpose 2.0 paper if you use human-in-the-loop training, and the Cellpose3 paper if you use the image restoration models or cyto3.

How to use Cellpose in Python?

The repository provides notebooks for this: run_Cellpose-SAM.ipynb runs the model on your own data mounted in Google Drive, and test_Cellpose-SAM.ipynb runs it on example data in 2D and 3D. The README does not document a command-line interface.

How to use the Cellpose GUI?

The README links a video of human-in-the-loop training, which is the GUI workflow for correcting masks and training on them. GUI extras are declared in setup.py under gui_deps, including pyqtgraph, pyqt6, qtpy and superqt.

Official sources

  1. License: BSD-3-Clause
  2. MouseLand/cellpose on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mouseland-cellpose.svg)](https://hysenlabs.com/projects/mouseland-cellpose)