Open-source project
computational-cell-analytics/micro-sam avatar
computational-cell-analytics/micro-sam

micro-sam, Segment Anything turned into a microscopy segmentation workbench

Segment Anything for Microscopy

741 stars115 forksJupyter NotebookMIT

At a glance

What is it?
computational-cell-analytics/micro-sam builds napari applications on top of Segment Anything for interactive 2D and 3D segmentation and 2D tracking, plus finetuning recipes for microscopy data. The published Nature Methods paper is the credibility argument, and the surrounding ecosystem of patho-sam, medico-sam and peft-sam is the sign of how live the project is.
Who is it for?
Adopt micro-sam if you segment cells, nuclei or mitochondria in microscopy images and want interactive prompt-driven segmentation with a path to finetuning on your own data. Skip it if you need fully unsupervised segmentation on a large archive with no human in the loop, because the interactive applications put a person in the segmentation loop by design.
Can I use it commercially?
Yes. MIT 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 1 day ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

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

Editorial analysis

What the project is and where it sits

micro-sam is a set of tools for segmentation and tracking in microscopy that build on top of Segment Anything. The stated pitch is that you can segment and track objects in microscopy images interactively with a few clicks.

The implementation is three napari applications, and the README shows a screenshot of each. Interactive 2D segmentation for cells, interactive 3D segmentation for mitochondria in electron microscopy data, and interactive tracking of 2D image data, where the third screenshot shows cell tracking rather than a static segmentation.

That last one is what distinguishes this from the other napari Segment Anything plugins. The README names three of them: napari-sam from MIC-DKFZ, which supports 2D and 3D, napari-segment-anything from the royerlab, which is 2D only, and napari-SAM4IS from hiroalchem. The comparison the project makes is that it supports more applications, 2D, 3D and tracking, and provides finetuning methods and finetuned models for microscopy data.

The citation section makes the academic case explicit. If you use the repository in research you should cite the project's paper, which the README notes is now published in Nature Methods, alongside the original Segment Anything publication. If you use the vit-tiny models you should also cite Mobile SAM, if you use automatic tracking you should also cite Trackastra, and if you use automatic prompt generation you should also cite the project's own APG paper.

That list is a good map of what the tool actually contains, because each citation corresponds to a distinct capability. Interactive segmentation comes from Segment Anything, the lightweight model variant comes from Mobile SAM, tracking comes from Trackastra, and prompt generation is the project's own contribution.

The licence is MIT, the project is on PyPI as micro_sam and on conda-forge, and there is a Zenodo DOI for citing a specific version. The releases are frequent, with v1.8.12, v1.8.13 and v1.8.14 in late August and September 2026, and the last push was on 2026-10-19.

Getting started and how the applications are meant to be used

The README keeps the installation and usage details in the documentation rather than in the README itself, and points at the documentation site, the quickstart video, a virtual workshop video from the I2K conference series, and a playlist of all video tutorials.

That choice of pointers is itself informative. The project is aimed at people who already work in napari and in the ImageJ ecosystem, and the videos serve as the teaching content. The support channels follow the same pattern: an issue tracker on GitHub, and the image.sc forum with the micro_sam tag, where the README asks people to tag two named maintainers.

The examples directory shows what the tools do in practice, and the file names are a good summary. There are annotator_2d.py, annotator_3d.py and annotator_tracking.py for the three interactive applications, automatic_segmentation.py and automatic_tracking.py for the automatic routes, image_series_annotator.py for working through a series of images, and object_classifier.py for classifying what has been segmented. There is a quick_start.py, a use_as_library/ directory for calling the functionality from your own code rather than through the interface, a bioimageio/ directory for export in the BioImageIO format, and a finetuning/ directory.

The distinction between the annotator and automatic scripts is the important one for an adopter. The annotator applications are interactive, so a person places prompts and the model proposes masks, and the person corrects them. The automatic scripts apply the model across a dataset without a person in the loop, which is what the automatic prompt generation work exists to support.

The object_classifier.py example is worth singling out because it is not a segmentation tool at all. Classifying what has been segmented, for example distinguishing cell types in an image where the boundaries are right but the labels are not, is a separate step in a microscopy pipeline, and having it in the same toolkit is convenient.

