DL
Daniel LeoneActive
SWE & ML Systems
← Portfolio Overview•
Edge AI & Computer Vision•Milestone v0.1.0

Sprite YOLO Object Detection Studio

A compact YOLO-style CNN object detector with a deterministic procedural synthetic dataset engine. The 389,958-parameter network runs entirely client-side in your browser via ONNX Runtime Web (WebAssembly)β€”zero server latency, zero cloud costs, and 60 FPS slider reactivity.

Parameters: 389,958
Model Weight: 1.56 MB ONNX
Benchmark mAP@0.50: 0.941
Optimal F1: 0.912
GitHub RepositoryπŸ“¦ Release v0.1.0 Assets
πŸ“–

How This Project & Page Works

CSCI 495/595 Deep Learning Rebuild

1. The Computer Vision Challenge

The detector is trained to locate two distinct Target sprites (Hero Rogue & Pig) across noisy procedural terrain while rejecting deceptive Distractor sprites (Dragon & Monster).

• Output: 16×16×1×6 grid tensor
• Anchor box: 32×32 px ($0.125$ norm)
• Loss: Multi-Task Coord MSE + Focal Loss

2. Sprite Asset Catalog (Ground Truth)

Every sample places 2 Targets alongside 2 Distractors:

Hero RoguePig
TARGETSHero & Pig
DragonMonster
DISTRACTORSDragon & Monster

3. Verifying Model Truth

The detector is specialized exclusively on Targets. A good result means finding both targets while leaving distractors unboxed:

Solid Green: Model's detected Targets
Dashed Cyan: Certified Ground Truth Target (Hero / Pig)
Dashed Violet: Distractor (Must remain unboxed!)
🎯 What is a "Good Result"?

Every test sample pairs 2 Targets (Rogue/Pig) with 2 Distractors (Dragon/Monster). A good result is 2 / 2 Targets Detected (solid green matching dashed cyan at >90% confidence) with zero false boxes on distractors or terrain tiles (100% Precision, 100% Recall).

πŸŽ›οΈ Slider Operating Guide

Confidence Threshold (0.35): Score cutoff ($Obj \times Class$). Targets score ≥0.90 while distractors score ~0.00. Raising above 0.85 drops faint targets; lowering below 0.15 can introduce terrain false alarms.
NMS IoU (0.50 - 0.70): Non-Maximum Suppression merges overlapping anchor cells firing on the same character into one crisp box.

Interactive Canvas View (256×256)
Initializing Engine...
Loading ONNX WebAssembly Model (1.56 MB)...
INFERENCE LATENCY
-- ms
TARGET MATCH (TP)
-- / --
MEAN IoU OVERLAP
--
DETECTION STATUS
Evaluating...
Quick Benchmark Samples (with Certified Ground Truth):25 canonical images

πŸ”¬ Decoded Tensor Output Inspector

16×16×1×6 Model Grid (De-anchored)
TypeScoreGrid Cell [R, C]Pixel Box [X1, Y1, X2, Y2]Size
No active detections to display

βš™οΈ Interactive Studio Controls

0.35

Minimum confidence ($Obj \times Class$) to retain candidate detections.

0.50

Maximum allowed box overlap before greedy suppression.

CLI Quickstart

Python 3.12
# Install with dev & export extras
pip install -e ".[dev,export]"
# Synthesize 1,000 samples
sprite-yolo generate -n 1000 --preset dense
# Evaluate mAP with threshold tuning
sprite-yolo evaluate -m model.keras --tune
# Export model to ONNX for web
sprite-yolo export -o model.onnx --format onnx

System Architecture & Mathematical Parity

The pipeline was refactored from two monolithic coursework notebooks into a modern, fully tested Python package with zero numerical drift.

1. Procedural Engine

Deterministic PRNG

Eliminates 280+ MB of static images from git tracking. Derives independent per-sample sub-seeds (hash(seed, i)) ensuring order-independent bit-for-bit reproducibility.

2. YOLO-mini CNN

4-Block Backbone

Strided Conv2D feature extractor reducing 256×256 inputs to a 16×16 spatial grid. A custom registered activation handles cell-relative coordinate regression and focal loss classification.

3. WebAssembly Export

Zero-Cost Edge Inference

Compiled to a 1.56 MB ONNX artifact running on client hardware. Real-time NMS parameter sweeping in JavaScript provides instant visual feedback without backend roundtrips.

Evaluation Benchmarks & Parity Results
MetricOriginal Coursework BaselineModernized v0.1.0 SuiteStatus
Mean Average Precision (mAP@0.50)0.9410.941Exact Parity
Optimal Validation F1-Score0.9120.912Exact Parity
Optimal Confidence Threshold0.300.30Verified
Optimal NMS IoU Threshold0.500.50Verified
Automated Tests0 (Notebook cells only)52 passing unit tests100% CI Green