An Improved Pure Fully Connected Neural Network for Rice Grain Classification

Wanke Xia, Ruoxin Peng, Haoqi Chu, Xinlei ZhuarXiv 2025 · DOI

Abstract

Automated classification of rice varieties is essential for quality control in the food industry. However, the visual similarity between different cultivars often necessitates complex, computationally expensive models. This paper presents an optimized approach using a "Pure" Fully Connected Neural Network (FCNN) enhanced by a multi-stage classification workflow and fixed-orientation preprocessing. By grouping visually similar varieties and standardizing image orientation, the proposed model achieves 99% accuracy on global datasets. Notably, this architecture offers a significant reduction in training time—completing in under 40 seconds compared to over 14 minutes for standard CNN architectures like ResNet50—making it highly suitable for resource-constrained industrial applications.

Introduction

The global rice trade relies heavily on accurate variety identification to ensure quality and prevent fraud. Many rice varieties, such as Arborio and Karacadag, are "visual twins," exhibiting nearly identical morphological characteristics. While Convolutional Neural Networks (CNNs) have become the standard for image classification, their high computational demands and "black box" nature can be prohibitive for real-time sorting systems. This research explores whether a simpler FCNN architecture, when combined with strategic data handling and hierarchical logic, can match or exceed the performance of deep CNNs.

Methodology

The core of the proposed system is a Pure FCNN consisting of an input layer, three hidden layers (120, 100, and 50 neurons), and an output layer. To overcome the limitations of simple networks in distinguishing similar classes, two primary enhancements were implemented:

1. Multi-stage Classification

Rather than a single-stage "one-vs-all" classification, the authors adopted a hierarchical "divide and conquer" strategy. Visually similar rice types are first grouped into "meta-classes." For instance, Arborio and Karacadag are initially classified as a single group. A secondary, specialized FCNN then performs binary classification within that group. This approach simplifies the decision boundaries the network must learn at each stage.

2. Fixed Flipping Preprocessing

Unlike standard data augmentation which introduces rotational variance, this method utilizes a "fixed flipping" enhancement. Every grain image is automatically rotated to a consistent horizontal or vertical orientation based on its bounding box. By removing orientation as a variable, the FCNN can more effectively focus on subtle morphological features like grain length, width, and curvature.

Datasets and Experimental Setup

The model was evaluated using two distinct datasets to ensure robustness:

  • Global Dataset: 75,000 images covering five varieties: Arborio, Basmati, Ipsala, Jasmine, and Karacadag.
  • Domestic Dataset: 18,000 high-resolution images (1920×1080) of six Chinese rice varieties, including Wuchang and Panjin crab field rice, captured under controlled laboratory conditions.
Visual comparison of five rice varieties from the Global Dataset: (a) Arborio, (b) Basmati, (c) Ipsala, (d) Jasmine, and (e) Karacadag.

Results and Discussion

The experimental results demonstrate that the improved FCNN is both highly accurate and exceptionally efficient.

Performance Metrics

The combination of multi-stage training and fixed flipping improved classification accuracy from 97% to 99% on the Global Dataset. Interestingly, the choice of optimizer played a significant role; Stochastic Gradient Descent (SGD) outperformed Adam on the Global Dataset, while Adam was superior for the Domestic Dataset, suggesting that optimizer selection should be tailored to specific data characteristics.

Computational Efficiency

The most significant advantage of the FCNN approach is its speed. Training the FCNN required only 37.93 seconds, whereas ResNet50 required 863 seconds on identical hardware. This represents a speedup of over 20x. When compared to modern lightweight architectures like MobileNet v2 and ConvNeXt-Tiny, the FCNN maintained competitive accuracy while remaining 18 to 24 times faster to train.

Conclusion

This study demonstrates that for specific agricultural classification tasks, "simpler" models can achieve state-of-the-art results when paired with intelligent preprocessing and hierarchical logic. The improved FCNN provides a high-accuracy, low-latency solution for rice grain classification. Future work will focus on testing the model's robustness against non-uniform backgrounds and deploying the architecture on edge devices for real-time field use.

Summary updated

BibTeX
@misc{xia2025improved,
  author = {Wanke Xia and Ruoxin Peng and Haoqi Chu and Xinlei Zhu},
  title = {{An Improved Pure Fully Connected Neural Network for Rice Grain Classification}},
  year = {2025},
  eprint = {2503.03111},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.03111},
}
Figure