Segment Anything in High Quality

Lei Ke, Mingqiao Ye, Martin Danelljan, Yifan Liu, Yu-Wing Tai +2 more
2/12/2026

No official code found. Best implementation: SysCV/sam-hq (4,214 stars, Apache-2.0, last commit 2025-09-12).

Abstract

The recent Segment Anything Model (SAM) represents a big leap in scaling up segmentation models, allowing for powerful zero-shot capabilities and flexible prompting. Despite being trained with 1.1 billion masks, SAM's mask prediction quality falls short in many cases, particularly when dealing with objects that have intricate structures. We propose HQ-SAM, equipping SAM with the ability to accurately segment any object, while maintaining SAM's original promptable design, efficiency, and zero-shot generalizability. Our careful design reuses and preserves the pre-trained model weights of SAM, while only introducing minimal additional parameters and computation. We design a learnable High-Quality Output Token, which is injected into SAM's mask decoder and is responsible for predicting the high-quality mask. Instead of only applying it on mask-decoder features, we first fuse them with early and final ViT features for improved mask details. To train our introduced learnable parameters, we compose a dataset of 44K fine-grained masks from several sources. HQ-SAM is only trained on the introduced detaset of 44k masks, which takes only 4 hours on 8 GPUs. We show the efficacy of HQ-SAM in a suite of 10 diverse segmentation datasets across different downstream tasks, where 8 out of them are evaluated in a zero-shot transfer protocol. Our code and pretrained models are at https://github.com/SysCV/SAM-HQ.

View on arXivView PDF

Code Implementations(1)

SysCV/sam-hqCommunity74%
Apache-2.0

Segment Anything in High Quality [NeurIPS 2023]

4,214266C++, CudaJun 1, 20231 years agoApache-2.0
high-qualitysamsegment-anythingsegment-anything-modelsegmentation+1 more

Similar Papers

Cite this paper

@article{ke2026segment,
  title  = {Segment Anything in High Quality},
  author = {Lei Ke and Mingqiao Ye and Martin Danelljan and Yifan Liu and Yu-Wing Tai and Chi-Keung Tang and F. Yu},
  year   = {2026},
  eprint = {2306.01567},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2306.01567},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.01567.svg)](https://codeofpaper.com/paper/2306.01567)

Discussion