This project implements an image classification system to automatically classify waste into six categories using deep learning (CNN) with TensorFlow and Keras. The dataset used is TrashNet, which contains images of various types of waste.
ML - TUBES/
├── Trashnet/ # Original dataset (belum dipisah)
│ ├── cardboard/
│ ├── glass/
│ ├── metal/
│ ├── paper/
│ ├── plastic/
│ └── trash/
│
├── Trashnet_split/ # Dataset setelah split: train/val/test
│ ├── train/
│ ├── val/
│ └── test/
│
├── ArielYosuaHasibuan_FP_ML2425_manual_book.pdf # Manual book (penjelasan kode)
├── ArielYosuaHasibuan_FP_ML2425_paper.pdf # Laporan akhir
├── ArielYosuaHasibuan_FP_ML2425_source_code.ipynb # Notebook proyek
└── README.md # Dokumentasi proyek (file ini)
cardboardglassmetalpaperplastictrash(minority class)
- ✅ Data Splitting: 70% train, 17% val, 13% test
- ✅ Image Preprocessing with
ImageDataGenerator - ✅ Data Augmentation focused on minority class
trash - ✅ Class Weighting to handle class imbalance
- ✅ Transfer Learning using pretrained
MobileNetV2andDenseNet121 - ✅ Fine-Tuning: Partial unfreezing of layers for performance improvement
- ✅ Callbacks:
ModelCheckpoint(save best model)EarlyStopping(prevent overfitting)ReduceLROnPlateau(adjust learning rate)
| Model | Notes |
|---|---|
| MobileNetV2 | Lightweight, fast convergence |
| DenseNet121 | Deeper model, higher final accuracy |
| Model | Accuracy | F1-Score | Recall (Trash) |
|---|---|---|---|
| MobileNetV2 | ~79% | 0.77 | 0.67 |
| DenseNet121 | 86% | 0.86 | 0.83 |
- Confusion matrix for each model
- Classification report: precision, recall, F1-score per class
- Accuracy and loss graphs (training vs validation)
-
Clone this repository
git clone https://github.com/arielyosua/Waste-Classification-Using-Convolutional-Neural.git cd Waste-Classification-Using-Convolutional-Neural -
Install dependencies
pip install -r requirements.txt -
Make sure folder
Trashnetis populated with original dataset images
or download from TrashNet GitHub -
Run source code in Jupyter Notebook or Python script
jupyter notebook ArielYosuaHasibuan_FP_ML2425_source_code.ipynb -
Output models will be saved as
.h5(MobileNetV2 and DenseNet121)
*_manual_book.pdf→ Detailed code explanation*_source_code.ipynb→ Main training workflow*_paper.pdf→ Formal report of the final project
This project was created by Ariel Yosua Hasibuan for the ML2425 - Final Project
Program Studi Ilmu Komputer, Universitas Pertamina
If you find this useful or want to contribute, feel free to fork or raise an issue.
⭐️ Don't forget to star the repository if you like it!