A spectral model is a function that computes a parameter of interest — nitrogen content, moisture, the share of an adulterant — from a reflectance spectrum. The difference between a lab model and a field model isn’t the algorithm, it’s how the data it learned from was collected.
Reference set
The foundation is a set of samples with a lab-analysis result. What matters isn’t the number of measurements but the spread: the set must cover the full range of values the model will later need to predict, including the extremes.
- At least a few dozen samples for every level of material variability.
- Measurements from different locations, seasons, and material batches.
- The same measurement protocol for every reference sample.
A model will never be more accurate than the reference method it learned from.
Preparing the spectra
A raw spectrum contains effects unrelated to the parameter being studied: surface scattering, differences in measurement geometry, detector drift. Preprocessing transforms remove these components before the data reaches the model.
Validation
Cross-validation results on the same set almost always look good. A trustworthy answer only comes from a test set collected independently — at a different time, on a different field, or from a different material batch.
Metrics worth reporting
Root mean square error of prediction (RMSEP), the coefficient of determination, and the range in which the model remains reliable. Without a stated range, the first two numbers say nothing useful.
Maintaining the model
Materials change — new varieties, different growing conditions, new raw-material suppliers. A model needs its reference set replenished periodically, or its accuracy drops without warning.