- 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:
- 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.
- 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.
- Exhaustive Parameter Exploration: The
run_exhaustive.pyscript can evaluate over 39,000 method combinations, generating a comprehensive statistical report for each DEM. - Automated Differential Computation: Built‑in analysis modules compute pairwise residuals, divergence maps, and meta‑divergence scores, delivering a ready‑to‑interpret feature matrix.
- Modular Architecture: The
src/directory separates decomposition, upsampling, and analysis, making it straightforward to plug in new algorithms or GPU‑accelerated kernels. - 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
- Clone the repository and install dependencies.
- Prepare or generate a test DEM (e.g., using
generate_test_dem.pyfrom LiDAR tiles). - Run
run_experiment.pyto evaluate a curated set of method pairs. - Optionally launch
run_exhaustive.pyfor full‑scale exploration. - 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.

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.
- Explore the UBOS homepage for a quick overview of the platform’s capabilities.
- Learn about the company’s mission on the About UBOS page.
- Get a technical deep‑dive with the UBOS platform overview, which includes native support for geospatial data pipelines.
- Start fast with UBOS templates for quick start, such as the AI SEO Analyzer or the AI Article Copywriter.
- For startups seeking AI‑enhanced GIS solutions, see UBOS for startups.
- SMBs can benefit from UBOS solutions for SMBs, which include low‑code visualizations of DEM data.
- Enterprises looking for scale can adopt the Enterprise AI platform by UBOS, featuring robust security and multi‑tenant support.
- Automate repetitive GIS workflows with the Workflow automation studio.
- Design custom web interfaces for DEM inspection using the Web app editor on UBOS.
- Integrate conversational AI into your GIS portal via the Telegram integration on UBOS or the ChatGPT and Telegram integration.
- Leverage the OpenAI ChatGPT integration for natural‑language queries over elevation datasets.
- Store large raster tiles efficiently with the Chroma DB integration.
- Give your GIS dashboards a voice using the ElevenLabs AI voice integration.
- Explore ready‑made AI tools such as the AI Image Generator for creating terrain visualizations, or the AI Video Generator to produce animated fly‑throughs of DEMs.
- Boost your marketing analytics with the AI marketing agents that can automatically generate reports from your geospatial insights.
- Review real‑world implementations in the UBOS portfolio examples.
- Check the UBOS pricing plans to find a tier that matches your project budget.
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.