All projects
Artificial Intelligence

Rice Classification Model

A deep learning model that identifies rice varieties from images

huggingface.co
Rice Classification Model
%98
Accuracy
CNN
Architecture
2024
Year

Overview

Classifying agricultural produce by expert eye in a lab is both slow and person-dependent. Distinguishing rice varieties is particularly hard; the difference between grains often comes down to a few millimetres of size and ratio.

The model was trained on the rice dataset from Kaggle. Images were normalised first, then data augmentation added rotation, zoom and brightness variation, making the model robust to the variable shooting conditions of the real world. The convolutional neural network was built with dropout layers to prevent overfitting.

It reached 98% accuracy on the test set. Inspecting the confusion matrix showed that most errors clustered between the two varieties that look most alike — which indicates the model learned a meaningful boundary rather than a random one. The model can be tried live on Hugging Face Spaces.

Highlights

  • 98% classification accuracy on the test set
  • Robustness to real shooting conditions via data augmentation
  • Overfitting controlled with dropout layers
  • A live demo you can try in the browser

Objectives

  • Automate classification that depends on an expert eye
  • Produce stable results under variable shooting conditions
  • Publish the model so anyone can try it

Solution

  • Designing a convolutional neural network architecture
  • An image normalisation and augmentation pipeline
  • Error analysis with a confusion matrix
  • Serving the model on Hugging Face Spaces

Approach

  1. 01Reviewing and balancing the Kaggle dataset
  2. 02Model training and hyperparameter experiments
  3. 03Evaluation and publishing a live demo

Outcomes

  • 98% accuracy, close to human expert level
  • Errors clustered on visually closest varieties rather than at random
  • The model can be tested by anyone through a browser

Challenges

  • Separating varieties that look extremely similar
  • Preventing overfitting with limited data
  • Stability across different lighting conditions

Selected Work

Similar projects

View all