Skip to main content

Predicting the quality of ryegrass using hyperspectral imaging



The quality of forage plants is a crucial component of animal performance and a limiting factor in pasture based production systems. Key forage attributes that may require improvement include the sugar, lipid, protein and energy contents of the vegetative parts of these plants. The aim of this study was to evaluate the potential capacity of hyperspectral imaging (HSI) for non-invasive assessment of forage chemical composition. Hyperspectral image data within the visible near-infrared range into the extended near-infrared covering 550–1700 nm wavelengths were obtained from 185 accessions of ryegrass (Lolium perenne), which were also analysed for 13 forage quality attributes.


Medium to high predictive power was observed for the HSI models of total sugars (R2 validation of 0.58), high molecular weight sugars (R2 validation of 0.63), %Ash (R2 validation of 0.50) and %Nitrogen (R2 validation of 0.70). Significant HSI models with low R2 validation of 0.1–0.5 were also obtained for low molecular weight sugars, NDF (%), ADF (%), DOMD (% DM), ME (MJ/kg DM), DM (%), Ca (mg/g) and OM (%). We also observed significant differences in the chemical composition between the pseudostems and leaves of the plants for each accession. The power of HSI for prediction of these differences within plants was also demonstrated.


This study paves the way for the HSI technology to be used for in-field estimation of forage composition attributes in perennial ryegrass. This will allow more rapid genetic-based selection and breeding for a trait that is normally expensive to measure providing a cheaper, non-destructive and high throughput screening tool.


Genomic selection can be effectively used to increase forage and animal productivity by selecting traits of interest in forages [1]. Among these traits, forage composition is one of the hardest and most costly traits to measure as it requires harvest and manual separation. Another limitation to the measurement of this trait is that the standard method of measuring forage composition requires collection and destruction of the plant material. Therefore, non-invasive technologies from which models can be developed to predict the composition of forage would be highly valuable [2]. A body of research has demonstrated the potential of non-invasive near-infrared spectroscopy (NIRS) based methods (dried and ground samples) to estimate the components of forage [3,4,5,6]. Other non-invasive technologies including Hyperspectral Imaging (HSI) systems [7,8,9,10] have been used to develop predictive models for forage quality and quantity. If accurate prediction models can be developed, such technologies will offer the potential for faster and higher throughput prediction of forage quality attributes and hence streamlining more rapid genomic selection for quality traits.

Near-infrared spectroscopy (NIRS) is based on utilizing the interaction of electromagnetic radiation with matter to detect the characteristic chemical signatures of target materials [2]. NIRS instruments based on single point measurement typically require a multitude of replicate scans of the target object for improved prediction of attributes. NIRS instruments can be used to predict the attributes of heterogeneous materials provided a sufficient number of replicate scans are obtained to account for this heterogeneity [11] although this adds extra time and cost to applications. NIRS has been used in perennial ryegrass to estimate leaf relative water content [12]. HSI instruments, however, are capable of capturing both spectral and spatial information [2]. These features make the technology suitable for automated, rapid and large-scale screening of forage. HSI systems have been used at plot, paddock, farm and catchment scales to determine type of forage as well as the quality of forage [7,8,9,10, 13, 14], although there is less information at the plant scale, which is the scale of interest for plant breeders. The deployment of the HSI technology, like any other technology, for forage analysis is dependent on the time and spatial scales of interest. Furthermore, because model calibrations are dependent on the spatial scale of interest as well as the lighting conditions, care must be taken when transferring calibration equations between spatial scales. This is specifically true when the forage is heterogeneous, and lighting and forage geometry only allow for observation of a subset of the sward in which case, a calibration transfer technique must be employed.

The targeted selection of new forages for optimal animal production and environmental outcomes in pastoral-based systems requires detailed information on forage composition. Information on the temporal (diurnal and seasonal) and spatial (between plants in the field as well as within the sward) variation in the composition of forage is also required to assess the performance of new forages and their interaction with the farm system. Forage quality traits of interest include the contents of total sugars, high molecular weight (HMW) sugars, low molecular weight (LMW) sugars, ash, calcium (Ca) and nitrogen [1, 15]. In addition, more complex and calculated composition traits such as neutral detergent fibre (NDF), acid detergent fibre (ADF), digestible organic matter in dry matter (DOMD), metabolisable energy (ME), and organic matter (OM) are the gold standard traits in forages [1, 15]. The ME content of forage plays the central role in animal growth, maintenance and production. It also provides a measure of production potential, although production is dependent on the other components of the forage as well [15]. NDF is an indication of the digestibility of cellulose, hemicellulose and lignin which comprise the cell wall components of the plant structure. ADF is a measure of the digestibility of the cellulose and lignin components only. The ash in forage consists of mineral elements such as sulphates, chlorides, and phosphates, which provide no energetic value to the animal. DOMD represents the organic matter in dry matter (DM), which is residual dry weight of the forage after the removal of moisture. The water soluble carbohydrate (WSC) includes mono- and di-saccharides, oligosaccharides and fructans (LMW and HMW sugars). Water soluble carbohydrates are the most digestible components of ryegrass and play an important role in the complex process of ruminant digestion [16]. Water soluble carbohydrates also provide a primary substrate for ruminal microbiota to breakdown of plant protein, which then becomes available for animal growth and maintenance. High WSC forage also potentially increases milk production of dairy cows while reducing the excretion of urinary nitrogen. The latter is a significant environmental problem in pastoral-based agricultural systems [16]. The concentration of the soluble sugars within ryegrass also exhibits a diurnal pattern that is seasonally dependent on the time course of photosynthesis [17,18,19,20]. Reducing the nitrogen content of forage also provides another strategy to reduce the nitrogen intake of the animal and therefore reduce urinary nitrogen levels and nitrogen losses from pasture [21,22,23].

The purpose of this study is to develop and test HSI models to predict the chemical composition of different genotypes of perennial ryegrass. Another goal is to examine the differences in the chemical composition of the leaves and pseudostems of the plants. The role of different wavelengths in the detection of different forage quality traits was investigated. Also, the likely predictive power of different wave ranges of very near-infrared (VNIR) and extended NIR was explored. An examination of the utility of a range of chemometric methods to predict the chemical composition of ryegrass forage was also conducted.


Raw HSI images of forage blades and pseudostems are shown in Fig. 1a, b respectively. The forage heat map at 1080 nm is shown in Fig. 1c for the blades image in Fig. 1a. The region of interest (ROI) for the blades image in Fig. 1a is shown in Fig. 1d. The distribution in mean forage reflectance spectra in the ROI across all 37 genotypes is shown in Fig. 2. There is significant variability between genotypes in the mean forage reflectance spectra in the ROI for blades samples (P < 0.001). Reflectance minima are at 1000 nm, 1200 nm and 1450 nm and are consistent with water absorbance bands and forage reflectance spectra obtained from dried and milled samples [3].

Fig. 1
figure 1

a Raw HSI image (320 pixels per line by 400 lines per image) of the ryegrass blades (at 558, 740 and 937 nm wavelengths). The image was captured directly above the plant. b Raw HSI image of forage of the ryegrass pseudostems after harvesting the top half of the plant (at 558, 740 and 937 nm wavelengths). The image was captured directly above the plant. c Forage heat map of ryegrass at 1080 nm (red denotes high reflectance and blue denotes low reflectance). d Region of interest (ROI) for the ryegrass (white pixels)

Fig. 2
figure 2

Distribution in mean forage reflectance spectra in the ROI for blades across the 37 ryegrass genotypes

Prediction models were calibrated and validated using the hyperspectral images and the wet chemistry data (partial least squares regression (PLSR) models). Comparisons of the best candidate calibration models for the BL + PS (Fig. 3) and BL datasets are described in Table 1) where model performance was similar for each dataset. The performance of the model for the prediction of total sugars in the BL + PS dataset is shown in Fig. 3a (R2 validation = 0.58, n = 66, LV = 12, RMSE = 34.4 mg/g). Average-high model performance was also observed for the prediction of HMW sugars for the BL + PS dataset (R2 validation = 0.63, n = 66, LV = 12, RMSE = 21.6 mg/g). The model performance for % Nitrogen for the BL + PS dataset is shown in Fig. 3b (R2 = 0.70, n = 64, LV = 20, RMSE = 0.35%). HSI models (R2 validation of 0.1–0.5) are also obtained for Ash (%), NDF (%), ADF (%), DOMD (% DM), ME (MJ/kg DM), DM (%), Ca (mg/g) and OM (%).

Fig. 3
figure 3

a Validated model performance for total sugars expressed as mg/g for the 2016 trial (BL + PS HSI reflectance spectra analysed by PLSR (SNV) model; Validation R2 = 0.58, n = 66, LV = 12, RMSE = 34.4 mg/g, intercept = 10.1 ± 9.6 mg/g, slope = 0.93 ± 0.10, bias = − 3.8 mg/g). b Validated model performance for Nitrogen % for the 2016 trial (BL + PS HSI mean reflectance spectra analyzed by PLSR (SNV) model; Validation R2 = 0.70, RMSE = 0.35%, n = 64)

Table 1 Model performance for the 13 forage attributes based on full spectrum

We also examined the ability of a variety of multivariate methods to predict the forage attributes. Our comparison of the different methods for nitrogen prediction on the BL + PS dataset is summarized in Table 2. Partial least squares regression methods provided the best predictions on the validation dataset. Gaussian process regression and RF methods require larger dataset for training [24] and did not perform as well as PLSR. Support vector machine provided reduced performance compared to PLSR, and would also be expected to improve in performance relative to PLSR with a larger dataset. The various multiple linear regression models provided validation R2 of around 0.6, although the performance of these models would likely decrease on an independent dataset as they less effectively deal with multi-collinear data compared to PLSR based methods.

Table 2 Model performance of HSI models for nitrogen (PS + BL) (%) (ryegrass blades (BL) + pseudostem (PS))

We found that wavelengths in the range 900–1700 nm provided a much better prediction of total sugars than wavelengths in the 550–900 nm wavelength range with a calibration R2 of 0.53 (900–1700 nm) compared to 0.18 (550–900 nm) (Table 3). Conversely, we found that wavelengths in the 550–900 nm and the 900–1700 nm ranges each provided a similar prediction of nitrogen % with a calibration R2 of 0.62 (900–1700 nm) compared to 0.71 (550–900 nm) (Table 3). This highlights that the relative importance of wavelength ranges for the prediction of nitrogen and total sugars is dependent on the attribute. However, total sugars and nitrogen models based on the full wavelength range 550–1700 nm were superior to the respective individual VNIR (550–900 nm) and extended NIR (900–1700 nm) models, which highlights the value of obtaining spectral information over a broad range of wavelengths for accurate prediction of these attributes. Key wavelengths for the prediction of total sugars (based on PLSR(VIP)) are 548–573, 642–750, 1332–1460, 1509–1519, 1558–1627, and 1676–1696 nm. Key wavelengths for the prediction of nitrogen (based on PLSR(VIP)) are 548–582, 637–755, 888–893, 932–937, 1351–1415, and 1514–1696 nm.

Table 3 Model performance over different wavelength ranges

There were differences in the nitrogen, total sugar, LMW and HMW sugar concentration between pseudostems and leaves in the 15 plants with wet chemistry measurements (Fig. 4). The pseudostems had a nitrogen concentration of 2.1 ± 0.35% whereas the blades had a nitrogen concentration of 3.2 ± 0.32% (difference of 1.1 ± 0.13% (P < 0.001)). Higher nitrogen concentrations in the blades are consistent with other studies that observed that the nitrogen concentration in leaves was ~ 50% greater than the stems of 99 day old perennial ryegrass plants [25] and mature ryegrass [26], although this is dependent on season and the time period after harvesting. In contrast, the pseudostems had a larger total sugar concentration of 153 ± 53 mg/g compared to leaves with a concentration of 60 ± 18 mg/g (difference of 93 ± 15 mg/g (P < 0.001)). This difference was associated with a difference (P < 0.001) in the HMW sugars between the pseudostems (75 ± 39 mg/g) and leaves (17 ± 14 mg/g) and a similar difference (P < 0.001) in the LMW sugars between the pseudostems (77 ± 15 mg/g) and leaves (43 ± 7.5 mg/g). LMW sugars are 2.5 times more concentrated in the leaves than the pseudostems compared to HMW sugars. Plants with high concentrations of nitrogen, total sugar, LMW or HMW sugar in the leaves also had corresponding high concentrations of nitrogen, total sugar, LMW or HMW sugar in the pseudostems (R2 = 0.50–0.89; P < 0.01).

Fig. 4
figure 4

a Relationships between the measured sugar concentrations in the pseudostems (PS) and blades (BL) of the 15 ryegrass plants with wet chemistry data. There are positive relationships for measured high molecular weight sugar (HMW) (R2 = 0.89, RMSE = 4.9 mg/g, slope = 0.34 ± 0.03), low molecular weight sugar (LMW) (R2 = 0.50, RMSE = 5.6 mg/g, slope = 0.36 ± 0.10), and total (R2 = 0.84, RMSE = 7.7 mg/g, slope = 0.32 ± 0.04). Total sugar concentration is 100–250 mg/g at the base of the sward (PS) and 40–100 mg/g at the top of the sward (BL). b Relationship between the measured total nitrogen % in the pseudostems (PS) and blades (BL) of 15 ryegrass plants with wet chemistry (R2 = 0.83, RMSE = 0.14%, slope = 0.84 ± 0.11). Nitrogen concentration is 1.5–2.5% at the base of the sward (PS) and 2.5–4% at the top of the sward (BL)

There are significant differences between the mean spectra of PS and BL plants (Fig. 5a). Pseudostems have a characteristic high reflectance at 800–1100 nm (reflectance of 1.1 for PS compared to 0.7 for BL at 1100 nm) and a characteristic low reflectance at 1200–1500 nm respectively (reflectance of -1.2 for PS compared to -0.7 for BL at 1500 nm). The spectra were used to classify the genotypes into PS and BL groups (Fig. 5b). This highlights that the spectral profiles of the pseudostems and leaves of ryegrass plants are different.

Fig. 5
figure 5

a Differences in the mean HSI spectra (SNV) between leaves (blue) and pseudostems (red). b Grouped scatter plot of the first two canonical variables obtained from a one-way multivariate analysis of variance of the PS + BL mean HSI spectra (n = 200). The first canonical variable provides a clear separation between ryegrass genotypes with blades (black crosses) and pseudostem (red circles)

The HSI predicted distribution in the concentration of nitrogen and total sugars prior to the first cut are shown in Fig. 6a, b respectively for the image in Fig. 1a. These predictions are independent of the lighting gradients inherent with the experimental setup illustrated in Fig. 1a. Nitrogen concentration was predicted to be 1–2.5% at the base of the plant (PS) and 2.5–4% at the top of the plant (BL). The total sugar concentration was 100–250 mg/g at the base of the plant (PS) but only 40–100 mg/g at the top of the plant (BL). These predictions for the spatial distribution of nitrogen and total sugars within the plant are consistent with the significant differences in the wet chemistry measurements of nitrogen and total sugars between the blades and pseudostems (Fig. 4a, b). This highlights the ability of hyperspectral systems to predict not only between plant differences in attributes, but also the variation in these attributes within a single plant.

Fig. 6
figure 6

a The HSI predicted distribution in % nitrogen in the same plant shown in Fig. 1a. White denotes the background and regions with very low reflectance. Nitrogen concentration is 1–2.5% at the base of the sward (PS) and 2.5–4% at the top of the sward (BL). b The HSI predicted distribution in the total concentration of sugars (mg/g) in the same plant shown in Fig. 1a. White denotes the background and regions with very low reflectance. Total sugar concentration is 100–250 mg/g at the base of the sward (PS) and 40–100 mg/g at the top of the sward (BL)


The models developed in this study provide a rapid screening tool for selection of the best genotypes without the need for ongoing wet chemistry measurements. However, our calibration dataset of 120 plants is not large enough to cover a broader range of these traits. Therefore, these prediction models are expected to improve for calibration datasets with a larger number of samples such as the 1000–4000 laboratory analyzed samples in larger studies [9, 27]. Despite this, our models provide accurate, repeatable and rapid prediction of ryegrass quality traits under field conditions. In addition, our predictions of plant chemistry potentially provides a method to classify different plant species that have different chemical composition [28,29,30] (e.g. clover and/or weeds) for mixed sward-based applications such as high/low nitrogen species content and/or nitrogen fertilizer delivery [13, 14].

Hyperspectral data can be used to obtain information on the quality of forage on both spatial and temporal scales [8, 10]. This extra information can be used to parameterize mathematical models of forage growth and their response to environmental and management variables (e.g. climate and grazing) [31]. Hyperspectral data also provide information for testing the underlying assumptions of these mathematical models and revision and improvement of the models accordingly. The amalgamation of hyperspectral data with plant modelling will also allow for in-field assessment of plants and their diurnal and seasonal nutrient flows. These are traits and interactions that are difficult and time-consuming to objectively measure otherwise.

The cross-validation error (RMSE calibration) for NDF (RMSE = 2.53%), soluble sugars (2.89%), DOMD (1.36%) obtained by HSI (550–1700 nm, raw pasture) in this study are smaller or comparable to those obtained by NIRS by Corson et al. [4], for NDF (calibration RMSE = 2.79%), soluble sugars (calibration RMSE = 1.38%), DOMD (calibration RMSE = 3.37%) (1100–2500 nm, 60 °C dried and ground pasture samples). However, the NIRS model developed by Corson et al. [4], was calibrated over a wider range of NDF (17.8–78.0%), soluble sugar (1–25%) and DOMD (55–85%) values. Furthermore, the cross-validation error (RMSE calibration) for ADF (RMSE = 1.39%) and Ash (RMSE = 0.66%) are smaller or comparable to those obtained by NIRS by Pullanagari et al. [32], for ADF (RMSE = 2.13%) and Ash (RMSE = 0.74%) (350–1500 nm for field measured samples over a sample area of 0.25 m2 using the ASD FieldSpec® Pro FR spectroradiometer), although our samples are not calibrated over as wide an attribute range.

Our current models were based on 550–1700 nm waveband range and are likely to be less informative than models calibrated over a broader range of wavelengths (350–2500 nm) [3, 7, 32]. We found that wavelengths in the extended NIR range 900–1700 nm provided a much better prediction of total sugars than wavelengths in the visible near-infrared 550–900 nm wavelength range. However, the two ranges provided a similar prediction of % nitrogen. This indicates that low cost visible near-infrared 400–1000 nm devices [24] are likely to provide satisfactory predictions of nitrogen but are likely to provide poorer prediction of the concentration of sugar in forage.

Differences in the nitrogen, total sugar, LMW and HMW sugar concentration between pseudostems and leaves of the same genotypes and even individual plants show the imbalanced distribution of these components in perennial ryegrass. The significantly higher nitrogen concentration in leaves than in the pseudostems was consistent with other studies [25]. The very high sugar concentration in pseudostems compared to the leaves was also consistent with previous studies using destructive methods, although this was dependent on the ryegrass cultivar, plant age and time of day [20, 26, 33]. We also used our model calibrations to predict the distributions in the concentrations of nitrogen and sugar within an individual plant at an individual pixel scale (sub leaf scale). Our predictions in the spatial distribution in nitrogen and total sugars within the plant were consistent with the measured differences in nitrogen and total sugars between stems and leaves in studies using destructive measures [20, 25, 26, 33]. This highlights the potential for hyperspectral imaging to predict the concentration and distribution of the components within an individual plant and the opportunity to conduct non-destructive and continuous experiments on the changes in the nutrient distribution within ryegrass plants.

The high positive correlation of nitrogen, total sugar, LMW or HMW sugar in the leaves with those in the pseudostems indicates that models calibrated to material from the upper zones of the plant will provide biased predictions of the average concentration of these components within the entire plant. The partitioning of sugar is consistent with previous studies of the distribution of sugars within ryegrass that found that the concentration of total sugar in the pseudostem was more than twice that in the leaf, although dependent on the cultivar, plant age and time of day [20, 26, 33]. However, the whole plant predictions of these traits will be correlated with the actual concentrations of these traits. The slope, intercept and error variance for this relationship, however, will depend on the ryegrass cultivar, plant age, time of day and plant structure. This highlights that bias and error can be introduced when extrapolating model predictions to regions of forage that have not been subject to hyperspectral calibration analysis. The identification of the differences in the spectral signatures of the pseudostems and leaves can be used to define the region of interest in an image for trait prediction (e.g. only in the leaves). It can also be used for spectral un-mixing procedures for forage imaged at greater distances from the ground [34].

