FlatHike: Open-Source AI and On-Device Terrain Intelligence for Real-World Trails
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass What I Built Most modern apps are designed to keep your eyes glued to glass. FlatHike is built for the exact opposite: to get you out into the woods, onto the ridges, and back home safely, keeping your screen ti

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿
This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
Most modern apps are designed to keep your eyes glued to glass. FlatHike is built for the exact opposite: to get you out into the woods, onto the ridges, and back home safely, keeping your screen time down to a few seconds of situational clarity.
When you are planning or navigating a hike in the mountains, conventional map apps usually treat distance as flat lines or give naive time estimates based on standard walking speed. But in real backcountry terrain, grade and elevation change dictate everything. A 5-kilometer flat stroll in the park takes an hour; a 5-kilometer mountain scramble with a 25% incline can take half a day.
FlatHike is an open-source, privacy-first Android application designed for hikers, trail runners, and alpine adventurers. It analyzes real GPS telemetry (GPX, KML, GeoJSON, CSV/TXT) and elevation profiles using digital elevation models (DEM) and biomechanical velocity algorithms, combined with on-device open-weight AI (Google Gemma) that runs completely offline with zero internet access.
Route overview: contrasting idealized flat-ground velocity against real recorded alpine speed (1.8 km/h on steep terrain) and pacing telemetry.
The app is published and ready to install on Android devices.
When navigating high-altitude ridges (ascending past 4,000 meters), FlatHike computes real 3D arc lengths and applies WGS-84 geodetic corrections to account for the difference between sea-level map projections and real physical trail length at high elevations:
WGS-84 Geodetic parameters showing elevation reduction to ellipsoid (-13.2 m) and 3D chord adjustments above geoid.
Hikers can tap anywhere along the elevation chart to inspect instantaneous altitude and gradient, and view pace broken down by grade:
Interactive elevation profile with crosshair (3644m at km 16.73) and five-tier slope categorization: Steep Ascent (>15%), Moderate Ascent (5–15%), Flat/Gentle (±5%), Moderate Descent (-15…-5%), and Steep Descent (<-15%).
The trail is dissected into segments with detailed climb rates, accompanied by the built-in AI Gemma trail assistant ready to answer pacing questions:
Kilometer splits (5 km segments shown) showing grade and elevation change, alongside the on-device AI Gemma Trail Assistant ready to generate full route safety reports.
FlatHike gives hikers full control over how Gemma operates, defaulting to an instant offline expert mode with zero data downloads:
Settings modal showing Gemma execution modes: Built-in instant offline expert, on-device MediaPipe GPU/CPU neural model, and cloud fallback.
FlatHike is fully open-source under the Apache-2.0 License:
Building software for the outdoors imposes strict constraints: battery efficiency, offline resilience, and mathematical precision.
Cloud AI is useless at 2,500 meters altitude where cell service vanishes. To give hikers an intelligent guide that works without the internet, FlatHike integrates Google's open-weight Gemma model family (Gemma-2B and Gemma-3B / PaliGemma) executed directly on the user's mobile device via the Google MediaPipe Tasks GenAI API ( com.google.mediapipe:tasks-genai ).
Instead of simplistic averages, FlatHike models hiking velocity based on Waldo Tobler's Hiking Function:
$$W = 6 \cdot e^{-3.5 \cdot \left|\tan(\theta) + 0.05\right|}$$
The app calculates exact cumulative arc lengths along the GPS track using spherical Haversine trigonometry with chord interpolation. It segments the path into continuous grade classes:
This allows hikers to diagnose exactly where their energy was spent and compare their recorded telemetry to theoretical physiological baselines.
This year's Hacktoberfest theme— Touch Grass —highlights the true potential of open-source artificial intelligence: empowering software that operates in the real physical world, not just inside a server rack.
Get outside, stay safe on the trail, and enjoy the mountains!
Some comments may only be visible to logged-in visitors. Sign in to view all comments.