Drop a waste photo, watch it get sorted and see what the model looked at
ResNet50
Powered by Grad-CAM
Drop a waste image or click to upload
PNG or JPG, up to 10 MB, 224×224 recommended
JPG / PNG
Original
Grad-CAM
lowhigh
PredictionPlastic
94%confidence
Cardboard
Glass
Metal
Paper
Plastic
Trash
How it works
From photo to prediction
Four steps run every time you hit Classify.
1
Preprocess
Your photo is resized to 224×224 and normalized to ImageNet statistics, the same transform the model saw during training.
2
Classify
A ResNet50 fine-tuned on TrashNet runs a forward pass, and a softmax turns its outputs into probabilities across the six material classes.
3
Explain with Grad-CAM
Gradients for the winning class are traced back to the last convolutional layer to build a heatmap of the regions that drove the decision.
4
Read the result
You get the predicted material, its confidence, the full probability distribution, and the heatmap overlaid on your image.
Model served by FastAPI on Hugging Face Spaces, frontend on Vercel
Results
Three backbones, one fair split
Every model trained and evaluated on the identical seed-locked split, so the comparison is honest.
Model
Acc
F1
AUC
ResNet50 live
91.6%
0.916
0.99
Ensemble
91.0%
0.911
0.99
MobileNetV2
84.2%
0.847
0.97
EfficientNet-B0
80.5%
0.806
0.97
The hardest class is trash, with only 137 images in the dataset. A weighted sampler and label smoothing lift its recall well above what a naive model reaches.
TrashNet, 70/15/15 split, test set never seen during training
About
See what the AI sees
NemVision is a waste-image classifier that does two things at once. It predicts what a piece of trash is made of, and it shows the exact regions the model used to decide.
It is trained on TrashNet, 2,527 images across six materials: cardboard, glass, metal, paper, plastic, and trash. Three ImageNet-pretrained backbones were benchmarked under one identical split. ResNet50 won at 91.6% and is the model serving this demo.
The pipeline is built to stay honest on a small, imbalanced dataset: selective fine-tuning so general features stay intact, a weighted sampler to lift the rare trash class, label smoothing, AdamW with a cosine schedule, and a test set that is never touched during training. Grad-CAM adds explainability so a prediction is never a black box.
PyTorchtorchvisionGrad-CAMFastAPIHugging Face SpacesVercel