A deep learning project for classifying household waste into six categories: cardboard, glass, metal, paper, plastic, and trash. The project uses image data organized in labeled folders and includes complete pipelines for model training, evaluation, and inference.
GarbageClassification/
├── Garbage Classification.ipynb # Main notebook: exploration, training, evaluation
├── Project Report.pdf # Methodology, results, and conclusions
├── requirements.txt # Python dependencies
└── GarbageClassification/ # Dataset directory
├── cardboard/
├── glass/
├── metal/
├── paper/
├── plastic/
└── trash/
- Python 3.8+
- pip
Install dependencies:
pip install -r requirements.txt- Open
Garbage Classification.ipynbin Jupyter Notebook or JupyterLab. - Execute cells in order:
- Load and inspect the dataset
- Preprocess and augment images
- Define and compile the model
- Train and evaluate
- Plot metrics and confusion matrix
To convert the workflow into a standalone Python script, follow this pattern:
- Load images from
GarbageClassification/usingImageDataGeneratorortf.data. - Preprocess and batch images (resize, normalize, augment).
- Build a CNN model or apply transfer learning (e.g., MobileNetV2, ResNet50).
- Train and validate using an 80/20 train/validation split.
- Save the trained model and report test accuracy.
The dataset consists of labeled images of household waste, organized by class folder.
- Split: 80% training / 20% validation (recommended)
- Augmentation: Strongly recommended to reduce overfitting (flips, rotations, zoom, etc.)
- Source: Kaggle – Garbage Classification
| File | Description |
|---|---|
Garbage Classification.ipynb |
Main workflow notebook |
Project Report.pdf |
Full project report with results |
requirements.txt |
Required Python packages |
To ensure consistent results across runs, set random seeds at the start of your notebook or script:
import os
import random
import numpy as np
import tensorflow as tf
SEED = 42
os.environ['PYTHONHASHSEED'] = str(SEED)
random.seed(SEED)
np.random.seed(SEED)
tf.random.set_seed(SEED)