Computer Vision in Viticulture

Thank you to the Pennsylvania Liquor Control Board for supporting our efforts to make computer vision available to grape growers in Pennsylvania and beyond.

Note that computer vision is still in its infancy – especially in viticulture. Please use the resources provided in this guide with a grain of salt. Use common sense and always be sure to validate any data you collect by checking the accuracy of its results.

If you find yourself on these pages, it most likely means you want to use images and videos in your vineyard to automate the process of identifying and counting things. What things? That’s up to you! This guide includes instructions for both leveraging models we trained to count early-stage grape clusters as well as ways that you can train and deploy your own custom models.

The following documents aim to arm you with the tools necessary to explore potential uses of computer vision on your vineyard. While computer vision is complex and nuanced, our hope is that these resources are as straightforward and easy-to-follow as possible. We consider these to be working documents and will update them as we receive feedback and generate new vineyard models. Please do not hesitate to reach out with any questions or ideas you may have. We look forward to seeing what you build!

Common Types of Computer Vision

There are many flavors of computer vision with new techniques emerging regularly. In this guide, we are going to focus on two common kinds of computer vision: Image classification and object detection.

Image Classification

When we want a computer program to tell us what an entire image represents, we call this image classification. For example, we could train a computer vision model that can classify images of cats vs dogs. When we show the model an image of a beagle, it would be able to understand that the image was of a dog.

In viticulture, we might train a model that can recognize common pests or diseases. Users of this model could snap an image of an insect or an infected leaf and the model would classify the image as being something like ‘spotted lanternfly’ or ‘powdery mildew’.

Object Detection

Object detection models go further than image classification in that they can identify multiple objects within an image. For instance, a model might be trained to detect different kinds of coins on a tabletop. With this model, we could quickly identify how many quarters, nickels, pennies, etc. are within the image. With a little programming, we could even assign monetary values to each object classification and add up the value of the coins on the table.

In viticulture, we might train a model that can quickly detect visible flower clusters and count them for us. As part of this project we trained several such models that are freely available for you to use by following the guides within these pages.

How This Guide is Structured

In this guide we will be focusing primarily on the creation and deployment of object detection computer vision models using freely available tools. We split this guide into two sections: 1.) ready-to-use models for early-stage flower cluster object detection, and 2.) tools for creating your own custom models.

Feel free to jump around this guide to find the resources that are most relevant to you.