DEV Community

Cover image for WildTrace — Every Small Habitat Has a Story
Arpit
Arpit

Posted on

WildTrace — Every Small Habitat Has a Story

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.

What I Built

I spend a lot of time in front of a computer building things with AI. Between experimenting with models, developing applications, and trying to turn ideas into working products, it's easy to spend hours looking at a screen without paying much attention to what's happening outside.

When I came across this week's Hacktoberfest theme, Touch Grass, I wanted to build something that would connect technology with the real world in a more meaningful way.

Not another chatbot that tells you about nature. Not another image classifier that identifies a plant and calls it a day.

I wanted to build something that gives you a reason to go outside, observe a small part of nature, and come back a few days later to see what might have changed.

That's how WildTrace started.

WildTrace is an AI-powered micro-habitat observation platform. It lets you document tiny natural environments — a patch of moss on a rock, a crack in tree bark, or a small patch of vegetation — and compare photographs of the same place over time.

The interesting part isn't just finding differences between two images. It's figuring out which differences are meaningful, which might be caused by the camera, and when the system simply doesn't have enough evidence to make a claim.

Because a greener photograph doesn't necessarily mean more growth. And sometimes, the most responsible thing an AI can say is, "These photographs aren't comparable enough to tell."

The Experience

WildTrace habitat observation dashboard showing its dark nature-inspired interface for exploring micro-habitats, comparing observations, and viewing field missions

WildTrace's nature-inspired interface brings habitat observations, comparisons, and field missions into one experience.

Users can document a micro-habitat, revisit it over time, compare photographs, examine image-derived indicators, and explore cautious AI-generated hypotheses about visible differences.

Unlike a one-off image identification tool, WildTrace is designed around revisiting a place and building an observation history.

Computer Vision Meets Scientific Caution

WildTrace combines several image-analysis techniques to characterize differences between observations.

1. Excess Green (ExG)

The application calculates:

ExG = 2G − R − B

ExG describes green-channel dominance in an image. It is not a direct measurement of biomass, plant health, or biological growth.

2. Edge Correlation and Framing Assessment

WildTrace uses Sobel edge information and structural correlation to assess whether two photographs are sufficiently comparable for interpreting visual differences.

It also calculates pixel-level differences. However, a large pixel difference is not automatically evidence of biological change.

Photographs taken from different angles can produce substantial pixel changes even when the underlying habitat has changed very little.

3. The Scientific Reliability Gate

WildTrace comparison screen displaying a warning about incompatible photo framing and recommending side-by-side inspection instead of a potentially misleading pixel-difference analysis

When framing is incompatible, WildTrace warns the observer and favours side-by-side inspection over potentially misleading pixel-difference interpretation.

This is one of the project's central design decisions: the application should not confidently claim directional change when the visual evidence is unreliable.

The comparison workflow can flag incompatible framing, disclose uncertainty, and encourage the observer to inspect both photographs together instead of treating image metrics as definitive ecological evidence.

Multimodal AI and Model Flexibility

WildTrace uses a configurable AI inference layer to interpret image pairs and produce structured comparison results.

The implementation includes:

  • OpenRouter-based multimodal inference.
  • Configurable vision models through OPENROUTER_MODEL.
  • Zod validation of model responses.
  • Bounded retries and configurable timeouts.
  • A deterministic local heuristic fallback when hosted inference is unavailable.

The provider abstraction allows model selection to change without replacing the broader comparison workflow.

Model Evaluation

We evaluated three models on three pairwise comparisons from our moss-photo dataset.

Model Median Latency Schema Validation
Google Gemini 2.5 Flash 5.4 seconds 3/3
Qwen 2.5-VL 72B Instruct 25.1 seconds 3/3
Qwen3-VL 8B Instruct 23.3 seconds 3/3

In these tests, all three models returned schema-valid results and respected the incompatible-framing safeguard.

Gemini was substantially faster, so it remains the default for the interactive experience. The Qwen models provide configurable open-weight alternatives through hosted inference.