Although the same approach and procedures can be used for other species of grasses, there will be species-specific challenges as the shape, shading and leaf overlap will vary across species. Furthermore, each species has its own chemical variation in different organs or sections of the plant. Therefore, species-specific models may be required for more accurate prediction of traits of interest.


This study examines the utility of Hyperspectral Imaging (HSI) based methods for non-invasive assessment of the composition of ryegrass. The quality of forage is an important component of animal performance and environmental impact in pasture based production systems. Hyperspectral image data (550–1700 nm) were obtained from 185 individual ryegrass (Lolium perenne) plants that were also assessed for 13 forage quality attributes including nitrogen and sugar content. We used this data to develop models to predict these quality attributes of ryegrass and these provide for more accurate, repeatable and rapid prediction of ryegrass quality attributes under field conditions. We also examined ten different chemometric methods for predicting the forage attributes and established that partial least squares regression models performed favorably for the size of our calibration dataset. We also examined the relative importance of different wavelengths for the prediction of the different quality attributes and these can be used to make informed decisions about suitable sensors for field deployment of spectral systems. We also observed significant differences in the concentrations of nitrogen and sugars between the pseudostems and leaves of the plants and demonstrated the ability for hyperspectral systems to predict these differences within the plant. The use of hyperspectral systems will allow for more rapid genetic selection of desirable ryegrass attributes and provides an in-field tool to investigate the interactions between forage genetics, animal production and environmental outcomes in pastoral-based agricultural systems.


Plant material

Thirty-seven wild accessions and cultivars of perennial ryegrass (Lolium perenne L.) plants were clonally replicated (n = 5) and grown in individual pots in a fully-randomised complete block (n = 185 plants in total), outdoors at the AgResearch Grasslands campus in Palmerston North, New Zealand (40.3804°S, 175.6138°E). Plant seeds originated from different European countries, NZ and Australia. Clones were produced by dividing one plant into five 5-tiller plants and potted in prepared soil mix with slow release Osmocote. Plants were kept outside but under overhead irrigation so that the plants did not dry out during periods with no rain. Plants were 3 months old when harvested. For each plant, total leaf material was harvested, within 1 min after hyperspectral scanning, by cutting at 4 cm above the soil surface. Leaf material was immediately snap-frozen in liquid nitrogen. For a subset of three genotypes × 5 clonal replicates (n = 15 plants), pseudostems (PS) and upper leaf blades (BL) were scanned and harvested separately. All samples were held at − 80 °C prior to freeze-drying. Freeze-dried material was milled and subsequently analysed by wet chemistry. The ratio of leaf blade: pseudostem was also recorded for each plant.

Wet chemistry

The low molecular weight (LMW), high molecular weight (HMW) and total sugars for each plant were measured via water soluble carbohydrate (WSC) analysis and expressed as mg/g (mean of 3 replicates). Ash (%), nitrogen (%), neutral detergent fibre (NDF; %), acid detergent fibre (ADF; %), DOMD (% DM), ME (MJ/kg DM), DM (%), Ca (mg/g) and OM (%) were also measured for each plant. This provided a data set of 185 samples for leaf blades or lamina and an additional 15 samples for pseudostems.

WSC were determined by liquid/gas chromatography–mass spectrometry based technique [35]. Dry matter and Ash/OM were determined by AOAC 930.15/925.10/942.05. For Ash determination the sample was ignited at 500 °C to burn off all organic material. The inorganic material not volatilized at this temperature is the ash. For dry matter determination the moisture of the sample was removed by volatilization caused by heating at 105 °C for 16 h. The amount of material left after the removal of the moisture was defined as the dry matter. Total Nitrogen was determined by Leco CN analyzer, AOAC 968.06 [36]. The sample was weighed into tin foil capsule, loaded into the furnace and combusted in a stream of oxygen. The products of combustion were then passed through a secondary furnace for further oxidation and particulate removal. The moisture free gases were then swept through a heated copper catalyst under helium flow to remove oxygen and convert NOx to N2, and the nitrogen content was determined with a thermal conductivity cell. The crude protein content of the sample was obtained by multiplying total nitrogen content by 6.25. Calcium was determined by preparation AOAC 968.08D followed by colourimetric analysis. The estimation of DOMD followed the method of Roughan and Holland [37]. NDF/ADF were determined by Ankom. Metabolizable Energy (ME) was determined by calculation.

Hyperspectral imaging

