Noe commited on
Commit ·
4ee4d4f
1
Parent(s): 8861251
Initial upload: 5-fold CV ensemble checkpoints (Kaggle test 0.84690)
Browse files- README.md +89 -0
- autumn-lake-60/checkpoint.pth +3 -0
- autumn-lake-60/config.yaml +33 -0
- breezy-yogurt-59/checkpoint.pth +3 -0
- breezy-yogurt-59/config.yaml +33 -0
- cv5_manifest.json +12 -0
- legendary-deluge-61/checkpoint.pth +3 -0
- legendary-deluge-61/config.yaml +33 -0
- serene-durian-62/checkpoint.pth +3 -0
- serene-durian-62/config.yaml +33 -0
- worthy-blaze-63/checkpoint.pth +3 -0
- worthy-blaze-63/config.yaml +33 -0
README.md
CHANGED
|
@@ -1,3 +1,92 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- image-segmentation
|
| 5 |
+
- historical-maps
|
| 6 |
+
- cadastral-maps
|
| 7 |
+
- block-vectorization
|
| 8 |
+
- cross-validation
|
| 9 |
+
- ensemble
|
| 10 |
+
library_name: pytorch
|
| 11 |
+
pipeline_tag: image-segmentation
|
| 12 |
---
|
| 13 |
+
|
| 14 |
+
# Historical Map City-Block Vectorisation — 5-fold CV ensemble
|
| 15 |
+
|
| 16 |
+
EfficientNet-B4 UNet + SCSE attention checkpoints from the 5-fold cross-validation ensemble used for the Research Topics in Cartography (RTCart) 2026 Task 2 competition. Together they constitute the model that scored **0.84690** on the Kaggle leaderboard (`score = 0.4 × c-IoU + 0.6 × c-PoLiS`).
|
| 17 |
+
|
| 18 |
+
The corresponding code lives in the **[NB11/block_vectorization](https://github.com/NB11/block_vectorization)** repository — clone that to actually run inference.
|
| 19 |
+
|
| 20 |
+
## What's here
|
| 21 |
+
|
| 22 |
+
| Folder | Fold | Val IoU (held-out tiles) |
|
| 23 |
+
| --- | --- | --- |
|
| 24 |
+
| `breezy-yogurt-59/` | 0 | 0.9845 |
|
| 25 |
+
| `autumn-lake-60/` | 1 | 0.9852 |
|
| 26 |
+
| `legendary-deluge-61/` | 2 | 0.9870 |
|
| 27 |
+
| `serene-durian-62/` | 3 | 0.9824 |
|
| 28 |
+
| `worthy-blaze-63/` | 4 | 0.9826 |
|
| 29 |
+
|
| 30 |
+
Each folder contains:
|
| 31 |
+
- `checkpoint.pth` — model state dict (~80 MB)
|
| 32 |
+
- `config.yaml` — exact training config
|
| 33 |
+
|
| 34 |
+
Plus `cv5_manifest.json` — fold index → folder mapping for the inference orchestrator.
|
| 35 |
+
|
| 36 |
+
## How to use
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
# 1. Clone the code repo
|
| 40 |
+
git clone https://github.com/NB11/block_vectorization.git
|
| 41 |
+
cd block_vectorization
|
| 42 |
+
python -m venv .venv && source .venv/bin/activate
|
| 43 |
+
pip install -r requirements.txt
|
| 44 |
+
|
| 45 |
+
# 2. Download these weights into the runs/ tree
|
| 46 |
+
mkdir -p runs
|
| 47 |
+
for fold in breezy-yogurt-59 autumn-lake-60 legendary-deluge-61 serene-durian-62 worthy-blaze-63; do
|
| 48 |
+
mkdir -p "runs/$fold"
|
| 49 |
+
curl -L "https://huggingface.co/Noe-B/historical-map-city-block-vectorization/resolve/main/$fold/checkpoint.pth" \
|
| 50 |
+
-o "runs/$fold/checkpoint.pth"
|
| 51 |
+
curl -L "https://huggingface.co/Noe-B/historical-map-city-block-vectorization/resolve/main/$fold/config.yaml" \
|
| 52 |
+
-o "runs/$fold/config.yaml"
|
| 53 |
+
done
|
| 54 |
+
curl -L "https://huggingface.co/Noe-B/historical-map-city-block-vectorization/resolve/main/cv5_manifest.json" \
|
| 55 |
+
-o "runs/cv5_manifest.json"
|
| 56 |
+
|
| 57 |
+
# 3. Generate the data manifest + run the ensemble (requires the raw maps in data/raw/)
|
| 58 |
+
python scripts/pipeline/1_preprocess.py
|
| 59 |
+
python scripts/pipeline/1b_make_cv_manifest.py --block-size 2 --n-folds 5
|
| 60 |
+
python scripts/pipeline/3b_infer_cv.py $(jq -r '.folds[]' runs/cv5_manifest.json)
|
| 61 |
+
python scripts/pipeline/5_postprocess.py runs/cv5-breezy-yogurt-59 config/postprocess_cv_optimal.yaml
|
| 62 |
+
python scripts/pipeline/6_submit.py runs/cv5-breezy-yogurt-59 config/postprocess_cv_optimal.yaml
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Model
|
| 66 |
+
|
| 67 |
+
- **Architecture:** `segmentation_models_pytorch` UNet decoder with SCSE attention, EfficientNet-B4 encoder (ImageNet-pretrained), 768 × 768 input, 2-channel output (interior + boundary ring).
|
| 68 |
+
- **Loss:** `BceLovász` on interior + `BCEDice` on boundary ring.
|
| 69 |
+
- **Training:** AdamW + cosine LR schedule, batch_size 2, early-stopping patience 30, max 120 epochs. All 5 folds warm-started from the Stage 2 anchor; each was fine-tuned at LR 4e-5 on its held-out fold split.
|
| 70 |
+
- **Data:** ~190 tiles per fold (the other ~48 held out for validation), spanning both labelled maps. 5-fold spatial-block stratified CV (block_size_tiles = 2) prevents train/val leakage.
|
| 71 |
+
|
| 72 |
+
## Results
|
| 73 |
+
|
| 74 |
+
| Stage | Approach | Kaggle test |
|
| 75 |
+
| --- | --- | --- |
|
| 76 |
+
| Single model (Stage 3) | `fresh-sunset-57` (boundary head, single-map PP sweep) | 0.840 |
|
| 77 |
+
| 5-fold CV ensemble | Same PP as Stage 3 | 0.83686 |
|
| 78 |
+
| **5-fold CV + CV-aware PP** | this release | **0.84690** |
|
| 79 |
+
|
| 80 |
+
The CV-aware postprocessing config that produced the final score is committed in the code repo at `config/postprocess_cv_optimal.yaml`.
|
| 81 |
+
|
| 82 |
+
## Citation
|
| 83 |
+
|
| 84 |
+
```bibtex
|
| 85 |
+
@misc{brugger2026blockvec,
|
| 86 |
+
title = {Block-Polygon Extraction from Historical Cadastral Maps},
|
| 87 |
+
author = {Brugger, Noé},
|
| 88 |
+
year = {2026},
|
| 89 |
+
note = {RTCart 2026, Task 2},
|
| 90 |
+
url = {https://github.com/NB11/block_vectorization}
|
| 91 |
+
}
|
| 92 |
+
```
|
autumn-lake-60/checkpoint.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f737a32b0d764e708cdab18ef5f03515ca089fbe9eb20256aba876f6036a0452
|
| 3 |
+
size 82028033
|
autumn-lake-60/config.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
experiment_name: cv_fold1
|
| 2 |
+
preprocessing:
|
| 3 |
+
approach: v2
|
| 4 |
+
manifest_path: data/preprocessed/v2_manifest_cv.json
|
| 5 |
+
model:
|
| 6 |
+
name: efficientnet_unet
|
| 7 |
+
encoder: efficientnet-b4
|
| 8 |
+
encoder_weights: imagenet
|
| 9 |
+
attention: scse
|
| 10 |
+
in_channels: 3
|
| 11 |
+
classes: 2
|
| 12 |
+
tile_size: 768
|
| 13 |
+
training:
|
| 14 |
+
epochs: 120
|
| 15 |
+
batch_size: 2
|
| 16 |
+
learning_rate: 4.0e-05
|
| 17 |
+
optimizer: adamw
|
| 18 |
+
scheduler: cosine
|
| 19 |
+
loss: boundary_head
|
| 20 |
+
augmentation: true
|
| 21 |
+
num_workers: 2
|
| 22 |
+
n_folds: 5
|
| 23 |
+
fold_index: 1
|
| 24 |
+
early_stopping_patience: 30
|
| 25 |
+
early_stopping_min_delta: 0.0001
|
| 26 |
+
init_from: runs/civilized-wars-52/checkpoint.pth
|
| 27 |
+
loss:
|
| 28 |
+
boundary_weight: 0.5
|
| 29 |
+
bce_weight: 0.5
|
| 30 |
+
lovasz_weight: 0.5
|
| 31 |
+
wandb:
|
| 32 |
+
project: block-vectorization
|
| 33 |
+
entity: research_carto
|
breezy-yogurt-59/checkpoint.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3afa3aae695f26aabaee6165695cbc132fb240822eb581cf35cbed3f28afa393
|
| 3 |
+
size 82028033
|
breezy-yogurt-59/config.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
experiment_name: cv_fold0
|
| 2 |
+
preprocessing:
|
| 3 |
+
approach: v2
|
| 4 |
+
manifest_path: data/preprocessed/v2_manifest_cv.json
|
| 5 |
+
model:
|
| 6 |
+
name: efficientnet_unet
|
| 7 |
+
encoder: efficientnet-b4
|
| 8 |
+
encoder_weights: imagenet
|
| 9 |
+
attention: scse
|
| 10 |
+
in_channels: 3
|
| 11 |
+
classes: 2
|
| 12 |
+
tile_size: 768
|
| 13 |
+
training:
|
| 14 |
+
epochs: 120
|
| 15 |
+
batch_size: 2
|
| 16 |
+
learning_rate: 4.0e-05
|
| 17 |
+
optimizer: adamw
|
| 18 |
+
scheduler: cosine
|
| 19 |
+
loss: boundary_head
|
| 20 |
+
augmentation: true
|
| 21 |
+
num_workers: 2
|
| 22 |
+
n_folds: 5
|
| 23 |
+
fold_index: 0
|
| 24 |
+
early_stopping_patience: 30
|
| 25 |
+
early_stopping_min_delta: 0.0001
|
| 26 |
+
init_from: runs/civilized-wars-52/checkpoint.pth
|
| 27 |
+
loss:
|
| 28 |
+
boundary_weight: 0.5
|
| 29 |
+
bce_weight: 0.5
|
| 30 |
+
lovasz_weight: 0.5
|
| 31 |
+
wandb:
|
| 32 |
+
project: block-vectorization
|
| 33 |
+
entity: research_carto
|
cv5_manifest.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"started_at": "2026-05-19T23:21:51.460456",
|
| 3 |
+
"n_folds": 5,
|
| 4 |
+
"folds": {
|
| 5 |
+
"0": "runs/breezy-yogurt-59",
|
| 6 |
+
"1": "runs/autumn-lake-60",
|
| 7 |
+
"2": "runs/legendary-deluge-61",
|
| 8 |
+
"3": "runs/serene-durian-62",
|
| 9 |
+
"4": "runs/worthy-blaze-63"
|
| 10 |
+
},
|
| 11 |
+
"last_updated": "2026-05-20T05:06:55.390755"
|
| 12 |
+
}
|
legendary-deluge-61/checkpoint.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b591d597e453d2ed3b05dc09c47bee464fab81905cbafcdaa9ecf3a7627a3ab9
|
| 3 |
+
size 82028033
|
legendary-deluge-61/config.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
experiment_name: cv_fold2
|
| 2 |
+
preprocessing:
|
| 3 |
+
approach: v2
|
| 4 |
+
manifest_path: data/preprocessed/v2_manifest_cv.json
|
| 5 |
+
model:
|
| 6 |
+
name: efficientnet_unet
|
| 7 |
+
encoder: efficientnet-b4
|
| 8 |
+
encoder_weights: imagenet
|
| 9 |
+
attention: scse
|
| 10 |
+
in_channels: 3
|
| 11 |
+
classes: 2
|
| 12 |
+
tile_size: 768
|
| 13 |
+
training:
|
| 14 |
+
epochs: 120
|
| 15 |
+
batch_size: 2
|
| 16 |
+
learning_rate: 4.0e-05
|
| 17 |
+
optimizer: adamw
|
| 18 |
+
scheduler: cosine
|
| 19 |
+
loss: boundary_head
|
| 20 |
+
augmentation: true
|
| 21 |
+
num_workers: 2
|
| 22 |
+
n_folds: 5
|
| 23 |
+
fold_index: 2
|
| 24 |
+
early_stopping_patience: 30
|
| 25 |
+
early_stopping_min_delta: 0.0001
|
| 26 |
+
init_from: runs/civilized-wars-52/checkpoint.pth
|
| 27 |
+
loss:
|
| 28 |
+
boundary_weight: 0.5
|
| 29 |
+
bce_weight: 0.5
|
| 30 |
+
lovasz_weight: 0.5
|
| 31 |
+
wandb:
|
| 32 |
+
project: block-vectorization
|
| 33 |
+
entity: research_carto
|
serene-durian-62/checkpoint.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1976d81524694b93724a298d80630e2adb027662b1a4ab68b4e19ee8b907334
|
| 3 |
+
size 82028033
|
serene-durian-62/config.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
experiment_name: cv_fold3
|
| 2 |
+
preprocessing:
|
| 3 |
+
approach: v2
|
| 4 |
+
manifest_path: data/preprocessed/v2_manifest_cv.json
|
| 5 |
+
model:
|
| 6 |
+
name: efficientnet_unet
|
| 7 |
+
encoder: efficientnet-b4
|
| 8 |
+
encoder_weights: imagenet
|
| 9 |
+
attention: scse
|
| 10 |
+
in_channels: 3
|
| 11 |
+
classes: 2
|
| 12 |
+
tile_size: 768
|
| 13 |
+
training:
|
| 14 |
+
epochs: 120
|
| 15 |
+
batch_size: 2
|
| 16 |
+
learning_rate: 4.0e-05
|
| 17 |
+
optimizer: adamw
|
| 18 |
+
scheduler: cosine
|
| 19 |
+
loss: boundary_head
|
| 20 |
+
augmentation: true
|
| 21 |
+
num_workers: 2
|
| 22 |
+
n_folds: 5
|
| 23 |
+
fold_index: 3
|
| 24 |
+
early_stopping_patience: 30
|
| 25 |
+
early_stopping_min_delta: 0.0001
|
| 26 |
+
init_from: runs/civilized-wars-52/checkpoint.pth
|
| 27 |
+
loss:
|
| 28 |
+
boundary_weight: 0.5
|
| 29 |
+
bce_weight: 0.5
|
| 30 |
+
lovasz_weight: 0.5
|
| 31 |
+
wandb:
|
| 32 |
+
project: block-vectorization
|
| 33 |
+
entity: research_carto
|
worthy-blaze-63/checkpoint.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b1db78df8daef4dbdc54e9aed65da7b168e5937addc580afc21552a54088b2a4
|
| 3 |
+
size 82028033
|
worthy-blaze-63/config.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
experiment_name: cv_fold4
|
| 2 |
+
preprocessing:
|
| 3 |
+
approach: v2
|
| 4 |
+
manifest_path: data/preprocessed/v2_manifest_cv.json
|
| 5 |
+
model:
|
| 6 |
+
name: efficientnet_unet
|
| 7 |
+
encoder: efficientnet-b4
|
| 8 |
+
encoder_weights: imagenet
|
| 9 |
+
attention: scse
|
| 10 |
+
in_channels: 3
|
| 11 |
+
classes: 2
|
| 12 |
+
tile_size: 768
|
| 13 |
+
training:
|
| 14 |
+
epochs: 120
|
| 15 |
+
batch_size: 2
|
| 16 |
+
learning_rate: 4.0e-05
|
| 17 |
+
optimizer: adamw
|
| 18 |
+
scheduler: cosine
|
| 19 |
+
loss: boundary_head
|
| 20 |
+
augmentation: true
|
| 21 |
+
num_workers: 2
|
| 22 |
+
n_folds: 5
|
| 23 |
+
fold_index: 4
|
| 24 |
+
early_stopping_patience: 30
|
| 25 |
+
early_stopping_min_delta: 0.0001
|
| 26 |
+
init_from: runs/civilized-wars-52/checkpoint.pth
|
| 27 |
+
loss:
|
| 28 |
+
boundary_weight: 0.5
|
| 29 |
+
bce_weight: 0.5
|
| 30 |
+
lovasz_weight: 0.5
|
| 31 |
+
wandb:
|
| 32 |
+
project: block-vectorization
|
| 33 |
+
entity: research_carto
|