A little R package to calculate the Distance to the Second Cluster proposer by Mitchell et al. 2008.
Overview • Installation • Usage • References • Related
D2SC is a light R package to calculate the Distance to the Second Cluster proposed by Mitchell et al. 2008. The Distance to the Second Cluster can be used as indicator of classification confidence in Land Use / Land Cover classification problems. The D2SC package makes it easy to calculate the distance between two cluster using raster
objects (RasterStack or RasterBrick) which contain the probability of belonging to each cluster (or class).
D2SC is computed as the complement of the ratio between most voted and second voted class Hermosilla et al. 2022:
where
Note D2SC package works with both RasterStack and RasterBrick objects. See raster documentation to wotk with.
To use this package you need to clone this repository usind devtools
:
# Install devtools
install.packages("devtools")
library(devtools)
# Install the development version from GitHub
install_github("sermomon/D2SC")
The main function of the package is d2sc
which calculate the Distance to the Second Cluster. But, the package also contain two complementaty functions: getIndexOf
and distBetween
.
By default, d2sc
computes the Euclidean distance between the class with the highest probability and the class with the second highest probability:
r_distBetw_1_2 <- d2sc(x)
You can also calculate the distance between the class with the highest probability and the class with the third highest probability by modifying the ind
argument.
# Distance between the class with the highest probability and the class with the third highest probability
r_distBetw_1_3 <- d2sc(r, ind=c(1,3))
- Scott W. Mitchell, Tarmo K. Remmel, Ferenc Csillag, Michael A. Wulder (2008). Distance to second cluster as a measure of classification confidence. Remote Sensing of Environment, 112(5), 2615-2626. https://doi.org/10.1016/j.rse.2007.12.006
- Txomin Hermosilla, Alex Bastyr, Nicholas C. Coops, Joanne C. White, Michael A. Wulder (2022). Mapping the presence and distribution of tree species in Canada's forested ecosystems. Remote Sensing of Environment, 282, 113276. https://doi.org/10.1016/j.rse.2022.113276
D2SC is a research tool created by Sergio Morell-Monzó. Meaning, if you liked using this tool or it has helped you in any way, I'd like you send me an email at sermomon@upv.es about anything you'd want to say about this package. I'd really appreciate it!
This tool uses the following Open Source packages:
- raster. D2SC was built under raster 3.5.2
The following scientific studies used the Distance to The Second Cluster:
- Patrick Bogaert, François Waldner, Pierre Defourny (2017). An information-based criterion to measure pixel-level thematic uncertainty in land cover classifications. Stochastic Environmental Research and Risk Assessment, 31, 2297–2312. https://doi.org/10.1007/s00477-016-1310-y
- Txomin Hermosilla, Michael A. Wulder, Joanne C. White, Nicholas C. Coops, Geordie W. Hobart (2015). Regional detection, characterization, and attribution of annual forest change from 1984 to 2012 using Landsat-derived time-series metrics. Remote Sensing of Environment, 170, 121-132. https://doi.org/10.1016/j.rse.2015.09.004
- Txomin Hermosilla, Michael A. Wulder, Joanne C. White, Nicholas C. Coops & Geordie W. Hobart (2018) Disturbance-Informed Annual Land Cover Classification Maps of Canada's Forested Ecosystems for a 29-Year Landsat Time Series, Canadian Journal of Remote Sensing, 44(1), 67-87. https://doi.org/10.1080/07038992.2018.1437719
- Wei Wei, Jing Zhang, Liang Zhou, Binbin Xie, Junju Zhou, Chuanhua Li (2021). Comparative evaluation of drought indices for monitoring drought based on remote sensing data. Environ Sci Pollut Res 28, 20408–20425 (2021). https://doi.org/10.1007/s11356-020-12120-0
- Paulo J. Murillo-Sandoval, Thomas Hilker, Meg A. Krawchuk, Jamon Van Den Hoek (2018). Detecting and Attributing Drivers of Forest Disturbance in the Colombian Andes Using Landsat Time-Series. Forest, 9(5), 269. https://doi.org/10.3390/f9050269
Web Sergio Morell-Monzó · Google Scholar Sergio Morell-Monzó · GitHub @sermomon · Twitter @sermomon