alabatie commited on
Commit
98269fb
·
verified ·
1 Parent(s): fa7d35c

Update README.md

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