Files changed (1) hide show
  1. README.md +159 -67
README.md CHANGED
@@ -1,65 +1,113 @@
1
  ---
2
- license: etalab-2.0
3
  pipeline_tag: image-segmentation
4
  tags:
5
- - semantic segmentation
6
  - pytorch
7
- - landcover
 
 
 
 
 
 
 
8
  library_name: pytorch
9
  datasets:
10
- - IGNF/FLAIR-HUB
11
  ---
12
 
13
- We introduce **MAESTRO**, a tailored adaptation of the Masked Autoencoder (MAE) framework that effectively orchestrates the use of multimodal, multitemporal, and multispectral Earth Observation (EO) data. Evaluated on four EO datasets, MAESTRO sets a new state-of-the-art on tasks that strongly rely on multitemporal dynamics, while remaining highly competitive on tasks dominated by a single monotemporal modality.
14
 
15
- Our contributions are as follows:
 
 
 
 
 
 
 
 
16
  - **Extensive benchmarking of multimodal and multitemporal SSL:** Impact evaluation of various fusion strategies for multimodal and multitemporal SSL.
17
  - **Patch-group-wise normalization:** Novel normalization scheme that normalizes reconstruction targets patch-wise within groups of highly correlated spectral bands.
18
  - **MAESTRO:** Novel adaptation of the MAE that combines optimized fusion strategies with our tailored patch-group-wise normalization..
19
 
20
  <div style="position: relative; text-align: center;">
21
- <img src="./media/Maestro_Overview.png" alt="Classes distribution." style="width: 100%; display: block; margin: 0 auto;"/>
22
  </div>
23
 
24
 
 
 
25
 
26
 
27
 
28
- 💻 **Code repository:** https://github.com/IGNF/MAESTRO<br>
29
- 📃 **Paper:** https://arxiv.org/abs/2508.10894
30
 
31
- <hr>
32
 
 
 
 
33
 
34
- ## Pre-training Dataset
 
 
 
 
 
 
35
 
 
 
 
 
 
36
 
37
  <hr>
38
 
39
- ## 🔎 Cross-dataset Evaluation
40
 
41
- Benchmark results on 4 datasets :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  <p align="center">
44
 
45
- | Model | Pre-training dataset | TreeSatAI-TS | PASTIS-HD | FLAIR#2 | FLAIR-HUB |
46
- |--------------------|-----------------------|--------------|-----------|---------|-----------|
47
- | MAESTRO (ours) | FLAIR-HUB | **79.6** | **68.0** | - | - |
48
- | MAESTRO (ours) | S2-NAIP urban | 78.8 | 67.4 | 62.6 | 64.6 |
49
- | DINO-v2 | LVD-142M | 76.7 | 64.4 | **64.2**| 66.0 |
50
- | DINO-v2 sat. | Maxar Vivid2 | 76.3 | 64.0 | 63.5 | **66.0** |
51
- | DOFA | DOFA MM | 76.0 | 62.9 | 62.3 | 65.1 |
52
- | CROMA | SSL4EO | 70.5 | 65.0 | 39.0 | 44.3 |
53
- | Prithvi-EO-2.0 | HLS | 75.6 | 66.2 | 41.8 | 44.9 |
54
- | SatMAE | fMoW RGB+S | 76.9 | 66.6 | 42.5 | 45.0 |
55
  </p>
56
 
57
 
58
- <hr>
59
 
60
- ## 🚀 Getting Started
 
 
61
 
