Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WasteGen-waste-segregation

This project classifies images of waste into six categories using a custom-built Convolutional Neural Network (CNN). It's designed to help with smarter waste management by automatically identifying the type of waste — whether it's glass, metal, paper, plastic, cardboard, or just trash.

🚀 What This Project Does

  • Trains a CNN model from scratch
  • Uses image augmentation for better generalization.
  • Applies class balancing to handle unequal dataset classes.
  • Evaluates with a confusion matrix and accuracy graphs.
  • Saves the best model automatically.
  • check real-time classification using your webcam.

🧰 Tech Stack

  • Python
  • TensorFlow / Keras
  • NumPy, Matplotlib, Seaborn
  • OpenCV (for real-time classification)
  • FastAPI

📁 Dataset

The dataset should be organized with one folder per class (e.g., cardboard, glass, metal, paper, plastic, trash), all under a main dataset-resized/ directory.

🏋️‍♂️ How to Train

  1. Clone this repo:

    git clone https://github.com/yourusername/WasteGen-waste-segregation.git
    cd waste-classifier-cnn
  2. Make sure your dataset is in dataset_waste/.

  3. Run the training script:

    python train_and_model.py

The model will be saved as best_model.h5 after training.

🎥 Real-time Prediction (Optional)

Once you have the trained model, you can try classifying waste in real time using your webcam:

python realtime_classifier.py

📊 Example Output

  • Training & validation accuracy plots
  • Confusion matrix to visualize predictions
  • Label displayed live on webcam feed

📦 Future Ideas

  • Deploy as a web app using Streamlit or Flask
  • Add support for mobile camera input
  • Connect to a smart dustbin or IoT system

🤝 Contributing

Feel free to fork the repo and open a pull request if you want to improve anything — from better CNN architecture to UI features!

About

waste segregation in real time

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages