2026.5.31
CropGuardian — AI Agricultural Threat Detection
Project Whitepaper — Plain-Language Edition
| Project | CropGuardian |
| Tagline | AI-Powered Agricultural Assistant |
| Built with | Next.js 15 + TensorFlow.js |
| Privacy | All AI runs in your browser — data stays on your phone |
| Audience | Farmers, teammates, reviewers, and anyone new to technology |
Table of contents
- Executive summary
- The problem in everyday terms
- What CropGuardian does
- Feature 1 — Real-time AI scanner
- Feature 2 — Mobile-first field experience
- Feature 3 — Pest wiki
- Feature 4 — Smart alert history
- How the AI works (plain English)
- Why your data stays on the phone
- How the app is built
- Getting started
- Future roadmap
- Glossary
- 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:
- Live AI scanner — point your camera at the field; the app draws boxes around cattle and other visible threats in real time.
- Farmer-friendly design — big buttons, bottom navigation, and a dashboard you can read at a glance outdoors.
- Pest wiki — a searchable guide to pests like locusts, fall armyworms, and aphids, with prevention tips.
- 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:
| Problem | What goes wrong |
|---|---|
| Animals in the field | Cows, horses, or sheep eat or trample crops — often at dawn or dusk |
| Insects & pests | Locusts, armyworms, and aphids can spread fast across a whole plot |
| Late response | Damage is noticed only after a full night or weekend |
| Hard-to-use tech | Many 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:
| Part | One-line summary |
|---|---|
| AI Scanner | Watches the camera and warns you when something threatening appears |
| Dashboard | Shows farm health, active alerts, and system status |
| Pest Wiki | Teaches you how to identify and treat common pests |
| Alert History | Saves 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 type | Why it matters on a farm |
|---|---|
| Cattle (cow) | Grazing or trampling crops |
| Horse / sheep | Livestock wandering into plots |
| Bird | Feeding on grain or seedlings |
| Dog / cat | Strays 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
| Choice | Why it helps farmers |
|---|---|
| Mobile-first layout | Buttons and text are sized for phones, not laptops |
| Bottom navigation | Thumb-friendly tabs while holding the phone |
| Glassmorphism UI | Clear, modern panels that stay readable outdoors |
| Earthy forest tones | Calm colors that fit an agritech feel and reduce eye strain |
| Responsive dashboard | See 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 detail | Plain meaning |
|---|---|
| Timestamp | Exact date and time of detection |
| Sector / location label | Which part of the farm (e.g. North plot, Gate B) |
| Detection type | What 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
| Task | Question 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 AI | CropGuardian | |
|---|---|---|
| Needs strong internet | Often yes | Works after first load |
| Who sees your field? | Third-party servers | Only you |
| Speed | Upload + wait | Near real-time |
| Rural connectivity | Pain point | Designed 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
| Layer | Technology | Role |
|---|---|---|
| Website framework | Next.js 15 (App Router) | Fast, modern pages and routing |
| Language | JavaScript (ES6+) | Core application code |
| AI engine | TensorFlow.js + COCO-SSD | Load and run the vision model in-browser |
| Icons | Lucide React | Clear symbols for nav and alerts |
| Styling | Custom 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:
git clone <your-repo-url>
cd Cattle-Detection-Project
npm install
npm run devThen 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 feature | Benefit |
|---|---|
| PWA support | Install to home screen + better offline use |
| Regional languages | Wiki and UI in local languages for wider reach |
| Weather integration | Humidity, rain, and soil moisture context for alerts |
| Custom pest models | Train detection on region-specific insects via transfer learning |
13. Glossary
| Term | Simple definition |
|---|---|
| AI / machine learning | Software that learns from examples instead of fixed rules |
| COCO-SSD | A pre-built object detector that finds and labels things in images |
| TensorFlow.js | Runs machine-learning models inside a web browser |
| Bounding box | Colored rectangle drawn around a detected object |
| Confidence score | How sure the AI is (0–100%) |
| Object detection | Finding what something is and where it is |
| Mobile-first | Designed for phones before desktops |
| Glassmorphism | UI style with frosted, semi-transparent panels |
| PWA | Progressive Web App — website that can install like an app |
| Transfer learning | Starting from an existing AI model and teaching it new pests |
| MIT License | Open 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.