Downloads · 30 days
0
TheHelltaker/smart-waste-segregator
smart-waste-segregator is a image classification model from TheHelltaker. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
Weights for the Smart Waste Segregator, a Raspberry Pi bin that classifies incoming trash and sorts it with a dual-flap servo mechanism.
Downloads · 30 days
0
Access
Public
Updated Aug 26, 2026
Repo size
80.4 MB
Likes
0
Public
Click a slice to open those files.
.torchscript22.5 MB · 28%
From the Hugging Face model README
Weights for the Smart Waste Segregator, a Raspberry Pi bin that classifies incoming trash and sorts it with a dual-flap servo mechanism.
Code, notebooks and evaluation artifacts: https://github.com/divyanshuklai/smart-waste-segregator
mobilenetv3-small/
best_model.pth 18.5 MB trained PyTorch checkpoint
waste_classifier.onnx 6.1 MB ONNX export, this is what runs on the Pi
yolo11/
yolo11n.pt 5.6 MB detection weights
yolo11n-cls.pt 5.8 MB classification weights
yolo11n.torchscript 11.1 MB TorchScript export
yolo11n-cls.torchscript 11.5 MB TorchScript export
yolo11n_ncnn_model/ NCNN export (model.ncnn.bin, .param, model_ncnn.py, metadata.yaml)
yolo11n-cls_ncnn_model/ NCNN export
The shipped model is MobileNetV3-Small, not MobileNetV2. A MobileNetV2 was trained
as a separate experiment but did not ship. The checkpoint here has squeeze-and-excite
blocks and the ONNX graph contains 28 HardSigmoid nodes, both of which identify it
as V3-Small.
Classes, in the order the shipped weights expect:
0 metal
1 plastic
2 glass
3 biodegradable
Training
| Best validation accuracy | 91.63% (epoch 9 of 10) |
| Train accuracy that epoch | 98.15% |
| Optimizer | Adam, lr 1e-3 |
| Dataset | 6,571 images, four classes grouped from 8 source folders |
| Split | 5,256 train / 1,315 validation |
| PyTorch | 2.4.1 |
A second run in the same notebook used 20 epochs, 165 batches per epoch, OneCycleLR,
early stopping with patience 5, and heavier augmentation. Per-epoch numbers were not saved.
ONNX export
| Opset | 11 |
| Input | (1, 3, 224, 224) NCHW float32, dynamic batch axis |
| Output | (1, 4) |
| Constant folding | on |
| Parity vs PyTorch | rtol=1e-3, atol=1e-5 |
On-device inference uses onnxruntime with CPUExecutionProvider,
GraphOptimizationLevel.ORT_ENABLE_ALL and intra_op_num_threads = 4. Images are
captured with libcamera-still at 2592x1944, converted BGR to RGB with OpenCV and
resized to 224x224.
import onnxruntime, numpy as np
opts = onnxruntime.SessionOptions()
opts.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL
opts.intra_op_num_threads = 4
sess = onnxruntime.InferenceSession(
"mobilenetv3-small/waste_classifier.onnx",
providers=["CPUExecutionProvider"],
sess_options=opts,
)
x = np.random.rand(1, 3, 224, 224).astype(np.float32)
logits = sess.run(None, {sess.get_inputs()[0].name: x})[0]
print(["metal", "plastic", "glass", "biodegradable"][int(logits.argmax())])
A later pass exporting YOLO11n to formats that run on constrained hardware.
| Parameters (yolo11n-cls) | 2,807,024 |
| FLOPs | 4.2 G |
| Fused layers | 47 |
| TorchScript size | 10.9 MB |
| NCNN size | 10.7 MB |
| Ultralytics | 8.3.82 |
| torch | 2.6.0 |
NCNN classifier timing on the bus.jpg sample: 124.0 ms inference, 78.8 ms
preprocess, 1.3 ms postprocess.
Read these before using the weights for anything.
BIODEGRADABLE, CARDBOARD, GLASS, METAL, PAPER, PLASTIC), drops every index >= 4, which discards 860 of 1,042 images, then reads the
surviving indices against a different four-class list. The large off-diagonal count in
the repository's confusion matrix is that mismapping, not model error.smart_waste_segregation.py uses ['plastic', 'paper', 'metal', 'glass'], which is
wrong for the model it loads, so the device printed mislabelled class names. This is
documented rather than silently corrected.Divyansh Shukla, 2024-2025. Smart Waste Segregator.