DEV Community

Ranit Das
Ranit Das

Posted on

NatureLens — An AI That Tells You to Touch Grass.

This is a submission for the Hacktoberfest Open-Source AI Challenge — Week 1: Touch Grass

What if your phone could help you notice the world instead of distracting you from it?

We spend hours looking at screens to discover things that are literally sitting outside our windows.

A bird on a branch.

A strange leaf.

A mushroom beside a trail.

A flower you've walked past a hundred times.

So I built NatureLens — a local-AI-powered outdoor field guide designed around one simple idea:

Touch grass. Notice more.

Instead of asking people to search the internet every time they see something interesting, NatureLens turns their phone into an interactive field guide.

Point your camera at something.

Observe it.

Let local AI help you understand it.

Then go outside and look again.


🌱 What I Built

NatureLens is a mobile-first PWA + desktop companion for outdoor exploration.

It combines your phone's camera and location capabilities with local multimodal AI to create an exploration loop:

See → Identify → Investigate → Observe Again → Discover

The core experience

📸 Point your camera at something

Take a photo of a plant, insect, object, or other outdoor discovery.

🤖 Ask local AI what you're looking at

NatureLens sends the image to Gemma 4 E4B running locally through Ollama.

🧠 Get a confidence-aware identification

Instead of pretending AI is always certain, NatureLens communicates uncertainty and encourages verification.

🔎 Get evidence guidance

The app doesn't just say "that's probably X."

It gives you things to look for so you can investigate the identification yourself.

👀 Observe Again

Go back to the object.

Look closer.

Compare what you see with what the model suggested.

That's intentional.

The goal isn't to replace observation.

The goal is to make observation more interesting.


🤖 The AI Runs Locally

This is the part of NatureLens I'm particularly excited about.

Instead of sending every image to a proprietary cloud AI API, NatureLens uses:

Gemma 4 E4B + Ollama

The model runs locally on the user's computer.

             ┌─────────────────────┐
             │      Your Phone     │
             │                     │
             │  Camera + GPS + UI  │
             └──────────┬──────────┘
                        │
                        │ HTTPS
                        ▼
             ┌─────────────────────┐
             │   NatureLens App    │
             │      Next.js        │
             └──────────┬──────────┘
                        │
                        │ localhost
                        ▼
             ┌─────────────────────┐
             │       Ollama        │
             │                     │
             │    Gemma 4 E4B      │
             │  Multimodal Model   │
             └─────────────────────┘
Enter fullscreen mode Exit fullscreen mode

For development and phone testing, the laptop acts as the local AI host.

The phone doesn't need direct access to Ollama.

It talks to the NatureLens application, which communicates with the locally running model.

That means the intelligence powering the experience can stay under the developer's control.

No AI API key is required for the core identification workflow.

No per-image API bill.

No requirement to upload every observation to a third-party AI service.

Just:

Your hardware + Ollama + Gemma 4 E4B.


🧠 Why Gemma 4 E4B?

NatureLens isn't just using Gemma because it's an AI model that can look at images.

The project is specifically designed around the idea of local multimodal intelligence.

Nature exploration is inherently visual.

A text-only model would require the user to describe what they're seeing:

"There is a small green insect with transparent wings sitting on a leaf..."

That's already defeating the purpose.

With a multimodal model, the interaction becomes:

Here. Look at this. What should I notice?

That's a much more natural interface for exploration.

Gemma 4 E4B makes that possible while keeping inference local through Ollama.

And that changes the architecture of the application.

Instead of:

Phone → Cloud API → AI → Phone
Enter fullscreen mode Exit fullscreen mode

NatureLens can work around:

Phone → Your Computer → Local Gemma → Your Computer → Phone
Enter fullscreen mode Exit fullscreen mode

The AI isn't some mysterious service somewhere on the internet.

It's a model running on your machine.


🗺️ More Than an Image Classifier

I didn't want NatureLens to become:

Upload image → AI gives species name → Done.

That would just be another AI wrapper.

So the application is built around exploration rather than identification.

🧭 Discovery Map

Your discoveries can be associated with locations and explored through a map interface.

📍 GPS Capture

Observations can include where they happened, turning individual discoveries into a personal field journal.

