<?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 Felix Galindo on Medium]]></title>
        <description><![CDATA[Stories by Felix Galindo on Medium]]></description>
        <link>https://medium.com/@felixgalindo91?source=rss-b67e7306c74c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vmc-CpOX9GuBtKTBZ8WfVg@2x.jpeg</url>
            <title>Stories by Felix Galindo on Medium</title>
            <link>https://medium.com/@felixgalindo91?source=rss-b67e7306c74c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 02:53:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@felixgalindo91/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[Sensors Only See Shadows]]></title>
            <link>https://medium.com/@felixgalindo91/sensors-only-see-shadows-004601e67786?source=rss-b67e7306c74c------2</link>
            <guid isPermaLink="false">https://medium.com/p/004601e67786</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[physical-ai]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[tinyml]]></category>
            <dc:creator><![CDATA[Felix Galindo]]></dc:creator>
            <pubDate>Wed, 27 May 2026 15:20:09 GMT</pubDate>
            <atom:updated>2026-05-27T15:38:56.246Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The data bottleneck behind wearable AI, and what the field is doing about it.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HnMU3wmeSNM9yc3xKShzXQ.png" /></figure><p>A wrist-worn accelerometer outputs three numbers per sample at roughly 50 Hz. From that stream, a classifier on the device has to decide whether the wearer is walking, jogging, eating, sleeping, or doing the dishes.</p><p>The classifier never observes the activity. It sees only the shadow the activity casts onto three channels of acceleration, and has to infer the rest. It works some of the time. The reasons it fails the rest of the time are structural. They explain why wearable AI lags vision and language by several years, and what’s about to close the gap.</p><h3><strong>Sensor data is structurally unlabelable</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QNaxGdsCjrGu8X7ba3fS8w.png" /><figcaption>Figure 1</figcaption></figure><p>Two unlabeled inputs. An image is interpretable on sight and a human assigns the label in seconds; a 100-sample 3-axis accelerometer window carries no label a human can read directly and requires a time-synchronized video reference to annotate.</p><p>Vision and language got their deep-learning dividend on the back of cheap labels. ImageNet has 1.3M labeled images. COCO has 330k. CLIP trained on roughly 400M scraped image-caption pairs. A crowd-worker can label an image in seconds.</p><p>You cannot do this with sensor data. A 100-sample, three-channel accelerometer trace looks like noise to a human annotator. To label it, you need a synchronized video of the person who produced it. Annotation requires lab conditions, dedicated hardware, and a privacy-compliant collection process. Cost per labeled window is orders of magnitude higher than cost per labeled image.</p><p>The field’s controlled HAR datasets reflect this. Sixty subjects, six to ten activities, recorded in lab settings. The largest free-living wearable dataset, the UK Biobank, contains roughly 95k subjects across 700k person-days. It is unlabeled by construction.</p><p>The modeling problem is not “how do we squeeze more accuracy out of a labeled dataset.” It is “how do we use the unlabeled data, because that is almost all the data.”</p><p>This generalizes. In any domain where the raw data is not human-interpretable (sensor traces, machine logs, network telemetry, industrial signals), the labeling pipeline that built ImageNet does not transfer. The data is structurally unlabelable, and the modeling stack has to be different.</p><h3><strong>Pipeline decisions cap model performance</strong></h3><p>Bulling et al. (2014) factor a HAR system into five stages: recording, preprocessing, segmentation, feature extraction, classification. Deep learning collapsed the last two into a single learned encoder. The first three stay engineering decisions, and they bound everything downstream.</p><p>Sensor placement decides which activities are observable at all. A wrist sensor separates walking from typing, but not chewing from talking. Sampling rate caps the recoverable signal frequency. Window length sets the temporal context per inference. None of these are model hyperparameters; they frame the learning problem before the model sees it. Choices like window size and segmentation strategy routinely move performance more than model architecture does. In wearable AI, the model is one node; the pipeline is the system.</p><h3><strong>Self-supervised learning is the structural fix</strong></h3><p>The core idea is straightforward: design a training task whose ground truth is computable from the input itself, with no human labels. Train the encoder on that task at scale on unlabeled data. Transfer the encoder to the downstream task with whatever small labeled set exists.</p><p>The vision canon includes rotation prediction (Gidaris et al., 2018), jigsaw position prediction (Doersch et al., 2015), and inpainting (Pathak et al., 2016). The language canon is next-token and masked-token prediction.</p><p>In wearable HAR, the equivalent tasks are:</p><p><strong>Multi-task transformation prediction</strong> (Saeed et al., 2019). Apply <em>*N*</em> stochastic augmentations (jitter, scaling, time-warp, rotation, magnitude warp, permutation) to a sensor window and predict which were applied. Forces the encoder to model what a clean signal of human motion looks like.</p><p><strong>Masked reconstruction. </strong>Hide a portion of the window and train an encoder-decoder to reconstruct it. The pretext analog of BERT.</p><p>-<strong>Contrastive learning</strong> (SimCLR-style). Generate two augmented views of the same window and train the encoder to embed them near each other while pushing other windows apart.</p><p>The resulting encoder is frozen, or partially fine-tuned, and a small classifier head is trained on the labels that exist. The encoder does the representation learning; the labels only have to teach the activity vocabulary, not the entire signal model.</p><h3><strong>Evaluation should match the deployment regime</strong></h3><p>Most published HAR results report F1 on the fully labeled benchmark. This is not the deployment regime. A shipped wearable has near-zero labeled examples per wearer. The relevant evaluation is the limited-label setting: F1 as a function of labeled windows per class, swept from roughly 5 to 100.</p><p>I ran that sweep on the SOAR 2024 / MotionSense pipeline, comparing a SimCLR-pretrained encoder (frozen, small trainable head) against the same architecture trained end-to-end from random initialization. The result was not what the popular narrative predicts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ylFZ2uVHZcW4aJbX6dxI4g.png" /><figcaption>Figure 2.</figcaption></figure><p>Supervised end-to-end matched or beat the frozen SSL probe at every label budget above five per class. SSL was within a few F1 points everywhere and edged ahead at the smallest budget, but it did not dominate. Two things explain this. SimCLR pretrained on a single small corpus (MotionSense, ~17k unlabeled windows) is a weak encoder. And MotionSense is an easy six-activity dataset, where there is little headroom for SSL to win. The widely cited Haresamudram 2021 result used CPC, a different and for-HAR generally stronger SSL method.</p><p>The interesting number is not which curve sits higher. It is that the SSL probe reached competitive F1 while its encoder saw zero labels. The supervised baseline used labels for the entire network; the SSL path used them only for a small head. In an environment where labeled windows are the scarce resource, performance-per-label-touched is the metric that matters, and on that metric SSL is the better deal. The benchmark question is whether SSL beats supervised. The deployment question is how much usable behavior you can get from a labeling pipeline you cannot afford.</p><p>The general principle still holds. Reporting performance under the conditions a model will actually encounter is a different exercise from reporting performance under conditions the researcher controls. The latter selects for techniques that flatter the benchmark; the former selects for techniques that ship.</p><h3><strong>The pattern across modalities</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yq0xo-ElfiWX8nbRbY9VVQ.png" /><figcaption>Figure 3</figcaption></figure><p>A common template across modalities. Vision, language, and wearables each pretrain an encoder on a pretext task whose target is derived from the input itself with no human labels, then train a small downstream head on limited labeled data.</p><p>Each major AI breakthrough of the last fifteen years follows the same template:</p><ol><li>Identify a domain with abundant unlabeled data.</li><li>Design a self-supervised pretext task that forces the model to learn the structure of that data.</li><li>Use the resulting encoder as a substrate for downstream tasks.</li></ol><p>Vision: ImageNet seeded the field, but the long-term gains came from contrastive and masked-image methods on web-scale unlabeled images. Language: the entire LLM era is built on next-token prediction over Common Crawl. Wearables: the same trajectory, roughly a decade behind. The lag was never algorithmic; it was the time it took to collect unlabeled sensor data at scale.</p><p>Mobiact (61 subjects, lab) → Capture-24 (151 subjects, free-living) → UK Biobank (~95k subjects, free-living). The corpus is forming. The pretext-task literature has caught up. The remaining engineering problem is squeezing the resulting encoders into the energy and memory budget of a wrist-worn device, which is tractable.</p><p>For engineers in any label-scarce domain: the prerequisite for catching this wave is unlabeled data at scale plus a pretext task that captures the structure that matters downstream. If a domain is missing one of those, that is the bottleneck, not the model architecture and not the compute.</p><h3><strong>What’s next: the same playbook beyond wearables</strong></h3><p>The wearable-AI stack converges on the same shape as the rest of modern AI: large unlabeled corpus, self-supervised encoder, small fine-tuned head. The constraints unique to wearables (privacy, intermittent connectivity, energy budget) push more of the encoder and the adaptation step onto the device itself. The underlying data structure is the same.</p><p>The same playbook generalizes to most edge AI domains where sensor data is structurally unlabelable and the deployed unit drifts away from the training distribution. The structural ingredients:</p><ol><li>Raw signal that humans cannot label by inspection.</li><li>Abundant unlabeled data from fielded devices.</li><li>Per-unit drift that punishes a single population-trained model.</li><li>Power, memory, or connectivity constraints that block cloud retraining.</li></ol><p>When those four hold, the wearable approach is the only one that scales. A few concrete instances:</p><p><strong>Industrial vibration monitoring.</strong> A three-axis accelerometer on a motor produces the same data shape as a wrist accelerometer. Nobody can label “early-stage bearing wear” by looking at the trace, but the motor supplies unlabeled signal 24/7. Pretrain on a fleet; adapt the head per machine to handle that machine’s mounting and load profile.</p><p><strong>Electrical signature monitoring.</strong> Current and voltage at a piece of equipment trace a time-series unique to that asset’s load profile. The same pretext tasks (masked windows, augmentation prediction, contrastive views) apply directly. Per-asset adaptation handles inter-unit variance that a single global model cannot.</p><p>-<strong>Acoustic equipment monitoring. </strong>A microphone on an HVAC unit, pump, or compressor captures a signature humans cannot label without years of domain knowledge. Same playbook, different sample rate.</p><p><strong>Commercial-building telemetry.</strong> PIR, CO2, door, and occupancy sensors. Each building’s “normal” pattern is different. Pretrain on a portfolio of buildings; adapt per site.</p><p><strong>Agricultural and environmental sensing.</strong> Soil moisture, leaf-wetness, multispectral, weather telemetry. Each field is its own micro-distribution.</p><p>In every case the wearer is replaced by <em>the asset</em>, t<em>he building</em>, or <em>the field</em>. The structural problem is identical: a fleet-wide pretrained encoder, a small per-deployment head, no labeled data from the operator, and no cloud round-trip on the critical path.</p><p>The wrist was never really the subject. A wearable is just the clearest case of a problem that shows up wherever a machine has to act on signals no human can read: the labels you want do not exist, and almost everything you record is unlabeled. Vision and language hit that wall first and got past it with self-supervision. Wearables are getting past it now. Vibration sensors, power meters, microphones, and soil probes are behind them on the same path. The takeaway outlives any single device. When your data only casts shadows, stop waiting for labels and learn from the shadows.</p><h3><strong>References</strong></h3><p>1. Bulling, A., Blanke, U., &amp; Schiele, B. (2014). <strong>A tutorial on human activity recognition using body-worn inertial sensors.</strong> ACM Computing Surveys, 46(3). <a href="https://doi.org/10.1145/2499621">https://doi.org/10.1145/2499621</a><br>2. Gidaris, S., Singh, P., &amp; Komodakis, N. (2018). <strong>Unsupervised representation learning by predicting image rotations.</strong> ICLR. arXiv:1803.07728<br>3. Doersch, C., Gupta, A., &amp; Efros, A. A. (2015). <strong>Unsupervised visual representation learning by context prediction.</strong> ICCV. arXiv:1505.05192<br>4. Pathak, D., Krähenbühl, P., Donahue, J., Darrell, T., &amp; Efros, A. A. (2016). <strong>Context encoders: Feature learning by inpainting.</strong> CVPR. arXiv:1604.07379<br>5. Saeed, A., Ozcelebi, T., &amp; Lukkien, J. (2019). <strong>Multi-task self-supervised learning for human activity detection.</strong> Proc. ACM IMWUT, 3(2). arXiv:1907.11879<br>6. Haresamudram, H., Essa, I., &amp; Plötz, T. (2021). <strong>Contrastive predictive coding for human activity recognition.</strong>*Proc. ACM IMWUT, 5(2). arXiv:2012.053337. Deng, J., et al. (2009). <strong>ImageNet: A large-scale hierarchical image database.</strong> CVPR.<br>8. Lin, T.-Y., et al. (2014). <strong>Microsoft COCO: Common objects in context.</strong> ECCV. arXiv:1405.0312<br>9. Radford, A., et al. (2021). *Learning transferable visual models from natural language supervision* (CLIP). ICML. arXiv:2103.00020<br>10. Chen, T., Kornblith, S., Norouzi, M., &amp; Hinton, G. (2020). *A simple framework for contrastive learning of visual representations* (SimCLR). ICML. arXiv:2002.05709<br>11. Devlin, J., Chang, M.-W., Lee, K., &amp; Toutanova, K. (2019). *BERT: Pre-training of deep bidirectional transformers for language understanding.* NAACL. arXiv:1810.04805</p><p>12. Malekzadeh, M., Clegg, R. G., Cavallaro, A., &amp; Haddadi, H. (2019). <strong>Mobile sensor data anonymization</strong> (MotionSense). ACM/IEEE IoTDI. <a href="https://github.com/mmalekzadeh/motion-sense">https://github.com/mmalekzadeh/motion-sense</a><br>13. Vavoulas, G., Chatzaki, C., Malliotakis, T., Pediaditis, M., &amp; Tsiknakis, M. (2016). <strong>The MobiAct dataset.</strong> ICT4AgeingWell.<br>14. Oxford Wearables Group. <strong>Capture-24: Activity tracker dataset for human activity recognition.</strong><a href="https://github.com/OxWearables/capture24">https://github.com/OxWearables/capture24</a><br>15. Doherty, A., et al. (2017). <strong>Large scale population assessment of physical activity using wrist-worn accelerometers: The UK Biobank study.</strong> PLOS ONE, 12(2), e0169649.</p><p>16. SOAR 2024 — Self-Supervised / On-device Activity Recognition tutorial. <a href="https://github.com/ubicompsoartutorial/soar_2024">https://github.com/ubicompsoartutorial/soar_2024</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=004601e67786" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built an AI Financial Manager That Actually Knows My Finances]]></title>
            <link>https://medium.com/@felixgalindo91/i-built-an-ai-financial-manager-that-actually-knows-my-finances-1c139ca9ad1f?source=rss-b67e7306c74c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c139ca9ad1f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[personal-finance]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Felix Galindo]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 20:02:06 GMT</pubDate>
            <atom:updated>2026-04-05T20:06:48.983Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FyiZgdNJAqbdm_fQdaMHeQ.png" /></figure><p>How I connected Monarch Money to Claude and automated the parts of personal finance I kept putting off</p><p>Every morning at 6 AM, before I’m even awake, an AI agent checks my bank accounts, scans new transactions, updates my HSA tracker, flags anything weird, and drops a summary in Slack.</p><p>I didn’t set out to build this. I just got tired of forgetting to save medical receipts.</p><h3>The problem I kept running into</h3><p>I use Monarch Money to track my finances. It’s good at what it does. But I kept falling behind on the stuff that actually matters: logging HSA receipts so I can reimburse myself tax-free in retirement, keeping my tax deductions organized, noticing when subscriptions quietly increase by $3/month.</p><p>I’d open Monarch, look at my transactions, think “I should really log that doctor visit in my HSA spreadsheet,” and then close the tab and move on with my day. Every. Single. Time.</p><p>The data was all there. I just wasn’t doing anything with it.</p><h3>What I built</h3><p>I wrote an open-source MCP server that gives AI assistants direct access to Monarch Money data.</p><p>Quick explainer if you haven’t heard of MCP: it’s a protocol that lets AI tools like Claude call external APIs. So instead of you copying numbers out of Monarch and pasting them into a chat, the AI just… pulls what it needs.</p><p>The server exposes 18 tools:</p><ul><li>Accounts &amp; net worth — balances across all your linked banks, cards, investments</li><li>Transactions — search by date, category, merchant, tags, whatever</li><li>Budgets — planned vs actual by category</li><li>Cashflow — income, expenses, savings rate, breakdowns</li><li>Recurring transactions — all your bills and subscriptions</li><li>Investment holdings — brokerage positions</li><li>Receipts — downloads transaction attachments to your machine</li></ul><p>Everything gets cached locally in SQLite with a 24-hour TTL so it’s not hitting the API constantly.</p><h3>What using it feels like</h3><p>With the server running, you can just ask stuff:</p><p>“How’s my budget this month?” — and it actually pulls your real budget data and tells you which categories are over.</p><p>“Show me every Amazon charge over $100 in the last three months.” — and you get a real answer, not a suggestion to go check your bank app.</p><p>“What’s my net worth?” — and it adds up all your accounts right there.</p><p>It’s weirdly satisfying the first time it works. Like, oh, the AI actually <em>knows</em> this now.</p><h3>Where it gets really useful: agents that run on autopilot</h3><p>Asking questions is cool. But the thing that actually changed my workflow is running agents on a schedule, doing stuff I’d never get around to on my own.</p><h3>The HSA thing (this is what started it all)</h3><p>If you have a Health Savings Account, you might know the trick: pay medical bills out of pocket now, keep the receipts, and reimburse yourself decades later for tax-free retirement income. The IRS doesn’t care when you reimburse, just that you have documentation.</p><p>The problem is you need obsessive records. Date, provider, amount, receipt for every single expense. For years.</p><p>I set up an agent that:</p><ol><li>Pulls my transactions every morning</li><li>Looks for anything in medical categories</li><li>Cross-references against healthcare providers I’ve been to before</li><li>Downloads the receipt if one’s attached</li><li>Logs it in my HSA tracking spreadsheet</li><li>If something’s ambiguous (like a $200 CVS charge that could be prescriptions or could be snacks), it asks me in Slack and waits for a thumbs up before logging it</li></ol><p>I went from “I’ll do it this weekend” (I never did it this weekend) to having a complete, audit-proof HSA record that updates itself.</p><h3>Tax prep that doesn’t suck</h3><p>Same idea for taxes. The agent tracks deductible stuff all year:</p><ul><li>Charitable donations get logged when they happen, not when I’m panicking in April</li><li>Education expenses get categorized automatically</li><li>Business vs personal expenses get separated</li><li>Year-end: I have an itemized summary with receipts ready to go for tax filing</li></ul><p>There’s a real dollar difference between “I think I donated like two grand?” and showing up with 47 itemized donations totaling $2,847.</p><h3>Catching charges you’d miss</h3><p>I also have it flag stuff daily:</p><ul><li>Charges way bigger than usual at a given merchant</li><li>Duplicate charges within a few days</li><li>Merchants I’ve never seen before</li><li>Anything that doesn’t line up with my recurring patterns</li></ul><p>Most people don’t notice a fraudulent charge for a week or two. This catches it the same morning.</p><h3>Tracking FIRE progress</h3><p>If you’re into the financial independence thing, an agent can:</p><ul><li>Track your savings rate week over week</li><li>Watch your net worth against where you need to be</li><li>Notice when subscriptions creep up</li><li>Project your timeline based on current trends</li></ul><p>I’m tracking toward a $1M net worth goal and it’s way more motivating when something tells you “you’re $X ahead/behind target” every week instead of you checking manually whenever you remember.</p><h3>The Monday morning summary</h3><p>Every week I get a Slack message with:</p><ul><li>What I spent last week, broken down by category</li><li>Where I stand against my monthly budgets</li><li>Bills coming up</li><li>Net worth change</li><li>Anything that needs attention</li></ul><p>Takes me five minutes to read. Used to take an hour of spreadsheet fiddling that I’d usually skip.</p><h3>Setting it up</h3><p>It’s not complicated. You need a Monarch Money account, Python 3.10+, and an MCP-compatible AI assistant (Claude Desktop, Claude Code, etc.).</p><pre>git clone https://github.com/felixgalindo/monarch-money-mcp.git<br>cd monarch-money-mcp<br>./setup.sh</pre><p>Setup script handles the virtual environment, dependencies, and login. Takes a couple minutes.</p><p>One gotcha: if you signed up for Monarch with Google or Apple, you’ll need to add a password to your account first (Settings &gt; Security &gt; Set Password). Or you can use the session token method during login if you’d rather not.</p><p>Then add it to your AI assistant’s config:</p><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;monarch-money&quot;: {<br>      &quot;command&quot;: &quot;python&quot;,<br>      &quot;args&quot;: [&quot;-m&quot;, &quot;monarch_money_mcp&quot;],<br>      &quot;cwd&quot;: &quot;/path/to/monarch-money-mcp&quot;<br>    }<br>  }<br>}</pre><p>Done. Your AI can now see your finances.</p><p>If you manage money for multiple people (partner, family business, etc.), the server supports multiple accounts with a MONARCH_ACCOUNT environment variable. Each one gets its own isolated token and cache.</p><h3>“But is this safe?”</h3><p>Fair question. You’re giving an AI access to financial data.</p><p>Credentials never touch the codebase. Your session token lives in your OS keychain (macOS Keychain on Mac, Credential Locker on Windows, Secret Service on Linux).</p><p>Everything stays local. The server runs on your machine and only talks to Monarch Money’s official API. Nothing goes to third parties.</p><p>It’s read-only. I deliberately left out all write operations. The server can’t create transactions, move money, delete accounts, or modify anything. It can only look.</p><p>It’s open source. Read the code yourself. It’s like 500 lines of Python.</p><h3>Why I think this matters</h3><p>This isn’t really about Monarch Money specifically. It’s about what happens when financial data stops being something you look at and starts being something that works for you.</p><p>I spent years knowing I should track my HSA receipts, should organize my tax deductions, should review my subscriptions regularly. I just… didn’t. Not because it’s hard, but because it’s tedious and easy to put off.</p><p>Now I don’t have to rely on discipline. The system does it whether I feel like it or not.</p><p>If that sounds useful, the project is here: <a href="https://github.com/felixgalindo/monarch-money-mcp">https://github.com/felixgalindo/monarch-money-mcp</a></p><p>Star it if you want. PRs welcome.</p><p>— -</p><p><em>*Felix Galindo is a Staff Engineer. He writes code, builds systems, and occasionally automates his own life.*</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c139ca9ad1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vision Language Action Models and What They Unlock for Edge AI]]></title>
            <link>https://medium.com/@felixgalindo91/vision-language-action-models-and-what-they-unlock-for-edge-ai-65ead9f980a6?source=rss-b67e7306c74c------2</link>
            <guid isPermaLink="false">https://medium.com/p/65ead9f980a6</guid>
            <category><![CDATA[physical-ai]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[robitics]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <dc:creator><![CDATA[Felix Galindo]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 19:21:06 GMT</pubDate>
            <atom:updated>2025-12-26T19:21:06.534Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*acNJPQtLZVGBLRz6bvh1YQ.png" /></figure><h3>One of the next major leaps in edge AI is the unification of perception, reasoning, and action.</h3><p>For years, edge AI systems have been optimized primarily to see. Cameras detect objects. Sensors classify signals. Decisions are made downstream. Recent advances in vision language action models, especially those emerging from NVIDIA and foundation model research, point to a different future for edge intelligence. One where perception, intent, and control are learned together rather than engineered in isolation.</p><h3>How Traditional Edge AI Systems Are Built</h3><p>Most deployed edge AI systems today follow a familiar pipeline.</p><p>Perception models process sensor data. Their outputs are translated into symbols or states. Engineers write rules to decide what should happen next. Controllers then execute predefined actions.</p><p>This approach works well in constrained environments. As variability increases, it begins to break down. New object configurations, ambiguous instructions, or unfamiliar environments require additional rules. Over time, system complexity grows faster than system capability.</p><h3>What Vision Language Action Models Change</h3><p>Vision language action models collapse this traditional pipeline.</p><p>Instead of separating vision, reasoning, and control, these models learn a shared representation across all three. Visual context and language intent are processed jointly, and the model produces actions directly.</p><p>A strong reference example is NVIDIA’s GR00T N1 foundation model for robotics, which integrates perception, language understanding, and motor control into a single unified policy. <a href="https://arxiv.org/abs/2503.14734">https://arxiv.org/abs/2503.14734</a></p><p>When perception and action are trained together, systems generalize better. They respond to intent rather than scripts. They also degrade more gracefully as conditions change.</p><h3>Use Cases Enabled by Vision Language Action Models</h3><p>This architectural shift enables classes of edge applications that are difficult to build using traditional pipelines.</p><ol><li>Intent Driven Robotics Robots: can execute high level instructions such as moving a misplaced object back to storage without engineers defining explicit object classes, rule trees, or task scripts. The system reasons over visual context and intent instead of relying on state machines.</li><li>Adaptive Industrial Automation: In factories and warehouses, these systems can respond to unexpected situations like misplaced parts, blocked paths, or human intervention. Instead of faulting or requiring manual reprogramming, the system adapts its behavior based on what it sees and what it is asked to do.</li><li>Context Aware Visual Inspection: Rather than triggering fixed alerts, inspection systems can interpret scenes in context, explain anomalies, and answer natural language questions about what is happening. This moves visual inspection from detection toward understanding.</li><li>Human Machine Interaction at the Edge: By combining vision, language, and action locally, operators can interact with machines using natural language and gestures without relying on cloud connectivity. This improves latency, privacy, and reliability.</li></ol><h3>The Bigger Picture</h3><p>Vision language action models represent a convergence point for edge AI.</p><p>They reduce system complexity while increasing capability. They enable intent driven behavior instead of rule driven behavior. They allow edge devices to operate autonomously rather than just efficiently.</p><p>With modern edge capable platforms such as Orin class systems, this intelligence can now live entirely at the edge.</p><p>That is when edge AI stops being about detection and starts becoming real autonomy.</p><p>#EdgeAI #Robotics #ArtificialIntelligence #EmbeddedSystems #ComputerVision #PhysicalAI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65ead9f980a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing TinyMLDelta — Incremental ML Model Updates for Tiny Devices]]></title>
            <link>https://medium.com/@felixgalindo91/introducing-tinymldelta-incremental-ml-model-updates-for-tiny-devices-96663edd1991?source=rss-b67e7306c74c------2</link>
            <guid isPermaLink="false">https://medium.com/p/96663edd1991</guid>
            <category><![CDATA[tinyml]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <dc:creator><![CDATA[Felix Galindo]]></dc:creator>
            <pubDate>Sun, 23 Nov 2025 00:13:38 GMT</pubDate>
            <atom:updated>2025-11-23T00:13:38.524Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9KeachlmbDY0MDFmjO4PA.png" /></figure><h3>Introducing TinyMLDelta — Incremental ML Model Updates for Tiny Devices</h3><p><em>By Felix Galindo — AIoT Visionary | Embedded AI Systems Architect</em><br> <em>November 22, 2025</em></p><h3>🚀 Edge AI doesn’t fail because the models are bad. It fails because the infrastructure is missing.</h3><p>A week ago, I wrote about a quiet truth anyone shipping ML to microcontrollers already knows:</p><p><strong>Most Edge AI projects stall after the prototype.</strong></p><p>Not because the model isn’t accurate.<br>Not because the hardware can’t run inference.<br>Not because the idea is flawed.</p><p>They stall because <strong>there is no model-lifecycle layer on embedded devices</strong>.</p><p>No versioning.<br>No compatibility guardrails.<br>No OTA model strategy.<br>No rollback path.<br>No standard way to evolve models safely over time.</p><p>In other words: <strong>Edge AI lacks the infrastructure layer that every cloud ML system already has.</strong></p><p>Over the past few months, I started building one piece of that missing layer.</p><h3>🔧 Introducing TinyMLDelta — an open-source incremental model-update system for TinyML</h3><p><strong>GitHub:</strong> <a href="https://github.com/felixgalindo/TinyMLDelta">https://github.com/felixgalindo/TinyMLDelta</a></p><p>Instead of shipping an entire 20–200 KB TensorFlow Lite Micro model over-the-air, TinyMLDelta computes a <strong>tiny binary patch</strong> that mutates the model already on the device.</p><p>And it does this <em>safely</em>, with active guardrails and atomic A/B updates.</p><p>This directly aligns with the point from my earlier article,<br> <strong>“Why Edge AI Fails — And Why the Missing Infrastructure Layer Matters More Than the Models”</strong>:</p><blockquote>Edge AI only scales when model updates become lightweight, safe, and infrastructure-backed.</blockquote><p>TinyMLDelta is one step toward that future.</p><h3>✅ What TinyMLDelta supports today</h3><h3>Core system</h3><ul><li>TensorFlow Lite Micro → TinyMLDelta patch generation</li><li>A/B safe-update mechanism</li><li>Flash model copying + atomic slot switching</li><li>Per-chunk CRC integrity verification</li><li>Crash-safe journaling</li><li>Fully working POSIX/macOS demo with simulated flash</li></ul><h3>Guardrails (the most important part)</h3><ul><li>TFLM ABI compatibility checks</li><li>Built-in opset hash verification</li><li>Tensor I/O schema hashing (types + shapes)</li><li>Required tensor-arena size enforcement</li><li>Chunk-bounds and patch-safety validation</li></ul><p>These guardrails prevent model corruption — one of the biggest risks in edge AI deployments.</p><h3>📊 Real-world test results</h3><p>Using a <strong>67 KB sensor model</strong>, TinyMLDelta produced:</p><ul><li><strong>Only 383 bytes changed</strong></li><li><strong>Patch size: 475 bytes</strong></li><li><strong>Successful end-to-end update via A/B flash slots</strong></li><li><strong>Full byte-for-byte validation of the target model in flash</strong></li></ul><p>This is the direction edge AI needs: <strong>small, safe, incremental model evolution</strong> — not full-model OTA replacements.</p><h3>🔮 What’s next (in progress)</h3><p>TinyMLDelta is just one part of the broader Edge AI infrastructure layer.<br> Upcoming work includes:</p><ul><li>Edge Impulse model support</li><li>SHA-256 + CMAC signing for secure update flows</li><li>Rich metadata TLVs (model semver, model ID, dataset versioning)</li><li>OTA reference pipelines for: Zephyr Project, Arduino Uno R4 / Portenta, Particle Tachyon</li></ul><p>This is not the entire infrastructure layer — but it’s a foundational building block.</p><h3>🌍 Why this matters</h3><p>Billions of MCUs run the edge.<br> Their ML models need constant iteration and improvement — but today, updating those models is:</p><ul><li>Expensive</li><li>Slow</li><li>Fragmented</li><li>Risk-prone</li><li>Vendor-specific</li></ul><p>TinyMLDelta aims to make <strong>model updates as lightweight, safe, and infrastructure-supported</strong> as the models themselves.</p><p>It’s early — but the initial results are already promising.</p><h3>🤝 Looking for collaborators</h3><p>If you work in:</p><ul><li>Embedded AI</li><li>OTA systems</li><li>IoT platforms</li><li>Firmware engineering</li><li>TinyML model deployment</li><li>ML infrastructure</li></ul><p>…I’d love feedback, thoughts, and collaborators.</p><p>The goal is to make this a community-driven foundation for safe on-device ML lifecycle management.</p><h3>📖 The article that inspired this project</h3><p><strong>“Why Edge AI Fails — And Why the Missing Infrastructure Layer Matters More Than the Models”</strong><br> <a href="https://www.linkedin.com/pulse/why-edge-ai-fails-missing-infrastructure-layer-matters-felix-galindo-7k3ic">https://www.linkedin.com/pulse/why-edge-ai-fails-missing-infrastructure-layer-matters-felix-galindo-7k3ic</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96663edd1991" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Edge AI Fails — And Why the Missing Infrastructure Layer Matters More Than the Models]]></title>
            <link>https://medium.com/@felixgalindo91/why-edge-ai-fails-and-why-the-missing-infrastructure-layer-matters-more-than-the-models-a05f291a5834?source=rss-b67e7306c74c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a05f291a5834</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[edge-computing]]></category>
            <dc:creator><![CDATA[Felix Galindo]]></dc:creator>
            <pubDate>Sun, 16 Nov 2025 20:15:18 GMT</pubDate>
            <atom:updated>2025-11-17T01:39:42.621Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Edge AI Fails — And Why the Missing Infrastructure Layer Matters More Than the Models</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KZrXVNC8Gs1Vg_izkMr8_w.png" /></figure><p>Every year, I see new demos showing what’s possible with machine learning on tiny devices. And honestly, it’s impressive. Edge AI has moved forward fast — smaller models, better compilers, specialized MCUs, and tools that make it almost too easy to get something running.</p><p>But even with all that progress, there’s still this quiet truth that people in the trenches already know:</p><p><strong>Most Edge AI projects never make it past a prototype.</strong></p><p>Not because the model wasn’t accurate.<br>Not because the hardware couldn’t handle it.<br>Not because the idea was flawed.</p><p>They fail for a much more boring reason:</p><p><strong>There’s no real infrastructure to support intelligence at the edge.</strong></p><p>It’s the unglamorous part of the problem, but it’s the part that decides whether the whole thing works or not.</p><h3>The Bottleneck Has Shifted</h3><p>A few years ago, training a model small enough for a microcontroller was the hard part.<br>Now? Not really.</p><p>We have great tooling.<br>Quantization tricks are pretty mature.<br>Vendors ship silicon specifically for this kind of workload.<br> Even the compilers and runtime stacks aren’t too painful anymore.</p><p>So the issue isn’t the model.</p><p>The issue is everything that has to happen <em>around</em> the model and none of it is standardized or consistent.</p><h3>A Fragmented Ecosystem</h3><p>Here’s the reality most teams deal with:</p><ul><li>chip vendors give you an inference library</li><li>ML platforms let you export a model</li><li>cloud platforms give you dashboards</li><li>firmware teams have their own OTA system</li><li>data capture is a separate homemade process</li><li>retraining happens in someone’s Jupyter notebook</li></ul><p>These pieces aren’t connected. They’re not designed to be connected.<br> So people glue them together with scripts, cron jobs, and a lot of hope.</p><p>It works… until it doesn’t.</p><p>And when it breaks, it breaks quietly. That’s the dangerous part.</p><h3>What Edge AI Actually Needs</h3><p>When you look at projects that succeed long term, they all have one thing in common:<br> someone found a way (usually manually) to build a complete loop around the model.</p><p>A real Edge AI system needs:</p><ol><li>solid data collection from real devices</li><li>the ability to simulate rare or hard-to-capture scenarios</li><li>preprocessing and sensor fusion that can survive field variability</li><li>a repeatable, training pipeline</li><li>packaging that fits the target hardware</li><li>secure deployment to thousands of devices</li><li>monitoring that doesn’t overwhelm bandwidth</li><li>OTA updates for models with a safety net</li><li>a retraining cycle that is predictable</li></ol><p>Almost no company has all of this.<br>Some companies have none of it.</p><p>And that’s where things collapse.</p><h3>The Field Is Messy (And Your Model Has to Live There)</h3><p>If you’ve ever shipped hardware, you know the field is full of surprises.</p><p>Sensors get installed upside down.<br>Humidity changes everything.<br>Noise patterns shift month to month.<br>Batch-to-batch hardware differences are real.<br>A firmware update changes timing by 2 ms and suddenly the model behaves differently.<br>Connectivity drops and the device runs in “offline survivor mode” longer than expected.</p><p>These are normal things.</p><p>But for a model? These are landmines.</p><p>Without the right system behind it, the model just drifts quietly until one day the team says, “Weird… it used to work better.”</p><h3>The Missing Infrastructure Layer</h3><p>This is the part the industry hasn’t solved yet.</p><p>We don’t need another model zoo.<br>We don’t need another quantizer.<br>We don’t need prettier dashboards.</p><p>We need a foundation — something that sits underneath all of this and makes the whole lifecycle stable and repeatable.</p><p>Something that ties together data, training, packaging, deployment, drift monitoring, and updates.</p><p>Right now, everyone builds this once, by hand, and never wants to touch it again.<br>It shouldn’t be that way.</p><h3>Closing Thoughts</h3><p>Edge AI won’t scale because we squeeze models down to 4 KB or invent a faster DSP instruction.</p><p>It will scale when the industry builds the infrastructure to support intelligence where it’s actually deployed — in messy, unpredictable, real-world environments.</p><p>The model is important, but it’s only one piece of the puzzle.</p><p>The infrastructure is what makes the whole thing real.</p><p>#EdgeAI #IoT #MachineLearning #EmbeddedSystems #EdgeComputing #AIInfrastructure #MLOps #DigitalTransformation #AIoT</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a05f291a5834" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust-Powered TinyML: A Look at the MicroFlow Framework]]></title>
            <link>https://medium.com/@felixgalindo91/a-review-of-microflow-rust-based-runtime-for-efficient-edge-ai-b889e9145be1?source=rss-b67e7306c74c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b889e9145be1</guid>
            <category><![CDATA[tinyml]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[tensorflow-lite]]></category>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Felix Galindo]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 20:22:13 GMT</pubDate>
            <atom:updated>2024-10-22T17:37:17.607Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t5CnJep61jqVvjoi" /></figure><p>The paper <strong><em>MICROFLOW: AN EFFICIENT RUST-BASED INFERENCE ENGINE FOR TINYML</em></strong> by <strong>Matteo Carnelos</strong>, <strong>Francesco Pasti</strong>, and <strong>Nicola Bellotto</strong> introduces MicroFlow, a novel Rust-based framework designed to efficiently run AI models on resource-constrained edge devices. The authors aim to demonstrate how Rust’s unique features — particularly its memory safety, concurrency model, and performance — can lead to superior results compared to existing frameworks like TensorFlow Lite Micro (TFLM), all while maintaining high efficiency in memory and computation.</p><p>In this review, I will examine the key design decisions made by the authors, the MicroFlow runtime, and the role of the MicroFlow compiler. Additionally, I will review how they achieved efficiency in mathematical operations and highlight the performance of the runtime on test devices such as the ESP32 and nRF52840 microcontrollers.</p><h3>MicroFlow: An Efficient Edge AI Runtime</h3><p>MicroFlow was developed to meet the growing need for efficient AI processing on resource constrained devices such as microcontrollers. The runtime supports fundamental AI operations like ReLU, Convolution, and Softmax, which are critical for many edge AI tasks, including object detection and voice recognition.</p><p>The authors chose Rust as the foundation for this project due to its well-known advantages:</p><ul><li><strong>Memory Safety</strong>: Rust’s ownership system helps avoid memory management issues like buffer overflows and null pointer dereferences, which are critical to avoid in embedded AI applications.</li><li><strong>Concurrency</strong>: Rust provides safe concurrency primitives, which enable real-time AI inference while handling multiple tasks in parallel on resource-constrained devices.</li></ul><h3>Efficiency in Mathematical Operations</h3><p>One of the central innovations of MicroFlow is its efficiency in executing fundamental AI operations. The authors were able to achieve this by carefully optimizing the mathematical operations, minimizing memory usage, and reducing processing overhead:</p><ul><li><strong>Memory Efficiency</strong>: By reducing unnecessary data copies and avoiding dynamic memory allocations, the authors minimized the overhead that often plagues real-time AI processing on embedded devices.</li><li><strong>Optimized Convolutions</strong>: The convolution operation, which is key to many neural networks, was optimized for memory reuse and reduced recalculation of intermediate values. This approach minimizes both RAM and flash memory consumption.</li><li><strong>Efficient Activation Functions</strong>: Functions like ReLU and Softmax were optimized with Rust’s ownership and borrowing system to avoid memory duplication, thus significantly lowering RAM usage while maintaining high speed.</li><li>Through these optimizations, MicroFlow was able to use 30% less flash memory and 20–25% less RAM compared to TensorFlow Lite Micro, making it a better fit for low-power, resource-constrained devices.</li></ul><h3>The Role of the MicroFlow Compiler</h3><p>The MicroFlow compiler plays a critical role in ensuring the runtime operates efficiently on embedded systems. The authors designed the compiler to generate compact, optimized code that can fit into the limited memory of microcontrollers without sacrificing performance.</p><p>Key benefits of the MicroFlow compiler include:</p><ol><li><strong>Code Size Optimization</strong>: The compiler strips away unnecessary abstractions and focuses on essential operations, resulting in smaller code that fits within the memory constraints of embedded devices.</li><li><strong>Cross-Platform Support</strong>: The compiler is designed to work seamlessly across various hardware platforms, allowing developers to deploy AI models on different microcontroller architectures without extensive modifications.</li><li><strong>Efficient Memory Management</strong>: Rust’s memory model, combined with the compiler’s optimizations, ensures that memory is automatically deallocated when no longer needed. This reduces the likelihood of memory leaks, a common issue in C-based embedded systems, and ensures a low memory footprint.</li></ol><h3>Testing on Embedded Devices</h3><p>The authors tested MicroFlow on two commonly used embedded devices: the ESP32 and nRF52840 microcontrollers. These devices have tight memory constraints, making them excellent candidates for testing the efficiency of AI runtimes like MicroFlow.</p><ul><li><strong>ESP32 (Adafruit HUZZAH32)</strong>:</li><li>Architecture: 32-bit Xtensa</li><li>Flash Size: 4 MB</li><li>RAM Size: 328 KB</li><li>Clock Speed: 240 MHz</li><li><strong>nRF52840 (Arduino Nano 33 BLE Sense)</strong>:</li><li>Architecture: 32-bit Cortex-M4F</li><li>Flash Size: 1 MB</li><li>RAM Size: 256 KB</li><li>Clock Speed: 64 MHz</li></ul><p>On both devices, MicroFlow demonstrated significantly lower memory usage compared to TensorFlow Lite Micro:</p><ul><li><strong>ESP32</strong>: MicroFlow used approximately <strong>28 KB less flash</strong> and <strong>15 KB less RAM</strong> than TensorFlow Lite Micro</li><li><strong>nRF52840</strong>: MicroFlow used <strong>20 KB less flash</strong> and <strong>10 KB less RAM</strong> than TensorFlow Lite Micro</li></ul><p>These optimizations are crucial for ensuring that AI applications can run on small, battery-operated devices without exhausting the available resources.</p><h3>Performance Comparison: MicroFlow vs. TensorFlow Lite Micro</h3><p>The authors provide a detailed comparison between MicroFlow and TensorFlow Lite Micro. While both frameworks performed similarly in terms of runtime and energy efficiency, MicroFlow’s standout feature was its lower memory usage. It consistently used 30% less flash memory and 20–25% less RAM than TFLM, making it an attractive option for developers working with highly constrained edge devices.</p><p>This optimized memory handling without sacrificing inference performance positions MicroFlow as a strong alternative for edge AI applications, especially in environments where memory resources are tight.</p><h3>Conclusion</h3><p>The paper <strong><em>MICROFLOW: AN EFFICIENT RUST-BASED INFERENCE ENGINE FOR TINYML</em></strong> presents a compelling case for using Rust in embedded AI applications. The runtime demonstrates how Rust’s memory safety, concurrency, and performance optimizations can be leveraged to create a highly efficient, modular AI framework suitable for resource-constrained devices.</p><p>I’m particularly excited to see if the authors will extend MicroFlow’s capabilities by leveraging processors with built-in NPUs (Neural Processing Units), such as the STM32MP2 series, or taking advantage of Cortex-M4 based microcontrollers that support DSP instructions and floating-point units (FPUs). This could further improve performance and open up new possibilities for more complex AI applications on resource constrained devices.</p><p>Additionally, I’m curious to see how the performance and efficiency savings in end-user applications built with Rust compare to those using C/C++ in TensorFlow Lite Micro (TFLM). While Rust’s advantages in memory safety and concurrency are clear, seeing how these translate into real-world gains in terms of processing speed and energy efficiency will be key to understanding its impact on embedded AI development.</p><p>For more information, the authors have made the project available on GitHub: <a href="https://github.com/matteocarnelos/microflow-rs">microflow-rs</a>. The full paper can be accessed via <a href="https://arxiv.org/pdf/2409.19432">arXiv (2409.19432)</a>, and credit goes to the team for their valuable contribution to advancing Edge AI technology.</p><h3>About Me</h3><ul><li><strong>Connect with me on </strong><a href="https://www.linkedin.com/in/felix-ee/"><strong>LinkedIn</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b889e9145be1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fooling a CNN and Its Implications for Edge AI Systems]]></title>
            <link>https://medium.com/@felixgalindo91/fooling-a-cnn-and-its-implications-for-edge-ai-systems-c42bebf3ee10?source=rss-b67e7306c74c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c42bebf3ee10</guid>
            <category><![CDATA[edge-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Felix Galindo]]></dc:creator>
            <pubDate>Tue, 15 Oct 2024 16:50:46 GMT</pubDate>
            <atom:updated>2024-10-16T01:41:20.770Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OA-2c0sumj2KkXV75kvpIw.jpeg" /></figure><h3>Introduction</h3><p>Edge AI systems, such as drones, smart cameras, and IoT devices, increasingly rely on pre-trained models like <strong>SqueezeNet, MobileNet, Tiny YOLO </strong>for tasks such as real-time image classification and object detection. Pre-trained models are widely used because they offer a lightweight, efficient solution that works well in resource-constrained environments. However, these models are vulnerable to <strong>adversarial attacks</strong> — small, almost imperceptible changes to an input image that can cause the model to misclassify it.</p><p>In this article, we demonstrate how <strong>gradient ascent</strong> can be used to fool a pre-trained model like SqueezeNet by turning an image of a <strong>Tibetan Mastiff</strong> into one classified as a <strong>Persian cat</strong> (class index 283). We’ll explore the potential risks of adversarial attacks for Edge AI systems and discuss possible defenses.</p><h3>Example Fooling Image</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*7HNMMcYtski8Ac704_Lj_w.png" /><figcaption>Fooling Example</figcaption></figure><p>In the example above, an image of a Tibetan Mastiff has been subtly altered using gradient ascent. While these changes are invisible to the human eye, the model misclassifies the image as a Persian cat.</p><h3>How Gradient Ascent Works</h3><p>Gradient ascent is a technique that iteratively adjusts an image to maximize the model’s confidence in an incorrect class.</p><ol><li><strong>Start with the original image</strong>: In this case, a Tibetan Mastiff.</li><li><strong>Choose the target class</strong>: The class you want the model to incorrectly predict.</li><li><strong>Calculate the gradient</strong>: Compute the gradient of the loss function with respect to the image. This gradient shows how to change the pixels to increase the model’s confidence in the wrong class.</li><li><strong>Update the image</strong>: The image is modified slightly in the direction of the gradient. These iterative changes gradually fool the CNN into making the wrong prediction.</li></ol><p>Each iteration updates the image as follows:</p><p><strong>X_new = X_old + η ∇_X L(X, y_target)</strong></p><p>Where:</p><ul><li><strong>X_new</strong> is the updated image.</li><li><strong>η</strong> (eta) is the learning rate, which controls the size of each update.</li><li><strong>∇_X L(X, y_target)</strong> is the gradient of the loss with respect to the input image.</li></ul><h3>Code Example: Simplified Gradient Ascent</h3><p>Below is a simplified code example demonstrating how gradient ascent is used to modify an image and fool a commonly used pre-trained CNN, SqueezeNet:</p><pre>import torch<br>import torch.optim as optim<br>from torchvision.models import squeezenet1_1<br><br># Load the pre-trained SqueezeNet1_1 model<br>model = squeezenet1_1(pretrained=True)<br>model.eval()<br># Assume `X` is your original image tensor (e.g., the Tibetan Mastiff image)<br>X = ...  # Your input image as a tensor<br>X.requires_grad = True  # Enable gradients for the input image<br># Set the target class to &#39;Persian cat&#39; (class index 283 in ImageNet)<br>target_class = 283<br># Use gradient ascent to update the image<br>optimizer = optim.Adam([X], lr=0.01)<br>for iteration in range(100):  # Perform 100 iterations<br>    optimizer.zero_grad()  # Clear previous gradients<br>    output = model(X)  # Forward pass to get predictions<br>    # Maximize the score for the target class (Persian cat)<br>    loss = -output[0, target_class]  # Negative because we want to maximize<br>    loss.backward()  # Backpropagate to compute gradients<br>    optimizer.step()  # Update the image based on the gradient<br>    if iteration % 10 == 0:<br>        print(f&quot;Iteration {iteration}: Loss {loss.item()}&quot;)<br># The X tensor now holds the adversarial image that fools the model</pre><h3>Implications for Edge AI Systems</h3><h4>1. Security Vulnerabilities</h4><p>Edge AI systems, which often operate in critical environments such as surveillance cameras, industrial robots, or autonomous vehicles, are particularly vulnerable to adversarial attacks. These attacks could force systems to misclassify objects in real-time, leading to potentially dangerous consequences.</p><p>For example, an autonomous vehicle might misinterpret a stop sign as a speed limit sign, or a security camera might mistake a person for an object, allowing unauthorized access.</p><h4>2. Limited Resources</h4><p>Edge devices typically have limited computational power and memory, which is why pre-trained models like SqueezeNet are commonly used. While efficient, these models are also more vulnerable to adversarial attacks due to their simplified decision boundaries.</p><p>Defending against adversarial examples without significantly increasing the resource load on these systems presents a unique challenge for Edge AI applications.</p><h4>3. Real-Time Decision Making</h4><p>Edge AI systems, which often need to make real-time decisions, are at an even greater risk. Adversarial attacks can be applied quickly and subtly, fooling the model before the system can detect or correct the error.</p><p>In real-time systems like traffic control, industrial automation, or healthcare, the consequences of a misclassification can be severe and immediate.</p><h3>Mitigation Strategies</h3><p>To protect Edge AI systems from adversarial attacks, developers can implement several strategies:</p><ul><li><strong>Adversarial Training</strong>: By training the model with adversarial examples, it becomes more robust to such attacks, although this increases the complexity of the training process.</li><li><strong>Input Filtering</strong>: Pre-processing techniques that filter out adversarial noise or detect adversarial inputs can mitigate attacks, but they also add extra computational steps.</li><li><strong>Confidence Monitoring</strong>: Monitoring a model’s prediction confidence can help detect when the system is being fooled. If confidence drops or is inconsistent, the system can trigger alerts for human intervention.</li></ul><h3>Conclusion</h3><p>Pre-trained models like SqueezeNet, MobileNet, Tiny YOLO are frequently used in Edge AI systems due to their lightweight and efficient design, making them ideal for resource-constrained environments. However, as demonstrated in this article, these models are vulnerable to adversarial attacks that can easily manipulate predictions.</p><p>In our demonstration, we used gradient ascent to transform an image of a Tibetan Mastiff into one misclassified as a Persian cat. This highlights the significant risks that adversarial attacks pose to Edge AI systems, especially in safety-critical or real-time applications. As AI continues to be integrated into everyday devices, it is essential to ensure that these models are robust against adversarial manipulation to maintain the security and reliability of Edge AI systems.</p><h3>About Me</h3><ul><li><strong>Connect with me on </strong><a href="https://www.linkedin.com/in/felix-ee/"><strong>LinkedIn</strong></a></li><li><a href="http://felixgalindo.com/"><strong>Visit my personal website</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c42bebf3ee10" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>