La vectorisation du produit OSO, comment ça marche ?

Le produit vecteur d'OSO 2017 est enfin sorti ! Après plusieurs semaines de traitements, les vecteurs de chaque département sont disponibles ici. La production requiert la mobilisation d'une grande quantité de ressources de calcul et une stratégie de traitements un peu particulière. Nous voulions vous expliquer comment parvient-on à produire cette couche d'information.

Exemple du raster initial (10 m), régularisé (20m) et vectorisé

A priori, le plus simple serait de prendre la couche raster issue de la chaine de traitements iota² de l'intégrer dans notre logiciel SIG préféré et d'appuyer sur le bouton "Vectorisation" ! Mais les choses ne sont pas si simples, certaines contraintes et besoins nous obligent à quelques tours de passe-passe :

Continue reading

Are Sentinel-2 water vapour products useful ?

Atmospheric absorption: in blue, the surface reflectance of a vegetation pixel, as a function of wavelength. In red, the reflectance of the same pixel at the top of atmosphere. For a wavelength of 1.38 µm, water vapour totally absorbs the light that comes from the earth surface at sea level. At 0.94 µm (940nm), a weaker water vapour absorption band only partly absorbs the photons.

=>

Sentinel-2B has two channels centered on water vapour absorption bands: channel 9 (940 nm) and channel 10 (1380 nm). Band 10 corresponds to a very strong absorption, strong enough to prevent any photon to reach ground from the Sun without being absorbed in the atmosphere. This band is intensively used to detect and correct high clouds.

 

In this blog, we discussed much less band 9 (940 nm) yet. Here, water vapour absorption is not strong enough to catch all the photons which reach the surface. The proportion of absorbed photons depends on the water vapour atmospheric content, and also on the viewing and solar zenith angles. We use band 9 for atmospheric correction, but it could be useful to study convection phenomena within the atmosphere too.

Continue reading

Des applications pour la vapeur d'eau observée par Sentinel2 ?

Absorption atmosphérique. En bleu, la réflectance de surface pour un pixel couvert de végétation, en fonction de la longueur d'onde, en rouge la réflectance au sommet de l'atmosphère pour ce même pixel. A 1.38 µm, la vapeur d'eau absorbe totalement la lumière provenant de la surface au niveau de la mer. Autour de 0.94 µm, une autre bade d'absorption de la vapeur d'eau est visible, mais l'absorption y est moins intense

=>

Sentinel-2B dispose de deux canaux centrés sur des bandes d'absorption de la vapeur d'eau: la bande 9 (940nm) et la bande 10 (1380 nm). La bande 10 correspond à une très forte absorption, telle qu'en général, dans cette bande, les photons n'ont aucune chance d'atteindre le sol, et encore moins le satellite après réflexion sur le sol. Cette bande est utilisée pour détecter les nuages hauts.

 

Dans ce blog, nous avons jusqu'ici moins parlé de la bande d'absorption à 940 nm. Ici l'absorption des photons passant par la surface terrestre n'est pas totale, seule une forte proportion d'entre eux est absorbée, et cette proportion dépend bien sûr de la quantité de vapeur d'eau, mais aussi de l'inclinaison des directions solaires et d'observation. Cette bande nous sert à la correction atmosphérique, mais pourrait aussi, je pense, intéresser les spécialistes de l'atmosphère.

Continue reading

Machine learning for land cover map production - Follow-up on the TiSeLaC challenge

I discussed some important aspects to take into account when validating land cover maps in a previous post. In that same post I insisted on the fact that machine learning pipeline building using a blind optimisation of accuracy metrics can lead to unrealistic expectations about land cover maps produced using these approaches.

 

I cited as an example the TiSeLaC challenge, where 2 of the participating teams achieved FScores above 99%, which is an accuracy higher than the one we can expect from the reference data used for the validation.

 

I assumed that this unrealistic performances where due to over-fitting and the use of a validation set too similar to the training set. I have recently asked the challenge organisers about the procedure for splitting the reference data into train and test sets and they confirmed that the split was done at the pixel level and not at the polygon level. Therefore, nearly identical pixels coming from the same polygon could be used for training and validation.

 

Therefore, looking at the challenge results, one could expect that all the teams would have got similar high performances. Since this was not the case, I asked for references to the methods used. Two of the methods are published. I am assuming that these are the 2 winning methods.

 

One of the methods uses spatial nearest neighbour classification to decide the labels, that is, the class for a pixel is decided using the labels of the nearest pixels of the training set. Here, "nearest" means the closest in the image using an Euclidean distance on the spatial coordinates of the pixel. Indeed, the pixel coordinates where provided as a separate record, but I don't think they were intended to be used as features. And, yes, the best results are obtained if only pixel coordinates are used (no reflectances, no NDVI, nothing!). And 1 single neighbour works best than 2-NN or 10-NN.

 

This shows that indeed, neighbouring pixels were present in the training and test sets, and the fewer the information used (just the closest pixel) the better the result obtained.

 

To quickly check this, I ran a simple, out-of-the-box, Random Forest classifier using the coordinates as features and got 97.90% accuracy on the test set, while using the image features gives about 90%.

 

The second of the 2 winning methods (which is actually the first with an FScore of 99.29 while the method above obtains 99.03), uses 3 deep neural networks, 2 of which use temporal convolutions for each pixel. The third network is a multi-layer perceptron were the input features are statistics computed on all the pixels found in a spatial neighbourhood of the pixel to be classified. Different sizes of neighbourhoods between 1 and 17 are used. This is much more complex than using only the label of the closest pixel, but actually, contains the same information. Adding the information of the 2 first networks may allow to correctly classify the few pixels that the previous method got wrong. The performance difference between the 2 methods is less than 0.3%, which may probably fall within typical confidence intervals.

 

What can we learn from these results?

 

First of all, blind metric optimisation without domain knowledge can produce misleading results. Any remote sensing scientist knows that pixel coordinates only are not good predictors for producing a map. Otherwise, one could just spatially interpolate the reference data. Even when applying krigging, other variables are usually used!

 

Second, when organising this kind of contest, realistic data sets have to be used. The split between training and validation has to follow strict rules in order to avoid neighbouring pixels appearing in both data sets.

 

Third, map validation has to have a spatial component: are the shapes of the objects preserved, is there image noise in the generated map, etc. This is a tricky question which needs either to have dense reference data in some places or having specific metrics which are able to measure distortions without reference data. Obtaining dense reference data is very costly to and can even be impossible if some of the classes can't be identified by image interpretation (we are not tagging images of cats or road signs!). Developing specific metrics for spatial quality which don't need reference data is an open problem. Some solutions have been developed for the assessment of pan-sharpening algorithms, but the problem is rather different.

 

Finally, I hope that this critical analysis of the TiSeLaC contest will be useful for future contests, because I think that they may be very useful to get together the remote sensing and the machine learning communities.

The odds to find snow in St. Moritz

Did you know that the St. Moritz Casino is the highest in Switzerland? If you like gambling, I have a little game for you: what are the odds to find snow near St. Moritz?

Fortunately, I just finished the processing of 218 Sentinel-2 dates from 2015-Dec-04 to 2018-Apr-10 of tile 32TNS with our let-it-snow processor. I did this off-line production for a colleague because, as of today, Theia only distributes the snow products after July 2017 in this region of Switzerland (see the available products here).
 
A quick way to check the output is to compute a snow cover probability map: that is, for each pixel, the number of times that snow was observed divided by the number of times that the snow could be observed.
 
To compute this map we just need to know that the Theia snow products (LIS_SEB.TIF raster files) are coded as follows:
0: No-snow
100: Snow
205: Cloud including cloud shadow
254: No data
 
Here is a piece of script to do this:

#!/bin/bash 
# initialize snow.tif with zeros
# store in Byte because we have less than 255 dates
f0=$(find . -name LIS_SEB.TIF | head -1)
gdal_calc.py --overwrite -A $f0 --type=Byte --calc=A*0 --outfile=snow.tif
# accumulate snow pixels in snow.tif
for f in $(find . -name LIS_SEB.TIF)
do
# snow is coded with 100
gdal_calc.py --overwrite -A $f -B snow.tif --type=Byte --calc="B+(A==100)" --outfile=snow.tif
done

# now do the same for clear.tif
# init
gdal_calc.py --overwrite -A $f0 --type=Byte --calc=A*0 --outfile=clear.tif
# accumulate clear pixels in clear.tif
for f in $(find . -name LIS_SEB.TIF)
do
# only snow and no snow are coded with values lower than 101
gdal_calc.py --overwrite -A $f -B clear.tif --type=Byte --calc="B+(A<101)" --outfile=clear.tif
done

