Automated Wheat Grain and Impurity
Analysis - Using Image Processing and
Machine Learning
Varsha Pillai
Department of Electrical Engineering, IIT Kanpur
varshap@iitk.ac.in
Mentor: Prof.Tushar Sandhan, Department of Electrical Engineering
This project, in collaboration with ITC, aims to automate the quality analysis of wheat
grains using image processing and machine learning. It focuses on detecting surface
creases, identifying impurities, and analyzing how evenly the grains are spread. The
end goal is to build a complete prototype that can classify grains and multiple types of
impurities automatically.
On the hardware side, a prototype box with glass screens and a controlled lighting setup
has been developed. A Raspberry Pi handles image capture and is connected to a screen
with a full graphical user interface (GUI) for easy operation and visualization.
So far, we have used image processing techniques to divide each image into a grid and
measure how densely grains are packed in each area. Based on this, we give suggestions
on which direction to shake the grains to spread them evenly.
We also detect surface creases by rotating each grain, analyzing its center line, and
looking for dips in brightness that indicate a crease.
To improve impurity detection, we tested four backlight colors (white, red, green, and
blue) and found that some colors work better for showing certain types of impurities.
We have completed image segmentation, crease detection, heatmap generation, and initial backlight analysis. The next step is to train a machine learning model that can fully
classify all impurities and grains.
Keywords: Wheat Grain Analysis, Impurity Detection, Machine Learning, StarDist
Segmentation
1
Figure 1: Grains with Crease(green),segmented by StarDist
Figure 2: Spread Score Heat Map
2