<?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 Shubham Kumar on Medium]]></title>
        <description><![CDATA[Stories by Shubham Kumar on Medium]]></description>
        <link>https://medium.com/@shubhamkumar797989?source=rss-592f0b1167e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*qfoGcb574B_8krw2</url>
            <title>Stories by Shubham Kumar on Medium</title>
            <link>https://medium.com/@shubhamkumar797989?source=rss-592f0b1167e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:47:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shubhamkumar797989/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[From Shelf Image to Stock Keeping Unit Code (SKU Code): Designing a Production-Ready Retail AI…]]></title>
            <link>https://medium.com/@shubhamkumar797989/from-shelf-image-to-sku-code-designing-a-production-ready-retail-ai-pipeline-6cd6604b7266?source=rss-592f0b1167e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cd6604b7266</guid>
            <category><![CDATA[machine-learning-systems]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-computer-vision]]></category>
            <category><![CDATA[deep-learning-models]]></category>
            <category><![CDATA[retail-ai-systems]]></category>
            <dc:creator><![CDATA[Shubham Kumar]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 13:57:34 GMT</pubDate>
            <atom:updated>2026-03-29T14:13:45.343Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>From Shelf Image to Stock Keeping Unit Code (SKU Code): Designing a Production-Ready Retail AI Pipeline</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RiUMXRUSb015Rmd61SDXkw.png" /></figure><p><strong>A practical, production-grade guide to building a scalable retail AI system that survives repackaging, New product developments (NPDs), and real-world chaos.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gJyKnU3e0as888sLxSA6Vw.png" /></figure><p><strong>What if your AI system confidently identifies the wrong product?</strong></p><p>What if your AI system confidently identifies the wrong product — and silently poisoned your entire supply chain?</p><p>That’s not a hypothetical. It’s one of the most common failure modes in retail computer vision. The real challenge isn’t detecting products on a shelf. It’s mapping them <strong>accurately</strong> to enterprise SKU codes in a world where packaging changes constantly, new products launch every month, and visual signals are unreliable.</p><p>This is the story — and system design — of how to solve that problem properly.</p><p><strong>The Real Problem: Detection Is Easy, SKU Mapping Is Hard</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*woQ2cggs4clpam2XBFWHfQ.png" /></figure><p>At first glance, building a shelf intelligence system seems straightforward:</p><ul><li>Detect products</li><li>Classify them</li><li>Output SKU</li></ul><p>But this naive approach breaks immediately in production.</p><p>Because retail is messy:</p><ul><li>Repackaging happens constantly</li><li>Colors invert, layouts change</li><li>New Product Developments (NPDs) appear frequently</li><li>Thousands of SKUs exist under the same brand</li></ul><p>If your system tightly couples vision models with SKU prediction, you’ll end up retraining constantly — and still failing.</p><p><strong>Business Objective: What Are We Really Solving?</strong></p><p>We’re not building a model. We’re building a <strong>system</strong>.</p><p>The goal:</p><p>Detect products from compact retail shelves and map each product to a numeric SKU code used in enterprise systems.</p><p>The system must:</p><ul><li>Support multiple brands</li><li>Handle high SKU counts</li><li>Adapt to frequent NPDs</li><li>Survive repackaging without constant re-training</li><li>Run locally (no cloud dependency)</li></ul><p><strong>SKU Logic: Why You Should Never Predict SKU Directly</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pX6CzmWi1T_ugWlfnbp8Og.png" /></figure><p>A SKU is not just a label — it’s a structured entity:</p><p><strong>SKU = Brand + Packaging Type + Weight + Flavor</strong></p><p>Example:</p><ul><li>Brand: Britannia</li><li>Packaging: Packet</li><li>Weight: 100g</li><li>Flavor: Butter</li></ul><p>SKU Name: BRI_PKT_100_BTR</p><p>SKU Code: 10225231</p><p>Here’s the critical rule:</p><p><strong>Machine Learning (ML) models must NEVER generate SKU codes.</strong></p><p>Instead:</p><ul><li>Models predict attributes</li><li>Business logic maps attributes → Stock Keeping Unit (SKU)</li></ul><p><strong>High-Level Architecture: The Right Way to Think About It</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTg7iN6eoezxptJS57V_Lg.png" /></figure><p><strong>Pipeline:</strong></p><p>Shelf Image → Detection → Cropping → Flavor Identification → Business Mapping → SKU Code</p><p>This separation is what makes the system scalable.</p><p><strong>Step 1: Object Detection YOLO (You Only Look Once) — Keep It Simple</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xv0p4kBVML4otqRllO8MZw.png" /></figure><p><strong>What YOLO Should Do</strong></p><ul><li>Detect products</li><li>Output bounding boxes</li><li>Predict:</li><li>Brand</li><li>Packaging type</li><li>Optional size</li></ul><p><strong>What YOLO Should NOT Do</strong></p><ul><li>Predict flavour</li><li>Predict SKU</li></ul><p><strong>Why?</strong></p><p>Because flavour changes frequently. Encoding it into detection creates constant retraining cycles.</p><p><strong>Step 2: Product Cropping — The Unsung Hero</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tq5slR1cUAyYhvwjJrVrNQ.png" /></figure><p>Once detection is done:</p><ul><li>Each bounding box becomes an isolated product image</li></ul><p>This improves:</p><ul><li>OCR accuracy</li><li>Embedding quality</li><li>Overall system reliability</li></ul><p><strong>Step 3: Flavor Identification (Vision Transformer (ViT) + Similarity)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXME6x8Dtn7rf9L15zgchg.png" /></figure><p>Instead of classification, use <strong>embeddings</strong>.</p><p>Process:</p><ul><li>Convert image → vector</li><li>Compare using cosine similarity</li><li>Match against a flavor database</li></ul><p><strong>Why This Works</strong></p><ul><li>No re-training for new flavors</li><li>Handles repackaging naturally</li><li>Scales easily</li></ul><p><strong>Step 4: Optical Character Recognition (OCR) — The Supporting Layer</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUy-Gyn5ggQ4-CgAA7NIow.png" /></figure><p>OCR extracts useful text like:</p><ul><li>Flavor keywords</li><li>Weight indicators</li></ul><p>But remember:</p><p>OCR supports vision — it does not replace it.</p><p><strong>Step 5: Flavor Resolution (Fusion Layer)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-DP0I-j1e_r3CYYEw4VazQ.png" /></figure><p>Inputs:</p><ul><li>ViT similarity</li><li>OCR signals</li></ul><p>Output:</p><ul><li>Final flavour + confidence</li></ul><p>This is where logic beats brute-force ML.</p><p><strong>Step 6: SKU Mapping — Pure Business Logic</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5MsFuvtkiA14NCP-h2hDw.png" /></figure><p>Use a lookup table:</p><p>Inputs:</p><ul><li>Brand</li><li>Packaging</li><li>Weight</li><li>Flavour</li></ul><p>Outputs:</p><ul><li>SKU Name</li><li>Numeric SKU Code</li></ul><p>If no match:</p><p>Return<strong> UNKNOWN</strong></p><p><strong>Step 7: Confidence &amp; Safety Logic</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kn66w4YbWXMqpmaY8MsZwA.png" /></figure><p>Never force predictions.</p><p>Rules:</p><ul><li>Low detection confidence → reject</li><li>Low flavour confidence → reject</li></ul><p><strong>UNKNOWN is better than WRONG</strong></p><p><strong>Handling NPDs &amp; Repackaging</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C155aQcG8hX4W1cujWUe_A.png" /></figure><p>Retail constantly evolves.</p><p>Your system must handle:</p><ul><li>Graphic changes</li><li>Colour inversions</li><li>New flavours</li><li>Minor shape changes</li></ul><p>Without constant re-training.</p><p><strong>Output: What the System Produces</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QaFIHv0gPY5E0WExIXvaCA.png" /></figure><p>For each detected product:</p><ul><li>Brand</li><li>Packaging Type</li><li>Weight</li><li>Flavour</li><li>SKU Name</li><li>SKU Code</li><li>Confidence scores</li></ul><p>This is not just prediction — it’s structured intelligence.</p><p><strong>A Quick Story from the Field</strong></p><p>A team once built a system for a large packaged goods company similar to Britannia.</p><p>They directly classified SKUs.</p><p>It worked in testing.</p><p>Then:</p><ul><li>Packaging changed</li><li>New flavours launched</li></ul><p>Accuracy dropped drastically — but worse, the system still returned confident wrong predictions.</p><p>After redesigning with:</p><ul><li>Attribute separation</li><li>Embedding-based matching</li><li>SKU lookup tables</li></ul><p>The system became stable and scalable.</p><p><strong>Key Takeaways</strong></p><ul><li>Never predict SKU directly</li><li>Separate ML and business logic</li><li>Use embeddings for flexibility</li><li>Design for repackaging</li><li>OCR is support, not authority</li><li>Confidence gating is critical</li><li>UNKNOWN is a valid output</li></ul><p><strong>Conclusion</strong></p><p>The difference between a demo and a real system is not accuracy — it’s resilience.</p><p>Retail environments are chaotic. If your system can’t adapt, it will fail.</p><p>But if you design with:</p><ul><li>Separation of concerns</li><li>Minimal re-training</li><li>Strong business logic</li></ul><p>You build something that actually works in the real world.</p><p><strong>Call to Action</strong></p><p>If you found this useful:</p><ul><li>👏 Clap to support</li><li>💬 Share your thoughts</li><li>🔁 Share with your team</li><li>➕ Follow for more real-world AI system design</li></ul><p><strong>SEO Tags</strong></p><p>Computer Vision</p><p>Retail AI</p><p>Machine Learning Systems</p><p>Deep Learning</p><p>AI Architecture</p><p><strong>Social Media Post</strong></p><p>Most retail AI systems fail not because of bad models — but bad design.</p><p>If you’re building shelf intelligence or SKU detection, this guide breaks down a production-ready system using YOLO, ViT, OCR, and business logic.</p><p>Stop retraining. Start designing systems that scale.</p><p><strong>Meta Description</strong></p><p>Learn how to build a scalable shelf product detection and SKU mapping system using YOLO, ViT, OCR, and business logic for real-world retail AI.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cd6604b7266" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>