$ cat wastesep/README.md
Research Assistant · NICHE Robotics Lab, University of Michigan-Dearborn · Jan 2026 – Present · Dearborn, MI

Fine-tuning a vision-language model to sort waste, and building the sorter around it

I fine-tuned Qwen3-VL-4B with reinforcement learning (GRPO) to detect nine kinds of cafeteria waste, then built a sorter around it: a spectral sensor checks for grease, and a servo flap routes each item to recycling or landfill.

Role
Research Assistant: model fine-tuning and evaluation, plus the sensing and software around the model
Goal
Route each cafeteria item to recycling or landfill, and fail safe when unsure
Context
NICHE Robotics Lab · UMHealth waste streams · U-M Graham Sustainability Institute
+0.16
micro F1 over the base model on held-out whole images (0.42 → 0.58) · 100 test images
0 → 85%
correct "no object" answers on empty image regions after redesigning the reward (base model: 98%)
~3s
per decision · ~6 s when the spectral contamination check is required
Assembled WasteSep unit next to a tape measure WasteSep unit, side view WasteSep unit, front view
Fig 1. The assembled WasteSep unit, shown with a tape measure for scale (left), from the side (center) and from the front (right)
Problem

Contamination can get a whole recycling batch rejected

UMHealth's recycling vendor rejects a batch if more than 20–25% of it is contaminated. A clean item sent to landfill costs one item; a dirty one sent to recycling can cost the whole batch. So the system sends anything it is unsure about to landfill.

Fine-tuning

GRPO fine-tuning of Qwen3-VL-4B for structured detection

The model has one job: return every waste item in the photo as JSON ({"objects": [{"label", "bbox"}]}), with corner-format boxes on a 0–1000 grid. Routing stays outside the model. I started with a prompt-only 30B prototype (24 s per frame on an RTX 2000 Ada), moved to 8B (6 s), and settled on Qwen3-VL-4B, fine-tuned with reinforcement learning instead of supervised loss.

01Method: GRPO (TRL) with a rank-16 LoRA adapter via Unsloth, bf16, on an RTX PRO 6000 Blackwell. Each image gets eight sampled answers, scored against each other.
02Reward: five parts, covering valid JSON, correct labels, box overlap (IoU), object count and completeness. Predictions are matched to ground truth by Hungarian matching. IoU is scored continuously so near-misses still teach.
03Data: nine item classes (to-go box, to-go cup, cup lid, straw, tissue, paper, wrapper, plastic bottle, glass bottle), because recycling rules name items, not materials. 1,845 objects on 994 TACO images, split 745 / 149 / 100. Food waste was dropped as a class: with 5 examples, an exact-match reward suppresses it instead of learning it.
Results

Fine-tuning improved labels, not localization

On 100 held-out test images, micro F1 at IoU 0.5 rose from 0.42 (base) to 0.58 (fine-tuned). The base model already placed boxes well: 25 of the 32 extra correct detections on validation were label fixes on objects it had already found.

What went wrong

Bugs that made bad runs look good, and a model that couldn't say "nothing"

01Box format. The scorer read Qwen3-VL's corner boxes as centre/width/height. Near-perfect predictions scored about 0.18, and one run falsely appeared to triple its localization. I caught it by drawing the boxes on images, not from the metrics.
02Reward denominator. The overlap reward divided by matches instead of true objects, so predicting fewer boxes scored higher.
03Prompt keys. Prompt and parser used different JSON keys, so the format reward was zero on every answer.
04Evaluation leak. A crop design placed test windows using the ground-truth boxes. I relabelled those numbers as upper bounds and rebuilt the windows as a label-free grid.

Hallucination on empty regions. The fine-tuned model drew a box on almost every empty image tile, because no training image was ever empty and the reward could not score an empty answer as correct. I changed the reward to give full marks for "nothing" on an empty input and added 15% empty tiles to training. In a controlled experiment, with the success criteria fixed before testing, correct "nothing" answers rose from 0% to 85% (the base model scores 98%), at a cost of about 0.05 whole-image F1. These results are pending an independent recomputation.

The system

The camera proposes, the spectral sensor vetoes, a fixed rule decides

01The camera photographs the item on the tray and the model identifies it.
02For to-go boxes, an AS7265x spectral sensor under the tray checks the surface for grease.
03A routing table (a config file, editable from the dashboard) picks the bag. Anything unidentified, unclear or failed goes to landfill, with the reason logged.
04A servo flap drops the item into the green or clear bag: about 3 s per decision, or 6 s with the spectral check.
Diagram: camera, light sensor and depth camera feed a decision step that drives the flap to the green or clear bag
Fig 2. How one item is sorted: 3 sensors, 1 decision step, 2 bags
01 / 05
Fig 3. Tray-camera recordings of single items being sorted (15 fps, no audio): Clean flat tissue

How the grease check works. Clean cardboard's rough fibers scatter light, so it reads bright. Oil fills the gaps and the surface reads darker. A drop of 4% or more against a clean reference sends the item to landfill. In a bench test with oil spread on cardboard, the change was about 2.5× the normal variation between clean boxes, and calibration held within 0.2% over 8 days. Oil in one thick spot, honey, and plastic-lined cups are not yet detected reliably.

Spectral readings for clean, tomato juice, sauce, water and oil samples on to-go boxes
Fig 4. Spectral readings for a clean to-go box and boxes with tomato juice, sauce, water and oil. Only oil reads clearly darker than clean. Channels above about 750 nm are ignored.

Every item's footage, spectral reading and decision is recorded. A dashboard compares readings against the clean reference and exports to CSV, JSON or Excel. Before trusting the sensor, I found three silent faults in an 80-reading pilot (duplicate reads, zero readings on dark items, placement-dependent readings) and fixed each one.

Dashboard comparing one item's spectral reading with the clean reference
Fig 5. Dashboard view of one item's spectral reading against the clean reference
Build photos
CAD drawing of the base assembly with dimensions in mm
CAD drawing of the base assembly (mm)
Color and depth camera mounted inside the housing Raspberry Pi that runs the light sensor
Camera inside the housing (left) and the Raspberry Pi that runs the spectral sensor (right)
Sensor window in the tray, seen from above Light sensor under the tray window
Sensor window in the tray (left) and the spectral sensor beneath it (right)
Limits & next steps

A working proof of concept, not yet a product

The model sometimes confuses paper with wrappers, single-spot stains slip past the grease check, and the system is not yet liquid safe, so liquid safety testing comes before a cafeteria field test. Next: fine-tuning on in-domain tray images, a broader contamination check, a servo-driven gate for touch-free use, and faster decisions.

Skills demonstrated
vision-language modelsQwen3-VLGRPO fine-tuningreward designLoRAUnslothevaluation designspectral sensingmodel serving (FastAPI)