<?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 Ryan Revilla on Medium]]></title>
        <description><![CDATA[Stories by Ryan Revilla on Medium]]></description>
        <link>https://medium.com/@ryan.ar?source=rss-42a70443ad4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*b_lfpcl6K26ECFknCcg_fg.jpeg</url>
            <title>Stories by Ryan Revilla on Medium</title>
            <link>https://medium.com/@ryan.ar?source=rss-42a70443ad4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 21:50:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ryan.ar/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[Building an Agentic Software Team. First Attempt — March 2026]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ryan.ar/building-an-agentic-software-team-first-attempt-march-2026-1c0b0b230921?source=rss-42a70443ad4f------2"><img src="https://cdn-images-1.medium.com/max/1920/1*IFpPyT63hOA7bj9Kf5WpEQ.png" width="1920"></a></p><p class="medium-feed-snippet">A first attempt at deploying spec-driven development.</p><p class="medium-feed-link"><a href="https://medium.com/@ryan.ar/building-an-agentic-software-team-first-attempt-march-2026-1c0b0b230921?source=rss-42a70443ad4f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ryan.ar/building-an-agentic-software-team-first-attempt-march-2026-1c0b0b230921?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c0b0b230921</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[agentic-coding]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Wed, 11 Mar 2026 16:43:48 GMT</pubDate>
            <atom:updated>2026-03-12T03:14:47.487Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Understanding Skills and Sub-Agents in Claude Code]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ryan.ar/understanding-skills-and-sub-agents-in-claude-code-879d0eb73d81?source=rss-42a70443ad4f------2"><img src="https://cdn-images-1.medium.com/max/1200/0*bGoArcOqxjdS3S-i.png" width="1200"></a></p><p class="medium-feed-snippet">A beginners conceptual guide to Claude Code skills and sub-agents. These principles apply to Gemini-CLI and OpenCode.</p><p class="medium-feed-link"><a href="https://medium.com/@ryan.ar/understanding-skills-and-sub-agents-in-claude-code-879d0eb73d81?source=rss-42a70443ad4f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ryan.ar/understanding-skills-and-sub-agents-in-claude-code-879d0eb73d81?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/879d0eb73d81</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[open-code]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 02:48:27 GMT</pubDate>
            <atom:updated>2026-03-11T02:53:07.676Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Systems Thinking Takes Center Stage in the Age of AI]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ryan.ar/why-systems-thinking-takes-center-stage-in-the-age-of-ai-b84b970b127d?source=rss-42a70443ad4f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*37Fm8qRhVNLRwOk_UP4YBw.png" width="5128"></a></p><p class="medium-feed-snippet">AI coding tools move to spec-driven development. A move to a systems approach to coding with AI agents.</p><p class="medium-feed-link"><a href="https://medium.com/@ryan.ar/why-systems-thinking-takes-center-stage-in-the-age-of-ai-b84b970b127d?source=rss-42a70443ad4f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ryan.ar/why-systems-thinking-takes-center-stage-in-the-age-of-ai-b84b970b127d?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b84b970b127d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[systems-engineering]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[systems-thinking]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 02:21:16 GMT</pubDate>
            <atom:updated>2026-03-06T17:22:18.081Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Software Assembly Lines]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ryan.ar/software-assembly-lines-9a7b17e31a23?source=rss-42a70443ad4f------2"><img src="https://cdn-images-1.medium.com/max/2600/0*IakfjicMY6BFS26I" width="6048"></a></p><p class="medium-feed-snippet">A take on the end of artisan software development. How Agile led us here.</p><p class="medium-feed-link"><a href="https://medium.com/@ryan.ar/software-assembly-lines-9a7b17e31a23?source=rss-42a70443ad4f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ryan.ar/software-assembly-lines-9a7b17e31a23?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a7b17e31a23</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 01:41:56 GMT</pubDate>
            <atom:updated>2026-03-12T21:27:54.581Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Microchips For Fluids Exist. But, Where Are They?]]></title>
            <link>https://medium.com/a-microbiome-scientist-at-large/microchips-for-fluids-exist-but-where-are-they-816988beaa5b?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/816988beaa5b</guid>
            <category><![CDATA[biology]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[chemistry]]></category>
            <category><![CDATA[biotechnology]]></category>
            <category><![CDATA[microfluidics]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 21:00:38 GMT</pubDate>
            <atom:updated>2026-02-08T19:50:44.827Z</atom:updated>
            <content:encoded><![CDATA[<h4>A technology with amazing potential. Yet, it struggles to be commercialized.</h4><figure><img alt="A microfluidic chip example. Shows a microchip with fluid and electronic electrodes. It was probably never commercialized." src="https://cdn-images-1.medium.com/max/960/0*GZNtikCm0aT8N4xk" /><figcaption>An elusive microfluidic chip. (W<a href="https://commons.wikimedia.org/wiki/File:Microfluidic_chip_for_point-of-care_medical_devices.jpg">ikipedia Commons</a>)</figcaption></figure><p>Today, at every major university in the United States, one can find a research lab building a futuristic microchip. Microchips whose purpose is to act on fluids rather than electricity. These microchips promise to do everything from delivering drugs, to diagnosing illnesses, to even growing organs.</p><blockquote>This technology and its applications have been worked on for the last 30+ years. However, it’s rarely successfully commercialized.</blockquote><p>The technology I am referring to has a name: <strong>Microfluidics</strong>.</p><p>There are many reasons for the difficulties of commercializing microfluidics. For this article, I will first introduce this field to you. I will then focus on <em>one particularly deadly gap</em> faced by all of us in this industry. One where many companies failed to cross. One that we’ve attacked for 12 years at my company.</p><p>That deadly gap is in scaling up manufacturing.</p><p>I have lived in the microfluidics industry for now over a decade. The company I co-founded, Fluxergy Inc., delivers a microfluidic solution for Equine Veterinarians (i.e., horse vets) across the US. We got our start in animal health and are moving to deliver products in other sectors.</p><p>I can proudly say that we’re one of a few companies delivering on <em>one</em> promise of microfluidics. However, that fact also scares me. It scares me because an industry can only flourish with a network of players. And, I personally think addressing this deadly gap between research and industry can help bring more amazing applications to reality.</p><p>In the coming sections, you’ll learn a little about<strong> what microfluidics is</strong>, <strong>why it’s so challenging</strong>, and I’ll highlight <strong>the biggest opportunity I see</strong> in the field.</p><p>For some background, let’s first look at what microfluidics is and what it’s meant to deliver.</p><h4>The promise of microfluidics</h4><p>The promise derives itself from a simple concept: <em>the benefits of dealing with small amounts of fluid</em>. If you think about your own body, most processes happen at scales a microscope can only see (if not smaller). Microfluidics is an attempt to leverage these microscopic processes and effects.</p><p>With small volumes of fluid, chemical processes can occur quickly. Using small volumes of fluid also has a cost savings — expensive chemical and biological components can be used in tiny fractions. More so, many reactions could be packed into a small area and run in parallel. Making for parallel “computing” of the sorts.</p><p>This fact pointed early researchers to the idea of a <strong>micro-total-analysis system</strong> (<strong>u-TAS</strong>, circa 1990). This idea was to run chemical reactions or biological processes on a microchip. Reactions would run automatically and would be massively parallelized to run a complete, total analysis on a sample; hence, the name.</p><p>More so, it would be faster, cheaper to run, and more efficient than doing things in a lab. You could, in theory, take all of the steps performed in a lab and put them onto a microchip.</p><p>This idea expanded to <strong>the concept of shrinking an entire lab onto a chip</strong> — in fact, one of the most prominent research journals in the field goes by the same name: <em>Lab on a Chip</em>.</p><p>The dream was realizing the Star Trek Tricorder — a portable device that could analyze anything. With microfluidics, this dream could become a reality.</p><p>This is the promise of microfluidics. Now, let’s get into why it’s so difficult to deliver on this promise.</p><h4>From Lab to Fab</h4><p>Research labs throughout the world make prototype microfluidic chips every day. These prototypes showcase the promise of microfluidics, and they have for decades. People can today, in fact, run a medical diagnosis from a chip. They can run chemical analysis and synthesis on a microchip. However, almost all are prototypes. Translating these to production-capable products is a different game.</p><p>The mentality in a research lab is often to try a new, interesting application. Researchers will try 1000 times and maybe get 10 microchips to work. Because of this, a means of rapid prototyping these devices is highly desired and has become popular with researchers. And, in this context, it makes sense. Try as many things as quickly as you can to iterate on ideas. However, the challenge is moving away from that prototype. Getting to the point where you try 100,000 times and get 95,000 working microchips.</p><blockquote>Researchers try 1,000 times and get 10 to work. Companies try 100,000 times and <strong><em>need</em></strong> 95,000 to work.</blockquote><p>Now, you could say: Isn’t that the problem for any new product?</p><p>Well, yes. But, microfluidics carries <em>a specific problem</em> that makes it almost insurmountable for a new company.</p><p>Remember how we discussed the benefits of handling small amounts of fluid? Well, that is a double-edged sword.</p><p>Let’s do a little thought experiment to help you understand. Imagine holding a bottle of water. Say 1 liter. What percentage of water do you think touches the surface of the bottle? Now, shrink that bottle by a factor of 10,000. It now holds only 0.0001 liters (100 microliters). What percentage of water now touches the surface of that tiny bottle?</p><p>That question is somewhat ill-posed. But, even without being more precise and doing the math, it’s easy to say: <em>a lot more</em>.</p><p>Because of this, interactions between the fluid and its container (i.e. the microchip) become magnified. These interactions, in fact, drive how the fluids behave in these microchips. That means any change in material causes the fluid to behave differently. More so, differences in materials can also affect chemical reactions. This sounds like a basic idea, but the implications are tremendous.</p><p>This means if a prototype uses one material and the final product uses another, the fluid behavior and underlying chemical/biological processes can change significantly. Significantly enough that your device may not even work. Even more so, the<em> variations</em> in surface quality of these materials create the same effect, just in a less predictable way. Making repeatability also a significant factor.<strong> So, materials and fabrication methods matter… a lot.</strong></p><p>The problem is that these prototyping methods aren’t reliable or cost-effective when attempting to produce large numbers of these devices. So, people trying to commercialize microfluidic devices must then switch materials and fabrication methods. Then, switching over to your new material will cause design changes. This often leads to going back to the drawing board.</p><p>Beyond materials, there is a deeper problem in making your microfluidic chip.</p><h4>In search of economies of scale</h4><p>In many mature industries, you can assume that early prototypes are expensive and that cost savings will come as manufacturing scales. This is the concept of economies of scale.</p><p>But, what happens when few people how to make your product? Let alone, make it more efficient to produce?</p><p>This is the case with microfluidics.</p><blockquote><strong>There is no standardized or accepted way to make a microfluidic chip, in large numbers while at a cost acceptable by the user.</strong></blockquote><p>This is problematic.</p><p>Problematic because to realize economies of scale, one needs <em>methods, materials, and machinery </em>— we’ll call these the 3 M’s — to scale production. In more mature industries, people will rely on a network of suppliers and know-how to supply 1 or all of the 3 M’s.</p><p>For example, in semiconductors, one can develop a new computer architecture, take it through prototyping, and scale it all using external vendors. Think of how Apple Silicon (the M-Series processor) came to be. Apple designs the processor. Apple doesn’t manufacture it. They can completely rely on external vendors, like the famous TSMC. TSMC has the fabrication knowhow, access to materials, and well-vetted manufacturing methods and machinery. TSCM has all 3 of the M’s.</p><p>That is not so in microfluidics.</p><p>There is no TSMC equivalent in microfluidics.<strong> </strong>You’ll also struggle to find a network of suppliers that produce chips at the right cost, in high volume, and at the quality you need. In other words, <strong>microfluidics has a sparse, non-scalable supply chain</strong>.</p><p>Because of this, one is forced to look to other industries for the 3 M’s, or… you must invent your own.</p><p>For us, we’ve relied on other industries for materials. For methods and machinery, we’ve opted to invent our own.</p><figure><img alt="A custom robotic cell by Fluxergy Inc. Image features an upside-down, yellow Fanuc robot working on a conveyor of parts." src="https://cdn-images-1.medium.com/max/1024/1*k2LIMZe0v9x9ScZcnmndZw.png" /><figcaption>Our third (3rd) generation microfluidic chip assembly machine undergoing testing. This is one of many machines we’ve had to build for our production line. Photo by Author.</figcaption></figure><p>At time of writing, we’ve put in 12 years of work into developing our manufacturing. Almost every step in our process uses custom machinery and internally-developed methods for making our microfluidic chips. We’ve even gone as far as establishing our own internal group to design and build this machinery. Vertically integrating (as the business folk would say).</p><p>All of this is in parallel with developing the actual product.</p><p>So, in other words, new companies attempting to commercialize microfluidics not only have to develop a product, but <strong>new companies also have to invent a manufacturing method</strong>. On top of that, the manufacturing method has to produce chips at a cost that can make a profit.</p><p>Sounds like an insurmountable task, no?</p><p>Well, I can tell you. It is not for the faint of heart. It’s an expensive endeavor.</p><p>This is the challenge in microfluidics. And, why there are still so few of us that deliver in this industry.</p><p>Which brings me to a big opportunity in this field.</p><h4>The big opportunity in microfluidics</h4><p>We’ll go off the idea that there exists no TSMC equivalent of microfluidics, nor a network of suppliers that can be strung together to make your microchip in a scalable way. So, the big opportunity is… in the supply chain.</p><p>It’s not sexy. You won’t be famous (or infamous like Elizabeth Holmes and Theranos). But… you have a much higher chance of business success.</p><p>Become a supplier of <em>cost-effective</em> microfluidic chips or the equipment that makes these chips. There exists some that are trying today. However, I cannot say that they meet the cost, repeatability, and volume requirements for real production. Of the very few who have cost-effective manufacturing, they are not suppliers and are making their own products (like us).</p><p>Now, we haven’t touched on this explicitly. But, I’ve explained some bits. Microfluidics displays some unique features that make it enticing:</p><ul><li>A wide variety of possible applications</li><li>Heavy dependence on materials</li></ul><p>The second can seem like a negative, but this can be leveraged. Because of these two factors, there probably will not be one, accepted way to make a microfluidic chip. There will be many. It’s not like semiconductors, where the convergence is on certain silicon processing steps. Because we are dealing with a myriad of potential fluids (and what they contain) and what a user intends to do with these fluids (i.e. varied applications), a single method of manufacturing cannot exist. The goal should be to niche down.</p><p>If you make a chip cheap enough, reliable enough, scalable, and specific enough, your customers will come.</p><p><em>If you would like connect or discuss further, please reach out on </em><a href="https://www.linkedin.com/in/ryan-a-revilla/"><em>LinkedIn</em></a><em>.</em></p><h4>Some references to support my claims</h4><ul><li><a href="https://www.investopedia.com/terms/e/economiesofscale.asp">The basics of economies of scale</a>.</li><li><a href="https://pubs.rsc.org/en/content/articlelanding/2022/lc/d1lc00731a/unauth">Importance of materials in microfluidics, some applications, and even touches on the promise</a>.</li><li><a href="https://www.sciencedirect.com/science/article/pii/S2590007219300036?via%3Dihub">30 Years of Microfluidics</a>. Touches on history and talks about manufacturing challenges.</li><li><a href="https://www.mdpi.com/2072-666X/12/3/319">Good overview for methods of manufacturing in microfluidics</a>. Not all inclusive. Some methods are being used today in industry. Others have shown to be unreliable or not scalable at the needed price points.</li><li><a href="https://pubs.aip.org/aip/bmf/article/16/2/021301/2835411/Perspectives-in-translating-microfluidic-devices">Explicitly talks of the lab-to-fab issue discussed here</a>. Talks on efforts in standardization, but I can say that I have yet to hear successful companies following them. Does talk about the supply chain issue.</li><li><a href="https://www.sciencedirect.com/science/article/abs/pii/092540059080209I?via%3Dihub">The original u-TAS concept</a> (1990). Makes a great case for putting chemical analysis on a microchip. Also gives you perspective on how long we’ve been trying.</li><li><a href="https://doi.org/10.1038/ s43586-022-00118-6">My Company, Fluxergy Inc.</a> Our <a href="https://www.fluxergy.com/manufacturing">manufacturing portion</a> of the website.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=816988beaa5b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/a-microbiome-scientist-at-large/microchips-for-fluids-exist-but-where-are-they-816988beaa5b">Microchips For Fluids Exist. But, Where Are They?</a> was originally published in <a href="https://medium.com/a-microbiome-scientist-at-large">Sharing Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anomaly Detection in Manufacturing: Taking a Different Approach to Training]]></title>
            <link>https://medium.com/@ryan.ar/anomaly-detection-in-manufacturing-taking-different-approach-to-training-2e87c0cb4b0c?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e87c0cb4b0c</guid>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[edge-computing]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Thu, 15 Jan 2026 05:42:34 GMT</pubDate>
            <atom:updated>2026-07-03T19:29:32.720Z</atom:updated>
            <content:encoded><![CDATA[<h4>By flipping a key question, the field of anomaly detection shows us a different approach to the problem of defect detection as well as a different way to train models.</h4><figure><img alt="Anomaly detection on a PCB. (Left) A heatmap indicating the location of some discoloration on the PCB as well as some burned components. (Right) shows the same features circled by the algorithm." src="https://cdn-images-1.medium.com/max/1024/1*SztMfrcydAegbvmX1fK3Og.png" /><figcaption>Anomaly detection showing heat map (left) and circled regions (right). This was using anomaly detection methods found in Anomalib, an open source library for anomaly detection supported by Intel.</figcaption></figure><p>Detecting defective products is a priority for any manufacturer. Attempts at detecting defects is nothing new. However, the computer vision techniques commonly used today require a clear understanding of what a defect looks like. Often these techniques start with the question: How can we detect defect, X? But, what if you don’t have images of every possible defect to train an algorithm on? This is the problem more modern techniques focus on.</p><p>The modern approach flips the question around. Instead of trying to detect a specific defect, this approach tries to find anything that is abnormal. And, by doing so, it makes managing computer vision much easier.</p><p>This post will cover a technique that leverages existing, pre-trained neural networks. In a <a href="https://medium.com/@ryan.ar/autoencoders-for-defect-detection-in-images-06d534745ecc?sk=5b10248cee58f3b2d7324f42aba7d0c9">previous post</a>, I covered a very simple, yet effective technique for training a network on only good images. The method covered here also takes the same approach, but cleverly uses existing networks instead of training your own.</p><h3>Leveraging pre-trained networks</h3><p>To understand why one would use a pre-trained network, you would need to step back to understand what defect detection requires.</p><p><em>First</em>, a defect detector needs to see features in an image.</p><p><em>Second</em>, it determines if a feature is defective (or abnormal).</p><p>And, as an <em>optional third</em> requirement, it can show where these defects are.</p><p>If one thinks about what existing pre-trained networks can accomplish these, we mainly need a network that can see features reliably, discern one feature from another, and also show location of these features. Defined like this, object detection neural networks are a great fit.</p><h3>A naive approach</h3><p>Having figured out that a pre-trained object detector is a candidate for our task, a kneejerk reaction is to fine-tune one of these neural networks to find our defects.</p><p>But, that puts us back to where we started: <em>we end up collecting images of our defects.</em></p><p>If we try to flip the question (like mentioned in the intro), we could fine-tune one of these networks to only recognize our good parts. If we know that images only contain our parts and the parts are imaged using a clean, consistent background, we could then say that any appreciable error in our fine-tuned object detector would indicate a defective part.</p><p>Now, this would work if we don’t care about where our defects are, or what they look like. But, if we do care? This approach leaves us without any location information on the defects. We would only have a “no-detect” indicator to follow.</p><p>As it turns out, there’s a better way that doesn’t involve fine-tuning and still gets us to our third requirement of <em>locating defects</em> within an image. To understand this method more, we’ll need to understand what an object detector learns during training.</p><h3>Peering into an object-detector</h3><p>The object detector we’ll look at is one of the most popular. The convolutional neural network (CNN). Early in the development of CNN’s, people wondered what these networks learned after training. As it turns out, one can look at the output of each layer in a CNN to see what it has progressively learned.</p><p>After each layer of a CNN, a compressed set of information is produced. This information is called a <strong>feature map</strong>. If <a href="https://poloclub.github.io/cnn-explainer/">one visualizes these feature maps</a>, one can see that earlier layers learn different features of an image than later ones. Early feature maps find basic edges. Following ones find shapes. The later ones find entire objects.</p><p>If we feed images of our manufactured parts through these networks, these feature maps should show features the CNN found on our object. Everything from edges, to shapes, and eventually our object.</p><p>The next insight here is that these edges and shapes in early layers may be different for images containing defects than those that do not. For example, if a metal food can has a dent in it, that shape should be present in some feature map within the CNN.</p><p>An additional property of these feature maps: they all can be mapped back to the original image. Meaning, we can find the location of these different edges, shapes, and objects within our image.</p><p>We’re getting closer to our third requirement of finding where defects are in an image.</p><h3>Using feature maps</h3><p>Newer methods take the approach of analyzing these feature maps. The two detection methods we’ll talk about here try to do two simple things:</p><ul><li><strong>Memorize what a non-defective feature map looks like.</strong></li><li><strong>Compare features from test images to those memorized</strong></li></ul><p>Anything that differs from these memorized feature maps is said to be defective. And, leveraging the location mapping property mentioned earlier, these identify exactly where they are different.</p><p>This method is called the <strong>memory bank </strong>method. <em>You simply memorize what is good and indicate where things differ from good</em>. It’s actually a more intuitive approach because this is how you would train a human to find defective parts: Tell them what is considered good, isolate the rest.</p><figure><img alt="Left, layers of a CNN being monitored for features during training. Purple dots indicate the features which appear to be clustered. These are stored in a memory bank. Right, the features seen during inference. Colored dots indicate on a feature map graph. Green indicates non-anomalous features on the map that correspond to the clusters of the trained feature maps (purple). the red dots indicate anomalous features that are outside of these clusters." src="https://cdn-images-1.medium.com/max/640/1*vfcly6TYofjOfUIpToMhmA@2x.jpeg" /><figcaption>(Left) A memory bank of features is stored from a non-defective dataset. (Right) During inference, feature maps that are “far” from the originally-stored features are considered anomalous.</figcaption></figure><p>Most memory bank methods work off of stored feature maps of good parts. The question then becomes, how do you store the information and how you compare. The two primary methods I’ve evaluated so far are called PaDiM and Patchcore.</p><p><strong>PaDiM</strong> tries to summarize the feature maps of good parts using statistics, outputting a set of “ideal feature maps”. <strong>Patchcore</strong> just tries to selectively memorize feature maps from images of good parts.</p><h4>PaDiM</h4><p>More specifically, <a href="https://arxiv.org/abs/2011.08785">PaDiM</a> makes takes a mean of the feature map set as well as the covariance. I remember this method as the statistical summary method. It’s great because it makes the model less-memory intensive during inference, which means it’s a candidate for low-resource compute methods.</p><h4>Patchcore</h4><p><a href="https://arxiv.org/abs/2106.08265">Patchcore</a> tries to memorize specific features that represent the non-defective parts. Now, this is somewhat a brute-force approach in my opinion. However, it does a great job. Also, there’s some additional steps it takes to make its selection of features. Mainly a distance algorithm. So, not all features of the training set are saved.</p><figure><img alt="Anomaly detection using PaDiM on a piece of gum. Left shows a heat map surrounding the chip in the gum. Right shows an enclosed circle that indicates the location of the anomaly." src="https://cdn-images-1.medium.com/max/512/1*aYPGMVNrEXEcIqZhujrH0A.png" /><figcaption>An image of gum with anomaly detection. This is using the PaDiM model and was trained within minutes. Image by Author.</figcaption></figure><p>I almost hate to call this training, as these two models don’t go through the standard epoch training method. Instead, they are more like peering into a network and recording. Almost as if acting like an observer. Other models in this field, however, do use the “standard” training methods seen in neural networks. Which brings me to where you can get started exploring these models.</p><h3>Where to find these and use them</h3><p>These, and many more algorithms can be found in an open-source library called <a href="https://anomalib.readthedocs.io/en/v2.2.0/">Anomalib</a>. It is maintained by Intel and seems to be actively updated. So, it’s a great source if you want to get started in detecting defects in products on your manufacturing line. Or, even some other “anomalous” feature within your own application.</p><p>To compare against a more traditional approach, see this article that trains a simple autoencoder to find defects:</p><p><a href="https://medium.com/@ryan.ar/autoencoders-for-defect-detection-in-images-06d534745ecc">Autoencoders for Defect Detection in Images</a></p><p>If you would like to connect with me or work with me, please see my <a href="http://www.linkedin.com/in/ryan-a-revilla">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e87c0cb4b0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Autoencoders for Defect Detection in Images]]></title>
            <link>https://medium.com/@ryan.ar/autoencoders-for-defect-detection-in-images-06d534745ecc?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/06d534745ecc</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[manufacturing]]></category>
            <category><![CDATA[anomaly-detection]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Fri, 05 Sep 2025 23:35:08 GMT</pubDate>
            <atom:updated>2026-05-27T12:28:21.730Z</atom:updated>
            <content:encoded><![CDATA[<h4>An example of using autoencoders to detect flaws in manufacturing.</h4><p>Detecting defective products is a primary goal in any manufacturing line. Today, computer vision for quality control is readily available. However, the basic computer vision methods require that a defect be well-quantified. This makes the case for introducing machine learning to help detect less quantifiable defects.</p><p>That being said, images collected on a manufacturing line can be skewed towards non-defective products, where images of defective products are rare. This makes a simple classifier difficult to train. Here, I’ll show one method involving an autoencoder to get around this problem.</p><p><em>This is part of some ongoing work I am doing. So, future posts may show improvements in methodology.</em></p><h3>The method</h3><blockquote>For those who are unfamiliar with an autoencoder, it is a machine learning <a href="https://www.ibm.com/think/topics/autoencoder">model for reconstructing input data</a>.</blockquote><p>This sounds somewhat a trivial task. But, for this task we can get clever. If we train an autoencoder only on non-defective parts, it should reliably reproduce these parts. When fed an image of a defective part, there should be some error in the reproduction.</p><p>Presumably, if the autoencoder learns to reproduce good part images well, this error should be large enough between defective parts and good parts that one could form a decision boundary.</p><h3>The dataset: images of brake caliper defects</h3><p>For public demonstration of these methods, I’ll be using a publicly available dataset. This dataset contains images of both good and defective castings on brake calipers, it can be <a href="https://www.kaggle.com/datasets/ravirajsinh45/real-life-industrial-dataset-of-casting-product">found here on Kaggle for free</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*LUZb-ukC2JuhSrvpe3dX8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*eM7r8Ew8l36u-8OzRoZBpQ.png" /><figcaption>(Left) An example of a defective product from the dataset. (Right) Example of a good product from the dataset. Images made by author in matplotlib. <a href="https://www.kaggle.com/datasets/ravirajsinh45/real-life-industrial-dataset-of-casting-product">Source data</a>.</figcaption></figure><h3>A simple autoencoder in Keras</h3><p>For initial testing, I went with a simple autoencoder made with fully-connected, dense layers. The implementation can be seen here:</p><pre>stacked_encoder = Sequential([<br>    layers.Input(img.shape), # img.shape is 300 x 300 pixels<br>    layers.Flatten(),<br>    layers.Dense(100, activation=&quot;relu&quot;),<br>    layers.Dense(30, activation=&quot;relu&quot;),<br>])<br>stacked_decoder = Sequential([<br>    layers.Dense(100, activation=&quot;relu&quot;),<br>    layers.Dense(img.shape[0] * img.shape[1] * img.shape[2], activation=&quot;sigmoid&quot;),<br>    layers.Reshape([img.shape[0], img.shape[1],img.shape[2]]),<br>])<br>stacked_ae = Sequential([stacked_encoder, stacked_decoder])<br>stacked_ae.compile(loss=&quot;mse&quot;, optimizer=&quot;nadam&quot;)<br>stacked_ae.summary()</pre><p>Here, we separated the autoencoder into two parts: <em>encoder</em> and <em>decoder</em>. For this specific case, we won’t use this separation. In similar cases, the encoder is used on its own to perform the same task we have here, which is considered a method of anomaly detection. For an example of that, you can see this <a href="https://www.youtube.com/watch?v=q_tpFGHiRgg">YouTube video</a>.</p><h3>Looking at some reconstructions</h3><p>For training, I used this line of code:</p><pre>history = stacked_ae.fit(X_good,X_good,epochs=200)</pre><p>Here, you’ll notice that the X_good is used for both the input and the training labels. This variable is from a set of non-defective parts of the dataset. I was sure to split these into training and validation splits beforehand, but that is outside the scope of this article.</p><p>Plotting some of the reconstructions of the non-defective (good) and defective parts, we can see there’s a clear difference. Albeit, for some good parts there is room for improvement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5MLUyjNPGQCvvR97nRseBw.png" /><figcaption>Original images compared against the reconstructions from the autoencoder. These are shown for both good parts and defective parts. Image by Author.</figcaption></figure><p>To get a starker change in the results, we’ll take the difference between the reconstruction image and the original image. This is accomplished by merely subtracting the two. We’ll also constrain them to values between 0–1 by using np.clip().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p_ikHu8EExLY0xH2UfVqxw.png" /><figcaption>Input images are subtracted from the reconstructed images. These are clipped to be within 0–1 range. Original images are plotted against “reconstructed” images, where here the reconstruction is really the difference between the original and the output of the autoencoder. (Top) Good parts. (Bottom) Defective parts.</figcaption></figure><p>The result shows a more exaggerated difference between good and defective parts. It’s almost as if the defects are highlighted now. This should be good enough to run a basic classifier.</p><p><em>The function I used to plot the images above can be seen below. This function allows for both plotting the image reconstructions as well as the error between the two by changing the </em><em>plot_diff boolean.</em></p><pre>def plot_reconstructions(model, images=X_good, n_images=5,plot_diff=False):<br>    reconstructions = np.clip(model.predict(images[:n_images]), 0, 1)<br><br>    if plot_diff:<br>        reconstructions = reconstructions - images<br>        reconstructions = np.clip(reconstructions,0,1)<br><br>    fig = plt.figure(figsize=(n_images * 1.5, 3))<br>    for image_index in range(n_images):<br>        plt.subplot(2, n_images, 1 + image_index)<br>        plt.imshow(images[image_index], cmap=&quot;binary&quot;)<br>        plt.axis(&quot;off&quot;)<br>        plt.subplot(2, n_images, 1 + n_images + image_index)<br>        plt.imshow(reconstructions[image_index], cmap=&quot;binary&quot;)<br>        plt.axis(&quot;off&quot;)</pre><h3>Laying the groundwork for a classifier</h3><p>To use a classifier to determine if a part is good or defective, one needs to make sure the results are separable in some way. For me, I wanted each image to come down to a single number. To do so, one can use a number of methods. For example:</p><ul><li>Sum over all of the image</li><li>Take the mean of the image</li><li>Take the standard deviation over the image</li></ul><p>After some testing, these all worked to some degree. However, the standard deviation of the image proved most effective. I also found it useful to take the np.abs() of each to make sure the result is positive. Here is the function I used to do so:</p><pre>def get_diff_sums(imgs,autoenc):<br>    Y = autoenc.predict(imgs) # create reconstructions<br>    D = Y-imgs # take differences between reconstructions and images<br>    sums = []<br>    for diff in D:<br>        sums.append(np.abs(np.std(diff))) # take std and abs of each image<br>    sums = np.array(sums)<br>    return sums<br><br>good = get_diff_sums(X_good,stacked_ae)<br>bad = get_diff_sums(X_bad,stacked_ae)</pre><p>Plotting the results, we can see that the good and bad parts are separable. This means a classifier can be applied in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*oww6kMNqEibXj8-CZha7vQ.png" /><figcaption>Plot of the results that can be used for classification. Image by Author.</figcaption></figure><p><em>As a note the Reconstruction Error is the difference between the reconstructed image and that of the original image. The reconstruction error is in the same shape as the original image. To make it into a single number for future classification, the standard deviation was taken. Then the absolute value was taken so that values are positive.</em></p><p>For a more modern approach to defect and anomaly detection:</p><p><a href="https://medium.com/@ryan.ar/anomaly-detection-in-manufacturing-taking-different-approach-to-training-2e87c0cb4b0c">Anomaly Detection in Manufacturing: Taking a Different Approach to Training</a></p><p>For a list of related articles on manufacturing:</p><p><a href="https://medium.com/@ryan.ar/list/135737473e52">ML / AI in Manufacturing</a></p><h3>Conclusion</h3><p>An autoencoder can be a useful tool in detecting defects in images, especially if the dataset mostly contains images of non-defective parts. Here we trained an autoencoder to reproduce an image of a good part. Images of defective parts sent through the autoencoder produced a reconstruction error. The reconstruction image was subtracted from the original image to produce a reconstruction error. Summarizing the reconstruction error into a single number provided a means of separating good and bad parts, which allows for future classification.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06d534745ecc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rethinking the Value of Running Services on the IoT Edge]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ryan.ar/rethinking-the-value-of-running-services-on-the-iot-edge-cb695c264aaf?source=rss-42a70443ad4f------2"><img src="https://cdn-images-1.medium.com/max/2600/0*6Manoa4JGFA-RSs9" width="6000"></a></p><p class="medium-feed-snippet">A special case that forced me to use a Raspberry Pi to run a service. It made me rethink the value an edge device has.</p><p class="medium-feed-link"><a href="https://medium.com/@ryan.ar/rethinking-the-value-of-running-services-on-the-iot-edge-cb695c264aaf?source=rss-42a70443ad4f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ryan.ar/rethinking-the-value-of-running-services-on-the-iot-edge-cb695c264aaf?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb695c264aaf</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[edge-computing]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Wed, 03 Sep 2025 23:44:34 GMT</pubDate>
            <atom:updated>2025-09-07T18:00:19.195Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Exploring the Practical Use of ML in Manufacturing]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ryan.ar/exploring-the-practical-use-of-ml-in-manufacturing-14bc571b3858?source=rss-42a70443ad4f------2"><img src="https://cdn-images-1.medium.com/max/2600/0*OJQvc4Z2ohbdd-mi" width="4745"></a></p><p class="medium-feed-snippet">Looking at the case for using machine learning in manufacturing environments.</p><p class="medium-feed-link"><a href="https://medium.com/@ryan.ar/exploring-the-practical-use-of-ml-in-manufacturing-14bc571b3858?source=rss-42a70443ad4f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ryan.ar/exploring-the-practical-use-of-ml-in-manufacturing-14bc571b3858?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/14bc571b3858</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[manufacturing]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Mon, 25 Aug 2025 15:41:29 GMT</pubDate>
            <atom:updated>2025-08-25T20:47:13.162Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The First Learning Algorithms: Adaptive Filters]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://aiadvances.org/the-first-learning-algorithms-adaptive-filters-f1fe9e0d0d61?source=rss-42a70443ad4f------2"><img src="https://cdn-images-1.medium.com/max/1920/1*mdN8lIguPggesu-4ISa04A.png" width="1920"></a></p><p class="medium-feed-snippet">A brief history lesson on machine learning origins that proved to be a useful learning exercise.</p><p class="medium-feed-link"><a href="https://aiadvances.org/the-first-learning-algorithms-adaptive-filters-f1fe9e0d0d61?source=rss-42a70443ad4f------2">Continue reading on AI Advances »</a></p></div>]]></description>
            <link>https://aiadvances.org/the-first-learning-algorithms-adaptive-filters-f1fe9e0d0d61?source=rss-42a70443ad4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1fe9e0d0d61</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Ryan Revilla]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 16:49:10 GMT</pubDate>
            <atom:updated>2025-08-05T16:49:10.991Z</atom:updated>
        </item>
    </channel>
</rss>