2026.5.31

CropGuardian — AI Agricultural Threat Detection

Project Whitepaper — Plain-Language Edition

/ ARTICLE
ProjectCropGuardian
TaglineAI-Powered Agricultural Assistant
Built withNext.js 15 + TensorFlow.js
PrivacyAll AI runs in your browser — data stays on your phone
AudienceFarmers, teammates, reviewers, and anyone new to technology

Table of contents

  1. Executive summary
  2. The problem in everyday terms
  3. What CropGuardian does
  4. Feature 1 — Real-time AI scanner
  5. Feature 2 — Mobile-first field experience
  6. Feature 3 — Pest wiki
  7. Feature 4 — Smart alert history
  8. How the AI works (plain English)
  9. Why your data stays on the phone
  10. How the app is built
  11. Getting started
  12. Future roadmap
  13. Glossary
  14. Elevator pitch

1. Executive summary

CropGuardian is a mobile-first web app that helps farmers spot threats early, learn about common pests, and keep a record of what the camera saw — all from a smartphone.

The app combines four tools in one:

  1. Live AI scanner — point your camera at the field; the app draws boxes around cattle and other visible threats in real time.
  2. Farmer-friendly design — big buttons, bottom navigation, and a dashboard you can read at a glance outdoors.
  3. Pest wiki — a searchable guide to pests like locusts, fall armyworms, and aphids, with prevention tips.
  4. Alert history — a log of past detections with time and field sector, so you can spot patterns over days or weeks.

Everything runs in the browser. Photos and video frames are not sent to a cloud server for analysis. That keeps the farm private and works better on patchy rural internet.


2. The problem in everyday terms

Farmers lose crops to problems that appear quickly and are easy to miss:

ProblemWhat goes wrong
Animals in the fieldCows, horses, or sheep eat or trample crops — often at dawn or dusk
Insects & pestsLocusts, armyworms, and aphids can spread fast across a whole plot
Late responseDamage is noticed only after a full night or weekend
Hard-to-use techMany tools need fast internet, expensive cameras, or training

CropGuardian is built for the farmer who already carries a phone and needs something simple, fast, and private — not another complicated dashboard meant for office workers.


3. What CropGuardian does

Think of CropGuardian as four apps in one jacket:

PartOne-line summary
AI ScannerWatches the camera and warns you when something threatening appears
DashboardShows farm health, active alerts, and system status
Pest WikiTeaches you how to identify and treat common pests
Alert HistorySaves a timeline of detections for later review

4. Feature 1 — Real-time AI scanner

What you see

When you open the scanner and allow camera access, the app shows your live field view with colored boxes drawn around objects the AI recognizes. Each box includes:

  • A label (for example: cow, bird, horse)
  • A confidence score — how sure the AI is (shown as a percentage)
  • A “Threat Detected” alert when something farm-relevant is found

What the scanner is best at

The scanner uses COCO-SSD, a pre-trained vision model that is strong at spotting large, visible things:

Detected typeWhy it matters on a farm
Cattle (cow)Grazing or trampling crops
Horse / sheepLivestock wandering into plots
BirdFeeding on grain or seedlings
Dog / catStrays disturbing plants or storage

For tiny insects (locusts, aphids), the live camera model is limited — those pests are better covered in the Pest Wiki (Section 6). Future versions plan custom pest models (see Roadmap).

Privacy-first by design

The scanner never uploads your frames to a server for analysis. The neural network runs inside your browser using TensorFlow.js.


5. Feature 2 — Mobile-first field experience

CropGuardian is designed for one hand, bright sun, and muddy pockets — not for a desktop office.

Design choices

ChoiceWhy it helps farmers
Mobile-first layoutButtons and text are sized for phones, not laptops
Bottom navigationThumb-friendly tabs while holding the phone
Glassmorphism UIClear, modern panels that stay readable outdoors
Earthy forest tonesCalm colors that fit an agritech feel and reduce eye strain
Responsive dashboardSee active threats, farm health, and vitals in one glance

You open the site in Chrome or Safari on your phone — no app store download required today (PWA “install to home screen” is on the roadmap).


6. Feature 3 — Pest wiki

Not every threat shows up as a big object on camera. Some pests are small but devastating. The Pest Wiki is CropGuardian’s built-in field encyclopedia.

