DOI : https://doi.org/10.5281/zenodo.18389829
- Open Access

- Authors : Mr. Abhinav Kudnar, Mr. Hrushikesh Malshikare, Mr. Rushikesh Palve, Mr. Mayur Sarode, Prof. P.S Vidap
- Paper ID : IJERTV15IS010334
- Volume & Issue : Volume 15, Issue 01 , January – 2026
- DOI : 10.17577/IJERTV15IS010334
- Published (First Online): 27-01-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Automatic Wheat Grain Quality Analyzer
Mr. Abhinav Kudnar
Computer Engineering Pune Institute of Computer Technology Pune, India
Mr. Hrushikesh Malshikare
Computer Engineering Pune Institute of Computer Technology Pune, India
Mr. Rushikesh Palve
Computer Engineering Pune Institute of Computer Technology Pune, India
Mr. Mayur Sarode
Computer Engineering, Pune Institute of Computer Technology Pune, India
Prof. P.S Vidap
Computer Engineering, Pune Institute of Computer Technology Pune, India
Abstract – Manual evaluation of grain quality is time- consuming and subjective, prompting the need for automated solutions. This paper introduces a sophisticated approach to grain quality assessment, leveraging advanced deep learning models that outperform conventional built-in models. These models are designed to effectively capture intricate grain patterns through feature extraction and customized convolutional neural networks, enhancing efficiency and precision.To ensure objective evaluations, a weighted rating system is implemented. This system carefully evaluates predefined categories, assigning weights based on their relative importance. The integration of this weight- ing mechanism improves accuracy and consistency throughout the grain quality assessment process.Automated grain quality assessment reduces subjectivity, enhances quality control, and leverages the capabilities of advanced deep learning models. This research contributes to streamlining the evaluation process in the grain industry, optimizing productivity and ensuring consumer satisfaction.
Index Terms – Machine Vision based Quality Control, Com- puter Vision, Deep Learning, Convolutional Neural Network, InceptionV3, Mobile-Net, Dense-Net, Xception, Wheat-quality
- INTRODUCTION
India is 2nd largest wheat producer in the world, which produces 106M tonnes of wheat yearly. So, the demand for identifying the quality of wheat grains is increased. The objec- tive of this paper is to assess the quality of wheat grains using the Deep learning approach. Model classification of wheat grains into predefined categories will be done using deep learning. By enumerating the number of categorized grains quality assessment will be performed. At procurement centers, manual methods are used to perform quality assessments. If the quality predicted by the manual method is not correct then farmers cannot get the correct price for their wheat. The Indian agricultural field is the major backbone of the Indian economy. With the help of new technologies, there is a need to develop a mobile application for quality prediction of wheat grains which will overcome the drawbacks of manual methods. The objective of this paper is to classify wheat grain into predefined categories such as broken, blacktip, shriveled, etc. We have compared the results from two different Deep-learning models i.e., Inception, and MobileNet, and based on their
accuracy. To increase the accuracy of Deep Learning odels, a hybrid model has been created for the purpose of classification. Image processing techniques are used to generate datasets. There are two key processes, one is to separate the object from the background and another is to separate multiple grains which are adjacent. A typical approach for the first process is to use single colored background and easily separate objects from the background. The segmentation algorithm is used to separate adjacent grains.
- Motivation
India is the largest wheat producer in the world. Physical checking of wheat grains is done by the manual method in most of the procurement centers. However, the task is daunting when it comes to manual testing. Two Disadvantages of manual testing are that it is time-consuming, expensive and objectivity is uncertain. We suggest a technique to automati- cally grade sample grains to help manual evaluators deal with the drawbacks of manual grading.
- Main Contribution
In our research endeavor, we strive to advance the field of CNN by offering a unique and valuable contribution. Our focus is on enhancing the classification performance in resource-constrained settings while maintaining computational efficiency. To achieve this, we propose a hybrid approach that integrates the combined features of Inception and MobileNet, with a specific emphasis on the influential kernels derived from InceptionV3. We conduct rigorous experiments and com- pare the results obtained from two distinct CNN algorithms. Through this comprehensive analysis, we conclusively estab- lish that our hybrid model surpasses its counterparts, delivering exceptional results in terms of both accuracy and efficiency.
- Motivation
- RELATED WORK
Quality detection in the food industry has been a subject of research for a considerable period. Numerous methodologies
have been employed to devise models for detecting food quality. The proposed CNN-based model demonstrates the successful classification of fifteen distinct wheat varieties, achieving an impressive accuracy of 98% on the test set. The model also exhibits a remarkably low loss value of 0.0846, indicating its robust performance. However, it is worth noting that higher-resolution images impose memory constraints and can potentially lead to system slowdowns [1]. The paper presents five deep-learning models for wheat variety classification, all achieving a threshold accuracy of 97%. Among these models, DenseNet outperforms the others with a test accuracy of 95.68%. InceptionV3 follows closely with a test accuracy of 95.62%, while MobileNet achieves a test accuracy of 95.49% [2]. The research paper focuses on image processing techniques such as color space conversion, image rotation, and image flipping for grain analysis. Grains are manually identified and segmented to create training, testing, and validation datasets. Additionally, the counting of grains is performed on various background colors [3]. Quality assess- ment involves measuring grain length, breadth, and diagonal size. The proposed algorithm categorizes grains based on the length and determines quality using average feature values [5]. The paper establishes a correlation between fungi and the textural features of grains. Specifically, it investigates the impact of Fusarium Head Blight (FHB) disease on grain shape and size [6]. This paper works on difficulties in the detection of wheat heads due to different wheat varieties, planting densities, and growth periods of wheat plants in different countries [7]. The paper aims to improve the efficiency and effectiveness of wheat grain classification, which can have significant implications in quality control, sorting, and grading processes in the agriculture and food industries [8]. The paper proposes the use of chemometric methods, which involve the application of statistical and mathematical techniques, to analyze the hyperspectral data and extract relevant features for classification [9]. In summary, the paper highlights the suc- cessful application of soft computing techniques, specifically Neural Networks, for the identification of wheat grain varieties based on their geometric features [10].
- MATERIALS AND METHODS
- Grain Collection
To ensure the relevance and representativeness of the wheat grains used in the study, a total of six categories were collected: Blacktip, Broken, Hole Weeviled, Immature, correct, and plant part. The wheat grains were sourced from local farms, taking into consideration the variability that naturally occurs in real-world conditions.
The inclusion of multiple categories allows for a compre- hensive analysis of different grain characteristics and potential defects. Each category represents a distinct aspect of grain quality, such as physical damage, immaturity, or the presence of plant parts. By including these categories, the study aims to cover a wide range of grain conditions commonly encountered in practical scenarios.
Collecting the wheat grains from local farms ensures that the samples reflect the specific characteristics and variations found in the region under study. This approach enhances the studys applicability and validity, as it captures the local context and conditions that may influence grain quality.
The selection of these specific categories was based on expert knowledge and consultation with agricultural profes- sionals. These categories were deemed relevant and significant in evaluating grain quality and identifying potential issues or defects.
- Image Dataset Collection
- Experimental Setup:
- Background:
A white paper was used as the background for cap- turing the photographs of the wheat grains. The white background provided a neutral and consistent surface against which the grains could be clearly distinguished.
- Lighting:
lighting was utilized to maintain consistent and con- trolled lighting conditions throughout the data collec- tion process. Adequate lighting was ensured to min- imize shadows and achieve optimal visibility of the grains characteristics. The lighting setup was arranged to evenly illuminate the grains and minimize any potential lighting variations across the images.
- Background:
- Image Capture:
Photographs were taken for each category, capturing ten images per category. Each image contained approxi- mately
100 wheat grains. The camera was positioned at a fixed distance of approximately 25 cm from the grains to ensure consistent image acquisition conditions.
- Camera Settings:
The camera settings were adjusted to capture high- resolution images with appropriate exposure levels and accurate color representation. The settings were opti- mized to ensure clear visibility of the grain details, avoiding overexposure or underexposure.
- Image Segmentation:
After capturing the images containing approximately 100 grains, image segmentation techniques were applied to separate and extract individual grains from each image. This step involved using image processing algorithms to identify and isolate individual grains within the larger image.
- Creation of Single Grain Images:
From each segmented image, 100 different images con- taining a single grain were created. This process involved cropping and extracting each individual grain from the segmented image to generate a dataset of single-grain images.
- Dataset Creation:
The collected and segmented single-grain images were compiled and stored as a dataset. Each image was labeled with its corresponding category (Blacktip, Broken, Hole Weevilled, Immature, correct, or plant part). The dataset
contained a total of 600 images, with 100 images per category.
- Data Storage:
The dataset of single-grain images, along with their respective category labels, was stored in a suitable format, ensuring ease of access and retrieval for subsequent analysis and model training.
- Experimental Setup:
- DataSet
Sr. No.
Class Name Images 1 Broken Wheat Grain 2 Black Tip Wheat Grain 3 Hole and Weviiled Tip Wheat Grain
4 Immature Grains 5 Plant Part 6 Inorganic Impurity 7 Correct Variety of Grain which includes Sharbati, Shivor, etc.
TABLE I: Grain Images
- Grain Collection
- EXPERIMENTAL TECHNIQUES/PROPOSED METHODOLOGY
- System Architecture
Fig. 1: System Architecture
- Models and their architecture
Deep learning has revolutionized computer vision and emerged as the dominant approach for various computer vision tasks. Deep learning models have the remarkable ability to automatically learn intricate patterns and representations from vast amounts of visual data, enabling them to excel in tasks such as object recognition, image classification, and image segmentation. Depending on the specific task and the characteristics of the visual data, deep learning models can encompass a wide range of architectures, allowing for powerful and versatile solutions in the field of computer vision.
- Hybrid CNN:
The CNN model is designed for classifying segmented wheat images with a dimension of 220 x 220 pixels. It consists of
12 layers in total, including multiple branches for convolutional operations.
The model begins with a 1×1 convolution branch that applies a convolutional layer with 16 filters and employs the ReLU activation function. Next, a 3×3 convolution branch performs a convolution operation with 16 filters, followed by another convolutional layer with 32 filters using a kernel size of 3×3. Padding is utilized to maintain the spatial dimensions, and the ReLU activation function is applied to enhance non- linearity. Similarly, a 5×5 convolution branch is implemented, applying a convolutional layer with 16 filters and then another convolutional layer with 32 filters using a kernel size of 5×5. Again, padding is used for spatial preservation, and the ReLU activation function is employed.
Padding is used to maintain spatial dimensions, and the max pooling branch performs max pooling with a pool size of 3×3 and a stride of 1×1. After the convolutional branches, the outputs are concatenated, and the concatenated features are passed through additional convolutional and dense layers. The final layer of the model uses the softmax activation function with 6 classes for class probability estimation. The model has
a total of 327,756,742 trainable parameters, representing the weights and biases.
- Preprocessing Module
- Image Loading and Prepossessing:
The module starts by loading an input image using open- source libraries like Open-CV. The image is converted to a grayscale. Adaptive thresholding is performed on the grayscale image. This step helps in segmenting the grains from the background, and the resulting binary image
- Morphological Operations:
This component performs morphological operations, starting with dilating the binary mask. This step helps to join nearby grain regions and fill gaps.
- Displaying and Resizing the Segmented Image:
This section specifies the desired display width and height. It calculates the resize ratio based on the original image dimensions and the desired display dimensions.
- Contour Detection and Bounding Boxes:
This component is used to detect contours in the eroded image. The contours represent the boundaries of the segmented grains. For each contour, the module calcu- lates the bounding rectangle coordinates. The bounding rectangle coordinates (x, y, width, height) are appended to the bounding boxes list. Bounding Boxes are converted to a numpy array.
- Image Loading and Prepossessing:
- Proposed Modules
- Feature Extraction and Grain Classification:
This module focuses on extracting relevant features from the grain images for classification purposes. It employs two approaches: manual feature extraction and automatic feature extraction using Convolutional Neural Networks (CNN). In the manual approach, specific features such as shape, color, texture, and size are manually extracted. In the automatic approach, hybrid CNNs are utilized to au-
tomatically learn and extract discriminative features from
Algorithm 1 An algorithm for getGrainCount
Require: input img
Perform segmentation to segment each image of grains Cntlst < Class, Count > []
while Segmented img count 1 do pred class predict(segmented img) if pred class defined classes then
Cntlst[pred class] Cntlst[pred class] + + else if pred class / defined classes then Reject segmented image
end if
end while
Algorithm 2 An algorithm for getWightedQualityScore
hyper para [w0 w1, w2, w3, w4, w5, w6, w7] Cntlst < Class, Count > getGrainCount()
for each class : Cntlst do
if cntlst[other class] = total grain count then
return 1
else if then
Finalscore 22/7[W0C0 + W1C1 + W2C2 + W3C3 W4C4 + W5C5 + W66 + W7C7]
end if
end for
- Feature Extraction and Grain Classification:
- System Architecture
- MATHEMATICS
The scaling factor is determined by calculating the ratio between the desired range and the current range of the overall quality score. In this case, the desired range is (-10, 10), and the current range is (-4, 3). By dividing the desired range (20) by the current range (7), the scaling factor is approximately 2.857. Multiplying the quality score by this scaling factor stretches or compresses the range to match the desired range while preserving the relative weights and counts.
- EXPERIMENTAL RESULTS
TABLE II: Accuracy Comparison
the images, which are then used for grain classification. Approach Training Accuracy Testing Accuracy
- Quality Score:
Our approacp 0.9284 0.99 Our approacp 0.913 0.87 Incpetion 0.89 0.88 Xception 0.9334 0.93 Mobilenet 0.927 0.914 DenseNet 0.9386 0.9362 The Quality Score module is responsible for assess- ing the the final quality score of the input image. It incorporates two utility functions: getGrainCount() and getWeightedQualityScore().
- Deep Learning Framework and Machine Specifications
All our training and testing script are written in Python 3 programming language. We have used Python deep learning framework Keras (v2.12.0). As Kerass backend, we have used Tensorflow (v2.12.0). Our experiments were performed on the machine having the following specifications: 1. Camera (48 MP) 2. Laptop (core i5 intel CPU processor, 8 GB RAM) 3. GPU 12GB
- Accuracy plot for CNN Based Approach
Fig. 2: Accuracy vs Epoch
- LIMITATIONS
- Specific lighting conditions and clear black background is necessary, without that results predicted by the model will be less accurate.
- Noisy background in the image will also affect the results.
- Grading of samples is done based on morphological properties and not based on chemical properties.
- CONCLUSION
In conclusion, our research project on automated grain quality assessment using advanced deep learning models has yielded significant advancements. Our custom-developed con- volutional neural networks and feature extraction techniques have demonstrated superior accuracy and efficiency in captur- ing intricate grain patterns. By integrating a weighted rating system, we have enhanced objectivity and reduced subjectivity in the assessment process. This automated solution provides a more efficient and reliable alternative to manual methods, improving quality control in the grain industry and benefiting producers and consumers. Future research can further refine the system and explore potential applications in related in- dustries, driving the continuous evolution of automated grain quality assessment and quality assurance processes.
- ACKNOWLEDGEMENT
The first step on the path to positive change is acknowl- edgement that change is necessary and possible. Open yourself to the possibility of seeing the world in a new way. What do you have to lose? – Alex Blackwell. We would like to express our sincere appreciation to all individuals who contributed to the completion of this research paper. We would like to extend our gratitude to our guide for their expertise and guidance throughout the process. We are grateful to Pune Institute of Computer Technology for encouraging and supporting us throughout the research period.
REFERENCES
- Lingwal, S., Bhatia, K.K. Tomer, M.S. Image-based wheat grain classification using convolutional neural network. Multimed Tools Appl 80, 3544135465 (2021). https://doi.org/10.1007/s11042-020-10174-3
- Karim Laabassi, Mohammed Amin Belarbi, Sa¨d Mahmoudi, Sidi Ahmed Mahmoudi, Kaci Ferhat,Wheat varieties identification based on a deep learning approach, Journal of the Saudi Society of Agricultural Sciences,Volume 20, Issue 5,2021,Pages 281- 289,ISSN 1658-077X, https://doi.org/10.1016/j.jssas.2021.02.008. (https://www.sciencedirect.com/science/article/pii/S1658077X21000308)
- Wei WU, Tian-le YANG, Rui LI, Chen CHEN, Tao LIU, Kai ZHOU, Cheng-ming SUN, Chun-yan LI, Xin-kai ZHU, Wen-shan GUO, Detection and enumeration of wheat grains based on a deep learning method under various scenarios and scales, Journal of Integrative Agriculture,Volume 19, Issue 8,2020,Pages 1998-2008,
ISSN 2095-3119, https://doi.org/10.1016/S2095-3119(19)62803-
0.(https://www.sciencedirect.com/science/article/pii/S2095311919628030)
- Ferna´ndez-Campos, Mariela, Huang, Yu-Ting, Jahanshahi, Mohammad R., Wang, Tao, Jin, Jian, Telenko, Darcy EP, Go´ngora-Canul, Carlos, Cruz,
- D., (2021), Wheat spike blast image classification using deep convolutional neural networks, Frontiers in Plant Science, 12: pg: 1054. doi:10.3389/fpls.2021.673505.
- Devi, T. Neelamegam, P. Sudha, S.. (2017). Machine vision based qual- ity analysis of rice grains. 1052-1055. 10.1109/ICPCSI.2017.839187.
- Ropelewska, E., Jurczak, S., Bilska, K. et al. Correlations between the textural features of wheat kernels and the quantity of DNA of Fusarium fungi. Eur Food Res Technol 245, 11611167 (2019). https://doi.org/10.1007/s00217-019-03240-0
- R. Shen, T. Zhen and Z. Li, YOLOv5-Based Model Integrating Separa- ble Convolutions for Detection of Wheat Head Images, in IEEE Access, vol. 11, pp. 12059-12074, 2023, doi: 10.1109/ACCESS.2023.3241808.
- A. Kayabasi, An Application of ANN Trained by ABC Algorithm for Classification of Wheat Grains, Int J Intell Syst Appl Eng, vol. 6, no. 1, pp. 8591, Mar. 2018.
- Bao, Y.; Mi, C.; Wu, N.; Liu, F.; He, Y. Rapid Classification of Wheat Grain Varieties Using Hyperspectral Imaging and Chemometrics. Appl.
Sci. 2019, 9, 4119. https://doi.org/10.3390/app194119
- Bhuyan, R. Soft computing for wheat grain Identification. Global Journal of Applied Engineering in Computer Science and Mathematics (GJAECSMA) 1.1 (2020): 5-7.
- NVISIA. Agile Methodology [Online image]. Retrieved from
https://www.nvisia.com/insights/agile-methodology
