Source-linked AI summary
Hyperspectral Data Analysis in R: the hsdar Package
Lukas W. Lehnert, Hanna Meyer, Wolfgang A. Obermeier, Brenner Silva, Bianca Regeling, Jörg Bendix
TL;DR
Hyperspectral analysis in R lacked directly applicable, integrated tools for preprocessing and extracting information from hyperspectral data. hsdar provides a framework for handling and analyzing these data, with case studies estimating leaf chlorophyll and detecting laryngeal cancer. The reported case-study results include strong chlorophyll-model fit and higher overall accuracy for the cancer SVM than for the neural network.
Problem
Hyperspectral preprocessing and information-extraction functionality in R was partly available, dispersed across packages, and not directly applicable to hyperspectral data.
Source: §2 · p. 2Method
hsdar provides a framework for handling and analyzing hyperspectral data, integrating processing routines with R statistical analyses and supporting normalized ratio indices for larynx spectra.
Source: §2 · p. 3, §3.1 · p. 3, §5.2 · p. 14Results
Chlorophyll estimation achieved RMSE = 2.49 mg and R2 = 0.95; for laryngeal cancer classification, SVM overall accuracy was 93.33% versus 90% for the neural network.
Source: §5.1 · p. 13, §5.2 · p. 17Takeaways & Limitations
The case studies illustrate hsdar’s use in remote sensing and spatial applications, and the package is applicable to multispectral satellite data including Landsat 8 and MODIS.
Source: §6 · p. 18Automatic diagnosis of laryngeal cancer is not possible without the knowledge of a trained medical expert.
Source: §5.2 · p. 18
Abstract
from arXiv · showhide
Hyperspectral remote sensing is a promising tool for a variety of applications including ecology, geology, analytical chemistry and medical research. This article presents the new \hsdar package for R statistical software, which performs a variety of analysis steps taken during a typical hyperspectral remote sensing approach. The package introduces a new class for efficiently storing large hyperspectral datasets such as hyperspectral cubes within R. The package includes several important hyperspectral analysis tools such as continuum removal, normalized ratio indices and integrates two widely used radiation transfer models. In addition, the package provides methods to directly use the functionality of the caret package for machine learning tasks. Two case studies demonstrate the package's range of functionality: First, plant leaf chlorophyll content is estimated and second, cancer in the human larynx is detected from hyperspectral data.
1. Introduction
Hyperspectral imaging serves research across many disciplines, with applications ranging from ecology and agriculture to geology and medical research. The paper presents hsdar as an R package combining hyperspectral analysis tools with R’s statistical capabilities.
1. Introduction
- Hyperspectral imaging is used in analytical chemistry, agricultural research, ecology, pedology, geology, and medical research.Its advantages include cost-effective spatial analysis, nondestructive measurement of surface properties, and speed that can reach real time.Source: §1 · p. 2
- Hyperspectral imaging supports measurements using portable spectrometers or cameras in the field, laboratory, or surgical suite, with sensor choice depending on the target and analysis aim.Vegetation has a prominent red edge, while geological analyses usually require short- and mid-infrared wavelengths.Source: §1 · p. 2
- Commercial tools such as Erdas Imagine, ENVI, and MATLAB’s hyperspectral toolbox are generally expensive and offer limited statistical-analysis functionality.The paper presents hsdar as an open-source R package combining hyperspectral tools with R’s statistical power.Source: §1 · p. 2
2. Why use R for hyperspectral imaging analysis
Hyperspectral analysis commonly involves preprocessing, extracting relevant information, and then classification or regression. The paper motivates hsdar as a way to bring dispersed, partly unavailable hyperspectral-processing functions into R’s statistical workflow.
2. Why use R for hyperspectral imaging analysis
- Hyperspectral analysis commonly proceeds through spectral preprocessing, extraction of target-relevant information, and classification or regression to predict properties across space and time.R is identified as comprehensive for the third step, including machine-learning methods such as support vector machines, Random Forests, and artificial neural networks.Source: §2 · p. 2
- Before hsdar, functionality for preprocessing and information extraction was partly available in R, dispersed across packages, and not directly applicable to hyperspectral data.This left the first two stages less integrated than R’s statistical-analysis stage.Source: §2 · pp. 2–3
- hsdar provides a framework for handling and analyzing hyperspectral data, implementing common processing routines and extending R functionality to include hyperspectral data in broader statistical analyses.Its development particularly focused on large datasets collected under field conditions, such as vegetation remote sensing.Source: §2 · p. 3
3. Overview of the functionality of hsdar
hsdar organizes hyperspectral measurements and associated information in a Speclib object, then provides processing, analysis, and modelling functionality. Its features address both large raster datasets and spectral-analysis tasks.
3.1. Classes
- Speclib stores reflectance spectra, band specifications, and supplementary information together, using a matrix for smaller datasets or a RasterBrick for large hyperspectral images.Matrix rows represent samples and columns represent bands; wavelength and full-width-half-maximum values describe the sensor bands, while supplementary information can include ancillary data and raster images.Source: §3.1 · p. 3, Figure 1 · p. 4
- Speclib objects can be created from hyperspectral raster files or from reflectance values and wavelength information, and hsdar can retrieve spectra from an online USGS library.Online retrieval supports approximate string matching and automatically masks missing data.Source: §3.1 · pp. 3–5
3.2. Functionality
- For datasets exceeding RAM, hsdar can process RasterBrick spectra block-wise, or users can iteratively read chunks, apply multiple functions, and write results with one read/write pass.The block-wise function approach saves intermediate results to a temporary raster and can require repeated saving and rereading when multiple functions are applied.Source: §3.2 · pp. 5–6
- Preprocessing includes four built-in noise filters or signal-package filters, derived spectral variables, and resampling hyperspectral data to lower-resolution sensors.Resampling can use predefined satellite-sensor response functions, Gaussian response functions based on fwhm, or response values stored in a Speclib.Source: §3.2 · p. 6, Figure 2 · p. 7
- Analysis tools include about 100 vegetation and soil indices, red-edge feature extraction methods, user-defined indices, and linear spectral unmixing.Examples include NDVI, the cellulose absorption index, Gaussian-fit red-edge inflection points, and red-edge positions from linear extrapolation.Source: §3.2 · pp. 6–7
- hsdar implements the PROSPECT leaf reflectance model and PROSAIL canopy reflectance model, and provides an inverted PROSPECT model to estimate leaf biochemical parameters from hyperspectral data.PROSAIL adds canopy directional reflectance simulation to PROSPECT’s functionality.Source: §3.2 · p. 7
4. Other hyperspectral imaging tools
The paper situates hsdar alongside commercial hyperspectral tools and the R package hyperSpec. The packages complement each other in their application focus and can interoperate through conversion between their object classes.
4. Other hyperspectral imaging tools
- MATLAB’s hyperspectral toolbox includes feature extraction and supervised classification, while ENVI offers image preprocessing such as continuum removal and feature extraction such as the spectral angle mapper.The cited tools provide functionality comparable to hsdar in some areas.Source: §4 · pp. 7–8
- Within R, hsdar focuses on field-condition datasets, especially vegetation and ecosystem remote sensing, while hyperSpec emphasizes plotting and laboratory data such as chemistry or medical research.hsdar interfaces with hyperSpec by converting between Speclib and hyperSpec objects, giving hsdar users access to its import and plotting functions.Source: §4 · p. 8
5. Case studies
The case studies demonstrate hsdar in two settings: estimating grassland chlorophyll from field spectra and examining laryngeal cancer tissue with hyperspectral imaging. They illustrate spectral preprocessing and feature extraction alongside prediction and classification workflows.
5.1. Remote sensing of vegetation: chlorophyll content
- Chlorophyll prediction uses Savitzky-Golay filtering and transformed spectra, with Random Forest trained from spectral and extracted feature predictors.The filter uses a 15 nm length; the example also converts SPAD readings to µg cm−2.Source: §5.1 · pp. 9, 11, 12
- A segmented upper hull ensures two small chlorophyll absorption features are identified; only those at 460 nm and 670 nm are selected, while the 980 nm feature relates to plant water content and biomass.Source: §5.1 · p. 10
- RMSE = 2.49 mg and R2 = 0.95 for Random Forest chlorophyll estimates compared with measured values under repeated cross-validation.The model used mtry = 453.Source: §5.1 · p. 13, Figure 5 · p. 14
5.2. Hyperspectral detection of cancer
- Because larynx measurements are counts sensitive to illumination, normalized ratio indices are used instead of absolute counts as band-pair predictors.The indices are evaluated in separate generalized linear models to avoid collinearity.Source: §5.2 · pp. 14–15
- 93.33% overall accuracy for the support vector machine, versus 90% for the neural network; the authors describe detection as requiring a trained medical expert.The study also notes that its variable-light-source acquisition made counts sensitive to patient movement and illumination geometry.Source: Table 3 · p. 17, §5.2 · pp. 17–18
- For cancer classification, recursive feature elimination excludes highly correlated predictors before support vector machine and neural network models are trained.The two classifiers use repeated 10-fold cross-validation, repeated five times.Source: §5.2 · p. 17
6. Conclusions
hsdar adds environmental hyperspectral analysis tools to R, with case studies demonstrating its use in remote sensing and spatial applications.
6. Conclusions
- hsdar adds hyperspectral processing and univariate and multivariate modeling, including machine learning, to R.It is based on the raster package and gives users control over modeling results.Source: §6 · p. 18
- The package targets environmental analysis, distinguishing its focus from hyperSpec’s laboratory analysis while allowing data conversion between the packages.Both packages extend R with methods for hyperspectral imaging previously available only in commercial software.Source: §6 · p. 18
- hsdar also applies to multispectral satellite data, including Landsat 8 and MODIS, and can calculate indices such as NDVI.The two case studies provide an initial impression of hyperspectral remote sensing applications.Source: §6 · p. 18
Journal of Statistical Software http://www.jstatsoft.org/
The supplied passages contain journal and issue metadata, not substantive research content.
Journal of Statistical Software http://www.jstatsoft.org/
- The passages identify the Journal of Statistical Software, list Volume VV and Issue II, and show placeholder submission and acceptance dates.They also include the journal website.Source: Journal of Statistical Software… · p. 22