Papers › SAM2-UNet: Segment Anything 2 Makes Strong Encoder for Natural and Medical Image Segmentation

SAM2-UNet: Segment Anything 2 Makes Strong Encoder for Natural and Medical Image Segmentation

16 Aug 2024arXiv:2408.08870archive 2025-07-28

Xinyu Xiong, Zihuang Wu, Shuangyi Tan, Wenxue Li, Feilong Tang, Ying Chen, Siying Li, Jie Ma, Guanbin Li

Image segmentation plays an important role in vision understanding. Recently, the emerging vision foundation models continuously achieved superior performance on various tasks. Following such success, in this paper, we prove that the Segment Anything Model 2 (SAM2) can be a strong encoder for U-shaped segmentation models. We propose a simple but effective framework, termed SAM2-UNet, for versatile image segmentation. Specifically, SAM2-UNet adopts the Hiera backbone of SAM2 as the encoder, while the decoder uses the classic U-shaped design. Additionally, adapters are inserted into the encoder to allow parameter-efficient fine-tuning. Preliminary experiments on various downstream tasks, such as camouflaged object detection, salient object detection, marine animal segmentation, mirror detection, and polyp segmentation, demonstrate that our SAM2-UNet can simply beat existing specialized state-of-the-art methods without bells and whistles. Project page: \url{https://github.com/WZH0120/SAM2-UNet}.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2408.08870")

Code

Syntology Ran 5 of 9 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · violated contract; 2 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: official repository: 9 samples from 1 repository, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wzh0120/sam2-unet officialmentioned in papermentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 5 ran; 1 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
1ran · violated contract
2ran · our draft was wrong
1ran · fixture could not drive it
4unverified

Licence: 0 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from wzh0120/sam2-unet. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

compute_axial_cis wzh0120/sam2-unet/sam2/modeling/position_encoding.py official repository ran · violated contract Apache-2.0 (permissive) · 7ceaad42da42edd5 · report
get_1d_sine_pe wzh0120/sam2-unet/sam2/modeling/sam2_utils.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · a6c3974188a5ffb0 · report
init_t_xy wzh0120/sam2-unet/sam2/modeling/position_encoding.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · bb060d29525f90eb · report
reshape_for_broadcast wzh0120/sam2-unet/sam2/modeling/position_encoding.py official repository ran · fixture could not drive it Apache-2.0 (permissive) · f8f09f78b474ee7c · report
select_closest_cond_frames wzh0120/sam2-unet/sam2/modeling/sam2_utils.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 4ee20f090e58c425 · report
build_sam2 wzh0120/sam2-unet/sam2/build_sam.py official repository unverified Apache-2.0 (permissive) · 31a4fffe09fed1c5 · report
build_sam2_video_predictor wzh0120/sam2-unet/sam2/build_sam.py official repository unverified Apache-2.0 (permissive) · 6cd9b91468681cef · report
do_pool wzh0120/sam2-unet/sam2/modeling/backbones/hieradet.py official repository unverified Apache-2.0 (permissive) · d3df9ada3e05fa55 · report
get_activation_fn wzh0120/sam2-unet/sam2/modeling/sam2_utils.py official repository unverified Apache-2.0 (permissive) · f2e72d81f39d65cd · report

Tasks

Image SegmentationMarine Animal SegmentationMedical Image SegmentationMirror DetectionSalient Object DetectionSegmentationSemantic Segmentationparameter-efficient fine-tuning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Image Segmentation MAS3K SAM2-UNet E-measure 0.943 #1 of 4 Archive leaderboard report
Image Segmentation MAS3K SAM2-UNet MAE 0.021 #1 of 4 Archive leaderboard report
Image Segmentation MAS3K SAM2-UNet S-measure 0.903 #1 of 4 Archive leaderboard report
Image Segmentation MAS3K SAM2-UNet mIoU 0.799 #1 of 4 Archive leaderboard report
Image Segmentation MSD (Mirror Segmentation Dataset) SAM2-UNet F-measure 0.957 #1 of 5 Archive leaderboard report
Image Segmentation MSD (Mirror Segmentation Dataset) SAM2-UNet IoU 0.918 #1 of 5 Archive leaderboard report
Image Segmentation MSD (Mirror Segmentation Dataset) SAM2-UNet MAE 0.022 #1 of 5 Archive leaderboard report
Image Segmentation PMD SAM2-UNet F-measure 0.826 #1 of 5 Archive leaderboard report
Image Segmentation PMD SAM2-UNet IoU 0.728 #1 of 5 Archive leaderboard report
Image Segmentation PMD SAM2-UNet MAE 0.027 #1 of 5 Archive leaderboard report
Image Segmentation RMAS SAM2-UNet E-measure 0.944 #2 of 4 Archive leaderboard report
Image Segmentation RMAS SAM2-UNet MAE 0.022 #2 of 4 Archive leaderboard report
Image Segmentation RMAS SAM2-UNet S-measure 0.874 #2 of 4 Archive leaderboard report
Image Segmentation RMAS SAM2-UNet mIoU 0.738 #2 of 4 Archive leaderboard report
Salient Object Detection DUT-OMRON SAM2-UNet E-measure 0.912 #1 of 8 Archive leaderboard report
Salient Object Detection DUT-OMRON SAM2-UNet MAE 0.039 #1 of 8 Archive leaderboard report
Salient Object Detection DUT-OMRON SAM2-UNet S-measure 0.884 #1 of 8 Archive leaderboard report
Salient Object Detection DUTS-TE SAM2-UNet E-measure 0.959 #1 of 8 Archive leaderboard report
Salient Object Detection DUTS-TE SAM2-UNet MAE 0.020 #1 of 8 Archive leaderboard report
Salient Object Detection DUTS-TE SAM2-UNet Smeasure 0.934 #1 of 8 Archive leaderboard report
Salient Object Detection ECSSD SAM2-UNet E-measure 0.970 #1 of 10 Archive leaderboard report
Salient Object Detection ECSSD SAM2-UNet MAE 0.020 #1 of 10 Archive leaderboard report
Salient Object Detection ECSSD SAM2-UNet S-measure 0.950 #1 of 10 Archive leaderboard report
Salient Object Detection HKU-IS SAM2-UNet E-measure 0.971 #1 of 9 Archive leaderboard report
Salient Object Detection HKU-IS SAM2-UNet MAE 0.019 #1 of 9 Archive leaderboard report
Salient Object Detection HKU-IS SAM2-UNet S-measure 0.941 #1 of 9 Archive leaderboard report
Salient Object Detection PASCAL-S SAM2-UNet E-measure 0.931 #2 of 10 Archive leaderboard report
Salient Object Detection PASCAL-S SAM2-UNet MAE 0.043 #2 of 10 Archive leaderboard report
Salient Object Detection PASCAL-S SAM2-UNet S-measure 0.894 #2 of 10 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections