Introduction
The Trash Classification AI System uses YOLOv11 (specifically the YOLOv11n-seg variant) for instance segmentation of recyclable materials. This training pipeline enables you to train a custom model to detect and segment three classes of trash: cardboard/paper, metal, and plastic.YOLOv11 is the latest version of Ultralytics’ YOLO family, offering improved accuracy and faster inference speeds compared to previous versions.
Why YOLOv11?
YOLOv11 was selected for this project due to:- Real-time Performance: Optimized for fast inference on edge devices
- Instance Segmentation: Provides pixel-level masks for precise object boundaries
- Efficient Architecture: The nano variant (yolo11n-seg) balances accuracy with model size
- Transfer Learning: Pre-trained weights accelerate training convergence
- Multi-platform Support: Compatible with CUDA, MPS (Apple Silicon), and CPU
Hardware Requirements
Recommended Setup
- GPU: NVIDIA GPU with 8GB+ VRAM (RTX 3060 or higher)
- RAM: 16GB minimum, 32GB recommended
- Storage: 10GB+ for dataset and training artifacts
- CPU: Multi-core processor (for data loading)
Supported Devices
The training script automatically detects and uses the best available device:Training Resources
Expected Training Time
| Device Type | Epochs | Estimated Time |
|---|---|---|
| NVIDIA RTX 3080 | 300 | 2-4 hours |
| Apple M1/M2 | 300 | 4-8 hours |
| CPU Only | 300 | 24-48 hours |
Training Configuration
The default training configuration uses:- Model: YOLOv11n-seg (nano segmentation variant)
- Epochs: 300
- Image Size: 640x640
- Batch Size: Automatic (optimized for available memory)
- Early Stopping: 10 epochs patience
- Task: Instance segmentation
Training Pipeline Components
- Dataset Preparation: Organize images and annotations in YOLO format
- Model Initialization: Load pre-trained YOLOv11n-seg weights
- Training: Train with automatic device selection and monitoring
- Evaluation: Validate performance on validation set
- Export: Save best model weights for deployment
Next Steps
Dataset Preparation
Learn how to structure your dataset and prepare annotations
Model Training
Configure and run the training script