Overview
Reciclaje AI classifies waste into 5 distinct categories to facilitate proper recycling and waste management. Each class is assigned a unique ID and visual color code for easy identification.Classification System
The model outputs a class ID (0-4) for each detected object. The mapping is as follows:Class 0: Metal
Metallic waste materials including cans, foil, and metal containers.
Class 1: Glass
Glass bottles, jars, and other glass containers.
Class 2: Plastic
Plastic bottles, containers, bags, and plastic packaging materials.
Class 3: Carton
Cardboard boxes, paper cartons, and similar paper-based materials.
Class 4: Medical
Medical waste including syringes, masks, and healthcare-related items.
Visual Color Coding
Each class is displayed with a distinctive color for quick visual identification:OpenCV uses BGR (Blue-Green-Red) color format instead of the standard RGB format. This is why red is represented as
(0, 0, 255) rather than (255, 0, 0).Class Detection Implementation
Here’s how the system processes class predictions:Label Rendering
Each detection displays a label with the class name and confidence percentage:The black background rectangle ensures text readability regardless of the underlying frame content.
Class-Specific UI Integration
The GUI version (main.py) displays corresponding icons and text labels for each detected class:
Detection Examples
Metal Detection Example
Metal Detection Example
When a metal can is detected:
- Class ID:
0 - Label:
"Metal 95%"(example confidence) - Bounding box color: Yellow/Cyan
- UI displays metal icon and recycling instructions
Plastic Detection Example
Plastic Detection Example
When a plastic bottle is detected:
- Class ID:
2 - Label:
"Plastic 87%"(example confidence) - Bounding box color: Red
- UI displays plastic icon and recycling instructions
Medical Waste Detection Example
Medical Waste Detection Example
When medical waste is detected:
- Class ID:
4 - Label:
"Medical 92%"(example confidence) - Bounding box color: Blue
- UI displays medical waste warning and disposal instructions
Why These 5 Classes?
Recyclable Materials
Metal, Glass, Plastic, and Carton are the most common recyclable materials in household and industrial waste.
Safety Priority
Medical waste requires special handling and disposal procedures. Early identification prevents contamination and health hazards.
Educational Value
These categories align with standard recycling education curricula, making the system ideal for schools and educational programs.
Practical Implementation
Five classes provide a good balance between specificity and model complexity for real-time detection on standard hardware.
Extending the Classification System
Next Steps
How It Works
Learn about the complete detection pipeline
Model Architecture
Understand the YOLOv8 model behind the classifications