Spaces:
Sleeping
Sleeping
|
Download README.md from EnYa32/Rice-Classifier-CNN: direct link, hf CLI and curl.
- Browser
- Download file 2.25 kB
-
https://huggingface.co/spaces/EnYa32/Rice-Classifier-CNN/resolve/main/README.md
- Command line
-
hf download hf://spaces/EnYa32/Rice-Classifier-CNN/README.md
-
curl -L -o README.md https://huggingface.co/spaces/EnYa32/Rice-Classifier-CNN/resolve/main/README.md
2.25 kB
A newer version of the Streamlit SDK is available: 1.67.0
metadata
title: Rice Classification CNN
emoji: πΎ
colorFrom: green
colorTo: yellow
sdk: streamlit
app_file: src/streamlit_app.py
pinned: false
short_description: Rice image classifier CNN.
license: mit
Rice Classification using CNN (From Scratch)
This project implements a Convolutional Neural Network (CNN) from scratch to classify rice grain images into five different types:
- Arborio
- Basmati
- Ipsala
- Jasmine
- Karacadag
The model was trained without transfer learning and achieves very high accuracy on the validation dataset.
π Dataset
- Total images: 75,000
- Classes: 5
- Train / Validation Split: 80% / 20%
- Image size: 160 Γ 160
- Batch size: 16
- Background: Black (single rice grain per image)
π§ Model Overview
The CNN architecture includes:
- 5 Convolutional Layers
- 3 MaxPooling Layers
- Batch Normalization
- L2 Regularization
- Data Augmentation (Flip, Rotation, Zoom)
- Global Average Pooling
- Dense Layer with Dropout
- Softmax Output Layer (5 classes)
βοΈ Training Setup
- Loss Function: Sparse Categorical Crossentropy
- Optimizer: Adam (learning rate = 0.0001)
- Metrics: Accuracy
- Epochs: 40
- Callbacks:
- EarlyStopping
- ReduceLROnPlateau
- ModelCheckpoint
π Results
- β Validation Accuracy: 99.94%
- β Validation Loss: 0.0179
- β Precision, Recall, F1-Score: 1.00 for all classes
- β Only 9 misclassifications out of 75,000 images
The confusion matrix shows nearly perfect classification performance.
π Future Work
- Test the model on real-world images
- Apply stronger data augmentation
- Compare with a Transfer Learning model (e.g. ResNet50)
- Deploy as a Streamlit Web App
π€ Author
Name: Enes Yamac
Date: 05.12.2025
Project Type: Deep Learning β CNN Image Classification
π Files in this Project
best_rice_cnn.kerasβ Trained CNN modelrice_cnn_training.ipynbβ Jupyter Notebook (training & evaluation)Rice_CNN_Report_Enes_Yamac.pdfβ Technical ReportREADME.mdβ Project description
β Status: Project completed successfully.