File size: 11,767 Bytes
88cbcd0
 
d6cf770
 
 
 
 
d87c801
d6cf770
 
 
 
 
 
d87c801
d6cf770
 
 
 
20b334f
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
d6cf770
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
 
09aaa6d
9c1de65
7bf16ce
a4fd9ca
 
79a7ccd
 
78e38e0
79a7ccd
 
0c51ade
79a7ccd
 
 
 
 
 
 
0c51ade
a4fd9ca
 
6dc104b
a4fd9ca
 
 
6dc104b
 
 
 
 
 
 
 
 
a4fd9ca
 
 
f214513
 
69a7946
56bcf67
 
f214513
58c706b
 
 
 
56bcf67
78e38e0
 
 
58c706b
 
 
 
 
 
56bcf67
58c706b
 
 
56bcf67
 
 
58c706b
56bcf67
 
 
58c706b
f214513
a4fd9ca
 
79a7ccd
 
a4fd9ca
 
 
 
 
 
 
 
 
 
78e38e0
a4fd9ca
 
 
 
 
 
 
3ecce40
 
 
 
 
a4fd9ca
 
 
 
 
 
 
 
 
3ecce40
 
 
 
 
 
 
 
 
 
 
a4fd9ca
 
 
 
 
 
 
78e38e0
 
 
 
 
 
c9f6e5f
 
 
78e38e0
 
c9f6e5f
 
78e38e0
c9f6e5f
78e38e0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a4fd9ca
 
 
 
c9f6e5f
 
 
 
bf7384e
97d3a79
e41d9da
 
 
 
 
 
 
 
c9f6e5f
649fe9f
 
 
 
c9f6e5f
a4fd9ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6dc104b
 
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
---
license: etalab-2.0
tags:
- segmentation
- pytorch
- aerial imagery
- landcover
- IGN
model-index:
- name: FLAIR-INC_RVBIE_unetresnet34_15cl_norm
  results:
  - task:
      type: semantic-segmentation
    dataset:
      name: IGNF/FLAIR#1-TEST
      type: earth-observation-dataset
    metrics:
    - name: mIoU
      type: mIoU
      value: 54.7168
    - name: Overall Accuracy
      type: OA
      value: 76.3711
    - name: Fscore
      type: Fscore
      value: 67.6063
    - name: Precision
      type: Precision
      value: 69.3481
    - name: Recall
      type: Recall
      value: 67.6565
      
    - name: IoU Buildings
      type: IoU
      value: 82.6313
    - name: IoU Pervious surface
      type: IoU
      value: 53.2351
    - name: IoU Impervious surface
      type: IoU
      value: 74.1742
    - name: IoU Bare soil
      type: IoU
      value: 60.3958
    - name: IoU Water
      type: IoU
      value: 87.5887
    - name: IoU Coniferous
      type: IoU
      value: 46.3504
    - name: IoU Deciduous
      type: IoU
      value: 67.4473
    - name: IoU Brushwood
      type: IoU
      value: 30.2346
    - name: IoU Vineyard
      type: IoU
      value: 82.9251
    - name: IoU Herbaceous vegetation
      type: IoU
      value: 55.0283      
    - name: IoU Agricultural land
      type: IoU
      value: 52.0145
    - name: IoU Plowed land
      type: IoU
      value: 40.8387   
    - name: IoU Swimming pool
      type: IoU
      value: 48.4433    
    - name: IoU Greenhouse
      type: IoU
      value: 39.4447
      
pipeline_tag: image-segmentation
---

# FLAIR model collection
The FLAIR models is a collection of semantic segmentation models initially developed to classify land cover on very high resolution aerial ortho-images ([BD ORTHO®](https://geoservices.ign.fr/bdortho)). 
The distributed pre-trained models differ in their :
- input modalities : RVB (true colours), RVBI (true colours + infrared), RVBIE (true colours + infrared + elevation)
- model architecture : U-Net with a Resnet-34 encoder, Deeplab
- target class nomenclature : 12 or 15 land cover classes
- dataset for training : [FLAIR dataset](https://huggingface.co/datasets/IGNF/FLAIR) or the increased version of this dataset FLAIR-INC.


# FLAIR FLAIR-INC_RVBIE_resnet34_unet_15cl_norm model
The general characteristics of this specific model *FLAIR-INC_RVBIE_resnet34_unet_15cl_norm* are :
* RVBIE images (true colours + infrared + elevation)
* U-Net with a Resnet-34 encoder
* 15 class nomenclature [building,pervious_surface,impervious_surface,bare_soil,water,coniferous,deciduous,brushwood,vineyard,herbaceous,agricultural_land,plowed_land,swimming pool,snow,greenhouse]


## Model Informations

<!-- Provide the basic links for the model. -->

- **Repository:** https://github.com/IGNF/FLAIR-1-AI-Challenge
- **Paper [optional]:** https://arxiv.org/pdf/2211.12979.pdf
- **Developed by:** IGN
- **Compute infrastructure:** 
    - software: python, pytorch-lightning
    - hardware: GENCI, XXX
- **License:** : Apache 2.0

  
## Uses
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

The model has been trained with

**Radiometry of input images** :
The input images are distributed in 8-bit encoding format per channel. or traning the model, input normalization was performed (see section **Traing Details**). 
It is recommended that the user apply the same type of input normalization while inferring the model.

**Multi-domain model** :
The FLAIR-INC dataset that was used for training is composed of 75 radiometric domains. In the case of aerial images, domain shifts are due : the date of the aerial survey (april to november), spatial domain (equivalent to a french department administrative division) and downstream radimetric processing.
By construction the model is robust to theses shifts, and can be applied to any images of the ([BD ORTHO® product](https://geoservices.ign.fr/bdortho)).

**Land Cover classes of prediction** :
The orginial class nomenclature of the FLAIR Dataset is made up of 19 classes(See the [FLAIR dataset](https://huggingface.co/datasets/IGNF/FLAIR) page for details).
However 3 classes corresponding to uncertain labelisation (Mixed (16), Ligneous (17) and Other (19)) and 1 class with very poor label quantity (Clear cut (15)) were deasctivated during training.
As a result, the logits produced by the model are of size 19x1, but class 15,16,17 and 19 should appear at 0 in the logits. And labels 15,16,17 and 19 never predicted in the argmax.


## Bias, Risks, and Limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

**Using the model on input images with other spatial resolution** :
The FLAIR-INC_RVBIE_resnet34_unet_15cl_norm model has been trained with fixed scale conditions. All patches used for training are derived from aerial images of 0.2 meters spatial resolution. 
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.

**Using the model for other remote sensing sensors** :
The FLAIR-INC_RVBIE_resnet34_unet_15cl_norm model has been trained with aerial images of the ([BD ORTHO® product](https://geoservices.ign.fr/bdortho)) that encopass very specific radiometric image processing. 
Using the model on other type of aerial images or satellite images may imply the use of transfer learning or domain adaptation techniques.

**Using the model on other spatial areas** :
The FLAIR-INC_RVBIE_resnet34_unet_15cl_norm model has been trained on patches reprensenting the French Metropolitan territory. 
The user should be aware that applying the model to other type of landscapes may imply a drop in model metrics.  


{{ bias_risks_limitations | default("[More Information Needed]", true)}}



### Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

{{ bias_recommendations | default("Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.", true)}}

## How to Get Started with the Model

Use the code below to get started with the model.


{{ get_started_code | default("[More Information Needed]", true)}}

## Training Details

### Training Data

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
218 400 patchs of 512 x 512 pixels were used to train the model. 
The train/validation split was performed patchwise to obtain a 80% / 20% distribution. Spatial independancy between patches is guaranted : neighbouring patches are assigned to the same partition :
* Train set : 174 700 patches
* Validation set : 43 700 patchs


{{ training_data | default("[More Information Needed]", true)}}

### Training Procedure

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->

#### Preprocessing [optional]

For traning the model, input normalization was performed so as the input dataset has a mean of 0 and a standart deviation of 1. For this model here are the statistics of the TRAIN+VALIDATION partition. It is recommended that the user apply the same type of input normalization.
Input normalization was performed 
| Modalities              | Mean (Train + Validation)       |Std    (Train + Validation)     |
| ----------------------- | ----------- |----------- |
| Red Channel (R)         | 105.08	    |52.17       |
| Green Channel (V)       | 110.87      |45.38       |
| Blue Channel (B)        | 101.82	    |44.00       |
| Infrared Channel (I)    | 106.38	    |39.69       |
| Elevation Channel (E)   | 53.26       |79.30       |


{{ preprocessing | default("[More Information Needed]", true)}}


#### Training Hyperparameters

- **Training regime:** {{ training_regime | default("[More Information Needed]", true)}} <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->

* Model architecture: Unet (implementation from the [Segmentation Models Pytorch library](https://segmentation-modelspytorch.readthedocs.io/en/latest/docs/api.html#unet)
* Encoder : Resnet-34 pre-trained with ImageNet
* Augmentation :
  * VerticalFlip(p=0.5)
  * HorizontalFlip(p=0.5)
  * RandomRotate90(p=0.5)
* Input normalization (mean=0 | std=1):
  * norm_means: [105.08, 110.87, 101.82, 106.38, 53.26]
  * norm_stds: [52.17, 45.38, 44, 39.69, 79.3]
* Seed: 2022
* Batch size: 10
* Number of epochs : 200
* Early stopping : patience 30 and val_loss as monitor criterium 
* Optimizer : SGD
* Schaeduler : mode = "min", factor = 0.5, patience = 10, cooldown = 4, min_lr = 1e-7
* Learning rate : 0.02
* Class Weights : 
  * 1: [1, building]
  * 2: [1, pervious surface]
  * 3: [1, impervious surface]
  * 4: [1, bare soil]
  * 5: [1, water]
  * 6: [1, coniferous]
  * 7: [1, deciduous]
  * 8: [1, brushwood]
  * 9: [1, vineyard]
  * 10: [1,herbaceous vegetation]
  * 11: [1, agricultural land]
  * 12: [1, plowed land]
  * 13: [1, swimming_pool]
  * 14: [1, snow]
  * 15: [0, clear cut]
  * 16: [0, mixed]
  * 17: [0, ligneous]
  * 18: [1, greenhouse]
  * 19: [0, other]


#### Speeds, Sizes, Times [optional]

<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->

The FLAIR-INC_RVBIE_resnet34_unet_15cl_norm model was trained on a HPC/AI resources provided by GENCI-IDRIS (Grant 2022-A0131013803). 16 V100 GPUs were requested ( 4 nodes, 4 GPUS per node).

FLAIR-INC_RVBIE_resnet34_unet_15cl_norm was obtained for num_epoch=76 with corresponding val_loss=0.56. 

<img src="train_loss_FLAIR-INC_RGBIE_resnet34_unet_15cl_norm.png" alt="drawing" style="width:200px;"/>



Train loss log             |  Val loss log 
:-------------------------:|:-------------------------:
![](train_loss_FLAIR-INC_RGBIE_resnet34_unet_15cl_norm.png)| ![](val_loss_FLAIR-INC_RGBIE_resnet34_unet_15cl_norm.png)




Train loss log             |  Val loss log 
:-------------------------:|:-------------------------:
<img src="train_loss_FLAIR-INC_RGBIE_resnet34_unet_15cl_norm.png" alt="drawing" style="width:200px;"/> | <img src="val_loss_FLAIR-INC_RGBIE_resnet34_unet_15cl_norm.png" alt="drawing" style="width:200px;"/>


{{ speeds_sizes_times | default("[More Information Needed]", true)}}

## Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

### Testing Data, Factors & Metrics

#### Testing Data

<!-- This should link to a Dataset Card if possible. -->

{{ testing_data | default("[More Information Needed]", true)}}

#### Metrics

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

{{ testing_metrics | default("[More Information Needed]", true)}}

### Results

{{ results | default("[More Information Needed]", true)}}

#### Summary

{{ results_summary | default("", true) }}


## Technical Specifications [optional]

### Model Architecture and Objective

{{ model_specs | default("[More Information Needed]", true)}}


## Citation [optional]

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

**BibTeX:**

{{ citation_bibtex | default("[More Information Needed]", true)}}

**APA:**

{{ citation_apa | default("[More Information Needed]", true)}}

## Contact
ai-challenge@ign.fr