On-the-Go Mapping of Grape Composition in the Field Through Hyperspectral Machine Vision. AVF Project #2022-2607.
Summary of Final Report:
This project aimed to develop a non-invasive, real-time method for assessing grape composition in vineyards using hyperspectral imaging technology. This innovative approach helps viticulturists monitor grape quality and make informed decisions about vineyard management and harvesting.
After preliminary work in a varietal collection in the Fresno State vineyard in 2021, we conducted a final study in a Merlot vineyard in Madera, California, in 2022. In this study 160 vines were sampled multiple times throughout the growing season. The UTV used for this research was customized to elevate the vine canopy and expose the grapes, allowing the hyperspectral cameras to capture detailed images. These cameras operated in the visible to shortwave infrared (VIS/SWIR) spectrum, covering wavelengths from 900 to 1700 nm. The cameras were equipped with GPS systems for precise georeferencing and halogen lights for night imaging.
The captured images were processed using a specific vegetation index thresholding method to segment the grape signals from the background and vine leaves. This segmentation was crucial for isolating the spectral data related to the grapes. The study collected approximately 650 grape samples, which were analyzed in the laboratory to determine their chemical composition, including Brix (sugar content), pH, titrable acidity (TA), and anthocyanin profiles.
We employed four machine learning models—Extra Tree Regressor (ETR), Random Forest (RF), Gradient Boosting (GB), and Extreme Gradient Boosting (XGBoost)—to predict grape composition from the spectral data. The models’ performance was evaluated using 10-fold cross- validation, which helps ensure robustness and accuracy. Among the models, the Extra Tree Regressor performed the best, with R² values of 0.91 for Brix, 0.90 for pH, 0.85 for TA, and 0.91 for anthocyanins. These high R² values indicate that the models could accurately predict the grape composition based on the spectral data.
Feature importance analysis using recursive feature elimination identified the most informative spectral bands for predicting grape composition. Using these key bands, we retrained the models, which maintained high predictive performance while reducing data complexity.
Spatial prediction maps were generated to visualize the variability of grape composition across the vineyard. These maps showed how different grape composition parameters, such as Brix, pH, and anthocyanin levels, varied spatially and temporally within the vineyard. Such detailed mapping allows viticulturists to identify areas within the vineyard that require different management practices, optimizing resource use and improving grape quality.
The project demonstrated that hyperspectral imaging combined with machine learning provides a powerful tool for precision viticulture. This approach enables real-time, non-destructive monitoring of grape composition, offering significant advantages over traditional methods, which are labor-intensive, time-consuming, and invasive. The successful deployment of this technology could revolutionize vineyard management, leading to better-quality grapes and wine, more efficient use of resources, and ultimately higher profitability for growers.
Future research will focus on generalizing the predictive models to other grape varieties and vineyard conditions. The goal is to develop robust, adaptable models that can be used in diverse viticultural settings. Additionally, integrating this technology with automated vineyard management systems, such as drones or robotic harvesters, could further enhance its practical applications, paving the way for smarter, more efficient vineyard operations.

