<?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 Paul Christian Hosch on Medium]]></title>
        <description><![CDATA[Stories by Paul Christian Hosch on Medium]]></description>
        <link>https://medium.com/@paul.christian.hosch?source=rss-2c383f0047bf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*s2fDx20U7ip3Rdhy</url>
            <title>Stories by Paul Christian Hosch on Medium</title>
            <link>https://medium.com/@paul.christian.hosch?source=rss-2c383f0047bf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 05:06:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paul.christian.hosch/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[Towards Flood Mapping With Random Forests: How Training Data Design Shapes Tree Growth]]></title>
            <link>https://medium.com/@paul.christian.hosch/towards-flood-mapping-with-random-forests-how-training-data-design-shapes-tree-growth-d7a0c7b6b281?source=rss-2c383f0047bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7a0c7b6b281</guid>
            <category><![CDATA[sampling-methods]]></category>
            <category><![CDATA[flood-mapping]]></category>
            <category><![CDATA[random-forest]]></category>
            <category><![CDATA[class-imbalance]]></category>
            <dc:creator><![CDATA[Paul Christian Hosch]]></dc:creator>
            <pubDate>Tue, 15 Jul 2025 09:55:01 GMT</pubDate>
            <atom:updated>2025-07-15T09:55:01.465Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why the way we select training samples can make or break our flood detection models.</em></p><p>Floods can devastate entire communities and disrupt ecosystems in a matter of hours. With modern remote sensing tools, particularly Synthetic Aperture Radar (SAR), researchers and practitioners can “see” through clouds and capture the evolving picture on the ground — even when floodwater and the weather is raging.</p><p>But while technology has made data acquisition increasingly powerful, there’s a hidden factor that could be the key to more accurate flood mapping: <strong>how we select and prepare training data for machine learning models</strong>.</p><h4><strong>The Promise of Random Forest for Flood Detection</strong></h4><p>Random Forests, originally introduced by Leo Breiman in 2001, are an ensemble learning method that combines multiple decision trees to improve predictive performance. In flood mapping, these trees work together to classify whether each pixel is flooded or non-flooded, drawing on a rich mix of input features.</p><p>Our workflow leverages nine SAR-based features — including VV pre-event, VH pre-event, and temporal changes — alongside four contextual features: HAND (Height Above Nearest Drainage), slope, land cover, and Euclidean distance to the nearest drainage. By merging these data types, the algorithm captures not only the backscatter signals from water and land surfaces but also crucial terrain and environmental factors that influence how floods spread.</p><p>However, even a robust ensemble method like Random Forest is heavily dependent on one critical factor: <strong>the quality and diversity of its training data</strong>.</p><h4><strong>The Hidden Challenge: Why Sampling Design Matters</strong></h4><p>Most flood-mapping tasks deal with severely skewed class distributions. Typically, only a small fraction of any study area is actually flooded, while the vast majority remains dry. This creates a deceptively simple problem with complex consequences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1HeCpbQ5M6onr4U_RsD8pg.png" /><figcaption>Figure 1: Select Sample Sets Visualized for the Valencia Case Study; nF, nNF: Number of Flooded, NonFlooded Samples; dMIN: Minimum Distance Between Samples of One Class.</figcaption></figure><p>Figure 1 illustrates this challenge perfectly using data from Valencia. Notice how Simple Random and Simple Systematic sampling produce dramatically different numbers of flooded samples (nF) compared to non-flooded samples (nNF) — with flooded samples being severely underrepresented. In contrast, Balanced Random and Balanced Systematic approaches achieve equal representation through stratified sampling. We’ll come back to the minimum distance between samples (dMIN) later.</p><p>Random training sample selection will inadvertently pick too few flooded pixels, leading to poor classifier performance and systematic underestimation of flooded areas. Decision trees thrive on splitting data in ways that isolate distinct features — like distinguishing flooded from non-flooded backscatter signals. But if the vast majority of your training data consists of non-flooded pixels, the algorithm quickly learns to label everything as non-flooded.</p><p><strong>The solution seems obvious: balance your classes.</strong> Stratified sampling ensures that each tree receives meaningful examples of both flooded and non-flooded pixels, enriching the “collective wisdom” of the forest ensemble.</p><h4><strong>When Balance Isn’t Enough: The Spatial Clustering Problem</strong></h4><p>Yet stratified sampling can create its own pitfalls. As shown in Figure 1, the minimum distance between samples of one class (dMIN) reveals another crucial insight: sampling methods that force equal representation of classes might inadvertently cluster sample points too close together in space. Notice how balanced sampling reduces spatial separation (dMIN decreases), while systematic approaches increase it, indicating a better spatial distribution.</p><p>Such spatial imbalance risks overfitting and reduces the model’s ability to generalize to new areas. Systematic sampling approaches offer a solution by distributing samples across a grid — imagine casting an imaginary net across your area of interest. This achieves even spacing of samples across the study area, making them more representative of the entire training domain.</p><p>The contrast is striking: while simple random sampling can be quick to implement, a balanced sampling design ensures equal representation of flooded and non-flooded classes during training, and systematic grid-based approaches avoid the spatial clustering that can doom sample representation of the domain.</p><h4><strong>Visualizing How Forests Grow Differently</strong></h4><p>One of the most fascinating aspects of this research is observing how the same Random Forest algorithm — trained with identical parameters — can produce dramatically different tree structures based just on different sampling strategies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7sF9Ed6fx0fnmq2maeHNHQ.png" /><figcaption>Figure 2: Side by Side Visualization of Two Random Forests Trained on Different Samples. With 12 of 300 Trees Ploted with the Line Width Indicating the number of Training Samples passing through each node.</figcaption></figure><p>Figure 2 provides a compelling side-by-side comparison of 12 out of 300 decision trees from a trained Random Forest classifier. The visualization shows how tree structure and depth vary dramatically depending on sampling design. Trees trained on simple random samples (left) tend to be shallow and rely on a narrow range of features for splits. Some trees may even contain samples from only one class. In contrast, trees trained on balanced systematic samples (right) grow much deeper and more complex, incorporating a wider range of features during node splits — creating the characteristic “bushy” appearance of a well-trained forest.</p><p>This variability underscores why meticulous sampling design is essential: <strong>every tree in the forest is shaped by the data it sees during training</strong>.</p><h4><strong>Concluding</strong></h4><p>Remote sensing for flood delineation isn’t just an academic exercise: accurate flood delineation inform emergency evacuation plans, resource allocation, and are needed for the future training and validation of predictive models.</p><p>Balancing flooded and non-flooded classes, distributing samples wisely across a scene, and choosing appropriate sample sizes can all supercharge our Random Forest flood mapping approach.</p><h4><strong>What’s Next: The Complete Pipeline</strong></h4><p>The sampling design explored in this article is just one piece of the puzzle. We’re working on a comprehensive paper and framework that optimizes the entire pipeline, from feature engineering through sampling to hyperparameter tuning and model enhancements. Our preliminary findings evaluated 4860 trained models across three case studies using Leave-One-Site-Out Cross Validation Validation using overall accuracy (OA) and F1-Score. The optimized pipeline achieved an aggregated performance score, combining balanced and proportional metrics for both OA and F1-Score, of up to 0.8801 compared to the baseline configuration of 0.7428, representing an 18.5% improvement. However results also revealed that optimal parameters vary dramatically across regions — what works for riverine floods in the Danube catchment may fail for flash floods in coastal Valencia.</p><p>The game-changer? An <strong>interactive GUI tool</strong> that automatically optimizes the flood mapping pipeline for specific regions and conditions. No more one-size-fits-all approaches. Researchers will soon have access to area-specific optimization across the complete Random Forests flood mapping workflow. Allowing for specifically tuned as well as pretrained models for flood label generation.</p><p><em>This article is based on ongoing research into Random Forest optimization for flood mapping using SAR data and contextual features. Stay tuned for the full pipeline paper and interactive tool release.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7a0c7b6b281" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>