Introduction
In industrial agriculture, corn quality assessment is a critical step before processing. Traditionally, human inspectors manually evaluate 200g samples to distinguish between high-quality and defective kernels. This manual process is inherently slow, labor-intensive, and prone to subjective bias. Automating this task requires a system capable of high-speed, accurate classification in real-world conditions.
Problem Statement
The primary challenge in automating grain inspection is the physical arrangement of the kernels. In a typical sample, kernels are not isolated; they frequently touch, clump, or overlap. Conventional computer vision techniques, such as the watershed transform, often struggle with these "touching" scenarios, leading to under-segmentation (merging kernels) or over-segmentation (fragmenting a single kernel). Effective automation requires a robust pipeline that can handle dense clusters of grain without requiring manual separation.
Methodology
The researchers proposed a two-stage deep learning architecture to address both localization and classification.
Instance Segmentation
The first stage employs Mask R-CNN with a ResNet-101 backbone to perform instance segmentation. Unlike semantic segmentation, which merely identifies pixels belonging to a class, instance segmentation treats each kernel as a unique object. By predicting a bounding box and a precise binary mask for every instance, the system effectively "unsticks" touching kernels.
Classification (CK-CNN)
Following segmentation, individual kernel images are passed to a custom, lightweight classifier named CK-CNN. Designed specifically for this task, CK-CNN consists of three convolutional layers (3x3 kernels) and two fully connected layers. This architecture is significantly more efficient than general-purpose models like VGG16 or ResNet50, utilizing only 3.3 million parameters—approximately 7x fewer than ResNet50.
Dataset and Experimental Setup
The study introduced the CORN-KERNEL dataset, comprising 523 images captured using a Basler ACE camera under controlled LED illumination.
The dataset includes:
- Individual Grids: 303 images used to train the classification model.
- Dense Clusters: 23 images containing thousands of instances with hand-annotated contours for segmentation training.
- Classes: Kernels are categorized as Good, Defective (broken/rotten), or Impurity (foreign objects like stones).
Results and Discussion
The proposed pipeline demonstrated high performance across both stages:
- Segmentation: Mask R-CNN achieved a Mean Intersection over Union (mIoU) of 0.89, outperforming U-Net (0.70) and traditional Watershed methods (0.55).
- Classification: The CK-CNN model reached an average accuracy of 95.6%.
A key finding was that the specialized, shallower CK-CNN outperformed deeper models. The consistent visual features of corn kernels allowed the smaller model to achieve high accuracy without the overfitting risks or computational overhead associated with massive architectures.
Conclusion
This research provides a robust end-to-end solution for automated corn quality inspection. By combining instance segmentation to handle touching kernels with a lightweight custom classifier, the system achieves high accuracy suitable for industrial deployment. Future work will focus on addressing class imbalances in impurities and extending the model's applicability to other agricultural products.
Summary updated