The Hyperspectral Line Scanning Imaging System (Hyperspec® Extended VNIR, Headwall Photonics, Fitchburg, MA, USA) with 235 wavebands captured between 550 and 1700 nm for each of 320 pixels in a line and 400 lines per image was used to capture spectra from the samples. Hyperspectral images were captured before and after harvesting the top half of the plant (BL and PS images respectively). A 50 mm lens with a focal length of 25 mm, pixel pitch of 30 µm and an f-stop of 2.8 were used for imaging all samples. A moving stage system was used at a speed of 11.1 mm/s and with an image write speed of 25 frames per second. The spatial resolution was calculated by the Hyperspec™ software and the HSI camera exposure setting was fixed at 28 ms. A single line beam halogen light source (30o angle of incidence from vertical, 400 W) was used to illuminate samples and all 185 plants were scanned. Measurements were undertaken on the 22nd of March 2016 in a dark room at the AgResearch Grasslands site, Palmerston North, New Zealand. A total of 452 images were collected with either two or three images per plant from directly above depending on the quality of image capture and the general morphology of each plant. White and dark reference samples were collected for each image with a 200 mm × 50 mm Spectralon white reference tile and the lens cap on respectively. The reflectance (R) of each pixel/sample was calculated using these white (W) and dark (D) reference samples according to the equation

$$R = \frac{I - D}{W - D}$$

where the calibrated image reflectance is obtained from the raw image irradiance (I) and the dark and white reference images.


Approximately 128,000 spectra were collected per hyperspectral image, however, only a portion of these contain information about the sample of interest. An algorithm was developed to automatically segment the images into ryegrass regions of high spectral reflectance. This was defined by the region with R ≥ 0.3 (reflectance at 1080 nm, which was chosen as this wavelength is not much affected by water content), which was representative of the harvested region.

Multivariate analysis of the spectra was conducted using partial least squares regression (PLSR). Partial least squares regression is a widely accepted regression modelling approach that effectively deals with multi-collinear data [38]. Models tested were based on the mean spectrum. The mean spectrum were calculated from 29,228 ± 18,255 HSI pixels, which represents on average 23% of the total number of HSI pixels. Models were based on the average spectrum from the 2–3 replicate images captured per plant. In total, three plants with an average number of pixels less than 5000 were not used in the analysis. Reduced models were also evaluated based on the average of 1, 2 or 3 images captured per plant. Models for visual yield also included the number of pixels as a predictor. Models were developed using two methods: 1) only the blades material (BL) and 2) the blades and pseudostem material (BL + PS).

The predictive models were calibrated and cross-validated using two-thirds of the data set. The calibration data set was used to fit the chemometric models that allow forage composition to be predicted from spectral data obtained from HSI. The remaining one-third of the data set was used for model validation.

Standard normal variate (SNV) pre-processing methods were applied to the mean spectral data [39]. The number of latent variables for PLSR was identified using tenfold cross-validation (CV) with 100 Monte Carlo replicates applied to the calibration data set. Models were built using varying numbers of latent variables (LV) from 1 to 50 and applied to the validation set to generate performance values of R2 and root mean squared error (RMSE) [40]. Based on the regression Ymeasured = a + b × Ypredicted, the validation slope (b), intercept (a) and bias (expected predicted-observed) were also calculated. The optimal number of latent variables is determined by selecting the calibration model with the smallest RMSE (Adjusted Wold’s (AW) R criterion with threshold of unity and 0.99; denoted AW and AW0.99) and results are reported for the AW criteria unless otherwise specified.

Models were also obtained based on Partial Least Squares Regression (PLSR) with wavelength selection according to Competitive Reweighted Adaptive Sampling (CARS) and Variable Importance Projections (VIP), Gaussian Process Regression (GPR), Support Vector Machine (SVM), Random Forest Regression (RF), Multiple Linear Regression (MLR), Stepwise Multiple Regression (SMLR), lasso regularization for linear regression (LASSO) and Robust Multiple Regression (RMLR) [27].

Models were explored using the data over the wavelength ranges 550–900 nm and 900–1700 nm separately to investigate the likely predictive power of different wavelength ranges from visible to extended NIR available in hyperspectral cameras at AgResearch.

Based on the PLSR(VIP) analysis we determined that 558 nm and 740 nm are key wavelengths for both nitrogen and sugars and 937 nm is a key wavelength for nitrogen estimation. The wavelengths 558 nm and 740 nm are also influenced by chlorophyll content. For this reason 558, 740, and 937 nm were selected as wavelengths to visualize the HSI images of forage (Fig. 1).

Multivariate linear regression was also used to investigate the effect of plant material (BL or PS) and plant genotype on the mean HSI spectra [41]. One-way multivariate analysis of variance was also used to compare the multivariate means in the mean HSI spectra data grouped by plant material type (PS, BL). The analysis was based on spectral data from every 2nd wavelength (117 bands). Scatter plots were used to visualize the group separation using the first two canonical variables.

Availability of data and materials

