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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: etalab-2.0
|
3 |
+
tags:
|
4 |
+
- segmentation
|
5 |
+
- pytorch
|
6 |
+
- aerial imagery
|
7 |
+
- landcover
|
8 |
+
- IGN
|
9 |
+
model-index:
|
10 |
+
- name: FLAIR-INC_RVBIE_unetresnet34_15cl_norm
|
11 |
+
results:
|
12 |
+
- task:
|
13 |
+
type: semantic-segmentation
|
14 |
+
dataset:
|
15 |
+
name: IGNF/FLAIR/
|
16 |
+
type: earth-observation-dataset
|
17 |
+
metrics:
|
18 |
+
- name: mIoU
|
19 |
+
type: mIoU
|
20 |
+
value: 58.63
|
21 |
+
- name: Overall Accuracy
|
22 |
+
type: OA
|
23 |
+
value: 76.3711
|
24 |
+
- name: Fscore
|
25 |
+
type: Fscore
|
26 |
+
value: 72.4353
|
27 |
+
- name: Precision
|
28 |
+
type: Precision
|
29 |
+
value: 74.3015
|
30 |
+
- name: Recall
|
31 |
+
type: Recall
|
32 |
+
value: 72.4891
|
33 |
+
|
34 |
+
- name: IoU Buildings
|
35 |
+
type: IoU
|
36 |
+
value: 82.6313
|
37 |
+
- name: IoU Pervious surface
|
38 |
+
type: IoU
|
39 |
+
value: 53.2351
|
40 |
+
- name: IoU Impervious surface
|
41 |
+
type: IoU
|
42 |
+
value: 74.1742
|
43 |
+
- name: IoU Bare soil
|
44 |
+
type: IoU
|
45 |
+
value: 60.3958
|
46 |
+
- name: IoU Water
|
47 |
+
type: IoU
|
48 |
+
value: 87.5887
|
49 |
+
- name: IoU Coniferous
|
50 |
+
type: IoU
|
51 |
+
value: 46.3504
|
52 |
+
- name: IoU Deciduous
|
53 |
+
type: IoU
|
54 |
+
value: 67.4473
|
55 |
+
- name: IoU Brushwood
|
56 |
+
type: IoU
|
57 |
+
value: 30.2346
|
58 |
+
- name: IoU Vineyard
|
59 |
+
type: IoU
|
60 |
+
value: 82.9251
|
61 |
+
- name: IoU Herbaceous vegetation
|
62 |
+
type: IoU
|
63 |
+
value: 55.0283
|
64 |
+
- name: IoU Agricultural land
|
65 |
+
type: IoU
|
66 |
+
value: 52.0145
|
67 |
+
- name: IoU Plowed land
|
68 |
+
type: IoU
|
69 |
+
value: 40.8387
|
70 |
+
- name: IoU Swimming pool
|
71 |
+
type: IoU
|
72 |
+
value: 48.4433
|
73 |
+
- name: IoU Greenhouse
|
74 |
+
type: IoU
|
75 |
+
value: 39.4447
|
76 |
+
|
77 |
+
pipeline_tag: image-segmentation
|
78 |
---
|
79 |
+
|
80 |
+
|
81 |
+
<div style="border:0px; padding:25px; background-color:#F8F5F5; padding-top:10px; padding-bottom:1px;">
|
82 |
+
<h1>FLAIR model collection</h1>
|
83 |
+
<p>The FLAIR models are a collection of semantic segmentation models initially developed to classify land cover on very high resolution aerial images (more specifically the French <a href="https://geoservices.ign.fr/bdortho">BD ORTHO®</a> product). The distributed pre-trained models differ in their :</p>
|
84 |
+
<ul style="list-style-type:disc;">
|
85 |
+
<li>dataset for training : <a href="https://huggingface.co/datasets/IGNF/FLAIR"><b>FLAIR</b> dataset</a> or the increased version of this dataset <b>FLAIR-INC</b> (x 3.5 patches). Only the FLAIR dataset is open at the moment.</li>
|
86 |
+
<li>input modalities : <b>RGB</b> (natural colours), <b>RGBI</b> (natural colours + infrared), <b>RGBIE</b> (natural colours + infrared + elevation)</li>
|
87 |
+
<li>model architecture : <b>resnet34_unet</b> (U-Net with a Resnet-34 encoder), <b>deeplab</b></li>
|
88 |
+
<li>target class nomenclature : <b>12cl</b> (12 land cover classes) or <b>15cl</b> (15 land cover classes)</li>
|
89 |
+
</ul>
|
90 |
+
</div>
|
91 |
+
<br>
|
92 |
+
|
93 |
+
<div style="border:1px solid black; padding:25px; background-color:#FDFFF4 ; padding-top:10px; padding-bottom:1px;">
|
94 |
+
<h1>FLAIR-INC_rgbie_15cl_resnet34-unet</h1>
|
95 |
+
<p>The general characteristics of this specific model <strong>FLAIR-INC_rgbie_15cl_resnet34-unet</strong> are :</p>
|
96 |
+
<ul style="list-style-type:disc;">
|
97 |
+
<li>Trained with the FLAIR-INC dataset</li>
|
98 |
+
<li>RGBIE images (true colours + infrared + elevation)</li>
|
99 |
+
<li>U-Net with a Resnet-34 encoder</li>
|
100 |
+
<li>15 class nomenclature : [building, pervious surface, impervious surface, bare soil, water, coniferous, deciduous, brushwood, vineyard, herbaceous, agricultural land, plowed land, swimming pool, snow, greenhouse]</li>
|
101 |
+
</ul>
|
102 |
+
</div>
|
103 |
+
|
104 |
+
## Model Informations
|
105 |
+
- **Code repository:** https://github.com/IGNF/FLAIR-1
|
106 |
+
- **Paper:** https://arxiv.org/pdf/2211.12979.pdf
|
107 |
+
- **Developed by:** IGN
|
108 |
+
- **Compute infrastructure:**
|
109 |
+
- software: python, pytorch-lightning
|
110 |
+
- hardware: HPC/AI resources provided by GENCI-IDRIS
|
111 |
+
- **License:** : Apache 2.0
|
112 |
+
|
113 |
+
---
|
114 |
+
|
115 |
+
## Uses
|
116 |
+
|
117 |
+
Although the model can be applied to other type of very high spatial earth observation images, it was initially developed to tackle the problem of classifying aerial images acquired on the French Territory.
|
118 |
+
The product called ([BD ORTHO®](https://geoservices.ign.fr/bdortho)) has its own spatial and radiometric specifications. The model is not intended to be generic to other type of very high spatial resolution images but specific to BD ORTHO images.
|
119 |
+
Consequently, the model’s prediction would improve if the user images are similar to the original ones.
|
120 |
+
|
121 |
+
_**Radiometry of input images**_ :
|
122 |
+
The BD ORTHO input images are distributed in 8-bit encoding format per channel. When traning the model, input normalization was performed (see section **Trainingg Details**).
|
123 |
+
It is recommended that the user apply the same type of input normalization while inferring the model.
|
124 |
+
|
125 |
+
_**Multi-domain model**_ :
|
126 |
+
The FLAIR-INC dataset that was used for training is composed of 75 radiometric domains. In the case of aerial images, domain shifts are frequent and are mainly due to : the date of acquisition of the aerial survey (from april to november), the spatial domain (equivalent to a french department administrative division) and downstream radiometric processing.
|
127 |
+
By construction (sampling 75 domains) the model is robust to these shifts, and can be applied to any images of the ([BD ORTHO® product](https://geoservices.ign.fr/bdortho)).
|
128 |
+
|
129 |
+
_**Specification for the Elevation channel**_ :
|
130 |
+
The fifth dimension of the RGBIE images is the Elevation (height of building and vegetation). This information is encoded in a 8-bit encoding format.
|
131 |
+
When decoded to [0,255] ints, a difference of 1 should coresponds to 0.2 meters step of elevation difference.
|
132 |
+
|
133 |
+
|
134 |
+
_**Land Cover classes of prediction**_ :
|
135 |
+
The orginial class nomenclature of the FLAIR Dataset encompasses 19 classes (See the [FLAIR dataset](https://huggingface.co/datasets/IGNF/FLAIR) page for details).
|
136 |
+
However 3 classes corresponding to uncertain labelisation (Mixed (16), Ligneous (17) and Other (19)) and 1 class with very poor labelling (Clear cut (15)) were desactivated during training.
|
137 |
+
As a result, the logits produced by the model are of size 19x1, but classes n° 15, 16, 17 and 19 should appear at 0 in the logits and should not be present in the final argmax product.
|
138 |
+
|
139 |
+
|
140 |
+
|
141 |
+
## Bias, Risks, Limitations and Recommendations
|
142 |
+
|
143 |
+
_**Using the model on input images with other spatial resolution**_ :
|
144 |
+
The FLAIR-INC_rgbie_15cl_resnet34-unet model was trained with fixed scale conditions. All patches used for training are derived from aerial images with 0.2 meters spatial resolution. Only flip and rotate augmentations were performed during the training process.
|
145 |
+
No data augmentation method concerning scale change was used during training. The user should pay attention that generalization issues can occur while applying this model to images that have different spatial resolutions.
|
146 |
+
|
147 |
+
_**Using the model for other remote sensing sensors**_ :
|
148 |
+
The FLAIR-INC_rgbie_15cl_resnet34-unet model was trained with aerial images of the ([BD ORTHO® product](https://geoservices.ign.fr/bdortho)) that encopass very specific radiometric image processing.
|
149 |
+
Using the model on other type of aerial images or satellite images may imply the use of transfer learning or domain adaptation techniques.
|
150 |
+
|
151 |
+
_**Using the model on other spatial areas**_ :
|
152 |
+
The FLAIR-INC_rgbie_15cl_resnet34-unet model was trained on patches reprensenting the French Metropolitan territory.
|
153 |
+
The user should be aware that applying the model to other type of landscapes may imply a drop in model metrics.
|
154 |
+
|
155 |
+
---
|
156 |
+
|
157 |
+
## How to Get Started with the Model
|
158 |
+
|
159 |
+
Visit ([https://github.com/IGNF/FLAIR-1](https://github.com/IGNF/FLAIR-1)) to use the model.
|
160 |
+
Fine-tuning and prediction tasks are detailed in the README file.
|
161 |
+
|
162 |
+
|
163 |
+
---
|
164 |
+
|
165 |
+
## Training Details
|
166 |
+
|
167 |
+
### Training Data
|
168 |
+
|
169 |
+
218 400 patches of 512 x 512 pixels were used to train the **FLAIR-INC_RVBIE_resnet34_unet_15cl_norm** model.
|
170 |
+
The train/validation split was performed patchwise to obtain a 80% / 20% distribution between train and validation.
|
171 |
+
Annotation was performed at the _zone_ level (~100 patches per _zone_). Spatial independancy between patches is guaranted as patches from the same _zone_ were assigned to the same set (TRAIN or VALIDATION).
|
172 |
+
The following number of patches were used for train and validation :
|
173 |
+
| TRAIN set | 174 700 patches |
|
174 |
+
| VALIDATION set | 43 700 patchs |
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
|
179 |
+
|
180 |
+
### Training Procedure
|
181 |
+
|
182 |
+
#### Preprocessing
|
183 |
+
|
184 |
+
For traning the model, input normalization was performed to center-reduce (**a mean=0** and a **standard deviation = 1**, channel wise) the dataset.
|
185 |
+
We used the statistics of TRAIN+VALIDATION for input normalization. It is recommended that the user apply the same type of input normalization.
|
186 |
+
|
187 |
+
Statistics of the TRAIN+VALIDATION set :
|
188 |
+
|
189 |
+
| Modalities | Mean (Train + Validation) |Std (Train + Validation) |
|
190 |
+
| ----------------------- | ----------- |----------- |
|
191 |
+
| Red Channel (R) | 105.08 |52.17 |
|
192 |
+
| Green Channel (G) | 110.87 |45.38 |
|
193 |
+
| Blue Channel (B) | 101.82 |44.00 |
|
194 |
+
| Infrared Channel (I) | 106.38 |39.69 |
|
195 |
+
| Elevation Channel (E) | 53.26 |79.30 |
|
196 |
+
|
197 |
+
|
198 |
+
#### Training Hyperparameters
|
199 |
+
|
200 |
+
* Model architecture: Unet (implementation from the [Segmentation Models Pytorch library](https://segmentation-modelspytorch.readthedocs.io/en/latest/docs/api.html#unet))
|
201 |
+
* Encoder : Resnet-34 pre-trained with ImageNet
|
202 |
+
* Augmentation :
|
203 |
+
* VerticalFlip(p=0.5)
|
204 |
+
* HorizontalFlip(p=0.5)
|
205 |
+
* RandomRotate90(p=0.5)
|
206 |
+
* Input normalization (mean=0 | std=1):
|
207 |
+
* norm_means: [105.08, 110.87, 101.82, 106.38, 53.26]
|
208 |
+
* norm_stds: [52.17, 45.38, 44, 39.69, 79.3]
|
209 |
+
* Seed: 2022
|
210 |
+
* Batch size: 10
|
211 |
+
* Number of epochs : 200
|
212 |
+
* Early stopping : patience 30 and val_loss as monitor criterium
|
213 |
+
* Optimizer : SGD
|
214 |
+
* Schaeduler : mode = "min", factor = 0.5, patience = 10, cooldown = 4, min_lr = 1e-7
|
215 |
+
* Learning rate : 0.02
|
216 |
+
* Class Weights : [1-building: 1.0 , 2-pervious surface: 1.0 , 3-impervious surface: 1.0 , 4-bare soil: 1.0 , 5-water: 1.0 , 6-coniferous: 1.0 , 7-deciduous: 1.0 , 8-brushwood: 1.0 , 9-vineyard: 1.0 , 10-herbaceous vegetation: 1.0 , 11-agricultural land: 1.0 , 12-plowed land: 1.0 , 13-swimming_pool: 1.0 , 14-snow: 1.0 , 15-clear cut: 0.0 , 16-mixed: 0.0 , 17-ligneous: 0.0 , 18-greenhouse: 1.0 , 19-other: 0.0]
|
217 |
+
|
218 |
+
|
219 |
+
#### Speeds, Sizes, Times
|
220 |
+
|
221 |
+
The FLAIR-INC_rgbie_15cl_resnet34-unet model was trained on a HPC/AI resources provided by GENCI-IDRIS (Grant 2022-A0131013803).
|
222 |
+
16 V100 GPUs were used ( 4 nodes, 4 GPUS per node). With this configuration the approximate learning time is 6 minutes per epoch.
|
223 |
+
|
224 |
+
FLAIR-INC_rgbie_15cl_resnet34-unet was obtained for num_epoch=76 with corresponding val_loss=0.56.
|
225 |
+
|
226 |
+
|
227 |
+
<div style="position: relative; text-align: center;">
|
228 |
+
<p style="margin: 0;">TRAIN loss</p>
|
229 |
+
<img src="figs/train_loss_FLAIR-INC_RGBIE_resnet34_unet_15cl_norm.png" alt="TRAIN loss" style="width: 60%; display: block; margin: 0 auto;"/>
|
230 |
+
<p style="margin: 0;">VALIDATION loss</p>
|
231 |
+
<img src="figs/val_loss_FLAIR-INC_RGBIE_resnet34_unet_15cl_norm.png" alt="VALIDATION loss" style="width: 60%; display: block; margin: 0 auto;"/>
|
232 |
+
</div>
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
## Evaluation
|
237 |
+
|
238 |
+
### Testing Data, Factors & Metrics
|
239 |
+
|
240 |
+
#### Testing Data
|
241 |
+
|
242 |
+
The evaluation was performed on a TEST set of 31 750 patches that are independant from the TRAIN and VALIDATION patches. They represent 15 spatio-temporal domains.
|
243 |
+
The TEST set corresponds to the reunion of the TEST set of scientific challenges FLAIR#1 and FLAIR#2. See the [FLAIR challenge page](https://ignf.github.io/FLAIR/) for more details.
|
244 |
+
|
245 |
+
The choice of a separate TEST set instead of cross validation was made to be coherent with the FLAIR challenges.
|
246 |
+
However the metrics for the Challenge were calculated on 12 classes and the TEST set acordingly.
|
247 |
+
As a result the _Snow_ class is absent from the TEST set.
|
248 |
+
|
249 |
+
#### Metrics
|
250 |
+
|
251 |
+
With the evaluation protocol, the **FLAIR-INC_RVBIE_resnet34_unet_15cl_norm** have been evaluated to **OA= 76.37%** and **mIoU=58.63%**.
|
252 |
+
The _snow_ class is discarded from the average metrics.
|
253 |
+
|
254 |
+
The following table give the class-wise metrics :
|
255 |
+
|
256 |
+
| Modalities | IoU (%) | Fscore (%) | Precision (%) | Recall (%) |
|
257 |
+
| ----------------------- | ----------|---------|---------|---------|
|
258 |
+
| building | 82.63 | 90.49 | 90.26 | 90.72 |
|
259 |
+
| pervious surface | 53.24 | 69.48 | 68.97 | 70.00 |
|
260 |
+
| impervious surface | 74.17 | 85.17 | 86.28 | 84.09 |
|
261 |
+
| bare soil | 60.40 | 75.31 | 80.49 | 70.75 |
|
262 |
+
| water | 87.59 | 93.38 | 93.16 | 93.61 |
|
263 |
+
| coniferous | 46.35 | 63.34 | 63.52 | 63.16 |
|
264 |
+
| deciduous | 67.45 | 80.56 | 77.44 | 83.94 |
|
265 |
+
| brushwood | 30.23 | 46.43 | 63.55 | 36.58 |
|
266 |
+
| vineyard | 82.93 | 90.67 | 91.35 | 89.99 |
|
267 |
+
| herbaceous vegetation | 55.03 | 70.99 | 70.59 | 71.40 |
|
268 |
+
| agricultural land | 52.01 | 68.43 | 59.18 | 81.12 |
|
269 |
+
| plowed land | 40.84 | 57.99 | 68.28 | 50.40 |
|
270 |
+
| swimming_pool | 48.44 | 65.27 | 81.62 | 54.37 |
|
271 |
+
| _snow_ | _00.00_ | _00.00_ | _00.00_ | _00.00_ |
|
272 |
+
| greenhouse | 39.45 | 56.57 | 45.52 | 74.72 |
|
273 |
+
| **average** | **58.63** | **72.44** | **74.3** | **72.49** |
|
274 |
+
|
275 |
+
|
276 |
+
|
277 |
+
|
278 |
+
|
279 |
+
|
280 |
+
|
281 |
+
|
282 |
+
The following illustration gives the resulting confusion matrix :
|
283 |
+
* Top : normalised acording to columns, columns sum at 100% and the **precision** is on the diagonal of the matrix
|
284 |
+
* Bottom : normalised acording to rows, rows sum at 100% and the **recall** is on the diagonal of the matrix
|
285 |
+
|
286 |
+
|
287 |
+
<div style="position: relative; text-align: center;">
|
288 |
+
<p style="margin: 0;">Normalized Confusion Matrix (precision)</p>
|
289 |
+
<img src="figs/FLAIR-INC_RVBIE_resnet34_unet_15cl_norm_cm-precision.png" alt="drawing" style="width: 70%; display: block; margin: 0 auto;"/>
|
290 |
+
<p style="margin: 0;">Normalized Confusion Matrix (recall)</p>
|
291 |
+
<img src="figs/FLAIR-INC_RVBIE_resnet34_unet_15cl_norm_cm-recall.png" alt="drawing" style="width: 70%; display: block; margin: 0 auto;"/>
|
292 |
+
</div>
|
293 |
+
|
294 |
+
|
295 |
+
|
296 |
+
### Results
|
297 |
+
|
298 |
+
Samples of results
|
299 |
+
|
300 |
+
|
301 |
+
---
|
302 |
+
|
303 |
+
## Citation
|
304 |
+
|
305 |
+
|
306 |
+
**BibTeX:**
|
307 |
+
|
308 |
+
```
|
309 |
+
@inproceedings{ign-flair,
|
310 |
+
title={FLAIR: a Country-Scale Land Cover Semantic Segmentation Dataset From Multi-Source Optical Imagery},
|
311 |
+
author={Anatol Garioud and Nicolas Gonthier and Loic Landrieu and Apolline De Wit and Marion Valette and Marc Poupée and Sébastien Giordano and Boris Wattrelos},
|
312 |
+
year={2023},
|
313 |
+
booktitle={Advances in Neural Information Processing Systems (NeurIPS) 2023},
|
314 |
+
doi={https://doi.org/10.48550/arXiv.2310.13336},
|
315 |
+
}
|
316 |
+
```
|
317 |
+
|
318 |
+
|
319 |
+
**APA:**
|
320 |
+
```
|
321 |
+
Anatol Garioud, Nicolas Gonthier, Loic Landrieu, Apolline De Wit, Marion Valette, Marc Poupée, Sébastien Giordano and Boris Wattrelos. 2023.
|
322 |
+
FLAIR: a Country-Scale Land Cover Semantic Segmentation Dataset From Multi-Source Optical Imagery. (2023).
|
323 |
+
In proceedings of Advances in Neural Information Processing Systems (NeurIPS) 2023.
|
324 |
+
DOI: https://doi.org/10.48550/arXiv.2310.13336
|
325 |
+
```
|
326 |
+
|
327 |
+
## Contact : [email protected]
|