✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: January 1, 2026
  • 7 min read

Introducing RESIDUALS: Multi‑Method Differential Feature Detection for DEMs

RESIDUALS is an open‑source Python framework that detects terrain features in Digital Elevation Models (DEMs) by systematically combining multiple decomposition and up‑sampling methods and analysing the resulting residuals.

Why DEM Feature Detection Matters for Geospatial Professionals

Geospatial analysts, GIS specialists, and data scientists constantly seek more reliable ways to extract ridges, valleys, and subtle terrain anomalies from elevation data. Traditional single‑method approaches often miss critical details or introduce artifacts. The RESIDUALS project addresses this gap by offering a multi‑method differential feature detection workflow that is both reproducible and extensible. In an era where DEM upsampling, residual networks, and open‑source GIS tools dominate the conversation, RESIDUALS provides a systematic, data‑driven path to higher‑quality geospatial insights.

If you’re looking to boost your geospatial analysis pipeline, integrate advanced feature detection, or simply explore cutting‑edge DEM processing techniques, this article will walk you through the project’s core concepts, practical usage, and the tangible benefits it delivers to the GIS community.

RESIDUALS Project Overview

Developed by the RESIDUALS GitHub repository, the framework is built in Python and leverages popular scientific libraries such as NumPy, SciPy, scikit‑image, and PyWavelets. Its primary goal is to systematically test combinations of signal decomposition and up‑sampling methods to reveal terrain features that are otherwise hidden in raw DEMs.

The project follows a four‑level differential hierarchy:

  • Level 0: Ground‑truth hillshade or reference DEM.
  • Level 1: Decomposition residuals generated by methods like bicubic, Lanczos, B‑spline, and FFT.
  • Level 2: Differential maps (Δ) comparing each residual to the ground truth.
  • Level 3: Divergence metrics that highlight disagreements across methods.
  • Level 4: Meta‑divergence (uncertainty of uncertainty) for robust confidence scoring.

By examining each level, analysts can pinpoint which method combinations best capture specific terrain characteristics, turning the detection process into a data‑driven decision rather than a trial‑and‑error exercise.

Key Features and Methodology

RESIDUALS distinguishes itself through a suite of carefully engineered capabilities:

  1. Extensive Decomposition Library: Includes 25 algorithms ranging from Gaussian blur and bilateral filters to wavelet transforms and morphological operations. Each method targets different feature scales—from broad regional trends to fine‑grained peaks.
  2. Rich Upsampling Options: Offers 19 up‑sampling techniques (bicubic, Lanczos, B‑spline, FFT, and advanced windowed‑sinc kernels) to reconstruct higher‑resolution DEMs while preserving edge fidelity.
  3. Exhaustive Parameter Exploration: The run_exhaustive.py script can evaluate over 39,000 method combinations, generating a comprehensive statistical report for each DEM.
  4. Automated Differential Computation: Built‑in analysis modules compute pairwise residuals, divergence maps, and meta‑divergence scores, delivering a ready‑to‑interpret feature matrix.
  5. Modular Architecture: The src/ directory separates decomposition, upsampling, and analysis, making it straightforward to plug in new algorithms or GPU‑accelerated kernels.
  6. Visualization Suite: Generates grid visualizations where rows represent decomposition methods and columns represent up‑sampling strategies, instantly revealing method‑specific strengths.

The methodology follows a clear, repeatable workflow:

Step‑by‑Step Workflow

  1. Clone the repository and install dependencies.
  2. Prepare or generate a test DEM (e.g., using generate_test_dem.py from LiDAR tiles).
  3. Run run_experiment.py to evaluate a curated set of method pairs.
  4. Optionally launch run_exhaustive.py for full‑scale exploration.
  5. Inspect the resulting visual grid and divergence tables to select the optimal combination for your specific terrain.

Practical Usage and Real‑World Applications

RESIDUALS is designed for flexibility, making it suitable for a wide range of geospatial tasks:

  • Terrain Analysis: Detect ridgelines, drainage networks, and slope breaks for hydrological modeling.
  • Infrastructure Planning: Identify subtle ground deformations that could affect road or pipeline construction.
  • Environmental Monitoring: Track vegetation canopy changes or erosion patterns over time.
  • Change Detection: Compare DEMs from different epochs to highlight landslide or subsidence events.
  • Quality Assurance: Spot artifacts introduced during LiDAR processing or DEM generation.

Because the framework outputs both raw residual arrays (.npy) and visual summaries, it integrates seamlessly with GIS platforms such as QGIS, ArcGIS, or custom Python‑based pipelines.

Benefits for Geospatial Analysts and Data Scientists

For professionals working with elevation data, RESIDUALS delivers concrete advantages:

Benefit Why It Matters
Higher Feature Recall Multiple method combos capture both coarse and fine terrain details.
Reduced False Positives Meta‑divergence highlights uncertain detections, allowing targeted validation.
Scalable Exploration Automated exhaustive runs save weeks of manual trial‑and‑error.
Open‑Source Transparency Full code access ensures reproducibility and easy customization.
Seamless Integration Outputs compatible with standard GIS formats and Python data stacks.

These benefits translate into faster project delivery, higher confidence in terrain models, and the ability to uncover hidden patterns that can drive strategic decisions in urban planning, natural resource management, and disaster mitigation.

Access the RESIDUALS Codebase

Ready to experiment? Clone the repository and start exploring:

git clone https://github.com/bshepp/RESIDUALS.git
cd RESIDUALS
pip install -r requirements.txt
python run_experiment.py

For a deeper dive, the official GitHub page provides detailed documentation, sample DEMs, and a roadmap for future contributions.

RESIDUALS differential hierarchy illustration

Leverage UBOS Resources to Accelerate Your GIS Projects

While RESIDUALS handles the heavy lifting of feature detection, UBOS offers a suite of AI‑powered tools that can further streamline data ingestion, visualization, and reporting.

By combining RESIDUALS’ powerful feature detection with UBOS’s low‑code AI ecosystem, you can build end‑to‑end geospatial solutions that are both accurate and production‑ready.

Conclusion: Elevate Your DEM Workflows Today

RESIDUALS transforms DEM analysis from a single‑method guesswork into a data‑driven, multi‑method exploration that surfaces hidden terrain features with unprecedented clarity. Its open‑source nature, exhaustive combinatorial engine, and clear visual outputs make it an indispensable tool for any GIS professional seeking to improve accuracy, reduce manual tuning, and accelerate project timelines.

Ready to integrate RESIDUALS into your workflow? Clone the repo, run a quick experiment, and then pair the results with UBOS’s AI‑enhanced visualizations and automation tools. The synergy of these platforms empowers you to deliver smarter, faster, and more reliable geospatial insights.

Take the next step: download RESIDUALS, explore the UBOS ecosystem, and start turning raw elevation data into actionable intelligence.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.