Hyperspectral Data Processing & AI

Home / Hyperspectral Hub / Data processing
Data & analytics

Hyperspectral data processing & AI

Turning gigabytes of spectra into a reliable decision: calibration, preprocessing, chemometrics, machine learning, validation and real-time deployment.

ReliabledecisionsCalibratePre-processModelValidate
Workflow

From raw counts to classified images

1Raw cubeDigital numbers fromthe detector2ReflectanceDark and whitereference correction3Pre-processSNV, MSC,derivatives,smoothing4ModelPLS-DA, SVM, RF, CNN5DeployReal-timeclassification onthe line
Step 1

Calibration: get to reflectance

Raw sensor output depends on the light source, exposure and detector. Converting to reflectance makes data comparable:

R = (Isample − Idark) / (Iwhite − Idark)

Idark: shutter closed. Iwhite: a calibrated diffuse reflectance standard. In the field, an empirical line method with ground targets is common. A 2025 Remote Sensing study found manufacturer calibration of UAS sensors benefited from it.

  • Take dark and white references at the start of each session, and when temperature or lighting changes
  • Keep the white reference at the same distance and geometry as the sample
  • Radiometric calibration (to radiance) is provided at the factory on Headwall imagers
  • Industrial HELIOS cameras keep factory calibration stable across shifts
Step 2

Preprocessing: remove what isn’t chemistry

Rinnan et al. (2009) reviewed the most common preprocessing methods for NIR spectra. Most remove physical effects such as scattering, particle size and distance, leaving the chemical signal.

MethodWhat it correctsWhen to use
SNV (standard normal variate)Multiplicative scatter, path-length differencesPowders, grains, rough surfaces
MSC (multiplicative scatter correction)Scatter relative to a mean spectrumSimilar to SNV, needs a representative mean
Savitzky–Golay derivativesBaseline offsets and slopes. Sharpens overlapping bandsMost NIR/SWIR models
Smoothing / binningNoise; reduces band countLow-light or high-speed acquisition
Masking / segmentationBackground, conveyor, shadowsAlways, before modelling objects
Step 3

Modelling: from chemometrics to deep learning

Unsupervised

PCA, clustering and k-means show natural groupings and outliers, and help you understand the data before labelling it.

Classification

PLS-DA, SVM, random forest and neural networks assign each pixel or object to a class: good or bad, material A or B.

Regression

PLS regression and others predict a number per pixel: moisture, fat, sugar (Brix), API concentration.

Deep learning

1D, 2D and 3D CNNs learn spatial and spectral features together. Used increasingly for complex defects, e.g. aflatoxin studies (2025).

Amigo et al. (2015) give a widely cited tutorial on hyperspectral image analysis that covers these steps in depth.

Step 4

Validation: prove it before you trust it

  • Split by sample or batch, never by pixel, to avoid over-optimistic results
  • Test on product from different days, suppliers and seasons
  • Report sensitivity, specificity and confusion matrices, not just accuracy
  • Monitor performance in production and retrain when product changes
Step 5

Real-time deployment

Production lines need decisions in milliseconds. Headwall’s ecosystem covers it: perClass Mira builds models with machine learning and deploys them on live data, SQALAR handles qualitative and quantitative chemometrics, and ALPHA G100/G110 platforms classify HELIOS camera data in real time (G100 supports up to 100 material classes). The HELIOS EQ32 and MV.X classify inside the camera itself.

Evidence

References & further reading

Peer-reviewed sources. Where a study used a specific sensor, it’s noted as reported by the authors.

Methods

#Reference
1Amigo, J.M., Babamoradi, H., Elcoroaristizabal, S. (2015). Hyperspectral image analysis. A tutorial. Analytica Chimica Acta 896:34–51. 10.1016/j.aca.2015.09.030
2Rinnan, Å., van den Berg, F., Engelsen, S.B. (2009). Review of the most common pre-processing techniques for near-infrared spectra. TrAC Trends in Analytical Chemistry 28(10):1201–1222. 10.1016/j.trac.2009.07.007

Example deep-learning applications

#Reference
1Williams, L., Shukla, P., Sheikh-Akbari, A., Mahroughi, S., Mporas, I. (2025). Measuring the level of aflatoxin infection in pistachio nuts by applying machine learning techniques to hyperspectral images. Sensors 25(5):1548. 10.3390/s25051548
2Authors as listed in journal (2022). Detection of aflatoxin B1 in single peanut kernels by combining hyperspectral and microscopic imaging technologies. Sensors 22(13):4864. 10.3390/s22134864
3Authors as listed in journal (2025). Deep learning-based detection of aflatoxin B1 contamination in almonds using hyperspectral imaging: a focus on optimized 3D Inception–ResNet model. Toxins 17(4):156. 10.3390/toxins17040156
Next step

Talk to a Headwall integration partner

As an official Headwall Photonics integration partner, we specify, integrate and support Headwall hyperspectral systems, from lab feasibility to full production lines. Send us samples and we’ll show you what the data can do.

  • Feasibility trials on your samples
  • Headwall sensor selection and integration
  • Real-time classification wired into your line

Start a conversation

Email sales@automateandcontrol.co.uk or call +44 208 1333 585. Send a sample, a photo or a spec, and we’ll take it from there.

Contact our engineersHeadwall product range