Rice Variety Classification

1. Overview
This deep learning project leverages transfer learning with MobileNet to classify five distinct rice varieties from image data: Arborio, Basmati, Ipsala, Jasmine, and Karacadag. The model achieves 99.82% test accuracy with only 1 misclassification across 562 test samples.
Transfer Learning Pipeline
ImageNet
Pre-trained MobileNet weights
Freeze
Lock early layers preserve features
Fine-Tune
Unfreeze last 20 layers for rice
Classify
Custom head 5 varieties
2. Model Architecture
The model uses MobileNet pre-trained on ImageNet as a base, with a custom classification head added on top. The final 20 layers of MobileNet undergo fine-tuning to learn rice-specific visual characteristics.
Network Architecture
Frozen Layers
MobileNet Conv Blocks 1–N
General visual features preserved
Fine-Tuned (Last 20 Layers)
Rice-Specific Feature Learning
Grain edges, morphology, surface texture
Data Augmentation Techniques
Rotation
Random angle rotation
H-Flip
Horizontal mirror
V-Flip
Vertical mirror
Zoom
Random zoom & shift
3. Dataset
The dataset contains 1,500 images per category with stratified division into training, validation, and test subsets.
Arborio
Short, round
1,500 imgs
Basmati
Long, slender
1,500 imgs
Ipsala
Medium
1,500 imgs
Jasmine
Long
1,500 imgs
Karacadag
Short, round
1,500 imgs
Morphological Challenge: Karacadag and Arborio share similar short, round grain profiles, making them the most common confusion pair. Jasmine shows the most feature-space overlap across all varieties.
4. Results
Classification Accuracy
99.82%
Accuracy
Correct
out of 562 test samples
Misclassified
single error across all varieties
5. Extended Analysis
The project includes a comprehensive evaluation beyond standard accuracy metrics:
Grad-CAM Heatmaps
Model focuses on grain edges, morphology, and surface characteristics
t-SNE / PCA Projections
Five well-separated clusters in learned feature space
Morphological Comparison
Contour analysis of grain area, perimeter, and aspect ratios
Error Analysis
Misclassified images with high certainty identifying model blind spots
Low-Confidence Predictions
Ambiguous outputs predominantly from Jasmine varieties
Architecture Benchmarks
EfficientNet and ResNet50 compared against MobileNet baseline
6. Key Insights
Transfer learning achieves near-perfect classification with modest training data
Jasmine variety presents classification challenges with overlapping learned representations
Round-grain morphologies (Karacadag, Arborio) occasionally conflate in model predictions
Model attention concentrates on grain boundary geometry rather than background elements
Learned feature representations demonstrate excellent inter-class separability
