Table of Contents
Fetching ...

CornViT: A Multi-Stage Convolutional Vision Transformer Framework for Hierarchical Corn Kernel Analysis

Sai Teja Erukude, Jane Mascarenhas, Lior Shamir

TL;DR

CornViT tackles automated corn kernel grading by decomposing the task into purity, morphology, and embryo orientation using three sequential CvT-13 classifiers. The approach leverages convolution-augmented self-attention to capture local texture and global shape, achieving stage-wise accuracies above 91% and outperforming ResNet-50 and DenseNet-121 baselines. It provides interpretable intermediate outputs and a lightweight Flask web app for deployment, along with publicly released stage-wise datasets. The work demonstrates a practical, scalable pathway for automated seed-quality assessment in breeding and seed-production pipelines.

Abstract

Accurate grading of corn kernels is critical for seed certification, directional seeding, and breeding, yet it is still predominantly performed by manual inspection. This work introduces CornViT, a three-stage Convolutional Vision Transformer (CvT) framework that emulates the hierarchical reasoning of human seed analysts for single-kernel evaluation. Three sequential CvT-13 classifiers operate on 384x384 RGB images: Stage 1 distinguishes pure from impure kernels; Stage 2 categorizes pure kernels into flat and round morphologies; and Stage 3 determines the embryo orientation (up vs. down) for pure, flat kernels. Starting from a public corn seed image collection, we manually relabeled and filtered images to construct three stage-specific datasets: 7265 kernels for purity, 3859 pure kernels for morphology, and 1960 pure-flat kernels for embryo orientation, all released as benchmarks. Head-only fine-tuning of ImageNet-22k pretrained CvT-13 backbones yields test accuracies of 93.76% for purity, 94.11% for shape, and 91.12% for embryo-orientation detection. Under identical training conditions, ResNet-50 reaches only 76.56 to 81.02 percent, whereas DenseNet-121 attains 86.56 to 89.38 percent accuracy. These results highlight the advantages of convolution-augmented self-attention for kernel analysis. To facilitate adoption, we deploy CornViT in a Flask-based web application that performs stage-wise inference and exposes interpretable outputs through a browser interface. Together, the CornViT framework, curated datasets, and web application provide a deployable solution for automated corn kernel quality assessment in seed quality workflows. Source code and data are publicly available.

CornViT: A Multi-Stage Convolutional Vision Transformer Framework for Hierarchical Corn Kernel Analysis

TL;DR

CornViT tackles automated corn kernel grading by decomposing the task into purity, morphology, and embryo orientation using three sequential CvT-13 classifiers. The approach leverages convolution-augmented self-attention to capture local texture and global shape, achieving stage-wise accuracies above 91% and outperforming ResNet-50 and DenseNet-121 baselines. It provides interpretable intermediate outputs and a lightweight Flask web app for deployment, along with publicly released stage-wise datasets. The work demonstrates a practical, scalable pathway for automated seed-quality assessment in breeding and seed-production pipelines.

Abstract

Accurate grading of corn kernels is critical for seed certification, directional seeding, and breeding, yet it is still predominantly performed by manual inspection. This work introduces CornViT, a three-stage Convolutional Vision Transformer (CvT) framework that emulates the hierarchical reasoning of human seed analysts for single-kernel evaluation. Three sequential CvT-13 classifiers operate on 384x384 RGB images: Stage 1 distinguishes pure from impure kernels; Stage 2 categorizes pure kernels into flat and round morphologies; and Stage 3 determines the embryo orientation (up vs. down) for pure, flat kernels. Starting from a public corn seed image collection, we manually relabeled and filtered images to construct three stage-specific datasets: 7265 kernels for purity, 3859 pure kernels for morphology, and 1960 pure-flat kernels for embryo orientation, all released as benchmarks. Head-only fine-tuning of ImageNet-22k pretrained CvT-13 backbones yields test accuracies of 93.76% for purity, 94.11% for shape, and 91.12% for embryo-orientation detection. Under identical training conditions, ResNet-50 reaches only 76.56 to 81.02 percent, whereas DenseNet-121 attains 86.56 to 89.38 percent accuracy. These results highlight the advantages of convolution-augmented self-attention for kernel analysis. To facilitate adoption, we deploy CornViT in a Flask-based web application that performs stage-wise inference and exposes interpretable outputs through a browser interface. Together, the CornViT framework, curated datasets, and web application provide a deployable solution for automated corn kernel quality assessment in seed quality workflows. Source code and data are publicly available.
Paper Structure (31 sections, 8 equations, 14 figures, 9 tables, 1 algorithm)

This paper contains 31 sections, 8 equations, 14 figures, 9 tables, 1 algorithm.

Figures (14)

  • Figure 1: The overall workflow of the proposed CornViT system illustrates how a single-kernel RGB image passes through the preprocessing module and then sequentially through three CvT-13 classifiers.
  • Figure 2: A sample of images randomly picked from the Stage 1 dataset, showing pure kernels on the left and impure kernels on the right.
  • Figure 3: Representative samples from the Stage 2 dataset showing flat kernels on the left and round kernels on the right.
  • Figure 4: Sample images randomly picked from the Stage 3 dataset depicting embryo orientation, with kernels exhibiting the embryo-up class on the left and the embryo-down class on the right.
  • Figure 5: Schematic of the CvT-13 architecture used as the backbone in all CornViT stages wu2021cvt. (a) The complete architecture highlights the hierarchical multi-stage design facilitated by the Convolutional Token Embedding layer. (b) A detailed illustration of the Convolutional Transformer Block, which begins with a convolutional projection layer.
  • ...and 9 more figures