What’s inside

  • Searchable pest directory — find pests by name or browse categories
  • Expert-style entries for common threats, including:
    • Locusts
    • Fall armyworms
    • Aphids
  • Identification guides — what to look for on leaves, stems, or soil
  • Threat levels — how urgent the problem is
  • Prevention methods — both organic and standard treatment options

The wiki turns CropGuardian from “camera only” into a complete assistant — detect what you can see live, and learn what you cannot.


7. Feature 4 — Smart alert history

Every time the scanner flags a threat, CropGuardian can log the event to build a farm audit trail.

Logged detailPlain meaning
TimestampExact date and time of detection
Sector / location labelWhich part of the farm (e.g. North plot, Gate B)
Detection typeWhat the AI saw (cow, bird, etc.)

Over time, this helps answer questions like:

  • “Do cows always enter from the east gate at night?”
  • “Are birds worse after harvest?”
  • “Did our new fence reduce alerts?”

8. How the AI works (plain English)

Neural network

A neural network is software trained on thousands of example images. It learns patterns — “this shape and texture usually means cow” — without a human writing every rule by hand.

COCO-SSD is a ready-made detector trained on the COCO dataset (everyday photos with 80 object types). CropGuardian loads this model in the browser and runs it on each camera frame.

Object detection vs. classification

TaskQuestion answered
Classification“Is there a cow somewhere in this photo?”
Object detection“There is a cow here, and a bird there” (with boxes)

CropGuardian uses detection because a field may have multiple threats at once, and the farmer needs to know where to look.


9. Why your data stays on the phone

Cloud AICropGuardian
Needs strong internetOften yesWorks after first load
Who sees your field?Third-party serversOnly you
SpeedUpload + waitNear real-time
Rural connectivityPain pointDesigned around it

Field images can reveal crop type, farm layout, and location. Keeping inference on-device is a deliberate privacy choice for the farming community.


10. How the app is built

LayerTechnologyRole
Website frameworkNext.js 15 (App Router)Fast, modern pages and routing
LanguageJavaScript (ES6+)Core application code
AI engineTensorFlow.js + COCO-SSDLoad and run the vision model in-browser
IconsLucide ReactClear symbols for nav and alerts
StylingCustom CSS (agritech theme)Forest tones, glass panels, mobile layout

License: MIT — free to use, modify, and share (see LICENSE in the repository).


11. Getting started

For developers or anyone setting up the project locally:

bash
git clone <your-repo-url>
cd Cattle-Detection-Project
npm install
npm run dev

Then open http://localhost:3000 on your phone or computer browser.

Tip for field testing: Use your phone on the same Wi‑Fi as your computer, and visit your computer’s local network address (e.g. http://192.168.x.x:3000) to test the camera outdoors.


12. Future roadmap

CropGuardian is actively evolving. Planned improvements:

Planned featureBenefit
PWA supportInstall to home screen + better offline use
Regional languagesWiki and UI in local languages for wider reach
Weather integrationHumidity, rain, and soil moisture context for alerts
Custom pest modelsTrain detection on region-specific insects via transfer learning

13. Glossary

TermSimple definition
AI / machine learningSoftware that learns from examples instead of fixed rules
COCO-SSDA pre-built object detector that finds and labels things in images
TensorFlow.jsRuns machine-learning models inside a web browser
Bounding boxColored rectangle drawn around a detected object
Confidence scoreHow sure the AI is (0–100%)
Object detectionFinding what something is and where it is
Mobile-firstDesigned for phones before desktops
GlassmorphismUI style with frosted, semi-transparent panels
PWAProgressive Web App — website that can install like an app
Transfer learningStarting from an existing AI model and teaching it new pests
MIT LicenseOpen license allowing free use with minimal restrictions

14. Elevator pitch

CropGuardian is a mobile-first agricultural assistant that puts live threat detection, a pest encyclopedia, and an alert history log in every farmer’s pocket. Using TensorFlow.js and COCO-SSD, it highlights cattle, birds, and other visible threats through the phone camera — with confidence scores and instant “Threat Detected” alerts — while keeping all image processing on the device. Combined with a searchable wiki for locusts, armyworms, and aphids, it helps farmers see, learn, and remember what happened in the field. Built with Next.js 15 for the farming community, under the MIT license.

Developed with care for the farming community.

RISHITA · RESEARCH & ENGINEERINGPOSTS: 2PROJECTS: 3