24-679: Campus Recycling and Trash Bin Classifier
This model classifies photographs of campus bins as recycling (0) or trash (1). It fine-tunes a pretrained ResNet-18 with AutoGluon MultiModal for the Week 4 models lesson in Carnegie Mellon University's 24-679, Fall 2026 course.
The intended use is teaching image preparation, transfer learning, and evaluation. It classifies the bin shown in a photograph; it does not identify waste materials or determine whether a particular item is recyclable.
Inputs and outputs
Supply a pandas DataFrame with an image column containing local image-file paths. The predictor reads the pixels; labels and provenance fields are not inputs. predict() returns 0 or 1, and predict_proba() returns class probabilities.
| Label | Meaning |
|---|---|
0 |
Recycling bin |
1 |
Trash bin |
The dataset provides 512 × 512 RGB images, with EXIF orientation applied, aspect ratio preserved, and gray padding. The saved model then applies its own shorter-side resize, center crop, and ImageNet normalization. Use the same preparation for comparable results on new photographs.
Data and training
Source: 2026 campus bin photographs, revision 688cb8cffb4ef986a966dc729c72b2307eb9f69c.
| Partition | Original photos | Stored variants | Total | Recycling / trash |
|---|---|---|---|---|
| Training | 86 | 344 | 430 | 220 / 210 |
| Validation | 19 | 0 | 19 | 10 / 9 |
| Test | 19 | 0 | 19 | 10 / 9 |
Original photos were split with class stratification before augmentation. Each training original contributes four separately generated variants: brightness, rotation, contrast, and Gaussian blur. The dataset card documents the actual transform strengths. Related variants stay in training; different photos of the same physical bin or location can still cross partitions.
Labels come from the survey's upload question/folder and were not independently verified from pixels.
| Training setting | Recorded value |
|---|---|
| Framework | AutoGluon MultiModal 1.6.1 |
| Image backbone | timm resnet18, pretrained, fine-tuned for two classes |
| Parameters | Approximately 11.2 million; all trainable |
| Preset and branch | medium_quality; model.names = ["timm_image"] |
| Selection metric | Validation accuracy |
| Fit budget and seed | 300 seconds; 24679 |
| Optimizer | AdamW; learning rate 0.0004; weight decay 0.001 |
| Learning-rate schedule | Cosine decay with layerwise decay |
| Training image processing | Resize, center crop, and TrivialAugment |
| Checkpoint selection | Up to three checkpoints, greedy-soup averaging |
| Recorded environment | Linux; Python 3.13.15; PyTorch 2.11.0+cu128; NVIDIA A100-SXM4-40GB |
The course notebook reports 61.34 seconds of training and final validation accuracy 0.9474 (18/19). The 300 seconds above is the configured budget, not the measured duration. The saved configuration uses mixed precision and does not enable deterministic execution; a seed alone does not guarantee an identical rerun.
Evaluation
The course notebook downloaded and reloaded the native archive from this repository, then displayed predictions for all 19 original test photographs. The results below were recalculated from those predictions, and the true labels were checked against the pinned dataset. Image inference was not independently rerun for this card.
Documented model revision: e546b34f2c26de6c3a504c30d7937f24e272c47b.
| Test metric | Value |
|---|---|
| Accuracy | 0.9474 (18/19) |
| Balanced accuracy | 0.9500 |
| Weighted F1 | 0.9474 |
| Macro F1 | 0.9474 |
| Training-majority baseline accuracy, always recycling | 0.5263 (10/19) |
Confusion matrix: rows are actual labels; columns are predicted labels.
| Actual / predicted | Recycling | Trash |
|---|---|---|
| Recycling | 9 | 1 |
| Trash | 0 | 9 |
One recycling photograph was classified as trash. Each changed prediction moves accuracy by about 5.26 percentage points. This small test set is not an evaluation on entirely new bins, photographers, or locations.
Backgrounds, bin color, signage, and camera angles may provide shortcuts. Augmentation does not create independent photos or guarantee preserved visual evidence. Performance on other campuses, unfamiliar bins, ambiguous images, or changed lighting remains unestablished. Broader use requires a larger evaluation grouped by physical bin and location, plus review of per-class errors and labels.
Load and predict
Use a compatible AutoGluon environment, preferably matching the recorded Python and library versions. Download the full native archive to restore the configuration, preprocessing, and checkpoint together. Both the native loader and the separate pickle use serialized Python objects, so load only trusted artifacts. See the AutoGluon loading documentation.
python -m pip install "autogluon.multimodal==1.6.1" "datasets==5.0.1" huggingface_hub
from pathlib import Path
import zipfile
import pandas as pd
from huggingface_hub import hf_hub_download
from datasets import load_dataset
from autogluon.multimodal import MultiModalPredictor
# Pin the artifact and prepared image dataset used for the reported results.
MODEL_REVISION = "e546b34f2c26de6c3a504c30d7937f24e272c47b"
DATA_REVISION = "688cb8cffb4ef986a966dc729c72b2307eb9f69c"
archive = hf_hub_download(
"ccm/2026-24679-image-autogluon-predictor",
"autogluon_image_predictor_dir.zip",
revision=MODEL_REVISION,
)
# Load the complete native directory, including model.ckpt and preprocessing.
model_dir = Path(f"bin_model_{MODEL_REVISION[:8]}")
model_dir.mkdir(exist_ok=True)
with zipfile.ZipFile(archive) as bundle:
bundle.extractall(model_dir)
predictor = MultiModalPredictor.load(str(model_dir))
# Materialize one already-prepared test image for a reproducible demonstration.
test = load_dataset(
"ccm/2026-24679-image-dataset", revision=DATA_REVISION, split="test"
)
image_path = model_dir / "example_bin.png"
test[0]["image"].convert("RGB").save(image_path)
inputs = pd.DataFrame({"image": [str(image_path.resolve())]})
# Classify the pixels without providing the true label to the predictor.
labels = predictor.predict(inputs)
print(labels.map({0: "Recycling", 1: "Trash"}))
print(predictor.predict_proba(inputs)) # Columns 0 and 1 correspond to the labels above.
For new images, replace the example path with paths to your prepared RGB photographs. Use validation data for model choices and reserve an independent test set for final scoring.
Licensing and provenance
Maintainer: ccm. The repository had no model license specified when this card was added; this card does not assign one. Refer to the dataset card for image collection, consent, and reuse limitations. Removing camera metadata does not remove identifying details visible in an image.