Smart Store Analytics AI: Computer Vision & Retail Spatial Intelligence
A production-grade Computer Vision and Retail Spatial Intelligence platform performing Multi-Object Tracking, interactive zone editing, shopper conversion funnels, 2D heatmaps, and checkout queue SLA monitoring with zero biometric retention.
The Physical Retail Telemetry Divide: Bringing Web Analytics to the Physical Aisle
In modern digital commerce, operators enjoy complete visibility over customer journeys. Every click, scroll depth, session duration, and funnel drop-off is tracked and analyzed via platforms like Google Analytics and Hotjar, enabling rapid layout iteration and conversion optimization. In stark contrast, physical brick-and-mortar retail stores—which continue to drive more than eighty percent of total global commerce—have historically operated blindly. Operations teams invest millions in interior remodeling and visual merchandising while relying on coarse entrance counters that register headcounts but provide zero insight into what happens past the doorway.
This operational divide creates three critical vulnerabilities for retail operators. First, entrance beam counters fail to track internal footfall paths, leaving management unaware of which promotional displays capture genuine shopper interest and which aisles suffer from total abandonment. Second, unmonitored checkout queue bottlenecks trigger cart abandonment, as frustrated customers walk out when lines exceed acceptable thresholds without management receiving proactive notice to deploy relief cashiers. Third, privacy regulations rightfully ban intrusive biometric harvesting, preventing operators from deploying cloud-based facial recognition systems in public commercial spaces.
Privacy-First Vision Pipeline & Occlusion-Resilient Multi-Object Tracking
To resolve these challenges without compromising visitor privacy, I engineered Smart Store Analytics AI as a high-performance computer vision platform that executes inference entirely on edge hardware without streaming raw video to external cloud providers. The object detection module leverages a lightweight YOLO model restricted strictly to bounding box coordinates for people, stripping away all facial, gender, and biometric features at the moment of optical acquisition.
Each detected individual is mapped to a ground contact point calculated at the bottom-center of their bounding box coordinates. The Multi-Object Tracking engine pairs active tracks with candidate detections through an Intersection over Union cost matrix with a baseline threshold of 0.30. When fast movement or momentary camera occlusions drop overlap scores, the system automatically falls back to Euclidean centroid proximity matching within an eighty-pixel radius, preserving track continuity. Track states are governed by a deterministic state machine requiring two consecutive frame confirmations before graduating from tentative to confirmed status, and purging records from active memory after thirty consecutive unobserved frames.
Mathematical Foundations: Jordan Curve Point-in-Polygon & Gaussian Density Kernels
Optical tracking coordinates are transformed into commercial business intelligence through rigorous computational geometry:
Commercial zone dwell time is calculated using a horizontal ray-casting point-in-polygon algorithm grounded in the Jordan Curve Theorem. The algorithm casts an infinite horizontal ray from the shopper ground contact point and tallies the total number of intersections with the edges of configured department polygons. An odd intersection count confirms that the visitor is physically positioned inside the department boundary, triggering continuous frame-accurate dwell accumulation until an exit event occurs.
Spatial traffic concentration is modeled through a two-dimensional Gaussian kernel density accumulator operating over a discrete 128 by 72 grid. Every point recorded along an active trajectory injects a smooth density weight into the surrounding coordinate space. The accumulated density matrix is normalized and rendered through thermal colormap palettes, producing high-contrast spatial heatmaps that instantly differentiate prime commercial corridors from stagnant display corners.
Shopper Conversion Funnels & The AI Retail Copilot Engine
The platform features an end-to-end conversion funnel module that quantifies visitor progression across four distinct retail zones: the entrance foyer, the promotional showcase, the high-value electronics department, and the point-of-sale checkout counter. The funnel engine computes drop-off percentages between successive zones, flags the primary operational leakage bottlenecks where shopper interest collapses, and constructs directional Markov migration matrices that reveal shopper transit probabilities across departments.
Complementing the funnel engine is the AI Retail Copilot, an automated heuristic advisory system that evaluates the spatial health of the store floor on a scale from 0 to 100. The copilot analyzes footfall concentration, dwell time dispersion, and department traversal ratios to detect dead merchandise showcases suffering from traffic volumes forty percent below store averages. When an underperforming zone is identified, the copilot generates actionable merchandising recommendations—such as shifting seasonal endcaps toward primary transit corridors—and highlights the target area on the live dashboard with an attention-guiding visual flash.
In-Browser Interactive Canvas Zone Editor & Queue Bottleneck Telemetry
To eliminate developer dependency when store layouts shift, the platform provides an interactive zone editor built on the HTML5 Canvas element. Floor managers can visually drag polygon vertex handles directly within their browser viewport, create custom department zones, modify existing boundaries, and commit updated floorplans directly to JSON configuration files without restarting server processes.
To safeguard customer retention at point-of-sale, the platform incorporates an automated queue bottleneck state machine. The system continuously evaluates checkout zone occupancy and customer wait duration, dispatching immediate SLA breach warnings when customer counts exceed five individuals or dwell times exceed three minutes. Alerts are transmitted asynchronously through an integrated notification engine supporting Slack, Discord, and Telegram bots, complete with configurable cooldown throttling to prevent notification flooding while ensuring prompt staff mobilization.
Multi-Source Stream Ingestion, Live Webhooks, and Enterprise API Integration
Designed for flexible field deployment, the streaming infrastructure supports three operational ingestion modes: a zero-GPU synthetic simulation generator that produces realistic shopper trajectories for headless development, a video file uploader compatible with recorded MP4, AVI, and MOV files for retrospective store audits, and a direct RTSP video capture pipeline that interfaces natively with enterprise IP cameras and network video recorders.
The backend exposes high-throughput FastAPI REST endpoints structured to OpenAPI standards, enabling seamless integration with external ERP, CRM, and business intelligence systems. Operators can export printable executive A4 PDF audit summaries and RFC-compliant CSV dwell datasets with a single click. Supported by a comprehensive test suite of sixty-three unit and integration tests executing deterministically in sub-second runtimes, the platform delivers enterprise-grade reliability and mathematical precision for physical retail intelligence.
Click any screen below to inspect in high-resolution with zoom in, zoom out, pan, and full screen controls.
01
AI Retail Copilot & Layout Advisory
Heuristic spatial intelligence drawer scoring overall store health (0-100), flagging merchandise dead zones, and recommending high-impact showcase relocations to resolve traffic congestion.
02
Interactive In-Browser Zone Editor
HTML5 Canvas floorplan editor enabling store managers to drag polygonal vertex handles in real time, configure department boundaries, and persist commercial layouts to JSON.
03
Shopper Flow & Multi-Stage Conversion Funnel
Multi-stage shopper progression analytics (Entrance -> Promotions -> High Value Electronics -> Checkout POS), quantifying drop-off rates, stage bottlenecks, and zone transition matrices.
04
Multi-Source CCTV & RTSP Video Ingestion
Hybrid video manager facilitating instant runtime switching between synthetic zero-GPU simulation, recorded CCTV files (MP4/AVI/MOV), and live RTSP IP camera feeds with real-time FPS telemetry.
05
Live Webhooks & Instant Telegram Alerting
Autonomous notification engine dispatching checkout queue SLA breach alerts to Slack, Discord, and Telegram bots, backed by cooldown suppression logic to eliminate notification fatigue.
06
Camera Stream Switcher & Controls
Operator dropdown control for seamless switching between live CCTV network streams and recorded validation datasets without restarting the background vision pipeline.
07
FastAPI OpenAPI Interactive Documentation
High-throughput RESTful endpoints compliant with OpenAPI specifications, enabling automated spatial matrix export and frictionless integration with enterprise ERP and CRM architectures.
Interested in a similar project?
We can build a tailored solution customized to your business goals.
Explore Related Work
Production software, AI tools, and enterprise platforms.
ERP & Enterprise Systems
ReconcileX: Enterprise Financial Reconciliation & ZATCA Tax Compliance Platform with Hybrid Deterministic Architecture
An enterprise-grade open-source financial reconciliation engine engineered to eliminate manual spreadsheet matching, combining deterministic zero-hallucination arithmetic with agentic reasoning to resolve bundled batch payouts, ZATCA VAT compliance audits, and balanced ERP journal vouchers.
Cloud Engines & Infrastructure
PeerWarp: Zero-Cloud P2P Direct File Transfer Platform
An open-source, production-grade file transfer platform engineered to move unlimited files and folders directly between browsers via encrypted WebRTC DataChannels, eliminating cloud storage intermediaries with direct-to-disk writing, on-the-fly compression, and local Wi-Fi radar.
AI & Automation
OmniInsight: Privacy-Preserving Local BI & Automated Analytics Platform with In-Memory DuckDB and Multi-LLM Reasoning
An open-source, local-first Business Intelligence platform engineered to replace proprietary cloud BI tools, pairing DuckDB's vectorized in-memory OLAP engine with privacy-safe LiteLLM reasoning to autonomously synthesize executive dashboards and answer conversational NLQ queries with zero data leakage.