62
- First, set up the module with [Poetry](https://python-poetry.org/).
63
 
64
  ```bash
65
  # 1. Change directory
@@ -69,67 +117,111 @@ cd MAESTRO
69
  poetry install
70
  ```
71
 
72
- Then, you can start from the following minimal examples.
73
-
74
- Intra-dataset MAESTRO on TreeSatAI-TS:
75
  ```bash
76
- # pre-train, probe and finetune on TreeSatAI-TS
77
  poetry run python main.py \
78
- model.model=mae model.model_size=medium \
79
- opt_pretrain.epochs=100 opt_probe.epochs=10 opt_finetune.epochs=50 \
80
- datasets.name_dataset=treesatai_ts \
81
- datasets.root_dir=/path/to/dataset/dir datasets.treesatai_ts.rel_dir=TreeSatAI-TS \
82
- run.exp_dir=/path/to/experiments/dir run.exp_name=mae-m_treesat
 
 
 
 
 
 
 
 
 
 
83
  ```
84
 
85
- Intra-dataset MAESTRO on PASTIS-HD:
86
  ```bash
87
- # pre-train, probe and finetune on PASTIS-HD
88
  poetry run python main.py \
89
- model.model=mae model.model_size=medium \
90
- opt_pretrain.epochs=100 opt_probe.epochs=10 opt_finetune.epochs=50 \
91
- datasets.name_dataset=pastis_hd \
92
- datasets.root_dir=/path/to/dataset/dir datasets.pastis_hd.rel_dir=PASTIS-HD \
93
- run.exp_dir=/path/to/experiments/dir run.exp_name=mae-m_pastis
 
 
 
 
 
 
 
 
 
 
94
  ```
95
 
96
- Intra-dataset MAESTRO on FLAIR-HUB:
97
  ```bash
98
- # pre-train, probe and finetune on FLAIR-HUB
99
  poetry run python main.py \
100
- model.model=mae model.model_size=medium \
101
- opt_pretrain.epochs=100 opt_probe.epochs=15 opt_finetune.epochs=100 \
102
- datasets.name_dataset=flair \
103
- datasets.root_dir=/path/to/dataset/dir datasets.flair.rel_dir=FLAIR-HUB \
104
- run.exp_dir=/path/to/experiments/dir run.exp_name=mae-m_flair
 
 
 
 
 
 
 
 
 
 
105
  ```
106
 
107
- Cross-dataset MAESTRO from S2-NAIP urban to TreeSatAI-TS:
 
108
  ```bash
109
- # pre-train on S2-NAIP urban
110
  poetry run python main.py \
111
- model.model=mae model.model_size=medium \
112
- opt_pretrain.epochs=15 opt_probe.epochs=0 opt_finetune.epochs=0 \
113
- datasets.name_dataset=s2_naip \
114
- datasets.root_dir=/path/to/dataset/dir datasets.s2_naip.rel_dir=s2-naip-urban \
115
- run.exp_dir=/path/to/experiments/dir run.exp_name=mae-m_s2-naip && \
116
- # probe and finetune on TreeSatAI-TS
117
- poetry run python main.py \
118
- model.model=mae model.model_size=medium \
119
- opt_pretrain.epochs=0 opt_probe.epochs=10 opt_finetune.epochs=50 \
120
- datasets.name_dataset=treesatai_ts \
121
- datasets.treesatai_ts.aerial.image_size=240 datasets.treesatai_ts.aerial.patch_size.mae=16 \
122
- datasets.treesatai_ts.s1_asc.name_embed=s1 datasets.treesatai_ts.s1_des.name_embed=s1 \
123
- datasets.root_dir=/path/to/dataset/dir datasets.treesatai_ts.rel_dir=TreeSatAI-TS \
124
- run.exp_dir=/path/to/experiments/dir run.load_name=mae-m_s2-naip run.exp_name=mae-m_s2-naip-x-treesat
 
125
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  ```
127
 
128
  <hr>
129
 
130
  ## Reference
131
 
132
- If you use this code, please cite:
133
 
134
  ```bibtex
135
  @article{labatie2025maestro,
@@ -144,4 +236,4 @@ If you use this code, please cite:
144
 
145
  ## Acknowledgement
146
 
147
- The experiments in the paper were conducted using HPC/AI resources from GENCI-IDRIS (allocations A0181013803, A0161013803, and AD010114597R1).
 
1
  ---
2
+ license: apache-2.0
3
  pipeline_tag: image-segmentation
4
  tags:
 
5
  - pytorch
6
+ - pytorch lightning
7
+ - remote sensing
8
+ - earth observation
9
+ - self-supervised learning
10
+ - masked autoencoders
11
+ - transformers
12
+ - multimodal
13
+ - multitemporal
14
  library_name: pytorch
15
  datasets:
16
+ - ignf/flair-hub
17
  ---
18
 
19
+ ## Download
20
 
21
+ ⚖️ [**Model weights**](checkpoints/pretrain-epoch=99.ckpt) <br>
22
+ ⚙️ [**Model configuration**](.hydra/config_resolved.yaml) <br>
23
+ 📂 [**Dataset splits**](dataset_splits) <br>
24
+
25
+ ## Abstract
26
+
27
+ **MAESTRO** is a tailored adaptation of the Masked Autoencoder (MAE) framework that effectively orchestrates the use of multimodal, multitemporal, and multispectral Earth Observation (EO) data. Evaluated on four EO datasets, MAESTRO sets a new state-of-the-art on tasks that strongly rely on multitemporal dynamics, while remaining highly competitive on tasks dominated by a single monotemporal modality.
28
+
29
+ MAESTRO's contributions are as follows:
30
  - **Extensive benchmarking of multimodal and multitemporal SSL:** Impact evaluation of various fusion strategies for multimodal and multitemporal SSL.
31
  - **Patch-group-wise normalization:** Novel normalization scheme that normalizes reconstruction targets patch-wise within groups of highly correlated spectral bands.
32
  - **MAESTRO:** Novel adaptation of the MAE that combines optimized fusion strategies with our tailored patch-group-wise normalization..
33
 
34
  <div style="position: relative; text-align: center;">
35
+ <img src="./media/Maestro_Overview.png" style="width: 100%; display: block; margin: 0 auto;"/>
36
  </div>
37
 
38
 
39
+ 📃 **Paper:** https://arxiv.org/abs/2508.10894 <br>
40
+ 💻 **Code repository:** https://github.com/IGNF/MAESTRO <br>
41
 
42
 
43
 
44
+ ## Pre-training
 
45
 
 
46
 
47
+ This model is pre-trained on [FLAIR-HUB](https://huggingface.co/datasets/IGNF/FLAIR-HUB)
48
+
49
+ FLAIR-HUB contains 241,100 tiles of size 102.4 × 102.4 m, covering a total area of 2,528 km² across France.
50
 
51
+ We retain six distinct modalities:
52
+ - Aerial imagery RGB + NIR (0.2 m resolution)
53
+ - DEM/DSM imagery (0.2 m resolution)
54
+ - SPOT 6–7 imagery
55
+ - Sentinel-1 time series in ascending orbit
56
+ - Sentinel-1 time series in descending orbit
57
+ - Sentinel-2 time series
58
 
59
+ Below is the reconstruction loss during pre-training on the combined training and validation ensembles, using patch-group-wise normalization and modality-weighted averaging proportional to token counts.
60
+
61
+ <div style="position: relative; text-align: center;">
62
+ <img src="./media/Reconstruction_Loss.png" style="width: 100%; display: block; margin: 0 auto;"/>
63
+ </div>
64
 
65
  <hr>
66
 
 
67
 
68
+ ## Fine-tuning
69
+
70
+ For optimal fine-tuning results with this model:
71
+ - Ensure that patch sizes and channels match between pre-training and fine-tuning for each modality:
72
+ - Modality "aerial":
73
+ - Patch size: 16
74
+ - Channels: NIR, RED, GREEN, BLUE
75
+ - Modality "spot":
76
+ - Patch size: 16
77
+ - Channels: RED, GREEN, BLUE
78
+ - Modality "s1":
79
+ - Patch size: 2
80
+ - Channels: VV, VH
81
+ - Modality "s2":
82
+ - Patch size: 2
83
+ - Channels: B02, B03, B04, B05, B06, B07, B08, B8A, B11, B12
84
+ - Use fixed cross-dataset grids for positional encodings proportional to ground sampling distance: `grid_pos_enc` ≈ 1.6 * `crop_meters`
85
+
86
+ Note that modality names must match between pre-training and fine-tuning.
87
+
88
+ Below are cross-dataset evaluation results obtained with these guidelines on TreeSatAI-TS, PASTIS-HD.
89
 
90
  <p align="center">
91
 
92
+ | Model | Pre-training dataset | TreeSatAI-TS | PASTIS-HD |
93
+ |--------------------|-----------------------|--------------|-----------|
94
+ | MAESTRO (ours) | FLAIR-HUB | **79.6** | **68.0** |
95
+ | DINO-v2 | LVD-142M | 76.7 | 64.4 |
96
+ | DINO-v2 sat. | Maxar Vivid2 | 76.3 | 64.0 |
97
+ | DOFA | DOFA MM | 76.0 | 62.9 |
98
+ | CROMA | SSL4EO | 70.5 | 65.0 |
99
+ | Prithvi-EO-2.0 | HLS | 75.6 | 66.2 |
100
+ | SatMAE | fMoW RGB+S | 76.9 | 66.6 |
 
101
  </p>
102
 
103
 
104
+ ## 🚀 Getting started
105
 
106
+ Prerequisites:
107
+ - Fetch [Dataset splits](dataset_splits) and move them to each dataset directory
108
+ - Fetch [model weights](checkpoints/pretrain-epoch=99.ckpt) and [model configuration](.hydra/config_resolved.yaml) and move them to `/path/to/experiments/`
109
 
110
+ The module is setup with [Poetry](https://python-poetry.org/).
111
 
112
  ```bash
113
  # 1. Change directory
 
117
  poetry install
118
  ```
119
 
120
+ Pre-training on FLAIR-HUB is performed using:
 
 
121
  ```bash
 
122
  poetry run python main.py \
123
+ model.model=mae model.model_size=medium \
124
+ model.fusion_mode=group model.inter_depth=3 \
125
+ opt_pretrain.epochs=100 opt_probe.epochs=0 opt_finetune.epochs=0 \
126
+ opt_pretrain.batch_size=144 \ # batch size 9 on 4 nodes with 4 GPUs per node
127
+ datasets.name_dataset=flair \
128
+ datasets.flair.filter_inputs=[aerial,dem,spot,s2,s1_asc,s1_des] \
129
+ datasets.flair.crop_meters=102.4 datasets.flair.grid_pos_enc=160 \
130
+ datasets.flair.aerial.image_size=512 datasets.flair.aerial.patch_size.mae=16 \
131
+ datasets.flair.dem.image_size=512 datasets.flair.dem.patch_size.mae=32 \
132
+ datasets.flair.spot.image_size=128 datasets.flair.spot.patch_size.mae=16 datasets.flair.spot.bands=3 \
133
+ datasets.flair.s2.image_size=10 datasets.flair.s2.patch_size.mae=2 \
134
+ datasets.flair.s1_asc.image_size=10 datasets.flair.s1_asc.patch_size.mae=2 \
135
+ datasets.flair.s1_des.image_size=10 datasets.flair.s1_des.patch_size.mae=2 \
136
+ datasets.root_dir=/path/to/dataset/dir datasets.flair.csv_dir=/path/to/dataset/dir/FLAIR-HUB datasets.flair.rel_dir=FLAIR-HUB \
137
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB_base \
138
  ```
139
 
140
+ Fine-tuning on TreeSatAI-TS:
141
  ```bash
 
142
  poetry run python main.py \
143
+ model.model=mae model.model_size=medium \
144
+ model.fusion_mode=group model.inter_depth=3 \
145
+ opt_pretrain.epochs=0 opt_probe.epochs=10 opt_finetune.epochs=50 \
146
+ opt_probe.batch_size=96 opt_finetune.batch_size=96 \ # batch size 32 on 1 node with 3 GPUs per node
147
+ opt_finetune.monitor=treesat_mlc_thresh/weighted_f1_val \
148
+ datasets.name_dataset=treesatai_ts \
149
+ datasets.treesatai_ts.filter_inputs=[aerial,s2,s1_asc,s1_des] \
150
+ datasets.treesatai_ts.crop_meters=60 datasets.treesatai_ts.grid_pos_enc=96 \
151
+ datasets.treesatai_ts.aerial.image_size=240 datasets.treesatai_ts.aerial.patch_size.mae=16 \
152
+ datasets.treesatai_ts.s2.image_size=6 datasets.treesatai_ts.s2.patch_size.mae=2 \
153
+ datasets.treesatai_ts.s1_asc.image_size=6 datasets.treesatai_ts.s1_asc.patch_size.mae=2 \
154
+ datasets.treesatai_ts.s1_des.image_size=6 datasets.treesatai_ts.s1_des.patch_size.mae=2 \
155
+ datasets.root_dir=/path/to/dataset/dir datasets.treesatai_ts.rel_dir=TreeSatAI-TS \
156
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-TSAI-TS_base \
157
+ run.load_name=MAESTRO_FLAIR-HUB_base # load pre-trained model
158
  ```
159
 
160
+ Fine-tuning on PASTIS-HD:
161
  ```bash
 
162
  poetry run python main.py \
163
+ model.model=mae model.model_size=medium \
164
+ model.fusion_mode=group model.inter_depth=3 \
165
+ opt_pretrain.epochs=0 opt_probe.epochs=10 opt_finetune.epochs=50 \
166
+ opt_probe.batch_size=48 opt_finetune.batch_size=48 \ # batch size 16 on 1 node with 3 GPUs per node
167
+ opt_finetune.monitor=pastis_seg/average_iou_val \
168
+ datasets.name_dataset=pastis_hd \
169
+ datasets.pastis_hd.filter_inputs=[spot,s2,s1_asc,s1_des] \
170
+ datasets.pastis_hd.crop_meters=160 datasets.pastis_hd.grid_pos_enc=256 datasets.pastis_hd.repeats=8 \
171
+ datasets.pastis_hd.spot.image_size=160 datasets.pastis_hd.spot.patch_size.mae=16 \
172
+ datasets.pastis_hd.s2.image_size=16 datasets.pastis_hd.s2.patch_size.mae=2 \
173
+ datasets.pastis_hd.s1_asc.image_size=16 datasets.pastis_hd.s1_asc.patch_size.mae=2 \
174
+ datasets.pastis_hd.s1_des.image_size=16 datasets.pastis_hd.s1_des.patch_size.mae=2 \
175
+ datasets.root_dir=/path/to/dataset/dir datasets.pastis_hd.rel_dir=PASTIS-HD \
176
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-PASTIS-HD_base \
177
+ run.load_name=MAESTRO_FLAIR-HUB_base # load pre-trained model
178
  ```
179
 
180
+
181
+ Fine-tuning on FLAIR#2:
182
  ```bash
 
183
  poetry run python main.py \
184
+ model.model=mae model.model_size=medium \
185
+ model.fusion_mode=group model.inter_depth=3 \
186
+ opt_pretrain.epochs=0 opt_probe.epochs=15 opt_finetune.epochs=100 \
187
+ opt_probe.batch_size=48 opt_finetune.batch_size=48 \ # batch size 6 on 2 nodes with 4 GPUs per node
188
+ opt_finetune.monitor=cosia/average_iou_val \
189
+ datasets.name_dataset=flair \
190
+ datasets.flair.version=flair2 \
191
+ datasets.flair.filter_inputs=[aerial,s2] \
192
+ datasets.flair.crop_meters=102.4 datasets.flair.grid_pos_enc=160 \
193
+ datasets.flair.aerial.image_size=512 datasets.flair.aerial.patch_size.mae=16 \
194
+ datasets.flair.s2.image_size=10 datasets.flair.s2.patch_size.mae=2 \
195
+ datasets.root_dir=/path/to/dataset/dir datasets.flair.csv_dir=/path/to/dataset/dir/FLAIR-HUB datasets.flair.rel_dir=FLAIR-HUB \
196
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-FLAIR2_base \
197
+ run.load_name=MAESTRO_FLAIR-HUB_base # load pre-trained model
198
+ ```
199
 
200
+ Fine-tuning on FLAIR-HUB:
201
+ ```bash
202
+ poetry run python main.py \
203
+ model.model=mae model.model_size=medium \
204
+ model.fusion_mode=group model.inter_depth=3 \
205
+ opt_pretrain.epochs=0 opt_probe.epochs=15 opt_finetune.epochs=100 \
206
+ opt_probe.batch_size=96 opt_finetune.batch_size=96 \ # batch size 6 on 4 nodes with 4 GPUs per node
207
+ opt_finetune.monitor=cosia/average_iou_val \
208
+ datasets.name_dataset=flair \
209
+ datasets.flair.filter_inputs=[aerial,s2,s1_asc,s1_des] \
210
+ datasets.flair.crop_meters=102.4 datasets.flair.grid_pos_enc=160 \
211
+ datasets.flair.aerial.image_size=512 datasets.flair.aerial.patch_size.mae=16 \
212
+ datasets.flair.s2.image_size=10 datasets.flair.s2.patch_size.mae=2 \
213
+ datasets.flair.s1_asc.image_size=10 datasets.flair.s1_asc.patch_size.mae=2 \
214
+ datasets.flair.s1_des.image_size=10 datasets.flair.s1_des.patch_size.mae=2 \
215
+ datasets.root_dir=/path/to/dataset/dir datasets.flair.csv_dir=/path/to/dataset/dir/FLAIR-HUB datasets.flair.rel_dir=FLAIR-HUB \
216
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-FLAIR-HUB_base \
217
+ run.load_name=MAESTRO_FLAIR-HUB_base # load pre-trained model
218
  ```
219
 
220
  <hr>
221
 
222
  ## Reference
223
 
224
+ If you use this model, please cite:
225
 
226
  ```bibtex
227
  @article{labatie2025maestro,
 
236
 
237
  ## Acknowledgement
238
 
239
+ The experiments in the paper were conducted using HPC/AI resources from GENCI-IDRIS (allocations A0181013803, A0161013803, AD010114597R1, and AD011014690R1).