<?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 Aliaksei Petsiuk on Medium]]></title>
        <description><![CDATA[Stories by Aliaksei Petsiuk on Medium]]></description>
        <link>https://medium.com/@apetsiuk?source=rss-34490aee8142------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g6dDx8V5B6Ev0zKU440FpA.jpeg</url>
            <title>Stories by Aliaksei Petsiuk on Medium</title>
            <link>https://medium.com/@apetsiuk?source=rss-34490aee8142------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:43:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@apetsiuk/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[Stanford Bunny: Voronoi Mesh]]></title>
            <link>https://medium.com/@apetsiuk/stanford-bunny-voronoi-mesh-apetsiuk-52a7993b5a0a?source=rss-34490aee8142------2</link>
            <guid isPermaLink="false">https://medium.com/p/52a7993b5a0a</guid>
            <category><![CDATA[3d-printing]]></category>
            <category><![CDATA[concept]]></category>
            <category><![CDATA[3d-modeling]]></category>
            <category><![CDATA[generative-art]]></category>
            <category><![CDATA[blender]]></category>
            <dc:creator><![CDATA[Aliaksei Petsiuk]]></dc:creator>
            <pubDate>Fri, 21 Aug 2026 22:13:17 GMT</pubDate>
            <atom:updated>2026-08-21T22:13:17.144Z</atom:updated>
            <content:encoded><![CDATA[<h4>Procedural design from sketch to fabrication</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXkg6j_MFZqQ3pV8obsb1w.png" /><figcaption>Finding an idea for a futuristic shape based on the <a href="https://graphics.stanford.edu/data/3Dscanrep/">Stanford Bunny</a> model</figcaption></figure><p>Let’s take a look at a procedural design approach that goes from sketch to digital fabrication — 3D printing. We’ll be transforming the iconic <a href="https://graphics.stanford.edu/data/3Dscanrep/"><strong>Stanford Bunny</strong></a> into a futuristic, multi-layered sculpture using <a href="https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/index.html"><strong>Geometry Nodes</strong></a> in <a href="https://www.blender.org/"><strong>Blender</strong></a>, moving from a pencil sketch to a multi-material 3D print.</p><p>Scanned in <strong>1994</strong> by <a href="https://engineering.stanford.edu/news/tale-ubiquitous-stanford-bunny"><strong>Greg Turk</strong> and <strong>Marc Levoy</strong></a> at <strong>Stanford University</strong>, the <strong>Stanford Bunny</strong> was one of the first high-quality 3D scans available to researchers. Since then, it has become a popular geometric shape for testing algorithms and computational methods that rely on spatial mesh structure.</p><p>Beyond the considerable computational power hidden inside Blender’s Geometry Nodes, working with them is also great brain training — it boosts your imagination and spatial thinking, and helps you better understand computer graphics.</p><h3>Sketch</h3><p>This example started with an old sketch, in which I explored a few ideas around the famous bunny model. The main “Voronoi” concept felt very organic yet technological — I liked it. The color combination felt nice too.</p><blockquote>In mathematics, a <a href="https://en.wikipedia.org/wiki/Voronoi_diagram">Voronoi diagram</a> is a partition of a plane into regions, each grouped around one specific point. In design, it evokes patterns like organic cell structures or cracked, dried mud, and it’s also strongly reminiscent of sci-fi technology.</blockquote><p>That’s how the 3D model concept came together. The bunny would consist of <strong>three distinct layers</strong>:</p><ol><li>🍏<strong> The Inner Core (Green):</strong> a version of the bunny reduced in both size and polygon count, “glowing with an internal energy.”</li><li>🔲 <strong>The Reinforcement (Black):</strong> a thin, structural wireframe “holding the green energetic core.”</li><li>⚪️ <strong>The Protective Shields (White):</strong> translucent protective plates inspired by eggshells or ceramic thermal insulation tiles.</li></ol><h3>Model</h3><p>With the conceptual idea ready, I imported the original Stanford Bunny model into Blender and decimated it into a low-poly base geometry to use as the input structure. Here’s a step-by-step breakdown of my procedural logic (all steps are illustrated in the figure below):</p><ol><li><strong>Mesh processing:</strong> convert the source mesh into hexagonal shapes, then subdivide.</li><li><strong>Selective separation:</strong> using a wave texture as a mask, we mark which polygons should “grow” shields and which should leave the reinforcement exposed, based on the source mesh.</li><li><strong>Reinforcement wireframe:</strong> scale and extrude faces to create the profile of a futuristic mesh cage.</li><li><strong>Extrusion &amp; solidify:</strong> give the white plates thickness and slightly offset them from the body to create depth.</li><li><strong>Synchronization:</strong> adjust the scale of the inner core so it fits perfectly inside the outer shells.</li><li><strong>Materials:</strong> set up materials for visualization and rendering.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jlPZrH4Ctr4dl6Yo8lueJw.png" /><figcaption>Blender Geometry Nodes used for the complete procedural, parametrized modeling of the Voronoi bunny, based on a low-poly Stanford Bunny mesh</figcaption></figure><p>The cell-like pattern actually comes from combining a <em>Dual Mesh</em> node — which generates the hexagonal polygons — with a <em>Wave Texture</em> node used as the selection mask. Here is the final result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BR2U5AtSK1jQ5NmQfymRPw.png" /><figcaption>Model transformation from a low-poly single object to a multi-layered futuristic structure</figcaption></figure><p>The real power of procedural modeling comes into play when you vary the input parameters and generate a different model every time, without remodeling the whole structure. I can also swap the initial low-poly bunny source for any other shape and instantly get a completely new model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NCS0FTZwlP_10IPVuihwUQ.png" /><figcaption>Applying the same geometry nodes to <a href="https://www.thingiverse.com/thing:1519139">shell</a>, <a href="https://www.thingiverse.com/thing:763622">benchy</a>, <a href="https://www.thingiverse.com/thing:937740/files">low poly fox</a>, <a href="https://www.thingiverse.com/thing:387266">nut and bolt</a>, and <a href="https://www.thingiverse.com/thing:9704">wrench</a></figcaption></figure><p>By gradually changing the procedural parameters over time, we can also create an animation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*c6FjzOgYz_p2kFXuQm8xNg.gif" /><figcaption>Varying procedural parameters over time</figcaption></figure><h3>Fabricate</h3><p>To bring this concept into the real world, I split the final model into three separate STL files and <strong>3D printed</strong> them in different colors. I used a <strong>Prusa</strong> <strong>MK3S</strong> printer paired with a <strong>Prusa MMU2S (Multi-Material Unit)</strong>, which let me print all three materials — the glowing core, the black struts, and the white shields — simultaneously, as a single, cohesive object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*ONb_BLTCcqDsCgVeCm8g4A.gif" /><figcaption>3D printing simulation (also done in Blender)</figcaption></figure><p>It’s a <strong>~24-hour print</strong> with single 0.4 mm nozzle, 0.20 mm layer height, PLA filament in three colors, 10 mm outer brim for bed adhesion, auto-generated grid supports, , aligned seam position, and a wipe tower with purge volumes ranging from 140–300 mm³ depending on the color transition — the MMU2S needs that range to fully flush the previous filament before switching.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S6_DmIGKWM4Ow5BTa7m0BQ.png" /><figcaption>Two Stanford Bunny models with varied procedural parameters</figcaption></figure><p>The result is a nice sci-fi 👽 tactile desktop decoration. The best part is that it’s completely personal and customizable — something that goes from your idea and <strong>sketchbook</strong> doodles all the way to a real <strong>physical object</strong>. It boosts your <strong>imagination</strong> even more than before :)</p><h4>Useful Links</h4><ul><li><a href="https://github.com/apetsiuk/Blender-Materials-Compositing-GeometryNodes">Blender Materials &amp; Geometry Nodes Compositing</a> — a collection of procedural material presets and Geometry Nodes references.</li><li><a href="https://www.printables.com/model/1661824-stanford-bunny-cosmic-voronoi-easter">Stanford Bunny: Cosmic Voronoi Easter</a> — download the printable STL files on Printables.</li></ul><h3>Thoughts for future enhancement</h3><p>The small 3D-printed sculpture is great as it is, but we can go further. Just a few ideas on how to possibly modify it in the future:</p><ul><li>Add LEDs inside to convert it into a night lamp.</li><li>Replace the inner core with a fertilized substrate for growing plants (like grass or moss).</li><li>Keep playing with the input parameters to generate various interesting shapes with minimal input.</li></ul><p>Thanks for reading! 💚 Let me know in the comments what you think about the design and concept. I’d also love to hear about any similar projects or experiences of your own.</p><p>Cheers!<br>Aliaksei</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52a7993b5a0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graph-based toolpath optimization in multi-material 3D printing]]></title>
            <link>https://medium.com/@apetsiuk/graph-based-toolpath-optimization-in-multi-material-3d-printing-c5fc936f6269?source=rss-34490aee8142------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5fc936f6269</guid>
            <category><![CDATA[manufacturing]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[additive-manufacturing]]></category>
            <category><![CDATA[3d-printing]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Aliaksei Petsiuk]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 19:16:59 GMT</pubDate>
            <atom:updated>2026-03-11T21:04:09.091Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6aalE7L-_sjenuhPxPMTbQ.png" /></figure><h4>Introduction to Tool Change Optimization</h4><p>Hello, everyone! In our ongoing exploration of <strong>multi-material 3D printing,</strong> we are focusing on improving slicing and fabrication methods to reduce the number of <strong>tool changes</strong> using <strong>graph traversal</strong> optimization of individual material regions.</p><p>As demonstrated in our previous <a href="https://www.youtube.com/watch?v=RipTRgQQOnU">work</a> (figure below), the developed <strong>layer batching</strong> method provides a substantial reduction in material consumption and print time for multi-color 3D printing by significantly decreasing wipe tower fabrication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9VHuiXhhogew6cuRniZ50Q.png" /><figcaption>Example of previously developed layer batching in multi-color 3D printing. The results show this method can significantly increase efficiency (material usage, print time, and energy consumption) by reducing the number of tool changes, or material transitions.</figcaption></figure><p>The updated slicing and fabrication technique presented here is a <strong>tool-change reduction</strong> strategy for multi-color, or multi-material, 3D printing designed for <strong>single-nozzle systems.</strong> It minimizes tool changes by considering:</p><ol><li>The layer height;</li><li>The maximum allowable layer batch size;</li><li>Intersections with lower layer regions.</li></ol><p>This method utilizes the internal tools of the well-known <a href="https://slic3r.org/"><strong>Slic3r</strong></a> library and is compatible with modern Slic3r-based software, such as <a href="https://github.com/prusa3d/PrusaSlicer"><strong>PrusaSlicer</strong></a><strong>, </strong><a href="https://github.com/OrcaSlicer/OrcaSlicer"><strong>OrcaSlicer</strong></a><strong>, and </strong><a href="https://github.com/bambulab/BambuStudio"><strong>Bambu Studio</strong></a><strong>.</strong></p><h4>Multi-Color 3D printing</h4><p>Those familiar with multi-color 3D printing know that a significant portion of fabrication time is consumed by forming the <a href="https://help.prusa3d.com/article/wipe-tower_125010"><strong>wipe tower</strong></a><strong>.</strong> This is due to frequent <strong>material changes</strong> within almost every layer and the physical limitations of using a single extrusion tool (the nozzle).</p><p>For each color transition within a layer, the material must be switched, requiring the 3D printer to purge the new material through the same nozzle. Each purging segment takes time and contributes to the wipe tower’s volume. When a layer is partially fabricated, the new material is purged and the process repeats until the layer — and eventually the part — is complete.</p><p>If we look closely at a slice of a multi-material model in PrusaSlicer, as shown in the figure below, we can see that each color region is an independent G-code segment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ABKSxBGqToya8Hum609jHQ.png" /><figcaption>During conventional layer-wise slicing, each material region within each layer represents an individual G-code segment. This suggests that a proper graph traversal algorithm can fabricate multiple regions of the same color across several layers before returning to a lower layer to continue with another color/material.</figcaption></figure><p>This brings us to a fundamental question:</p><blockquote><strong>Can we reduce tool changes by moving away from the traditional layer-wise concept toward independent interlayer fabrication of color regions?</strong></blockquote><p>In other words, can we consider the model not as a set of layers, but as a set of individual color regions? We can then attempt to fabricate the part by traversing these regions with minimal color changes — similar to minimizing distance in the famous <a href="https://en.wikipedia.org/wiki/Travelling_salesman_problem"><strong>“Traveling Salesman” problem</strong></a>.</p><h4>Slicing Process Under the Hood</h4><p>The short answer is yes: we can represent the model as a <strong>dependency graph</strong> of material regions and traverse it efficiently.</p><p>Let’s first look at the slicing process itself.</p><p>Initially, the STL model is divided into a series of layers. Each layer is then subdivided into constituent color (or material) regions, and a G-code piece is generated for every region. Subsequently, an internal tool-ordering procedure determines the sequence in which these pieces are fabricated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*myNQ8rBN6mEd4_XMgRThWA.png" /><figcaption>The slicing process “under the hood” for the most popular 3D printing slicers whose work is based on the Slic3r library.</figcaption></figure><p>In this context, the concept of the “layer” remains important for preserving vertical structural information, particularly for the placement of supports. However, since support layers can be printed in any color, we don’t need to worry about material consistency there. By optimizing the tool ordering of these individual regions, we can substantially decrease the number of tool changes and, consequently, the size of the wipe tower.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BZZWbKrW9Y_sTUNMsUtNDA.png" /><figcaption>Slicing process optimization: the tool ordering optimization process can significantly reduce the size of the wipe tower.</figcaption></figure><h4>Step-by-Step Explanation: An Example</h4><p>Let’s look at our sample model, segmented into layers and color regions. This shows how the original 3D model is transformed into a dependency graph for future traversal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnYSzUix1dGOsxkXLE6bmg.png" /><figcaption>Introducing a node notation for the multi-color 3D model: each color region of each laeyr is a node on the future dependency graph.</figcaption></figure><p>Our model consists of 13 layers and 5 colors. This information is used to segment each layer into separate color regions. We use a node notation where each region is an individual node: <strong>L<em>x</em>​R<em>y</em>,</strong> where <strong>L</strong> is the layer number and <strong>R</strong> is the region number. For example, Layer 7, Region 0 (purple color) is denoted as node <strong>L7R0, </strong>and<strong> </strong>Layer 7, Region 1 (white color) is denoted as node <strong>L7R1</strong>.</p><p>In a conventional slicing/fabrication process, the printer’s toolhead might move from region 0 to region 1, then to region 3 within the same layer. With a single-nozzle system, every transition requires a filament (material) change. In a standard PrusaSlicer configuration, this specific model would typically require <strong>28 tool changes </strong>(material transitions). By using the layer batching technique, we can print multiple regions of the same color across several layers before switching, significantly reducing material transitions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wGftLaj3vFJiJnZ8oOojog.png" /><figcaption>Node notation provides a fabrication map, allowing us to queue color regions for fabrication.</figcaption></figure><h4>Dependency Graph</h4><p>To achieve this, we represent the model as a graph. In PrusaSlicer, for example, we extract the X/Y location, Z-height, area, and perimeter for every color region. Most importantly, we calculate the <strong>intersection</strong> with all color regions on the layer below. This tells us if a region can be printed immediately or if we must finish a region below it first to maintain structural integrity.</p><p>In our dependency graph, a node (color region) can only be fabricated once all its underlying connections (edges) are completed. The figure below shows how the color region depend on each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZADOzgykAtTo9iH_ulxSw.png" /><figcaption>In the presented model table, which can be generated directly in PrusaSlicer, we track the layer and region numbers, where the region number corresponds to the tool (or filament color or material). Columns marked with asterisks indicate intersections with regions located directly one layer below. This allows us to produce egdes on the graph, illustrating the fabrication dependency between each color region.</figcaption></figure><h4>Traditional vs. Batched Slicing</h4><p>Traditional 3D printing proceeds layer-by-layer, resulting in many tool changes within each layer. Batched slicing, however, allows us to process individual nodes independently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1EqqgObRNE7d5qpP57ln0A.png" /><figcaption>In regular (conventional) slicing and then 3D printing, we proceed layer by layer, changing tools multiple times within each layer. Optimization in this “zig-zag” approach is mostly limited between successive layers: a new layer tends to start with the same material as the last region of the previous layer, thereby minimizing a single tool change. However, a significant number of tool changes remain within the layers themselves.</figcaption></figure><p>In this example, we use a <strong>three-layer batch</strong>. If we start with the purple color, we fabricate three purple regions (L0R0, L1R0, L2R0) consecutively. Then we return to layer L0 to print the white regions. At each step, we analyze whether it is physically possible to continue a color on an upper layer or if an intersection requires us to switch. This approach reduces the total tool changes to <strong>15</strong> — almost halving the traditional wipe tower size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zrzb44inXaLQ8UMh8XEuhA.png" /><figcaption>Layer batched slicing: if the number of layers in a batch exceeds the set limit, or if it is physically impossible to fabricate the next region due to an intersection, the algorithm makes a “random jump” to another available color and continues the process.</figcaption></figure><p>To visualize this, we can represent the fabrication order, or <strong>“printing map,”</strong> by changing the colors of each fabricated batch. This allows us to see the movement through nodes to complete the entire model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*76mb7CXaIkrpc-VdBwqQRw.png" /><figcaption>Visualization of batched fabrication.</figcaption></figure><p>In batch number 3 then (yellow regions from L0R3 to L3R3), we fabricate the same yellow material over four layers, since the maximum layer distance (batch) between L3R3 and the remaining unfinished region L1R2 remains within the maximum layer batch range of three layers. When we jump to region L3R0 later, we only fabricate the purple material up to region L4R0, because it is impossible to continue fabrication to region L5R0 without finishing the intersecting region L4R1 first.</p><p>The animation below illustrates the differences in the fabrication process between regular and batched fabrication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*1BJlShAb8zF1UiQQo7sa5Q.gif" /><figcaption>Regular vs. Batched Fabrication.</figcaption></figure><h4>Optimization and “Random Jumps”</h4><p>A key part of this algorithm is the concept of <strong>random jumps</strong>. Once a batch is finished, there are often multiple available regions to print next. For example, if we start with the purple region L0R0 and fabricate purple material up to region L2R0, we can then switch to regions L0R1 or L0R3, as both options are possible. We analyze the potential regions for jumping and then randomly choose one of them. The same procedure happens after each batch. This allows us to generate numerous <strong>alternative print paths</strong> for the same model. We can then vary the batch size (<strong>B</strong>) and the starting color region to find the best result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t7kl5bZOBowUzooS" /><figcaption>Alternative fabrication paths based on batch size, starting nodes, and random jumps.</figcaption></figure><p>Once a batch is completed, we can jump to any other available region below. For instance, after finishing region 0 (three layers of region 0 in the first image on the left, for example), we can move to region 1 or 3, but not to region 2 if its dependent nodes are not yet complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OLXnu-SR14_kW9B2" /><figcaption>Well, we can generate more unique fabrication paths…</figcaption></figure><p>By performing <strong>9,000 iterations</strong> (varying the batch size <strong>B</strong> and the starting node), we can find the most efficient fabrication path with the minimum number of tool changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JIwunerJI0T6kaOEaiQSxw.png" /><figcaption>Tool change distribution over 9,000 iterations (1,000 for each combination of batch parameter and starting node). While the standard Slic3r-based approach would result in 28 tool changes, our iterations show varying distributions — all of which are lower than 28.</figcaption></figure><p>While the standard Slic3r-based approach results in 28 tool changes, our iterations show varying distributions — all of which are lower than 28. This allows us to compare the best and worst paths across all iterations to choose the most optimal fabrication sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yvUAizvXD1rCQ_qs" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q1u9p-2CUUUW0arc" /><figcaption>Best fabrication paths for various initial conditions (batch size and starting node).</figcaption></figure><h4>Drawbacks and Considerations</h4><p>It is important to acknowledge, though, the potential for minor <strong>aesthetic defects.</strong> When the hot nozzle returns to print new material next to a previously printed batch, its physical size may cause slight <strong>“wavy” patterns</strong> or surface marks. However, in most cases, these areas are internal or located deeper in the model, making them <strong>invisible</strong> in the final part.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B07zD4JZ647rBV9rTjhIaQ.png" /><figcaption>Inevitable damage caused by the hot nozzle contacting previously fabricated regions, which may lead to minor aesthetics defects.</figcaption></figure><p>For example, if we increase the batch number to six (six layers of the same color are printed consecutively before switching to another batch), a wavy pattern may appear on the yellow part. Yet, this pattern is not visible on the purple section because it is located deeper in the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zbPHRVV_OW7gXEZKdqf5Tw.png" /><figcaption>Appearance of a wavy pattern at higher batch numbers. Reducing the size of the nozzle can minimize this effect.</figcaption></figure><p>Here are a few more cases to support this statement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cKLrJP4fbkpZzfRHsL7giw.png" /><figcaption>Minor aesthetics defects caused by layer batching fabrication.</figcaption></figure><p>Thus, the transition from traditional layer-by-layer 3D printing to the sequential fabrication of individual color regions across multiple layers (batched fabrication) allows for a significant reduction in material changes while maintaining acceptable manufacturing standards.</p><h4>🔗 Additional resources</h4><ul><li><em>YouTube videos: </em><a href="https://www.youtube.com/watch?v=RipTRgQQOnU"><em>part one</em></a><em> and </em><a href="https://www.youtube.com/watch?v=futRklE9CD8"><em>part two</em></a><em>.</em></li><li><em>Follow the development on </em><a href="https://github.com/apetsiuk/PrusaSlicer"><em>GitHub</em></a><em>.</em></li><li><em>Related academic paper in </em><a href="https://doi.org/10.1108/RPJ-01-2024-0050"><em>Rapid Prototyping Journal</em></a><em> (</em><a href="http://dx.doi.org/10.2139/ssrn.4655383"><em>open access version</em></a><em>).</em></li></ul><h4>Thank you for reading! Choose the right fabrication paths. 🙌</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5fc936f6269" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Math & Code: A Simple Tutorial for Procedural Abstract Illustration in Python]]></title>
            <link>https://medium.com/@apetsiuk/math-code-a-simple-tutorial-for-procedural-abstract-illustration-in-python-174405c2472e?source=rss-34490aee8142------2</link>
            <guid isPermaLink="false">https://medium.com/p/174405c2472e</guid>
            <category><![CDATA[graphics-programming]]></category>
            <category><![CDATA[python-art]]></category>
            <category><![CDATA[procedural-design]]></category>
            <category><![CDATA[procedural-art]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Aliaksei Petsiuk]]></dc:creator>
            <pubDate>Sun, 21 Dec 2025 02:12:29 GMT</pubDate>
            <atom:updated>2025-12-21T02:12:29.857Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWRNeQJw5zNqZFMzeAM1og.png" /></figure><p>Simple procedural graphics may not be as powerful as AI-based generative design systems. However, it can demonstrate the mathematics underlying spatial forms, as well as the stochastic processes that drive natural structures and physical effects.</p><p>At its core, procedural art rules that every pixel (or visual element) is modified according to a pre-defined set of algorithmic procedures based on its attributes and position on the digital canvas. Perhaps the most direct real-world application of this behavior is shading in video games and real-time graphics. A dedicated language, such as GLSL, controls the GPU to determine visual effects, colors, lighting, and textures. <a href="https://thebookofshaders.com/"><strong>The Book of Shaders</strong></a> by Patricio Gonzalez Vivo and Jen Lowe clearly demonstrates this visual mechanics for creative coders.</p><p>The accessibility of procedural drawing received a significant boost with the emergence of software sketchbooks like <a href="https://processing.org/"><strong>Processing</strong></a><strong> </strong>and<strong> </strong><a href="https://p5js.org/"><strong>p5.js</strong></a>. These platforms lowered the barrier to entry for code learners and artists. Here, Bohnacker, Groß, and Laub’s <a href="https://benedikt-gross.de/projects/generative-gestaltung-the-book/"><strong>Generative Design: Visualize, Program, and Create</strong></a> gives a lot of inspiration by revealing the potential held within algorithmic control of colors and shapes.</p><p>Concurrently, the popularity of procedural drawings has been substantially driven by the <a href="https://www.generativehut.com/"><strong>Pen plot art</strong></a> movement. Here, artists merge digital code with physical art by using <a href="https://all3dp.com/2/pen-plotters-best-xy-plotters/"><strong>G-code pen plotters</strong></a> to create precise and complex lines. This movement explores algorithmic patterns and texture through various media, creating a tangible link between digital concept and material output. Tools like <a href="https://github.com/abey79/vsketch"><strong>Vsketch</strong></a> by Antoine Beyeler offer a Python-based generative art toolkit, drawing direct inspiration from Processing and optimized for physical plotting.</p><p>Beyond these environments, there are many independent projects, including Python procedural art GitHub repositories such as <a href="https://renatobudinich.com/create-random-images-with-randimage/"><strong>randimage</strong></a> by Renato Budinich, <a href="https://github.com/timpyrkov/procedural-art"><strong>procedural-art</strong></a> by Tim Pyrkov, and <a href="https://github.com/JakobGlock/Generative-Art"><strong>generative-art</strong></a> by Jakob Glock. Further inspiration can be found in projects like <a href="https://inconvergent.net/"><strong>Inconvergent</strong></a> by Anders Hoff, or a valuable set of articles related to visual and acoustic generative art written by <a href="https://medium.com/@_stc"><strong>Agoston Nagy</strong></a>.</p><p>Finally, for interactive and audio-visual solutions, node-based visual programming systems like <a href="https://derivative.ca/"><strong>Touchdesigner</strong></a> and <a href="https://cables.gl/"><strong>Cables</strong></a> are frequently used to combine animation, sound, and real-time interaction into compelling generative art projects.</p><p>Well, a proper literature review on procedural drawing and generative art is beyond the scope of this article. However, I encourage you to share any inspiring resources or great examples you know in the comments below.</p><h3>Procedural Abstract Illustration in Python</h3><p>Now that we have covered a bit of the procedural drawing background, let’s dive into the tutorial. This is a great “brain gymnastic” exercise that touches on random distributions, coordinate geometry, and 3D-to-2D projection. The project draws its aesthetic inspiration from the vintage <a href="https://en.wikipedia.org/wiki/Asteroids_(video_game)"><strong>Asteroids</strong></a> game by Atari.</p><blockquote><strong>TL;DR:</strong> The complete source code for this procedural engine is available at <a href="https://github.com/apetsiuk/Procedural-Drawing-in-Python"><strong>github.com/apetsiuk/Procedural-Drawing-in-Python</strong></a><strong>.</strong> While you can run the script immediately to see the results, this article serves as a deep-dive reference into the “how” and “why.”</blockquote><h4>Establishing the Composition</h4><p>In procedural art, every pixel follows a behavioral pattern defined by code. By setting specific rules and mathematical functions while allowing for a controlled range of random values, we can create visuals that are complex, captivating, and slightly different every time the script is run.</p><p>In this project we are creating a multi-layered composition as shown in the image below.</p><ol><li><strong>Base:</strong> a square canvas with a grainy paper-like texture.</li><li><strong>Texture:</strong> a series of dynamic parabolic lines to suggest movement.</li><li><strong>Focal point:</strong> a central, random pixelated color gradient.</li><li><strong>Main “character”:</strong> a 3D-projected polygonal mesh featuring variable line thickness and an anaglyph effect for depth.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TRotDXZZQyyBHIqpFLflgQ.png" /><figcaption><strong>Stages of composition creation.</strong> From left to right: 1) — the initial blank canvas, on which the main object will later be placed in the center of the frame; 2) — noise and lines are added for texture and dynamics; 3) — the main area with the color gradient is in place in the center of the frame; 4) — a polygonal mesh with variable line thickness has been added, and an anaglyph aura creates a shimmering depth effect.</figcaption></figure><h4>Generating the Digital Canvas</h4><p>Our first step is to create the stage. We will use the <strong>Python Imaging Library (PIL)</strong> for rendering and <strong>NumPy</strong> for efficient pixel-array operations. To handle the more complex tasks, we’ll use <strong>OpenCV</strong> for image blending and <strong>SciPy’s ConvexHull</strong> module for our geometric centerpiece. The <strong>random</strong> library in Python will be performing heavy lifting for us in generating arbitrary values.</p><p>To give the background character, we introduce Gaussian noise. This creates an “organic” paper-like effect — a subtle, grainy texture that breaks the perfection of an empty digital background.</p><pre>import numpy as np<br>from PIL import Image, ImageDraw, ImageChops<br>import cv2<br>import matplotlib.pyplot as plt<br>import random<br>from random import randint, getrandbits<br>from scipy.spatial import ConvexHull<br><br><br>def generate_canvas(h,w,hframe,wframe,bg_color,mean,var,k):<br>    &quot;&quot;&quot;<br>    Generates a grainy background canvas with a specified frame.<br>    &quot;&quot;&quot;<br>    # Create the total canvas size (core + frame on all sides)<br>    canvas = bg_color*np.ones((h+hframe*2,w+wframe*2,3),dtype=np.uint8)<br>    # Add texture (Gaussian noise)<br>    canvas_with_noise = add_canvas_noise(canvas,mean,var,k)<br>    # Convert to grayscale to maintain the aesthetic<br>    canvas_grayscale = convert_to_gray(canvas_with_noise)<br>    return Image.fromarray(canvas_grayscale)<br><br><br>def convert_to_gray(img_rgb):<br>    &quot;&quot;&quot;<br>    Converts an RGB image to grayscale using the weighted luminosity formula:<br>    Y = 0.2989*R + 0.5870*G + 0.1140*B<br>    &quot;&quot;&quot;<br>    img_gray = np.zeros(img_rgb.shape,dtype=np.uint8)<br>    img_gray[:,:,0] = 0.2989*img_rgb[:,:,0]+\<br>                      0.5870*img_rgb[:,:,1]+\<br>                      0.1140*img_rgb[:,:,2]<br>    img_gray[:,:,1] = img_gray[:,:,0]<br>    img_gray[:,:,2] = img_gray[:,:,0]<br>    return img_gray<br><br><br>def add_canvas_noise(image,mean,var,k):<br>    &quot;&quot;&quot;<br>    Applies Gaussian noise to simulate a grainy, paper-like texture.<br>    &quot;&quot;&quot;<br>    row,col,ch= image.shape<br>    mean = mean<br>    var = 0.4<br>    sigma = var**0.5<br>    gauss = np.random.normal(mean,sigma,(row,col,ch))<br>    gauss = gauss.reshape(row,col,ch)<br>    noisy = image + k*gauss-2<br>    return np.uint8(noisy)<br><br><br>im = generate_canvas(h=150,w=150,hframe=40,wframe=40,<br>                     bg_color=255,mean=0,var=0.4,k=2)<br>plt.imshow(im)</pre><p>For this tutorial, our canvas is 230x230 pixels in size. This includes a 150x150 central area surrounded by a 40-pixel frame (Figure below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*NrZ0ltFOiczwC5Op76JoNw.png" /><figcaption><strong>Initial canvas with a paper-like texture.</strong> Left) — canvas for the future drawing; Right) — indication of dimensions: the gray square in the middle indicates the boundaries of the future drawing.</figcaption></figure><p>While you can vary the grayscale intensity or rescale the image, we will stick to this pixelated, low-fi style — it gives the final piece a cool, tactile aesthetic. Generating background noise with different parameters allows you to achieve the desired picture style (Figure below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ytGKRZQ-MyJIc2PFIqoag.png" /><figcaption><strong>Various examples of canvases with different input parameters.</strong> Generating background noise with different parameters allows you to achieve the desired picture style.</figcaption></figure><h4>Drawing Dynamic Parabolas</h4><p>To add a sense of motion and energy, we will overlay “swiping” parabolic lines. By drawing a series of these curves with slight variations in orientation, we create a rhythmic, dynamic visual field.</p><p>Mathematically, a parabola follows the quadratic form: <strong><em>y = Ax² + Bx + C</em></strong><em>. </em>To place these on our canvas, we randomly select three <em>(x, y)</em> coordinates. By ensuring the first and third points lie outside the canvas boundaries, we force the curves to sweep entirely across the frame. We then solve the system of equations to find the specific <em>A, B,</em> and <em>C</em> coefficients for that curve.</p><pre>def add_curved_lines(im_width,im_height,no_of_lines,point_1,point_2,point_3):<br>    &quot;&quot;&quot;<br>    Calculates a family of parabolic curves based on three control points.<br>    Returns the lists of x- and y-coordinate arrays for each generated line.<br>    &quot;&quot;&quot;<br>    # Fits a quadratic equation y = Ax^2 + Bx + C through three points<br>    x1,y1 = point_1[0], point_1[1]<br>    x2,y2 = point_2[0], point_2[1]<br>    x3,y3 = point_3[0], point_3[1]<br><br>    # Calculate the parabola vertex using Cramer&#39;s rule<br>    denom = (x1-x2)*(x1-x3)*(x2-x3);<br>    a = (x3*(y2-y1)+x2*(y1-y3)+x1*(y3-y2))/denom;<br>    b = (x3*x3*(y1-y2)+x2*x2*(y3-y1)+x1*x1*(y2-y3))/denom;<br>    c = (x2*x3*(x2-x3)*y1+x3*x1*(x3-x1)*y2+x1*x2*(x1-x2)*y3)/denom;<br><br>    # Generates a set of coordinates for a &#39;family&#39; of parabolas.<br>    aa = np.linspace(a,a+a*0.7,num=no_of_lines)<br>    bb = np.linspace(b,b+b*0.8,num=no_of_lines)<br>    cc = np.linspace(c,c+c*1.5,num=no_of_lines)<br><br>    all_Xs = []<br>    all_Ys = []<br><br>    x_pos=np.arange(0,im_width*2,1)<br>    for i in range(no_of_lines):<br>        y_pos=[]<br>        for x in range(len(x_pos)):<br>            x_val=x_pos[x]<br>            y=((i/15)*aa[i]*(x_val**2))+(bb[i]*x_val)+cc[i]*(1+i/20)<br>            y_pos.append(y)<br>        all_Xs.append(x_pos)<br>        all_Ys.append(y_pos)<br>    return all_Xs, all_Ys<br><br><br>def generate_canvas(h,w,hframe,wframe,bg_color,mean,var,k,no_of_lines,line_color,point_1,point_2,point_3,line_widths):<br>    &quot;&quot;&quot;<br>    Orchestrates the creation of the textured, vector-line background.<br>    Returns the final textured PIL image with embedded vector curves.<br>    &quot;&quot;&quot;    <br>    # Create a blank grayscale canvas<br>    canvas = bg_color*np.ones((h+hframe*2,w+wframe*2,3),dtype=np.uint8)<br>    # Add noise<br>    canvas_with_noise = add_canvas_noise(canvas,mean,var,k)<br>    canvas_grayscale = convert_to_gray(canvas_with_noise)<br>    canvas_result = Image.fromarray(canvas_grayscale)<br>    draw_canvas = ImageDraw.Draw(canvas_result)<br><br>    # Add curved lines<br>    line_widths = list(np.linspace(line_widths[0], line_widths[1], no_of_lines))<br>    all_Xs,all_Ys = add_curved_lines(im_width=w,im_height=h,no_of_lines=no_of_lines,point_1=point_1,point_2=point_2,point_3=point_3)<br>    for i in range(len(all_Xs)):<br>        for j in range(len(all_Xs[0])-1):<br>            line_xy = ((int(all_Xs[i][j]),int(all_Ys[i][j])),(int(all_Xs[i][j+1]),int(all_Ys[i][j+1])))<br>            draw_canvas.line(line_xy,fill=(line_color,line_color,line_color),width=int(line_widths[i]))<br>    return canvas_result<br><br><br># Plot the result<br>fig = plt.figure(figsize=(18,12),dpi=80)<br>im = generate_canvas(h=150,w=150,hframe=40,wframe=40,<br>                     bg_color=255,mean=0,var=0.4,k=2,<br>                     no_of_lines=30,line_color=200,<br>                     point_1 =[random.randint(-60,-20),random.randint(-80,300)],<br>                     point_2 =[75,75],<br>                     point_3 =[random.randint(105,180),random.randint(-30,180)],<br>                     line_widths=[1,10])<br>plt.xticks([])<br>plt.yticks([])<br>plt.imshow(im)<br>plt.show()</pre><p>To create a series of lines rather than a single curve, the function iterates N times, interpolating the coefficients for each step. The i-th parabola is calculated using three transformations:</p><ul><li><strong>Curvature:</strong> Scaling the x² term to flatten or widen the curve.</li><li><strong>Tilt:</strong> Interpolating the x term to shift the vertex.</li><li><strong>Position:</strong> Vertically shifting the entire “stripe” to create spacing.</li></ul><p>The result is a background that feels dynamic, transforming a simple static frame into an interplay of sweeping curves and grainy texture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHNMSczJQIlFjj4IgZPT6A.png" /><figcaption><strong>Background with dynamic effect. </strong>A set of parabolic lines with different input parameters is drawn onto the canvas. Randomization allows for a unique image to be generated after each code run. You can vary the number, gray value and thickness of the lines.</figcaption></figure><h4>The Gradient Rectangle</h4><p>At the center of our canvas, we place a bright rectangular gradient. The code logic here is built on linear interpolation: for any given pixel, the color is a weighted average of two randomly selected “Start” and “Stop” colors based on its position. We also add a bit of noise. By using getrandbits(), we randomly decide if a color channel transitions horizontally or vertically, leading to multiple possible gradient variations.</p><pre>def add_picture_noise(image):<br>    &quot;&quot;&quot;<br>    Applies a multi-layered stochastic noise profile to an image.<br>    Returns a noisy image array, clipped and cast to np.uint8.<br>    &quot;&quot;&quot;<br>    # gauss<br>    row,col,ch= image.shape<br>    mean = 0<br>    var = 0.5<br>    sigma = var**0.5<br>    gauss = np.random.normal(mean,sigma,(row,col,ch))<br>    gauss = gauss.reshape(row,col,ch)<br>    noisy_gauss = image + 20*gauss-20<br><br>    # speckles<br>    speckle = np.random.randn(row,col,ch)<br>    speckle = speckle.reshape(row,col,ch)<br>    noisy_speckle = noisy_gauss + 0.2*noisy_gauss*speckle<br>    return np.uint8(noisy_speckle)<br><br><br>def generate_colored_area(h,w,border_alpha,border_size,color_start,color_stop,gradient_direction):<br>    &quot;&quot;&quot;<br>    Creates a textured rectangular region featuring a multi-directional color gradient.<br>    Returns a noisy, bordered gradient region (np.uint8).<br>    &quot;&quot;&quot;<br><br>  # Create a placeholder for the image region filled with color gradient<br>  fill = np.zeros((h,w,len(color_start)),dtype=float)<br><br>  # Fill the area with a color gradient<br>  for i,(start,stop,is_horizontal) in enumerate(zip(color_start,color_stop,gradient_direction)):<br>        if is_horizontal:<br>            fill[:,:,i] = np.tile(np.linspace(start,stop,w),(h,1))<br>        else:<br>            fill[:,:,i] = np.tile(np.linspace(start,stop,h),(w,1)).T<br>  fill = np.uint8(fill)<br><br>  # Add noise<br>  fill_with_noise = add_picture_noise(fill)<br><br>  # Create a darkened border<br>  black_pad = np.zeros(fill.shape,dtype=np.uint8)<br>  # create a placeholder for the final image<br>  final_result = np.zeros(fill.shape,dtype=np.uint8)<br><br>  # dst = alpha*src1 + beta*src2 +gamma<br>  alpha, beta, gamma = border_alpha, 1.0-border_alpha, 0.0<br>  final_result = cv2.addWeighted(fill_with_noise,alpha,black_pad,beta,gamma,final_result)<br>  final_result[border_size:-border_size,border_size:-border_size] = fill_with_noise[border_size:-border_size,border_size:-border_size]<br>  return final_result<br><br><br>fig = plt.figure(figsize=(10,8),dpi=80)<br>im = generate_colored_area(h=150,w=150,border_alpha=0.7,border_size=5,<br>                           color_start=(np.random.randint(0,255),    # red<br>                                        np.random.randint(0,255),    # green<br>                                        np.random.randint(0,255)),   # blue<br>                           color_stop=(np.random.randint(0,255),     # red<br>                                        np.random.randint(0,255),    # green<br>                                        np.random.randint(0,255)),   # blue<br>                           gradient_direction=(bool(getrandbits(1)), # red<br>                                               bool(getrandbits(1)), # green<br>                                               bool(getrandbits(1))) # blue<br>                           )<br>plt.xticks([])<br>plt.yticks([])<br>plt.imshow(im)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QiSoT-jXxCgrSTgbSCCHaQ.png" /><figcaption><strong>Various types of randomized gradients with or without noise and with different border parameters.</strong></figcaption></figure><p>Our generate_colored_area function is a utility that:</p><ol><li>Generates the randomized gradient.</li><li>Applies a secondary layer of noise for texture.</li><li>Adds a soft, darkened border to create a subtle “inner shadow” effect.</li></ol><p>This creates a striking focal point that feels recessed into the frame, adding an immediate sense of higher dimensionality. Now we can place the gradient area on the canvas:</p><pre>def generate_image(h,w,hframe,wframe,bg_color,mean,var,k,<br>                   no_of_lines,line_color,point_1,point_2,point_3,line_widths,<br>                   border_alpha,border_size,<br>                   color_start,color_stop,gradient_direction):<br>    &quot;&quot;&quot;<br>    The master orchestration function that composites the background and the central gradient area.<br>    Returns the complete, multi-layered composition (PIL.Image).<br>    &quot;&quot;&quot;<br>    # Generate a canvas and a colored area<br>    canvas = generate_canvas(h,w,hframe,wframe,bg_color,mean,var,k,no_of_lines,line_color,point_1,point_2,point_3,line_widths) # PIL<br>    colored_area = generate_colored_area(h,w,border_alpha,border_size,color_start,color_stop,gradient_direction) # nparray<br><br>    # Place the colored area on the canvas<br>    canvas_nparray = np.asarray(canvas).copy()<br>    canvas_nparray[hframe:-hframe,wframe:-wframe,:] = colored_area<br><br>    final_image = Image.fromarray(np.uint8(canvas_nparray))<br>    return final_image<br><br><br>fig = plt.figure(figsize=(12,12),dpi=80)<br>im = generate_image(h=150,w=150,hframe=40,wframe=40,<br>                    bg_color=205,mean=1,var=0.4,k=20,<br>                    no_of_lines=20,line_color=100,<br>                    point_1 =[random.randint(-60,-20),random.randint(-80,300)],<br>                    point_2 =[75,75],<br>                    point_3 =[random.randint(105,180),random.randint(-30,180)],<br>                    line_widths=[2,10],<br>                    border_alpha=0.7,border_size=5,<br>                    color_start=(np.random.randint(0,255),  # red<br>                                 np.random.randint(0,255),  # green<br>                                 np.random.randint(0,255)), # blue<br>                    color_stop=(np.random.randint(0,255),   # red<br>                                np.random.randint(0,255),   # green<br>                                np.random.randint(0,255)),  # blue<br>                    gradient_direction=(bool(getrandbits(1)), # red<br>                                        bool(getrandbits(1)), # green<br>                                        bool(getrandbits(1))) # blue<br>                    )<br>plt.xticks([])<br>plt.yticks([])<br>plt.imshow(im)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M5WrMb8muIvlT5suh_59rg.png" /><figcaption><strong>A raster canvas with a dynamic textured background and a colorful spotlight.</strong></figcaption></figure><h4>The Convex Hull Polygon</h4><p>While our background is intentionally grainy, we want our central geometric object to be crisp and smooth in order to feel structured and architectural. We achieve this by generating a <strong>Convex Hull</strong> — the smallest convex polygon that can enclose a set of randomly scattered <em>(x, y, z)</em> coordinates (a cloud of 3D points) — and plotting it on the canvas using the regular functions from the matplotlib library.</p><p>In our code, we generate three distinct clusters of points across the <em>X, Y,</em> and <em>Z</em> axes to ensure the resulting shape has enough complexity to look “designed” rather than purely random. We then wrap these points in a convex hull, the smallest convex polygon containing all the given points. For this, we use a special function from the scipy library:</p><pre># --- 1. Generate clustered 3D points ---<br>coordinates1 = np.random.randint(90,240, size=(1,7,3))<br>coordinates2 = np.random.randint(90,190, size=(1,7,3))<br>coordinates3 = np.random.randint(65,265, size=(1,7,3))<br>coordinates = np.vstack((coordinates1[0],coordinates2[0],coordinates3[0]))<br><br># --- 2. Compute the hull ---<br>hull = ConvexHull(coordinates)</pre><p>In 3D space, this becomes a faceted “mesh” composed of triangular faces called <strong>simplices</strong>. When we project this 3D object onto our 2D digital canvas, we lose the actual depth information. To bring that feeling of volume back, we use an artistic technique called <strong>Atmospheric Perspective</strong>. In traditional painting, objects closer to the viewer are sharper, darker, and have thicker outlines.</p><p>To implement this procedurally, we calculate the thickness of every edge based on its position along the Z-axis.<strong> </strong>The following code takes our 3D coordinates, computes the hull, and then iterates through every triangular face to draw the edges with depth-weighted parameters:</p><pre># --- 3. Define depth mapping parameters ---<br># Extract all Z values from the hull&#39;s vertices for the range calculation<br>Z_values = coordinates[hull.vertices, 2]<br>Z_MIN = Z_values.min()  # Actual minimum depth (closest)<br>Z_MAX = Z_values.max()  # Actual maximum depth (farthest)<br><br>W_MIN = 1        # Minimum pixel width (farthest lines)<br>W_MAX = 8        # Maximum pixel width (closest lines)<br>Z_range = Z_MAX - Z_MIN<br>W_range = W_MAX - W_MIN<br><br># --- 4. Plotting the 2D mesh projection with depth-weighted edges ---<br>fig = plt.figure(figsize=(12,8),dpi=80)<br>plt.imshow(255*np.ones((250+40*2,250+40*2,3),dtype=np.uint8))<br><br># A. Plot the vertices (optional, for reference)<br>hull_xy_vertices = coordinates[hull.vertices, :2]<br>#plt.scatter(hull_xy_vertices[:, 0], hull_xy_vertices[:, 1], c=&#39;red&#39;, marker=&#39;o&#39;, s=150)<br><br># B. Iterate over the hull&#39;s simplices to draw all its edges<br>for simplex_indices in hull.simplices:<br><br>    # Get the 3D coordinates for the 3 vertices of this face<br>    X_face = coordinates[simplex_indices, 0]<br>    Y_face = coordinates[simplex_indices, 1]<br>    Z_face = coordinates[simplex_indices, 2]<br><br>    # Define the three edges of the current triangle face using index pairs: (V1, V2), (V2, V3), (V3, V1)<br>    edge_indices = [(0, 1), (1, 2), (2, 0)]<br><br>    for i_start, i_end in edge_indices:<br><br>        # 1. Get coordinates for the current edge<br>        x1, y1, z1 = X_face[i_start], Y_face[i_start], Z_face[i_start]<br>        x2, y2, z2 = X_face[i_end], Y_face[i_end], Z_face[i_end]<br><br>        # 2. Calculate the average depth (Z) of the edge. <br>        # Every edge is defined by two vertices. To find the &quot;depth&quot; of a specific line, we calculate the average Z value of its start and end points:<br>        Z_edge = (z1 + z2) / 2<br><br>        # 3. Calculate the line width (W_edge) based on depth<br>        # We define a range for our line weights (e.g., from 1 to 8 pixels). To map our Z-coordinates to these weights, we first calculate a normalized depth (0 to 1). In this coordinate system, lower Z values represent points closer to the viewer:<br>        # Normalized depth (0=farthest, 1=closest)<br>        # Note: If Z_range is 0 (all Z are the same), this will handle it by setting normalized_depth to 1.<br>        if Z_range == 0:<br>            normalized_depth = 1<br>        else:<br>            normalized_depth = 1 - ((Z_edge - Z_MIN) / Z_range)<br><br>        # Final thickness (scaled)<br>        W_edge = W_MIN + (W_range * normalized_depth)<br><br>        # Ensure minimum thickness and convert to integer<br>        W_edge = max(W_MIN, int(round(W_edge)))<br><br>        # 4. Plot the edge in 2D with the calculated thickness<br>        line_alpha = W_edge/10<br>        if(line_alpha &gt;=0.7):<br>          line_alpha=0.7<br>        if(line_alpha &lt;= 0.3):<br>          line_alpha=0.3<br>        plt.plot([x1, x2],<br>                [y1, y2],<br>                color=&#39;black&#39;,<br>                linewidth=W_edge,<br>                alpha=line_alpha)<br><br>plt.xticks([])<br>plt.yticks([])<br>plt.show()</pre><p>Beyond thickness, we also vary the <strong>transparency (alpha-parameter)</strong>. By tying the alpha value to the line width, thicker (closer) lines appear more opaque, while thinner (distant) lines fade into the background. This will create an illusion of a three-dimensional object floating in a pixelated digital space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PonYnHbUhTdf9A4RiNrV5A.png" /><figcaption><strong>Creation of a 3D polygonal mesh and processing of its 2D projection.</strong> 1) — random 3D points with wrapped convex hull; 2) — XY projection of the obtained shape; 3) — line width of edges is adjusted according to depth.</figcaption></figure><p>Our geometric centerpiece is now ready to be placed over the central gradient, but it needs one final touch to feel truly alive. To elevate the 3D illusion, we’ll introduce a shimmering <a href="https://en.wikipedia.org/wiki/Anaglyph_3D"><strong>anaglyph</strong></a> effect.</p><h4>Adding the Anaglyph Effect</h4><p>To push the 3D illusion further, we want the shape to “shimmer” with an anaglyph effect. This technique mimics the chromatic fringe you see through vintage 3D glasses, splitting the edges into distinct color channels (usually red and cyan). By subtly shifting these color components based on our depth data, we create a sense of optical vibration and “shimmer,” making the polygon appear as though it’s hovering in a tangible, three-dimensional space.</p><p>This is where the project moves from static geometry to a more cinematic, “glitch-art” aesthetic. To make the polygon feel like it is vibrating with energy, we don’t just draw it once; we simulate a camera system that “sees” the object from slightly different angles, creating a depth-weighted chromatic aberration. In other words, rather than a simple static horizontal shift, we use a true 3D approach. We calculate the displacement based on the depth (Z-axis) of each edge. This creates a realistic parallax effect:</p><ul><li><strong>Close edges:</strong> Exhibit higher displacement and thicker lines, creating intense “aberration.”</li><li><strong>Far edges:</strong> Remain more stable and thinner, anchoring the object in the background.</li></ul><p>To execute this, we treat our 3D coordinates as a physical object in front of a virtual camera. We don’t just move the 2D lines — we transform the 3D points in space before they hit the “film.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2fqv88Fd9ybBQ1QV6vAvQ.png" /><figcaption><strong>The relationship between image pixels and real-world 3D coordinates in the form of a transformation matrix.</strong> The image pixel positions (xp and yp) correspond to their three-dimensional spatial locations (Xw, Yw, and Zw), where the index p means “picture plane”, and the index w means “world space”. The fx and fy parameters are the focal lengths in image coordinates, cx and cy are the coordinates of the optical center in image coordinates (the principal point), [r11…r33] values represent the rotation matrix, and [tx, ty, tz] is the translation vector.</figcaption></figure><p>We use a <strong>Transformation Matrix</strong> that combines rotation and translation of an object. In our case, the object is the set of the convex hull vertices. To rotate the hull, we apply three (around each axis) independent Euler angle transformations. By applying a small rotation angle to the Z-axis, we slightly rotate the hull. When we project these rotated points back onto our 2D canvas, the edges appear to shift and separate.</p><pre>def rotate(obj, cam_mtx, theta_x, theta_y, theta_z, t_x, t_y, t_z):<br>    &quot;&quot;&quot;<br>    Applies 3D Euclidean transformations to an object around its local center.<br>    Returns the transformed 3D coordinates (np.ndarray).<br>    &quot;&quot;&quot;<br>    # 1. Calculate the center (centroid) of the object<br>    centroid = np.mean(obj, axis=0)<br>    <br>    # 2. Shift object to the origin (0,0,0)<br>    obj_centered = obj - centroid<br><br>    # 3. Create rotation matrices<br>    tx, ty, tz = np.radians(theta_x), np.radians(theta_y), np.radians(theta_z)<br>    <br>    Rx = np.array([[1, 0, 0], <br>                   [0, np.cos(tx), -np.sin(tx)], <br>                   [0, np.sin(tx),  np.cos(tx)]])<br>    <br>    Ry = np.array([[np.cos(ty), 0, np.sin(ty)], <br>                   [0, 1, 0], <br>                   [-np.sin(ty), 0, np.cos(ty)]])<br>    <br>    Rz = np.array([[np.cos(tz), -np.sin(tz), 0], <br>                   [np.sin(tz),  np.cos(tz), 0], <br>                   [0, 0, 1]])<br><br>    # Combined rotation matrix<br>    R = Rx @ Ry @ Rz<br><br>    # 4. Rotate the centered points<br>    obj_rotated = obj_centered @ R.T<br><br>    # 5. Translate back to original position + optional extra translation (t_x, t_y, t_z)<br>    # This keeps it in the center of the image frame<br>    obj_final = obj_rotated + centroid + np.array([t_x, t_y, t_z])<br><br>    return obj_final</pre><p>The “shimmer” is a composite of multiple renderings. To achieve this look, we follow a three-step layering process:</p><ol><li><strong>Generate the “ghost” instances:</strong> We copy our convex hull three times.</li><li><strong>Apply micro-rotations:</strong> Each instance is rotated by a slightly different angle using our rotate function.</li><li><strong>Assign chromatic roles:</strong> Each rotated instance is assigned a vibrant color and a specific transparency. For instance, the aqua and pink layers are rendered with higher line widths to create a “glow” around the central object.</li><li><strong>The anchor layer:</strong> Finally, we draw the original, non-rotated hull in crisp white or black. This layer acts as the structural “anchor,” providing a crisp, high-contrast focal point that pulls the vibrating colors into a readable shape.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHjieo-ABjbFiUfj8LkqKA.png" /><figcaption><strong>Anaglyph effect achieved through spatial transformations of the three-dimensional polygonal mesh.</strong></figcaption></figure><p>By varying the anaglyth colors and line thicknesses, as well as background grayscale intensity — from a stark white canvas to a deep, dark gray — the anaglyph colors react differently. On a dark background, the <strong>cyan</strong> and <strong>royalblue</strong> layers glow, while on light backgrounds, the <strong>deeppink</strong> and <strong>aqua</strong> create a shimmering “prismatic” effect.</p><p>The beauty of this approach is that the thickness and transparency of every line are still tied to their original 3D depth. The lines closer to the viewer “vibrate” stronger than those in the back.</p><h4>Combining the Elements: The Final Assembly</h4><p>This is the stage where our individual procedural systems — the noisy canvas, the sweeping curves, the vibrant gradient, and the polygonal 3D mesh — are woven into a single, cohesive composition.</p><p>The assembly begins with the generate_image function. This master utility handles the &quot;raster&quot; part of our art. By passing randomized parameters for colors and gradient directions, we ensure that the &quot;mood&quot; of the piece shifts with every run.</p><pre>fig = plt.figure(figsize=(8,8),dpi=80)<br><br># The master generate_image function call generates the textured background, <br># parabolas, and the central gradient rectangle.<br>im = generate_image(h=250,w=250,hframe=40,wframe=40,<br>          bg_color=205,mean=1,var=0.4,k=20,<br>          no_of_lines=20,line_color=100,<br>          point_1 =[random.randint(-60,-20),random.randint(-80,300)],<br>          point_2 =[75,75],<br>          point_3 =[random.randint(105,180),random.randint(-30,180)],<br>          line_widths=[1,5],<br>          border_alpha=0.7,border_size=5,<br>          color_start=(np.random.randint(0,255),    # red<br>                       np.random.randint(0,255),    # green<br>                       np.random.randint(0,255)),   # blue<br>          color_stop=(np.random.randint(0,255),     # red<br>                      np.random.randint(0,255),     # green<br>                      np.random.randint(0,255)),    # blue<br>          gradient_direction=(bool(getrandbits(1)), # red<br>                      bool(getrandbits(1)),         # green<br>                      bool(getrandbits(1)))         # blue<br>      )<br><br>plt.imshow(im)</pre><p>Once the raster background is set, we layer the vector geometry on top using a multi-pass rendering technique. We draw the polygon four times to create the anaglyph “shimmer.”</p><pre># Generate a polygonal shape<br>coordinates1 = np.random.randint(90,240, size=(1,7,3))<br>coordinates2 = np.random.randint(90,190, size=(1,7,3))<br>coordinates3 = np.random.randint(65,265, size=(1,7,3))<br>coordinates = np.vstack((coordinates1[0],coordinates2[0],coordinates3[0]))<br><br># Create a convex hull<br>hull = ConvexHull(coordinates)<br><br># Plot vertex markers<br>hull_xy_vertices, coords_to_plot, line_alphas, line_widths = generate_projection(coordinates, hull)<br>plt.scatter(hull_xy_vertices[:, 0], hull_xy_vertices[:, 1], c=&#39;white&#39;, marker=&#39;+&#39;, s=80)<br><br># Create the anaglyph effect<br># rotate(obj,cam_mtx,theta_x,theta_y,theta_z,t_x,t_y,t_z)<br>coordinates2 = rotate(coordinates,cam_mtx,0,0,1.0,0,0,0)<br>hull2 = ConvexHull(coordinates2)<br>hull_xy_vertices2, coords_to_plot2, line_alphas2, line_widths2 = generate_projection(coordinates2, hull2)<br><br>for i in range(len(coords_to_plot2)):<br>    plt.plot(coords_to_plot2[i][0],coords_to_plot2[i][1],color=&#39;gold&#39;,linewidth=line_widths2[i],alpha=0.6*line_alphas2[i])<br><br># rotate(obj,cam_mtx,theta_x,theta_y,theta_z,t_x,t_y,t_z)<br>coordinates2 = rotate(coordinates,cam_mtx,0,0,0.8,0,0,0)<br>hull2 = ConvexHull(coordinates2)<br>hull_xy_vertices2, coords_to_plot2, line_alphas2, line_widths2 = generate_projection(coordinates2, hull2)<br><br>for i in range(len(coords_to_plot2)):<br>    plt.plot(coords_to_plot2[i][0],coords_to_plot2[i][1],color=&#39;deeppink&#39;,linewidth=line_widths2[i],alpha=0.4*line_alphas2[i])<br><br># rotate(obj,cam_mtx,theta_x,theta_y,theta_z,t_x,t_y,t_z)<br>coordinates2 = rotate(coordinates,cam_mtx,0,0,-0.8,0,0,0)<br>hull2 = ConvexHull(coordinates2)<br>hull_xy_vertices2, coords_to_plot2, line_alphas2, line_widths2 = generate_projection(coordinates2, hull2)<br><br>for i in range(len(coords_to_plot2)):<br>    plt.plot(coords_to_plot2[i][0],coords_to_plot2[i][1],color=&#39;aqua&#39;,linewidth=line_widths2[i],alpha=0.4*line_alphas2[i])<br><br># Draw the main polygonal mesh<br>for i in range(len(coords_to_plot)):<br>    plt.plot(coords_to_plot[i][0],coords_to_plot[i][1],color=&#39;white&#39;,linewidth=line_widths[i],alpha=line_alphas[i])<br><br>plt.xticks([])<br>plt.yticks([])<br>plt.show()</pre><p>By combining these steps, the image transforms from a static frame into a captivating interplay of light and geometry. The crisp, white lines of the polygon provide a sharp contrast against the fluid, noisy gradient, while the color-shifted layers create a “third dimension” that feels like it is leaping off the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*MCZf63UOxwQw3k4Tjt2wSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*5dXHzLg053ZAoS4ZLzVG5Q.png" /><figcaption><strong>Two final randomly generated illustrations.</strong></figcaption></figure><p>Here are some more generated examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TzULeGneWgr_GHsga_F-Pg.png" /><figcaption><strong>Selected examples of randomly generated procedural illustrations.</strong></figcaption></figure><p>Since the entire process is procedural, we can incrementally change the rotation angles in a loop to create a spinning 3D GIF of our shimmering polygon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*IJBJcSFfkEubdtPb42VnRQ.gif" /><figcaption><strong>An example of randomly generated procedural animation.</strong></figcaption></figure><p>Procedural art is an iterative journey. Now that you have the core engine running, the real magic happens when you start “breaking” the math to see what happens. Try experimenting with shades of gray, line thickness, colors, and polygon coordinates. 😉</p><h4>Conclusion</h4><p>The beauty of procedural illustration lies in the balance between the <strong>predictability of math</strong> and the <strong>surprise of randomness</strong>. You set the rules, but the code provides the unique execution. By applying fundamental coordinate geometry, linear algebra, and a touch of randomness, you can transform a few lines of Python code into a sophisticated, evolving piece of abstract art.</p><p><strong>I hope you found this tutorial helpful. Thank you and happy drawing!</strong></p><h4><a href="https://github.com/apetsiuk/Procedural-Drawing-in-Python"><strong>The full code is here</strong></a><strong>! 📝</strong></h4><p><a href="https://github.com/apetsiuk/Procedural-Drawing-in-Python">GitHub - apetsiuk/Procedural-Drawing-in-Python: A simple tutorial for procedural abstract illustration in Python</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=174405c2472e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PrusaSlicer: Source Code Anatomy [Part 2, Print Object Generation]]]></title>
            <link>https://medium.com/@apetsiuk/prusaslicer-source-code-anatomy-part-2-print-object-generation-1bd5b5061f10?source=rss-34490aee8142------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bd5b5061f10</guid>
            <category><![CDATA[prusaslicer]]></category>
            <category><![CDATA[prusa]]></category>
            <category><![CDATA[3d-printing]]></category>
            <category><![CDATA[slicing-software]]></category>
            <category><![CDATA[additive-manufacturing]]></category>
            <dc:creator><![CDATA[Aliaksei Petsiuk]]></dc:creator>
            <pubDate>Fri, 10 Feb 2023 03:08:51 GMT</pubDate>
            <atom:updated>2023-02-10T03:08:51.355Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PMDjy5tTQJnDJTZNaJdPVw.png" /></figure><p>Previous part:</p><p><a href="https://medium.com/@apetsiuk/prusaslicer-source-code-anatomy-part-1-history-and-introduction-3524930af4cd">PrusaSlicer: Source Code Anatomy [Part 1, History and Overview]</a></p><p>As mentioned earlier in the post above, after processing (print -&gt; process()) a loaded 3D STL model or a 3MF project, PrusaSlicer generates a Print object, which can be illustrated in the graph below.</p><pre>// Loading 3D models and processing configurations<br>FullPrintConfig fff_print_config;<br>Model model = Model::read_from_file(...);<br><br>// Creating a printable object data structure<br>Print fff_print;<br>PrintBase *print = static_cast&lt;PrintBase *&gt;(&amp;fff_print);<br><br>// Applying the configurations and processing the created object<br>print -&gt; apply(model, fff_print_config);<br>print -&gt; process();</pre><p>Here we load a model from the file, apply the specified configurations, and process the print object. The apply() method utilizes the provided printer and slicing configurations, and the process() function converts the input STL/3MF/… files into a suitable data structure for G-Code generation.</p><p>The print-&gt;process() refers to void Slic3r::Print::process() method declared in Print.hpp. It is responsible for slicing the loaded 3D model mesh and creating its <strong>skirt, brim, wipe tower, support structure, perimeters, infilling, and ironing </strong>sequences<strong> </strong>for each model object.</p><p>Thus, after processing, we get the following data and are ready to generate G-Code (each class in the image belongs to the <strong>libslic3r </strong>library, for example, Print means Slic3r::Print). Classes are in bold and their main fields are listed below each class name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*RSxto1semQXCcAFX9U710w.png" /><figcaption>Structural relationships of the generated print object (fff_print). Each class in the image belongs to the libslic3r library, e.g. Print means Slic3r::Print. Classes are in bold and their main fields are listed below each class.</figcaption></figure><ul><li><strong>PrintBase </strong>— abstracts the slice — &gt; convert to instructions — &gt; send to printer flow for different 3D printing technologies.</li><li><strong>Print </strong>— complete print tray with possibly multiple objects, where each of them is defined as an instance of <strong>PrintObject </strong>class.</li><li><strong>PrintRegion</strong> — represents a group of volumes to print sharing the same configurations, including the same assigned extruder or multiple extruders.</li><li><strong>Layer </strong>— horizontal section of a certain thickness at the geometric cut level, containing all the color regions.</li><li><strong>Model </strong>— represents all the 3D objects within the scene you want to slice.</li><li><strong>ModelObject </strong>— a printable object, possibly having multiple print volumes (each with its own set of parameters and materials), and possibly having multiple modifier volumes, each modifier volume with its set of parameters and materials. Each ModelObject may be instantiated multiple times, each instance having a different placement on the print bed, different rotation, and different uniform scaling.</li><li><strong>ModelVolume </strong>— represents a part of the STL model which has a different color or is part of another STL model</li></ul><p>All the slicing parameters could be stored in the <strong>SlicingParameters </strong>field (Slic3r::PrintObject::m_slicing_params). It collects data to be used by the variable layer thickness algorithm, the interactive layer height editor, and the printing process itself. The slicing parameters depend on various configuration values: layer height, first layer height, raft settings, print nozzle diameter, etc.</p><pre>// Slic3r::PrintObject::m_slicing_params<br>const SlicingParameters&amp; slicing_parameters() const<br>{return m_slicing_params;}</pre><p>Every sliced Layer, in turn, has the following structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBmFYYcMaDzVGnhzXKpVig.png" /><figcaption>Structural relationships of the sliced layer object</figcaption></figure><p>Starting with points, each part contributes to the individual surfaces which are combined into regions, and, finally, to the entire layer. It is to this structure (a set of various XYZ coordinates) we apply the group of functions to get the correct printer instructions (G-Code).</p><p>When the loaded model with all its STL meshes inside is sliced (PrintObject::slice()), the program creates the following layer hierarchy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*OtCaCEeTPGB4qFWmXSrEUQ.png" /><figcaption>Sliced layer hierarchy</figcaption></figure><p>Before the slicing stage, one can also manipulate the individual model volumes, as in the Eiffel Tower example below, where different colors refer to different model volumes. This step precedes the slicing procedure, so the overall algorithm takes into account possible collisions and provides a corrected G-Code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*AB6L1ZLyPXUpmoNiSIy-oA.png" /><figcaption>Manipulating with individual model volumes. This step precedes the slicing procedure, so the overall algorithm takes into account possible collisions and provides a corrected G-Code.</figcaption></figure><p>Now, let’s have a closer look at the <strong>PrintObject </strong>processing functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*euvSnC4f7hfKYDYOgh-DuQ.png" /><figcaption>Print object processing pipeline</figcaption></figure><p>Function<strong>make_perimeters()</strong> generates perimeters for each layer. It also compares each layer to the one below and marks those slices needing one additional inner perimeter, like the top of domed objects.</p><p><strong>PrintObject::slice()</strong> is called by make_perimeters() method and is located in PrintObjectSlice.cpp . It 1️⃣ decides Z positions of the layers, 2️⃣ initializes layers and their regions, 3️⃣ slices the object meshes, 4️⃣ slices the modifier meshes and reclassifies the slices of the object meshes by the slices of the modifier meshes, 5️⃣ applies for size compensation (offsets the slices in XY plane), and 6️⃣ replaces bad slices by the ones reconstructed from the upper/lower layer. The resulting layer polygons are marked as “internal”. PrintObject::slice_volumes(), in turn, merges all regions’ slices to get islands and chains them by the shortest path.</p><p>Infill(), ironing(), and generate_support_material() are small functions, so it is useful to bring their entire code here:</p><p><strong>Infill()</strong></p><pre>void PrintObject::infill()<br>{<br>    // prerequisites<br>    this-&gt;prepare_infill();<br><br>    if (this-&gt;set_started(posInfill)) {<br>        auto [adaptive_fill_octree, support_fill_octree] = this-&gt;prepare_adaptive_infill_data();<br>        auto lightning_generator                         = this-&gt;prepare_lightning_infill_data();<br><br>        BOOST_LOG_TRIVIAL(debug) &lt;&lt; &quot;Filling layers in parallel - start&quot;;<br>        tbb::parallel_for(tbb::blocked_range&lt;size_t&gt;(0, m_layers.size()),<br>            [this, &amp;adaptive_fill_octree = adaptive_fill_octree, &amp;support_fill_octree = support_fill_octree, &amp;lightning_generator](const tbb::blocked_range&lt;size_t&gt;&amp; range) {<br>                for (size_t layer_idx = range.begin(); layer_idx &lt; range.end(); ++ layer_idx) {<br>                    m_print-&gt;throw_if_canceled();<br>                    m_layers[layer_idx]-&gt;make_fills(adaptive_fill_octree.get(), support_fill_octree.get(), lightning_generator.get());<br>                }<br>            }<br>        );<br>        m_print-&gt;throw_if_canceled();<br>        BOOST_LOG_TRIVIAL(debug) &lt;&lt; &quot;Filling layers in parallel - end&quot;;<br>        this-&gt;set_done(posInfill);<br>    }<br>}</pre><p>The prerequisite for the infilling method is <strong>PrintObject::prepare_infill()</strong> which:</p><ul><li>Detects surface types (top/bottom/internal) and decides what surfaces are to be filled.</li><li>Processes external surfaces, where it detects bridges and produces enlarged overlapping bridging areas.</li><li>Merges surfaces with the same style.</li><li>Discovers vertical and horizontal shells and adds solid fills to ensure their sustainable thickness.</li><li>Clips fill surfaces and trims the sparse infill to make it act as an internal support.</li></ul><p><strong>Ironing()</strong></p><pre>void PrintObject::ironing()<br>{<br>    if (this-&gt;set_started(posIroning)) {<br>        BOOST_LOG_TRIVIAL(debug) &lt;&lt; &quot;Ironing in parallel - start&quot;;<br>        tbb::parallel_for(<br>            // Ironing starting with layer 0 to support ironing all surfaces.<br>            tbb::blocked_range&lt;size_t&gt;(0, m_layers.size()),<br>            [this](const tbb::blocked_range&lt;size_t&gt;&amp; range) {<br>                for (size_t layer_idx = range.begin(); layer_idx &lt; range.end(); ++ layer_idx) {<br>                    m_print-&gt;throw_if_canceled();<br>                    m_layers[layer_idx]-&gt;make_ironing();<br>                }<br>            }<br>        );<br>        m_print-&gt;throw_if_canceled();<br>        BOOST_LOG_TRIVIAL(debug) &lt;&lt; &quot;Ironing in parallel - end&quot;;<br>        this-&gt;set_done(posIroning);<br>    }<br>}</pre><p><strong>Generate_support_material()</strong></p><pre>void PrintObject::generate_support_material()<br>{<br>    if (this-&gt;set_started(posSupportMaterial)) {<br>        this-&gt;clear_support_layers();<br>        if ((this-&gt;has_support() &amp;&amp; m_layers.size() &gt; 1) || (this-&gt;has_raft() &amp;&amp; ! m_layers.empty())) {<br>            m_print-&gt;set_status(85, L(&quot;Generating support material&quot;));    <br>            this-&gt;_generate_support_material();<br>            m_print-&gt;throw_if_canceled();<br>        }<br>        this-&gt;set_done(posSupportMaterial);<br>    }<br>}</pre><p>Perimeters, infills, and ironing work for each sliced layer:</p><pre>PrintObject::m_layers[layer_idx]-&gt;make_perimeters(); // defined in Layer.cpp<br>PrintObject::m_layers[layer_idx]-&gt;make_fills(...); // in Fill.cpp<br>PrintObject::m_layers[layer_idx]-&gt;make_ironing(); // in Fill.cpp </pre><p>Support method applies for each printing object (each 3D STL mesh):</p><pre>*PrintObject -&gt; _generate_support_material(); // defined in PrintObject.cpp<br><br>void PrintObject::_generate_support_material()<br>{<br>    PrintObjectSupportMaterial support_material(*PrintObject, m_slicing_params);<br>    support_material.generate(*PrintObject);<br>}</pre><p><strong>Print::_make_wipe_tower() </strong>and <strong>Print::_make_skirt() </strong>methods are used for the whole 3D scene to take into account all existing objects.</p><p>The core functionality of <strong>Print::_make_wipe_tower() </strong>can be summarized as follows:</p><pre>void Print::_make_wipe_tower(){<br>...<br>// Initialize the wipe tower.<br>WipeTower wipe_tower(m_config, wipe_volumes, m_wipe_tower_data.tool_ordering.first_extruder());<br><br>// Generate the wipe tower layers.<br>m_wipe_tower_data.tool_changes.reserve(m_wipe_tower_data.tool_ordering.layer_tools().size());<br>wipe_tower.generate(m_wipe_tower_data.tool_changes); // GCode/WipeTower.cpp<br>m_wipe_tower_data.depth = wipe_tower.get_depth();<br>m_wipe_tower_data.brim_width = wipe_tower.get_brim_width();<br>...}</pre><p>Where the <strong>WipeTower::generate(…)</strong> is:</p><pre>// Processes vector m_plan and calls respective functions to generate G-code for the wipe tower<br>// Resulting ToolChangeResults are appended into vector &quot;result&quot;<br>void WipeTower::generate(std::vector&lt;std::vector&lt;WipeTower::ToolChangeResult&gt;&gt; &amp;result)<br>{<br> if (m_plan.empty())<br>        return;<br><br>    m_extra_spacing = 1.f;<br><br> plan_tower();<br>    for (int i=0;i&lt;5;++i) {<br>        save_on_last_wipe();<br>        plan_tower();<br>    }<br><br>    m_layer_info = m_plan.begin();<br><br>    // we don&#39;t know which extruder to start with - we&#39;ll set it according to the first toolchange<br>    for (const auto&amp; layer : m_plan) {<br>        if (!layer.tool_changes.empty()) {<br>            m_current_tool = layer.tool_changes.front().old_tool;<br>            break;<br>        }<br>    }<br><br>    for (auto&amp; used : m_used_filament_length) // reset used filament stats<br>        used = 0.f;<br><br>    m_old_temperature = -1; // reset last temperature written in the gcode<br><br>    std::vector&lt;WipeTower::ToolChangeResult&gt; layer_result;<br> for (auto layer : m_plan)<br> {<br>        set_layer(layer.z, layer.height, 0, false/*layer.z == m_plan.front().z*/, layer.z == m_plan.back().z);<br>        m_internal_rotation += 180.f;<br><br>        if (m_layer_info-&gt;depth &lt; m_wipe_tower_depth - m_perimeter_width)<br>   m_y_shift = (m_wipe_tower_depth-m_layer_info-&gt;depth-m_perimeter_width)/2.f;<br><br>        int idx = first_toolchange_to_nonsoluble(layer.tool_changes);<br>        ToolChangeResult finish_layer_tcr;<br><br>        if (idx == -1) {<br>            // if there is no toolchange switching to non-soluble, finish layer<br>            // will be called at the very beginning. That&#39;s the last possibility<br>            // where a nonsoluble tool can be.<br>            finish_layer_tcr = finish_layer();<br>        }<br><br>        for (int i=0; i&lt;int(layer.tool_changes.size()); ++i) {<br>            layer_result.emplace_back(tool_change(layer.tool_changes[i].new_tool));<br>            if (i == idx) // finish_layer will be called after this toolchange<br>                finish_layer_tcr = finish_layer();<br>        }<br><br>        if (layer_result.empty()) {<br>            // there is nothing to merge finish_layer with<br>            layer_result.emplace_back(std::move(finish_layer_tcr));<br>        }<br>        else {<br>            if (idx == -1)<br>                layer_result[0] = merge_tcr(finish_layer_tcr, layer_result[0]);<br>            else<br>                layer_result[idx] = merge_tcr(layer_result[idx], finish_layer_tcr);<br>        }<br><br>  result.emplace_back(std::move(layer_result));<br> }<br>}</pre><p><strong>Print::_make_skirt()</strong></p><pre>void Print::_make_skirt(){<br>...<br>// Generate the skirt centerline.<br>        Polygon loop;<br>        {<br>            Polygons loops = offset(convex_hull, distance, ClipperLib::jtRound, float(scale_(0.1)));<br>            Geometry::simplify_polygons(loops, scale_(0.05), &amp;loops);<br>   if (loops.empty())<br>    break;<br>   loop = loops.front();<br>        }<br>        // Extrude the skirt loop.<br>        ExtrusionLoop eloop(elrSkirt);<br>        eloop.paths.emplace_back(ExtrusionPath(<br>            ExtrusionPath(<br>                erSkirt,<br>                (float)mm3_per_mm,         // this will be overridden at G-code export time<br>                flow.width(),<br>    (float)first_layer_height  // this will be overridden at G-code export time<br>            )));<br>        eloop.paths.back().polyline = loop.split_at_first_point();<br>        m_skirt.append(eloop);<br>...}</pre><p>Class <strong>ExtrusionLoop </strong>represents a single continuous extrusion loop, possibly with varying extrusion thickness, extrusion height, and bridging.</p><h3>▶️ Next</h3><p>The next chapter will cover details about the GCode class.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bd5b5061f10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PrusaSlicer: Source Code Anatomy [Part 1, History and Overview]]]></title>
            <link>https://medium.com/@apetsiuk/prusaslicer-source-code-anatomy-part-1-history-and-introduction-3524930af4cd?source=rss-34490aee8142------2</link>
            <guid isPermaLink="false">https://medium.com/p/3524930af4cd</guid>
            <category><![CDATA[prusa]]></category>
            <category><![CDATA[3d-printing]]></category>
            <category><![CDATA[additive-manufacturing]]></category>
            <category><![CDATA[computational-geometry]]></category>
            <category><![CDATA[slicing-software]]></category>
            <dc:creator><![CDATA[Aliaksei Petsiuk]]></dc:creator>
            <pubDate>Tue, 07 Feb 2023 14:48:37 GMT</pubDate>
            <atom:updated>2023-11-03T06:43:33.928Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mDcwuTOiN7K_8AHfPg6XWA.png" /></figure><blockquote>This article is part of a cycle devoted to the PrusaSlicer source code structure analysis. These works are under development and will continue to be updated.</blockquote><p><a href="https://github.com/prusa3d/PrusaSlicer"><strong>PrusaSlicer</strong></a> is the heir of <a href="https://manual.slic3r.org/getting-slic3r/getting-slic3r#building-from-source"><strong>Slic3r</strong></a> developed by <a href="https://github.com/alranel"><strong>Alessandro Ranellucci</strong></a><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D-PqSQRSc3wVfjM7xkMzzA.png" /><figcaption>PrusaSlicer (2016) and its ancestors: SLic3r (2011) and SkeinForge (2008)</figcaption></figure><p>The core software library is <a href="https://manual.slic3r.org/libslic3r-doc/hierarchy.html"><strong>libslic3r</strong></a>,<strong> </strong>written in C++ for fast geometric processing of complex 3D models. A <a href="https://slic3r.org/blog/1.5-years-of-slic3r-development/">brief history</a> of one and a half years of development reveals more details:</p><blockquote>Slic3r was born in late 2011 as an attempt to modernize the 3D printing toolchain. It simplified slicing by reducing configuration to just three options (nozzle diameter, filament diameter, temperature) and it also made slicing a lot faster. The goal was to have clean, structured code for prototyping new features and getting a powerful slicing engine.</blockquote><h4>Slic3r had introduced a good number of new features:</h4><ul><li><strong>Automatic detection of bridges</strong> — detects each bridge independently and only extends it by the distance strictly needed for anchoring</li><li><strong>Micro layering</strong> — different layer heights may be used for infill, perimeters as well as to various regions of the model</li><li><strong>Brim </strong>— addition to the print used to hold the edges of a printing part, which can prevent warping and help with bed adhesion</li><li><strong>Cooling logic</strong> — controls both cooling fan and print speed in a single integrated logic</li><li><strong>Sequential printing</strong> — have the printer print one object completely at a time</li><li><strong>Avoiding crossing perimeters</strong> — bends travel moves so that they don’t cross objects when not strictly needed — and when it’s needed, it tries to cross a vertex rather than a flat surface</li><li><strong>Different extrusion widths</strong> — for each print part (perimeters, infill, support, first layer, etc.)</li><li><strong>Extra perimeters</strong> — automatically increases the number of perimeters in those layers where slopes would expose some of the infill producing sub-optimal results</li><li><strong>Multiple extruders</strong> — native support for multi-material files. It was one of the first applications able to read and write AMF files. It also allowed using a secondary extruder for support material, opening the way to soluble support</li><li><strong>Only infill where needed</strong> — detect what upper parts of the object require infill for supporting the ceiling</li><li><strong>Different number of top and bottom layers</strong> — allows making vases from solid objects</li><li><strong>Acceleration control</strong> — allows fine-tuning your firmware by assigning different acceleration limits to each part of the print (perimeters, infill, bridges)</li><li><strong>Automatic logic for generating internal bridges over sparse infill</strong> — improves the quality of top surfaces</li></ul><h4>PrusaSlicer, in turn, created:</h4><ul><li>Multiple G-code flavors supported (RepRap, Makerbot, Mach3, Machinekit, etc.)</li><li>Ability to plate multiple objects having distinct print settings</li><li>STL auto-repair (tolerance for broken models)</li><li>Combines infill every ’n’ perimeters layer to speed up printing</li><li>Spiral vase mode for continuous printing</li><li>Fine-grained configuration of speed, acceleration, and extrusion width</li><li>Several infill patterns including honeycombs, spirals, Hilbert curves</li><li>Standby temperature and automatic wiping for multi-extruder printing</li><li>Support for post-processing scripts</li><li>Cooling logic controlling fan speed and dynamic print speed</li></ul><p>The Slic3r library is widely distributed: <a href="https://github.com/supermerill/SuperSlicer"><strong>SuperSlicer</strong></a> represents another fork based on it, and <strong>OctoPrint</strong> has a <a href="https://github.com/OctoPrint/OctoPrint-Slic3r">plugin</a> that allows connecting Slic3r for slicing. It may also be worth noting a single-file embedded C-based Slic3r remake attempt, developed by <a href="https://github.com/dronus/Schlizzer">dronus</a>.</p><p>Both Slic3r and PrusaSlicer programs allow running the whole process in the <a href="https://manual.slic3r.org/advanced/command-line">backend, using a command line interface</a>. This allows other developers to focus on their own GUIs by easily integrating main slicing features under the hood.</p><p>Below is an example of using the slicer via the command line. Here we are passing the saved project <strong>(models.3mf)</strong> along with its slicing configurations baked in the 3D Manufacturing Format (3MF) and receiving the output printer instructions as a <strong>models.gcode</strong>:</p><pre>Usage: prusa-slicer [ ACTIONS ] [ TRANSFORM ] [ OPTIONS ] [ FILES ]<br>Actions: --export-gcode<br>Transform: --cut 3<br>Options: --loglevel 5 --output models.gcode<br>Files: models.gcode, models.3mf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXslOk-eRb9hOL3zAleazA.png" /><figcaption>PrusaSlicer running in the backend through the command line interface</figcaption></figure><p>PrusaSlicer allows to store complex compound models along with slicing configurations, materials, and colors in 3MF format. This is an open-source XML-based data-storing architecture developed by <a href="https://3mf.io/">3MF Consortium</a>. To have a look in 3MF file contents — just rename .3mf to .zip and extract the data to another folder. You will then get a number of files with metadata, mesh structure, configuration files, etc.</p><h3>Dependencies</h3><p>The main software dependencies are listed below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gg3GyiX2lseTb1MDPAhotg.png" /></figure><ul><li><a href="https://www.boost.org/"><strong>Boost</strong></a><strong> </strong>— a set of C++ libraries that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries. It provides free peer-reviewed portable C++ source libraries.</li><li><a href="https://eigen.tuxfamily.org/dox/GettingStarted.html"><strong>Eigen </strong></a>— a high-level C++ library of template headers for linear algebra, matrix and vector operations, geometrical transformations, numerical solvers, and related algorithms. Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.</li><li><a href="https://github.com/AngusJohnson/Clipper2"><strong>Clipper</strong></a> — The Clipper2 library performs intersection, union, difference, and XOR boolean operations on both simple and complex polygons. It also performs polygon offsetting. This is a major update of my original Clipper library that was written over 10 years ago. That library I’m now calling Clipper1 and while it still works very well, Clipper2 is better in just about every way.</li><li><a href="https://libigl.github.io/"><strong>LibIGL </strong></a>— a simple header-only C++ geometry processing library. We have a wide functionality including the construction of sparse discrete differential geometry operators and finite-elements matrices such as the cotangent Laplacian and diagonalized mass matrix, simple facet, and edge-based topology data structures, mesh-viewing utilities for OpenGL and GLSL, and many core functions for matrix manipulation.</li><li><a href="https://www.opengl.org/"><strong>OpenGL </strong></a>— OpenGL is a cross-language, cross-platform application programming interface for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit, to achieve hardware-accelerated rendering.</li><li><a href="https://www.cgal.org/"><strong>CGAL </strong></a>— CGAL is a software project that provides easy access to efficient and reliable geometric algorithms in the form of a C++ library. CGAL is used in various areas needing geometric computation, such as geographic information systems, computer-aided design, molecular biology, medical imaging, computer graphics, and robotics.</li></ul><p>There are many lines of code in PrusaSlicer, but the whole process can be roughly divided into two parts: 1️⃣ <strong>slicing<em> </em></strong>and 2️⃣ <strong>gcode generation</strong>.</p><h4>1. Slicing</h4><pre>// Loading 3D models and processing configurations<br>FullPrintConfig fff_print_config;<br>Model model = Model::read_from_file(...);<br><br>// Creating a printable object data structure<br>Print fff_print;<br>PrintBase *print = static_cast&lt;PrintBase *&gt;(&amp;fff_print);<br><br>// Applying the configurations and processing the created object<br>print -&gt; apply(model, fff_print_config);<br>print -&gt; process();</pre><h4>2. GCode Generation</h4><pre>// Create a gcode object and apply the required configurations<br>std::unique_ptr&lt;GCode&gt;gcode(new GCode);<br>gcode-&gt;apply_print_config(...);<br>GCode::GCodeOutputStream file(..., gcode-&gt;m_processor);<br><br>// Collect the sliced layers for printing<br>std::vector&lt;GCode::LayerToPrint&gt; layers_to_print = <br>GCode::collect_layers_to_print(object);<br>GCode::LayerToPrint &amp;layer = layers_to_print[layer_number];<br><br>// And write the corresponding gcode after processing each layer<br>GCode::LayerResult result;<br>for (every layer){<br>    result = gcode-&gt;process_layer(...);<br>    file.write(result.gcode);<br>}</pre><h3>▶️ Next</h3><p>The next chapter will cover further details regarding the abstract model of the print object.</p><p><a href="https://medium.com/@apetsiuk/prusaslicer-source-code-anatomy-part-2-print-object-generation-1bd5b5061f10">PrusaSlicer: Source Code Anatomy [Part 2, Print Object Generation]</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3524930af4cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evolution of Image Segmentation Methods (2022): 100+ Architectures]]></title>
            <link>https://medium.com/@apetsiuk/evolution-of-image-segmentation-methods-2022-100-architectures-751f7b5f7a04?source=rss-34490aee8142------2</link>
            <guid isPermaLink="false">https://medium.com/p/751f7b5f7a04</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[segmentation]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[image-processing]]></category>
            <dc:creator><![CDATA[Aliaksei Petsiuk]]></dc:creator>
            <pubDate>Wed, 29 Jun 2022 18:32:53 GMT</pubDate>
            <atom:updated>2022-06-29T18:32:53.394Z</atom:updated>
            <content:encoded><![CDATA[<h3>Evolution of Image Segmentation Methods (2022): 💯 Architectures</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*4gaeg82H34FzdcDrx2EJ6g.png" /></figure><p>Image segmentation is the process of partitioning a digital image into multiple meaningful regions sharing similar characteristics. Each pixel thus has a certain label that determines whether it belongs to a certain class. This adds a separate logical channel that determines the presence and location of individual physical objects and simplifies subsequent analysis.</p><p>Digital image segmentation is an essential component of many intelligent visual systems. Practical applications include medical imaging, anomaly detection in manufacturing, object detection in autonomous navigation systems, security surveillance, and others.</p><p>In general, it can be divided into three groups: 1️⃣ <strong>Semantic </strong>(determines whether each pixel belongs to a certain group of objects, e.g. all segmented pedestrians in an image have the same label); 2️⃣ <strong>Instance </strong>(determines whether each image pixel belongs to an individual object, e.g. every segmented pedestrian in an image has an individual label); 3️⃣ <strong>Panoptic </strong>(combines semantic and instance segmentation simultaneously)</p><p>Since about the 1970s, image segmentation problems have been approached using a number of classic pre-deep learning techniques:</p><ul><li><strong>Thresholding</strong> <em>(</em><a href="https://ieeexplore.ieee.org/document/4310076"><em>Otsu, 1979</em></a><em>)</em></li><li><strong>Active contours</strong> <em>(</em><a href="https://doi.org/10.1007/BF00133570"><em>Kass, Witkin, Terzopoulos, 1988</em></a><em>)</em></li><li><strong>Watersheds</strong> <em>(</em><a href="https://doi.org/10.1016/0165-1684(94)90059-0"><em>Najman &amp; Schmitt, 1994</em></a><em>)</em></li><li><strong>Graph cuts</strong> <em>(</em><a href="https://doi.org/10.1109/34.969114"><em>Boykov, Veksler, Zabih, 2001</em></a><em>)</em></li><li><strong>Markov random fields (MRF) </strong><em>(</em><a href="https://doi.org/10.1145/502090.502093"><em>Hochbaum, 2001</em></a><em>)</em></li><li><strong>Histogram-based region growing</strong> <em>(</em><a href="https://www.researchgate.net/publication/8199997_Statistical_Region_Merging"><em>Nock &amp; Nielsen, 2004</em></a><em>)</em></li><li><strong>Random forests </strong><em>(</em><a href="https://doi.org/10.5244/C.22.54"><em>Schroff, Criminisi, Zisserman, 2008</em></a><em>)</em></li><li><strong>Conditional random fields (CRF) </strong><em>(</em><a href="https://doi.org/10.1145/1553374.1553479"><em>Plath, Toussaint, Nakajima, 2009</em></a><em>)</em></li><li><strong>Support vector machines (SVM)</strong> <em>(</em><a href="https://doi.org/10.1016/j.imavis.2010.08.003"><em>Yu, Wong, Wen, 2011</em></a><em>)</em></li><li><strong>k-means clustering</strong> <em>(</em><a href="https://doi.org/10.1016/j.procs.2015.06.090"><em>Dhanachandra et al., 2015</em></a><em>)</em></li><li><strong>Sparsity-based methods</strong> <em>(</em><a href="https://arxiv.org/abs/1704.07711"><em>Minaee &amp; Wang, 2019</em></a><em>)</em></li></ul><p>The situation has changed radically with the growth of computing power and the development of machine learning methods. Below is a set of <strong>100+</strong> neural network architectures designed for digital image segmentation. The following list of selected approaches is based on several comprehensive studies <em>(</em><a href="https://arxiv.org/abs/2001.05566"><em>Minaee et al. 2021</em></a><em>, </em><a href="https://arxiv.org/abs/1912.10230"><em>Ulku &amp; Akagündüz 2022</em></a><em>, see the references below)</em> and represents the main up-to-date technological slice.</p><p>The figures and brief explanations presented are taken from their respective sources. Let me please know in the comments if I missed anything, your feedback and personal experience are warmly welcome! 👍 💬</p><h3>Deep learning architecture groups for image segmentation problems (Minaee et al., 2022)<strong>:</strong></h3><ol><li>Fully convolutional networks <em>(2014-2015)</em></li><li>Convolutional models with graphical models <em>(2015–2016)</em></li><li>Encoder-decoder-based models <em>(2015–2020)</em></li><li>Multi-scale and pyramid network-based models <em>(2016–2019)</em></li><li>R-CNN-based models <em>(2015–2021)</em></li><li>Dilated convolutional models <em>(2014–2018)</em></li><li>Recurrent neural network-based models <em>(2015–2017)</em></li><li>Attention-based models <em>(2016–2019)</em></li><li>Generative models and adversarial training <em>(2016–2018)</em></li><li>Convolutional models with active contour models <em>(2016–2019)</em></li><li>Panoptic segmentation <em>(2018–2020)</em></li><li>Other models <em>(2015–2020)</em></li></ol><h3><strong>1. Fully convolutional networks</strong></h3><p><strong>FCN </strong><em>(</em><a href="https://arxiv.org/abs/1411.4038"><em>Long, Shelhamer, Darrell, 2014</em></a><em>)</em> [<a href="https://github.com/shekkizh/FCN.tensorflow">code</a>] — Combines semantic information from a deep, coarse layer with appearance information from a shallow, fine layer to produce accurate and detailed segmentations; relatively fast due to no fully connected layers or a refinement block — <em>85.2% mPA @ SIFTflow 62.2% mIoU @ PASCAL VOC 2012 65.3% mIoU @ CityScapes (w/o coarse) 39.3% mIoU @ ADE20K</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*j-nDzvZQssiRzCv-R2bWxA.png" /></figure><p><strong>ParseNet </strong><em>(</em><a href="https://arxiv.org/abs/1506.04579"><em>Liu, Rabinovich, Berg, 2015</em></a><em>)</em> [<a href="https://github.com/debidatta/caffe-parsenet">code</a>] — Adds global context to FCNs by using average features for a layer to augment the data at each location — <em>mIoU 65.82% @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*42BlUKlr5pHhnhD6DSlL-A.png" /></figure><h3>2. Convolutional models with graphical models</h3><p><strong>Fully Connected Deep Structured Network</strong> <em>(</em><a href="https://arxiv.org/abs/1503.02351"><em>Schwing and Urtasun, 2015</em></a><em>) </em>— A two-stage process merged into a single joint training algorithm (CNN provides local pixel-wise features for a global graphical model)</p><p><strong>DPN (Deep Parsing Network): CNN+Markov Random Field (MRF)</strong> <em>(</em><a href="https://arxiv.org/abs/1509.02634"><em>Liu et al., 2015</em></a><em>) — </em>DPN extends a contemporary CNN architecture to model unary terms and additional layers, it enables deterministic end-to-end computation in a single forward pass<em> —mIoU 77.5% @ PASCAL VOC 2012</em></p><p><strong>CNN+Conditional Random Fields (CRF)</strong> <em>(</em><a href="https://arxiv.org/abs/1504.01013"><em>Lin et al., 2016</em></a><em>) — </em>Improved semantic segmentation through the use of contextual information: ‘patch-patch’ context between image regions, and ‘patch-background’ context<em> — mIoU 78% @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*o6qWm_S_w_lSEtR1PqP-HQ.png" /></figure><p><strong>Deep Conv Net + Fully Connected CRFs</strong> <em>(</em><a href="https://arxiv.org/abs/1412.7062"><em>Chen et al., 2016</em></a><em>)</em> [<a href="https://bitbucket.org/deeplab/deeplab-public/src/master/">code</a>] — Overcoming the poor localization property of deep networks by combining responses at the final CNN layer with a fully connected CRF — <em>mIoU 71.6% @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*Vw5qX4TsX6amilZQVLhwXw.png" /></figure><h3>3. Encoder-decoder-based models</h3><p><strong>Deconvolution Network</strong> <em>(</em><a href="https://arxiv.org/abs/1505.04366"><em>Noh, Hong, Han, 2015</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/learning-deconvolution-network-for-semantic">code</a>] — Mitigates the limitations of fully convolutional networks by integrating deep deconvolution (transposed convolution) network and proposal-wise prediction— <em>mIoU 72.5% @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*y8F4myWhYW4h2Vbk83mO5Q.png" /></figure><p><strong>U-Net</strong> <em>(</em><a href="https://arxiv.org/abs/1505.04597"><em>Ronneberger, Fischer, Brox, 2015</em></a><em>)</em> [<a href="https://github.com/ShawnBIT/UNet-family">code</a>] — Can be trained end-to-end from very few images; efficient computational load due to the absence of fully connected layers or refinement blocks— <a href="https://arxiv.org/abs/1804.03821"><em>mIoU 72.7% @ PASCAL VOC 2012</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*Mt_0G19nyrB2WJGhCvwfPw.png" /></figure><p><strong>V-Net</strong> <em>(</em><a href="https://arxiv.org/abs/1606.04797"><em>Milletari, Navab, Ahmadi, 2016</em></a><em>)</em> [<a href="https://github.com/faustomilletari/VNet">code</a>] — 3D image segmentation based on a volumetric FCNN; a novel objective function is based on Dice coefficient; balancing between the number of foreground and background voxels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*6xgJlAQCh9tpQbtSn1lJcQ.png" /></figure><p><strong>Progressive Dense V-net (PDV-Net)</strong> <em>(</em><a href="https://doi.org/10.1109/tmi.2016.2528821"><em>Brosch et al., 2016</em></a><em>) —</em>Deep 3D convolutional encoder networks with shortcut connections applied to multiple sclerosis (MS) lesions segmentation in magnetic resonance images; the model consists of two interconnected pathways, a convolutional one, which learns increasingly more abstract and higher-level image features, and a deconvolutional pathway, which predicts the final segmentation at the voxel level; the joint training of the feature extraction and prediction pathways allows the automatic feature learning at different scales that are optimized for accuracy for any given combination of image types and segmentation task<em> — MICCAI 2008 and ISBI 2015 datasets</em></p><p><strong>SegNet </strong><em>(</em><a href="https://arxiv.org/abs/1511.00561v3"><em>Badrinarayanan, Kendall, Cipolla, 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/segnet-a-deep-convolutional-encoder-decoder">code</a>] — Decoder uses pooling indices computed in the max-pooling step of the corresponding encoder to perform non-linear upsampling (unlike U-Net), which eliminates the need for learning to upsample; comparison with FCN, DeepLab-LargeFOV, and DeconvNet reveals the memory versus accuracy trade-off, efficient computation load due to no fully connected layers or a refinement block— <em>59.9% mIoU @ PASCAL 2012 79.2% mIoU @ CityScapes (w/o coarse)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*VZyBfCKkx6SuiF7bKJ2zdg.png" /></figure><p><strong>W-Net</strong> <em>(</em><a href="https://arxiv.org/abs/1711.08506"><em>Xia &amp; Kulis, 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/w-net-a-deep-model-for-fully-unsupervised">code</a>] —Concatenating two fully convolutional networks together into an autoencoder: one for encoding and one for decoding; the encoding layer produces a k-way pixel-wise prediction, and both the reconstruction error of the autoencoder as well as the normalized cut produced by the encoder are jointly minimized during training — <em>Berkeley Segmentation Data Set (BSDS300, BSDS500)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*8FhXKAITG5bvFUOsB1EWwA.png" /></figure><p><strong>LinkNet </strong><em>(</em><a href="https://arxiv.org/abs/1707.03718"><em>Chaurasia &amp; Culurciello, 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/linknet-exploiting-encoder-representations">code</a>] —The architecture allows learning without any significant increase in the number of parameters: 11.5 million parameters and 21.2 GFLOPs for processing a 3×640×360 image— <em>76.4% class IoU @ CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/287/1*tFpVpOBkgKLufIP0Hl0OzA.png" /></figure><p><strong>Stacked Deconvolutional Network (SDN)</strong> <em>(</em><a href="https://arxiv.org/abs/1708.04943"><em>Fu et al., 2017</em></a><em>) — </em>Multiple shallow deconvolutional networks (SDN units) are stacked to integrate contextual information and guarantee the fine recovery of localization information; inter-unit and intra-unit connections are designed to enhance feature fusion — <a href="https://arxiv.org/abs/1912.10230"><em>83.5% mIoU @ PASCAL 2012</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*YTVHvjTjK1BVLf4zL_L3Tw.png" /></figure><p><strong>HRNet </strong><em>(</em><a href="https://arxiv.org/abs/1909.11065v6"><em>Yuan et al., 2019</em></a><em>)</em> [<a href="https://github.com/openseg-group/openseg.pytorch">code</a>] — Context aggregation and object-contextual representation approaches for semantic segmentation — <em>84.5% on CityScapes test, 45.66% on ADE20K val, 56.65% on LIP val, 56.2% on PASCAL-Context test and 40.5% on COCO-Stuff</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*HMe6pyuGbf6ULbIdzl_dIw.png" /></figure><p><strong>U²-Net</strong> <em>(</em><a href="https://arxiv.org/abs/2005.09007v3"><em>Qin et al., 2020</em></a><em>)</em> [<a href="https://github.com/ShawnBIT/UNet-family">code</a>] — A two-level nested U-structure enables training a deep network without using backbones from image classification tasks; it is able to capture more contextual information from different scales thanks to the mixture of receptive fields of different sizes in the proposed ReSidual U-blocks (RSU), it increases the depth of the whole architecture without significantly increasing the computational cost because of the pooling operations used in these RSU blocks — <em>Salient Object Detection (SOD) datasets</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*D820WW86gTNMJmDA56c7oA.png" /></figure><p><strong>U-Net 3+</strong> <em>(</em><a href="https://arxiv.org/abs/2004.08790"><em>Huang et al., 2020</em></a><em>)</em> [<a href="https://github.com/ShawnBIT/UNet-family">code</a>] — The full-scale skip connections incorporate low-level details with high-level semantics from feature maps on different scales and the deep supervision learns hierarchical representations from the full-scale aggregated feature maps; it can reduce the network parameters to improve the computation efficiency</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*slNmz0fho3RjsGTZHJlCyg.png" /></figure><h3>4. Multi-scale and pyramid network-based models</h3><p><strong>Multi-resolution Reconstruction Based on a Laplacian Pyramid</strong> <em>(</em><a href="https://arxiv.org/abs/1605.02264"><em>Ghiasi &amp; Fowlkes, 2016</em></a><em>)</em> [<a href="https://github.com/golnazghiasi/LRR">code</a>] — A multi-resolution reconstruction architecture based on a Laplacian pyramid that uses skip connections from higher resolution feature maps and multiplicative gating to successively refine segment boundaries reconstructed from lower-resolution maps — 79.9<em>% mIoU @ PASCAL VOC</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*Q7Ur8QSTXE_V0udkc_Zv9A.png" /></figure><p><strong>Feature Pyramid Network (FPN)</strong> <em>(</em><a href="https://arxiv.org/abs/1612.03144"><em>Lin et al., 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/feature-pyramid-networks-for-object-detection">code</a>] — Inherent multi-scale; top-down architecture with lateral connections builds high-level semantic feature maps at all scales; the method can run at 6 FPS on a GPU; may be computationally and memory intensive — <em>COCO Dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*3MmSkwMWvH5TTlVDB_t4cA.png" /></figure><p><strong>Pyramid Scene Parsing Network (PSPN)</strong> <em>(</em><a href="https://arxiv.org/abs/1612.01105"><em>Zhao et al., 2017</em></a><em>)</em> [<a href="https://github.com/hszhao/PSPNet">code</a>] — The capability of global context information by different-region-based context aggregation through a pyramid pooling module together with the proposed PSPNet — <em>mIoU 85.4% @ PASCAL VOC 2012 and 80.2% @ CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/1*9oW6Z3YWc12pMQuVhtc7vg.png" /></figure><p><strong>Context Contrasted Network (CCN)</strong> <em>(</em><a href="https://www.semanticscholar.org/paper/Context-Contrasted-Feature-and-Gated-Multi-scale-Ding-Jiang/ea743597a5f48babef1982259566d76a9bf66bf2"><em>Ding et al., 2018</em></a><em>) — </em>A context contrasted local feature leverages the informative context and spotlights the local information in contrast to the context; a scheme of a gated sum to selectively aggregate multi-scale features for each spatial position</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*dQ7wo_ozV0VNH9hL4HQc6w.png" /></figure><p><strong>Multi-scale Context Intertwining (MSCI)</strong> <em>(</em><a href="https://openaccess.thecvf.com/content_ECCV_2018/html/Di_Lin_Multi-Scale_Context_Intertwining_ECCV_2018_paper.html"><em>Lin et al., 2018</em></a><em>) — </em>Aggregates features from different scales via connections between Long Short-Term Memory (LSTM) chains; limited computational efficiency due to multiple RNN blocks (i.e. LSTMs)<em> — </em><a href="https://arxiv.org/abs/1912.10230"><em>88% mIoU @ PASCAL VOC 2012</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*H5Ay6wtRpHprLHtSSDEbJw.png" /></figure><p><strong>Adaptive Pyramid Context Network (APC-Net)</strong> <em>(</em><a href="https://doi.org/10.1109/CVPR.2019.00770"><em>He et al., 2019</em></a><em>) —</em>Global-guided local affinity can play a vital role in constructing effective context features; APC-Net adaptively constructs multi-scale contextual representations with multiple adaptive context modules<em> — 84.2% @ PASCAL VOC 2012 (w/o training on MS COCO)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*9OKzJ6aborpZ3EDPcNCxpA.png" /></figure><p><strong>Dynamic Multi-scale Filters Network (DM-Net)</strong> <em>(</em><a href="https://paperswithcode.com/paper/dynamic-multi-scale-filters-for-semantic"><em>He, Deng, Qiao, 2019</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/dynamic-multi-scale-filters-for-semantic">code</a>] — The architecture is composed of multiple Dynamic Convolutional Modules arranged in parallel, each of which exploits context-aware filters to estimate semantic representation for a specific scale — <em>84.4% @ PASCAL VOC 2012 (w/o training on MS COCO)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*58ojghr5CkqypxXwLlAJQg.png" /></figure><h3>5. R-CNN-based models (instance segmentation)</h3><p><strong>DeepMask</strong> <em>(</em><a href="https://arxiv.org/abs/1506.06204"><em>Pinheiro, Collobert, Dollar, 2015</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/learning-to-segment-object-candidates">code</a>] — The first part of the system outputs a class-agnostic segmentation mask, while the second part outputs the likelihood of the patch being centered on a full object; substantially higher object recall using fewer proposals; the model is able to generalize to unseen categories it has not seen during training — <em>PASCAL VOC 2007, MS COCO 2014</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*yDNnanxf1J9dO_UvyC0PQg.png" /></figure><p><strong>Multi-task Net for Instance Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1512.04412"><em>Dai, He, Sun, 2016</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/instance-aware-semantic-segmentation-via">code</a>] — The model consists of three networks: differentiating instances, estimating masks, and categorizing objects; these networks form a cascaded structure and share their convolutional features; 360ms testing an image using VGG-16 — <em>MS COCO 2015 competition (1st place)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*df2YdxWsJPrPD4euhg1Kyw.png" /></figure><p><strong>R-FCN</strong> <em>(</em><a href="https://arxiv.org/abs/1605.06409"><em>Dai, Li, He, Sun, 2016</em></a><em>)</em> [<a href="https://github.com/daijifeng001/r-fcn">code</a>] — Position-sensitive score maps to address a dilemma between translation-invariance in image classification and translation-variance in object detection; 170ms per image — <em>83.6% mAP @ PASCAL 2007</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*U3R4ntWN6qX79crUMr9UrA.png" /></figure><p><strong>Mask R-CNN</strong> <em>(</em><a href="https://arxiv.org/abs/1703.06870"><em>He et al., 2017</em></a><em>)</em> [<a href="https://github.com/matterport/Mask_RCNN">code</a>] — Extends Faster R-CNN by adding a branch for predicting an object mask in parallel with the existing branch for bounding box recognition; the model can be easily generalized to other tasks —<em> Outperforms all existing, single-model entries on every task, including the COCO 2016 challenge winners</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*Q1ctkrK88Bc5-LHOZcre0g.png" /></figure><p><strong>MaskLab </strong><em>(</em><a href="https://arxiv.org/abs/1712.04837"><em>Chen et al., 2017</em></a><em>) — </em>Produces three outputs: box detection, semantic segmentation, and direction prediction; built on top of the Faster-RCNN object detector, the predicted boxes provide accurate localization of object instances; within each region of interest, MaskLab performs foreground/background segmentation by combining semantic and direction prediction — <em>COCO Dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*yMjzX8Q-HCRF7g776z78oQ.png" /></figure><p><strong>Boundary-aware Instance Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1612.03129"><em>Hayder, He, Salzmann, 2017</em></a><em>) — </em>An object segment representation based on the distance transform of the object masks; an object mask network (OMN) with a new residual-deconvolution architecture that infers such a representation and decodes it into the final binary object mask — <em>PASCAL VOC 2012, CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*RpXafiJJxORXbRZ4aSXLqQ.png" /></figure><p><strong>Deep Watershed Transform</strong> <em>(</em><a href="https://arxiv.org/abs/1611.08303"><em>Bai &amp; Urtasun, 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/deep-watershed-transform-for-instance">code</a>] — Combines intuitions from the classical watershed transform and modern deep learning to produce an energy map of the image where object instances are unambiguously represented as basins in the energy map — <em>More than doubles the performance of the state-of-the-art on the challenging CityScapes Instance Level Segmentation task</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*KSYyGiRaPsq71skO0maCaw.png" /></figure><p><strong>Instance Segmentation via Deep Metric </strong><em>(</em><a href="https://arxiv.org/abs/1703.10277"><em>Fathi et al., 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/semantic-instance-segmentation-via-deep">code</a>] — A new method for semantic instance segmentation, by first computing how likely two pixels are to belong to the same object, and then by grouping similar pixels together; the similarity metric is based on a deep, fully convolutional embedding model; the grouping method is based on selecting all points that are sufficiently similar to a set of “seed points”, chosen from a deep, fully convolutional scoring model — <em>PASCAL VOC</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*-2GpeJzQhKztW5gBkZFvVw.png" /></figure><p><strong>TensorMask </strong><em>(</em><a href="https://arxiv.org/abs/1903.12174"><em>Chen et al., 2019</em></a><em>)</em> [<a href="https://github.com/facebookresearch/detectron2/tree/main/projects/TensorMask">code</a>] — An under-explored dense sliding-window instance segmentation; this task is fundamentally different than other dense prediction problems such as semantic segmentation or bounding-box object detection, as the output at every spatial location is itself a geometric structure with its own dimensions —<em> COCO Dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*MHkJVSgg6WIal-EXmU4-lw.png" /></figure><p><strong>PolarMask </strong><em>(</em><a href="https://arxiv.org/abs/1909.13226"><em>Xie at al., 2019</em></a><em>)</em> [<a href="https://github.com/xieenze/PolarMask">code</a>] — A conceptually simple anchor-box free and single-shot instance segmentation method, fully convolutional and can be used as a mask prediction module by easily embedding it into most off-the-shelf detection methods; two effective approaches to deal with sampling high-quality center examples and optimization for dense distance regression, respectively, which can significantly improve the performance and simplify the training process —<em>32.9% in mask mAP @ COCO Dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*eft7mjQ1jjhuM6BXPIdcSw.png" /></figure><p><strong>YOLACT: Real-time Instance Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1904.02689"><em>Bolya et al., 2019</em></a><em>)</em> [<a href="https://github.com/dbolya/yolact">code</a>] —Breaks instance segmentation into two parallel subtasks: generating a set of prototype masks and predicting per-instance mask coefficients; instance masks are produced by a linear combination of prototypes and mask coefficients — <em>29.8 mAP @ MS COCO at 33.5 FPS evaluated on a single TitanXP</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*u0mmy1TnNP1inS2917vaUg.png" /></figure><p><strong>YOLACT++</strong> <em>(</em><a href="https://arxiv.org/abs/1912.06218"><em>Bolya et al., 2020</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/yolact-better-real-time-instance-segmentation">code</a>] — In addition to YOLACT, a Fast NMS is proposed, a drop-in 12 ms faster replacement for standard NMS that only has a marginal performance penalty; the model incorporates deformable convolutions into the backbone network, optimizes the prediction head with better anchor scales and aspect ratios, and adds a novel fast mask re-scoring branch — <em>34.1 mAP @ MS COCO at 33.5 FPS</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*eIJeLs0SoyD9xzUkuA9q0Q.png" /></figure><p><strong>CenterMask </strong><em>(</em><a href="https://arxiv.org/abs/1911.06667"><em>Lee &amp; Park, 2020</em></a><em>)</em> [<a href="https://github.com/youngwanLEE/CenterMask">code</a>] — A simple yet efficient anchor-free instance segmentation, that adds a novel spatial attention-guided mask (SAG-Mask) branch to an anchor-free one-stage object detector (FCOS) in the same vein with Mask R-CNN; plugged into the FCOS object detector, the SAG-Mask branch predicts a segmentation mask on each box with the spatial attention map that helps to focus on informative pixels and suppress noise; improved VoVNetV2 backbone networks–<em>MS COCO at 35 FPS on TitanXP</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*x6tg5aOFZlWW9piWwIUL2A.png" /></figure><p><strong>PolarMask++ </strong><em>(</em><a href="https://arxiv.org/abs/2105.02184"><em>Xie at al., 2021</em></a><em>)</em> [<a href="https://github.com/xieenze/PolarMask">code</a>] — The polar representation unifies instance segmentation (masks) and object detection (bounding boxes) into a single framework, reducing the design and computational complexity; two modules are designed to sample high-quality center examples and optimize polar contour regression, making the performance of PolarMask does not depend on the bounding box prediction results and thus becomes more efficient in training; it is fully convolutional and can be easily embedded into most off-the-shelf detection methods — <em>ICDAR2015, DSB2018, MS COCO</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*-fuDL9j7y5cqRHnwz-MMJQ.png" /></figure><h3>6. Dilated convolutional models</h3><p><strong>DeepLab v1</strong> <em>(</em><a href="https://arxiv.org/abs/1412.7062"><em>Chen et al., 2014</em></a><em>)</em> [<a href="https://bitbucket.org/deeplab/deeplab-public/src">code</a>] — Brings together methods from DCNNs and probabilistic graphical models for addressing the task of pixel-level classification —<em>71.6% mIoU @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*3JZ7d8A07BGMrMf-en4JxQ.png" /></figure><p><strong>Multiscale Context Aggregation</strong> <em>(</em><a href="https://arxiv.org/abs/1511.07122"><em>Yu &amp; Koltun, 2015</em></a><em>)</em> [<a href="https://github.com/fyu/dilation">code</a>] —Increases the accuracy of segmentation systems; it uses dilated convolutions to systematically aggregate multi-scale contextual information without losing resolution; the architecture is based on the fact that dilated convolutions supports exponential expansion of the receptive field without loss of resolution or coverage —67<em>.6% mIoU @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*ZHHyOhfAlc4j20_EzBs0xw.png" /></figure><p><strong>Efficient Neural Network (ENet)</strong> <em>(</em><a href="https://arxiv.org/abs/1606.02147"><em>Paszke et al., 2016</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/enet-a-deep-neural-network-architecture-for">code</a>] — Created specifically for tasks requiring low latency operation. It is up to 18x faster, requires 75x fewer FLOPs, has 79x fewer parameters, and provides similar or better accuracy to existing models — <em>80.4% Category IoU @ CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*ci-K7lVq1eCm-Q70T99A7w.png" /></figure><p><strong>DeepLab v2</strong> <em>(</em><a href="https://arxiv.org/abs/1606.00915"><em>Chen et al., 2017</em></a><em>) </em>[<a href="https://paperswithcode.com/paper/deeplab-semantic-image-segmentation-with-deep">code</a>] — The authors (1) highlight convolution with upsampled filters, “atrous convolution” —a powerful tool in dense prediction tasks, provides resolution control and FOV expansion, (2) propose atrous spatial pyramid pooling to robustly segment objects at multiple scales, (3) improve the localization of object boundaries by combining methods from DCNNs and probabilistic graphical models — 79.7<em>% mIoU @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*c6R7TMgMn5xj1M24j0ktEg.png" /></figure><p><strong>DeepLab v3</strong> <em>(</em><a href="https://arxiv.org/abs/1706.05587"><em>Chen et al., 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/rethinking-atrous-convolution-for-semantic">code</a>] —Augmenting the previously proposed Atrous Spatial Pyramid Pooling module, which probes convolutional features at multiple scales, with image-level features encoding global context and further boost performance. DeepLabv3 significantly improves over the previous DeepLab versions w/o DenseCRF post-processing and attains comparable performance with other state-of-art models on the PASCAL VOC 2012 benchmark</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*lme4rPKH-58DNLte4pXUZw.png" /></figure><p><strong>DeepLab v3+</strong><em>(</em><a href="https://arxiv.org/abs/1802.02611"><em>Chen et al., 2018</em></a><em>)</em> [<a href="https://github.com/tensorflow/models">code</a>] — A combination of the advantages of previous methods: ‘3+’ extends DeepLabv3 by adding a simple and effective decoder module to refine the segmentation results along object boundaries; Xception &amp; depthwise separable convolution to both Atrous Spatial Pyramid Pooling and decoder modules resulting in a faster and stronger encoder-decoder network — <em>89.0% @ PASCAL VOC 2012, 82.1% @ CityScapes w/o any post-processing</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*TyxWFbjGX9DX0rEgSBf3IQ.png" /></figure><p><strong>Dense Upsampling Convolution — Hybrid Dilated Convolution (DUC-HDC)</strong> <em>(</em><a href="https://arxiv.org/abs/1702.08502"><em>Wang et al., 2018</em></a><em>)</em> [<a href="https://github.com/TuSimple/TuSimple-DUC">code</a>] — Improving pixel-wise semantic segmentation by manipulating convolution-related operations: 1) effectively enlarges the receptive fields (RF) of the network to aggregate global information; 2) alleviates what we call the “gridding issue” caused by the standard dilated convolution operation — <em>80.1% mIoU @ CityScapes, 83.1% @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*TWEfmy9uDfAo8QXcDYN2CA.png" /></figure><p><strong>Densely Connected Atrous Spatial Pyramid Pooling (DenseASPP) </strong><em>(</em><a href="https://doi.org/10.1109/CVPR.2018.00388"><em>Yang et al., 2018</em></a><em>) — </em>Connects a set of atrous convolutional layers in a dense way, such that it generates multi-scale features that not only cover a larger scale range, but also cover that scale range densely, without significantly increasing the model size</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*c6I3XGz1AInr52Wb6cOaEw.png" /></figure><h3>7. Recurrent neural network-based models</h3><p><strong>LSTM-based Pixel-level Segmentation</strong> <em>(</em><a href="https://openaccess.thecvf.com/content_cvpr_2015/papers/Byeon_Scene_Labeling_With_2015_CVPR_paper.pdf"><em>Byeon et al., 2015</em></a><em>) — </em>Classification, segmentation, and context integration are all carried out by 2D LSTM networks, allowing the texture and spatial model parameters to be learned within a single model; it has low computational complexity and efficiently captures local and global contextual information over raw RGB values and adapts well to complex scene images —<em> 78.56% Pixel accuracy @ Stanford Background Dataset, 3.7(s) (CPU) computing time, 155k parameters</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*8maAWAEWczIPJE4jN9cS0A.png" /></figure><p><strong>ReSeg</strong> <em>(</em><a href="https://arxiv.org/abs/1511.07053"><em>Visin et al., 2016</em></a><em>)</em> [<a href="https://github.com/fvisin/reseg">code</a>] — ReNet layers (each layer is composed of four RNN that sweep the image horizontally and vertically in both directions, encoding patches or activations, and providing relevant global information) are stacked on top of pre-trained convolutional layers, benefiting from generic local features —<em> 91.6% mIoU @ Weizmann Horses, 93.7% mIoU @ Oxford Flowers</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*o6PtAsLhCAhzTWBPQPyfGQ.png" /></figure><p><strong>Graph LSTM-based Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1603.07063"><em>Liang et al., 2016</em></a><em>) — </em>It takes each arbitrary-shaped superpixel as a semantically consistent node, and adaptively constructs an undirected graph for each image, where the spatial relations of the superpixels are used as edges; it is naturally aligned with the visual patterns and provides an economical information propagation route — <em>74.75% IoU-70.05% IoU @ Horse-Cow object parsing dataset, 60.16% @ PASCAL-Person-Part</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*-SY4SONkC_EyYl9kHkdQuA.png" /></figure><p><strong>Data Associated Recurrent Neural Network (DA-RNN)</strong> <em>(</em><a href="https://arxiv.org/abs/1703.03098"><em>Xiang &amp; Fox, 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/da-rnn-semantic-mapping-with-data-associated">code</a>] — A joint 3D scene mapping and semantic labeling framework; an RNN architecture for semantic labeling on RGB-D videos with integration output to mapping devices — <em>93.1% avg pixel labeling @ RGB-D Scene dataset, 85.9% avg pixel labeling @ ShapeNet Scene dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*6IKI0O_17rCtOTkSu6YUhg.png" /></figure><h3>8. Attention-based models</h3><p><strong>Attention-based Semantic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1511.03339"><em>Chen et al., 2016</em></a><em>) — </em>An attention mechanism learns to softly weight the multi-scale features at each pixel location; adapts a state-of-the-art semantic image segmentation model, which has been jointly trained with multi-scale input images and the attention model — <em>The best model (56.39%) attains 2.67% better performance than DeepLabMSc-LargeFOV (53.72%); PASCAL-Person-Part, PASCAL VOC 2012 and a subset of MS-COCO 2014</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*L894__UNWRtDgXmiGprsHg.png" /></figure><p><strong>Reverse Attention Network (RAN)</strong> <em>(</em><a href="https://arxiv.org/abs/1707.06426"><em>Huang et al., 2017</em></a><em>) — </em>A three-branch network built upon DeepLabv2-LargeFOV performs the direct, reverse and reverse-attention learning processes simultaneously — <em>48.1% mIoU @ PASCAL-Context; 66.6% mIoU @ PASCAL Person-Part, 80.5% mIoU @ PASCAL-VOC, 41.2% mIoU @ NYUDv2 and 35.3% mIoU @ ADE20K</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*rSG522-m-f_sGPEnRKbLyg.png" /></figure><p><strong>End-to-end Instance Segmentation with Recurrent Attention</strong> <em>(</em><a href="https://arxiv.org/abs/1605.09410"><em>Ren &amp; Zemel, 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/end-to-end-instance-segmentation-with">code</a>] — RNN architecture with an attention mechanism jointly trained to sequentially produce regions of interest as well as a dominant object segmentation within each region to model a human-like counting process, and produce detailed instance segmentations — <em>80.0 MWCov @ KITTI, and 9.5 AP @ Cityscapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*udXuVl4GG1tbCah1P6xXmA.png" /></figure><p><strong>Pyramid Attention Network (PAN) for Semantic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1805.10180"><em>Li et al., 2018</em></a><em>) — </em>Feature Pyramid Attention module to perform spatial pyramid attention structure on high-level output and combining global pooling to learn a better feature representation, and a Global Attention Upsample module on each decoder layer to provide global context as guidance of low-level features to select category localization details — <em>84.0% mIoU @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*v1I4HuIAJ7dDug9ynec97w.png" /></figure><p><strong>OCNet</strong> <em>(</em><a href="https://arxiv.org/abs/1809.00916"><em>Yuan et al., 2018</em></a><em>)</em> [<a href="https://github.com/openseg-group/OCNet.pytorch">code</a>] —An efficient interlaced sparse self-attention scheme to model dense relations (as surrogates for binary relation matrices) between any two of all pixels via the combination of two sparse relation matrices — <em>82.5% mIoU @ CityScapes test, 45.5% @ ADE20K val</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*M5QOyG8o8Xb0TKOqK46UTA.png" /></figure><p><strong>Pointwise Spatial Attention Network for Scene Parsing (PSANet)</strong> <em>(</em><a href="https://openaccess.thecvf.com/content_ECCV_2018/html/Hengshuang_Zhao_PSANet_Point-wise_Spatial_ECCV_2018_paper.html"><em>Zhao et al., 2018</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/psanet-point-wise-spatial-attention-network">code</a>] — Relaxes local neighborhood constraints with each position on the feature map connected to all the other ones through a self-adaptively learned attention mask; information propagation in bi-direction for scene parsing is enabled —<em> 85.7% mIoU @ PASCAL VOC 2012, 43.77% mIoU @ ADE20K, 81.4% mIoU @ CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*rhy5_6Fn7ixSoQg81DjM9Q.png" /></figure><p><strong>Discriminative Feature Network (DFN)</strong> <em>(</em><a href="https://arxiv.org/abs/1804.09337"><em>Yu et al., 2018</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/learning-a-discriminative-feature-network-for">code</a>] — Contains Smooth and Border sub-networks to handle the intra-class inconsistency problem and to select the more discriminative features — <em>86.2% mIoU @ PASCAL VOC 2012, 80.3% mIoU @ CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*YCUuIhH3c1dujHNiuaGXoQ.png" /></figure><p><strong>Dual Attention Network (DANet)</strong><em>(</em><a href="https://arxiv.org/abs/1809.02983"><em>Fu et al., 2019</em></a><em>)</em> [<a href="https://github.com/junfu1115/DANet">code</a>] — Adaptively integrates local features with their global dependencies utilizing two appended attention modules on top of traditional dilated FCN, which model the semantic interdependencies in spatial and channel dimensions — <em>81.5% mIoU @ CityScapes, 82.6% mIoU @ PASCAL VOC 2012, 39.7% mIoU @ COCO Stuff</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*HiiMzSqnbr3ytOQbh7h6JQ.png" /></figure><p><strong>Expectation-Maximization Attention (EMANet)</strong> <em>(</em><a href="https://arxiv.org/abs/1907.13426"><em>Li et al., 2019</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/expectation-maximization-attention-networks">code</a>] — Self-attention mechanism designed to compute the representation of each position by a weighted sum of the features at all positions formulated into an expectation-maximization manner; the EMA module is robust to the variance of input and is also friendly in memory and computation, the resulting representation is low-rank and deprecates noisy information from the input — <em>88.2% mIoU @ PASCAL VOC 2012, 39.9% mIoU @ COCO Stuff, 43.1GFLOPs, 22.1M Memory, 10.0M Parameters</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*r7PtUusi3rf6OiV0bsLT_w.png" /></figure><p><strong>Criss-Cross Attention Network (CCNet)</strong> <em>(</em><a href="https://arxiv.org/abs/1811.11721"><em>Huang et al., 2019</em></a><em>)</em> [<a href="https://github.com/speedinghzl/CCNet">code</a>] — Full-image contextual information in a very efficient way: for each pixel, a criss-cross attention module harvests the contextual information of all the pixels on its criss-cross path — <em>81.9% mIoU @ CityScapes test, 45.76% mIoU @ ADE20K validation, 55.47% mIoU @ LIP validation</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*CzbNjvvw_SECX6L4n_elag.png" /></figure><h3>9. Generative models and adversarial training</h3><p><strong>Adversarial Network for Semantic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1611.08408"><em>Luc et al., 2016</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/semantic-segmentation-using-adversarial">code</a>] — Training of a convolutional semantic segmentation network along with an adversarial network that discriminates segmentation maps coming either from the ground truth or from the segmentation network — 73.3<em>% mIoU @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*BNVDD-r53jnM4_o7fp22CQ.png" /></figure><p><strong>Semi-weakly Supervised GAN-based Semantic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1703.09695"><em>Souly, Spampinato, Shah, 2017</em></a><em>) — </em>Consists of a generator network to provide extra training examples to a multi-class classifier, acting as a discriminator in the GAN framework, that assigns sample a label <em>y</em> from the K possible classes or marks it as a fake sample (extra class); adding large fake visual data forces real samples to be close in the feature space, enabling a bottom-up clustering process, which, in turn, improves multiclass pixel classification — <em>PASCAL VOC 2012, SiftFlow, StanfordBG, CamVid</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*lS2vMjXxjfJpFze1PTWCuA.png" /></figure><p><strong>Semi-supervised Adversarial Network-based Semantic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1802.07934"><em>Hung et al., 2018</em></a><em>)</em> [<a href="https://github.com/hfslyc/AdvSemiSeg">code</a>] — Leverages unlabeled images to enhance the segmentation model; discriminator designed in a fully convolutional manner to differentiate the predicted probability maps from the ground truth segmentation distribution with the consideration of the spatial resolution; the proposed discriminator can be used to improve semantic segmentation accuracy by coupling the adversarial loss with the standard cross-entropy loss of the proposed model; it enables semi-supervised learning through discovering the trustworthy regions in predicted results of unlabeled images — <em>PASCAL VOC 2012 and CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*0Vg7MbtYe6mietANz9bv2w.png" /></figure><p><strong>SeGAN: Adversarial Network with Multi-scale L1 Loss</strong> <em>(</em><a href="https://doi.org/10.1007/s12021-018-9377-x"><em>Xue et al., 2018</em></a><em>) </em>[<a href="https://github.com/YuanXue1993/SegAN">code</a>] — FCN to generate segmentation label maps, and a novel adversarial critic network with a multi-scale <em>L</em>1 loss function to force the critic and segmentor to learn both global and local features that capture long- and short-range spatial relationships between pixels; SegAN framework is more effective and stable for the segmentation task, and it leads to better performance than the state-of-the-art U-Net method — <em>MICCAI BRATS brain tumor dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*MDqvY_FkwLXVxdsSWkDT0w.png" /></figure><p><strong>SeGAN: Segmentation and Generation of the Invisible Parts of Objects </strong><em>(</em><a href="https://arxiv.org/abs/1703.10239"><em>Ehsani, Mottaghi, Farhadi, 2018</em></a><em>)</em> [<a href="https://github.com/ehsanik/SeGAN">code</a>] —Studied the challenging problem of completing the appearance of occluded objects; SeGAN trained on synthetic photo-realistic images and jointly optimized for both segmentation and generation of the invisible parts of objects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*OUO5qMJ0GKQyITs1NtPwXg.png" /></figure><h3>10. Convolutional models with active contour models</h3><p><strong>Deep Active Contours</strong> <em>(</em><a href="https://arxiv.org/abs/1607.05074"><em>Rupprecht et al., 2016</em></a><em>) </em>— Class-specific CNN predicts a vector pointing from the respective point on the evolving contour towards the closest point on the boundary of the object of interest; the resulting interactive segmentation method is very efficient in terms of required computational resources and can even be trained on comparatively small graphics cards— <em>STACOM, PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*ZL9X5TSKePAFCMLlpL5u3w.png" /></figure><p><strong>ACM Post-processor</strong> <em>(</em><a href="https://arxiv.org/abs/1704.03593"><em>Le et al., 2018</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/reformulating-level-sets-as-deep-recurrent">code</a>] — A novel definition of contour evolution, Recurrent Level Set (RLS), to employ Gated Recurrent Unit under the energy minimization of a variational LS functional. The curve deformation process in RLS is formed as a hidden state evolution procedure and updated by minimizing an energy function composed of fitting forces and contour length. By sharing the convolutional features in a fully end-to-end trainable framework, it extends RLS to Contextual RLS (CRLS) to address semantic segmentation in the wild. The RLS improves both computational time and segmentation accuracy against the classic variations LS-based method, whereas the full end-to-end system CRLS achieves competitive performance — <em>66.7% mAP @ 0.5 on PASCAL VOC 2012, 40.1% mAP @ 0.5 on MS COCO 2014</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*UAc2c_-XX0_Q6bttG79xSA.png" /></figure><p><strong>Deep Structured Active Contours (DSAC)</strong> <em>(</em><a href="https://arxiv.org/abs/1803.06329"><em>Marcos et al., 2018</em></a><em>)</em> [<a href="https://github.com/dmarcosg/DSAC">code</a>] — Building footprint segmentation by exploiting the distinct geometric properties; trainable end-to-end DSAC integrates priors and constraints into the segmentation process, such as continuous boundaries, smooth edges, and sharp corners; it employs Active Contour Models (ACM), a family of constraint- and prior-based polygonal models —<em> 84.0% mIoU @ TorontoCity dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*QvTn-Xi0PrnCkyN0u-rD2g.png" /></figure><p><strong>Deep Active Lesion Segmentation (DALS)</strong> <em>(</em><a href="https://arxiv.org/abs/1908.06933"><em>Hatamizadeh et al., 2019</em></a><em>)</em> [<a href="https://github.com/ahatamiz/dals">code</a>] —Fully automated framework that leverages the powerful nonlinear feature extraction abilities of FCNNs and the precise boundary delineation abilities of Active Contour Models (ACMs); it benefits from an improved level-set ACM formulation with a per-pixel-parameterized energy functional and a novel multiscale encoder-decoder CNN that learns an initialization probability map along with parameter maps for the ACM — <em>Multiorgan Lesion Segmentation (MLS) dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*35WRt3pCyFK5Na7CKwhJag.png" /></figure><p><strong>Deep Active Ray Network (DARNet)</strong> <em>(</em><a href="https://arxiv.org/abs/1905.05889"><em>Cheng et al., 2019</em></a><em>)</em> [<a href="https://github.com/dcheng-utoronto/darnet">code</a>] — Automatic building segmentation: the backbone CNN predicts energy maps for energy function construction, while the polygon-based contour evolves through energy minimization; the proposed loss function directly encourages the contours to match building boundaries — <em>88.24% mIoU @ TorontoCity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*eJRC41M-797Maw0tVbRWWg.png" /></figure><p><strong>Deep Convolutional Active Contours (DCAC)</strong> <em>(</em><a href="https://arxiv.org/abs/1909.13359"><em>Hatamizadeh, Sengupta, Terzopoulos, 2019</em></a><em>) — </em>End-to-end trainable framework comprising a CNN and an ACM with learnable parameters; the ACM’s Eulerian energy functional includes per-pixel parameter maps predicted by the backbone CNN, which also initializes the ACM —<em> 92.9% mIoU @ TorontoCity</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*WYNE37oj7Sb5jMGkKkwnHg.png" /></figure><h3>11. Panoptic segmentation</h3><p><strong>Panoptic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1801.00868"><em>Kirillov et al., 2018</em></a><em>)</em> [<a href="https://github.com/cocodataset/panopticapi">code</a>] — An important step toward real-world vision systems, which unifies the typically distinct tasks of semantic segmentation (assign a class label to each pixel) and instance segmentation (detect and segment each object instance); the proposed novel panoptic quality metric captures performance for all classes in an interpretable and unified manner — <em>CityScapes, ADE20K, Vistas</em></p><p><strong>Panoptic Feature Pyramid Network</strong> <strong>(Panoptic FPN)</strong> <em>(</em><a href="https://arxiv.org/abs/1901.02446"><em>Kirillov et al., 2019</em></a><em>)</em> [<a href="https://github.com/facebookresearch/detectron2">code</a>] — Endowing Mask R-CNN with a semantic segmentation branch using a shared Feature Pyramid Network (FPN) backbone; this simple baseline not only remains effective for instance segmentation but also yields a lightweight, top-performing method for semantic segmentation — <em>28.8% mIoU @ COCO, 79.1% mIoU @ Cityscapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*TshQSq3Ipdq47w-Wjq5tYw.png" /></figure><p><strong>Attention-guided Network for Panoptic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1812.03904"><em>Li et al., 2019</em></a><em>) — </em>Unified framework with two branches for foreground (FG) and background (BG) segmentation simultaneously; RPN and FG segmentation mask are added to the BG branch to provide object-level and pixel-level attention; the approach is generalized to different backbones with consistent accuracy gain in both FG and BG segmentation —<em>46.5% PQ @ MS-COCO, 59.0% PQ @ Cityscapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*-NTlscZ7S0todg3XbyJXGA.png" /></figure><p><strong>Seamless Scene Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/1905.01220"><em>Porzi et al., 2019</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/seamless-scene-segmentation">code</a>] —Architecture takes advantage of a novel segmentation head that seamlessly integrates multi-scale features generated by a Feature Pyramid Network with contextual information conveyed by a light-weight DeepLab-like module; proposed alternative metric overcomes panoptic limitations when evaluating non-instance categories — <em>60.3% PQ @ CityScapes, 37.7% PQ @ Mapillary Vistas</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*hrnCWwXPCTYWbII3WUZttA.png" /></figure><p><strong>Panoptic DeepLab</strong> <em>(</em><a href="https://arxiv.org/abs/1910.04751"><em>Cheng et al., 2019</em></a><em>)</em> [<a href="https://github.com/bowenc0221/panoptic-deeplab">code</a>] — Bottom-up and single-shot approach for panoptic segmentation with adopted dual-ASPP and dual-decoder structures specific to semantic and instance segmentation, respectively; semantic segmentation branch is typical to any segmentation model (e.g., DeepLab), while the instance segmentation branch is class-agnostic, involving a simple instance center regression — <em>65.5% PQ @ CotyScapes test, Mapillary Vistas</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*AJYq1ic_q-KHrtjPnO7Pqg.png" /></figure><p><strong>UPSNet:</strong> <strong>Unified Panoptic Segmentation Network</strong> <em>(</em><a href="https://arxiv.org/abs/1901.03784"><em>Xiong et al., 2019</em></a><em>)</em> [<a href="https://github.com/uber-research/UPSNet">code</a>] —Deformable convolution-based semantic segmentation head and a Mask R-CNN style instance segmentation head on top of a single backbone residual network; a parameter-free panoptic head solves the panoptic segmentation via pixel-wise classification and handles the challenge caused by the varying number of instances and permits back propagation to the bottom modules in an end-to-end manner — <em>79.2% mIoU @ CityScapes pre-trained on COCO</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*bkk1QSfcFWZ1sgErsyyAWw.png" /></figure><p><strong>EfficientPS:</strong> <strong>Efficient Panoptic Segmentation</strong> <em>(</em><a href="https://arxiv.org/abs/2004.02307"><em>Mohan &amp; Valada, 2020</em></a><em>)</em> [<a href="https://github.com/DeepSceneSeg/EfficientPS">code</a>] —Shared backbone efficiently encodes and fuses semantically rich multi-scale features; a new semantic head aggregates fine and contextual features coherently, and a new variant of Mask R-CNN as the instance head; novel panoptic fusion module congruously integrates the output logits from both the heads of the EfficientPS architecture to yield the final panoptic segmentation output — <em>82.1% mIoU @ CityScapes test</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*m-dlE4wHDprB-fBzVEwY8A.png" /></figure><h3>12. Other models</h3><p><strong>BoxSup</strong> <em>(</em><a href="https://arxiv.org/abs/1503.01640"><em>Dai, He, Sun, 2015</em></a><em>)</em> [<a href="https://github.com/MaKaNu/boxsup-pytorch">code</a>] — Method achieves competitive accuracy but only requires easily obtained bounding box annotations; it iterates between automatically generating region proposals and training convolutional networks gradually recovering segmentation masks —<em> PASCAL VOC 2012 and PASCAL-CONTEXT</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*gkwzG9Cn1hV4kpgQ3XF21A.png" /></figure><p><strong>Feedforward-Net</strong> <em>(</em><a href="https://arxiv.org/abs/1412.0774"><em>Mostajabi, Yadollahpour, Shakhnarovich, 2015</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/feedforward-semantic-segmentation-with-zoom">code</a>] — Maps small image elements (superpixels) to rich feature representations extracted from a sequence of nested regions of increasing extent; the approach exploits statistical structure in the image and in the label space without setting up explicit structured prediction mechanisms, and thus avoids complex and expensive inference—<em> 64.4% average accuracy @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*5PxqtyavZIoGQwiVnVnT5Q.png" /></figure><p><strong>Saliency-aware Models for Geodesic Video Segmentation</strong> <em>(</em><a href="https://openaccess.thecvf.com/content_cvpr_2015/papers/Wang_Saliency-Aware_Geodesic_Video_2015_CVPR_paper.pdf"><em>Wang, Shen, Porikli, 2015</em></a><em>) — </em>Unsupervised, geodesic distance-based, salient video object segmentation method; spatiotemporal saliency maps, appearance models, and dynamic location models are combined into an energy minimization framework to attain both spatially and temporally coherent object segmentation — <em>SegTrack v2 and YouTube datasets</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*0HIR9fROJpELFvsON7Gb8Q.png" /></figure><p><strong>RefineNet </strong><em>(</em><a href="https://arxiv.org/abs/1611.06612"><em>Lin et al., 2017</em></a><em>)</em> [<a href="https://github.com/guosheng/refinenet">code</a>] — Generic multi-path refinement network that explicitly exploits all the information available along the down-sampling process to enable high-resolution prediction using long-range residual connections; the deeper layers that capture high-level semantic features can be directly refined using fine-grained features from earlier convolutions — <em>83.4% mIoU @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*BDmnPUI9dM3DwlBBWm1AIA.png" /></figure><p><strong>Graph Convolutional Networks</strong> <em>(</em><a href="https://arxiv.org/abs/1703.02719"><em>Peng et al., 2017</em></a><em>) </em>[<a href="https://paperswithcode.com/paper/large-kernel-matters-improve-semantic">code</a>] — Large kernel (and effective receptive field) plays an important role in performing the clas- sification and localization tasks simultaneously; a Global Convolutional Network addresses both the classification and localization issues — <em>82.2% mIoU @ PASCAL VOC 2012, 76.9% mIoU @ CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*OIxfinWHw0u-od7Ca4rQ0g.png" /></figure><p><strong>Dual Image Segmentation (DIS)</strong><em> (</em><a href="https://openaccess.thecvf.com/content_ICCV_2017/papers/Luo_Deep_Dual_Learning_ICCV_2017_paper.pdf"><em>Luo et al., 2017</em></a><em>) — </em>Two complementary learning problems that are jointly solved: one predicts label maps and tags from images, and the other reconstructs the images using the predicted label maps — <em>86.8% mIoU @ PASCAL VOC 2012, 45.5M parameters, 0.14(s) computing speed</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*oytSUfM1fyVuXX1s87joQg.png" /></figure><p><strong>FoveaNet (Perspective-aware Scene Parsing)</strong> <em>(</em><a href="https://arxiv.org/abs/1708.02421"><em>Li et al., 2017</em></a><em>) — A m</em>odel to fully exploit the perspective geometry of scene images and address the common failures of generic parsing models; it estimates the perspective geometry of a scene image through a CNN which integrates supportive evidence from contextual objects within the image; FoveaNet “undoes” the camera perspective projection analyzing regions in the space of the actual scene, and thus provides much more reliable parsing results — <em>CityScapes, CamVid</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*n9FGyu6nxl3ubPwpQP1XQg.png" /></figure><p><strong>CascadeNet</strong> <em>(</em><a href="https://openaccess.thecvf.com/content_cvpr_2017/html/Zhou_Scene_Parsing_Through_CVPR_2017_paper.html"><em>Zhou et al., 2017</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/semantic-understanding-of-scenes-through-the">code</a>] — A novel network design is proposed to parse a scene into stuff, objects, and object parts in a cascade and improve over the baselines; the trained scene parsing networks can lead to applications such as image content removal and scene synthesis — <em>ADE20K</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*8fqfdVSDJ1RWYi8YfXT4zg.png" /></figure><p><strong>Scale-adaptive Convolutions (SAC)</strong> <em>(</em><a href="https://openaccess.thecvf.com/content_iccv_2017/html/Zhang_Scale-Adaptive_Convolutions_for_ICCV_2017_paper.html"><em>Zhang et al., 2017</em></a><em>) — </em>Acquires flexible-size receptive fields during scene parsing; by adding a new scale regression layer, it can dynamically infer the position-adaptive scale coefficients to resize the convolutional patches, which, in turn, alleviates the problems of invisible small objects and inconsistent large-object predictions — <em>78.1% mIoU @ CityScapes, 81.86% mIoU @ ADE20K</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*974yoHlvvpxaI-grlnHuUQ.png" /></figure><p><strong>Context Encoding Network (EncNet)</strong> <em>(</em><a href="https://arxiv.org/abs/1803.08904"><em>Zhang et al., 2018</em></a><em>)</em> [<a href="https://github.com/zhanghang1989/PyTorch-Encoding">code</a>] —Context Encoding Module significantly improves semantic segmentation results with only marginal extra computation cost over FCN; it captures the semantic context of scenes and selectively highlights class-dependent feature maps— <em>51.7% mIoU @ PASCAL-Context, 85.9% mIoU @ PASCAL VOC 2012, final score of 0.5567 on ADE20K test set</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*Km5hGfsQEzFIhkgELtmq4w.png" /></figure><p><strong>Dynamic-structured Semantic Propagation Network (DSSPN)</strong> <em>(</em><a href="https://arxiv.org/abs/1803.06067"><em>Liang, Zhou, Xing, 2018</em></a><em>) — </em>Builds a semantic neuron graph by explicitly incorporating the semantic concept hierarchy into network construction; each neuron represents the instantiated module for recognizing a specific type of entity such as a super-class (e.g. food) or a specific concept (e.g. pizza)<em>— 43.68% mIoU @ ADE20K, 38.9% mIoU @ COCO-Stuff, 76.7% IoU class @ CityScapes, 45.01% mIoU @ Mapillary</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*F75K34ybrsa2L18pE0q74Q.png" /></figure><p><strong>Symbolic Graph Reasoning (SGR)</strong> <em>(</em><a href="https://papers.nips.cc/paper/2018/hash/cbb6a3b884f4f88b3a8e3d44c636cbd8-Abstract.html"><em>Liang et al., 2018</em></a><em>) — </em>SGR layer performs reasoning over a group of symbolic nodes whose outputs explicitly represent different properties of each semantic in a prior knowledge graph; it can be injected between any convolution layers and instantiated with distinct prior graphs, which significantly improves plain ConvNets on semantic segmentation and image classification tasks — <em>39.1% mIoU @ COCO-Stuff, 52.5% mIoU @ PASCAL-Context</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*qN_tzxhY9GH28a0c0SYjVw.png" /></figure><p><strong>Unified Perceptual Parsing Network (UPerNet)</strong> <em>(</em><a href="https://arxiv.org/abs/1807.10221"><em>Xiao et al., 2018</em></a><em>)</em> [<a href="https://github.com/CSAILVision/unifiedparsing">code</a>] — A multi-task framework and a training strategy are developed to learn from heterogeneous image annotations; it is applied to discover visual knowledge in natural scenes — <em>41.22% mIoU @ ADE20K</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*fWsZjjDD5TGvvIjvua0p5Q.png" /></figure><p><strong>SeedNet</strong> <em>(</em><a href="https://openaccess.thecvf.com/content_cvpr_2018/html/Song_SeedNet_Automatic_Seed_CVPR_2018_paper.html"><em>Song, Myeong, Mu Lee, 2018</em></a><em>)</em> [<a href="https://github.com/kelawaad/SeedNet">code</a>] — Allows users to reduce the number of inputs significantly; it formulates automatic seed generation problem as Markov Decision Process and then optimizes it by reinforcement learning with Deep Q-Network; the network achieves notable performance improvement from inaccurate initial segmentation on both seen and unseen datasets — <em>MSRA10K dataset</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*DyqxZY7BlpcwxljM9WERHA.png" /></figure><p><strong>ExFuse: Enhancing Feature Fusion</strong> <em>(</em><a href="https://arxiv.org/abs/1804.03821"><em>Zhang et al., 2018</em></a><em>) — </em>Introduces semantic information into low-level features and high-resolution details into high-level features to provide effective fusion; it bridges the gap between low-level and high-level features thus significantly improving the segmentation quality by 4.0% in total —<em>87.9% mIoU @ PASCAL VOC 2012</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*ZJ5Al5iWhaJp-A16Tkxj8w.png" /></figure><p><strong>Bilateral Segmentation Network (BiSeNet)</strong> <em>(</em><a href="https://arxiv.org/abs/1808.00897"><em>Yu et al., 2018</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/bisenet-bilateral-segmentation-network-for">code</a>] —Designs a Spatial Path with a small stride to preserve spatial information and generate high-resolution features; a Context Path with a fast downsampling strategy is employed to obtain sufficient receptive field; on top of the two paths, a new Feature Fusion Module is introduced to combine all features efficiently, making a right balance between speed and segmentation performance — <em>68.4% mIoU @ Cityscapes; CamVid, COCO-Stuff</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*AuYFlNQhP4SnHByso7Wypg.png" /></figure><p><strong>Wide ResNet</strong> <em>(</em><a href="https://arxiv.org/abs/1611.10080"><em>Wu et al., 2019</em></a><em>)</em> [<a href="https://github.com/itijyou/ademxapp">code</a>] — A new shallower architecture of residual networks which significantly outperforms much deeper models such as ResNet-200 on the ImageNet classification dataset; this performance is also transferable to other problem domains by developing a semantic segmentation approach — <em>82.5% mIoU @ PASCAL VOC, 48.1% mIoU @ PASCAL Context, 78.4% IoU class @ Cityscapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*tVjeeAhA8Zy6FMogXK34Pg.png" /></figure><p><strong>Ladder DenseNet</strong> <em>(</em><a href="https://arxiv.org/abs/1905.05661"><em>Kreso, Krapac, Segvic, 2019</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/190505661">code</a>] —A novel architecture features high modeling power and a very lean upsampling datapath; it is proposed to substantially reduce the extent of feature map caching by exploiting the inherent spatial efficiency of the DenseNet feature extractor; the resulting models deliver high performance with fewer parameters than competitive approaches, and allow training at megapixel resolution on commodity hardware —<em> 77.5% IoU class @ CityScapes; PASCAL VOC 2012, CamVid, ROB 2018, Vistas and KITTI datasets</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*tt98R5sBL9EGbzvdDoyfew.png" /></figure><p><strong>Semantic Prediction Guidance for Scene Parsing (SPGNet)</strong> <em>(</em><a href="https://arxiv.org/abs/1908.09798"><em>Cheng et al., 2019</em></a><em>) —</em>Learns to re-weight the local features through the guidance from pixel-wise semantic prediction; by carefully re-weighting features across stages, a two-stage encoder-decoder network coupled with our proposed SPG module can significantly outperform its one-stage counterpart with similar parameters and computations<em> — 81.1% mIoU@ CityScapes; PASCAL Person-Part</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*6__1lpGbh9LhdMQGNdmrPA.png" /></figure><p><strong>Gated Shape CNNs</strong> <em>(</em><a href="https://arxiv.org/abs/1907.05740"><em>Takikawa et al., 2019</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/gated-scnn-gated-shape-cnns-for-semantic">code</a>] — A two-stream CNN architecture explicitly wires shape information as a separate processing branch, i.e. shape stream, that processes information in parallel to the classical stream; a new type of gates that connect the intermediate layers of these two streams; it enables using a very effective shallow architecture for the shape stream that operates on the image-level resolution and produces sharper predictions around object boundaries and significantly boosts performance on thinner and smaller objects — <em>82.8% mIoU @ CityScapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*7uASVk3IJxVbfjl8f0ZWSw.png" /></figure><p><strong>Adaptive Context Network (ACNet)</strong> <em>(</em><a href="https://arxiv.org/abs/1911.01664"><em>Fu et al., 2019</em></a><em>) — </em>Captures the pixel-aware contexts by a competitive fusion of global context and local context according to different per-pixel demands: the global context demand is measured by the similarity between the global feature and its local feature, whose reverse value can be used to measure the local context demand<em>— 82.3% mIoU @ CityScapes; ADE20K, PASCAL Context, and COCO Stuff</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*fpZrewbVfIctCapcb0JMug.png" /></figure><p><strong>Segmentation by Pre-training and Self-training </strong><em>(</em><a href="https://arxiv.org/abs/2006.06882"><em>Zoph et al., 2020</em></a><em>)</em> [<a href="https://paperswithcode.com/paper/rethinking-pre-training-and-self-training">code</a>] — The study reveals the generality and flexibility of self-training with three additional insights: 1) stronger data augmentation and more labeled data further diminish the value of pre-training, 2) unlike pre-training, self-training is always helpful when using stronger data augmentation, in both low-data and high-data regimes, and 3) in the case that pre-training is helpful, self-training improves upon pre-training —<em>54.3AP @ COCO, 90.5% mIoU @ PASCAL VOC 2012</em></p><p><strong>Densely Connected Neural Architecture Search (DCNAS)</strong> <em>(</em><a href="https://arxiv.org/abs/2003.11883"><em>Zhang et al., 2020</em></a><em>) — </em>Directly searches the optimal network structures for the multi-scale representations of visual information, over a large-scale target dataset;<em> </em>a fusion module designed to reduce the memory consumption of ample search space<em>— 84.3% @ Cityscapes, and 86.9% @ PASCAL VOC 2012; ADE20K, PASCAL Context</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*PYOeiPN-gLZ4w5-7jlh4GA.png" /></figure><p><strong>Hierarchical Multi-scale Attention</strong> <em>(</em><a href="https://arxiv.org/abs/2005.10821"><em>Tao, Sapra, Catanzaro, 2020</em></a><em>)</em> [<a href="https://github.com/NVIDIA/semantic-segmentation">code</a>] — An attention-based approach to combining multi-scale predictions; the hierarchical approach achieves high memory efficiency; in addition to faster training, larger crop sizes lead to greater model accuracy —<em>61.1% mIoU @ Mapillary and 85.1% mIoU @ Cityscapes</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*anBWl_MdCyRgB8SjhEK9zQ.png" /></figure><h4>✅ <strong>In addition, a number of popular helpful resources to quickly set up and run your learning tasks</strong></h4><ul><li><a href="https://github.com/PaddlePaddle/PaddleSeg"><strong>PaddleSeg: A High-Efficient Development Toolkit for Image Segmentation.</strong></a><strong> </strong><em>Yi Liu, Lutao Chu, Guowei Chen, Zewu Wu, Zeyu Chen, Baohua Lai, Yuying Hao, 2021.</em> [<a href="https://arxiv.org/abs/2101.06175">arXiv</a>]—<em> “End-to-end high-efficient development toolkit for image segmentation based on PaddlePaddle, which helps both developers and researchers in the whole process of designing and training segmentation models, optimizing performance, inference speed, and deploying models. A lot of well-trained models and various real-world applications in both industry and academia help users conveniently build hands-on experiences in image segmentation”.</em></li><li><a href="https://modelzoo.co/"><strong>Model Zoo</strong></a><strong>: </strong>Open-Source Deep Learning Code and Pretrained Models</li><li><a href="https://pytorch.org/vision/stable/models.html"><strong>PyTorch: Models and Pretrained Weights</strong></a><strong> </strong>—<strong><em> </em></strong><em>“The </em><em>torchvision.models subpackage contains definitions of models for addressing different tasks, including image classification, pixel-wise semantic segmentation, object detection, instance segmentation, person keypoint detection, video classification, and optical flow”.</em></li></ul><h3>References</h3><ul><li><em>S. Minaee, Y. Y. Boykov, F. Porikli, A. J. Plaza, N. Kehtarnavaz and D. Terzopoulos,</em> 2022. <strong>Image Segmentation Using Deep Learning: A Survey</strong>, in IEEE Transactions on Pattern Analysis and Machine Intelligence. <strong><em>[</em></strong><a href="https://doi.org/10.1109/TPAMI.2021.3059968"><strong><em>DOI</em></strong></a><strong><em>, </em></strong><a href="https://arxiv.org/abs/2001.05566"><strong><em>arXiv</em></strong></a><strong><em>]</em></strong></li><li><em>Irem Ulku &amp; Erdem Akagündüz,</em> 2022. <strong>A Survey on Deep Learning-based Architectures for Semantic Segmentation on 2D Images</strong>, Applied Artificial Intelligence. <strong><em>[</em></strong><a href="https://doi.org/10.1080/08839514.2022.2032924"><strong><em>DOI</em></strong></a><strong><em>, </em></strong><a href="https://arxiv.org/abs/1912.10230"><strong><em>arXiv</em></strong></a><strong><em>]</em></strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=751f7b5f7a04" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LeetCode: Interview question statistics & how to run your own analytical report in 2022]]></title>
            <link>https://medium.com/@apetsiuk/leetcode-interview-question-statistics-how-to-run-your-own-analytical-report-in-2022-1b202ae48902?source=rss-34490aee8142------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b202ae48902</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[blind75]]></category>
            <category><![CDATA[patterns]]></category>
            <dc:creator><![CDATA[Aliaksei Petsiuk]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 01:05:22 GMT</pubDate>
            <atom:updated>2022-06-14T01:05:22.831Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*b_kuzi13bSvNcoSmD5fv8A.png" /></figure><p>Comparative statistical analysis of top interview problems by topics, complexity, and popularity based on <a href="https://leetcode.com/discuss/interview-question/1376426/facebook-interview-questions-july-2020-july-2021"><strong><em>pgmreddy’s list</em></strong></a><strong><em>. </em></strong>This overview may help you choose the optimal preparation strategy and automatically analyze any other tasks, depending on the need.</p><p>📂 My GitHub page with data and Jupyter notebooks is <a href="https://github.com/apetsiuk/LeetCode-Interview-Question-Statistics"><strong><em>here</em></strong></a><strong><em>.</em></strong></p><p>The complete list of interview questions that I included in the statistics:</p><ul><li><strong>Facebook (Meta)</strong> <a href="https://leetcode.com/discuss/interview-question/1376426/Google-or-Facebook-or-Interview-questions-or-July-2020-July-2021"><em>July 2020 — July 2021</em></a></li><li><strong>Google</strong> <a href="https://leetcode.com/list/xb4m49lh"><em>Jan — Jun 2020</em></a><em>, </em><a href="https://leetcode.com/list/5p5i7ub6"><em>Jul — Oct 2020</em></a></li><li><strong>Amazon </strong><a href="https://leetcode.com/discuss/interview-question/1349954/Amazon-or-Bloomberg-or-Interview-questions-or-July-2020-July-2021"><em>July 2020 — July 2021</em></a></li><li><strong>Bloomberg </strong><a href="https://leetcode.com/discuss/interview-question/1349954/Amazon-or-Bloomberg-or-Interview-questions-or-July-2020-July-2021"><em>July 2020 — July 2021</em></a></li><li><strong>Apple, Uber, Flipkart, Swiggy </strong><a href="https://leetcode.com/discuss/interview-question/1367526/apple-uber-flipkart-swiggy-interview-questions-july-2020-july-2021"><em>July 2020 — July 2021</em></a>*</li></ul><blockquote>*Given the small number of tasks for Apple, Uber, Flipkart, and Swiggy, they were all combined into a common database and are referred to as Apple in the text. It should also be noted that premium problems were not included in the statistics.</blockquote><p>So, to begin with, let’s create a script that will automatically crawl a LeetCode page with a programming question and read all the parameters we need. Based on <a href="https://stackoverflow.com/questions/56608480/parsing-leetcode-question-content-with-requests-and-beautifulsoup"><em>QHarr’s reply</em></a> on StackOverflow, we will create an SQL query to a backend database using <a href="https://www.postman.com/KDr-eam/workspace/leetcode-3219/documentation/13784539-df3a8069-6d69-46c4-9c02-77f0211ec1ae"><em>graphql</em></a><em>:</em></p><pre># sample problem to parse: <br># https://leetcode.com/problems/sliding-window-median/</pre><pre><strong>titleslug </strong>= &quot;sliding-window-median&quot;<br><br>data = {&quot;operationName&quot;:&quot;questionData&quot;,&quot;variables&quot;:{&quot;titleSlug&quot;:<strong>str(titleslug)</strong>},&quot;query&quot;:&quot;query questionData($titleSlug: String!)...} # <a href="https://github.com/apetsiuk/LeetCode-Interview-Question-Statistics">check it on github</a><br><br>r = requests.post(&#39;https://leetcode.com/graphql&#39;,json=data).json()<br><br>number = r[&#39;data&#39;][&#39;question&#39;][&#39;questionId&#39;]<br>title = r[&#39;data&#39;][&#39;question&#39;][&#39;title&#39;]<br>complexity = r[&#39;data&#39;][&#39;question&#39;][&#39;difficulty&#39;]<br>likes = r[&#39;data&#39;][&#39;question&#39;][&#39;likes&#39;]<br>dislikes = r[&#39;data&#39;][&#39;question&#39;][&#39;dislikes&#39;]<br>topics = r[&#39;data&#39;][&#39;question&#39;][&#39;topicTags&#39;]</pre><p>If we print out the desired variables, the output of the code snippet with the parsed parameters will look like this:</p><pre>480. Sliding Window Median<br>Complexity: Hard, LIkes: 2210, Dislikes: 134<br>Topics: Array, Hash Table, Sliding Window, Heap(Priority Queue)</pre><p>When accessing the LeetCode backend in the SQL query, we pass only one string parameter, <strong>“str(titleslug)”,</strong> which is contained in the source URL. Thus, having collected the necessary leet problems in a text file, we can go through the entire list in a loop and generate one <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html"><em>pandas data frame</em></a><em> </em>for the whole problem set:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*3CjXD4FiVKHK4-Hp-r6LyQ.png" /></figure><p>We now have a separate data frame for each set of leet problems. You can create your own problem list as a text file and get detailed statistics in a few clicks.</p><p>Okay! Let’s look at the interview problem sets. The overall task complexity distribution for each company is shown in the figure below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*O8gsZ2_lmgu6pSZso5g38A.png" /></figure><p>As we can see, despite the different number of tasks, almost all companies adhere to the 25% rule for easy and hard problems, while problems with medium complexity take ~50%. Google, in turn, is mainly focused on medium and hard questions.</p><p>Each task on leetcode can belong to several topics at once. The tasks in all interview sets have a total of 43 possible topics. If we collect all the problems for each individual set and count the number of mentions of each topic separately, the distribution by topic for each company will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*yPhh1Pq4tllheVZPXgwgwA.png" /></figure><p><strong>“Array”</strong> is obviously the most frequently mentioned. Other popular topics are <strong>“Strings”,</strong> various sorts of <strong>“Search”, “Sorting”, “Hash Tables”, “Dynamic Programming”,</strong> and <strong>“Trees”.</strong> The distribution and intersection of the <strong>Top 20 </strong>most popular topics among all companies can be conveniently represented as a polar graph with a logarithmic scale:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*F6hpt088qqkcTGrFPXod6w.png" /></figure><p>The popularity of the same interview problems among users, however, does not correlate with the frequency of choice of question topics among tech interviewers. The distribution of the users’ topic popularity index among all selected interview problems for each company is presented below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*X10HvCbz4DFD7LWeH5RZqw.png" /><figcaption>*Topic Popularity Index (TPI)</figcaption></figure><p>The weighted Topic Popularity Index (TPI) was calculated as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*pSZEmIOFoK2G8U6wr5j00g.png" /></figure><p>Where <strong><em>p</em></strong>—is a mention (can be either zero or one) of the topic on the web page with the problem (Related Topics section), <strong><em>N</em></strong> — is the total number of problems in the considered interview set.</p><p>For example, the topic “Math” got 2 mentions in two different questions with 600 and 1000 likes-dislikes values, respectively. So the “Math” popularity index is TPI = (1000+600)/2 = 800 (average number of likes-dislikes per mention). The topic “Array”, in turn, got 23 questions with 1000 likes-dislikes each, which means the “Array” got 23000 likes-dislikes in total, and, therefore, has the popularity index of TPI = 23000/23 = 1000 (average number of likes-dislikes per mention).</p><p>The next interesting parameter for us will be the correlation between mentions of different programming topics.</p><p>If, for example, we have a set of three tasks:</p><ul><li>#1 with the <strong>“Array”, “String”,</strong> and <strong>“Dynamic Programming”</strong> topics</li><li>#2 with the <strong>“Array”, “String”</strong> and <strong>“Sorting”</strong> topics</li><li>#3 with the <strong>“Array”</strong> and <strong>“Tree”</strong> topics</li></ul><p>Then the “Array” topic will have all three intersections with each of the problems, “String” — two intersections, and the topics “Dynamic Programming”, “Sorting”, and “Tree” will have zeros.</p><p>The figure below shows the topic correlation for Google and Meta problem sets. The number inside each cell indicates the number of mentions (intersections) of the topic on the Y-axis when the keyword on the X-axis was present in the problem description (Related Topics section on LeetCode pages with the given problems).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D8ydwuG3eeG5GqgjkJGe_A.png" /></figure><p>If we combine all five interview sets (Meta, Google, Amazon, Bloomberg, and Apple*) together and remove duplicate tasks, the overall correlation picture will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*oGJmQZ-WvXAfA7nLVNvI7A.png" /></figure><p>If you are currently learning about Hash Tables, for example, the next topics to consider might be “String”, “Search”, “Array” and “Sorting”.</p><p>Now we can look at the distribution of each topic in terms of problem complexity. Meta, as we can see from the plot, has the highest percentage of hard tasks in the area of Dynamic Programming and Memoization (which can also be considered as part of Dynamic Programming). A significant part of hard problems is observed in the areas of Graph, Sort, Queue, and Combinatorics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*AoqdT7yqS2cZ7amaOLS_1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*oR1A4jmqUjGaqIii4QZmOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*bHcQmMcfAJPAekAw58POlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*UnJeUi7Ve7YhcNxWEBC1Nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*HOKobNSU15AQBLtwoYWrMQ.png" /></figure><p>Nice! 👍 What else can we do next?</p><p>Now we will select those questions that appear multiple times (in interview sets of at least two companies).</p><p>Here is the best place to mention the well-known <a href="https://www.teamblind.com/post/New-Year-Gift---Curated-List-of-Top-75-LeetCode-Questions-to-Save-Your-Time-OaM1orEU"><strong><em>Blind 75 List</em></strong></a><strong><em>,</em></strong> the curated set of top 75 LeetCode questions divided into the following categories: <strong>Array, Binary, Dynamic Programming, Graph, Interval, Linked List, Matrix, String, Tree,</strong> and <strong>Heap.</strong> This list was created in 2018 and continues to be popular to this day, considered a must for interview preparation (very thorough analysis of all these questions was done by <a href="https://www.youtube.com/watch?v=KLlXCFG5TnA&amp;list=PLot-Xpze53ldVwtstag2TL4HQhAnC8ATf"><strong><em>NeetCode</em></strong></a><em>).</em><strong><em> </em></strong>There is also an updated version of it, <a href="https://www.techinterviewhandbook.org/grind75"><strong><em>Grind 75</em></strong></a><strong><em>,</em></strong> by the same <a href="https://www.techinterviewhandbook.org/grind75/about"><em>author</em></a><em>.</em></p><p>In this article, we came up with another list (see below), an intersection set of <strong>84</strong> interview questions in <strong>Meta, Google, Amazon, Bloomberg, Apple, Uber, Flipkart,</strong> and <strong>Swiggy</strong> in 2021. For convenience, we have grouped the problems into the same categories as in Blind 75.</p><h4>✅ An Intersection Set of 84 Interview Questions<strong> in Meta, Google, Amazon, Bloomberg, Apple, Uber, Flipkart, and Swiggy in 2021</strong></h4><p><em>Asterisk (*) and bold font indicate that the question is also on the Blind 75 list</em></p><pre><strong>ARRAY<br>*1:   </strong><a href="https://leetcode.com/problems/two-sum/"><strong>Two Sum</strong></a><strong><br>*238: </strong><a href="https://leetcode.com/problems/product-of-array-except-self/"><strong>Product of Array Except Self</strong></a><strong><br>*153:</strong> <a href="https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/"><strong>Find Minimum in Rotated Sorted Array</strong></a><strong><br></strong><em>31:   </em><a href="https://leetcode.com/problems/next-permutation/"><em>Next Permutation</em></a><em><br>34:   </em><a href="https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/"><em>Find First and Last Position of Element in Sorted Array</em></a><em><br>41:   </em><a href="https://leetcode.com/problems/first-missing-positive/"><em>First Missing Positive</em></a><em><br>42:   </em><a href="https://leetcode.com/problems/trapping-rain-water/"><em>Trapping Rain Water</em></a><em><br>84:   </em><a href="https://leetcode.com/problems/largest-rectangle-in-histogram/"><em>Largest Rectangle in Histogram</em></a><em><br>88:   </em><a href="https://leetcode.com/problems/merge-sorted-array/"><em>Merge Sorted Array</em></a><em><br>283:  </em><a href="https://leetcode.com/problems/move-zeroes/"><em>Move Zeroes</em></a><em><br>349:  </em><a href="https://leetcode.com/problems/intersection-of-two-arrays/"><em>Intersection of Two Arrays</em></a><em><br>380:  </em><a href="https://leetcode.com/problems/insert-delete-getrandom-o1/"><em>Insert Delete GetRandom O(1)</em></a><em><br>399:  </em><a href="https://leetcode.com/problems/evaluate-division/"><em>Evaluate Division</em></a><em><br>452:  </em><a href="https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/"><em>Minimum Number of Arrows to Burst Balloons</em></a><em><br>529:  </em><a href="https://leetcode.com/problems/minesweeper/"><em>Minesweeper</em></a><em><br>560:  </em><a href="https://leetcode.com/problems/subarray-sum-equals-k/"><em>Subarray Sum Equals K</em></a><em><br>973:  </em><a href="https://leetcode.com/problems/k-closest-points-to-origin/"><em>K Closest Points to Origin</em></a><em><br>977:  </em><a href="https://leetcode.com/problems/squares-of-a-sorted-array/"><em>Squares of a Sorted Array</em></a><em><br>994:  </em><a href="https://leetcode.com/problems/rotting-oranges/"><em>Rotting Oranges</em></a><em><br>1010: </em><a href="https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/"><em>Pairs of Songs With Total Durations Divisible by 60</em></a><em><br>1095: </em><a href="https://leetcode.com/problems/find-in-mountain-array/"><em>Find in Mountain Array</em></a><em><br>1169: </em><a href="https://leetcode.com/problems/invalid-transactions/"><em>Invalid Transactions</em></a><em><br>1235: </em><a href="https://leetcode.com/problems/maximum-profit-in-job-scheduling/"><em>Maximum Profit in Job Scheduling</em></a><em><br>1293: </em><a href="https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/"><em>Shortest Path in a Grid with Obstacles Elimination</em></a><em><br></em></pre><pre><strong>BINARY</strong><br><em>29:   </em><a href="https://leetcode.com/problems/divide-two-integers/"><em>Divide Two Integers</em></a><em><br>67:   </em><a href="https://leetcode.com/problems/add-binary/"><em>Add Binary</em></a><em><br></em></pre><pre><strong>DYNAMIC PROGRAMMING<br>*322: </strong><a href="https://leetcode.com/problems/coin-change/"><strong>Coin Change</strong></a><strong><br>*91:  </strong><a href="https://leetcode.com/problems/decode-ways/"><strong>Decode Ways</strong></a><strong><br></strong><em>63:   </em><a href="https://leetcode.com/problems/unique-paths-ii/"><em>Unique Paths II</em></a><strong><em><br></em></strong><em>72:   </em><a href="https://leetcode.com/problems/edit-distance/"><em>Edit Distance</em></a><em><br>139:  </em><a href="https://leetcode.com/problems/word-break/"><em>Word Break</em></a><em><br>140:  </em><a href="https://leetcode.com/problems/word-break-ii/"><em>Word Break II</em></a><em><br>329:  </em><a href="https://leetcode.com/problems/longest-increasing-path-in-a-matrix/"><em>Longest Increasing Path in a Matrix</em></a><em><br>688:  </em><a href="https://leetcode.com/problems/knight-probability-in-chessboard/"><em>Knight Probability in Chessboard</em></a><em><br>1125: </em><a href="https://leetcode.com/problems/smallest-sufficient-team/"><em>Smallest Sufficient Team</em></a><em><br>1335: </em><a href="https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule/"><em>Minimum Difficulty of a Job Schedule</em></a><em><br></em></pre><pre><strong>GRAPH</strong><br><strong>*133:</strong> <a href="https://leetcode.com/problems/clone-graph/"><strong>Clone Graph</strong></a><strong><br>*200: </strong><a href="https://leetcode.com/problems/number-of-islands/"><strong>Number of Islands</strong></a><strong><br></strong><em>210:  </em><a href="https://leetcode.com/problems/course-schedule-ii/"><em>Course Schedule II</em></a><em><br>128:  </em><a href="https://leetcode.com/problems/longest-consecutive-sequence/"><em>Longest Consecutive Sequence</em></a></pre><pre><strong><br>INTERVAL</strong><br><strong>*56:  </strong><a href="https://leetcode.com/problems/merge-intervals/"><strong>Merge Intervals</strong></a></pre><pre><strong><br>LINKED LIST</strong><br><strong>*21:  </strong><a href="https://leetcode.com/problems/merge-two-sorted-lists/"><strong>Merge Two Sorted Lists</strong></a><strong><br>*23:  </strong><a href="https://leetcode.com/problems/merge-k-sorted-lists/"><strong>Merge k Sorted Lists</strong></a><strong><br></strong><em>2:    </em><a href="https://leetcode.com/problems/add-two-numbers/"><em>Add Two Numbers</em></a><em><br>138:  </em><a href="https://leetcode.com/problems/copy-list-with-random-pointer/"><em>Copy List with Random Pointer</em></a><em><br>146:  </em><a href="https://leetcode.com/problems/lru-cache/"><em>LRU Cache</em></a><em><br>203:  </em><a href="https://leetcode.com/problems/remove-linked-list-elements/"><em>Remove Linked List Elements</em></a><em><br>445:  </em><a href="https://leetcode.com/problems/add-two-numbers-ii/"><em>Add Two Numbers II</em></a><em><br></em></pre><pre><strong>STRING</strong><br><strong>*3:   </strong><a href="https://leetcode.com/problems/longest-substring-without-repeating-characters/"><strong>Longest Substring Without Repeating Characters</strong></a><strong><br>*76:  </strong><a href="https://leetcode.com/problems/minimum-window-substring/"><strong>Minimum Window Substring</strong></a><strong><br>*242: </strong><a href="https://leetcode.com/problems/valid-anagram/"><strong>Valid Anagram</strong></a><strong><br>*20:  </strong><a href="https://leetcode.com/problems/valid-parentheses/"><strong>Valid Parentheses</strong></a><strong><br></strong><em>680:  </em><a href="https://leetcode.com/problems/valid-palindrome-ii/"><em>Valid Palindrome II</em></a><em><br>127:  </em><a href="https://leetcode.com/problems/word-ladder/"><em>Word Ladder</em></a><em><br>155:  </em><a href="https://leetcode.com/problems/min-stack/"><em>Min Stack</em></a><em><br>227:  </em><a href="https://leetcode.com/problems/basic-calculator-ii/"><em>Basic Calculator II</em></a><em><br>389:  </em><a href="https://leetcode.com/problems/find-the-difference/"><em>Find the Difference</em></a><em><br>394:  </em><a href="https://leetcode.com/problems/decode-string/"><em>Decode String</em></a><em><br>415:  </em><a href="https://leetcode.com/problems/add-strings/"><em>Add Strings</em></a><em><br>692:  </em><a href="https://leetcode.com/problems/top-k-frequent-words/"><em>Top K Frequent Words</em></a><em><br>778:  </em><a href="https://leetcode.com/problems/reorganize-string/"><em>Reorganize String</em></a><em><br>833:  </em><a href="https://leetcode.com/problems/find-and-replace-in-string/"><em>Find And Replace in String</em></a><em><br>953:  </em><a href="https://leetcode.com/problems/verifying-an-alien-dictionary/"><em>Verifying an Alien Dictionary</em></a><em><br>1047: </em><a href="https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/"><em>Remove All Adjacent Duplicates In String</em></a><em><br>1209: </em><a href="https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/"><em>Remove All Adjacent Duplicates in String II</em></a><em><br>1249: </em><a href="https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/"><em>Minimum Remove to Make Valid Parentheses</em></a><em><br>1396: </em><a href="https://leetcode.com/problems/design-underground-system/"><em>Design Underground System</em></a><em><br></em></pre><pre><strong>TREE</strong><br><strong>*124: </strong><a href="https://leetcode.com/problems/binary-tree-maximum-path-sum/"><strong>Binary Tree Maximum Path Sum</strong></a><strong><br>*102: </strong><a href="https://leetcode.com/problems/binary-tree-level-order-traversal/"><strong>Binary Tree Level Order Traversal</strong></a><strong><br>*297: </strong><a href="https://leetcode.com/problems/serialize-and-deserialize-binary-tree/"><strong>Serialize and Deserialize Binary Tree</strong></a><strong><br>*98:  </strong><a href="https://leetcode.com/problems/validate-binary-search-tree/"><strong>Validate Binary Search Tree</strong></a><strong><br>*236: </strong><a href="https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/"><strong>Lowest Common Ancestor of a Binary Tree</strong></a><strong><br></strong><em>116:  </em><a href="https://leetcode.com/problems/populating-next-right-pointers-in-each-node/"><em>Populating Next Right Pointers in Each Node</em></a><em><br>278:  </em><a href="https://leetcode.com/problems/first-bad-version/"><em>First Bad Version</em></a><em><br>528:  </em><a href="https://leetcode.com/problems/random-pick-with-weight/"><em>Random Pick with Weight</em></a><em><br>547:  </em><a href="https://leetcode.com/problems/number-of-provinces/"><em>Number of Provinces</em></a><em><br>721:  </em><a href="https://leetcode.com/problems/accounts-merge/"><em>Accounts Merge</em></a><em><br>987:  </em><a href="https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/"><em>Vertical Order Traversal of a Binary Tree</em></a><em><br>1376: </em><a href="https://leetcode.com/problems/time-needed-to-inform-all-employees/"><em>Time Needed to Inform All Employees</em></a><em><br></em></pre><pre><strong>HEAP</strong><br><strong>*295: </strong><a href="https://leetcode.com/problems/find-median-from-data-stream/"><strong>Find Median from Data Stream</strong></a><strong><br></strong><em>239:  </em><a href="https://leetcode.com/problems/sliding-window-maximum/"><em>Sliding Window Maximum</em></a><em><br>621:  </em><a href="https://leetcode.com/problems/task-scheduler/"><em>Task Scheduler</em></a><em><br>658:  </em><a href="https://leetcode.com/problems/find-k-closest-elements/"><em>Find K Closest Elements</em></a></pre><p>In addition, a number of popular programming patterns for an efficient approach to problem-solving:</p><ul><li><a href="https://hackernoon.com/14-patterns-to-ace-any-coding-interview-question-c5bb3357f6ed">14 Patterns to Ace Any Coding Interview Question</a></li><li><a href="https://hackernoon.com/5-to-23-patterns-to-ace-any-coding-interview">5 to 23 Patterns to Ace Any Coding Interview</a></li><li><a href="https://medium.com/leetcode-patterns">LeetCode Patterns</a> by csgator</li><li><a href="https://leetcode.com/explore/">Official LeetCode Explore Cards</a></li><li><a href="https://www.techinterviewhandbook.org/best-practice-questions">Best practice questions</a> by the author of Blind 75</li></ul><p>Thank you! Keep calm and LeetCode.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b202ae48902" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>