MapSAM2: Adapting SAM2 for Automatic Segmentation of Historical Map Images and Time Series

Xue Xia, Randall Balestriero, Tao Zhang, Yixin Zhou, Andrew Ding, Dev Saini, Lorenz HurniarXiv 2025 · DOI

Abstract

Historical map analysis is a critical component of digital humanities, yet it remains labor-intensive due to stylistic variability and a lack of annotated data. This paper presents MapSAM2, a framework that adapts the Segment Anything Model 2 (SAM2) for the automated segmentation and temporal linking of cartographic features. By treating both static map tiles and multi-year sequences as video data, MapSAM2 leverages SAM2’s memory mechanism to improve contextual understanding. Combined with Low-Rank Adaptation (LoRA) and a pseudo-video generation strategy, the model achieves state-of-the-art accuracy in few-shot scenarios, significantly reducing the manual effort required for historical urban studies.

Introduction

Historical maps provide a window into urban evolution, but extracting structured data from them is notoriously difficult. Researchers face two primary challenges: extreme stylistic variability across different eras and cartographers, and a "data desert" where annotated training sets are scarce. Furthermore, tracking specific features (e.g., a single building) across decades currently relies on brittle, multi-step pipelines that often fail when maps are distorted or features merge. MapSAM2 addresses these issues by repurposing foundation models designed for video segmentation to handle the unique temporal and spatial properties of historical maps.

Methodology

The core innovation of MapSAM2 lies in its adaptation of the SAM2 architecture, originally designed for video object segmentation, to the cartographic domain. The framework employs several key strategies to bridge the gap between natural video and historical documents.

Overview of the MapSAM2 framework showing (a) time-series tracking and (b) static map set segmentation using the "image-as-video" approach.

The "Image-as-Video" Approach

For static map segmentation, MapSAM2 treats a collection of map tiles as a video sequence. This allows the model’s memory attention mechanism to utilize features from previously processed tiles, providing critical context for complex areal features like vineyards or urban blocks. This mechanism effectively acts as a low-pass filter, emphasizing global context over high-frequency noise.

Adaptation and Prompting

To specialize the model for cartographic textures without losing general knowledge, the authors employ Low-Rank Adaptation (LoRA), updating only a small subset of parameters in the image encoder. To automate the process for large-scale datasets, a YOLOv11 detector is integrated to generate bounding box prompts, which are then processed by the SAM2 prompt encoder.

Pseudo-Video Generation

To overcome the lack of labeled time-series data, the framework uses "temporal transformations" on single-year maps. By simulating shifts, merges, and disappearances, the model learns to maintain object identity across frames without requiring vast amounts of real historical video data for training.

Experimental Results

The model was evaluated on several benchmarks, including the Siegfried Railway and Vineyard datasets and a newly curated Siegfried Building Time Series Dataset consisting of over 2,000 videos across four timestamps (1896, 1904, 1932, and 1945).

  • Areal Segmentation: On the Vineyard dataset (10-shot), MapSAM2 achieved an Intersection over Union (IoU) of 67.6, outperforming the previous state-of-the-art MapSAM (60.0).
  • Temporal Linking: In 10-shot time-series settings, MapSAM2 reached a 70.6 F1 score, more than doubling the performance of Mask2Former-VIS (34.8 F1). This demonstrates the robustness of the memory-based tracking mechanism even with minimal training data.
  • Few-Shot Robustness: MapSAM2 consistently outperformed specialized U-Net models in low-data regimes, suggesting that the "general intelligence" of foundation models provides a more stable baseline when data is scarce.

Conclusion and Future Work

MapSAM2 demonstrates that foundation models for video can be successfully adapted to complex cartographic tasks. While the model excels at areal features and temporal tracking, it still faces challenges with very thin linear features like railways. Future research will focus on improving the handling of "new" objects that appear in intermediate frames and refining the segmentation of high-contrast, thin structures.

Reference: Xia, X., et al. (2025). MapSAM2: Adapting SAM2 for Automatic Segmentation of Historical Map Images and Time Series. arXiv:2510.27547v1.

Summary updated

BibTeX
@misc{xia2025mapsam,
  author = {Xue Xia and Randall Balestriero and Tao Zhang and Yixin Zhou and Andrew Ding and Dev Saini and Lorenz Hurni},
  title = {{MapSAM2: Adapting SAM2 for Automatic Segmentation of Historical Map Images and Time Series}},
  year = {2025},
  eprint = {2510.27547},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.27547},
}
Figure