🔍 Confidence-Aware Identification

The AI isn't treated as an unquestionable source of truth.

If the visual evidence isn't strong enough, NatureLens encourages another observation.

🧩 Evidence Guidance

The application can tell you what visual characteristics to inspect to validate an identification.

🔄 Observe Again

One of the most important interactions in the app.

Instead of ending the experience after an AI answer, NatureLens sends you back outside.

🕵️ Mystery Mode

Don't immediately reveal everything.

Explore first.

Guess.

Then reveal.

📝 AI Field Journal

Your observations can be transformed into natural field-journal entries using the local AI workflow.

🎯 Outdoor Quests

NatureLens can generate small four-step exploration quests.

For example:

Find something with an unusual texture.
Photograph it.
Look for three visual characteristics.
Compare your observation with the AI's hypothesis.

The AI becomes a guide, not the destination.


📱 Built for the Phone

The interface is intentionally mobile-first.

The intended interaction isn't:

Sit at your desk → upload a photo → read an AI response.

It's:

Walk outside → see something → take out your phone → investigate.

NatureLens is an installable PWA, so the experience can feel much closer to a native mobile application.

The desktop interface acts as the companion environment for exploring discoveries, reviewing observations, and developing the application.


🛠️ How I Built It

The stack is deliberately modern but relatively lightweight:

Frontend

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS 4
  • Lucide React

Local Data

  • IndexedDB
  • Dexie

This lets NatureLens keep exploration data locally instead of requiring a traditional cloud database for the core experience.

Maps

  • Leaflet
  • OpenStreetMap

AI

  • Ollama
  • Gemma 4 E4B

Architecture

                         NATURELENS
                              │
             ┌────────────────┴────────────────┐
             │                                 │
       Mobile Explorer                  Desktop Explorer
             │                                 │
       Camera / GPS                         Dashboard
             │                                 │
             └──────────────┬──────────────────┘
                            │
                      Next.js App
                            │
                 ┌──────────┴──────────┐
                 │                     │
             IndexedDB             Local Vault
                 │                     │
                 │              .naturelens/
                 │                     │
                 └──────────┬──────────┘
                            │
                       AI Analysis
                            │
                          Ollama
                            │
                     Gemma 4 E4B
Enter fullscreen mode Exit fullscreen mode

🌍 Why Does Open Innovation Matter?

This project would be very different if the only option were a closed AI API.

Open models make it possible to experiment with a different question:

What happens when AI becomes part of the user's own environment instead of another cloud dependency?

For NatureLens, that matters because the application deals with:

  • Camera images
  • Personal observations
  • Location information
  • Field journals
  • Exploration history

Running the model locally gives developers and users more control over where inference happens.
It also makes experimentation dramatically easier.
I can change the model.
I can change the prompt.
I can change the inference pipeline.
I can inspect what is happening.
And I don't have to build the entire project around someone else's API billing model.
Gemma 4 E4B isn't just a component inside NatureLens.
It makes the project's local-first AI architecture possible.


🔥 The Interesting Part: AI That Sends You Away From the Screen

Most AI applications are optimized for keeping you inside the application.

More questions.

More conversations.

More generated content.

More time on screen.

NatureLens is intentionally different.

If NatureLens works perfectly, the user should eventually stop looking at the phone.
That's the point.
The AI might tell you:

"I think this is a particular type of plant."
But the next interaction isn't another chat message.

It's:
"Go look at the leaf again."
Look at the veins.
Look at the edges.
Check the underside.
Compare the evidence.
Make your own observation.
That's the philosophy behind the entire project:

AI should sometimes help you look away from the screen.


🎮 A Typical NatureLens Session

Imagine you're walking through a park.
You notice something strange growing beside a tree.

01 — Discover

You open NatureLens.
📸 Capture an image.

02 — Identify

Gemma 4 E4B analyzes the image locally.

03 — Question

NatureLens gives you a likely identification with confidence information.

04 — Investigate

The application tells you what characteristics to look for.

05 — Observe Again

You physically inspect the object.

06 — Record

Save the discovery with its location and notes.

07 — Keep Exploring

NatureLens generates another small exploration challenge.
And suddenly...
You aren't scrolling through your phone anymore.
You're using it to pay attention to the world around you.


💻 Code

The entire project is open source:

GitHub:
https://github.com/Uncooperativecase225/naturelens

The repository contains the complete NatureLens application, including the local AI integration and setup instructions.


🧪 Local Setup

You can run NatureLens without a paid AI API.

1. Install Ollama

Install Ollama on your computer.
Then download Gemma 4 E4B:

ollama pull gemma4:e4b
Enter fullscreen mode Exit fullscreen mode

Test it:

ollama run gemma4:e4b
Enter fullscreen mode Exit fullscreen mode

2. Clone NatureLens

git clone YOUR_REPOSITORY_URL
cd naturelens
Enter fullscreen mode Exit fullscreen mode

3. Install dependencies

npm install
Enter fullscreen mode Exit fullscreen mode

4. Configure the local AI

Create .env.local:

OLLAMA_URL=http://127.0.0.1:11434
OLLAMA_MODEL=gemma4:e4b
Enter fullscreen mode Exit fullscreen mode

5. Start NatureLens

npm run dev
Enter fullscreen mode Exit fullscreen mode

Then open:

http://localhost:3000
Enter fullscreen mode Exit fullscreen mode

That's it.
Your AI inference is running locally.


📲 Taking It Outside

For phone testing, the development machine can expose the Next.js application through a temporary HTTPS tunnel.

The architecture becomes:

Phone
  ↓
HTTPS
  ↓
Cloudflare Tunnel
  ↓
Next.js on Laptop
  ↓
Ollama
  ↓
Gemma 4 E4B
Enter fullscreen mode Exit fullscreen mode

This lets you actually take the interface outside and use the phone camera and GPS while the model remains on your computer.

For a real deployment, this would be replaced with an appropriate production hosting/local-edge architecture.


🔐 Privacy by Design

NatureLens is designed around a local-first architecture.

The core AI workflow does not require sending observations to a commercial AI API.

Local exploration data can be stored using IndexedDB, with an optional local vault.

That makes the project particularly interesting for applications involving personal observations and potentially sensitive location data.

Of course, users should still understand that when using a temporary public development tunnel, the web application itself is reachable through that tunnel.

Development tunnels are not a substitute for production security architecture.


⚠️ One Important Limitation

Gemma 4 E4B is an AI model.
That means its identification can be wrong.
NatureLens deliberately does not treat AI output as ground truth.
Especially with plants, fungi, insects, and potentially dangerous wildlife:
AI identification should be treated as an observation aid, not a safety authority.
Don't eat something because an AI said it's edible.
Don't approach wildlife because an AI said it's harmless.
Don't treat an AI-generated species identification as scientific confirmation.
The model helps you notice and investigate.
It doesn't replace expertise.


🧠 My Biggest Takeaway

Building NatureLens changed how I think about AI applications.
The easiest way to build an AI product is often:

Put a text box in front of an API.
But multimodal local models open a much bigger design space.
You can build experiences around:
seeing, listening, moving, observing and interacting with the physical world.
That's what I wanted to explore with NatureLens.

Not another chatbot.
Not another productivity assistant.
Not another application designed to maximize screen time.
Something that uses AI to encourage you to leave the screen behind.


🌿 Touch Grass. Notice More.

There are millions of things outside that we've stopped noticing.
NatureLens is my attempt to build a small bridge between local AI and the physical world.

And at the center of that bridge is Gemma 4 E4B — running locally, looking at the world through your camera, and helping turn ordinary walks into small investigations.

The ultimate success condition isn't:

"How long did you use NatureLens?"

It's:

"What did you notice after you put your phone down?"

🌿 Touch grass. Notice more.


🧑‍💻 My Agent Session

https://chatgpt.com/share/6ac80fbd-0574-83ee-bb79-b8cf54297cb4

This section documents the development session and AI-assisted building process used while creating NatureLens.


🏆 Prize Categories

  • Open-Source AI
  • Local AI / Open-Weight Models
  • Gemma / Google AI
  • Developer Tools / AI Applications

👥 Team

Built by: @ranit_das_2005

Built for the Hacktoberfest Open-Source AI Challenge — Week 1: Touch Grass.

NatureLens — Touch grass. Notice more.

Top comments (0)