Back

Lightweight open-source fine-tuning of SAM2 enables domain-specific microscopy segmentation

Bhat, E.; Selvan, S.; Okekenwa, S.; Dechkounian, Z.; Lin, V.; Nakano, M.; Saha, M.; Song, Y.

2025-11-10 cell biology
10.1101/2025.11.08.687405 bioRxiv
Show abstract

Quantitation of structures is a critical step in analyzing images. Automated segmentation of biological samples remains a central challenge in microscopy, where variations in signal/noise, intensity, texture, and edges hinder accurate delineation of cellular and tissue structures. Adaptations of foundation models such as Segment Anything Model (SAM) remain computationally intensive and require large training datasets. Here, we introduce a lightweight, open-source Google Colab pipeline that enables efficient fine-tuning of SAM2 on domain-specific datasets without additional architectural layers or specialized hardware. By coupling mask-decoder fine-tuning with biologically informed post-processing, our framework achieves robust segmentation across diverse imaging modalities. Applied to hippocampal segmentation in brain images and single-cell segmentation in cell images, fine-tuned SAM2 demonstrates substantial gains of accuracy relative to basic SAM2 and matches leading tools. This work establishes a scalable and accessible paradigm for domain-specific adaptations of SAM2 in microscopy, lowering computational and data barriers to advanced image segmentation. HighlightsO_LILightweight fine-tuning with no added architectural complexity. C_LIO_LIHigh segmentation accuracy (Dice/Jaccard scores) achieved with small datasets. C_LIO_LICross-domain generalization across tissue and cell imaging with biologically informed post-processing. C_LIO_LIComparable or superior performance to widely used tools (Cellpose, Imaris, ilastik) at substantially lower computational cost. C_LIO_LIOpen-source and executable in a single Colab notebook, ensuring reproducibility and accessibility for non-computational users. C_LIO_LITurnkey adaptability, allowing researchers to transform raw microscopy data into fine-tuned SAM2 models with minimal input. C_LI

Matching journals

The top 5 journals account for 50% of the predicted probability mass.

50% of probability mass above

"Similar papers" are the closest papers from that journal in the model's embedding space. They show what the match is built on, but the ranking comes mostly from a classifier over the whole training set, not from these examples alone.