Inspiration

Hikers and park rangers have access to weather forecasts, trail maps, and terrain data, but these tools rarely answer the most important question after a storm:

Which parts of this mountain are most likely to fail, and which trails should people avoid?

We built TerraSense to connect geospatial machine learning with actionable outdoor-safety guidance. Our primary focus is Mount Rainier, where steep terrain, heavy rainfall, glaciers, and a large trail network make landslide risk difficult to evaluate manually.

TerraSense estimates:

[ P(\text{rainfall-triggered landslide in a spatial cell during the next 72 hours}) ]

and translates that prediction into trail-level recommendations for hikers and park rangers.

What it does

TerraSense combines terrain data, historical landslide records, recent rainfall, forecast rainfall, and trail geometry to produce a live hazard assessment.

The application includes:

  • An interactive 3D globe with mountain and hill markers
  • Detailed mountain pages with 3D terrain
  • Static susceptibility and dynamic rainfall-triggered heatmaps
  • Circular, high-resolution risk overlays
  • Historical landslide locations
  • Trail-level risk scores
  • High-risk trail segment identification
  • Hazard zones and bypass routes
  • Debris-flow runout simulation
  • Streaming terrain, weather, history, and route analyses
  • Plain-language ranger alerts and reactive measures

Every mountain and hill receives a heatmap regardless of its overall risk level or whether trails are mapped. Locations with rendered model tiles use those tiles directly. Locations without local raster data receive a consistent circular fallback heatmap anchored to the model score.

How we built it

The frontend was built with Next.js, React, MapLibre GL, React Three Fiber, and Three.js. The backend uses FastAPI and PostgreSQL-compatible storage.

Our machine-learning pipeline has two primary stages.

First, a LightGBM terrain susceptibility model uses features derived from Copernicus DEM and ESA WorldCover data, including:

  • Elevation
  • Slope
  • Aspect
  • Curvature
  • Distance to drainage
  • Topographic wetness index
  • Land-cover classes

Historical labels come from the NASA Global Landslide Catalog and regional geological inventories.

Second, a dynamic rainfall model combines terrain susceptibility with:

  • Recent rainfall
  • Antecedent moisture
  • Forecast rainfall
  • Rainfall exceedance signals

This produces a 72-hour probability-style raster, which is saved as a GeoTIFF and converted into cached, high-resolution XYZ map tiles.

The model results are connected to a seven-agent analysis pipeline:

  • Terrain Analyst
  • Weather Analyst
  • Trail Analyst
  • History Analyst
  • Route Scout
  • Risk Synthesizer
  • Alert Writer

The analysts run in parallel. The Risk Synthesizer combines their findings into an operational decision, and the Alert Writer converts that decision into readable guidance.

Challenges we ran into

The biggest challenge was geographic generalization.

A model can perform well when training and test samples come from nearby terrain, but that does not mean it will transfer successfully to a different mountain. To address this, we used spatial validation rather than relying only on random pixel splits.

Our current results are approximately:

  • Regional terrain spatial cross-validation ROC-AUC: 0.82
  • External Mount Rainier terrain ROC-AUC: 0.60
  • Rainfall-trigger model ROC-AUC: 0.75
  • Expected calibration error: approximately 0.026

The gap between regional validation and Mount Rainier performance revealed the main limitation of the project: geographic domain shift. Landslide inventories are sparse, reporting quality varies by region, and there are not enough jointly labeled terrain-and-weather events for every target mountain.

We also had to prevent spatial and temporal leakage. Neighboring pixels from the same landslide or storm can make a model appear much stronger than it really is. We used spatial blocks, event-aware labels, and held-out regions to make evaluation more realistic.

Another challenge was turning large geospatial rasters into a responsive web experience. GeoTIFFs are useful for scientific processing but are not directly suitable for interactive maps. We converted them into cached XYZ tiles and added circular masking, smooth edge fading, high-resolution rendering, and cache-busting metadata.

Finally, we had to integrate machine-learning predictions with agent-generated explanations without allowing the agents to invent or alter model outputs. The agents receive structured predictions and add context from terrain, weather, history, trails, and routes.

Accomplishments that we're proud of

We are proud that TerraSense connects the full pipeline:

[ \text{Terrain data} \rightarrow \text{Feature engineering} \rightarrow \text{ML prediction} \rightarrow \text{Risk map} \rightarrow \text{Trail analysis} \rightarrow \text{Actionable guidance} ]

We built a working system that goes beyond a static susceptibility map. It combines terrain and weather, identifies high-risk areas, connects those areas to real trails, suggests bypass routes, and communicates the result in plain language.

We are also proud of the system's visual consistency. Every location receives a heatmap, even when it has no local raster or mapped trail data. Risk colors remain consistent with the underlying score, and the heatmaps fade cleanly into the surrounding terrain instead of showing square tile boundaries.

Most importantly, we tried to be honest about uncertainty. TerraSense reports external validation performance and known limitations rather than presenting a strong internal score as proof that the system is reliable everywhere.

What we learned

The biggest lesson was that landslide prediction is not only a terrain-classification problem.

Terrain tells us where a landslide could occur. Rainfall and hydrologic conditions help determine when risk may increase. A useful system needs both.

We also learned that a model score alone is not enough. A useful hazard system must be:

  • Spatially aligned
  • Calibrated
  • Explainable
  • Visually understandable
  • Connected to real decisions
  • Honest about uncertainty

Building TerraSense required us to work across geospatial raster processing, remote sensing, spatial machine learning, calibration, web mapping, backend APIs, database design, real-time agent orchestration, trail-network analysis, and visualization.

The most important technical lesson was that strong internal validation does not guarantee strong external performance. Geographic holdouts and target-domain data are essential for any real-world hazard application.

What's next for TerraSense

The most important next step is improving target-domain validity.

Our next goals are:

  • Acquire more dated Mount Rainier landslide events
  • Obtain historical as-of GFS and GEFS forecasts
  • Pair forecast data with verified event timestamps
  • Add snow, soil-moisture, and freeze-thaw features
  • Expand regional geology and soil inputs
  • Improve uncertainty and out-of-distribution detection
  • Validate the combined terrain-plus-rainfall system on additional mountains
  • Add more mountain-specific satellite and terrain windows
  • Run the application with hosted infrastructure and live model providers
  • Perform more rigorous operational and safety testing

TerraSense is not a replacement for official emergency-management warnings, local authorities, or geotechnical investigation. It is a decision-support system designed to help people understand where rainfall-triggered landslide risk may be concentrated and what actions deserve attention first.

Built With

Share this project:

Updates

Submission history