alabatie commited on
Commit
90dd565
·
verified ·
1 Parent(s): f702cba

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +169 -67
README.md CHANGED
@@ -1,65 +1,114 @@
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 +118,120 @@ 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 +246,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
+ - self-supervised learning
8
+ - masked autoencoders
9
+ - transformers
10
+ - remote sensing
11
+ - earth observation
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 and 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 move them into `/path/to/experiments/MAESTRO_FLAIR-HUB_base/checkpoints/`
109
+ - Fetch [model configuration](.hydra/config_resolved.yaml) and move it into `/path/to/experiments/MAESTRO_FLAIR-HUB_base/.hydra/`
110
 
111
+ The module is setup with [Poetry](https://python-poetry.org/).
112
 
113
  ```bash
114
  # 1. Change directory
 
118
  poetry install
119
  ```
120
 
121
+ Pre-training on FLAIR-HUB is performed using:
 
 
122
  ```bash
123
+ # batch size 9 on 4 nodes with 4 GPUs per node
124
  poetry run python main.py \
125
+ model.model=mae model.model_size=medium \
126
+ model.fusion_mode=group model.inter_depth=3 \
127
+ opt_pretrain.epochs=100 opt_probe.epochs=0 opt_finetune.epochs=0 \
128
+ opt_pretrain.batch_size=144 \
129
+ datasets.name_dataset=flair \
130
+ datasets.flair.filter_inputs=[aerial,dem,spot,s2,s1_asc,s1_des] \
131
+ datasets.flair.crop_meters=102.4 datasets.flair.grid_pos_enc=160 \
132
+ datasets.flair.aerial.image_size=512 datasets.flair.aerial.patch_size.mae=16 \
133
+ datasets.flair.dem.image_size=512 datasets.flair.dem.patch_size.mae=32 \
134
+ datasets.flair.spot.image_size=128 datasets.flair.spot.patch_size.mae=16 datasets.flair.spot.bands=3 \
135
+ datasets.flair.s2.image_size=10 datasets.flair.s2.patch_size.mae=2 \
136
+ datasets.flair.s1_asc.image_size=10 datasets.flair.s1_asc.patch_size.mae=2 \
137
+ datasets.flair.s1_des.image_size=10 datasets.flair.s1_des.patch_size.mae=2 \
138
+ datasets.root_dir=/path/to/dataset/dir datasets.flair.csv_dir=/path/to/dataset/dir/FLAIR-HUB datasets.flair.rel_dir=FLAIR-HUB \
139
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB_base \
140
  ```
141
 
142
+ Fine-tuning on TreeSatAI-TS:
143
  ```bash
144
+ # batch size 32 on 1 node with 3 GPUs per node
145
+ # load pre-trained model "MAESTRO_FLAIR-HUB_base"
146
  poetry run python main.py \
147
+ model.model=mae model.model_size=medium \
148
+ model.fusion_mode=group model.inter_depth=3 \
149
+ opt_pretrain.epochs=0 opt_probe.epochs=10 opt_finetune.epochs=50 \
150
+ opt_probe.batch_size=96 opt_finetune.batch_size=96 \
151
+ opt_finetune.monitor=treesat_mlc_thresh/weighted_f1_val \
152
+ datasets.name_dataset=treesatai_ts \
153
+ datasets.treesatai_ts.filter_inputs=[aerial,s2,s1_asc,s1_des] \
154
+ datasets.treesatai_ts.crop_meters=60 datasets.treesatai_ts.grid_pos_enc=96 \
155
+ datasets.treesatai_ts.aerial.image_size=240 datasets.treesatai_ts.aerial.patch_size.mae=16 \
156
+ datasets.treesatai_ts.s2.image_size=6 datasets.treesatai_ts.s2.patch_size.mae=2 \
157
+ datasets.treesatai_ts.s1_asc.image_size=6 datasets.treesatai_ts.s1_asc.patch_size.mae=2 \
158
+ datasets.treesatai_ts.s1_des.image_size=6 datasets.treesatai_ts.s1_des.patch_size.mae=2 \
159
+ datasets.root_dir=/path/to/dataset/dir datasets.treesatai_ts.rel_dir=TreeSatAI-TS \
160
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-TSAI-TS_base \
161
+ run.load_name=MAESTRO_FLAIR-HUB_base
162
  ```
163
 
164
+ Fine-tuning on PASTIS-HD:
165
  ```bash
166
+ # batch size 16 on 1 node with 3 GPUs per node
167
+ # load pre-trained model "MAESTRO_FLAIR-HUB_base"
168
  poetry run python main.py \
169
+ model.model=mae model.model_size=medium \
170
+ model.fusion_mode=group model.inter_depth=3 \
171
+ opt_pretrain.epochs=0 opt_probe.epochs=10 opt_finetune.epochs=50 \
172
+ opt_probe.batch_size=48 opt_finetune.batch_size=48 \
173
+ opt_finetune.monitor=pastis_seg/average_iou_val \
174
+ datasets.name_dataset=pastis_hd \
175
+ datasets.pastis_hd.filter_inputs=[spot,s2,s1_asc,s1_des] \
176
+ datasets.pastis_hd.crop_meters=160 datasets.pastis_hd.grid_pos_enc=256 datasets.pastis_hd.repeats=8 \
177
+ datasets.pastis_hd.spot.image_size=160 datasets.pastis_hd.spot.patch_size.mae=16 \
178
+ datasets.pastis_hd.s2.image_size=16 datasets.pastis_hd.s2.patch_size.mae=2 \
179
+ datasets.pastis_hd.s1_asc.image_size=16 datasets.pastis_hd.s1_asc.patch_size.mae=2 \
180
+ datasets.pastis_hd.s1_des.image_size=16 datasets.pastis_hd.s1_des.patch_size.mae=2 \
181
+ datasets.root_dir=/path/to/dataset/dir datasets.pastis_hd.rel_dir=PASTIS-HD \
182
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-PASTIS-HD_base \
183
+ run.load_name=MAESTRO_FLAIR-HUB_base
184
  ```
185
 
186
+
187
+ Fine-tuning on FLAIR#2:
188
  ```bash
189
+ # batch size 6 on 2 nodes with 4 GPUs per node
190
+ # load pre-trained model "MAESTRO_FLAIR-HUB_base"
191
  poetry run python main.py \
192
+ model.model=mae model.model_size=medium \
193
+ model.fusion_mode=group model.inter_depth=3 \
194
+ opt_pretrain.epochs=0 opt_probe.epochs=15 opt_finetune.epochs=100 \
195
+ opt_probe.batch_size=48 opt_finetune.batch_size=48 \
196
+ opt_finetune.monitor=cosia/average_iou_val \
197
+ datasets.name_dataset=flair \
198
+ datasets.flair.version=flair2 \
199
+ datasets.flair.filter_inputs=[aerial,s2] \
200
+ datasets.flair.crop_meters=102.4 datasets.flair.grid_pos_enc=160 \
201
+ datasets.flair.aerial.image_size=512 datasets.flair.aerial.patch_size.mae=16 \
202
+ datasets.flair.s2.image_size=10 datasets.flair.s2.patch_size.mae=2 \
203
+ datasets.root_dir=/path/to/dataset/dir datasets.flair.csv_dir=/path/to/dataset/dir/FLAIR-HUB datasets.flair.rel_dir=FLAIR-HUB \
204
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-FLAIR2_base \
205
+ run.load_name=MAESTRO_FLAIR-HUB_base
206
+ ```
207
 
208
+ Fine-tuning on FLAIR-HUB:
209
+ ```bash
210
+ # batch size 6 on 4 nodes with 4 GPUs per node
211
+ # load pre-trained model "MAESTRO_FLAIR-HUB_base"
212
+ poetry run python main.py \
213
+ model.model=mae model.model_size=medium \
214
+ model.fusion_mode=group model.inter_depth=3 \
215
+ opt_pretrain.epochs=0 opt_probe.epochs=15 opt_finetune.epochs=100 \
216
+ opt_probe.batch_size=96 opt_finetune.batch_size=96 \
217
+ opt_finetune.monitor=cosia/average_iou_val \
218
+ datasets.name_dataset=flair \
219
+ datasets.flair.filter_inputs=[aerial,s2,s1_asc,s1_des] \
220
+ datasets.flair.crop_meters=102.4 datasets.flair.grid_pos_enc=160 \
221
+ datasets.flair.aerial.image_size=512 datasets.flair.aerial.patch_size.mae=16 \
222
+ datasets.flair.s2.image_size=10 datasets.flair.s2.patch_size.mae=2 \
223
+ datasets.flair.s1_asc.image_size=10 datasets.flair.s1_asc.patch_size.mae=2 \
224
+ datasets.flair.s1_des.image_size=10 datasets.flair.s1_des.patch_size.mae=2 \
225
+ datasets.root_dir=/path/to/dataset/dir datasets.flair.csv_dir=/path/to/dataset/dir/FLAIR-HUB datasets.flair.rel_dir=FLAIR-HUB \
226
+ run.exp_dir=/path/to/experiments/dir run.exp_name=MAESTRO_FLAIR-HUB-x-FLAIR-HUB_base \
227
+ run.load_name=MAESTRO_FLAIR-HUB_base
228
  ```
229
 
230
  <hr>
231
 
232
  ## Reference
233
 
234
+ If you use this model, please cite:
235
 
236
  ```bibtex
237
  @article{labatie2025maestro,
 
246
 
247
  ## Acknowledgement
248
 
249
+ The experiments in the paper were conducted using HPC/AI resources from GENCI-IDRIS (allocations A0181013803, A0161013803, AD010114597R1, and AD011014690R1).