Tools for segmentation, tracking and classification in microscopy built on Segment Anything 2 (SAM2). Segment, track and classify objects in microscopy images interactively with a few clicks, or automatically.
We implement a napari plugin for:
- interactive and automatic segmentation of 2d images and 3d volumes
- interactive and automatic tracking of cells in 2d timeseries
- classification of segmented objects, for example into cell types
- pixel classification, for example for tissue or region segmentation
- batch annotation of all images in a folder with any of these tools
This functionality is powered by the micro-sam2 models, which are trained on microscopy data, and the micro_sam python library which enables application to large datasets and finetuning on your data.
The functionality of the previous version, based on the original Segment Anything (SAM1), is still available in the micro_sam.v1 subpackage and in the micro_sam v1 command line tools.
![]() Interactive Cell Segmentation in 2D |
![]() Interactive Mitochondria Segmentation in volumeEM |
![]() Automatic Cell Segmentation in 3D |
Interactive Cell Tracking in 2D+T |
Pixel Classification in Histopathology |
![]() Object Classification with Corrections |
![]() Batch Nucleus Classification in Histopathology |
If you run into any problems or have questions about our tool, please open an issue on GitHub or contact us via image.sc using the tag micro-sam, and tagging @anwai98 and @constantinpape.
You can follow recent updates on micro_sam in our news feed.
Please check the documentation for details on how to install and use micro_sam. You can also watch the quickstart video, our virtual I2K workshop video or all video tutorials. The videos show the previous version, so the user interface differs from the current one.
micro_sam works best on a computer with a GPU. It can be used on a normal laptop with a CPU, but will be slow for applications in 3D or for large images.
Note: we are working on improving performance on Macbook with an M-series chip;
it will be much faster there soon!
We always welcome new contributions!
If you just want to suggest a documentation edit, you can do this directly here, on GitHub. For more complex changes, see CONTRIBUTING.md or the contributing guide in our documentation for details. The first step is to discuss your idea in a new issue with the current developers.
Everyone participating in this project is expected to follow our Code of Conduct.
If you use this repository in your research, please cite
- our μSAM2 preprint (if you use μSAM2)
- our μSAM publication (μSAM1)
- If you use automatic tracking, please also cite Trackastra.
Other publications relevant for specific aspects:
- The SAM and SAM2 publications that describe the models we buid on for μSAM1 / μSAM2.
- Our publication on the Automatic Prompt Generation (APG) segmentation mode.
- Our publication on interactive object and pixel classification: μClass
- Our previous special-purpose models for histopathology and medical imaging.
There is one other napari plugin built around Segment Anything 2:
- https://github.com/royerlab/napari-segment-anything-2 (2d and video support)
Compared to this plugin we support more applications (2d, 3d, tracking and classification), and provide finetuning methods and finetuned models for microscopy data. WebKnossos, QuPath and Fiji also integrate Segment Anything 2 for interactive segmentation, mainly in 2d.
You can find an overview of changes introduced in previous releases here.





