GSIP

PyTorchGeospatialSystem Design
View Repository

Technical Stack

ComponentTechnologyDescription
Inference EnginePyTorchSupport for ResNet, ConvNeXt, Segformer, and Foundation Models.
GSIP StudioGTK4 / PythonNative desktop client for performance telemetry and result analysis.
OrchestrationHydraHierarchical configuration for multi-modal adapters and pipelines.
Geospatial I/ORasterio / GDALVirtual Reprojection (VRT) for on-the-fly multi-sensor alignment.
ArchitectureMultiprocessingProducer-Consumer pattern with zero-copy 'List of Views' optimization.

The Problem: The "Quilt Effect"

In Earth Observation (EO), images are captured as massive gigapixel tiles (e.g., 10,980×10,98010,980 \times 10,980). Neural networks, however, are restricted to small patches (e.g., 224×224224 \times 224). Naive tiling results in two major failures:

  1. Grid Artifacts: Edge predictions of a patch are lower quality due to truncated spatial context. "Naively" stitching these together creates visible seams—the "Quilt Effect."
  2. The Memory Wall: Gigapixel data exceeds GPU VRAM, usually requiring expensive HPC clusters and excluding researchers with consumer hardware.

Illustration of the "Quilt Effect" grid artifacts
Illustration of the "Quilt Effect" grid artifacts


Core Engineering: Seamless Inference

GSIP solves these issues through a three-layered spatial strategy that prioritizes mathematical continuity and hardware efficiency.

1. Redundant Patch Inference

Within a processing unit, patches are extracted using a sliding window with a 50% overlap. This ensures that every pixel in the final map is analyzed multiple times (4x) by the neural network. To merge these, GSIP applies a 2D Hann Windowing (sinusoidal weighting) function. This soft-blending gives 100% weight to a patch's center (highest context) and 0% to its edges, resulting in a mathematically seamless probability field.

2. Boundary Integrity (The Halo)

To maintain the validity of the overlapping patches at the boundaries of a processing zone, GSIP employs an ERF-Aware Halo. Every processing chunk is read with an additional margin of data (the Halo). This allows patches sitting on the zone's edge to still have access to the full spatial context they require. By processing this extra context but only retaining the central results, GSIP ensures every pixel in the output was predicted with a full field-of-view.

3. Hardware Democratization (ZoR)

Managing high-context processing on consumer hardware is handled by the Zone of Responsibility (ZoR) algorithm. Instead of using fixed tiles, the ZoR dynamically probes the system's available RAM at runtime. It calculates the largest safe "chunk" (ZoR + Halo) that can be processed without triggering Out-Of-Memory (OOM) errors, allowing gigapixel inference to scale from multi-GPU servers down to a standard 16GB laptop.

Visualizing the Seamless Reconstruction approach
Visualizing the Seamless Reconstruction approach


Agnostic Architecture: The True Strength

The defining strength of GSIP is its complete decoupling of the inference engine from specific models or file formats.

  • Model Agnostic (Adapters): Through a plug-and-play Adapter system, GSIP can wrap around any PyTorch-based model—from classic ResNets to modern Vision Transformers (like NASA/IBM's Prithvi). The engine handles the heavy lifting of data movement, tiling, and reconstruction, while the adapter defines only the model-specific preprocessing and forward pass.
  • Output Agnostic (Reporters): The Reporter system allows for modular output generation. Users can toggle or add new reporters to generate anything from standard GeoTIFFs and uncertainty maps to low-res previews, interactive HTML viewers, or global probability statistics, all without modifying the core pipeline.

A look at some qualitative results from GSIP
A look at some qualitative results from GSIP


Analysis & Uncertainty

GSIP Studio

A native GTK4 desktop application designed for deep analysis. It features interactive, synchronized charts for profiling Memory and GPU utilization, enabling researchers to identify hardware bottlenecks and verify pipeline efficiency in real-time.

Uncertainty Quantification

GSIP provides scientific reliability by outputting per-pixel Shannon Entropy and Prediction Gap maps. These layers visualize precisely where the model is ambiguous (e.g., confusing cloud shadows with water), allowing for a more nuanced interpretation of geospatial results.


Getting Started

1. Installation

git clone https://github.com/rvardiashvili/GSIP.git
cd GSIP
pip install -r src/requirements.txt
pip install -e .

2. Usage

# Run CLI Inference
python src/main.py model=resnet_s2 input_path=/path/to/data output_path=./out

# Launch Analysis Studio
python gtk_client/main.py