Earth observation guideAnalysis

AI and machine learning

Machine learning finds things in imagery by learning from examples rather than following rules someone wrote. This page covers what it is used for, the main kinds of model, and what to check before you rely on what it produces.

The basics

Artificial intelligence in Earth observation nearly always means machine learning. Instead of writing a rule such as "water is dark in the infrared", you show a computer program thousands of examples that a person has already labelled, such as patches of water, forest and crops, and it works out for itself what separates them. It then labels every pixel or every object in new images. Training a new colleague is a fair comparison. Shown enough good examples, they become quick and reliable on cases like the ones they have seen, and they can be confidently wrong on cases unlike any of them. In practice machine learning maps land cover, finds and counts ships, buildings and solar farms, spots change between dates, masks out clouds and produces sharper-looking images, a process called super-resolution.

Why it matters

A map made by a model is an estimate, however sharp it looks. Before you rely on one, ask what it was trained on, how it was checked against an independent sample, and how accurate it is for each class you care about, not only overall. A model trained in one region, season or sensor can do much worse in another. A super-resolved image looks sharper, but the extra detail is invented by the model from what it has learnt, not measured by the satellite. The analysis methods page covers the methods that do not learn from examples.

WaterForestCropsLabelled examplesThe modellearnsA map it predicts
Labelled examples of water, forest and crops train a model, which then predicts a class for every square of the map.

In depth

What it is used for

A review of more than 200 studies found deep learning applied across remote sensing image analysis, including image fusion, image registration, scene classification, object detection, land use and land cover classification and segmentation [1]. Land cover segmentation labels every pixel. Dynamic World, for example, applies deep learning to 10 m Sentinel-2 imagery to publish land use and land cover predictions continuously, alongside new acquisitions, rather than once a year [2]. Object detection finds and outlines individual things such as ships, buildings or solar farms. A survey of 119 papers on finding vessels in optical imagery noted that radar is still the leading technology for maritime monitoring, and that weather, sea state, cloud, haze, sun angle and the sensor all affect detection accuracy [3]. A global inventory built with machine learning located 68,661 commercial, industrial and utility-scale solar facilities [4].

Clouds must be masked before almost any optical analysis. Methods that classify each pixel by its spectrum alone tend to mistake bright surfaces such as snow, ice and buildings for cloud, and a convolutional network that also uses the spatial pattern improved detection, especially over snow and ice [5]. Super-resolution predicts a finer image than the sensor recorded. One network sharpens the 20 m and 60 m Sentinel-2 bands to 10 m, and it is trained by shrinking real images, so its accuracy can only be measured at that reduced scale, where the true finer image exists [6]. At the full scale there is nothing to check it against. Detail a super-resolution model adds is invented from what it learnt in training, not measured, and should not be used to count, measure or identify objects smaller than the sensor's own pixel. Change detection compares the same place on different dates, and the same kinds of network are used for it alongside the methods on the analysis methods page. Mapping a flood or a burn scar after an event is a closely related task, and both were among the tasks a foundation model described below was fine-tuned for [7].

The main kinds of model

A random forest is a collection of decision trees, each grown on a random sample of the training data and a random choice of the inputs, which vote on the answer [8]. In remote sensing it handles many correlated inputs well and is fast, but it is sensitive to how the training sample was designed [9]. A convolutional neural network learns its own features from the pixels, in layers that build from edges and textures up to whole objects [10]. The U-Net design labels every pixel [11], and the cloud detector above is built on it [5]. A transformer replaces convolution with self-attention, which relates every part of an image to every other part [12], and transformers have spread to very high resolution, hyperspectral and radar imagery [13]. A foundation model is pretrained by self-supervision on a large unlabelled archive and then fine-tuned for a particular task with a small labelled set. Prithvi, a transformer pretrained on more than 1 TB of Harmonized Landsat and Sentinel-2 imagery, was fine-tuned for cloud gap filling, flood mapping, burn scar segmentation and crop segmentation [7].

The limits a buyer should know

Figure 1 sets out the steps behind a machine learning map and what to ask about each. The first is the labelled training data. Models typically need large training sets, made by drawing on high-resolution imagery, collecting in the field or reusing existing data. Those labels are often assumed to be true but almost always contain errors, from how the sample was designed and how it was collected, and those errors can cause substantial errors in the map. They are often not accounted for or reported [14].

  1. LabelsExamples whose class is known, drawn on imagery or collected on the ground.Errors here become errors in the map.
  2. TrainingThe model is fitted to the labelled examples.Sensor, region and season are fixed by the examples.
  3. ValidationThe map is checked against a separate sample it never saw.Ideally a random sample, labelled independently.
  4. ApplicationThe model is run over the whole area.Outside the conditions of training it may fail.
  5. ReportingAccuracy is stated for each class, with area estimates.One overall figure can hide a weak class.

Built by the map makerWhat a buyer should ask to see

Figure 1. The steps that make a machine learning map, from labels to reported accuracy, and what a buyer should ask about each.

The second is validation against independent ground truth. The standard way to report the accuracy of a classified map is an error matrix, which counts a sample of locations by their mapped class and their reference class [15]. Good practice draws that reference sample by a probability sampling design and reports overall accuracy together with the accuracy of each class and estimated areas with confidence intervals [16]. The sample must be independent of the training data, or the check measures only how well the model remembers its examples. With the map's classes in the rows and the reference classes in the columns, overall accuracy is

OA=∑i=1qniin\mathrm{OA} = \frac{\sum_{i=1}^{q} n_{ii}}{n}
(1)

where OA\mathrm{OA} is the overall accuracy, a fraction without unit; niin_{ii} is the number of sample locations that the map and the reference both put in class ii; qq is the number of classes; and nn is the total number of sample locations.

