Inspiration
Warehouses already have cameras watching almost everything. Yet when inventory goes missing, a package is misplaced, or physical stock doesn't match warehouse records, figuring out what happened often means manually searching through hours of CCTV footage.
That disconnect inspired StockLens.
Mid-sized warehouses often rely on existing surveillance infrastructure but lack access to expensive, specialized inventory-tracking systems. I wanted to turn something they already own into something far more useful.
What if warehouse cameras could do more than record? What if they could remember and explain what happened to inventory?
During Cal Hacks, conversations with mentors experienced in warehouse operations reinforced the need for better inventory visibility and helped me focus on a practical, accessible solution.
What it does
StockLens is a computer vision-powered warehouse intelligence platform that transforms existing CCTV footage into searchable inventory movement histories.
Instead of simply recording activity, StockLens detects and tracks packages, monitors their movements, and reconciles what the cameras observe against warehouse inventory records.
For example, if warehouse records show eight packages but a camera observes one being removed without a corresponding inventory transaction, StockLens can flag the discrepancy and link the exact moment in the footage.
The platform brings together four warehouse camera viewpoints:
- Receiving Dock: Monitors incoming packages and inventory movements.
- Storage Shelves: Tracks shelf-level additions, removals, and physical stock changes.
- Warehouse Aisle: Observes package movements across warehouse areas.
- Dispatch: Tracks outgoing packages and identifies discrepancies with recorded movements.
Each camera contributes observations to a shared inventory intelligence system.
Ask StockLens: Conversational Visual Memory
One of StockLens's core features is Ask StockLens, a conversational investigation assistant powered by Claude.
Instead of manually searching movement logs or reviewing hours of footage, warehouse operators can ask questions such as:
- "Why is there an inventory discrepancy on Shelf 2?"
- "What movements were detected on Camera 2?"
- "Where was this package last observed?"
- "Show me the footage of that inventory removal."
StockLens retrieves relevant tracking events, inventory records, and video evidence to provide contextual explanations grounded in what the system actually observed.
Automatic AI Investigations
StockLens doesn't just wait for someone to ask a question.
When a new inventory discrepancy is detected, its AI investigator automatically examines the associated movement records and available evidence, summarizes what happened, and proposes a correction for operator review.
The human remains in control: inventory corrections require approval rather than being applied automatically.
This closes the loop between detecting a physical inventory problem, understanding its cause, and helping an operator resolve it.
How I built it
I built StockLens by combining computer vision, object tracking, a reactive backend, and Claude-powered reasoning into a single application.
Computer Vision and Tracking
I used YOLOv8 (Ultralytics) for object detection and multi-object tracking to follow packages across video frames.
Python and OpenCV handle video processing, tracking observations, spatial monitoring, and movement-event extraction.
A major architectural decision was separating object detections from confirmed movements. The system evaluates tracking histories, camera-specific monitoring regions, and directional movement rules before interpreting an observation as an inventory event.
Backend and Inventory Intelligence
Convex serves as the operational database, connecting camera observations, tracking histories, inventory records, discrepancies, and investigations.
This creates a shared source of inventory information across the application's camera and investigation experiences.
Frontend and Surveillance Experience
I built the application using Next.js, React, and TypeScript, with an immersive four-camera surveillance interface.
Operators can observe detections directly in the footage, focus on individual cameras, inspect movement events, and navigate to associated video evidence.
I intentionally made computer vision the center of the experience rather than hiding it behind a traditional analytics dashboard.
Claude-Powered Investigations
I integrated Claude to reason over stored inventory information and visual movement evidence.
The conversational assistant supports natural-language questions, while the automatic investigation workflow helps operators understand discrepancies and review proposed corrective actions.
The current prototype demonstrates these capabilities using prerecorded warehouse footage processed through the computer vision pipeline.
Challenges I ran into
1. Distinguishing detections from actual inventory movements
One of the biggest challenges was dealing with false positives.
YOLOv8 could detect packages moving along a conveyor belt, but it also detected stationary boxes in the background.
A valid object detection wasn't necessarily a valid inventory movement.
I addressed this through camera-specific monitoring regions, tracking consistency, and directional movement rules rather than simply counting bounding boxes.
2. Making tracking reliable in real warehouse footage
Real warehouse footage is messy. Packages overlap, workers obstruct camera views, and objects appear differently depending on lighting, packaging material, and camera angle.
Two particularly challenging cases were stacked cartons being detected as a single package and plastic-wrapped parcels being discarded by the tracker despite consistent visual observations.
Improving how these detections were interpreted and tracked helped recover missed movement events without requiring additional model training.
3. Making computer vision understandable
My initial application exposed too many movement logs, inventory tables, and technical details. It felt more like traditional inventory management software than a computer vision product.
I redesigned StockLens around immersive surveillance, visually distinct tracking states, and conversational investigations.
The goal was to let operators observe what happened, ask questions naturally, and reach the supporting evidence without needing to understand the underlying detection pipeline.
Accomplishments that I'm proud of
I'm particularly proud of moving StockLens beyond basic object detection into a functional inventory investigation system.
Across five real warehouse test clips totaling 2,040 frames, StockLens detected 15 of 16 package movements with zero false counts.
Some of the most meaningful improvements came from handling difficult visual conditions rather than simply switching to a larger model:
- Improved dispatch tracking from 6/9 to 9/9 movements by addressing tracking behavior that discarded faint but consistent detections.
- Improved stacked-carton handling so overlapping packages could be counted separately without additional model training.
- Excluded stationary background packages from conveyor tracking, so only parcels actually moving on the belt are tracked and counted.
- Built an end-to-end investigation workflow connecting computer vision detections, movement histories, inventory discrepancies, Claude-powered explanations, and human-approved corrections.
I'm also proud of building the experience around cameras warehouses already own, rather than relying on expensive new hardware.
What I learned
The biggest lesson: detecting an object is not the same as understanding its movement.
A computer vision model can correctly identify a package in a frame while still producing an incorrect inventory count if the tracking or movement logic is unreliable.
I learned that some of the most meaningful accuracy improvements came from better tracking, spatial constraints, and event-validation rules, not necessarily from training a bigger model.
I also learned how important it is to make complex technical systems understandable to the people using them. An operator shouldn't need to interpret bounding boxes, confidence scores, or tracking IDs to find out why inventory is missing.
That realization shaped StockLens's surveillance-first interface and conversational investigation experience.
What's next for StockLens
My immediate priority is improving detection and tracking accuracy by fine-tuning the computer vision models on larger, more diverse datasets of annotated warehouse footage.
As StockLens scales across different warehouses, variations in camera angles, lighting, packaging, and object occlusion will make reliable detection and generalization increasingly important.
Beyond model accuracy, I plan to:
- Integrate live CCTV streams for continuous inventory monitoring.
- Expand warehouse management system integrations to connect observed movements with existing inventory workflows.
- Improve cross-camera tracking to strengthen package movement histories across warehouse locations.
- Scale reliability through more extensive real-world evaluation and model fine-tuning.
StockLens is designed around a simple adoption advantage: mid-sized warehouses should be able to gain inventory intelligence from cameras they already have, without investing in expensive new hardware.
I'm exploring an affordable subscription model targeting approximately $80–$100 per warehouse site per month.
The longer-term vision is to make computer vision-powered inventory intelligence practical, affordable, and accessible.
The cameras observe. StockLens remembers. The operator asks. StockLens explains.
Log in or sign up for Devpost to join the conversation.