An Improved Pure Fully Connected Neural Network for Rice Grain Classification

An Improved Pure Fully Connected Neural Network for Rice Grain Classification
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Rice is a staple food for a significant portion of the world’s population, providing essential nutrients and serving as a versatile in-gredient in a wide range of culinary traditions. Recently, the use of deep learning has enabled automated classification of rice, im-proving accuracy and efficiency. However, classical models based on first-stage training may face difficulties in distinguishing between rice varieties with similar external characteristics, thus leading to misclassifications. Considering the transparency and feasibility of model, we selected and gradually improved pure fully connected neural network to achieve classification of rice grain. The dataset we used contains both global and domestic rice images obtained from websites and laboratories respectively. First, the training mode was changed from one-stage training to two-stage training, which significantly contributes to distinguishing two similar types of rice. Secondly, the preprocessing method was changed from random tilting to horizontal or vertical position cor-rection. After those two enhancements, the accuracy of our model increased notably from 97% to 99%. In summary, two subtle methods proposed in this study can remarkably enhance the classification ability of deep learning models in terms of the classification of rice grain.


💡 Research Summary

The paper presents a rice grain classification system built on a pure fully‑connected neural network (FCNN) and demonstrates that two modest methodological enhancements can raise classification accuracy from roughly 97 % to 99 %. The authors first assembled two image datasets. The “global” set comprises five internationally cultivated rice varieties (Arborio, Basmati, Ipsala, Jasmine, Karacadag) with 15 000 images per class, captured at 250 × 250 px on a uniform black background. The “domestic” set contains six Chinese varieties (Guangdong Simiao, Northeastern glutinous, Wuchang, Panjin crab field, Wannian Gong, Yanbian) with about 3 000 images per class, captured at 960 × 960 px using an industrial camera and subsequently pre‑processed (grayscale, luminance enhancement). Length and width measurements for each variety are also reported.

The baseline model is a straightforward FCNN: an input layer of 64 neurons, three hidden layers of 120, 100, and 50 neurons respectively, and an output layer whose size matches the number of classes (5 for the global set, 6 for the domestic set). ReLU activations are used in all hidden layers, Softmax in the output, and sparse categorical cross‑entropy as the loss function. Images are resized to 32 × 32 before being flattened and fed to the network. Training is performed with a batch size of 32 for up to 50 epochs, using the Keras Sequential API under Python 3.

Two enhancements are introduced.

  1. Multi‑stage Classification: Inspired by decision‑tree logic, the authors first train a coarse classifier that groups the two most easily confused varieties (Arborio and Karacadag) into a combined label “AK”. This first stage outputs one of four possibilities (AK, Basmati, Jasmine, Ipsala). If the prediction is AK, a second, binary FCNN is invoked to disambiguate between Arborio and Karacadag. This hierarchical approach reduces the chance of mis‑classification for visually similar classes.
  2. Fixed Flipping (Orientation Correction): Rather than relying on random data augmentation, the authors rotate each grain image until the grain’s bounding rectangle aligns horizontally or vertically with the image axes. The algorithm iteratively approximates the rectangle’s extreme pixels, rotates the image, and stops when the rectangle’s dimensions reach a minimal threshold. The resulting images have a standardized orientation, which improves the network’s robustness to positional variance without inflating the training set.

Experiments compare five optimizers (Adam, SGD, RMSprop, Adadelta, Nadam). On the global dataset, the baseline model achieves the highest test accuracy with SGD (97.41 %). After applying both multi‑stage classification and fixed flipping, the same optimizer yields a test accuracy of 99.42 % (training accuracy 99.75 %). Similar gains are observed across other optimizers, all surpassing 99 % test performance. The domestic dataset shows comparable improvements, confirming that the methods are not dataset‑specific. Confusion matrices illustrate that most residual errors involve the previously ambiguous pair (Arborio vs. Karacadag) and a few domestic varieties, indicating that the hierarchical scheme successfully mitigates the dominant source of confusion.

The study’s contributions are threefold: (i) demonstrating that a simple FCNN, when combined with targeted preprocessing and hierarchical classification, can rival more complex convolutional architectures for grain classification; (ii) proposing a practical orientation‑correction pipeline that eliminates the need for extensive data augmentation; (iii) providing a high‑quality, partially public rice image repository that addresses the common scarcity of agricultural datasets.

Limitations are acknowledged. Reducing images to 32 × 32 px discards fine‑grained texture information that could be beneficial for distinguishing subtle phenotypic traits. The multi‑stage design relies on prior knowledge of which classes are confusable; adding new varieties would require redesigning the hierarchy. All images were captured under controlled lighting and against a black background, so the model’s robustness to field conditions (variable illumination, cluttered backgrounds) remains untested.

Future work suggested includes: (a) integrating convolutional layers with the FCNN to preserve spatial features while retaining interpretability; (b) expanding the dataset with diverse lighting, backgrounds, and imaging devices to evaluate real‑world generalization; (c) automating the discovery of optimal class groupings for hierarchical classification, possibly via clustering of feature embeddings; and (d) deploying the system in a real‑time sorting line to assess latency introduced by the two‑stage inference and orientation correction steps.

In summary, the paper provides a concise yet effective recipe—hierarchical decision making plus orientation standardization—that lifts a plain fully‑connected network to state‑of‑the‑art accuracy for rice grain classification, while highlighting practical considerations for dataset construction and model deployment in precision agriculture.


Comments & Academic Discussion

Loading comments...

Leave a Comment