Overall accuracy weighs each class by how often it occurs, so a map can score well overall while missing most of a rare class. That is why accuracy should be reported per class, from both sides of the matrix. User's accuracy is the share of locations mapped as a class that really are that class, and producer's accuracy is the share of locations truly in a class that the map finds [15, 16].

UAi=niini+\mathrm{UA}_i = \frac{n_{ii}}{n_{i+}}
(2)

where UAi\mathrm{UA}_i is the user's accuracy of class ii, a fraction without unit, whose complement is the commission error; niin_{ii} is the number of sample locations correctly mapped as class ii; and ni+n_{i+} is the number of sample locations the map puts in class ii, the total of row ii.

PAj=njjn+j\mathrm{PA}_j = \frac{n_{jj}}{n_{+j}}
(3)

where PAj\mathrm{PA}_j is the producer's accuracy of class jj, a fraction without unit, whose complement is the omission error; njjn_{jj} is the number of sample locations correctly mapped as class jj; and n+jn_{+j} is the number of sample locations the reference puts in class jj, the total of column jj.

The third is domain shift. A model succeeds only as far as its training samples represent the images it is applied to. When those samples come from another image or another region, differences in acquisition and atmospheric conditions, or changes in what is observed such as crops at another stage of the season, shift the data and are likely to make the model fail. Domain adaptation methods aim to make a classifier robust to such shifts [17]. Accuracy measured in one place, season or sensor is therefore evidence about that place, season and sensor, and a buyer applying a model elsewhere should ask for a check there.

References

  1. Ma, L., Liu, Y., Zhang, X. et al. (2019) Deep learning in remote sensing applications: A meta-analysis and review. ISPRS Journal of Photogrammetry and Remote Sensing, 152, 166-177. https://doi.org/10.1016/j.isprsjprs.2019.04.015
  2. Brown, C. F., Brumby, S. P., Guzder-Williams, B. et al. (2022) Dynamic World, Near real-time global 10 m land use land cover mapping. Scientific Data, 9, 251. https://doi.org/10.1038/s41597-022-01307-4
  3. Kanjir, U., Greidanus, H. and Oštir, K. (2018) Vessel detection and classification from spaceborne optical images: A literature survey. Remote Sensing of Environment, 207, 1-26. https://doi.org/10.1016/j.rse.2017.12.033
  4. Kruitwagen, L., Story, K. T., Friedrich, J. et al. (2021) A global inventory of photovoltaic solar energy generating units. Nature, 598(7882), 604-610. https://doi.org/10.1038/s41586-021-03957-7
  5. Jeppesen, J. H., Jacobsen, R. H., Inceoglu, F. and Toftegaard, T. S. (2019) A cloud detection algorithm for satellite imagery based on deep learning. Remote Sensing of Environment, 229, 247-259. https://doi.org/10.1016/j.rse.2019.03.039
  6. Lanaras, C., Bioucas-Dias, J., Galliani, S. et al. (2018) Super-resolution of Sentinel-2 images: Learning a globally applicable deep neural network. ISPRS Journal of Photogrammetry and Remote Sensing, 146, 305-319. https://doi.org/10.1016/j.isprsjprs.2018.09.018
  7. Jakubik, J., Roy, S., Phillips, C. E. et al. (2023) Foundation Models for Generalist Geospatial Artificial Intelligence. arXiv, 2310.18660. https://doi.org/10.48550/arXiv.2310.18660
  8. Breiman, L. (2001) Random Forests. Machine Learning, 45(1), 5-32. https://doi.org/10.1023/A:1010933404324
  9. Belgiu, M. and Drăguţ, L. (2016) Random forest in remote sensing: A review of applications and future directions. ISPRS Journal of Photogrammetry and Remote Sensing, 114, 24-31. https://doi.org/10.1016/j.isprsjprs.2016.01.011
  10. LeCun, Y., Bengio, Y. and Hinton, G. (2015) Deep learning. Nature, 521(7553), 436-444. https://doi.org/10.1038/nature14539
  11. Ronneberger, O., Fischer, P. and Brox, T. (2015) U-Net: Convolutional Networks for Biomedical Image Segmentation. Medical Image Computing and Computer-Assisted Intervention, MICCAI 2015, Lecture Notes in Computer Science 9351, 234-241. https://doi.org/10.1007/978-3-319-24574-4_28
  12. Dosovitskiy, A., Beyer, L., Kolesnikov, A. et al. (2020) An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv, 2010.11929. https://doi.org/10.48550/arXiv.2010.11929
  13. Aleissaee, A. A., Kumar, A., Anwer, R. M. et al. (2023) Transformers in Remote Sensing: A Survey. Remote Sensing, 15(7), 1860. https://doi.org/10.3390/rs15071860
  14. Elmes, A., Alemohammad, H., Avery, R. et al. (2020) Accounting for Training Data Error in Machine Learning Applied to Earth Observations. Remote Sensing, 12(6), 1034. https://doi.org/10.3390/rs12061034
  15. Congalton, R. G. (1991) A review of assessing the accuracy of classifications of remotely sensed data. Remote Sensing of Environment, 37(1), 35-46. https://doi.org/10.1016/0034-4257(91)90048-B
  16. Olofsson, P., Foody, G. M., Herold, M. et al. (2014) Good practices for estimating area and assessing accuracy of land change. Remote Sensing of Environment, 148, 42-57. https://doi.org/10.1016/j.rse.2014.02.015
  17. Tuia, D., Persello, C. and Bruzzone, L. (2016) Domain Adaptation for the Classification of Remote Sensing Data: An Overview of Recent Advances. IEEE Geoscience and Remote Sensing Magazine, 4(2), 41-57. https://doi.org/10.1109/MGRS.2016.2548504