What is hyperspectral imaging?
An ordinary photograph records three colours. A hyperspectral image records hundreds — and that difference is enough to tell a ripe fruit from an unripe one, a real banknote from a forgery, or one white powder from another.
The basic idea
Every material reflects light differently at different wavelengths. Chlorophyll absorbs red and blue strongly but reflects near-infrared almost completely. Water absorbs in the short-wave infrared. Two plastics that look identically white to you have quite different fingerprints past 1000 nm.
A hyperspectral camera measures that pattern. Instead of one brightness value per pixel, or three, it records a continuous curve of reflectance against wavelength — a spectrum — for every pixel in the scene.
Stack those measurements and you get a datacube: two spatial dimensions, and a third axis running through wavelength. A slice across the cube is an image at one wavelength. A line down through it is the spectrum of a single point.
RGB vs hyperspectral
The clearest way to see the difference is to look at what each sensor actually measures across the spectrum.
| RGB photograph | Hyperspectral image | |
|---|---|---|
| Bands per pixel | 3 | Typically 100–300 |
| Band width | Roughly 100 nm, overlapping | Roughly 2–10 nm, contiguous |
| Wavelength range | Visible only, ~400–700 nm | Often 400–1000 nm, or 1000–2500 nm |
| What a pixel holds | Three numbers | A reflectance spectrum |
| Designed to match | The human eye | The physics of the material |
| Tells apart | Things that look different | Things that look identical |
| Typical file size | A few MB | Hundreds of MB per capture |
| Capture | Instant snapshot | Often a scan taking seconds |
| Cost | Anything from a phone up | Thousands to tens of thousands |
The one-sentence version: an RGB camera is built to reproduce what a scene looks like; a hyperspectral camera is built to measure what a scene is made of.
Where multispectral fits
Multispectral sits between the two. It captures a handful of bands — usually three to fifteen — chosen for particular jobs, with gaps between them. Landsat and most agricultural drone cameras are multispectral.
The practical distinction is not simply band count, it is contiguity. Hyperspectral bands are adjacent, so a pixel yields a continuous curve you can compare against a spectral library or match to a known absorption feature. With separated multispectral bands you get a few sample points, enough to compute an index like NDVI, but not enough to identify an unknown material.
What it is used for
Agriculture
Crop stress, disease and nutrient deficiency show up in the near-infrared days before anything is visible to the eye.
Food quality
Ripeness, sugar content, bruising and foreign objects on production lines, measured without touching the product.
Pharmaceuticals
Checking that tablets contain the right compound, evenly distributed, without destroying the sample.
Recycling
Sorting plastics by polymer type at speed — they are nearly indistinguishable visually but separate cleanly in the SWIR.
Geology and mining
Mapping minerals from aircraft or drill core by their absorption features.
Art conservation
Identifying pigments, spotting restorations and revealing underdrawings without taking a sample.
Medical research
Tissue oxygenation and margin assessment, where blood chemistry changes the spectrum.
Environment
Water quality, algal blooms, oil spills and vegetation mapping over large areas.
Advantages and limitations
Hyperspectral imaging is often presented as strictly better than photography. It is not — it is a different instrument with a different cost, and knowing where it fails matters as much as knowing where it wins.
Advantages
- Identifies materials, not just appearances. Two visually identical samples separate clearly by spectrum.
- Non-destructive and contactless. Nothing is cut, dissolved or consumed, so the same sample can be measured repeatedly.
- Spatial and chemical at once. You learn not only what is present but where, across the whole scene.
- Sees past the visible, where water, protein, fat and polymer bonds have their strongest features.
- Measures every pixel, so rare or small features are not missed by point sampling.
Limitations
- Expensive. Cameras run from thousands to tens of thousands, plus controlled lighting.
- Large files. One capture is routinely hundreds of megabytes, which complicates storage and processing.
- Calibration-dependent. Results need white and dark references and consistent illumination. Change the lighting and the numbers change.
- Slow to capture. Most systems scan line by line, so the subject or the camera has to move.
- Resolution trade-off. Splitting light into hundreds of bands leaves less per band, so spatial detail and signal-to-noise are usually lower than an RGB camera.
- Prone to overfitting. Hundreds of correlated bands with few labelled samples is exactly the setup where a model learns noise. See below.
- Surface only. It measures what light reaches and returns from — generally a thin surface layer, not the inside of an object.
The overfitting trap worth knowing about
This one catches nearly everyone starting out. With 200 bands and 30 labelled samples, a classifier has far more variables than examples, and can achieve perfect accuracy by memorising noise. Add more bands and accuracy on new data eventually gets worse, not better — a result known as the Hughes phenomenon, or the curse of dimensionality.
The usual defences are reducing dimensionality first (PCA or band selection), keeping models small, and above all validating on data the model has never seen — held out by sample, not by pixel. Pixels from one specimen are near-duplicates of each other, so splitting them randomly between training and testing reports an accuracy the model has not earned.
File formats and data size
A cube of 900 × 550 pixels across 300 bands at 16 bits is about 280 MB — for one capture. Datasets run to hundreds of those. Formats you will meet:
- ENVI — a plain-text
.hdrheader beside a binary file (.dat,.raw,.bil,.bip,.bsq). The header carries dimensions, wavelengths and the interleave order. Both files are needed; the binary alone is unreadable. - NPZ — a NumPy archive, common when the data has been through Python.
- MAT — MATLAB, common in published research datasets.
- GeoTIFF — multi-page TIFF, one page per band, usual for airborne and satellite data.
The interleave (BSQ, BIL, BIP) describes
how the cube is laid out on disk: band by band, line by line, or pixel by
pixel. It changes nothing about the data, only what is fast to read.
See a real datacube
HSI Studio opens hyperspectral images in your browser — nothing to install, no account, and your files never leave your machine. Sample datasets are loaded in with one click.
Common questions
Is hyperspectral imaging the same as multispectral?
No. Multispectral captures a few separated bands; hyperspectral captures many contiguous ones. Only the contiguous case gives each pixel a continuous spectrum that can be matched against known material signatures.
Can a normal camera be used for hyperspectral imaging?
Not meaningfully. A standard sensor has three broad filters and an infrared blocking filter, so the information simply is not recorded. Removing the IR filter gives some near-infrared sensitivity, which is useful for basic vegetation work, but it is still three broad bands rather than a spectrum.
How many bands does a hyperspectral image have?
Commonly between 100 and 300, though some instruments exceed 400. Band count alone says little about quality — spectral range, band width, signal-to-noise and calibration matter more.
Why do hyperspectral images look strange in colour?
Because there is no single correct colour for a cube with hundreds of bands. A viewer picks three to display as red, green and blue. Choosing bands near 650, 550 and 450 nm approximates true colour; any other choice is a false colour composite, which may reveal more but is not what the scene looked like.
Do I need machine learning to work with hyperspectral data?
Not always. Plenty of useful work uses band ratios and indices such as NDVI, or comparison against reference spectra. Machine learning helps when the distinction you care about has no simple index — but it needs enough labelled samples to be trustworthy, and honest validation.
What does calibration involve?
Converting raw sensor counts to reflectance, using a white reference of known reflectance and a dark reference taken with the shutter closed. Without it, measurements are specific to that lighting setup on that day and cannot be compared with anything else.