A Generic Method for Segmented Map Realignment using Local Features and Graph Neural Network
View Demo
·
Report Bug
SuperMapRealigner is a method developed at EPFL, Swiss Federal Institute of Technology in Lausanne, based on the works of Maxime Jan [1] and Rémi Petitpierre [2-3], in collaboration with Paul Guhennec, under the direction of Frédéric Kaplan.
This research is an extension of the JADIS project [2], which stems from a scientific collaboration between the Bibliothèque nationale de France (BnF) and EPFL. The JADIS project resulted in the initial development of an algorithm to automatically realign map collections with street-level precision. SuperMapRealigner continues and improves the results of the project.
The method is composed of two steps. First, the road network is extracted from historical maps using semantic segmentation. This step relies on open-mmlab/mmsegmentation. Second, local features are detected in the road network and the maps are realigned on a contemporary reference map, using Superpoints and SuperGlue graph neural network [4]. The preparation and segmentation of the full-scale maps, as well as the generation of the reference anchor from OpenStreetMap data are performed using Jadis utilities.
The accuracy of the realignment was evaluated on a corpus of 49 historical maps of Paris, using 245 control points annotated manually. The present algorithm allowed to realign accurately 37/49 maps (75.5%), with a median residual error of 16.7 ± 8.1 pixels (20 meters). This performance was confirmed on a sample of 20 historical maps from various European cities (see [1] for details).
The segmentation model is trained on the Historical City Maps Semantic Segmentation Dataset – Paris [5]. The road network segmentation performance reaches an IoU of 82.4 %.
- Jan, Maxime F. ‘A Generic Method for Cartographic Realignment Using Local Feature Matching: Towards a Computational Urban History’. Master’s thesis, EPFL, 2022. github.com/JanMaxime/PDM.
- Petitpierre, Rémi. ‘Projet JADIS’. Github. Paris: Bibliothèque nationale de France, 2020. v1.0-beta (beta). DOI: 10.13140/10.5281/zenodo.6594483
- Petitpierre, Rémi. ‘Neural Networks for Semantic Segmentation of Historical City Maps: Cross-Cultural Performance and the Impact of Figurative Diversity’. Master’s thesis, EPFL, 2020. DOI: 10.13140/RG.2.2.10973.64484.
- Sarlin, Paul-Edouard, Daniel DeTone, Tomasz Malisiewicz, and Andrew Rabinovich. ‘SuperGlue: Learning Feature Matching With Graph Neural Networks’, 4938–47, 2020. arXiv: 1911.11763
- Petitpierre, Rémi. ‘Historical City Maps Semantic Segmentation Dataset’. Zenodo, September 2021. DOI: 10.5281/zenodo.5497934
Note that it is not necessary to install OpenMMLab libraries (steps 1 and 2) if you intend to run the demo on provided data.
-
Download and install open-mmlab/mmsegmentation and open-mmlab/mmcv, according to the instructions provided by OpenMMLab. We use mmsegmentation v1.0.0 (released Apr. 6th 2023).
-
Download and install open-mmlab/mmdetection. We use mmdetection v2.0.0 (released Apr. 6th 2023).
-
Finally, ensure that the following libraries are installed :
pip install tqdm glob opencv-python scikit-image pillow scipy matplotlib overpass
If you want to segment your own maps, after installing the relevant libraries (see previous sections), you can make use of the pretrained model. A script called inference.py will also help you segment full-scale maps, by tiling the map into smaller 640x640 patches, that can be ingested by the neural network, and reconstituted afterward.
- Download the pretrained model from the following link.
- Unzip the pretrained model. Place the
inference.pyscript, found underassets/segmentation, and thepretrained_parisdirectory, in themmsegmentation/demo/folder. Copy also theutilsdirectory in the same location. - Place your map images in
mmsegmentation/documents/images/. Create the directories if necessary. - You can then run the segmentation inference by executing
python inference.pyfrom a terminal, when located inmmsegmentation/demo/.
To use SuperMapRealigner, simply follow the SuperMapRealigner.ipynb Jupyter notebook. The execution of the script should take less than 5 minutes to realign the 49 maps from the demo, when using a recent mid-range GPU.
Distributed under the license Creative Commons Attribution 4.0 International (CC BY 4.0).
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Rémi Petitpierre. (2023). BnF-jadis/SuperMapRealigner: v0.1-initial. Zenodo. https://doi.org/10.5281/zenodo.638211649
@software{petitpierre_bnf-jadis_2020,
author = {R{\'{e}}mi Petitpierre},
title = {BnF-jadis/SuperMapRealigner: v0.1-initial},
month = May,
year = 2023,
publisher = {Zenodo},
version = {v0.1},
doi = {10.5281/zenodo.638211649},
url = {https://doi.org/10.5281/zenodo.638211649}
}