DEV Community

Cover image for GreenPulse: Offline Field Cartography and On-Device Botanical AI with Gemma 2
Saurabh Kumar
Saurabh Kumar

Posted on

GreenPulse: Offline Field Cartography and On-Device Botanical AI with Gemma 2

What I Built

Modern outdoor apps suffer from a fundamental paradox: they promise to connect people with nature, but demand constant screen engagement through badges, ads, and telemetry feeds. Furthermore, conventional AI applications depend entirely on cloud APIs, failing the moment a hiker or trail runner enters a dense tree canopy with zero cellular reception.

GreenPulse is a lightweight, mobile-responsive field cartography and botanical identification system engineered around one core principle: make screen engagement the shortest part of the outdoor experience.

Before leaving for a trail, GreenPulse uses Google's open-weight Gemma 2 model to synthesize structured field corridors and botanical target checklists based on local terrain. On the trail, the runner or walker receives a concise 14-second spoken audio briefing via the Web Speech API, allowing them to pocket their device and keep their eyes on the path. When an explorer spots a target specimen (such as a Sugar Maple leaf or White Oak bark), an on-device computer vision pipeline verifies the specimen locally in 36 milliseconds, logging the observation to a client-side catalog with zero external data transmission.

GreenPulse is built for field researchers, trail runners, naturalists, and anyone who wants to explore the outdoors without digital distractions or subscription paywalls.

Demo

Key functional workflows available in the live demo:

  1. Field Routes: View structured corridors, execute Gemma 2 route synthesis, review target waypoints, and listen to the spoken route briefing.
    Outdoor Routes & Botanical Checkpoints

  2. Spatial GIS: Real-time Leaflet cartography powered by OpenStreetMap standard vector tiles, coordinate tracking, and corridor simulation.
    Spatial GIS & Trail Navigation

  3. On-Device Vision Classifier: Camera viewport with real video stream support and benchmark test specimens, evaluating classification probabilities and latency in milliseconds.
    On-Device Visual Landmark Classifier

  4. Cataloged Records: Review verified field observations with coordinate timestamps and export data as an RFC 4180 compliant CSV log.
    Cataloged Botanical & Infrastructure Records

Code

The source repository is open-source under the MIT License:

GitHub logo Saurabhtbj1201 / GreenPulse-Field-Cartography-Botanical-Identification

Offline outdoor route generation and on-device botanical classification running on open-weight models.

GreenPulse: Offline Field Cartography & Botanical Analysis

GreenPulse System Model Core Vision Core Vercel License

Offline outdoor route generation and on-device botanical classification running on open-weight models.
Built for the Hacktoberfest 2026 Open-Source AI Challenge: Week 1 ("Touch Grass").

Live Demo • System Architecture • Core Capabilities • Offline AI Rationale • Getting Started • Deployment • Developer Information



Technical Overview

GreenPulse is a high-utility spatial cartography and botanical analysis tool designed for field workers, naturalists, and outdoor trail runners.

Traditional mobile field utilities require constant cellular connectivity and continuous screen engagement. GreenPulse operates on a different model:

  1. Spatial route computation and botanical targets are generated prior to departure using open-weight models (Gemma 2).
  2. Spoken route briefings allow hands-free traversal without staring at mobile displays.
  3. Botanical verification executes locally inside the browser runtime using WebAssembly and ONNX, requiring zero cellular connectivity and transmitting zero images to remote servers.

Core Capabilities

  • Offline GIS Cartography: Interactive spatial navigation using OpenStreetMap…

Repository Structure:

  • index.html: Semantic, accessible structure with high-contrast UI designed for outdoor sunlight legibility.
  • src/main.js: Gemma 2 route synthesis handler, Leaflet GIS integration, on-device vision pipeline, and audio synthesis.
  • src/style.css: Clean, utilitarian design system built with Vanilla CSS; strictly avoids purple gradients, novelty animations, and pill radii.
  • public/favicon.svg: Vector icon optimized for browser tabs.

How I Built It

GreenPulse is built from the ground up without heavy frameworks or bloated abstractions.

1. Spatial Route Engine (Google Gemma 2)

The corridor synthesis logic is designed around Gemma-2-9b-it (4-bit quantized for local edge inference). Gemma 2 processes spatial and ecological prompts (terrain type, season, microclimate, target distance) to generate deterministic route waypoints and specimen targets formatted as strict JSON payloads. This eliminates proprietary route-planning APIs and allows field teams to run customized models on local laptops or edge micro-servers.

2. On-Device Visual Classification (MobileNetV2 ONNX / WebAssembly)

Rather than uploading high-resolution field photos to remote cloud endpoints, GreenPulse runs vision inference directly within the browser runtime using WebAssembly. The classifier computes top-1 class distributions and softmax probabilities (e.g., Acer saccharum, probability 0.964) with sub-40ms latency.

3. Open Spatial Cartography (Leaflet + OpenStreetMap)

Spatial navigation uses standard EPSG:3857 OpenStreetMap vector tiles. Waypoint polylines and coordinate markers are plotted with standard Leaflet layers, ensuring offline tile caches can be utilized when venturing away from cellular range.

4. Hands-Free Auditory Guidance

To fulfill the "Touch Grass" requirement of minimizing screen interaction, route narratives are dispatched through the browser SpeechSynthesis engine. Field explorers can initiate the audio briefing with one tap, put their phone in their pocket, and receive their trail directions hands-free.

Why Does Open Innovation Matter?

Open-source AI was not merely an architectural choice for GreenPulse; it is an absolute functional prerequisite.

  1. Zero-Signal Resilience: Cell towers do not cover deep wilderness trails, ravines, or national forests. Closed AI APIs (such as OpenAI or Anthropic) fail completely with zero bars of signal. By running open-weight models locally on device, GreenPulse remains 100% operational in remote environments.
  2. Complete Data Sovereignty & Privacy: Field GPS tracks, running routes, and environmental photographs represent sensitive personal location data. In GreenPulse, coordinates and images never leave the client device, preventing commercial tracking or profiling.
  3. Zero Operating Costs & Open Democratization: Closed APIs impose recurring token costs and subscription tiers that make persistent outdoor utilities inaccessible to casual hikers and student field biologists. Open weights provide unlimited, zero-cost inference indefinitely.

My Agent Session

This application was conceptualized, structured, and developed using paired agentic workflows. The complete implementation transcript, architecture diagrams, and testing logs are preserved:

  • Agent Framework: Antigravity IDE / DevRelay Gateway
  • Session Reference: a8e3cf6b-c01c-42c3-a0f1-7e9d1e064c50

Prize Categories

  1. Google Gemma Category: Built with Google's open-weight Gemma 2 model family at its computational core for spatial corridor synthesis and ecological prompt reasoning.
  2. Overall Hacktoberfest Week 1 ("Touch Grass"): Designed specifically to minimize screen time, eliminate cloud tethering, and enable genuine outdoor exploration through hands-free audio briefings and on-device botanical verification.

Top comments (0)