Skip to content

Latest commit

ย 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—‘๏ธ Garbage Classification using EfficientNetV2B2

A deep learning model for classifying waste images into six categories using transfer learning with EfficientNetV2B2.
Built with TensorFlow & Keras and deployed via Gradio on Hugging Face Spaces.


๐Ÿ“Œ Categories

The model can classify images into the following categories:

  • ๐Ÿ“ฆ Cardboard
  • ๐Ÿ”ฎ Glass
  • โš™๏ธ Metal
  • ๐Ÿ“„ Paper
  • ๐Ÿงด Plastic
  • ๐Ÿšฎ Trash

๐Ÿš€ Live Demo (Hugging Face)

๐Ÿ‘‰ Try the deployed model here: Garbage Classifier on Hugging Face


๐Ÿ“Š Model Performance

Metric Value
โœ… Accuracy 92.97%
๐Ÿ“‰ Test Loss 0.2643

๐Ÿ“Œ The model performs exceptionally well on all classes except โ€œtrashโ€, which is underrepresented and visually ambiguous.


๐Ÿง  How It Works

  • ๐Ÿ“ Dataset loaded from TrashNet (resized & preprocessed)
  • ๐Ÿ” Data Augmentation: Flip, Zoom, Contrast, Rotation
  • โš–๏ธ Class balancing using computed weights
  • ๐Ÿง  Model: EfficientNetV2B2 with top layers replaced
  • ๐Ÿงช Training: Fine-tuned with EarlyStopping + ReduceLROnPlateau

๐Ÿ› ๏ธ Tech Stack

  • TensorFlow / Keras
  • EfficientNetV2B2 (ImageNet pretrained)
  • Gradio (web deployment)
  • Hugging Face Spaces
  • Python, NumPy, PIL

๐Ÿงช Sample Predictions

Example Image Predicted Class Confidence
Plastic bottle Plastic 0.93
Paper sheet Paper 0.91
Metal can Metal 0.89
Trash mix (wrong) Paper โŒ 0.61

โš ๏ธ Note: The โ€œtrashโ€ class has lower accuracy due to fewer examples and overlap with other categories.


๐Ÿ“ Project Structure

garbage-classification/
โ”œโ”€โ”€ app.py                        # Gradio interface
โ”œโ”€โ”€ EfficientNetV2B2_model.keras  # Trained model
โ”œโ”€โ”€ requirements.txt              # Dependencies
โ””โ”€โ”€ README.md                     # This file


๐Ÿ‘‰ Try the live app on Hugging Face

๐Ÿง‘โ€๐Ÿ’ป Author
Made with โค๏ธ by Seona Ann Tom
๐Ÿ”— GitHub: @seonaann

๐Ÿ“œ License
This project is licensed under the MIT License.

๐Ÿ™Œ Acknowledgements
Dataset inspired by TrashNet

Hugging Face for free model hosting via Spaces

Gradio for the fast, no-code interface

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages