Papers › Segment Anything Model for Road Network Graph Extraction

Segment Anything Model for Road Network Graph Extraction

24 Mar 2024arXiv:2403.16051archive 2025-07-28

Congrui Hetang, Haoru Xue, Cindy Le, Tianwei Yue, Wenping Wang, Yihui He

We propose SAM-Road, an adaptation of the Segment Anything Model (SAM) for extracting large-scale, vectorized road network graphs from satellite imagery. To predict graph geometry, we formulate it as a dense semantic segmentation task, leveraging the inherent strengths of SAM. The image encoder of SAM is fine-tuned to produce probability masks for roads and intersections, from which the graph vertices are extracted via simple non-maximum suppression. To predict graph topology, we designed a lightweight transformer-based graph neural network, which leverages the SAM image embeddings to estimate the edge existence probabilities between vertices. Our approach directly predicts the graph vertices and edges for large regions without expensive and complex post-processing heuristics, and is capable of building complete road network graphs spanning multiple square kilometers in a matter of seconds. With its simple, straightforward, and minimalist design, SAM-Road achieves comparable accuracy with the state-of-the-art method RNGDet++, while being 40 times faster on the City-scale dataset. We thus demonstrate the power of a foundational vision model when applied to a graph learning task. The code is available at https://github.com/htcr/sam_road.

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="2403.16051")

Code

Syntology Ran 17 of 18 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 17 ran with no contract checked.

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

htcr/sam_road officialmentioned in papermentioned on GitHubpytorchMIT 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

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

17ran
1unverified

Licence: 0 of the 18 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 htcr/sam_road. “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.

create_output_dir_and_save_config htcr/sam_road/utils.py official repository ran MIT (permissive) · eace594ace06c68f · report
crop_img_patch htcr/sam_road/inferencer.py official repository ran MIT (permissive) · 9847c4aa680f7f58 · report
draw_line_segments_on_image htcr/sam_road/spacenet/generate_labels.py official repository ran MIT (permissive) · 62990ee83bc6c9e9 · report
draw_points_on_image htcr/sam_road/graph_extraction.py official repository ran MIT (permissive) · 2f135d04199d9188 · report
draw_points_on_image htcr/sam_road/spacenet/generate_labels.py official repository ran MIT (permissive) · 998429d0ff5eb4a1 · report
edge_list_to_adj_table htcr/sam_road/graph_utils.py official repository ran MIT (permissive) · 43d91f90853adbd0 · report
edge_list_to_adj_table htcr/sam_road/graph_utils.py official repository ran MIT (permissive) · 0bf072401f5943d4 · report
filter_nodes htcr/sam_road/graph_utils.py official repository ran MIT (permissive) · 68ccab6be670bfc4 · report
get_img_paths htcr/sam_road/inferencer.py official repository ran MIT (permissive) · 53810f783e40cd12 · report
get_patch_info_one_img htcr/sam_road/dataset.py official repository ran MIT (permissive) · e65200eaf5162974 · report
get_points_and_scores_from_mask htcr/sam_road/graph_extraction.py official repository ran fingerprinted MIT (permissive) · dff7a9d2d4290664 · report
graph_collate_fn htcr/sam_road/dataset.py official repository ran MIT (permissive) · 49fc6bdb42872104 · report
rasterize_graph htcr/sam_road/triage.py official repository ran MIT (permissive) · c4b20ca211d254a0 · report
read_rgb_img htcr/sam_road/dataset.py official repository ran MIT (permissive) · 787e3dce7cf3f6a1 · report
visualize_image_and_graph htcr/sam_road/triage.py official repository ran MIT (permissive) · acad5f61c59c85f5 · report
visualize_pred_gt_pair htcr/sam_road/triage.py official repository ran MIT (permissive) · b7d7f725d4dc325c · report
within_margin htcr/sam_road/spacenet_metrics/spacenet_convert.py official repository ran fingerprinted MIT (permissive) · 0b3109c04bded2ae · report
get_batch_img_patches htcr/sam_road/inferencer.py official repository unverified MIT (permissive) · 9666fa4a61dfac77 · report

Tasks

Graph LearningGraph Neural NetworkSemantic Segmentation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SAM

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