A deep learning project to classify rice types (Jasmine vs Gonen) using a Neural Network built with PyTorch.
This project implements a Binary Classification model to distinguish between two types of rice:
- Jasmine Rice (Class 1)
- Gonen Rice (Class 0)
The model is trained on physical characteristics of rice grains like Area, Perimeter, Eccentricity, etc.
| Metric | Value |
|---|---|
| Test Accuracy | ~92-95% |
| Training Epochs | 50 |
| Batch Size | 32 |
- Source: Kaggle - Rice Type Classification
- Total Samples: 18,185
- Features: 11 (Area, Perimeter, MajorAxisLength, etc.)
- Target: Binary (0 or 1)
| Set | Percentage | Samples |
|---|---|---|
| Training | 70% | ~12,729 |
| Validation | 15% | ~2,728 |
| Testing | 15% | ~2,728 |
Input (11 features)
↓
Linear(11 → 64) → ReLU → Dropout(0.2)
↓
Linear(64 → 32) → ReLU → Dropout(0.2)
↓
Linear(32 → 1) → Sigmoid
↓
Output (0 to 1 probability)
- Python 3.8+
- PyTorch - Deep Learning Framework
- Pandas - Data Manipulation
- NumPy - Numerical Operations
- Matplotlib - Visualization
- Scikit-learn - Train/Test Split & Metrics
rice_type_classification/
│
├── code.ipynb # Main Jupyter Notebook
├── rice_classifier.pth # Saved Model Weights
├── README.md # Project Documentation
└── rice-type-classification/
└── riceClassification.csv # Dataset
git clone https://github.com/KumarKhailendra/rice_type_classification.git
cd rice_type_classificationpip install torch pandas numpy matplotlib scikit-learn opendatasetsjupyter notebook code.ipynb- Open
code.ipynbin VS Code - Run all cells
- Custom Dataset class in PyTorch
- DataLoader for batch processing
- Neural Network with Dropout for regularization
- Binary Cross Entropy Loss for classification
- Adam Optimizer for training
- Model saving and loading
- Add more rice types (Multiclass Classification)
- Implement CNN for image-based classification
- Create a Flask/Streamlit web app
- Add confusion matrix visualization
- Hyperparameter tuning
Khailendra Prasad
This project is licensed under the MIT License - see the LICENSE file for details.
Give a ⭐ if this project helped you!
Made with ❤️ by Khailendra Prasad