Skip to content

Latest commit

Β 

History

History
135 lines (90 loc) Β· 2.79 KB

File metadata and controls

135 lines (90 loc) Β· 2.79 KB
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 πŸŒΎπŸ€–