about
EdgeSAM: Prompt-in-the-Loop Distillation for On-Device Deployment of Sam (arxiv.org)
2 points by georgehill on Dec 12, 2023 | hide | past | pdf | 1 comment on HN

In plain words: Shrinks the Segment Anything image encoder into a small network, training it with the user's clicks and boxes included so it learns how prompts turn into masks. It runs 37 times faster than the original and works in real time on a phone.

Abstract · EdgeSAM: Prompt-In-the-Loop Distillation for SAM

This paper presents EdgeSAM, an accelerated variant of the Segment Anything Model (SAM), optimized for efficient execution on edge devices with minimal compromise in performance. Our approach involves distilling the original ViT-based SAM image encoder into a purely CNN-based architecture, better suited for edge devices. We carefully benchmark various distillation strategies and demonstrate that task-agnostic encoder distillation fails to capture the full knowledge embodied in SAM. To overcome this bottleneck, we include both the prompt encoder and mask decoder in the distillation process, with box and point prompts in the loop, so that the distilled model can accurately capture the intricate dynamics between user input and mask generation. To mitigate dataset bias issues stemming from point prompt distillation, we incorporate a lightweight module within the encoder. As a result, EdgeSAM achieves a 37-fold speed increase compared to the original SAM, and it also outperforms MobileSAM/EfficientSAM, being over 7 times as fast when deployed on edge devices while enhancing the mIoUs on COCO and LVIS by 2.3/1.5 and 3.1/1.6, respectively. It is also the first SAM variant that can run at over 30 FPS on an iPhone 14. Code and demo are available at https://www.mmlab-ntu.com/project/edgesam.

Chong Zhou, Xiangtai Li, Chen Change Loy, Bo Dai
arXiv:2312.06660 · cs.CV · submitted Dec 11, 2023 · updated Sep 7, 2025
abstract · pdf · html · IJCV 2025. Project page: https://www.mmlab-ntu.com/project/edgesam

add comment on HN

Not affiliated with the authors but find the topic interesting. They have a GitHub page with code and a short demo also:

https://github.com/chongzhou96/EdgeSAM

EDIT:

And a video on YouTube:

https://www.youtube.com/watch?v=YYsEQ2vleiE