<?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 Mradul Dubey on Medium]]></title>
        <description><![CDATA[Stories by Mradul Dubey on Medium]]></description>
        <link>https://medium.com/@mraduldubey?source=rss-b72e98a18093------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gfO8IyU81NLbEnFn2BjV_Q.jpeg</url>
            <title>Stories by Mradul Dubey on Medium</title>
            <link>https://medium.com/@mraduldubey?source=rss-b72e98a18093------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 24 May 2026 02:26:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mraduldubey/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[The Failure Catalog]]></title>
            <link>https://medium.com/@mraduldubey/the-failure-catalog-fa236eeb25e2?source=rss-b72e98a18093------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa236eeb25e2</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[aritifical-intelligence]]></category>
            <category><![CDATA[vlm]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mradul Dubey]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 14:20:22 GMT</pubDate>
            <atom:updated>2026-04-24T14:20:22.459Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Ghost entities and false accusations, when VLMs trust data over their own eyes!</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWhyJEqRI67GV1mjYMXt-Q.jpeg" /><figcaption>Your VLMs may miss the proverbial “Elephant in the Room”</figcaption></figure><p>In <a href="https://medium.com/towards-artificial-intelligence/vlm-the-more-you-tell-it-the-less-it-sees-c07f33b6a159">VLM: the more you tell it, the less it sees</a>, I defined anchoring bias in VLMs and measured it across seven controlled conditions.</p><h4>The findings were quantitative:</h4><blockquote><strong><em>Structured data suppresses visual reasoning, and the delivery channel modulates how badly.</em></strong></blockquote><p>This post is different. These are not controlled experiments. They are stress tests. I have setup deliberately adversarial conditions (fabricated data, partial data, a weaker model) that I used during development to probe how the system breaks. The conditions are stacked: Gemini 2.5 Flash (weaker baseline than Part 1’s Gemini 3 Flash Preview), higher<em> text:image</em> token ratios, and intentionally incorrect or incomplete tracking data.</p><p>I am not claiming these failures will occur under normal operating conditions.</p><p><em>I am cataloguing the types of failures that anchoring bias produces when pushed, because they are qualitatively different from what Part 1 describes.</em></p><p><a href="https://medium.com/towards-artificial-intelligence/vlm-the-more-you-tell-it-the-less-it-sees-c07f33b6a159">Part 1</a> shows suppression i.e. the model looks less, narrates more, misses events. The failures below are not suppression. They are confabulation, misattribution, and fabrication. An engineer reading<a href="https://medium.com/towards-artificial-intelligence/vlm-the-more-you-tell-it-the-less-it-sees-c07f33b6a159"> Part 1 </a>would reasonably expect “the model might miss things.” They would not predict what follows.</p><p>Full details and raw responses in the <a href="https://github.com/mraduldubey/Anchoring-Bias-VLM">GitHub repository</a>.</p><h3><strong>Identity Misattribution — Failure Type 1</strong></h3><p><strong>Setup:</strong> Same shoplifting clip as Part 1. Same temporal grid + center frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*9T1M4L1GvA8N5X1WNgwk9g.jpeg" /><figcaption>T1 the mannequin</figcaption></figure><p><strong>I added tracking data for only one entity</strong>: <strong>T1 which is a mannequin standing in the background of the aisle.</strong></p><p>Not a person. A mannequin.</p><p><strong>No data for T2 (the actual shoplifter) or anyone else. </strong><em>Text:image</em> token ratio ~1.65.</p><p>The prompt included the instruction:</p><blockquote>“Use the visual frames as ground truth when signals seem ambiguous.”</blockquote><p>The model saw the shoplifting. It got the action right but got the actor wrong.</p><blockquote><em>”A woman (tracked as T1), wearing a red top and dark pants, is standing at a clothing rack. She reaches out and appears to be examining dark clothing items on the rack.”</em></blockquote><p><strong>T1 is not a woman in red. T1 is a mannequin.</strong></p><p><em>In other conditions with full data, the same model family correctly identified T1 as a mannequin.</em> But here, T1 was the only tracked entity and the tracking ID was powerful enough to override what the model could see.</p><p><strong>It described a mannequin as a living woman performing a multi-step action. </strong>Then it cited T1’s stationary tracking data as <em>confirmation</em>:</p><blockquote><em>”The tracking data confirms she remained stationary throughout this entire period of selection and concealment.”</em></blockquote><p><strong>Near-zero speed, a measurement of a mannequin being a mannequin, repurposed as evidence of “careful, deliberate stillness during concealment.”</strong></p><blockquote><em>”The primary notable event is the woman placing a clothing item from the rack directly into her personal bag around 91.3s. Given the context of a retail environment, this action, without any apparent intention to purchase… is highly suspicious and suggests possible shoplifting. The tracking data confirms she remained stationary throughout this entire period of selection and concealment.”</em></blockquote><p>Every sentence is confident. The action description is correct. The identity is wrong. <em>The data citation is real but irrelevant.</em></p><p><strong>The conclusion accuses a mannequin of shoplifting.</strong></p><p><strong>What this failure type looks like:</strong> Tracking IDs act as identity magnets. When the model observes an action and needs to assign it to an entity, it reaches for the only tracked ID available, regardless of whether that entity is a person, a mannequin, or anything else. It then cites the entity’s data as supporting evidence, even when the data describes entirely different behaviour.</p><h3><strong>Entity Fabrication — </strong>Failure Type 2</h3><p><strong>Setup: </strong>Same clip. Same temporal grid and center frame.</p><p><strong>T2’s (actual shoplifter) tracking data was replaced with fabricated data.</strong></p><p>All coordinate fields frozen to a single position (cx=307, cy=253), speed zero, area change zero. An internally consistent story i.e. a person standing still, doing nothing, the entire time.</p><p><strong>Text:image token ratio ~7.32.</strong></p><p>The ground truth: T2 picks up a garment, conceals it in her bag, and walks away.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*03Z7Xy41iIhOGgyiOxuwBw.jpeg" /><figcaption>Placing the fake tracking data for T2 on the image</figcaption></figure><p>This was the model’s response:</p><blockquote><em>”Foreground Activity (Woman in Red — Not explicitly tracked in the provided data): A woman wearing a red top… is actively engaged in browsing the clothes. She repeatedly picks up dark garments from the rack, examines them closely, and appears to place them back.”*</em></blockquote><blockquote><em>”Mid-ground Activity (Track T2 — Woman in Pink): A woman (T2) in a light pink outfit is consistently visible standing still at a clothing rack on the right side of the aisle. The tracking data confirms her cx, cy, bbox_area… are all unchanging at 0.0 or 14000, indicating she remains perfectly stationary.”</em></blockquote><p>The model invented two people. The real woman, the shoplifter, visible in every frame, was demoted to “not explicitly tracked.” Her shoplifting rewritten to “appears to place them back.”</p><p>The frozen coordinates point to the center-left of the frame, closest to T4 (a red dress mannequin on the left).</p><p>But the model described its ghost as “Woman in Pink” on the “right side of the aisle”, that’s T1, the pink mannequin, 240 pixels away from where the data says T2 is. The model recruited the visual appearance of a mannequin from across the frame, gave it T2’s tracking identity, and produced an entity that matches neither the data’s coordinates nor visual reality.</p><p>Conclusion:</p><blockquote><em>”There is no overtly suspicious or significant activity observed.”</em></blockquote><p><strong>What this failure type looks like:</strong> When data describes an entity that doesn’t match anything visible, the model doesn’t question the data. It fabricates a visual counterpart, stitching together appearance from one location and identity from another to produce a coherent but fictional entity. The real entity gets demoted; the fabricated one gets the track ID and narrative prominence.</p><h3><strong>Why catalogue these</strong></h3><p>Both failures share a root mechanism:</p><h4><strong>The model treats structured data as ground truth and adjusts its visual interpretation to match.</strong></h4><p><strong>And that’s anchoring bias for you.</strong> And it’s magnified in these cases due to higher <em>text:image</em> tokens ratios.</p><p>But they produce qualitatively different outcomes:</p><ol><li><strong>Identity misattribution</strong> bends <strong><em>who</em></strong> to fit the data. Actions flow to whichever entity the data names.</li><li><strong>Entity fabrication</strong> bends <strong><em>what exists</em></strong> to fit the data. The model invents a person rather than conclude the tracking data is wrong.</li></ol><p>Neither failure is a simple miss. In both cases the model produces confident, internally coherent, data-cited narratives. A downstream system consuming this output would have no signal that anything is wrong.</p><p>These are stress test results, not production benchmarks. The conditions were deliberately adversarial.</p><h4>But the failure <em>types :</em> misattribution and fabrication, are categories that production systems should test for, because they won’t surface in accuracy metrics that only measure “did the model detect the event.”</h4><p>For engineering guidance on defending against anchoring bias, channel selection, data filtering, baseline testing, see the <a href="https://medium.com/towards-artificial-intelligence/vlm-the-more-you-tell-it-the-less-it-sees-c07f33b6a159">part 1</a>. Full methodology, raw prompts, and all model responses: <a href="https://github.com/mraduldubey/Anchoring-Bias-VLM">github repo</a>.</p><p>Citable archive: DOI 10.5281/zenodo.19557723</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa236eeb25e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VLM: The More You Tell it, The Less it Sees.]]></title>
            <link>https://pub.towardsai.net/vlm-the-more-you-tell-it-the-less-it-sees-c07f33b6a159?source=rss-b72e98a18093------2</link>
            <guid isPermaLink="false">https://medium.com/p/c07f33b6a159</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Mradul Dubey]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 12:01:02 GMT</pubDate>
            <atom:updated>2026-04-17T12:01:02.944Z</atom:updated>
            <content:encoded><![CDATA[<h4>Defining Anchoring Bias in Visual Language Models (VLMs) &amp; an engineer’s field notes.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jx5bsbu3AyDmf0buv9nECQ.png" /></figure><h4>[~_~]</h4><p>One of the lingering challenges in computer vision, the video search problem, has been around as long as surveillance systems have existed. These systems generate hundreds of hours of video data with barebones analytics. Searching through such recordings is a huge and mostly manual undertaking. As a computer vision engineer, it has always appealed to me to solve it.</p><p><em>It was only natural that in the era of VLMs &amp; AI, the video search problem should be revisited with fresh tools.</em> In this spirit, I showed a vision-language model a surveillance clip of a woman shoplifting a garment.<em> I was not ready for the unexpected and unintuitive behaviour of such models.</em></p><p>With no additional context, the model described the event precisely:</p><blockquote>At 90.0s, the woman looks directly at the surveillance camera while quickly stuffing the dark garment into her large tote bag… selecting an item, checking her surroundings, looking directly at the camera, and then quickly concealing the item — suggests a case of shoplifting.</blockquote><p>Then I gave it the same frames, same model, same prompt, but additionally, the structured detection data from my object tracking pipeline. Here is the response:</p><blockquote>She stands in the middle of the hallway and looks at a cell phone in her hands… No suspicious activity is observed during this window.</blockquote><p><strong>Same frames. Same model. More data. Worse outcome.</strong></p><h4>[O_O]</h4><p>If you are working with Vision Language Models with multimodal capabilities, or technically speaking, <strong>Multimodal Large Language Models (MLLMs)</strong>, you <strong><em>must</em></strong> know about the following, because understanding these may determine how should you utilise these models in your CV pipeline:</p><ol><li><strong>Anchoring Bias</strong> &amp; the form it takes in VLMs</li><li><strong>Delivery Channels</strong> and their impact on anchoring bias</li><li>How to engineer against the impacts of anchoring bias in a complicated ML pipeline</li></ol><p>Some of these terms may be new to you, so let’s define them:</p><h4>Anchoring Bias</h4><p>Anchoring bias is a cognitive concept: the tendency to over-rely on an early piece of information when making subsequent decisions. Any structured data that is fed to VLMs as input can bring this bias in effect.</p><h4>Delivery Channels</h4><p>Structured data can reach the multimodal models through different modalities: embedded in text prompt, drawn on the image pixels or split across both. The delivery channel is “how” the data enters the model’s input.</p><h4>[O_o]</h4><p>If you are short on time, here are the main three main things that I learned while designing the experiments to understand why the the VLM’s results regressed with extra information:</p><ol><li><strong>The delivery channel modulates the anchoring effect.</strong> <br>We know any structured data that forms part of the input to the VLM models may trigger anchoring bias in the model. <em>But the same bounding box information, delivered as text vs drawn on the image vs a cross-modal reference scheme, produced dramatically different severity. No prior work has held the information constant and varied only the channel.</em> The differences are not reducible to token count.</li><li><strong>Plausible metadata passes unchallenged.<br></strong>Every published adversarial attack on VLMs operates at the pixel level. <em>I found that fabricated entries in structured text: the kind your own pipeline’s false positives already produce, are enough to override visual reasoning of the VLMs.</em> The model doesn’t verify metadata against the image. It only rejects metadata the image actively <em>disproves</em>. That’s a much lower bar.</li><li><strong>Every field of metadata has a cost.<br></strong>In my scene description task, the degradation curve is monotonic. <em>Even minimal metadata: just track IDs and carrying labels, costs visual perception.</em> There is no level where “a little data helps.” Whether this holds for other tasks is an open question, but for anything that depends on visual perception, every field you add trades perception for narration.</li></ol><p><strong>The rest of this post proves each of these claims.</strong></p><blockquote>If your interest is limited to mitigating these risks, skip directly to the “What to do about it” section at the end.</blockquote><h3>Motivation behind the experiment</h3><p>The core idea was to use VLMs to “describe” a sequence of video in enough detail. If the details capture outliers and notable events, we can search through the “video description” to quickly find whatever we are looking for.</p><p>The architecture was layered: YOLOv8 runs object detection and tracking on every frame, a math layer computes motion derivatives (velocity, acceleration, approach/retreat signals, turning sideways etc), and then a VLM receives sampled frames plus this pre-computed context to produce semantic understanding for “what’s actually happening in this clip.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tkw4g4bgG1ABLSe5-zcHDQ.png" /><figcaption>My naive attempt at solving the video search problem</figcaption></figure><blockquote>The assumption was intuitive: give the VLM a head start. It knows who’s in the scene, what they’re carrying, where they’re moving. It has bounding boxes, track IDs, confidence scores. <strong>This should be strictly better than vision alone.</strong></blockquote><h4>I was wrong.</h4><p>The more structured data I fed the model, the less it looked at the actual frames.</p><p>I knew I had to design experiments to understand why.</p><h3>The Experiment Methodology</h3><p>I took a 10-second surveillance clip (85s — 95s) of a shoplifting event: a woman selects a dark garment from a clothing rack, conceals it in her shoulder bag around 90s, and walks away.</p><p><strong>Every condition received the same two images:</strong></p><ul><li>A 3x3 temporal grid of 9 uniformly sampled frames from the window</li><li>The center frame (~90s) at full video resolution</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*ntQiSo0-HVVmFuoU77Tn7w.jpeg" /><figcaption>Temporal grid to capture the sequence of visual information in lieu of tracking data from math layer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*nh9qij3SFkWdUkDa9IjXoA.jpeg" /><figcaption>The center frame sent along the temporal grid</figcaption></figure><p>The temporal grid &amp; the center frame remained the same across experiments. The text data sent alongside the prompt captured all our detection (real + fake) and tracking data except the only variable was how and whether the bounding box data from the YOLO pipeline was delivered. See the table below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lc_7k80MjmvTTVWfAptjdw.png" /><figcaption>All cases: {detections from YOLOv8L + BoT-SORT} x {three delivery channels for the bounding boxes}</figcaption></figure><p><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM/blob/main/experiments/exp1/prompts/exp1_0_prompt.txt"><strong>Baseline (0)</strong></a><strong>:</strong> Clean images, no detection data. Vision only. The base prompt was the following:</p><pre>You are analyzing a surveillance video clip.<br>You are given two images:<br>- Image 1: a 3x3 temporal grid of 9 uniformly-sampled frames from an 85.0s–95.0s window, left-to-right top-to-bottom, each timestamped.<br>- Image 2: the center frame (~90.0s) at full resolution.<br>Describe what is happening in this window. Include timestamps.<br>Focus on: what each person is doing, what objects are present, notable events, any suspicious or significant activity.</pre><p><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM/blob/main/experiments/exp1/prompts/exp1_b_prompt.txt"><strong>B (Text Real)</strong></a><strong>:</strong> Clean images + a JSON block in the prompt containing real YOLOv8-L + BoT-SORT detections and tracks: track IDs, classes, confidence scores, and bbox coordinates as pixel values [x1, y1, x2, y2].</p><p><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM/blob/main/experiments/exp1/prompts/exp1_c_prompt.txt"><strong>C (Text Fake)</strong></a><strong>: </strong>Same as B, but the JSON also includes three fabricated entries: a fake person in the empty right aisle, a fake handbag on the floor, and a fake cell phone, near the shoplifter’s hand.</p><p><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM/blob/main/experiments/exp1/prompts/exp1_d_prompt.txt"><strong>D (Visual Real)</strong></a><strong>:</strong> Center image has coloured bounding boxes drawn on it (green for person, blue for handbag, etc.) with class+confidence labels above each box (e.g., “person 0.86”). The prompt gets metadata but no bbox coordinates, the spatial info is only in the image.</p><p><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM/blob/main/experiments/exp1/prompts/exp1_e_prompt.txt"><strong>E (Visual Fake)</strong></a><strong>:</strong> Same as D, but the drawn overlays include boxes for the three fake detections too.</p><p><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM/blob/main/experiments/exp1/prompts/exp1_f_prompt.txt"><strong>F (Cross-modal Real)</strong></a><strong>:</strong> Center image has only ID labels drawn on it (“T1”, “O164” — no class, no box). The prompt contains a JSON with detections (no bbox field) plus an id_labels mapping table. The model has to cross-reference: see “T1” on image → look up T1 in text → learn it’s a person carrying a handbag.</p><p><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM/blob/main/experiments/exp1/prompts/exp1_g_prompt.txt"><strong>G (Cross-modal Fake)</strong></a><strong>:</strong> Same as F, but with the three fake detections included in both the image labels and the text mapping table.</p><h3>The Metrics</h3><p>To measure what was happening, I scored each response on two dimensions:<br>1. <strong>Visual Detail (VD):</strong> observations only derivable from pixels: posture, gaze, hand actions, clothing, spatial relationships.<br>2. <strong>Data Narration (DN):</strong> sentences that reference, restate, or cite provided detection data: track IDs, bounding boxes, carrying labels, confidence scores.</p><p>The Visual Reasoning Ratio = <strong>VD/(VD+DN)</strong> tells you how much of the model’s output comes from actually looking at the image versus narrating the data it was given. A ratio of 100% means pure visual reasoning. A ratio of 30% means the model is mostly reading you back its input.</p><blockquote>Visual Reasoning Ratio(VRR) = VD / (VD + DN)</blockquote><blockquote>I know what you are thinking: these metrics are not really objective. And I would agree. But the task at hand was “scene description” and these proxy metrics were rigorous enough for the task at hand. To get a consistent number, I relied on Claude Opus model from Anthropic and let it assign the scores based on the raw VLM outputs.</blockquote><h3>Pattern 1: The delivery channel modulates the anchoring effect</h3><p>As we know, structured data in the prompt suppresses visual reasoning (anchoring bias). The <em>magnitude</em> of that suppression depends on how the data is delivered. Here are the results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhderkhSE3crzCLOu7aL9Q.jpeg" /><figcaption>Anchoring Bias quantified across experiments</figcaption></figure><p>The same bounding box information, delivered three ways, produced dramatically different outcomes.</p><p><strong>Text bounding boxes</strong> (condition B): where the bounding boxes from the object detection pipeline were given as structured text, dropped the VD ratio to 53%. The model narrated track IDs and bag classifications instead of watching the scene. Shoplifting description was hedged to “noteworthy behaviour.”</p><p><strong>Visual bounding boxes</strong> (condition D): where the boxes were drawn directly on the input image, held at 69%. The model still described the concealment: <em>“appears to place the item she just took into her large shoulder bag… consistent with shoplifting behaviour.”</em> <strong>The boxes directed attention without replacing observation.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*LPODp_hIz-5G94f7epqRaw.jpeg" /><figcaption>Bboxes overlaid on the image input</figcaption></figure><p><strong>Cross-modal delivery</strong> (condition F): where ID labels were drawn on the image but resolved via a text mapping table given in the prompt, dropped to 47% and produced the worst outcome of any real-data condition. The model fabricated movement that never occurred: <em>“She stops, turns around, and walks back toward her original position.”</em> The person never walked back. The cognitive load of cross-referencing visual IDs against text labels consumed the model’s “attention budget”, leaving nothing for independent scene analysis.</p><h4>Why does the delivery channel matter?</h4><p>I think it comes down to this: visual overlays are attention cues. They say “look here.” The model processes them as part of the image and investigates what’s inside the box. Text bboxes are propositional claims. They say “this entity exists, with these attributes, at these coordinates.” The model narrates the proposition instead of verifying it. I have also identified other potential mechanisms from existing research work, which may explain this behaviour, but I will discuss it a little later.</p><p>You may have one natural objection: may be this is just a token count effect. More text tokens in the prompt means less attention left for the image. I had the same doubt. Here’s the breakdown (image tokens are constant at 1,032 across all conditions):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1FO2ybXg5a4cQTu11nBZQg.png" /><figcaption>Experiments ordered by increasing text:image token ratio</figcaption></figure><p>The channel effect is not reducible to token count. Condition F (crossmodal, 328 tokens) anchors harder than condition B (text bbox, 353 tokens) despite having <em>fewer</em> text tokens. Cross-modal reference resolution imposes cognitive load beyond what raw token count captures.</p><h4>How this differs from prior work</h4><p>Anchoring bias in text-only LLMs is established territory: models over-weight reference values in reasoning tasks (Jones &amp; Steinhardt 2022). But that’s text-in, text-out. <strong>Nobody has tested what happens when anchoring data competes with <em>visual perception</em> in a multimodal model.</strong></p><p>The closest related work comes from visual prompting. <a href="https://arxiv.org/abs/2310.11441">Set-of-Mark prompting (Yang et al. 2023)</a> showed that visual overlays direct VLM attention. <a href="https://arxiv.org/abs/2403.02325">Contrastive Region Guidance (Wan et al., ECCV 2024)</a> designed a better way to perform visual prompting to help VLM performance. A <a href="https://www.lesswrong.com/posts/dktDLahikgoK4sen3/biasing-vlm-response-with-visual-stimuli">LessWrong analysis (“Biasing VLM Response with Visual Stimuli”)</a> showed that visual highlighting shifts VLM answers toward marked options, even incorrect ones. <strong>But none of these held the information constant and varied the delivery channel. That’s the gap this experiment fills.</strong></p><p><strong>There’s also a possible mechanistic explanation:</strong></p><blockquote>“<a href="https://arxiv.org/abs/2510.17771">Seeing but Not Believing” (Liu et al. 2025) </a>showed that VLM visual encoders capture the right information, but the language backbone overrides it during generation. Structured text data in the prompt may amplify this override.</blockquote><p><a href="https://arxiv.org/abs/2403.14003">Favero et al. (M3ID, CVPR 2024)</a> showed that VLMs’ reliance on visual input decays as more output tokens are generated. My data suggests the suppression can begin <em>before</em> generation even starts: from the input side, by loading the prompt with structured text.</p><blockquote>If you’re building a VLM pipeline and need to pass spatial data, visual overlays preserve more independent reasoning than text coordinates. Cross-modal reference schemes are the worst option.</blockquote><h3>Pattern 2: Plausible metadata passes unchallenged</h3><p>VLMs don’t verify metadata against the image. They only reject what the image actively disproves. I tested this by injecting three fake detections alongside the real ones:</p><ul><li>A fake <strong>person</strong> in the empty right aisle (confidence 0.52)</li><li>A fake <strong>handbag</strong> on the floor near a rack (confidence 0.47)</li><li>A fake <strong>cell phone</strong> near the subject’s hand (confidence 0.44)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*HVGdA2ptL9Ie6Pz9Fg7hiw.jpeg" /><figcaption>T89 is a fake person, 0412 a fake handbag &amp; 087 a fake phone (all in red)</figcaption></figure><p>The fake person and fake handbag were ignored in every condition, by both models. No visual evidence supported them, and the models declined to adopt them.</p><p>The fake cell phone was adopted in every condition it appeared in. Both models. Every time. Here’s the progression:</p><p><strong>Baseline</strong> (no data): <em>“quickly stuffing the dark garment into her large tote bag”</em></p><p><strong>Condition C</strong> (text + fakes): <em>“she appears to hold a cell phone… her behavior of taking an item and quickly walking away while looking at the camera could be considered notable for security purposes”</em></p><p><strong>Condition G</strong> (crossmodal + fakes): <em>“she stands in the middle of the hallway and looks at a cell phone in her hands… No suspicious activity is observed”</em></p><p>One fabricated entry at 0.44 confidence turned a confident shoplifting detection into “checking her phone before walking away.”</p><p>The difference between the adopted phone and the rejected person/bag is positional plausibility. The phone’s bounding box overlaps the subject’s hand region, it’s spatially consistent with what the model can see, even if the phone itself isn’t visible at that resolution. The fake person sits in an empty aisle with no visual evidence. The fake bag sits on the floor away from any person.</p><blockquote><strong>The model’s bar for adopting a fabricated detection is <em>not</em></strong></blockquote><blockquote><strong>“Can I see this in the image?”</strong></blockquote><blockquote><strong>It’s actually,</strong></blockquote><blockquote><strong>“Is there anything in the image that disproves this?”</strong></blockquote><blockquote>That’s a much lower bar.</blockquote><p>And the model can be critical when it wants to. In condition E, it correctly flagged that mannequins were misidentified as persons by the detection system: <em>“the detection system misidentifies these as persons in the 90.0s frame.”</em> But it applied that skepticism only where visual evidence was unambiguous (a clearly static mannequin) and not where it was merely ambiguous (a small phone bbox near a hand in a low-res region). The model’s skepticism is asymmetric: it challenges data that <em>obviously</em> contradicts the image, but accepts data that <em>merely lacks support</em> in the image.</p><h4>How this differs from prior work</h4><p>Every published adversarial attack on VLMs operates at the pixel level. <a href="https://arxiv.org/abs/2509.16645">AdvEDM (NeurIPS 2025)</a> injects semantics via adversarial image perturbations. Shadowcast (NeurIPS 2024) poisons training data. <a href="https://pubmed.ncbi.nlm.nih.gov/39890777/">Prompt injection work in oncology VLMs (Nature Communications 2024)</a> embeds sub-visual triggers in medical images. All of these modify the image itself.</p><p>What I found is a simpler, arguably more realistic attack surface: fabricated entries in the structured text metadata that accompanies the image. You don’t need adversarial perturbations. You don’t need to poison training data.</p><blockquote>Your own pipeline’s false positives, the detections you normally wouldn’t worry about because they’re below your confidence threshold, are already doing this, if they happen to land near a real entity.</blockquote><h3>Pattern 3: Every field of metadata has a cost</h3><p>In a separate experiment on the same shoplifting scene, I held the delivery channel constant (text JSON) and varied how much tracking data was included: from nothing to dense per-frame sampling with all motion fields. Note: this particular experiment used Gemini 2.5 Flash.</p><p>For the scene description task, every unit of this structured data traded visual perception for data narration. Since I varied data density across five levels on the same shoplifting scene I was able to quantify the curve of this loss:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7Rtvdr4Udaw7CFqRW36Ag.png" /><figcaption>The cost of metadata on visual perception of VLMs</figcaption></figure><p>The curve is monotonic. Every additional field of structured data costs visual perception. There is no level where “a little data helps”. Even G1 (minimal metadata: just track IDs, time ranges, and carrying labels) drops the visual reasoning ratio by 15 points.</p><p>At G4, the model latched onto a data artifact, a carrying-label change from “handbag” to “backpack” at 93.7s, a YOLO misdetection and treated that as the primary event: <em>“A significant change occurs: the tracking data indicates she is now carrying a ‘backpack’ instead of a ‘handbag’.”</em> The actual shoplifting, visible in the same frames, was not mentioned. Conclusion: <em>“No suspicious activity is identified.”</em></p><p>Prior work suggests complexity hurts VLM reasoning: <a href="https://proceedings.neurips.cc/paper_files/paper/2024/hash/4ea4a1ea4d9ff273688c8e92bd087112-Abstract-Conference.html">Multi-Object Hallucination (Chen et al., NeurIPS 2024)</a> showed hallucination increases with object categories, M3ID (CVPR 2024) showed visual reliance decays with output length. But those findings imply “be careful.”</p><p>For my task: scene description, where visual perception is the whole point, the data says there is no safe amount. The degradation starts at the very first field of metadata and never reverses.</p><blockquote>Whether other tasks (object counting, structured extraction) have a different curve shape is an open question. But for anything where you need the model to look at the image, every field you add has a measurable cost.</blockquote><h3>This isn’t just one model</h3><p>All the results discussed above used Gemini 3 Flash Preview (except the pattern 3, gradient experiment). I also ran the same seven-condition experiment on Gemini 2.5 Flash. The anchoring pattern is identical in direction: same channel ranking (visual &lt; text &lt; cross-modal), same fake phone adoption in all injection conditions, same cross-modal fabrication.</p><p>The key difference is the baseline. Gemini 2.5 Flash’s vision-only response hedges: <em>“no definitive evidence of theft or illicit activity.”</em> It sees the garment, sees the bag, describes the posture , but can’t synthesize them into a shoplifting interpretation. <em>Every data condition degraded further from an already-weaker starting point.</em></p><p>The most striking difference was in fake entity adoption. Gemini 3 Flash Preview adopted only the spatially-plausible phone and ignored the fake person and fake bag. Gemini 2.5 Flash, in the crossmodal+fake condition, adopted all three: inventing a “mannequin (T89)” to explain the fake person detection and an “empty red box (O412)” to explain the fake handbag. It never concluded the data was wrong. It fabricated objects to make the data true.</p><blockquote>If you’re deploying a cost optimized smaller model in your pipeline, anchoring effects will most likely be worse.</blockquote><h3>What to do about it</h3><p>Here’s what you can do about this, today:</p><h4>Use structured data to select, not to describe.</h4><p>Tracking data is excellent at identifying <em>which</em> 10-second window contains interesting activity: velocity spikes, proximity events, new entity appearances. <em>Use it to choose what the VLM looks at. Don’t put it into the prompt to “help” the VLM understand the window. Let the model look with its own eyes.</em></p><h4>If you must include data, use visual overlays, not text.</h4><p>Visual bounding boxes preserved 69% visual reasoning compared to 53% for text-encoded bounding boxes with the same spatial information. <em>The model treats drawn boxes as regions to investigate, not claims to narrate. This is a simple architectural choice with measurable impact.</em></p><h4>Never use cross-modal reference schemes.</h4><p>Numbered IDs on images with text mapping tables produced the lowest VD ratio (47%) and the most fabrication of any real-data condition. <em>The cross-referencing task consumes the model’s attention budget before it gets to the actual scene. If you need to label regions, draw the labels directly on the image.</em></p><h4>Always run a vision-only baseline.</h4><p>Before adding any structured data to your pipeline, establish what the model can see on its own. If the baseline misses the event, data may not help: it’ll add narration without adding perception. If the baseline catches the event, adding data risks suppressing it. <em>Depending on the use case, the baseline may be your ceiling, not your floor. If you must include the data from upstream CV pipeline, my humble advice is to be clever about how to utilize anchoring bias in your favour.</em></p><h4>Treat detection data as adversarial input.</h4><p>Your own pipeline’s false positives at moderate confidence can rewrite the VLM’s entire narrative, especially if they happen to be spatially plausible. Filter aggressively. If a detection doesn’t clear a high confidence threshold, it’s safer to omit it than to include it and hope the VLM applies skepticism. It won’t. Alternatively, make sure your upstream results are as good as they can be.</p><h3>Going deeper</h3><p>This post covers the controlled experiment and the engineering takeaways by taking one of the video examples.</p><p>I had also tested the hypothesis on another video of a busy street that has a collision at the end. The results were mostly the same, but the video was too chaotic and text:image token ratio was getting really skewed. Hence, it’s excluded from the report.</p><h4>GitHub Companion Repo</h4><blockquote>Full methodology, all raw prompts, all model responses, images, and scoring rubrics are present in this companion repo: <a href="https://github.com/mraduldubey/Anchoring-Bias-VLM">GitHub repository</a> 🎄<br><strong>Citable archive: DOI 10.5281/zenodo.19557723</strong></blockquote><p>But along the way, I found <em>other kind of failure modes</em> that are harder to summarize in a table and more unsettling in their implications: a model that invented a fictional person to avoid contradicting its data. A model that accused the wrong person of shoplifting and cited irrelevant tracking data as proof. A model that watched a car crash happen and declared “no suspicious activity” because the 2,341 lines of tracking JSON didn’t mention it.</p><h4>Upcoming Part 2: The Failure Catalogue</h4><blockquote>Some of those stories are in <strong>Part 2: The Failure Catalog: </strong>ghost entities and false accusations, that captures the other kinds of failures that I noticed while working on this. I am planning to publish this shortly.</blockquote><h4>[~_~]</h4><p>If you’re building a system that feeds structured data to a VLM: surveillance, medical imaging, autonomous vehicles, document analysis, test for this. I’d like to be wrong about the generality. I don’t think I am.</p><h4>Disclaimer ⚠️</h4><ul><li><em>This is an engineer’s investigation, not a peer-reviewed study. I tested two models (Gemini 3 Flash Preview as primary, Gemini 2.5 Flash as secondary) on one primary scene across seven controlled conditions.</em></li><li><em>Both are multimodal LLMs with reasoning capabilities, not minimal vision-language architectures and the anchoring effects may interact with their reasoning layers in ways that differ from simpler models. The patterns I found are consistent and reproducible within that scope. They are not a proof of universality.</em></li><li><em>By “VLMs” I mean generative vision-language models: Gemini, GPT-4o, Claude, LLaVA, Qwen-VL, InternVL. Models that accept interleaved image and text input and produce free-form text output. Not contrastive encoders like CLIP. Open-source VLMs (LLaVA, InternVL) are likely equally or more susceptible; I’d welcome community replication.</em></li><li><em>All raw prompts, raw model responses, images, and scoring methodology are in the companion </em><a href="https://github.com/mraduldubey/Anchoring-Bias-VLM"><em>GitHub repository</em></a><em>. I would encourage replication on other models, architectures, and domains before drawing production conclusions.</em></li><li>Citable archive: DOI 10.5281/zenodo.19557723</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c07f33b6a159" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/vlm-the-more-you-tell-it-the-less-it-sees-c07f33b6a159">VLM: The More You Tell it, The Less it Sees.</a> was originally published in <a href="https://pub.towardsai.net">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Papers That Taught Machines to Comprehend]]></title>
            <link>https://medium.com/@mraduldubey/the-papers-that-taught-machines-to-comprehend-0c091cbb39f8?source=rss-b72e98a18093------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c091cbb39f8</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[vlm]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Mradul Dubey]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 01:15:16 GMT</pubDate>
            <atom:updated>2026-04-16T01:15:16.571Z</atom:updated>
            <content:encoded><![CDATA[<p>And why the future is essentially, multimodal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JvbyLQ7Eir4Av7xR8GCRhQ.png" /></figure><p>If you’ve been following my timeline of the <a href="https://medium.com/@mraduldubey/the-papers-that-taught-machines-to-see-7414aed7fd45">14 papers that changed Computer Vision</a>, you know really enjoy putting things on a timeline. It offers a chronological perspective thats rare.</p><p>But before I was working on Computer Vision, working with pixels, I was a college student obsessed with <strong>NLP</strong>. My final year project attempted to solve “Sarcasm Detection in Text” using topic modelling. I worked for an year in the adjacent domains of text and audio AI. During this time, I optimized ASR for android phones, implemented NLU modules for production.</p><p>Back then, we were just trying to get machines to “understand” sentiment. Now, we’re talking to them like colleagues.</p><p>To understand the jump from basic text math to <strong>GPT-4</strong>, you have to look at these 12 milestones.</p><h3>TF-IDF (1972) — Karen Spärck Jones</h3><p>The OG. J<strong>ones showed us that a word’s importance isn’t just frequency; it’s about how unique it is to a document. </strong>It’s the statistical bedrock that proved we could turn language into a searchable, weighted numerical problem.</p><h3>Word2Vec (2013) — Mikolov et al.</h3><p>The “Big Bang” for NLP. <strong>This paper proved words could be vectors in a high-dimensional space where “King — Man + Woman = Queen.” </strong>It turned NLP from a dictionary problem into a geometry problem. Similarity between two words reduced to a trigonometric formula.</p><h3>FastText (2016) — Facebook AI Research (FAIR)</h3><p>As a dev, this was the practical hero. By breaking words into subwords (n-grams), <strong>FastText solved the “out-of-vocabulary” nightmare.</strong> It made NLP robust for the messy, typo-ridden real world. Even remembering “out-of-vocabulary” these many years laters leaves me anxious.</p><h3>The Transformer (2017) — Vaswani et al.</h3><p><strong>“Attention Is All You Need.”</strong> This is the most important paper of the decade. By ditching recurrence (LSTMs) for self-attention, it allowed us to train massive models in parallel. Every LLM today is a descendant of this specific architecture. Also, what a title for a research paper! And, yes, the name is enough.</p><h3>BERT (2018) — Devlin et al.</h3><p>Google’s masterpiece. <strong>BERT taught models to look at context from both directions (left and right) simultaneously. </strong><em>It stopped being about “predicting the next word” and started being about “understanding the whole sentence.”</em></p><h3>GPT-3 (2020) — Brown et al.</h3><p>The paper that proved <strong>Scale</strong> is a feature. <strong>OpenAI showed that if you make the model big enough and feed it enough of the internet, it starts to exhibit “few-shot” reasoning. </strong>It was the moment the world realized AI could write better than most humans.</p><h3>T5 (2020) — Raffel et al.</h3><p>The “Text-to-Text” Transfer Transformer. <strong>Google reframed every NLP task: translation, summarization, classification, into a simple text-to-text format.</strong> It unified the field into a single, clean pipeline.</p><h3>LoRA (2021) — Hu et al.</h3><p>Low-Rank Adaptation showed we could fine-tune massive models by only tweaking a tiny fraction of the parameters. <em>It made “personalizing” an LLM possible on consumer hardware.</em></p><h3>InstructGPT / RLHF (2022) — Ouyang et al.</h3><p>The secret sauce behind ChatGPT. <strong>It wasn’t just about being smart; it was about being <em>helpful</em>.</strong></p><p><strong><em>Reinforcement Learning from Human Feedback (RLHF)</em></strong> aligned model outputs with human intent, curing (some of) the “AI sociopath” tendencies.</p><h3>Llama / Llama 2 (2023) — Meta</h3><p><strong>The democratization of LLMs.</strong> By releasing a high-performing, open-weights model, Meta broke the “closed API” monopoly. It sparked the massive open-source AI explosion we’re living in right now.</p><h3>Mistral 7B / Mixture of Experts (2023) — Jiang et al.</h3><p><strong>Proved that small and smart beats big and bloated.</strong> By using “Mixture of Experts” (MoE), Mistral showed we can get GPT-4 level performance while only activating a fraction of the model’s parameters at any given time.</p><h3>The Converged Future (2024+) — PaliGemma / LLaVA</h3><p><strong>The timeline ends where my </strong><a href="https://medium.com/@mraduldubey/the-papers-that-taught-machines-to-see-7414aed7fd45"><strong>CV article</strong></a><strong> ended as well.</strong></p><p>Vision-Language Models (VLMs) have effectively erased the border between NLP and Computer Vision. <em>Tokens and pixels now live in the same latent space.</em></p><p>If I had to pick the three “pillars” here: <strong>Word2Vec</strong> (vectorizing meaning), <strong>Transformers</strong> (scaling context), and <strong>Llama</strong>(opening the gates).</p><p>The transition from my college NLP projects to the CV/Edge AI work I do now feels like a <strong>straight line</strong>. <strong>We’ve gone from counting words to simulating intelligence.</strong></p><blockquote><strong>The future is essentially, undoubtedly, multimodal.</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c091cbb39f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Papers That Taught Machines to See]]></title>
            <link>https://medium.com/@mraduldubey/the-papers-that-taught-machines-to-see-7414aed7fd45?source=rss-b72e98a18093------2</link>
            <guid isPermaLink="false">https://medium.com/p/7414aed7fd45</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai-research]]></category>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[object-detection]]></category>
            <dc:creator><![CDATA[Mradul Dubey]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 16:24:46 GMT</pubDate>
            <atom:updated>2026-04-15T16:24:46.751Z</atom:updated>
            <content:encoded><![CDATA[<p>Chronology of the science of deep learning for computer vision</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ac1zESv7GkwEvEjofEsq0g.png" /></figure><p>If you want to understand where computer vision is today, you need to know the papers that got us here, specially technically if you work in computer vision.</p><p>But, sometimes, it&#39;s interesting to step back and analyse the situation from chronological point of view, to track the leaps made and what breakthrough happened when.</p><p>Also, let’s reflect on the real story, what each paper actually broke, what surprised people, and why it mattered more than anyone expected at the time.</p><p><strong>Here’s my timeline. Fourteen papers. Three decades.</strong> <strong>One thread connecting handwritten digits to vision-language models.</strong></p><h3>LeNet-5 (1998) — Yann LeCun et al.</h3><p>The paper that proved CNNs work. LeCun built a network that could read handwritten digits on bank cheques. Most people treated it as a neat trick for a narrow problem.</p><p>They missed the real lesson: <strong>learned features beat hand-crafted ones.</strong></p><p>Every modern vision model descends from this idea. LeCun would wait 14 years for the world to catch up.</p><h3>AlexNet (2012) — Krizhevsky, Sutskever, Hinton</h3><p><strong>The Big Bang.</strong> Two grad students and their advisor entered the ImageNet competition with a deep neural network , which was surprisingly, a fringe idea at the time, and obliterated the field by over 10 percentage points.</p><p><em>The secret ingredient wasn’t architectural brilliance. It was two NVIDIA GTX 580 GPUs. Alex Krizhevsky was just trying to delay getting a real job.</em></p><p>Hinton later said: “Ilya thought we should do it, Alex made it work, and I got the Nobel Prize.” <strong>Hinton won the 2024 Nobel Prize in Physics for this line of work.</strong> Before AlexNet, almost nobody used neural networks for vision. After it, almost everybody did.</p><h3>VGGNet (2014) — Simonyan, Zisserman</h3><p>The “just stack more 3x3 convs” paper. VGG proved that depth matters and you don’t need clever multi-scale tricks, just go deeper with a simple, uniform architecture. It didn’t win ImageNet that year (GoogLeNet did), but VGG became the default backbone everyone actually used.<em> Sometimes the runner-up shapes the field more than the winner.</em></p><h3>GoogLeNet / Inception (2014) — Szegedy et al.</h3><p>The actual ImageNet 2014 winner. Inception modules ran multiple filter sizes in parallel and concatenated them. The first serious attempt at multi-scale feature extraction within a single layer. Architecturally clever, but the lasting contribution was the idea that you could design network topology itself as a learnable problem. <em>The inception module was the ancestor of every “let the architecture do the thinking” approach that followed.</em></p><h3>ResNet (2015) — Kaiming He et al.</h3><p>The paper that broke the depth barrier. <strong>Before ResNet, deeper networks performed worse, which made no theoretical sense. Adding more layers should help, not hurt.</strong></p><p>His team at Microsoft Research Asia added <strong>skip connections</strong>: just let the input bypass layers and add itself to the output. <em>Embarrassingly simple</em>. But it let them train 152-layer networks where 20-layer ones used to fail.</p><p><em>Over long time, the real impact wasn’t the ImageNet win. It was that skip connections showed up everywhere afterward, including in every single transformer model that exists today. Every time you use GPT or BERT, ResNet’s skip connections are in there.</em></p><h3>YOLO v1 (2016) &amp; SSD (2016) — Redmon et al. / Liu et al.</h3><p><strong>Before YOLO, object detection was a two-stage affair. First propose regions, then classify them. </strong>Slow.</p><p><em>YOLO reframed detection as a single regression problem: one forward pass, done.</em> Real-time object detection became possible on commodity hardware.</p><p>The backstory is bittersweet. Joseph Redmon, YOLO’s creator, quit computer vision research in 2020. He said the military applications and privacy concerns became impossible to ignore. His YOLOv3 paper had already contained unusually sharp jabs at Google and Facebook over surveillance. There was no YOLOv4 from Redmon. The community forked his work and kept going. Now YOLOvX has been almost hijacked by Ultralytics which are notorious for not releasing any research paper with their new model releases.</p><h3>Feature Pyramid Networks (2017) — Lin et al.</h3><p><strong>FPN solved a quiet but critical problem: detecting objects at vastly different scales in the same image.</strong> It built a top-down pathway with lateral connections that let high-level semantic features flow down to high-resolution layers. Doesn’t sound glamorous. But FPN became the backbone of essentially every competitive object detector for the next five years. If you’ve used Faster R-CNN, Mask R-CNN, or RetinaNet, FPN was doing the heavy lifting underneath.</p><h3>EfficientNet (2019) — Tan, Le</h3><p><strong>The “stop brute-forcing depth” paper.</strong> Mingxing Tan and Quoc Le showed that scaling width, depth, and resolution together with a compound coefficient beats scaling any single dimension.<em> EfficientNet matched state-of-the-art accuracy at a fraction of the compute.</em> The real contribution was a mindset shift: efficiency is a first-class design goal, not an afterthought. Edge deployment people (like me) owe this paper a lot.</p><h3>Vision Transformer / ViT (2020) — Dosovitskiy et al.</h3><p>The paper that said:<strong> what if we just throw away convolutions entirely? Chop the image into 16x16 patches, treat them as tokens, and feed them to a standard transformer.</strong></p><p><em>The computer vision community was skeptical: transformers were an NLP thing. But ViT worked. With enough data, it matched or beat CNNs.</em></p><p>The deeper lesson was uncomfortable: maybe convolutions weren’t a fundamental inductive bias for vision. Maybe they were just a computational shortcut for the data-scarce era. The debate isn’t settled, but ViT forced it open.</p><h3>DETR (2020) — Carion et al.</h3><p><strong>End-to-end object detection. No anchors, no NMS, no hand-designed components. Just a transformer encoder-decoder with learned object queries.</strong></p><p>The simplicity was shocking. DETR was initially slow and struggled with small objects, but it proved that detection could be reformulated as a set prediction problem. That opened the door to everything that followed: including RT-DETR, which eventually made transformer-based detection fast enough for real-time use.</p><h3>DINO / DINOv2 (2021 / 2023) — Caron et al.</h3><p><strong>Self-supervised learning for vision that actually worked.</strong> DINO trained a ViT with no labels at all, just self-distillation and the resulting features were good enough to use as a general-purpose visual backbone. DINOv2 scaled this up and produced features that rival supervised models across tasks. The quiet revolution here: we might not need labeled datasets for vision anymore. The features emerge from structure alone.</p><h3>Segment Anything / SAM (2023) — Kirillov et al.</h3><p><strong>Meta’s foundation model for segmentation.</strong></p><p>Give it a point, a box, or a text prompt, and it segments any object in any image. SAM was trained on 11 million images and over 1 billion masks. The scale was the story.</p><p>But the real shift was conceptual: segmentation went from a task-specific model to a general-purpose tool. <strong>SAM is to segmentation what GPT was to text: a foundation model that makes the task feel solved (even when edge cases remain).</strong></p><h3>RT-DETR (2023) — Zhao et al.</h3><p><strong>Real-time DETR. </strong>Took the elegant set-prediction framework of DETR and made it actually fast enough for production.</p><p>Hybrid encoder, efficient cross-attention, no NMS needed. <strong>For people deploying detection models on real hardware, RT-DETR was the moment transformer-based detection became a practical option, not just a research curiosity.</strong></p><h3>PaliGemma / LLaVA / Qwen-VL (2023–2024)</h3><p><strong>Vision meets language.</strong> These models take a vision encoder (often a ViT variant), connect it to a large language model, and suddenly the model can describe images, answer visual questions, and reason about what it sees. This is where the vision and NLP timelines finally converge. The image becomes a token sequence. The boundary between “seeing” and “understanding” dissolves. <strong>We’re still early, but the trajectory is clear: the future of vision is multimodal.</strong></p><p>From LeCun’s digit reader to models that see and speak. Thirty years. Each paper standing on the shoulders of the last.</p><p>If I had to pick the three that changed the most: <strong>AlexNet (proved deep learning works), ResNet (made it trainable at any depth), and ViT (proved convolutions were optional).</strong> Everything else is a refinement of those three shifts.</p><p>If you disagree with the list, or if you think I had missed something important, please do let me know.</p><p>This was a fun entry to write. Its a different perspective :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7414aed7fd45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rabbit Hole that is Model Quantization]]></title>
            <link>https://medium.com/@mraduldubey/the-rabbit-hole-that-is-model-quantization-d2637f7a70b1?source=rss-b72e98a18093------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2637f7a70b1</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[quantization]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[edge-computing]]></category>
            <dc:creator><![CDATA[Mradul Dubey]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 00:28:12 GMT</pubDate>
            <atom:updated>2026-04-15T14:40:24.923Z</atom:updated>
            <content:encoded><![CDATA[<p>I love rabbit holes and this is my motivation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n3Bh-oN9PugE0-kKkksPrw.png" /><figcaption>Funnelling down the rabbit hole</figcaption></figure><p>Model quantization is not the most exciting part of the ML model lifecycle for many people. Its probably a item on a checklist, a script that needs to be run before moving on to deployment.</p><p>As part of my work at <a href="https://medium.com/u/dc5920719017">Apra Labs</a> is on Edge AI. I deploy object detection models on edge hardware. Not cloud GPUs with 80 GB of VRAM, actual edge hardware with tight memory and real constraints.</p><p>A float32 YOLO model looks great on your dev machine. Then you try to deploy it on an edge accelerator and everything falls apart. Confidence score collapse, latency spikes, layers silently fallback to CPU. Your 85% detection confidence becomes 0.06 after conversion.</p><p>I’ve spent a significant amount of time fighting this. And I realised, I have been making an often repeated mistake in the landscape of Machine Learning:</p><blockquote>I was treating quantization like a checkbox.</blockquote><p>Run a script, get a smaller model. Ship it 🚀 . Right ?</p><p>Once you realize that, it only takes a second to realize the gravity of your mistake. If you keep an ear out for the buzzwords, you’d know that the pioneering work being done in LLM space is pushing the limits of quantization.</p><blockquote>Llama 3 70B in Q4_K_M, Qwen 3.5 running on a laptop through Ollama. Everyone’s crushing 70 billion parameter models down to 4 bit integers and running them locally and getting practical results. It sounds like magic, its not. Its quantization.</blockquote><p>It’s the same affine mapping, the same scale-and-zero point math I’ve been doing. The difference is only this: when LLM quantization goes wrong, you get slightly worse text. When mine goes wrong, a camera misses a person.</p><p><em>So, I sat down and mapped out everything a practitioner actually needs to understand to deploy a quantized model on real hardware. The list got long. Fast.</em></p><h3>Here’s a taste</h3><p>It starts with the obvious stuff, IEEE 754. What float32 can represent vs INT8’s 256 levels. Affine mapping. Symmetric vs asymmetric. Per-tensor vs per-channel.</p><p>Then, it gets real.</p><p>ONNX graphs and QDQ nodes. How PyTorch’s eager mode decomposition affects your TFLite output. Why torch.export with <em>strict=False</em> produces a different graph than <em>torch.onnx.export. </em>Why your ONNX Runtime quantization is correct but your TFLite converter throws it all away.</p><p>Then, it gets specific.</p><p>TFLite FlatBuffer internals. What BuiltinOperator codes actually mean. Why grappler fuses your softmax but your hardware accelerator can’t run the fused version. How signature keys differ from tensor names and how getting that wrong silently breaks calibration.</p><p>Then, it gets painful.</p><p>SiLU activations falling back to CPU. INT8 confidence degradation on narrow-range sigmoid outputs. The gap between what a converter claims to support and what actually runs on a hardware accelerator.</p><h3>What I’m doing about it</h3><p>I’m writing my way through this. Not in one shot, I will break it down into parts as I go deeper into each layer.</p><p>The goal is not to produce a textbook.</p><blockquote>The goal is to produce a guide that I wish I had 6 months ago.</blockquote><p>Practitioner first. Real failures, Real fixes.</p><p>Some topics I already do know. Others, I’m still learning. I will be very upfront about which is which.</p><p>If you work anywhere near the edge ML pipeline i.e. training, conversion, optimization, deployment, some of this may save you weeks of debugging.</p><p>More soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2637f7a70b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AR: the science behind Facehero II]]></title>
            <link>https://medium.com/apra-labs-blog/ar-the-science-behind-facehero-ii-bd2b51a39912?source=rss-b72e98a18093------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd2b51a39912</guid>
            <dc:creator><![CDATA[Mradul Dubey]]></dc:creator>
            <pubDate>Thu, 24 Dec 2020 08:52:07 GMT</pubDate>
            <atom:updated>2020-12-24T09:08:48.020Z</atom:updated>
            <content:encoded><![CDATA[<h3>AR: the science behind Facehero — Part II</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kpoj3KTb_6eOkSAkUto0mg.jpeg" /><figcaption>Face Hero: A mix of science and art with an element of surprise.</figcaption></figure><p><a href="https://medium.com/apra-labs-blog/ar-the-science-behind-facehero-d27be08f328e"><strong>In part I</strong></a> of the blog, we discussed the two problems that we needed to solve to make <a href="http://bit.ly/al_facehero"><strong>FaceHero</strong></a><strong> </strong>work. We also discussed the tools we would require to solve the problems, namely, <a href="https://developers.google.com/ar"><strong>ARCore</strong></a> &amp; <a href="https://developer.apple.com/documentation/arkit"><strong>ARKit</strong></a>. In this part of the blog, we will see how exactly does the information received from our tools solves our problems.</p><h3>Problem Status</h3><p>The tools that we are using provide us with information about the user’s face location, orientation and facial gestures in real-time. Logically speaking, the next step would be to assimilate all this information to figure out the user’s face orientation and face gesture. Let me state our requirements more specifically at this point:</p><ol><li><strong>A pointer on the screen that tracks the user’s head movement.</strong></li><li><strong>To identify the following set of gestures: Angry, Smile, Pout, Neutral.</strong></li></ol><p>The first problem can be solved by some linear transformation on the head’s origin &amp; axes, which is present in information that we directly get from CenterPose in ARCore and Face Coordinate System in ARKit. The point where the vector along the z-axis passing through the CenterPose of the user’s head intersects the screen, gives us the required pointer.</p><p>For the second problem, however, we can not directly use the information provided by our tools to come to a conclusion. So, we need a module that can analyze the information that we have (BlendShapes or Face Mesh) and provide us with the exact information we need (facial gestures). That is where Machine Learning comes into picture. If we select our information supplied from the ARCore and ARKit smartly enough and process it to maintain the right balance of bias &amp; variance, then, with enough samples we might be on the right side of <a href="https://en.wikipedia.org/wiki/Hoeffding%27s_inequality"><strong>Hoeffding’s inequality</strong></a>[1] to make a Machine Learning model learn to differentiate between the required gestures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*0fxotlDAKCU813nyVveL5w.png" /><figcaption>Hoeffding’s Inequality[1]</figcaption></figure><h3>ARKit Solution</h3><p>Recollect that ARKit provided us with Face Coordinate System, 3D Face Mesh &amp; most importantly, <a href="https://developer.apple.com/documentation/arkit/arfaceanchor/2928251-blendshapes">BlendShapes</a>. BlendShapes are provided for 52 trackers for different face expression, their values ranging from 0.0 (minimum expression) to 1.0 (maximum expression). <strong>With their 52 normalized values, BlendShapes fit perfectly as a “feature vector”.</strong></p><p>A <a href="https://en.wikipedia.org/wiki/Feature_(machine_learning)">feature vector</a> can be loosely described as the unbiased representative data containing enough information to conclude the result across all the data points.</p><p>Once we have a feature vector, we could train a classifier to classify these feature vector as one of the required gestures. Since our data was not linearly separable and we were limited ourselves to classic ML algorithms, we tried Support Vector Machines with RBF kernel trained by one-vs-all method. We optimized the hyper-parameters, C and Gamma, using dynamic programming. And we got a decent enough classifier.</p><p>However, in our experiments, we found that a <strong>voting based ensemble model of multiple SVM models</strong> trained as one vs one, with one group being any given gesture and the other being all other gestures combined (including Neutral), worked really well. Therefore we ended up with 3 SVM models:</p><ul><li><strong>Angry vs Others</strong></li><li><strong>Pout vs Others</strong></li><li><strong>Smile vs Others</strong></li></ul><p>According to the game play, if the users fails to make the appropriate gesture i.e. remains Neutral then we need to penalise them. But we did not train a separate model for Neutral vs Others because we didn’t need one. Instead we rely on the voting of the three models. If majority of the classifiers classify the frame as “Others”, we take it as Neutral. So, our final result was based on the voting by these classifiers across five frames.</p><p>This ensemble works really well. The data is consistently reliable from the Apple hardware and there is no information loss from any dimensionality reduction.</p><h3>ARCore Solution</h3><p>In the previous post, we noted that <a href="https://developers.google.com/ar">ARCore </a>does not provide us with any equivalent of BlendShapes. We get a face mesh with 468 vertices in 3D space. This is in contrast to 1220 vertices in ARKit. Prima facie, this implies that we get less information from ARCore than ARKit.</p><p>This makes things more challenging with ARCore. We have 468 * 3 = 1404 data points for a given frame.</p><blockquote>So, while the BlendShapes as a feature vector is a pleasant dream come true, the 1404 point long feature vector with ARCore is a nightmare.</blockquote><p>The variance is just too high and we end up with <strong>overfit classifiers</strong> i.e. the classifiers tend to remember the exact training data rather than to identify patterns in them. This is especially true for the classical ML methods like SVM or Decision Trees.</p><p>First, we need to process the data to reduce variance using some method of <strong>dimensionality reduction</strong>, which is a standard problem in ML. The basic idea is to map the data from a high-dimensional space into a low-dimensional space. Classical algorithms use linear transformations to do this while trying to keep the information loss to a minimum. Methods like <a href="https://en.wikipedia.org/wiki/Principal_component_analysis"><strong>Principle Component Analysis (PCA)</strong></a> , <a href="https://en.wikipedia.org/wiki/Singular_value_decomposition">Singular Value Decomposition (SVD)</a> or an <a href="https://en.wikipedia.org/wiki/Autoencoder">Autoencoder</a> can be used for the same.</p><p>We used PCA to transform our 1404 data point long vector to one 20 points long vector while preserving 98 % data variability. This 20 points long vector acts as our feature vector instead of the original vector.</p><p>Once we have got our feature vector, not unlike in the ARKit case, we trained three SVM models:</p><ul><li><strong>Angry vs Others</strong></li><li><strong>Smile vs Other</strong></li><li><strong>Pout vs Others</strong>.</li></ul><p>Our final result is based on the voting by these models across five frames. This works decently enough. Although less so than in the case of ARKit. And there are reasons for the same:</p><p><em>Firstly,</em> as established earlier, we get less inherent information from ARCore, given the relative face mesh size. <em>Secondly,</em> the data coming from ARCore itself is from a Machine Learning pipeline and hardware is not involved. This makes data less consistent. <em>Thirdly,</em> there is information loss due to dimensionality reduction. Not only that, dimensionality reduction works to preserve “variability” in the data which does not entirely translate to preserving pertinent information. That is to say, a smarter dimensionality reduction methods may improve the performance.</p><p>Despite all that, there is something really interesting happening in the case of ARCore. The face mesh was envisioned to enable developers to provide features like face filters that can decently track the user’s facial expressions and movements. We are deconstructing the information from another ML pipeline in a way it was not envisioned for.</p><h3>What else did we learn ?</h3><p>Some takeaway points should also be mentioned before concluding this series.</p><p>One of that is the case with <strong>Neutral </strong>gesture. It gave us a lot of trouble across both solutions. All the gestures seem to have an overlap with the Neutral gesture. <strong>This leads to a multi-label classifier predicting multiple classes with very high confidence, which defeats the whole purpose of having a classifier in the first place.</strong> The reasoning hypothesis is that across any population, somebody’s neutral face might resemble somebody else’s smile face or more often, the pout face.</p><p>Two, we also quickly tried <strong>neural networks</strong> in the case of ARCore but ran into similar problems. <a href="https://arxiv.org/pdf/1703.04977.pdf">The thing with standard Neural Networks is that you don’t have an “I don’t know” option<strong>[2]</strong>.</a> This combined with the issue that, we often observed very high confidence classification for both neutral and one of the other gestures, suggested we needed more experimentation with NNs to achieve a decent classification for the problem. Sadly, we ran out of time. T<em>his is one of the pathways the readers can explore further.</em></p><p>Anyway, it was such a unique solution that it deserved to be shared with more people. Hopefully, this gives them more ideas to try creative solutions and also build upon this solution.</p><blockquote><strong>References:</strong></blockquote><blockquote><a href="https://www.youtube.com/watch?v=MEG35RDD7RA"><strong>[1]</strong> A fantastic lecture on Hoeffding’s inequality and its relevance in Machine Learning</a>. Highly recommended.</blockquote><blockquote><a href="https://arxiv.org/pdf/1703.04977.pdf"><strong>[2] </strong>Research Paper explaining Bayesian Neural Networks that can be used to model epistemic uncertainty in neural networks.</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd2b51a39912" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apra-labs-blog/ar-the-science-behind-facehero-ii-bd2b51a39912">AR: the science behind Facehero II</a> was originally published in <a href="https://medium.com/apra-labs-blog">Apra Labs Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AR: the science behind Facehero]]></title>
            <link>https://medium.com/apra-labs-blog/ar-the-science-behind-facehero-d27be08f328e?source=rss-b72e98a18093------2</link>
            <guid isPermaLink="false">https://medium.com/p/d27be08f328e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[arkit]]></category>
            <category><![CDATA[ar]]></category>
            <category><![CDATA[gesture-recognition]]></category>
            <category><![CDATA[arcore]]></category>
            <dc:creator><![CDATA[Mradul Dubey]]></dc:creator>
            <pubDate>Sat, 08 Aug 2020 18:47:24 GMT</pubDate>
            <atom:updated>2020-08-08T18:56:47.213Z</atom:updated>
            <content:encoded><![CDATA[<h4>Makings of a fun AR Game</h4><h3>Augmented Reality</h3><blockquote>Augmented reality (AR) is an <strong>interactive experience of a real-world environment where the objects that reside in the real world are enhanced by computer-generated perceptual information</strong>, sometimes across multiple sensory <a href="https://en.wikipedia.org/wiki/Modality_(human%E2%80%93computer_interaction)">modalities</a>, including <a href="https://en.wikipedia.org/wiki/Visual">visual</a>, <a href="https://en.wikipedia.org/wiki/Hearing">auditory</a>, <a href="https://en.wikipedia.org/wiki/Haptic_perception">haptic</a>, <a href="https://en.wikipedia.org/wiki/Somatosensory_system">somatosensory</a> and <a href="https://en.wikipedia.org/wiki/Olfactory">olfactory</a>.</blockquote><blockquote>- Wikipedia definition of Augmented Reality (AR)</blockquote><p>This is obviously, quite a broad definition of AR and here, we are going to restrict ourselves to the visual modality in this blog series.</p><p>We come across this “visual” AR in the form of <a href="https://en.wikipedia.org/wiki/Google_Glass"><strong>Google Lens</strong></a>, the widely popular game<strong> </strong><a href="https://en.wikipedia.org/wiki/Pok%C3%A9mon_Go"><strong>Pokemon Go</strong></a><strong> </strong>and in utility based applications like <a href="https://play.google.com/store/apps/details?id=com.google.tango.measure&amp;hl=en_IN"><strong>Measure</strong></a><strong>:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fnc5DdYtIfEo%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dnc5DdYtIfEo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fnc5DdYtIfEo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f3a9a2dd5f96525fc2ef215c2384152/href">https://medium.com/media/6f3a9a2dd5f96525fc2ef215c2384152/href</a></iframe><p><strong>This is just the tip of the iceberg.</strong> AR has also been used to develop <strong>Face Filters</strong> on social media apps and also to make your <strong>Webcam</strong> smarter. The point being that AR continues to be used in a diverse manner and for diverse applications.</p><h3>The Application: Face Hero</h3><p>Here, at <a href="http://apralabs.com">Apra Labs</a>, we utilized Augmented Reality in an unconventional way, unlike all the applications described above. Our requirement came in the form of <a href="http://bit.ly/al_facehero"><strong>Face Hero</strong></a><strong>.</strong></p><p>With <a href="http://bit.ly/al_facehero">Face Hero</a>, we tried to develop a novel <strong><em>touch-free</em></strong> game that is not only engrossing and fun, but also very rewarding. Take a peep:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-sCm222X4As%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-sCm222X4As&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-sCm222X4As%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/52c74e52b09f75e534fbfacad3017c24/href">https://medium.com/media/52c74e52b09f75e534fbfacad3017c24/href</a></iframe><p>You are also encouraged to <a href="http://bit.ly/al_facehero">try this game for free</a>. In any case, let me roughly describe the bare-bones version of the game play:</p><p><a href="http://bit.ly/al_facehero">Face Hero</a> <strong><em>tracks the face orientation of the player </em></strong>and that enables the player to move the pointer around the screen space. Once the player locks on to a target character, <strong><em>the player has to emote a facial gesture corresponding to the character </em></strong>which prompts a positive reaction from the character and the player gets to score. E.g. smile to the baby to make it giggle, pout to the puppy etc.</p><h3>The Twin Problems</h3><p>So, while developing the game, speaking AR-wise, we had to solve <strong>two </strong>problems:</p><ol><li><strong>Track the face orientation of the player</strong></li><li><strong>Identify the facial gestures of the player</strong></li></ol><p>And we had to solve them using efficient algorithms for a smooth game play.</p><p>In this blog series, we will slowly explore, in more detail, how we utilized AR in solving both of these problems.</p><blockquote>But, in the details, lies the devil.</blockquote><p>As we will soon find out there is no “global best” solution for either of the problems.</p><h3>Tools &amp; The Devils</h3><p>At the heart of the solution to our problems, across multiple platforms, are two tools, namely: Apple’s <strong>ARKit</strong> and Google’s <strong>ARCore</strong>. Both of them contain a big set of features to track real world objects but the one that we were interested in, were the face tracking features that both of them provide. That is not to say that they do not differ in their capabilities and performance, but that they both provide out-of-the-box support for tracking faces.</p><h4>Apple’s ARKit</h4><p>ARKit tracks the user’s face and provides a detailed topology of the face. There are three main components of this topology:</p><ul><li><strong>Face Coordinate System</strong></li><li><strong>3D Face Mesh</strong></li><li><strong>Blend Shapes</strong></li></ul><p>The face coordinates system is supposed to be a way for positioning other elements relative to the face.</p><blockquote><a href="https://developer.apple.com/documentation/arkit/arfaceanchor">Units of face coordinate space are in meters, with the origin centered behind the face as indicated in the figure below.</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxQY5PjyWSCBU1oYGGqy3A.png" /><figcaption><strong>ARKit</strong>: Face Coordinate System <a href="https://developer.apple.com/documentation/arkit/arfaceanchor">[source]</a></figcaption></figure><p>So, when you see an app being used to apply a face filter, it is this coordinate system that allows moving the filter along with the user’s head movements.</p><p>Secondly, ARKit provides us with a Face Mesh:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*smm_RE4_-jjRV9FoU7R_Lg.gif" /><figcaption><strong>ARKit</strong>: <strong>3D Face Mesh</strong> with <strong>1220 vertices </strong>tracking Siddhant’s face in real time.</figcaption></figure><p>This face mesh consists of <strong>1220 vertices</strong> in 3-D space, all relative to the origin of the Face Coordinated System described above. It tracks the user’s face in real time.</p><p>Thirdly, and more importantly, ARKit provides us with Blend Shapes.</p><blockquote><a href="https://developer.apple.com/documentation/arkit/arfaceanchor/2928251-blendshapes">Blend Shapes are a group of named coefficients representing the detected facial expression in terms of the movement of specific facial features.</a></blockquote><p>Let’s take an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3CeD_2TNdOktqn2VDiim3g.png" /><figcaption><strong>ARKit</strong>: <strong>jawOpen </strong>blend shape <a href="https://developer.apple.com/documentation/arkit/arfaceanchor/blendshapelocation/2928236-jawopen">[source]</a></figcaption></figure><p>Here, “jawOpen” is one of the several blend shapes that ARKit provides. The value of each blend shape ranges from 0.0 (minimum) to 1.0 (maximum). <strong>ARKit provides us 52 such types in blend shapes<em>.</em></strong> In other words, all the Blend Shapes together provide an abstract representation of the user’s facial expressions.</p><p>Remember the Blend Shapes, they will be crucial in cracking our second problem.</p><h4><strong>Google’s ARCore</strong></h4><p>The google counterpart to ARKit is called ARCore. They differ, both in capabilities and also in how they work under the hood.</p><p><strong>ARKit utilizes the real-depth camera available</strong> on iPhones(X+)/iPads to generate the Face Mesh and Blend Shapes. Hardware variability across android devices does not lend the same luxury to ARCore.</p><p><strong>ARCore relies entirely on Deep Learning based algorithms. </strong>While this means, ARKit is generally more precise and informative as compared to ARCore, but, at the same time, this implies ARCore can function across android devices with different hardware capabilities and even on iOS. However, it may not be the best solution for iOS currently.</p><p>Coming back to our two problems at hand, the ARCore solution comes in the form of Augmented Faces, which mainly provides us with:</p><ul><li><strong>Center Pose</strong></li><li><strong>3D Face Mesh</strong></li></ul><blockquote><a href="https://developers.google.com/ar/develop/c/augmented-faces/overview">The center pose, located behind the nose, is the physical center point of the user’s head (in other words, inside the skull).</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRHuzmLsf4JRjzEjVipCBg.png" /><figcaption><strong>ARCore</strong>: Center Pose <a href="https://developers.google.com/ar/develop/c/augmented-faces/overview">[source]</a></figcaption></figure><p>This is the ARKit’s equivalent of Face Coordinate System.</p><ul><li><strong>3D Face Mesh</strong></li></ul><p>The 3D Face Mesh provided by ARCore consists of <strong>468 vertices. </strong>This is in contrast to the 1220 vertices in the ARKit Face Mesh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*iK9XSsYzEbllzXQaqnrMHw.png" /><figcaption><strong>ARCore</strong>:<strong> 3D Face Mesh</strong> with <strong>468 vertices </strong><a href="https://developers.google.com/ar/develop/c/augmented-faces/overview">[source]</a></figcaption></figure><p>And that’s it. <em>ARCore doesn’t provide anything like Blend Shapes!</em></p><h3>So, You’re Telling Me…</h3><p>That we had two main problems: Tracking the user’s face orientation and Identifying the facial gestures.</p><p>The best tool that we can use to solve our problems varies platform-wise: ARKit and ARCore.</p><p>ARKit provides us with a <strong>Face Coordinate System</strong>, a real-time <strong>3D Face Mesh </strong>with <strong>1220 vertices</strong> that tracks the user’s face and an abstract representation of user’s facial gestures in the form of <strong>52 Blend Shapes</strong>.</p><p>ARCore provides us with the <strong>Center Pose</strong> and a <strong>3D Face Mesh </strong>with <strong>468 vertices</strong>, but doesn’t provide us with any facial gesture abstractions like Blend Shapes.</p><p>A shrewd mind would wonder whether the lower number of vertices provided by ARCore and its inability to provide something like Blend Shapes are related. But, apart from the fact that the mesh tracked by ARKit contains more information (ARKit’s 1220 vs ARCore’s 468 vertices), the ARKit face mesh also feels more responsive than the ARCore counterpart.</p><blockquote>Phew! That was a lot to take.</blockquote><p>In Part II of the blog, we will see how exactly the information that we get from our tools helps us resolve our twin problems. And that’s where the real fun begins!</p><p>See you next time!!</p><blockquote>Want to explore more stuff? I have got a bunch of links for you to keep you occupied till the next time:</blockquote><blockquote>For the mathematically hungry: <a href="https://eater.net/quaternions">Quaternions</a></blockquote><blockquote>For the AR curious: <a href="https://developers.google.com/ar/discover">arcore,</a> <a href="https://developer.apple.com/documentation/arkit">arkit</a></blockquote><blockquote>For the hardware conscious: <a href="https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/capturing_photos_with_depth">apple depth cameras,</a> <a href="https://en.wikipedia.org/wiki/Intel_RealSense">intel realsense depth cameras</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d27be08f328e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apra-labs-blog/ar-the-science-behind-facehero-d27be08f328e">AR: the science behind Facehero</a> was originally published in <a href="https://medium.com/apra-labs-blog">Apra Labs Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>