An automated trash classification system using EfficientNetB0 and a fine-tuned Support Vector Machine (SVM).
ReClassify identifies recyclable materials across six categories to assist with smarter, cleaner waste sorting.
- Feature Extractor: EfficientNetB0 (pretrained on ImageNet)
- Classifier: Support Vector Machine (RBF kernel)
- Tuning: GridSearchCV for
C,gamma,kernel - Accuracy: 91% on TrashNet dataset
ReClassify uses the TrashNet dataset, containing:
- 2,500+ labeled images
- 6 classes:
cardboard,glass,metal,paper,plastic,trash - Images resized to 224×224 and preprocessed for EfficientNet
- Load and preprocess images
- Extract feature vectors with EfficientNetB0
- Normalize features using
StandardScaler - Train an SVM classifier with the best hyperparameters
- Evaluate accuracy, F1-score, and generate predictions
| Class | Precision | Recall | F1-score |
|---|---|---|---|
| Cardboard | 0.96 | 0.94 | 0.95 |
| Glass | 0.91 | 0.92 | 0.91 |
| Metal | 0.84 | 0.91 | 0.87 |
| Paper | 0.90 | 0.97 | 0.93 |
| Plastic | 0.94 | 0.85 | 0.89 |
| Trash | 0.89 | 0.67 | 0.76 |
- Overall Accuracy: 91%
- Macro F1 Score: 0.89
- Weighted F1 Score: 0.90
Install all required packages:
pip install -r requirements.txtMain packages:
tensorflow/kerasscikit-learnopencv-pythonmatplotlibnumpy
Run the classifier:
python main.pyThis script will:
- Load images from the
TrashNet/dataset - Extract features using EfficientNetB0
- Train and evaluate the SVM model
- Display classification report and prediction samples
├── TrashNet/ # Dataset (6 folders by class)
├── main.py # Main training & evaluation script
├── preprocess.py # Image loading/preprocessing helper
├── requirements.txt
└── README.md
- Add image augmentation to boost low-sample classes like
trash - Try ResNet or EfficientNetV2 for deeper feature extraction
- Deploy as a web app using Streamlit or Flask
- Implement real-time webcam classification