File size: 25,124 Bytes
bcb16da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
# STEM: Spatio-Temporal 3D Entity Matching Benchmark

## Construction Specification Document

**Version**: 1.0  
**Date**: 2026-07-08  
**Authors**: ZRH Edu  
**Target Venue**: VLDB Journal Special Issue on "Spatio-Temporal Data Management and Analytics: Machine Learning-based Solutions and Beyond"  
**HuggingFace Repository**: https://huggingface.co/datasets/eduzrh/STEM

---

## Table of Contents

1. [Project Overview](#1-project-overview)
2. [Research Motivation](#2-research-motivation)
3. [Dataset Sources](#3-dataset-sources)
4. [Benchmark Design](#4-benchmark-design)
5. [Code Architecture](#5-code-architecture)
6. [Environment Setup](#6-environment-setup)
7. [Download Plan](#7-download-plan)
8. [Preprocessing Pipeline](#8-preprocessing-pipeline)
9. [Experimental Protocol](#9-experimental-protocol)
10. [Delivery Checklist](#10-delivery-checklist)

---

## 1. Project Overview

### 1.1 Goal

Build the first **spatio-temporal 3D entity matching benchmark** that enables rigorous evaluation of matching algorithms for 3D building objects across both **different data sources** (cross-source entity resolution) and **different time points** (temporal entity resolution). The benchmark is designed to support both **unsupervised** and **few-shot** entity matching paradigms.

### 1.2 Core Contributions

| Contribution | Description |
|---|---|
| **STEM-3D Benchmark** | Multi-epoch, multi-source 3D building entity matching dataset with ground-truth labels |
| **Disaster Simulation Pipeline** | Controllable CRS misalignment + structural damage for realistic post-disaster cross-time matching |
| **Spatio-Temporal Evaluation Suite** | Standardized metrics for cross-time, cross-source 3D entity matching |
| **Open-Source Toolkit** | Full codebase for reproduction, extending 3dSAGER to spatio-temporal setting |

### 1.3 Why 3D Entity Matching Matters

Traditional entity matching (EM) operates on tabular records. However, real-world geospatial entities — buildings, bridges, infrastructure — are inherently 3D objects. Matching them across datasets is critical for:

- **Disaster response**: Match pre-disaster and post-disaster building inventories to assess damage
- **Urban digital twins**: Fuse multi-source 3D city models (Overture, 3DBAG, OpenStreetMap, commercial providers)
- **Cadastral reconciliation**: Match building registrations across jurisdictions and over time
- **Infrastructure monitoring**: Track structural changes across satellite/airborne LiDAR surveys

The **spatio-temporal** dimension adds unique challenges:
1. Buildings can be **modified** (extensions, demolitions, renovations) between time points
2. CRS (Coordinate Reference System) may differ between sources and epochs
3. Geometric properties change with time (height reduction from damage, volume changes from extensions)
4. No absolute coordinate alignment is available (post-disaster scenario)

---

## 2. Research Motivation

### 2.1 The Spatio-Temporal Entity Matching Problem

**Definition (Strong Spatio-Temporal EM)**: Given two collections of 3D building objects S_A_t and S_B_t' from potentially different sources A, B and different time points t, t', find all matching pairs (a in S_A_t, b in S_B_t') where a and b refer to the same real-world building.

**Key differences from standard EM**:
1. **Coordinate-unaware matching**: Cannot rely on absolute coordinates (different CRS, post-disaster shift)
2. **Temporal geometry drift**: Properties change between t and t' → geometric feature ratios deviate from 1.0
3. **Structural emergence/disappearance**: New buildings appear, old buildings are demolished
4. **Cross-source schema heterogeneity**: Different LOD levels, attribute schemas, modeling conventions

### 2.2 The (ε, δ)-Systematic Discrepancy Framework

Following the 3dSAGER paper, we formalize cross-source systematic discrepancy:

> For any geometric property p, there exists a source-specific scaling factor F_S^p such that for all matching buildings:  
> p_cand / p_index ≈ F_S^p

In the spatio-temporal setting, we extend this to:

> p_cand_t' / p_index_t ≈ F_S^p · F_T^p

where F_S^p is the source discrepancy and F_T^p is the temporal change factor.

### 2.3 Methodological Approach

We adopt and extend the **3dSAGER pipeline** for spatio-temporal entity matching:

Raw 3D City Models (CityJSON/CityGML) → Preprocessing → Object Properties (25 geometric features) → Pairwise Feature Vectors (F÷ division operator) → BKAFI Blocking → ML Classifier (XGBoost, RF, etc.) → Rigid Alignment (RANSAC + SVD) → Final Matching

**Key extensions for spatio-temporal**:
1. **Temporal property delta features**: Δp = |p_t' - p_t| as additional features
2. **Disaster-aware CRS simulation**: Random Z-rotation + damage (height reduction) for post-disaster scenarios
3. **Multi-epoch evaluation**: Match across (t=2009, t'=2012/2015/2018) pairs
4. **(ε, δ)-Temporal discrepancy tracking**: Measure F_T^p for each time gap
## 3. Dataset Sources

### 3.1 Primary Dataset: Lyon Multi-Epoch 3D City Model

**Source**: Métropole de Lyon Open Data + Zenodo  
**Format**: CityGML LOD2  
**Temporal coverage**: 2009, 2012, 2015, 2018 (4 epochs, 9-year span)  
**Coverage**: Lyon metropolitan area (59 communes)  
**Key features**:
- Same source/provider across all epochs (minimizes cross-source artifacts)
- Known to contain real building changes (demolitions, new constructions, renovations)
- Already used in 3D change detection research
- CityGML format with semantic building parts

| Epoch | Source | URL | Status |
|---|---|---|---|
| 2009 | Zenodo | https://zenodo.org/record/3611354 | Open access |
| 2012 | Zenodo | https://zenodo.org/record/3611354 | Open access |
| 2015 | Zenodo | https://zenodo.org/record/3611354 | Open access |
| 2018 | Grand Lyon Portal | https://data.grandlyon.com | Open access |

**Data characteristics**:
- CRS: EPSG:3946 (RGF93 / CC46)
- LOD: LOD2 (buildings with roof geometry, no detailed facade elements)
- Format: CityGML 2.0
- Estimated building count: ~150,000–200,000 per epoch

### 3.2 Secondary Dataset: 3dSAGER Hague Benchmark

**Source**: 3dSAGER project  
**Format**: CityJSON  
**Provider**: 3D BAG (Netherlands)  
**Coverage**: The Hague, Netherlands  
**Temporal**: Single epoch (2021/2022) with two co-registered sources (Source A, Source B)  
**URL**: https://tinyurl.com/3dSAGERdataset  
**Key features**:
- Provides **ground-truth match labels** across Source A/B
- Two sources with different LOD representations of the same area
- Used as baseline for cross-source evaluation (matching mode)

**Benchmark statistics** (medium version):
- ~3,000–5,000 buildings
- 25 geometric properties per building
- Train/val/test split by spatial grid cells

### 3.3 Temporal POI Data (Auxiliary)

**Source**: OpenStreetMap History API  
**Purpose**: Ground-truth verification for POI-level temporal entity matching  
**Entities**: Restaurants, shops, offices with temporal change logs  
**Temporal resolution**: Daily snapshots  
**Usage**: Validate temporal matching methodology at smaller scale

### 3.4 Dataset Summary Table

| Dataset | Type | Buildings | Epochs | LOD | Format | Labels |
|---|---|---|---|---|---|---|
| Lyon 2009–2018 | Primary | ~150K/epoch | 4 | LOD2 | CityGML | Build from persistence |
| Hague A/B | Baseline | ~4K | 1 (2 sources) | LOD1/LOD2 | CityJSON | Provided |
| OSM POI History | Auxiliary | ~5K POIs | Daily | N/A | GeoJSON | OSM IDs |

---

## 4. Benchmark Design

### 4.1 Task Taxonomy

The STEM benchmark defines **three sub-tasks**:

#### Task 1: Cross-Source 3D Entity Matching (Standard)
- **Input**: Source A buildings + Source B buildings (same epoch, different providers)
- **Goal**: Match corresponding buildings
- **Baseline dataset**: Hague A/B
- **Difficulty**: Cross-source schema heterogeneity (LOD differences)

#### Task 2: Cross-Time 3D Entity Matching (Temporal)
- **Input**: Buildings from epoch t + buildings from epoch t' (t ≠ t', same provider)
- **Goal**: Match persistent buildings across time
- **Primary dataset**: Lyon 2009–2018 (6 time pairs: 2009→2012, 2009→2015, 2009→2018, 2012→2015, 2012→2018, 2015→2018)
- **Difficulty**: Temporal geometry drift, building modifications, demolitions/new constructions

#### Task 3: Cross-Source + Cross-Time 3D Entity Matching (Full ST-EM)
- **Input**: Source A at epoch t + Source B at epoch t'
- **Goal**: Match buildings across both source and time
- **Constructed via**: Apply disaster simulation (CRS + damage) to cross-time pairs
- **Difficulty**: Maximum — both source and temporal discrepancies compound

### 4.2 Ground-Truth Label Construction

For the Lyon multi-epoch dataset, we construct ground-truth labels as follows:

1. **Spatial persistence filter**: Buildings with centroid distance < 2m across epochs are candidates
2. **Geometric consistency check**: Area ratio and volume ratio within [0.7, 1.3] → likely same building
3. **Building ID tracking**: Use CityGML `gml:id` attributes where available (Lyon may have persistent IDs)
4. **Manual sampling verification**: Random sample of 200 pairs per epoch gap for manual validation
5. **Confidence tiers**:
   - **High confidence**: Persistent CityGML ID + geometric consistency
   - **Medium confidence**: Spatial + geometric consistency only
   - **Low confidence**: Spatial proximity only (for hard negative mining)

### 4.3 Evaluation Metrics

| Metric | Description |
|---|---|
| **Precision** | TP / (TP + FP) |
| **Recall** | TP / (TP + FN) |
| **F1-Score** | Harmonic mean of Precision and Recall |
| **Recall@k** | Recall within top-k candidates per query building |
| **MRR** | Mean Reciprocal Rank |
| **Distance Recall** | Recall at spatial distance thresholds (10m, 25m, 50m) |
| **Temporal F1 Drop** | F1 degradation as time gap increases |
| **Cross-Source F1 Drop** | F1 degradation from single-source to cross-source matching |
| **Cross-Time F1 Drop** | F1 degradation from single-epoch to cross-epoch matching |

### 4.4 Training Regime Taxonomy

| Regime | Training Data | Test Data | Setting |
|---|---|---|---|
| **Supervised** | Labeled pairs from t→t' | Held-out pairs from same t→t' | Full labels available |
| **Few-shot** | K labeled pairs (K=5,10,20,50) | All remaining pairs | Scarce supervision |
| **Unsupervised (Zero-shot)** | No labels from target pair | All pairs from t→t' | Cross-epoch generalization |
| **Cross-epoch transfer** | Train on t1→t2, test on t3→t4 | Transfer to unseen epochs | Temporal generalization |
| **Cross-city transfer** | Train on Hague, test on Lyon | Transfer to unseen city | Geographic generalization |

### 4.5 Benchmark Splits

```
STEM/
├── lyon/
│   ├── 2009/, 2012/, 2015/, 2018/    # CityJSON-converted buildings
│   ├── labels/                        # Ground-truth match pairs per epoch pair
│   └── splits/                        # train/val/test CSV files
├── hague/
│   ├── source_a/, source_b/
│   ├── labels.csv
│   └── splits/
├── disaster/
│   ├── simulated/                     # Disaster simulation outputs
│   └── configs/                       # Simulation parameters
└── metadata/
    ├── dataset_card.md
    ├── statistics.json
    └── changelog.md
```
## 5. Code Architecture

### 5.1 Repository Structure

```
STEM/
├── README.md
├── requirements.txt
├── setup.py
├── config/
│   ├── default.yaml                  # Default configuration
│   ├── lyon.yaml                     # Lyon-specific config
│   ├── hague.yaml                    # Hague-specific config
│   └── disaster.yaml                 # Disaster simulation config
├── src/
│   ├── __init__.py
│   ├── data/
│   │   ├── __init__.py
│   │   ├── download.py               # Dataset downloader
│   │   ├── preprocess.py             # CityJSON/GML conversion
│   │   ├── labels.py                 # Ground-truth label construction
│   │   └── splits.py                 # Train/val/test splitting
│   ├── features/
│   │   ├── __init__.py
│   │   ├── properties.py             # 3dSAGER geometric properties (extended)
│   │   ├── temporal.py               # Temporal delta features
│   │   └── pairwise.py               # Pairwise feature vectors
│   ├── matching/
│   │   ├── __init__.py
│   │   ├── blocking.py               # BKAFI + extended blocking methods
│   │   ├── classifier.py             # ML classifier training
│   │   ├── alignment.py              # RANSAC rigid alignment
│   │   └── disaster.py               # Disaster simulation
│   ├── evaluation/
│   │   ├── __init__.py
│   │   ├── metrics.py                # Evaluation metrics
│   │   ├── analysis.py               # Result analysis utilities
│   │   └── visualization.py          # Plots and reports
│   └── utils/
│       ├── __init__.py
│       ├── io.py                     # File I/O utilities
│       ├── geometry.py               # Geometric computation helpers
│       └── logging.py                # Experiment logging
├── experiments/
│   ├── baseline_hague.py             # Reproduce 3dSAGER baseline
│   ├── cross_time_lyon.py            # Cross-time matching experiments
│   ├── few_shot_benchmark.py         # Few-shot evaluation
│   ├── zero_shot_benchmark.py        # Unsupervised/zero-shot evaluation
│   └── disaster_scenario.py          # Post-disaster matching
├── notebooks/
│   ├── 01_data_exploration.ipynb
│   ├── 02_feature_analysis.ipynb
│   └── 03_results_visualization.ipynb
├── tests/
│   ├── test_properties.py
│   ├── test_blocking.py
│   └── test_labels.py
└── docs/
    ├── api.md
    ├── benchmark_guide.md
    └── paper_figures/
```

### 5.2 Key Design Decisions

1. **CityJSON as canonical format**: All datasets converted to CityJSON v1.1 for uniformity
2. **Modular experiment scripts**: Each experiment type is a standalone script with YAML config
3. **Reproducibility**: All random seeds logged; configs versioned with experiment outputs
4. **HuggingFace Hub integration**: `push_to_hub()` calls in all data generation scripts
5. **Streaming support**: Large CityJSON files use streaming parsing (ijson)

### 5.3 Extension Points

| Extension | Location | Purpose |
|---|---|---|
| New dataset | `src/data/preprocess.py` | Add CityJSON conversion for new cities |
| New feature | `src/features/properties.py` | Add geometric/temporal property |
| New blocking method | `src/matching/blocking.py` | Add candidate generation method |
| New classifier | `src/matching/classifier.py` | Add ML/DL model |
| New evaluation metric | `src/evaluation/metrics.py` | Add custom metric |

---

## 6. Environment Setup

### 6.1 Python Environment

```bash
# Core environment
Python 3.9+ (tested with 3.9–3.12)
pip install -r requirements.txt

# Key dependencies (all installed via pip):
numpy==1.26.4
pandas==2.3.2
scikit-learn==1.6.1
xgboost==2.1.4
shapely==2.0.5
pyproj==3.6.1
geopandas==0.14.4
faiss-cpu==1.9.0
scipy==1.13.1
joblib==1.5.2
matplotlib==3.9.2
tqdm==4.67.1

# Optional — PyTorch + CLIP (for ViT-based blocking):
torch>=2.0.0
torchvision>=0.15.0
clip (from OpenAI GitHub)

# HuggingFace:
huggingface_hub>=0.20.0
datasets>=2.14.0
```

### 6.2 Disk Space Requirements

| Item | Estimated Size |
|---|---|
| Lyon 2009 CityGML | ~2–5 GB (compressed) |
| Lyon 2012 CityGML | ~2–5 GB (compressed) |
| Lyon 2015 CityGML | ~2–5 GB (compressed) |
| Lyon 2018 CityGML | ~2–5 GB (compressed) |
| Hague benchmark (A + B) | ~500 MB |
| Processed CityJSON files | ~2–3 GB per epoch |
| Feature caches (joblib) | ~200 MB per epoch |
| Model files | ~50 MB |
| **Total estimated** | **~25–40 GB** |

## 7. Download Plan

### 7.1 Step-by-Step Download Procedure

#### Phase 1: Hague Baseline Dataset (Priority: HIGH)

The 3dSAGER dataset contains The Hague buildings in CityJSON format, split into Source A and Source B directories. This is the baseline benchmark used in the 3dSAGER paper.

URL: https://tinyurl.com/3dSAGERdataset  
Expected output: data/hague/source_a/*.json, data/hague/source_b/*.json

#### Phase 2: Lyon Multi-Epoch Dataset (Priority: HIGH)

**Lyon 2009, 2012, 2015 from Zenodo**: https://zenodo.org/record/3611354  
Contains CityGML files for Lyon arrondissements across three historic versions.

**Lyon 2018 from Grand Lyon Portal**:  
https://data.grandlyon.com/jeux-de-donnees/maquettes-3d-texturees-2018-communes-metropole-lyon/donnees

#### Phase 3: Optional Additional Data

- 3DBAG historical versions (API: https://api.3dbag.nl/)
- OSM POI History (Overpass API with date filters)

### 7.2 Download Verification

- SHA256 hashes recorded for all downloaded files
- Building counts cross-referenced with published statistics
- Spatial extent and CRS validation
## 8. Preprocessing Pipeline

### 8.1 CityGML → CityJSON Conversion

```
CityGML (.gml/.xml)
    ↓  citygml-tools or custom parser
CityJSON (.json)
    ↓  CRS unification → EPSG:7415 (or local UTM)
    ↓  Centroid computation
    ↓  Building-only filtering
    ↓  Attribute standardization
    ↓  Save as joblib/.pkl cache
```

**Tools**:
- `citygml-tools` (Java CLI): `citygml-tools to-cityjson input.gml`
- `cityjson` Python package: for validation and manipulation
- Alternative: `cjio` Python package

### 8.2 Ground-Truth Label Construction

```
For each epoch pair (ti, tj):
├── Load buildings from ti and tj
├── Compute pairwise centroid distances
├── Filter: distance < 2m → candidate matches
├── Compute geometric consistency (area, volume ratios)
├── Filter: ratio ∈ [0.7, 1.3] → probable matches
├── Check CityGML ID persistence (if available)
├── Assign confidence tier (high/medium/low)
├── Manual sampling for verification (200 pairs)
└── Output: pairs CSV with [id_ti, id_tj, confidence, area_ratio, volume_ratio, distance]
```

### 8.3 Feature Extraction

For each building, extract 25 geometric properties (from 3dSAGER):
- **Size**: area, perimeter, volume, convex_hull_area, convex_hull_volume
- **Shape**: compactness_2d, compactness_3d, cubeness, hemisphericality, fractality
- **Dimensions**: bounding_box_width/length, aligned_bounding_box_width/length/height
- **Distribution**: density, elongation, shape_ind, axes_symmetry, num_vertices, circumference
- **Context**: ave_centroid_distance, height_diff, num_floors, perimeter_ind

**Temporal extension** (new for STEM):
- `delta_area`: |area_ti - area_tj| / area_ti
- `delta_volume`: |volume_ti - volume_tj| / volume_ti
- `delta_height`: |height_ti - height_tj| / height_ti
- `delta_compactness_3d`: same for compactness
- `time_gap_months`: temporal distance between epochs

### 8.4 Disaster Simulation (for Task 3)

```python
DisasterSimulator:
    CRS Simulation:
        - Random Z-axis rotation: θ ~ Uniform(0, 360°)
        - Random translation: t ~ Uniform(-100km, +100km) in X, Y
        - Applied to all candidate buildings
    
    Damage Simulation:
        - Per-building probability: P = 0.8
        - Height reduction factor: f ~ Uniform(0.3, 0.95)
        - Modified height = original_height × f
        - Propagate to volume, convex_hull_volume, compactness_3d
```

---

## 9. Experimental Protocol

### 9.1 Baseline Experiment (Task 1: Cross-Source)

| Parameter | Value |
|---|---|
| Dataset | Hague (Source A vs Source B) |
| Features | 25 geometric properties |
| Feature operator | Division (F÷) |
| Blocking method | BKAFI |
| Classifier | XGBoost |
| Train:Val:Test | 60:20:20 |
| Evaluation | Precision, Recall, F1, Recall@k |
| Seeds | 5 |

### 9.2 Cross-Time Experiment (Task 2)

| Parameter | Value |
|---|---|
| Dataset | Lyon (6 epoch pairs) |
| Train:Val:Test | 60:20:20 (per epoch pair) |
| Features | 25 geometric + 5 temporal delta |
| Classifier | XGBoost, GradientBoosting, RF, MLP |
| Evaluation mode | matching + blocking |
| Key analysis | F1 vs. time gap, property drift vs. time gap |

### 9.3 Few-Shot Experiment

| Shots | Setting |
|---|---|
| K = 5 | 5 labeled pairs per epoch pair |
| K = 10 | 10 labeled pairs |
| K = 20 | 20 labeled pairs |
| K = 50 | 50 labeled pairs |
| K = 100 | 100 labeled pairs |

### 9.4 Full ST-EM Experiment (Task 3)

| Parameter | Value |
|---|---|
| Base data | Lyon cross-time pairs |
| Simulation | CRS rotation + damage |
| Alignment | RANSAC rigid alignment |
| Re-scoring | α × geometric + (1-α) × spatial |
| Evaluation | Distance-based recall (10m, 25m, 50m) |

### 9.5 Unsupervised/Zero-Shot Experiment

| Setting | Description |
|---|---|
| Cross-epoch transfer | Train on 2009→2012, test on 2015→2018 |
| Cross-city transfer | Train on Hague, test on Lyon (adapt features) |
| Property-ratio heuristic | F÷ operator + clustering, no labels |
## 10. Delivery Checklist

### 10.1 Phase 1: Infrastructure (Current)

- [x] 3dSAGER codebase cloned and analyzed
- [x] Python environment with all dependencies installed
- [x] HuggingFace repo initialized and configured
- [x] Specification document written (this file)

### 10.2 Phase 2: Data Acquisition

- [x] Download 3dSAGER Hague dataset (Source A: 309MB, 36 CityJSON files; Source B: partial, 3 files)
- [ ] Complete Source B download (remaining CityJSON files)
- [ ] Download Lyon 2009-2015 from Zenodo (395 MB zip)
- [ ] Download Lyon 2018 from Grand Lyon portal
- [ ] Verify all downloads (counts, CRS, integrity)

### 10.3 Phase 3: Preprocessing

- [ ] Convert Lyon CityGML → CityJSON
- [ ] Unify CRS across all epochs
- [ ] Extract building geometries and compute centroids
- [ ] Generate geometric properties per building
- [ ] Cache processed data as joblib files

### 10.4 Phase 4: Benchmark Construction

- [ ] Construct ground-truth labels for all 6 Lyon epoch pairs
- [ ] Manual verification of random samples
- [ ] Generate train/val/test splits
- [ ] Compute dataset statistics
- [ ] Write dataset card (README.md for HuggingFace)

### 10.5 Phase 5: Baseline Experiments

- [ ] Run 3dSAGER baseline on Hague dataset (reproduce paper results)
- [ ] Run cross-time matching on Lyon (supervised)
- [ ] Run few-shot experiments (K = 5, 10, 20, 50)
- [ ] Run disaster scenario (CRS + damage + alignment)
- [ ] Run unsupervised transfer experiments

### 10.6 Phase 6: Upload & Documentation

- [ ] Upload all data to HuggingFace (eduzrh/STEM)
- [ ] Upload all code to HuggingFace
- [ ] Upload experiment results and logs
- [ ] Write paper-ready result tables and figures
- [ ] Push specification document

### 10.7 Phase 7: Paper Writing

- [ ] Draft VLDBJ paper outline
- [ ] Write methodology section
- [ ] Generate all figures and tables
- [ ] Write experiments and results
- [ ] Polish and submit

---

## Appendix A: Risk Analysis

| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Lyon data not downloadable | Low | High | Fall back to synthetic multi-epoch from 3DBAG versions |
| CityGML IDs not persistent | Medium | Medium | Use geometric + spatial heuristics for labeling |
| CityGML→CityJSON conversion fails | Low | Medium | Use `citygml-tools` Java tool as backup |
| HuggingFace storage limits | Low | Low | Use Git LFS for large files; tier upgrade if needed |
| Lyon building count too large | Medium | Medium | Use spatial subset (1–2 arrondissements) |
| Disk space insufficient for Lyon | Medium | High | Use GPU machine with SSD; process per-arrondissement |

## Appendix B: Timeline

| Week | Milestone |
|---|---|
| Week 1 | Environment setup, data download, preprocessing |
| Week 2 | Benchmark construction, baseline experiments |
| Week 3 | Full experiments, result analysis |
| Week 4 | Paper writing, final uploads |

## Appendix C: Lyon Zenodo Data Details

- **Zenodo Record**: https://zenodo.org/record/3611354
- **File**: `Lyon_2009-2012-2015_Splitted_Stripped.zip` (394.9 MB compressed, ~50.9 GB uncompressed)
- **MD5**: `74b4610a11d9ca37951f5de2b747794f`
- **Content**: CityGML LOD2 buildings for Lyon, split by arrondissement, across 3 epochs (2009, 2012, 2015)
- **Preprocessing**: Original data had structural issues resolved; texture coordinates removed
- **2018 data**: Separate download from Grand Lyon Open Data Portal

## Appendix D: Hague Dataset Details

- **Google Drive Folder**: https://drive.google.com/drive/folders/11dC2jn9fajcn2W0LWKBCgyuBxabkz4WU
- **Structure**:
  - `RawCitiesData/The Hague/Source A/` — CityJSON files covering all wijks (36 files, ~309 MB)
  - `RawCitiesData/The Hague/Source B/` — CityJSON files (3+ files, ~21 MB so far)
  - `dataset_partitions/` — Pre-computed train/val/test splits (3 seed files)
- **CRS**: EPSG:7415 (Amersfoort / RD New + NAP height)
- **Format**: CityJSON v1.0/v1.1
- **LOD**: Mixed LOD1/LOD2