Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.A rainbow in every pixel
An ordinary camera measures three colours per pixel. A multispectral satellite measures about ten, and a hyperspectral one measures hundreds of narrow colours, so each pixel becomes a detailed spectrum. Many materials have fingerprints: dips at precise wavelengths where they absorb light. Two clay minerals that look identical to the eye, or in ten broad bands, can differ in a dip only 40 nm wide. Pixels are also often mixtures, part leaf and part soil, so a key task is to work out how much of each material a pixel contains. The demo mixes three materials and shows the resulting spectrum.
Hyperspectral data map minerals for exploration, methane and dust sources (EMIT on the ISS), crop stress and water quality, and the same analysis runs on lab and drone spectrometers.
- 1. A hyperspectral sensor records…
- 2. Materials can be identified by…
- 3. Spectral unmixing estimates…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Instruments, libraries and the mixing model
- Airborne: AVIRIS (JPL, flying since 1987; 224 channels, 400–2500 nm, about 10 nm wide) and AVIRIS-NG (about 5 nm).
- Spaceborne: Hyperion on EO-1 (2000–2017, 220 bands, 30 m), PRISMA (ASI, 2019, about 240 bands, 30 m), EnMAP (DLR, 2022, over 200 bands from 420 to 2450 nm, 30 m), EMIT on the ISS (NASA, 2022, 60 m; minerals and methane plumes). Copernicus CHIME and NASA’s SBG are planned.
- Image cube: rows × columns × bands. Bands around 1400 and 1900 nm, where atmospheric water absorbs almost everything, are usually dropped.
- Spectral libraries: USGS splib07 and ECOSTRESS hold laboratory spectra of minerals, vegetation and man-made materials. Kaolinite shows an Al-OH doublet near 2165 and 2205 nm, montmorillonite a single feature near 2205 nm and calcite a carbonate feature near 2340 nm.
- Spectral angle mapper (SAM) (Kruse et al. 1993): the angle between a pixel spectrum and a reference, independent of brightness.
- Linear mixing model: x = E a + n, with abundances a ≥ 0 summing to 1. Solved by least squares (LS), sum-to-one constrained LS (SCLS) or fully constrained LS (FCLS, Heinz and Chang 2001).
- Endmember extraction: pure pixels sit at the vertices of the data simplex: PPI (Boardman et al. 1995), N-FINDR (Winter 1999), VCA (Nascimento and Bioucas-Dias 2005), ATGP (Ren and Chang 2003).
- Dimensionality reduction: PCA, and MNF (Green et al. 1988), which orders components by signal-to-noise ratio instead of variance.
- Classification: SVMs and random forests on spectra; 3-D CNNs and spectral transformers on spectral–spatial patches. Classic benchmarks: Indian Pines (AVIRIS, 145 × 145 pixels), Pavia University (ROSIS, 103 bands) and Salinas.
- 1. SAM is insensitive to…
- 2. Fully constrained unmixing enforces…
- 3. MNF orders components by…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Working with image cubes
Exercise 1.
- The spectral angle between pixels and a reference.
- Unconstrained, sum-to-one and fully constrained least-squares unmixing.
Practice.
- Work in surface reflectance (G5-6) and drop the water-absorption and noisy edge bands before anything else.
- Look at the noise: MNF or PCA eigenimages show stripes and bad detectors; denoise or drop them.
- Estimate the number of endmembers (HySime, virtual dimensionality) instead of guessing; extract them with VCA or N-FINDR and check them against a library.
- Unmix with FCLS for physically meaningful fractions; inspect residual images for missing endmembers.
- For classification with few labels, beware the Hughes phenomenon: reduce dimension or use spectral–spatial models with strong regularisation; split train and test spatially, not by random pixels.
import numpy as np, spectral # Spectral Python (SPy)
img = spectral.open_image("enmap_l2a.hdr").load() # rows × cols × bands, reflectance
good = np.r_[0:120, 135:170, 190:224] # drop water-vapour bands (sensor-specific)
X = img[:, :, good].reshape(-1, len(good))
lib = spectral.envi.open("usgs_splib07.hdr") # reference spectra, resampled to the sensor
angles = spectral.spectral_angles(img[:, :, good], lib.spectra[:, good]) # SAM against every library entry
best = angles.argmin(2)- 1. Before analysis, drop bands near…
- 2. Train/test splits for hyperspectral classification should be…
- 3. A residual image after unmixing reveals…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Geometry of mixing. If every pixel is a convex combination of p endmembers, the noise-free data lie in a (p − 1)-dimensional simplex whose vertices are the pure spectra. That is why PCA on mixtures needs only p − 1 components (one is used up by the sum-to-one constraint), and why endmember extraction looks for extreme pixels: the largest projections (PPI), the largest simplex volume (N-FINDR) or the largest residual orthogonal to what has already been found (ATGP, VCA).
Constrained least squares. Unconstrained LS gives â = (EᵀE)⁻¹Eᵀx. Its error covariance is σ²(EᵀE)⁻¹, so similar endmembers (a badly conditioned E) amplify noise. The sum-to-one constraint, added with a Lagrange multiplier, subtracts (EᵀE)⁻¹1 (1ᵀâ − 1)/(1ᵀ(EᵀE)⁻¹1). Non-negativity makes it a quadratic programme: active-set methods, or for few endmembers trying every subset, as in the exercise.
Why bands matter. With 6 bands and 4 endmembers that include two similar clays, E is nearly rank-deficient (condition number 701 against 76 with 211 bands), and the clays’ difference lies in a narrow doublet averaged away inside one broad band. Constraints keep the estimate inside the simplex but cannot create information that was never measured.
Hughes phenomenon. With a fixed number of training samples, classifier accuracy first rises and then falls as the number of bands grows, because the number of parameters to estimate outgrows the data (Hughes 1968).
- 1. Noise-free mixtures of p endmembers span…
- 2. LS abundance error grows when endmembers are…
- 3. The Hughes phenomenon is about…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.What do hundreds of narrow bands buy over a handful of broad ones?
History.
- G. F. Hughes, “On the mean accuracy of statistical pattern recognizers” (1968).
- A. F. H. Goetz, G. Vane, J. E. Solomon and B. N. Rock, “Imaging spectrometry for Earth remote sensing” (1985).
- F. A. Kruse et al., “The spectral image processing system (SIPS)” (1993), introducing SAM.
- D. C. Heinz and C.-I Chang, “Fully constrained least squares linear spectral mixture analysis” (2001).
- J. M. Bioucas-Dias et al., “Hyperspectral unmixing overview” (2012).
Exercise 2. Illustrative library of four spectra (vegetation, soil, a kaolinite-like clay with a 2165/2205 nm doublet and a montmorillonite-like clay with a single 2205 nm feature), 400–2500 nm at 10 nm (211 bands), noise 0.005.
- Band sets: all 211 bands, or 6 boxcar bands approximating Sentinel-2 B2, B3, B4, B8, B11 and B12.
- (a) Identification: 1500 pure clay pixels with brightness varying ±30%, labelled by the smaller spectral angle.
- (b) Unmixing: 1500 mixtures with Dirichlet(1, 1, 1, 1) abundances, unmixed by LS, SCLS and FCLS; and a 3-endmember model with one average clay for the total clay fraction.
| measure | 211 bands | 6 bands |
|---|---|---|
| clay identification accuracy (SAM) | 1.000 | 0.739 |
| abundance RMSE, LS | 0.0146 | 0.8089 |
| abundance RMSE, SCLS | 0.0142 | 0.5127 |
| abundance RMSE, FCLS | 0.0137 | 0.1824 |
| clay abundances only, FCLS | 0.0192 | 0.2575 |
| total clay fraction (3 endmembers), FCLS | 0.0024 | 0.0056 |
| condition number of E | 76 | 701 |
- Narrow features need narrow bands: the hyperspectral spectral angle identified every clay pixel; six bands managed 74%, better than the 50% of guessing but far from reliable.
- Constraints matter when data are scarce: with 211 bands all three methods were within 0.001 of each other, so the constraints added little; with 6 bands they were decisive (0.81 to 0.18), yet the clay split stayed poor.
- Ask the question the data can answer: with 6 bands, merging the clays into one endmember gave the total clay fraction to 0.006.
- Seeds 1 and 2 agreed: multispectral clay accuracy 0.731 and 0.754; hyperspectral FCLS RMSE 0.0140 and 0.0137; multispectral FCLS 0.1860 and 0.1839.
- Caveat: linear mixing with exact endmembers and white noise; real data add nonlinear (intimate) mixing, endmember variability and correlated sensor noise.
Spectral analysis in AI, robotics and aerospace
- Methane and dust: EMIT and PRISMA spectra reveal point-source methane plumes through narrow absorption near 2300 nm; matched filters and neural detectors flag them for follow-up.
- Mining and geology: clay, carbonate and iron-oxide maps guide exploration and monitor mine tailings.
- Agriculture and drones: hyperspectral drone cameras estimate nitrogen and disease stress; deep spectral–spatial networks classify crops.
- Planetary science: CRISM on the Mars Reconnaissance Orbiter mapped clays and sulfates on Mars with the same unmixing tools.
References
- G. F. Hughes (1968). “On the mean accuracy of statistical pattern recognizers.” IEEE Transactions on Information Theory.
- A. F. H. Goetz, G. Vane, J. E. Solomon and B. N. Rock (1985). “Imaging spectrometry for Earth remote sensing.” Science.
- A. A. Green, M. Berman, P. Switzer and M. D. Craig (1988). “A transformation for ordering multispectral data in terms of image quality with implications for noise removal.” IEEE Transactions on Geoscience and Remote Sensing.
- F. A. Kruse et al. (1993). “The spectral image processing system (SIPS): interactive visualization and analysis of imaging spectrometer data.” Remote Sensing of Environment.
- D. C. Heinz and C.-I Chang (2001). “Fully constrained least squares linear spectral mixture analysis method for material quantification in hyperspectral imagery.” IEEE Transactions on Geoscience and Remote Sensing.
- J. M. P. Nascimento and J. M. Bioucas-Dias (2005). “Vertex component analysis: a fast algorithm to unmix hyperspectral data.” IEEE Transactions on Geoscience and Remote Sensing.
- J. M. Bioucas-Dias et al. (2012). “Hyperspectral unmixing overview: geometrical, statistical, and sparse regression-based approaches.” IEEE JSTARS.
- R. F. Kokaly et al. (2017). “USGS spectral library version 7.” USGS Data Series 1035.
- D. Hong et al. (2022). “SpectralFormer: rethinking hyperspectral image classification with transformers.” IEEE Transactions on Geoscience and Remote Sensing.