Instructions to use khanhromvn/waste-detection-yolo11 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use khanhromvn/waste-detection-yolo11 with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("khanhromvn/waste-detection-yolo11", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Waste Detection YOLO11 (organic / recyclable / residual)
Object detection model that takes ONE photo and returns MANY bounding boxes, each labelled with one of 3 waste classes. Fine-tuned from yolo11m.pt (Ultralytics YOLO11).
- Author: KhanhRomVN (khanhromvn@gmail.com)
- Model file:
waste_detection_yolo11m.pt(38.6 MB, 20.06M params) - Framework: Ultralytics 8.4.182, PyTorch 2.11.0
- Task: object detection (not whole-image classification)
- License: MIT (check the licenses of the original datasets before commercial use)
Classes
| id | name | examples |
|---|---|---|
| 0 | organic |
food scraps, fruit, vegetables, bread, pizza, eggshell |
| 1 | recyclable |
plastic bottle, drink can, tin can, glass jar/bottle, cardboard, paper, metal lid |
| 2 | residual |
plastic bag/film, wrapper, crisp packet, styrofoam, disposable cup/cutlery, tissue, battery, cigarette butt, broken glass |
Demo: model output on real images
Left: original image. Right: model prediction (bounding boxes with class and confidence).
More pairs: images/demo/ (8 pairs, N_original.png / N_result.png).
Quick start
pip install ultralytics huggingface_hub
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
path = hf_hub_download(repo_id="khanhromvn/waste_classification", filename="waste_detection_yolo11m.pt")
model = YOLO(path)
results = model.predict("your_image.jpg", conf=0.25, imgsz=640)
results[0].save("result.jpg")
for b in results[0].boxes:
print(model.names[int(b.cls)], float(b.conf), b.xyxy.tolist())
Or use the CLI script in this repo:
pip install -r requirements.txt
python predict.py --source your_image.jpg --conf 0.25
Or the Ultralytics CLI with a local file:
yolo detect predict model=waste_detection_yolo11m.pt source=your_image.jpg conf=0.25
Recommended confidence threshold: 0.25 (see images/yolo11m/BoxF1_curve.png to pick your own).
Results (VAL: 441 images, 1,159 boxes, conf 0.001, IoU 0.6)
The TEST split was never used for model selection or reported here.
| Model | Params (M) | File size | Epochs run | Best epoch | mAP50 | mAP50-95 | P | R | ms/img (T4) | Train min |
|---|---|---|---|---|---|---|---|---|---|---|
| yolo11m (this model) | 20.06 | 38.6 MB | 32 | 24 | 0.495 | 0.388 | 0.606 | 0.463 | 24.0 | 241 |
| yolo11s | 9.43 | 18.3 MB | 54 | 34 | 0.481 | 0.373 | 0.602 | 0.450 | 8.5 | 206 |
| yolo11n | 2.61 | 5.2 MB | 55 | 40 | 0.455 | 0.349 | 0.541 | 0.453 | 3.8 | 181 |
This repo ships yolo11m (best accuracy). The yolo11s and yolo11n numbers are listed for comparison; their charts are in images/.
Per class AP50 / AP50-95 (yolo11m, VAL)
| Class | Boxes | AP50 | AP50-95 | P | R |
|---|---|---|---|---|---|
| organic | 396 | 0.519 | 0.398 | 0.606 | 0.446 |
| recyclable | 462 | 0.515 | 0.407 | 0.671 | 0.465 |
| residual | 301 | 0.450 | 0.357 | 0.540 | 0.478 |
Per source (yolo11m, VAL)
| Source | Images | mAP50 | mAP50-95 | Note |
|---|---|---|---|---|
| oi (Open Images v7) | 160 | 0.600 | 0.532 | labels incomplete, only 3 residual boxes |
| taco | 281 | 0.345 | 0.272 | only 6 organic boxes |
Charts
Demo pairs (original vs result) are in images/demo/ (N_original.png / N_result.png).
Training data
12,602 images (train 11,771 / val 441 / test 390), 9 sources mapped to 3 classes. Boxes: train 19,986 / val 1,159 / test 1,096. Train boxes per class: organic 6,119, recyclable 7,842, residual 6,025.
| Source | Images | Box type |
|---|---|---|
| fruits360 | 295 | auto-generated |
| g10v2 (10-class garbage) | 1,420 | auto-generated |
| g12 (12-class garbage) | 2,139 | auto-generated |
| oi (Open Images v7) | 1,052 | real boxes |
| realwaste | 2,240 | auto-generated |
| synth (synthetic composites) | 1,500 | composite |
| taco | 1,390 | real boxes |
| techsash (O/R set) | 1,779 | auto-generated |
| trashnet | 787 | auto-generated |
Val and test come only from the two sources with real boxes (taco, oi). Real-box training images are oversampled x2. Preprocessing: deduplication, CLIP zero-shot check of noisy labels (plastic bags moved from recyclable to residual), auto-generated boxes for label-only sources, synthetic composites. Label mapping per source: results/label_map.csv.
Training settings
imgsz 640, optimizer auto, lr0 0.01, lrf 0.01, warmup 3 epochs, weight decay 0.0005, mosaic 1.0 (off for last 10 epochs), mixup 0.1, HSV 0.015/0.7/0.4, fliplr 0.5, rotation 5 deg, translate 0.1, scale 0.5, AMP on, deterministic, seed 42. Hardware: Google Colab Free, Tesla T4. yolo11m: batch 16, patience 20, 4 h cap (stopped at epoch 32). Full details and scripts: training/README.md.
Limitations
- Moderate accuracy (mAP50 0.495); the main cause is data quality, not model size.
- Open Images annotations are incomplete, so precision/mAP on oi are artificially low.
- Rare class/source combinations (taco organic: 6 boxes, oi residual: 3 boxes) make some per-class numbers unreliable.
- Most training boxes are auto-generated, only taco and oi have real boxes.
- yolo11m was cut by a time cap at epoch 32.
- TEST split (390 images, 1,096 boxes) has not been evaluated yet.
residualis the hardest class. Not trained on clothes, shoes, textiles, electronics, light bulbs.- Not for safety-critical use.
Repo layout
waste_detection_yolo11m.pt model weights (Ultralytics .pt)
predict.py inference script
requirements.txt
images/ curves, confusion matrices, demo images (yolo11m / yolo11s / yolo11n)
results/ metrics CSV, manifest.json, dataset statistics, label_map.csv, classes.json
training/ phase1-4 scripts, args, config, logs
SHA-256 of waste_detection_yolo11m.pt: 9f2d19a7ce386c6dbb95a725e6197f7b6fb699cd601bbeca9407034396f2ad6a
Tom tat (Tieng Viet)
Mo hinh YOLO11m phat hien va phan loai rac thai trong anh thanh 3 nhom: huu co (organic), tai che (recyclable), rac con lai (residual). Huan luyen tren 12.602 anh tu 9 nguon du lieu, mAP50 = 0.495 va mAP50-95 = 0.388 tren tap val. Cach chay: xem phan Quick start o tren.
Citation
@misc{khanhromvn2026wastedetection,
author = {KhanhRomVN},
title = {Waste Detection YOLO11 (organic / recyclable / residual)},
year = {2026},
publisher = {Hugging Face},
email = {khanhromvn@gmail.com}
}
Built with Ultralytics YOLO11.
- Downloads last month
- 69
Evaluation results
- mAP50 on Waste detection VAL split (taco + oi, 441 images)self-reported0.495
- mAP50-95 on Waste detection VAL split (taco + oi, 441 images)self-reported0.388
- precision on Waste detection VAL split (taco + oi, 441 images)self-reported0.606
- recall on Waste detection VAL split (taco + oi, 441 images)self-reported0.463