The repository layout backs up the same picture. There is a micro_sam/ directory for the package, a finetuning/ directory, a doc/ directory, a notebooks/ directory, an examples/ directory, a test/ directory, a development/ and a deployment/ directory, a workshops/ directory, and scripts/ for helper tooling. The environment.yaml at the top level and the pyproject.toml with a setuptools build backend describe a conventional Python package with a conda environment for development.

Testing, linting and the conventions the project holds itself to

The pyproject.toml is worth reading because it shows the project's engineering habits more clearly than most READMEs do.

The test configuration is specific. The pytest addopts are -v with --durations=10, so the ten slowest tests are reported on every run, which is the standard way to make sure a slow suite stays noticed. Coverage is collected for the micro_sam package and written both as an XML file and as a term-missing report, so a developer can see which lines are uncovered rather than just a percentage. Two custom markers are declared: slow, with a note that it can be deselected with a not slow expression, and gui, for GUI tests that can similarly be deselected. Marking the GUI tests separately matters here, because the whole workflow lives inside napari and those tests need a display.

The formatting and linting configuration is a two-tool setup. Black is configured with a line length of 79 and a target version of py311, and Ruff is configured with the same line length and a long selection of rule sets: the flake8 basics, pyupgrade, isort, blind-except, bugbear, builtins, comprehensions, implicit string concatenation, logging format, pie and simplify. The ignore list is as informative as the selection. E501 is ignored because the line length is left to black. UP006 and UP007 are ignored because the project uses magicgui, which needs runtime type annotations, so the older typing forms are kept deliberately. SIM117 is ignored with a comment that nested with statements do not look great with black, and that it can be re-enabled after dropping Python 3.9.

The comments read like a record of decisions rather than a list of suppressions, which is what makes them useful. A project that explains why each exception exists is one where the exceptions get revisited.

The other top-level files are conventional and tell you what to expect. There is a CODE_OF_CONDUCT.md and a CONTRIBUTING.md, a requirements-dev.txt, a setup.cfg, a MANIFEST.in, a build_doc.py script, and a RELEASE_OVERVIEW.md that the README points at for an overview of changes introduced in previous releases.

The contributing guidance is explicit about the process. Documentation edits can be made directly on GitHub, while more complex changes should follow CONTRIBUTING.md or the contribution guide in the documentation, and the first step for anything larger is to discuss the idea in a new issue with the current developers. That is a reasonable arrangement for a project with this much surface area.

The follow-up work and what it says about the project

The Related Projects section lists what the same group has built on top of micro-sam, and it is the clearest evidence of where the work is going.

patho-sam improves SAM for histopathology. medico-sam improves SAM for medical imaging. peft-sam studies parameter efficient fine-tuning for SAM. All three live in the same computational-cell-analytics organisation, and each takes a domain and adapts the model to it.

The choice of peft-sam is worth noting. Parameter efficient fine-tuning is the technique that made adapting large models to narrow domains affordable, and choosing it as a research direction tells you the group treats the finetuning problem as the hard part rather than the prompting problem.

The two integration projects named separately are WebKnossos and QuPath, which both offer integration of Segment Anything for interactive segmentation. Those are the tools a pathologist or a neuroscientist is most likely to already have open, and offering integration into existing software is a different strategy from asking people to switch to napari.

The alternative plugins section is unusually honest for a project README. Listing three competing napari plugins with their URLs, and naming what each does and does not support, is a comparison a reader can act on. The claim made is about breadth of applications and about finetuning support, and those are checkable claims.

The release overview file is the other piece of context. A separate document tracking what changed in previous releases, alongside frequent patch releases in the 1.8 series, suggests a project with an active maintenance burden and enough users to justify that discipline.

For an adopter, the practical reading of all this is that micro-sam is one node in a research programme rather than a finished commercial tool. The core interactive applications are usable and citable, the domain adaptations exist as separate packages, and the direction of travel is towards finetuned models for specific image types rather than towards a more polished general purpose interface.

How it fits against the alternatives

The comparison to make is with the other napari Segment Anything plugins and with the general shape of the problem.

Against napari-sam and napari-segment-anything, the difference is scope. napari-sam supports 2D and 3D interactive segmentation while napari-segment-anything is 2D only; micro-sam adds tracking, adds finetuning, and ships finetuned models trained for microscopy rather than for natural images. The reason that matters is that a model trained on photographs is not much use for a fluorescence image of a cell, so the finetuned models are the part that changes the accuracy of the output rather than the ergonomics of the interaction.

The second alternative is doing the segmentation with a purpose-built tool. QuPath and WebKnossos both offer integration of Segment Anything for interactive segmentation. Choosing between them and micro-sam is a question of whether you want to work inside an existing platform or in a dedicated napari-based workflow with the surrounding finetuning ecosystem.

The third is the non-interactive route: a trained model applied to a dataset without human review. This is where the automatic segmentation and automatic tracking scripts and the automatic prompt generation work fit, and it is the right choice when you have tens of thousands of images and the segmentation quality does not need checking one by one. It is also where the tool is least mature, since the README's framing throughout is interactive.

The fourth alternative is training your own model from scratch for your modality, which is what a group with a large labelled dataset and a distinctive imaging modality would do. micro-sam's finetuning directory is the shortcut version of that, and the presence of peft-sam as a research project suggests the fine-tuning story is still being worked out rather than settled.

The honest limitation is the same one the tool's design implies. Interactive segmentation puts a person in the loop for every image, which is a great workflow for a researcher looking at twenty images and a poor one for a core facility processing a million. The automatic routes exist, but the project's own emphasis, the napari applications and the tutorials, is on the interactive case.

One more consideration for a lab setting is model provenance and reproducibility. The package is MIT licensed, the weights are distributed with it and are cited, and there is a Zenodo DOI, so a published result using micro-sam can point at a specific version and a specific paper. That is the sort of thing that matters more in research than in industry, and it is handled well here.

Editorial conclusion

Adopt micro-sam if you segment cells, nuclei or mitochondria in microscopy images and want interactive prompt-driven segmentation with a path to finetuning on your own data. Skip it if you need fully unsupervised segmentation on a large archive with no human in the loop, because the interactive applications put a person in the segmentation loop by design. Verify first by installing the package from PyPI or conda-forge, opening one of the example notebooks, and checking that the napari plugins appear, since the whole workflow is built around the napari viewer.

Frequently asked questions

What does micro-sam provide?

Three napari applications for interactive 2D segmentation, interactive 3D segmentation and interactive 2D tracking, plus automatic segmentation and tracking scripts, an object classifier example, a use-as-library route, BioImageIO export and finetuning recipes for microscopy data.

How does micro-sam differ from other napari Segment Anything plugins?

The README names napari-sam from MIC-DKFZ, which supports 2D and 3D, napari-segment-anything from the royerlab, which is 2D only, and napari-SAM4IS from hiroalchem. The comparison the project makes is that micro-sam supports more applications, 2D, 3D and tracking, and provides finetuning methods and finetuned models for microscopy data.

Which papers should I cite if I use micro-sam?

The project's own paper, which the README notes is published in Nature Methods, together with the original Segment Anything publication. Additionally cite Mobile SAM if you use the vit-tiny models, Trackastra if you use automatic tracking, and the project's automatic prompt generation paper if you use that.

What follow-up projects exist for micro-sam?

The same group maintains patho-sam, which improves SAM for histopathology, medico-sam, which improves SAM for medical imaging, and peft-sam, which studies parameter efficient fine-tuning for SAM. The README also notes integration of Segment Anything in WebKnossos and QuPath.

How is the micro-sam project tested?

The pyproject.toml configures pytest with verbose output, the ten slowest durations reported, coverage collected for the micro_sam package as both XML and a term-missing report, and custom markers for slow and gui tests so either can be deselected. Formatting is handled by Black at a line length of 79 with Ruff running a broad set of rule families and explaining each ignored rule in a comment.

Official sources

  1. computational-cell-analytics/micro-sam on GitHub
  2. License: MIT
  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/computational-cell-analytics-micro-sam.svg)](https://hysenlabs.com/projects/computational-cell-analytics-micro-sam)

Was this useful?