Chinese (Simplified)EnglishFrenchItalianPortugueseSpanish

Ocean Optics
Worldwide Headquarters
Largo, Florida, USA

+1 727-733-2447

[email protected]

Sales, Service
& Support Facility
Duiven, The Netherlands

+31 26-319-0500
+33 442-386-588

[email protected]

Ocean Optics GmbH Sales,
Service & Support Facility
Ostfildern, Germany

+49 711-34-16-96-0

[email protected]

Sales Support
for the
United Kingdom

+44 1865-819922

[email protected]

Sales, Service
& Support Facilities
Shanghai, PRC – Beijing, PRC

+86 21-6295-6600

[email protected]


Dynamic Sampling for NIR Food Measurement

Quality Sampling Delivers Quality Results: The Impact of Dynamic Sampling for NIR Measurements

by Henry Langston and Gustavo Caneda, Ocean Optics

NIR reflectance spectroscopy provides a reliable method for measuring food quality. Consumers demand high quality and consistency from their ingredients. For the food industry, monitoring parameters such as moisture, protein and fat content — as well as less directly correlated criteria such as ripeness — is a critical part of managing quality throughout the supply chain. Measurements made with NIR spectroscopy can reduce waste, improve consistency and ultimately help to deliver products that customers want to buy time after time. In this application note, we examine the impact of dynamic sampling on improving the repeatability of NIR reflectance measurements of corn kernels without increasing the total time or frequency of measurements.

A key advantage of NIR spectroscopy for the food industry is that sample preparation is unnecessary. With NIR reflectance spectroscopy, making measurements that are fast (high throughput), non-destructive and non-contact is relatively simple. This is particularly valuable when creating systems that need to be deployed in the field or factory. Modern diode array NIR spectrometers are well suited to such applications as they measure all wavelengths concurrently and have no moving parts, meaning they are very rugged and reliable.

But NIR spectroscopy has its challenges, too. In particular, sample handling is a critical part of the methodology. Dynamic sampling is a technique where rotational or linear motion is used as a way to remove variance from the results through more representative sampling. It is a simple yet powerful method to improve the repeatability and accuracy of reflectance measurements. This applies equally to building NIR calibration models or when deploying NIR systems in the field.

Dynamic Sampling and NIR Reflectance Measurements

Figure 1: A rotating sampling cup is illuminated by axially offset sampling optics. The corn is rotated while the measurement is made. The signal is then integrated over several time periods and averaged, producing a result that is representative of the sample despite shape, size, orientation and local variation of parameter concentration (including fat and moisture) within the kernel.

Figure 1: A rotating sampling cup is illuminated by axially offset sampling optics. The corn is rotated while the measurement is made. The signal is then integrated over several time periods and averaged, producing a result that is representative of the sample despite shape, size, orientation and local variation of parameter concentration (including fat and moisture) within the kernel.

In reflectance spectroscopy, the measured NIR signal is sensitive to many variables outside those of direct investigation. The pathlength between the sampling optics and the sample, the localized temperature (which will affect the signal from water in the sample), the shape of the sample and the homogeneity of the sample at both a macro and micro scale will all have a significant impact.

Figure 1 shows a sample of corn in a rotating sampling cup. If the challenge is to take a representative measurement — i.e., one that reflects the true nature of the sample rather than an outlier result — then one is faced with the following challenges. First, it is impractical to arrange the corn kernels so they are all at a fixed pathlength from the sampling optics, given that they are oddly shaped and of different sizes and orientations. This means incident light will be scattered with both varying intensity and direction.

Also, within each kernel there is a significant variation in the concentration of fats, proteins and carbohydrates. This variation can cause significant error unless precisely the same cross-section is sampled at each measurement (Figure 2).

Figure 1 - Sample of Corn Figure 2 - Corn Kernel Distribution

Figure 2: At left, a sample of corn kernels reveals a highly heterogeneous arrangement. The diagram shows the distribution of components within an individual corn kernel. This highlights the variance in concentration expected when sampling over various parts of the corn.