The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.


  1. Chapman DF, Edwards GR, Stewart AV, McEvoy M, O’Donovan M, Waghorn GC. Valuing forages for genetic selection: what traits should we focus on? Anim Prod Sci. 2015;55:868–82.

    Article  Google Scholar 

  2. Li L, Zhang Q, Huang D. A review of imaging techniques for plant phenotyping. Sensors (Basel, Switzerland). 2014;14(11):20078–111.

    Article  Google Scholar 

  3. Dale LM, Fernández Pierna JA, Vermeulen P, Lecler B, Bogdan AD, Păcurar FS, et al. Research on crude protein and digestibility of Arnica montana L. using conventional NIR spectrometry and hyperspectral imaging NIR. J Food Agric Environ. 2012;10(1):391–6.

    CAS  Google Scholar 

  4. Corson DC, Waghorn GC, Ulyatt MJ, Lee J. NIRS: forage analysis and livestock feeding. Proc N Z Grassl Assoc. 1999;61:127–32.

    Google Scholar 

  5. Ramoelo A, Skidmore AK, Cho MA, Mathieu R, Heitkönig IMA, Dudeni-Tlhone N, et al. Non-linear partial least square regression increases the estimation accuracy of grass nitrogen and phosphorus using in situ hyperspectral and environmental data. ISPRS J Photogramm Remote Sens. 2013;82:27–40.

    Article  Google Scholar 

  6. Biewer S, Fricke T, Wachendorf M. Development of canopy reflectance models to predict forage quality of legume-grass mixtures. Crop Sci. 2009;49(5):1917–26.

    Article  Google Scholar 

  7. Pullanagari R, Kereszturi G, Yule I. Integrating airborne hyperspectral, topographic, and soil data for estimating pasture quality using recursive feature elimination with random forest regression. Remote Sens. 2018;10(7):1117.

    Article  Google Scholar 

  8. Suzuki Y, Tanaka K, Kato W, Okamoto H, Kataoka T, Shimada H, et al. Field mapping of chemical composition of forage using hyperspectral imaging in a grass meadow. Grassl Sci. 2008;54(4):179–88.

    Article  CAS  Google Scholar 

  9. Yule I, Pullanagari R, Irwin M, McVeagh P, Kereszturi G, White M, et al. Mapping nutrient concentration in pasture using hyperspectral imaging. J N Z Grassl. 2015;77:47–50.

    Google Scholar 

  10. Beeri O, Phillips R, Hendrickson J, Frank AB, Kronberg S. Estimating forage quantity and quality using aerial hyperspectral imagery for northern mixed-grass prairie. Remote Sens Environ. 2007;110(2):216–25.

    Article  Google Scholar 

  11. Martínez ML, Garrido-Varo A, De Pedro E, Sánchez D. Effect of sample heterogeneity on near infrared meat analysis: the use of the RMS statistic. J Near Infrared Spectrosc. 1998;6:A313–20.

    Article  Google Scholar 

  12. Jiang Y, Liu H, Cline V. Correlations of leaf relative water content, canopy temperature, and spectral reflectance in perennial ryegrass under water deficit conditions. HortScience. 2009;44(2):459–62.

    Article  Google Scholar 

  13. Adão T, Hruška J, Pádua L, Bessa J, Peres E, Morais R, et al. Hyperspectral imaging: a review on UAV-based sensors, data processing and applications for agriculture and forestry. Remote Sens. 2017;9:1110.

    Article  Google Scholar 

  14. Sankaran S, Khot LR, Espinoza CZ, Jarolmasjed S, Sathuvalli VR, Vandemark GJ, et al. Low-altitude, high-resolution aerial imaging systems for row and field crop phenotyping: a review. Eur J Agron. 2015;70:112–23.

    Article  Google Scholar 

  15. Waghorn GC. What is metabolisable energy? Proc N Z Grassl Assoc. 2007;69:153–69.

    Google Scholar 

  16. Pacheco D, Lowe K, Burke JL, Cosgrove GP. Urinary nitrogen excretion from cows at different stage of lactation grazing different ryegrass cultivars during spring or autumn. Proc N Z Soc Anim Prod. 2009;69:196–200.

    Google Scholar 

  17. Souza AD, Sandrin CZ, Moraes MG, Figueiredo-Ribeiro RL. Diurnal variations of non-structural carbohydrates in vegetative tissues of Melinis minutiflora, Echinolaena inflexa and Lolium multiflorum (Poaceae). Braz J Bot. 2005;28:755–63.

    Article  Google Scholar 

  18. Cosgrove GP, Koolaard J, Luo D, Burke JL, Pacheco D. The composition of high sugar ryegrasses. Proc N Z Grassl Assoc. 2009;71:187–93.

    Google Scholar 

  19. Francis SA, Chapman DF, Doyle B, Leury BJ, Egan AR. Non-structural carbohydrate content of a perennial ryegrass cultivar bred for high sugar levels, compared to ‘normal’ perennial ryegrass and white clover. Anim Prod Aust. 2002;24:73–6.

    Google Scholar 

  20. Smith KF, Simpson RJ, Culvenor RA, Humphreys MO, Prud’Homme MP, Oram RN. The effects of ploidy and a phenotype conferring a high water-soluble carbohydrate concentration on carbohydrate accumulation, nutritive value and morphology of perennial ryegrass (Lolium perenne L.). J Agric Sci. 2001;136(1):65–74.

    Article  CAS  Google Scholar 

  21. Shepherd M, Shorten P, Costall D, Macdonald KA. Evaluation of urine excretion from dairy cows under two farm systems using urine sensors. Agr Ecosyst Environ. 2017;236:285–94.

    Article  Google Scholar 

  22. Bryant RH, Welten BG, Costall D, Shorten PR, Edwards GR. Milk yield and urinary-nitrogen excretion of dairy cows grazing forb pasture mixtures designed to reduce nitrogen leaching. Livest Sci. 2018;209:46–53.

    Article  Google Scholar 

  23. Shorten PR, Pleasants AB. A stochastic model of urinary nitrogen and water flow in grassland soil in New Zealand. Agr Ecosyst Environ. 2007;120(2):145–52.

    Article  CAS  Google Scholar 

  24. You H, Kim Y, Lee J-H, Jang B-J, Choi S. Food powder classification using a portable visible-near-infrared spectrometer. J Electromagn Eng Sci. 2017;17(4):186–90.

    Article  Google Scholar 

  25. Gislum R, Griffith SM. Tiller production and development in perennial ryegrass in relation to nitrogen use. J Plant Nutr. 2005;27(12):2135–48.

    Article  Google Scholar 

  26. Hoekstra NJ, Struik PC, Lantinga EA, Schulte RPO. Chemical composition of lamina and sheath of Lolium perenne as affected by herbage management. NJAS Wagening J Life Sci. 2007;55(1):55–73.

    Article  Google Scholar 

  27. Craigie CR, Johnson PL, Shorten PR, Charterise A, Maclennan G, Tate ML, et al. Application of Hyperspectral imaging to predict the pH, intramuscular fatty acid content and composition of lamb M. longissimus lumborum at 24 h post mortem. Meat Sci. 2017;132:19–28.

    Article  CAS  PubMed  Google Scholar 

  28. Rattray PV, Joyce JP. Nutritive value of white clover and perennial ryegrass. N Z J Agric Res. 1974;17(4):401–6.

    Article  Google Scholar 

  29. Harris SL, Clark DA, Auldist MJ, Waugh CD, Laboyrie PG. Optimum white clover content for dairy pasture. Proc N Z Grassl Assoc. 1997;59:29–33.

    Google Scholar 

  30. Nicol AM, Edwards GR. Why is clover better than ryegrass? Proc N Z Soc Anim Prod. 2011;71:71–8.

    Google Scholar 

  31. McCall DG, Bishop-Hurley GJ. A pasture growth model for use in a whole-farm dairy production model. Agric Syst. 2003;76(3):1183–205.

    Article  Google Scholar 

  32. Pullanagari RR, Yule IJ, Tuohy MP, Hedley MJ, Dynes RA, King WM. In-field hyperspectral proximal sensing for estimating quality parameters of mixed pasture. Precis Agric. 2012;13(3):351–69.

    Article  Google Scholar 

  33. Smith KF, Culvenor RA, Humphreys MO, Simpson RJ. Growth and carbon partitioning in perennial ryegrass (Lolium perenne) cultivars selected for high water-soluble carbohydrate concentrations. J Agric Sci. 2002;138(4):375–85 Epub 2002/10/02.

    Article  Google Scholar 

  34. Morison M, Cloutis E, Mann P. Spectral unmixing of multiple lichen species and underlying substrate. Int J Remote Sens. 2014;35(2):478–92.

    Article  Google Scholar 

  35. Subbaraj AK, Huege J, Fraser K, Cao M, Rasmussen S, Faville M, et al. A large-scale metabolomics study to harness chemical diversity and explore biochemical mechanisms in ryegrass. Commun Biol. 2019;2:87.

    Article  PubMed  PubMed Central  Google Scholar 

  36. Dumas JB. Procedes de l’Analyse Organique. Ann Chim Phys. 1831;2(47):198–213.

    Google Scholar 

  37. Roughan PG, Holland R. Predicting in vitro digestibilities of herbages by exhaustive enzymic hydrolysis of cell walls. J Sci Food Agric. 1977;28:1057–64.

    Article  CAS  Google Scholar 

  38. Wold S, Sjöström M, Eriksson L. PLS-regression: a basic tool of chemometrics. Chemometr Intell Lab Syst. 2001;58(2):109–30.

    Article  CAS  Google Scholar 

  39. Barnes RJ, Dhanoa MS, Lister S. Standard normal variate transformation and de-trending of near-infrared diffuse reflectance spectra. Appl Spectrosc. 1989;43(5):772–7.

    Article  CAS  Google Scholar 

  40. Cheng JH, Sun DW. Recent applications of spectroscopic and hyperspectral imaging techniques with chemometric analysis for rapid inspection of microbial spoilage in muscle foods. Compr Rev Food Sci Food Saf. 2015;14(4):478–90.

    Article  CAS  Google Scholar 

  41. Rencher AC. Methods of multivariate analysis. 2nd ed. New York, NY: Wiley; 2002.

    Book  Google Scholar 

Download references


The authors acknowledge the information provided by Marty Faville, technical support provided by Anna Larking and advice provided by Brent Barrett.


This research was funded by AgResearch Limited.

Author information

Authors and Affiliations



The experiment was designed by K.G. and S.R.L. J.S. grew, maintained, harvested and delivered the plant material. The hyperspectral experiment and imaging was conducted by S.R.L. The hyperspectral image processing was performed by P.R.S. Models, software, visualization and data analysis were developed by P.R.S. The original draft manuscript was prepared by P.R.S. and this was reviewed and edited by S.R.L., P.R.S., J.S. and K.G. K.G. provided project management and acquired the project funding. All authors read and approved the final manuscript.

Corresponding author

Correspondence to Paul R. Shorten.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The authors declare that they have no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Shorten, P.R., Leath, S.R., Schmidt, J. et al. Predicting the quality of ryegrass using hyperspectral imaging. Plant Methods 15, 63 (2019).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: