Overview
The Trash Classification AI System is trained to detect and classify three categories of recyclable waste materials. Each category has a unique identifier, color coding, and detection parameters.Waste Categories
The system recognizes the following waste types:Class Details
Cardboard & Paper
Class ID: 0
Color: Blue (BGR: 255, 0, 0)
Common items: boxes, newspapers, magazines, paper bags
Color: Blue (BGR: 255, 0, 0)
Common items: boxes, newspapers, magazines, paper bags
Metal
Class ID: 1
Color: Yellow (BGR: 255, 255, 0)
Common items: aluminum cans, tin cans, metal containers
Color: Yellow (BGR: 255, 255, 0)
Common items: aluminum cans, tin cans, metal containers
Plastic
Class ID: 2
Color: Gray (BGR: 200, 200, 200)
Common items: bottles, containers, packaging
Color: Gray (BGR: 200, 200, 200)
Common items: bottles, containers, packaging
Color Coding System
Each waste category is visualized with a distinct color for easy identification:Colors are specified in BGR format (Blue, Green, Red) as per OpenCV convention.
Visual Examples
When trash is detected, the system applies color-coded visualization:Detection Confidence
The system uses a confidence threshold to filter out low-quality detections:Confidence Threshold: 0.55 (55%)Only detections with confidence scores above 55% are included in the results. This threshold balances between detecting genuine trash objects and avoiding false positives.
Confidence Score Interpretation
| Confidence Range | Interpretation |
|---|---|
| 0.90 - 1.00 | Very high confidence - Clear, unambiguous detection |
| 0.75 - 0.89 | High confidence - Strong detection with good visibility |
| 0.55 - 0.74 | Moderate confidence - Valid detection, may have partial occlusion |
| < 0.55 | Below threshold - Filtered out as uncertain |
Class Mapping and IDs
The class ID system is used throughout the pipeline:In Segmentation Results
In Drawing Operations
Training Data Implications
The three-class system reflects the model’s training data:Focused Categories
The model specializes in three common recyclable materials, allowing for high accuracy within these categories.
Recyclability Focus
All three categories (paper, metal, plastic) are recyclable materials, making the system ideal for waste sorting applications.
Extending the Class System
To add new waste categories, you would need to:Retrain the Model
Add new labeled training data for the additional category and retrain the YOLO model
Implementation Reference
The complete class configuration is located in:The
trash_classes dictionary is imported and used across multiple modules, ensuring consistent class naming throughout the system.