These are preliminary results from a small evaluation, not proof that the models are equivalent across all habitats or conditions.

Turning Analysis Into Action

WildTrace field mission card suggesting a return visit to a moss-covered rock habitat, with instructions to align the next photograph with a recognizable feature and inspect the moss more closely

WildTrace turns an observation into a practical reason to revisit the habitat, align the next photograph, and inspect a physical feature more carefully.

The goal isn't to end the experience with an AI-generated explanation. WildTrace also suggests a focused field mission to encourage repeat observations and closer inspection.

For the demonstrated moss habitat, the mission encourages returning after a few days, aligning the next photograph with a recognizable rock fissure, and inspecting the moss directly.

This connects the digital workflow back to the real world — exactly what the Touch Grass theme inspires.

How I Built It

The application uses the following technology stack:

  • Next.js and TypeScript — web application and API routes.
  • Prisma and SQLite — persistence for observations and comparison data.
  • Sharp — image processing and preparation.
  • Computer vision utilities — Excess Green calculation, Sobel edge analysis, and pixel-difference measurements.
  • OpenRouter — hosted multimodal inference with configurable vision models.
  • Zod — structured response validation.
  • Docker Compose — containerized deployment with persistent storage.

The architecture separates image processing, AI inference, structured validation, and fallback behaviour. This makes the inference layer configurable while keeping the comparison workflow and scientific safeguards in place.

Offline Fallback

WildTrace includes a deterministic heuristic engine that operates locally without an API key or internet connection.

This provides a fallback interpretation path when hosted inference is unavailable. It is important to distinguish that capability from hosted multimodal analysis: OpenRouter inference requires network access, and the local fallback does not provide equivalent vision-model reasoning.

Privacy and Reliability

The implementation includes several protections and operational safeguards:

  • EXIF metadata stripping during image storage.
  • GPS-coordinate fuzzing in the observation experience.
  • Path-traversal protections on relevant API routes.
  • An allowlist of supported image extensions for disk-path resolution.
  • Server-side handling of inference credentials.
  • Bounded inference retries and configurable timeouts.
  • Persistent Docker volumes for the SQLite database and uploaded images.

These measures reduce specific risks but should not be interpreted as a guarantee that every deployment is free from security issues.

Testing and Verification

The final submission readiness audit reported:

  • 8/8 automated test suites passed.
  • Lint: zero errors and zero warnings.
  • TypeScript: zero type errors.
  • Production build: successful.
  • Multimodal evaluation: three pairwise comparisons per evaluated model.
  • Persistence: SQLite database and uploaded images verified across container restarts.

The repository includes detailed reports documenting the readiness audit and model evaluation.

Limitations

WildTrace is an experimental observation tool, not a validated ecological measurement instrument.

  • Lighting, camera exposure, moisture, shadows, perspective, and framing can confound comparisons.
  • ExG and pixel-level changes cannot independently establish biological growth or ecological causation.
  • Model evaluations cover only a small number of image pairs.
  • Hosted inference depends on external service availability and latency.
  • The offline heuristic fallback does not replace multimodal vision reasoning.
  • Reliable ecological conclusions would require broader field validation and domain-specific evaluation.

These limitations are central to how WildTrace is designed: uncertainty should be visible rather than hidden behind a confident AI response.

What's Next?

Future work could include:

  • Evaluating more habitats and environmental conditions.
  • Improving repeatable framing and alignment assessment.
  • Expanding observation history and comparison visualizations.
  • Testing additional vision models and inference providers.
  • Improving response latency and deployment options.
  • Collecting more carefully documented longitudinal field observations.

Explore the Project

GitHub Repository: https://github.com/A0R0P0I7T/WildTrace

WildTrace explores how AI can help people pay closer attention to the natural world — not by claiming certainty from every photograph, but by making observations easier to compare, uncertainty easier to understand, and the next outdoor visit more meaningful.

Go outside. Find a tiny habitat. Look closer. Come back later.

Top comments (0)