ysfad's picture
Upload README.md with huggingface_hub
2d47b82 verified
|
raw
history blame
4.58 kB
metadata
title: MAE Waste Classifier
emoji: πŸ—‚οΈ
colorFrom: green
colorTo: blue
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
models:
  - ysfad/mae-waste-classifier
datasets:
  - garythung/trashnet
tags:
  - computer-vision
  - image-classification
  - waste-management
  - recycling
  - mae
  - vision-transformer
  - environmental

πŸ—‚οΈ MAE Waste Classification System

An intelligent waste classification system using a finetuned MAE (Masked Autoencoder) ViT-Base model that achieves 93.27% validation accuracy on 9 waste categories.

🎯 Features

  • High Accuracy: 93.27% validation accuracy on waste classification
  • Fast Inference: Optimized ViT-Base architecture for real-time classification
  • Comprehensive: Covers 9 major waste categories
  • Smart Instructions: Provides specific disposal instructions for each item
  • Modern UI: Clean, intuitive Gradio interface

πŸ† Model Performance

  • Architecture: Vision Transformer (ViT-Base) with MAE pretraining
  • Training Data: RealWaste dataset (4,752 images)
  • Validation Accuracy: 93.27%
  • Training Accuracy: 99.89%
  • Parameters: 86M parameters
  • Preprocessing: MAE-style image preprocessing

πŸ“Š Waste Categories

The model can classify the following 9 waste categories:

  1. Cardboard - Recyclable paper-based packaging
  2. Food Organics - Compostable food waste
  3. Glass - Recyclable glass containers
  4. Metal - Recyclable metal items (cans, foil)
  5. Miscellaneous Trash - General non-recyclable waste
  6. Paper - Recyclable paper products
  7. Plastic - Various plastic items
  8. Textile Trash - Fabric and clothing waste
  9. Vegetation - Organic plant matter

πŸ”¬ Technical Details

Model Architecture

  • Base Model: Vision Transformer (ViT-Base/16)
  • Pretraining: MAE (Masked Autoencoder) self-supervised learning
  • Finetuning: Supervised classification on RealWaste dataset
  • Input Size: 224x224 pixels
  • Patch Size: 16x16 pixels

Training Process

  1. Pretraining: MAE self-supervised learning on ImageNet
  2. Finetuning: Classification head training on RealWaste dataset
  3. Optimization: AdamW optimizer with learning rate scheduling
  4. Data Augmentation: Standard vision transforms

Performance Metrics

  • Validation Accuracy: 93.27%
  • Training Accuracy: 99.89%
  • Training Time: ~15 epochs
  • Hardware: NVIDIA RTX 3080 Ti

πŸš€ Usage

Online Demo

Simply upload an image of a waste item to get:

  • Classification with confidence score
  • Disposal instructions for proper waste management
  • Top-k predictions with detailed breakdown

Model Access

The trained model is available on Hugging Face Hub:

Local Usage

from mae_waste_classifier import MAEWasteClassifier

# Load model from HF Hub
classifier = MAEWasteClassifier(hf_model_id="ysfad/mae-waste-classifier")

# Classify image
result = classifier.classify_image("path/to/image.jpg")
print(f"Predicted: {result['predicted_class']} ({result['confidence']:.3f})")

🌍 Environmental Impact

This system supports sustainable waste management by:

  • Reducing contamination in recycling streams
  • Educating users about proper disposal methods
  • Improving sorting accuracy in waste facilities
  • Promoting recycling awareness

πŸ“ˆ Dataset

Trained on the RealWaste dataset:

  • Total Images: 4,752
  • Training Split: 3,801 images (80%)
  • Validation Split: 951 images (20%)
  • Categories: 9 waste types
  • Quality: High-resolution real-world images

πŸ”§ Technical Requirements

  • Python: 3.8+
  • PyTorch: 2.0+
  • Transformers: Latest
  • Gradio: 4.44.0+
  • PIL: Image processing
  • NumPy: Numerical operations

πŸ“ License

This project is licensed under the MIT License. See the model repository for more details.

🀝 Contributing

Contributions are welcome! Areas for improvement:

  • Additional waste categories
  • Multi-language support
  • Mobile optimization
  • Integration with IoT devices

πŸ“ž Contact

For questions or collaboration opportunities, please reach out through the Hugging Face model repository.


🌱 Built for a sustainable future through AI-powered waste management