Skip to content

Keras/TensorFlow CNN that classifies waste images; ~3.7M parameters with Conv2D–MaxPool–Dropout blocks, trained 10 epochs with training accuracy rising to ~0.92 and validation around ~0.75–0.78

Notifications You must be signed in to change notification settings

ArindamDeka09/cnn-garbage-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

CNN Garbage Classifier

Introduction / Motivation

Waste management is one of the biggest urban challenges, and manual garbage sorting is slow, costly, and prone to errors. This project uses a Convolutional Neural Network (CNN) to automatically classify images of waste into predefined categories, enabling faster and more efficient waste segregation. The goal is to help recycling facilities, environmental initiatives, and researchers explore how deep learning can be applied to sustainability challenges.

Features

  • Image classification into multiple waste categories using CNNs.
  • Data preprocessing with image resising, normalisation, and augmentation.
  • Model training and evaluation in a reproducible Jupyter Notebook.
  • Confusion matrix and accuracy metrics for performance evaluation.
  • Easy to adapt for new waste categories by retraining on a custom dataset.

Dataset

  • Expected input: Images of garbage items organized into class folders.
  • Dataset should be structured for supervised image classification (train/test split).
  • Images are read, resized, and normalized before being passed to the CNN.
  • If dataset is not available locally, download from a waste classification dataset source (e.g., Kaggle) and place it into the data/ directory.

Project Structure

  • Arindam's_CNN_Garbage_Classifier.ipynb — main Jupyter notebook containing the entire workflow.
  • README.md — this file.
  • (Optional) data/ — dataset files (kept out of version control by default).
  • (Optional) models/ — saved trained models.

Installation

Prerequisites:

  • Python 3.8+
  • pip (or conda)
  • Jupyter Notebook/Lab

Create and activate a virtual environment (recommended):

python -m venv .venv
# Linux/Mac
source .venv/bin/activate
# Windows
.venv\Scripts\activate

Install dependencies:

pip install -U pip
pip install jupyter tensorflow keras numpy pandas matplotlib seaborn scikit-learn

Launch Jupyter:

jupyter notebook

Open Arindam's_CNN_Garbage_Classifier.ipynb.

Usage

  1. Ensure your dataset is available locally and structured properly for image classification.
  2. Update the dataset path in the notebook if necessary.
  3. Run all cells in sequence:
    • Imports
    • Data loading and preprocessing
    • Model definition (CNN architecture)
    • Training
    • Evaluation
  4. Review metrics such as accuracy, loss curves, and confusion matrix.

Configuration

  • Dataset path: edit the path variable in the notebook.
  • CNN parameters: adjust number of filters, kernel size, dropout, and dense layers as needed.
  • Training parameters: modify batch size, epochs, and learning rate for tuning.

Results

  • CNN achieves strong accuracy in classifying waste categories.
  • Visualization of accuracy and loss trends helps monitor training progress.
  • Confusion matrix highlights strengths and weaknesses for each category.

Ideas to improve:

  • Add more diverse data for better generalization.
  • Implement transfer learning with pre-trained models like ResNet or MobileNet.
  • Use real-time inference with a camera feed.

Contributing

Contributions welcome:

  • Fork the repo and create a feature branch.
  • Follow PEP8; add docstrings/comments.
  • Include notes/results/tests where relevant.
  • Open a pull request describing changes and motivation.

License

MIT License (recommended). Add a LICENSE file to the repository.

Acknowledgements / Credits

Completed during a Data Science and AI training program at Internselite.

Special thanks to my mentor, Ayush Srivastava, for guidance and support.

Libraries: pandas, numpy, scikit-learn, seaborn, matplotlib, tensorflow, keras.

Contact / Support

Author: Arindam Deka

Email: arindamdeka001@gmail.com

GitHub: ArindamDeka09

Issues: Please open an issue with details and steps to reproduce.

About

Keras/TensorFlow CNN that classifies waste images; ~3.7M parameters with Conv2D–MaxPool–Dropout blocks, trained 10 epochs with training accuracy rising to ~0.92 and validation around ~0.75–0.78

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published