# Task B Object Classifier First Pass This first-pass classifier recognizes Task B RGB crops as `sugar`, `mustard`, `banana`, or `unknown`. Artifacts: - Dataset: `outputs/datasets/task_b_object_crops/first_pass_20260624` - Dataset alias: `outputs/datasets/task_b_object_crops/latest` - Model: `outputs/models/task_b_object_classifier/first_pass_20260624` - Model alias: `outputs/models/task_b_object_classifier/latest` - Checkpoint: `checkpoint.pt` - TorchScript: `model_ts.pt` - Mapping: `class_mapping.json` - Metrics: `metrics.json` - Visual report: `prediction_contact_sheet.png` Dataset source: `scripts/generate_task_b_object_crops.py` launches Task B in a standalone offline scene, renders isolated objects with the legal head camera, and saves RGB crops. The saved dataset contains 80 sugar, 80 mustard, 80 banana, and 80 background/unknown crops. The generator uses RGB-D observations to form crop boxes, but the trained classifier input is RGB only. Legal boundary: Simulator ground truth is used only offline to write labels from the known Task B object index ranges: object 1-6 sugar, 7-12 mustard, and 13-18 banana. Future runtime policy code should load the TorchScript model on a legal camera RGB crop and must not read simulator object pose, object id, or labels. Commands: ```bash micromamba run -n atec2026 python scripts/generate_task_b_object_crops.py --headless --samples_per_class 80 --background_samples 80 --output outputs/datasets/task_b_object_crops/first_pass_20260624 --seed 24 --settle_steps 5 micromamba run -n atec2026 python scripts/train_task_b_object_classifier.py --data outputs/datasets/task_b_object_crops/first_pass_20260624 --output outputs/models/task_b_object_classifier/first_pass_20260624 --epochs 28 --batch_size 64 --seed 24 ``` Validation: Held-out crop validation accuracy is 96.875% (62/64). The model has 8,140 parameters and the TorchScript file is about 105 KB. | true \ pred | sugar | mustard | banana | unknown | |---|---|---|---|---| | sugar | 16 | 0 | 0 | 0 | | mustard | 0 | 15 | 1 | 0 | | banana | 0 | 1 | 15 | 0 | | unknown | 0 | 0 | 0 | 16 | Current heuristic context: An existing offline trace, `outputs/official_reach_tests/seed7_truefixed_16000_classifier_patch/trace.json`, shows the current color/aspect heuristic repeatedly confusing mustard observations as sugar or unknown. This is not the same held-out crop validation set, but it is the observed failure mode this model is intended to improve. Runtime loading sketch: ```python import json import torch model = torch.jit.load("outputs/models/task_b_object_classifier/latest/model_ts.pt", map_location="cpu") model.eval() mapping = json.load(open("outputs/models/task_b_object_classifier/latest/class_mapping.json")) # crop_tensor: [1, 3, 96, 96], RGB float in [0, 1], normalized by mean/std 0.5. pred_idx = int(model(crop_tensor).argmax(dim=1).item()) pred_class = mapping["idx_to_class"][str(pred_idx)] ```