Skip to content

EnYa32/Rice_Classifier_ResNet50

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

title emoji colorFrom colorTo sdk app_file pinned short_description license
Rice Classifier ResNet50
🌾
green
yellow
streamlit
src/streamlit_app.py
false
CNN-based rice image classifier with ResNet50.
mit

🌾 Rice Classification with ResNet50 (Transfer Learning)

🔗 Live Demo: [(https://huggingface.co/spaces/EnYa32/Rice_Classifier_ResNet50)]
This app uses a deep learning model to classify rice grain images into different rice types.

The model is based on ResNet50 (Transfer Learning) and reaches very high accuracy.


🚀 Quick Facts

  • Task: Image Classification
  • Model: ResNet50 (Transfer Learning)
  • Framework: TensorFlow / Keras
  • Classes: 5
  • Deployment: Streamlit + HuggingFace Space

📸 Model Insights & Training Visualizations

🔥 Grad-CAM Explainability

Model attention heatmap showing which regions influenced the prediction.

GradCAM


📈 Training Curves (Accuracy & Loss)

Training vs validation accuracy and loss across epochs.

Training Curves


🚀 Features

1ee0bca (Add model screenshots to README)

  • Upload rice grain images (JPG / PNG)
  • Automatic rice type classification
  • Confidence score output
  • Transfer learning with ResNet50 backbone
  • Production-ready Streamlit interface

📊 Model Performance

  • Validation Accuracy: 99.29%
  • Top-3 Accuracy: 100%
  • Low confusion between most classes
  • Minor confusion between visually similar rice types

🌾 Rice Classes

The model can classify the following rice types:

  • Arborio
  • Basmati
  • Ipsala
  • Jasmine
  • Karacadag

🖼️ How to use the app

  1. Upload a rice image (JPG or PNG)
  2. The model analyzes the image
  3. The predicted rice type is shown
  4. You also see the confidence score

🧪 Training Summary

  • Base Model: ResNet50
  • Transfer Learning: Yes
  • Data Augmentation: Yes
  • Optimizer: Adam
  • Loss Function: Sparse Categorical Crossentropy
  • Batch Size: 16

📁 Files in this Space

  • app.py → Streamlit App
  • best_rice_resnet50.keras → Trained Model
  • README.md → This file

📂 Dataset

  • Rice grain image dataset
  • 5 rice classes
  • Balanced class distribution
  • Preprocessing: resize + normalization
  • Augmentation: rotation, flip, zoom

🎯 Use Case

This project demonstrates a production-style computer vision pipeline using transfer learning with ResNet50, including training, evaluation, and deployment as an interactive Streamlit application.


👤 Author

Name: Enes Yamac
Date: 05.12.2025
Project Type: Deep Learning – CNN Image Classification with ResNet50


✅ Enjoy testing the rice classifier!
Upload an image and let the AI predict the rice type 🌾🤖

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors