<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bhapkarvishal on Medium]]></title>
        <description><![CDATA[Stories by Bhapkarvishal on Medium]]></description>
        <link>https://medium.com/@bhapkarvishal8?source=rss-f08fdc23ef78------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UqnMRknlJxbg3P-bJgxQHw.jpeg</url>
            <title>Stories by Bhapkarvishal on Medium</title>
            <link>https://medium.com/@bhapkarvishal8?source=rss-f08fdc23ef78------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:17:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhapkarvishal8/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Built a Forklift Collision-Warning System With One CCTV Camera. Here’s Exactly Where It Broke.]]></title>
            <link>https://medium.com/@bhapkarvishal8/i-built-a-forklift-collision-warning-system-with-one-cctv-camera-heres-exactly-where-it-broke-641bba5db5ea?source=rss-f08fdc23ef78------2</link>
            <guid isPermaLink="false">https://medium.com/p/641bba5db5ea</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[generative-ai-solution]]></category>
            <category><![CDATA[yolo]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[ai-ml-solution]]></category>
            <dc:creator><![CDATA[Bhapkarvishal]]></dc:creator>
            <pubDate>Sat, 11 Jul 2026 10:25:04 GMT</pubDate>
            <atom:updated>2026-07-11T10:25:04.794Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Subtitle:</strong> A 127 FPS detection pipeline is the easy part. Camera geometry is where warehouse safety AI actually lives or dies.</p><p><em>By Vishal Bhapkar — Senior AI/ML Solutions Engineer | Edge AI, Computer Vision, On-Device GenAI</em></p><p>Every year, forklifts injure a shocking number of warehouse workers. The commercial fixes for this — UWB tags on every helmet, proximity sensors on every vehicle, LiDAR curtains — all share the same problem: they need new hardware on every person and every machine. Meanwhile, almost every warehouse already has CCTV cameras bolted to the ceiling, recording accidents instead of preventing them.</p><p>So I gave myself a challenge on my personal workstation: <strong>can a single existing CCTV camera, plus a detection model and some geometry, warn a forklift driver about a collision two seconds before it happens?</strong></p><p>The short answer: yes, sometimes, and the “sometimes” is the interesting part. This article is the honest version of that project — including the test that produced fourteen false alarms in a row and the scenario my system missed completely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BkKzFRV1o-bPChQHDlaoFw.png" /></figure><h3>The setup</h3><p>The architecture is deliberately boring:</p><p><strong>Detector → Tracker → Risk Engine → Alert</strong></p><ul><li><strong>Detector:</strong> YOLO11n, the nano variant. I wanted something that would eventually fit on an edge box next to the camera, not a datacenter GPU. Trained on a public forklift dataset (Mohamed Traore’s forklift dataset on Roboflow, CC BY 4.0, around 1,000 images) plus CCTV footage from two different facility viewpoints for validation.</li><li><strong>Tracker:</strong> ByteTrack. No re-identification network, no appearance embeddings. Just motion-based association, because it’s fast and it works.</li><li><strong>Risk engine:</strong> This is the part I actually care about. Bounding boxes live in pixel space, but collisions happen in the real world. So I used a homography — a mapping from image coordinates to floor coordinates — to project every tracked object onto a 2D floor plan. On that floor plan I drew zone polygons (danger / caution / open) and computed two kinds of risk: <strong>distance-based</strong> (person inside a danger zone near a moving forklift) and <strong>time-to-collision</strong> (extrapolate both trajectories, check if they intersect within a threshold).</li></ul><p>The whole pipeline runs at 6.5 ms median latency per frame on my desktop GPU. That’s 127 FPS — which sounds like bragging until you realize it just means a much cheaper edge device can run it at a perfectly usable 15–25 FPS. Desktop headroom is edge feasibility.</p><h3>The detector numbers look bad. Here’s why I shipped them anyway.</h3><p>My cross-facility mAP@50 was <strong>0.330</strong>.</p><p>If you’ve spent time on benchmark leaderboards, that number looks like a failed experiment. Papers report 0.7, 0.8, 0.9. So let me explain why 0.33 was workable here, because this gap between benchmark thinking and system thinking is something I wish someone had told me years ago.</p><p>First, mAP is measured per frame, in isolation. A safety system doesn’t work per frame — it works per <em>track</em>. If the detector finds the forklift in 6 out of every 10 frames, ByteTrack stitches those detections into one continuous track and the risk engine never notices the gaps. Tracking converts a mediocre detector into a decent perception system.</p><p>Second, I ran the detector at a confidence threshold of <strong>0.087</strong>. Yes, you read that right. Conventional wisdom says a threshold that low drowns you in false positives. But ByteTrack was designed around exactly this idea — its second-stage association uses low-confidence boxes to keep tracks alive through partial occlusion. A flickering, low-confidence detection that persists across 20 frames in a physically plausible trajectory is real. A one-frame ghost is not. The tracker knows the difference; a per-frame threshold doesn’t.</p><p>Third — and this took me embarrassingly long to internalize — <strong>cross-facility mAP is the only number that matters for this kind of product</strong>. My same-facility validation looked far better. But a safety system that only works on the camera it was trained on is a demo. 0.33 across facilities was my honest number, so that’s the number I designed the system around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YTdMmyvrGQqmQ8u4C77NdQ.png" /><figcaption>Side-by-side frames from the two facilities showing detections — makes the domain gap visible.</figcaption></figure><h3>Test the logic before you blame the model</h3><p>Here’s the methodological decision that saved this project, and it’s the one thing I’d tell anyone building a perception-plus-logic system:</p><p><strong>I tested the risk engine with perfect inputs before I ever connected the real detector.</strong></p><p>I call it oracle mode. Instead of feeding the risk engine detections from YOLO, I fed it ground-truth object positions from scripted scenarios — head-on approaches, perpendicular crossings, near-misses, parallel safe passes, stationary encounters. Ten scenarios in total.</p><p>Why bother? Because when a combined system fails, you face a miserable debugging question: is the model wrong, or is the logic wrong? Oracle mode splits that question in half. If the risk engine misbehaves with <em>perfect</em> inputs, the logic is broken and no amount of model retraining will save you.</p><p>Oracle results: across all ten scenarios, the engine produced <strong>zero false alarms on the safe scenarios</strong> and flagged every genuine collision course with a <strong>lead time between 1.94 and 2.03 seconds</strong>. Two seconds is enough for a driver to brake or a worker to step back. The logic worked.</p><p>Then I swapped in the real detector, and reality arrived.</p><h3>Where it broke</h3><p>I ran three representative scenarios with the live detector instead of the oracle. One worked, one degraded, one failed completely. All three failures taught me more than the success did.</p><p><strong>Head-on approach: worked.</strong> Zero false alarms, 1.40 seconds of warning lead time. Less than the oracle’s 2 seconds — detection jitter delays the moment a trajectory becomes confidently “collision-bound” — but 1.4 seconds is still a usable warning.</p><p><strong>Parallel safe pass: fourteen false alarms.</strong> A person and a forklift moving in parallel, safely apart, and the system cried wolf fourteen times. This one stung until I understood it, because the root cause wasn’t the model <em>or</em> the risk logic. It was the homography. My image-to-floor mapping was rough — estimated from the scene rather than properly calibrated — and a small pixel-space error in that mapping turns into a large <em>lateral velocity</em> error in floor coordinates. The risk engine saw phantom sideways motion and kept concluding the person was drifting into the forklift’s path. The alert logic did exactly what it was told; the geometry lied to it.</p><p>The lesson, stated plainly: <strong>in world-coordinate safety systems, camera calibration is not a setup step — it is the product.</strong> The detection model is nearly a commodity at this point. The homography is where the engineering is.</p><p><strong>Perpendicular crossing: complete miss.</strong> A person approaching the forklift’s path at 90 degrees, and the system saw nothing wrong until it was far too late. This isn’t a bug I can fix with better code. From my single camera’s angle, a perpendicular approach produces almost no usable trajectory signal before the paths converge — and partial occlusion by the forklift itself finishes the job. It’s a geometric blind spot. The fix isn’t a better model; it’s a second camera at a complementary angle.</p><p>Which leads to my most transferable conclusion: <strong>one camera is a demo; two cameras is a system.</strong> If you’re evaluating a vendor pitch for camera-based workplace safety, the number of viewpoints per zone is a more important question than which YOLO version they use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1JvYfgI4jr0xEKOt__itA.png" /><figcaption>top-down floor plan showing the camera position, the perpendicular approach path, and the blind region.</figcaption></figure><h3>What I’d tell you if you’re building something similar</h3><p><strong>Separate perception errors from logic errors on day one.</strong> Build an oracle harness before you integrate. It’s a few hours of work and it will save you weeks of debugging the wrong component.</p><p><strong>Design around your honest cross-domain number, not your best validation number.</strong> If your model only sees 0.33 mAP on unseen cameras, build a tracker and temporal logic that can live with 0.33 — don’t build a system that silently assumes 0.8.</p><p><strong>Spend your effort where the failure modes are.</strong> My false alarms didn’t come from the neural network. They came from an uncalibrated homography. A checkerboard, an afternoon, and OpenCV’s calibration routines would have prevented all fourteen — that’s precisely the next step on my list, along with a second camera to kill the perpendicular blind spot.</p><p><strong>Cheap and imperfect beats expensive and absent.</strong> This system, even in its current state, provides 1.4 seconds of warning for head-on encounters using hardware the warehouse already owns. The alternative in most facilities is nothing at all. Perfect is a research goal; deployed-and-improving is a safety outcome.</p><p>The detection model took me a weekend. Understanding <em>why</em> the system failed took much longer — and that second part is the actual job.</p><p><em>I write about making AI work on real hardware — edge deployment, NPU optimization, computer vision, and on-device GenAI. If this was useful, follow along; the next piece covers why five different strategies for simulation-generated training data all failed for this same detector.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=641bba5db5ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>