WasteWise Garbage Classifier (YOLOv8n-cls)
Fine-tuned YOLOv8n-cls model for waste segregation at office/public kiosks.
Model Details
| Field | Value |
|---|---|
| Architecture | YOLOv8n-cls (classification head) |
| Input | RGB 224x224, normalized to [0,1] |
| Output | 8-class softmax probabilities |
| Format | ONNX (opset 17) |
| Size | ~5.5 MB |
| Accuracy | 94.4% top-1 on validation set |
| Dataset | garbage_office (8 classes, custom) |
Classes
| Index | Class |
|---|---|
| 0 | battery |
| 1 | biological |
| 2 | cardboard |
| 3 | glass |
| 4 | metal |
| 5 | paper |
| 6 | plastic |
| 7 | trash |
Training
- Dataset: garbage_office (8 classes, ~15k images)
- Framework: Ultralytics YOLOv8 + exported to ONNX
- Epochs: 50
- Image size: 224x224
- Augmentation: Standard YOLOv8 augmentation pipeline
Usage (Python)
import numpy as np
from PIL import Image
import onnxruntime as ort
session = ort.InferenceSession("wastewise-yolo.onnx")
img = Image.open("test.jpg").convert("RGB").resize((224, 224))
arr = np.array(img, dtype=np.float32) / 255.0
tensor = arr.transpose(2, 0, 1)[np.newaxis] # [1, 3, 224, 224]
outputs = session.run(None, {session.get_inputs()[0].name: tensor})
scores = outputs[0][0]
class_id = int(np.argmax(scores))
CLASS_NAMES = ["battery","biological","cardboard","glass","metal","paper","plastic","trash"]
print(f"Predicted: {CLASS_NAMES[class_id]} ({scores[class_id]:.1%})")
Part of WasteWise
This model powers WasteWise - an AI-powered waste segregation kiosk built on SAP BTP.