# Finally compute the snow probability in % (100.0* makes the calculation in float)
gdal_calc.py -A snow.tif -B clear.tif --type=Byte --calc="(100.0*A)/B" --outfile=snowProba.tif

 
This is the output:
 

The images are scaled from 0 (black) to 100 (white). The units are number of days for snow and clear, percentage for snowProba.

 

From which you can map the odds to find snow near St. Moritz (click on the image to animate)!
 

Venµs captured the orange snow in the Pyrenees

Theia just published the first Venµs images today, including a beautiful view of the Pyrenees. Once you have dezipped/untared/unzipped the files you can make a true color composite using the command:

gdal_translate -b 7 -b 4 -b 3 -scale 0 300 0 255 -ot byte VE_VM01_VSC_PDTIMG_L1VALD_ES_LTERA_20180419.DBL.TIF myColorCompo.tif

I tend to focus on the snow so I stretched the colors between reflectances 0-1000 instead of 0-300:

gdal_translate -b 7 -b 4 -b 3 -scale 0 1000 0 255 -ot byte VE_VM01_VSC_PDTIMG_L1VALD_ES_LTERA_20180419.DBL.TIF mySnowColorCompo.tif

First, I was a bit puzzled by the orange shade in the northern part of the image. We inspected carefully the image with Olivier because at this stage radiometric calibration issues are still possible..
Continue reading

Enneigement au 1er avril 2018 dans les Pyrénées

Le 1er avril est le moment privilégié par les hydrologues pour caractériser le potentiel hydrologique du manteau neigeux. Dans le cadre de l'OPCC [1] nous avons compilé différents indicateurs [2] :

 

 

  • L'équivalent en eau du manteau neigeux dans les sous-bassins pyrénéens du bassin de l'Ebre est calculé par la Confederación Hidrográfica del Ebro (agence de bassin) à partir d'observations MODIS, des données météorologiques, et un modèle de type "degré-jour" (la fonte est proportionnelle à la température de l'air).

 

https://pbs.twimg.com/media/DZ4_0wkXkAELrmc.jpg

Continue reading

Another validation of CESBIO's 2016 France land-cover map

In this post, a validation of the land-cover map of France produced by CESBIO for the 2016 period was presented. This validation used independent data (that is data collected by different teams and using different procedures than the data used for the classifier training), but the validation procedure consisted in applying classical machine learning metrics which, as described in this other post, have some limitations.

A fully independent validation following a sound protocol is costly and needs skills and expertise that are very specific. SIRS is a company which is specialised in the production of geographic data from satellite or aerial images. Among other things, they are the producers of Corine Land Cover for France and they are also responsible for quality control and validation of other Copernicus Land products.

SIRS has recently performed a validation of the 2016 France land-cover map. The executive summary of the report reads as follows:

This report provides the evaluation results of the CESBIO OSO 2016 10m layer and the CESBIO OSO 2016 20m layer.

The thematic accuracy assessment was conducted in a two-stage process:

  1. An initial blind interpretation in which the validation team did not have knowledge of the product’s thematic classes.
  2. A plausibility analysis was performed on all sample units in disagreement with the production data to consider the following cases:
  • Uncertain code, both producer and operator codes are plausible. Final validation code used is producer code.
  • Error from first validation interpretation. Final validation used is producer code
  • Error from producer. Final validation code used is from first validation interpretation
  • Producer and operator are both wrong. Final Validation code used is a new code from this second interpretation.

Resulting to this two-stage approach, it should be noticed that the plausibility analysis exhibit better results than the blind analysis.

The thematic accuracy assessment was carried out over 1,428 sample units covering France and Corsica.
The final results show that the CESBIO OSO product meet the usually accepted thematic validation requirement, i.e. 85 % in both blind interpretation and plausibility analysis. Indeed, the overall accuracies obtained are 81.4 +/- 3.68% for the blind analysis and 91.7 +/- 1.25% for the plausibility analysis on the CESBIO OSO 10m layer. The analysis on the 20m layer shows us that the overall accuracy for the blind approach is 81.1 +/-3.65% and 88.2 +/-3.15% for the plausibility approach.
Quality checks of the validation points have been made by French experts. It should be noticed that for the blind analysis, the methodology of control was based mostly on Google Earth imagery, no additional thematic source of information that could provide further context was used such as forest stand maps, peatland maps, etc.

These results are very good news for us and for our users. The report also contains interesting recommendations that will help us to improve our algorithms. The full report is available for download.