Waste Classifier (Bio vs Non-Bio) โ€” YOLOv8s-cls

A lightweight image classifier that sorts waste photos into biodegradable (Bio) and non-biodegradable (Non_Bio). It is YOLOv8s-cls fine-tuned from the COCO/ImageNet-pretrained checkpoint on the Waste_SIP_Dataset.

  • Task: binary image classification
  • Classes: Bio, Non_Bio
  • Architecture: YOLOv8s-cls (~10 MB checkpoint)
  • Input size: 224 ร— 224
  • Best validation top-1 accuracy: 0.96 (epoch 19 of 20)

Quick start

pip install ultralytics huggingface_hub
from huggingface_hub import hf_hub_download
from ultralytics import YOLO

weights = hf_hub_download(repo_id="W4ashabii/waste_classifier", filename="best.pt")
model = YOLO(weights)

results = model.predict("your_image.jpg", imgsz=224)
r = results[0]
print(r.names[r.probs.top1], float(r.probs.top1conf))

Batch prediction on a folder:

results = model.predict("path/to/images/", imgsz=224)
for r in results:
    print(r.path, r.names[r.probs.top1], round(float(r.probs.top1conf), 3))

Results

Metrics from the validation split, using the best checkpoint (best.pt, epoch 19):

Metric Value
Top-1 accuracy 0.960
Final-epoch (20) top-1 accuracy 0.955
Final training loss 0.038

Per-class recall (from the normalized confusion matrix):

Class Recall
Bio 0.97
Non_Bio 0.95

Top-5 accuracy is always 1.0 because there are only two classes, so it is not informative.

Training lasted about 2.3 minutes (140 s for 20 epochs).

Training curves Normalized confusion matrix

Note: best.pt was chosen by validation accuracy, so the validation numbers above are slightly optimistic. For an unbiased estimate, evaluate on the dataset's held-out test split.

Training details

Setting Value
Base model yolov8s-cls.pt (pretrained)
Framework Ultralytics YOLOv8
Epochs 20 (early-stopping patience 5)
Image size 224
Batch size 64
Optimizer AdamW
Initial learning rate 1e-3, cosine schedule
Precision FP16 mixed precision (AMP)
Hardware NVIDIA RTX 4070 (8 GB)

Dataset

Trained on Pramudit/Waste_SIP_Dataset, an image-folder dataset with train, validation and test splits and two classes (Bio, Non_Bio). Please refer to the dataset page for its license, collection method and class distribution.

Intended use

  • Demos, teaching and prototyping of automated waste sorting
  • A baseline for waste-classification research
  • Starting point for further fine-tuning on your own waste images

Limitations

  • Binary only. The model tells biodegradable from non-biodegradable. It does not identify material types (plastic, glass, metal, paper) and does not detect or locate objects in an image.
  • Single-object assumption. It classifies the whole image, so photos with mixed waste or cluttered scenes may give unreliable results.
  • Domain shift. Accuracy was measured on images from one dataset. Performance can drop with different cameras, lighting, backgrounds, or waste types that are rare in the training data.
  • Not safety-critical. Do not rely on it as the sole decision-maker for real waste handling, hygiene or compliance.

License

The weights are released under AGPL-3.0, in line with the Ultralytics YOLOv8 license. The training data has its own license; check the dataset page before commercial use.

Citation

@software{jocher2023ultralytics,
  author  = {Jocher, Glenn and Chaurasia, Ayush and Qiu, Jing},
  title   = {Ultralytics YOLOv8},
  version = {8.0.0},
  year    = {2023},
  url     = {https://github.com/ultralytics/ultralytics},
  license = {AGPL-3.0}
}
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for W4ashabii/waste_classifier

Finetuned
(231)
this model

Dataset used to train W4ashabii/waste_classifier