By slowly rotating the sample beneath the sampling optics, a simple and very practical technique, we can average out much of the variance and produce a considerably more repeatable, representative measurement. This is demonstrated in Figure 3, showing a comparison between measurements taken at seven different points across the corn sample and the same sample measured seven times using the dynamic sampling cup. In both cases the total measurement time was kept the same, with each result being the average of 50 scans at 50 ms integration time (2.5 seconds).

As the graph at left in Figure 3 shows, there is significant variation from measurement to measurement. The most significant difference is in the “magnitude” of the signal, with each measurement appearing to be reflected with a similar shape but different absolute signal, creating a scaling effect. This tends to be dominated by variation in the sampling pathlength and scattering of the incident and reflected light. With closer examination, one can see differences in the relative signal and slope indicating that there is a variation in the constituent absorbing components such as fats, protein and moisture.

The graph at right in Figure 3 shows the same corn sample measured using dynamic sampling. There is much less variation in the result as the rotation of the sample allows for variation to be reliably averaged out of the signal. Here, dynamic sampling greatly enhances the repeatability of the result without increasing the measurement time or number of samples.

Without Dynamic Sampling With Dynamic Sampling
Figure 3a - Corn Sample Measurements without Dynamic Sampling Figure 3 - Corn Measured with Dynamic Sampling Method

Figure 3: Reflectance-absorbance measurements of a single sample of corn demonstrate the differences between single-point averaged measurements (left graph) and dynamic sampling using an Ocean Optics NIRQuest512-1.7 spectrometer and rotating sampling cup accessory.

Dynamic Sampling as a Complementary Technique

A final point on dynamic sampling is that it is not an alternative to preprocessing but is instead a complementary technique. Preprocessing mathematically removes the impact of scattering variance and other complex-coupled variables from the system, leaving only shifts in the spectra from varying concentration of “real” parameters — i.e., those parameters of greatest interest.

Figure 4 compares the preprocessed data shown earlier in Figure 3, applying standard normal variance (SNV) and de-trend algorithms. In the graph at left in Figure 4 we see clear variance in peaks from 1000-1300 nm indicating some variance in protein and fat levels, while the variance in the peak at 1450 nm is related to variation in moisture. We are seeing the variance in concentration between corn kernels and within individual corn kernels.

In the graph at right in Figure 4, where the results from the corn are well matched, we can see the impact of using dynamic sampling to acquire a more representative sample. By rotating the sample as we acquire the spectra we are able to capture a measurement that reliably and repeatedly represents the state of the whole corn sample rather than individual kernels or parts of kernels.

Application of SNV & De-trend to the Collected Data without Dynamic Sampling Application of SNV and De-trend to Data Taken with Dynamic Sampling
Figure 4: Single positions spectra pre-processed with standard normal variance (SNV) and de-trend algorithms. Figure 4: Dynamic spectra pre-processed with standard normal variance (SNV) and de-trend algorithms.
Figure 4: By applying standard normal variance (SNV) and de-trend preprocessing algorithms to NIR measurements of corn kernels, we observe differences between standard sampling of seven single points (at left) and dynamic sampling of the same corn samples.

About Ocean Optics and Farm to Table Applications

Ocean Optics is passionate about applications of spectroscopy from farm to table for the food industry. We develop and manufacture optical sensing solutions using UV-Vis, NIR and Raman techniques for identification of ingredients and contaminants, quality monitoring and process control, and authentication and anti-counterfeiting applications. Applications include monitoring produce for quality and ripeness, analyzing wheat and grains for protein, fat and moisture content, and authenticating spirits and other high value food and agriculture products. Our line of dynamic sampling accessories includes a diffuse reflectance probe and rotating sampling cup.


TecnoCientífica, an Argentina-based provider of spectrophotometric systems for quality and process control, provided expertise and data used in this article. Argentina, Brazil and Mexico are among the world’s leading producers of corn and grains, combining for more than 100 million metric tons in 2014. (Source: Statista)