Skip to content

mmoneka11/SmartFarm-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmartFarm AI

AI-Powered Global Agriculture Pocket Assistant 🌍


🌍 Overview

SmartFarm AI is a global AI-powered agriculture pocket assistant that analyzes crop diseases and seed quality from images and delivers actionable insights with voice support using Gemini multimodal AI.

It is designed to help farmers, researchers, and agri-tech innovators make faster and smarter decisionsβ€”anywhere in the world.

πŸš€ Features

🌿 Crop Disease Analysis

  • Upload a crop leaf image
  • Identify crop type and possible disease
  • Confidence score (0–1)
  • Clear disease description
  • Treatment & pesticide recommendations
  • Farmer-friendly guidance

🌾 Seed Quality Analysis

  • Upload seed images
  • Detect seed quality (High / Medium / Low)
  • Visual observations (damage, color, defects)
  • Sowing recommendations
  • Confidence-based assessment

πŸ”Š Voice Assistance

  • AI-generated guidance converted into audio
  • Hands-free and field-friendly usage
  • Supports multilingual expansion

🎨 Modern UI

  • Built with Streamlit
  • Light & Dark theme support
  • Clean, professional SmartFarm branding
  • Image preview and audio playback

🧠 Gemini AI Integration

SmartFarm AI uses Gemini 3 Vision (gemini-3-flash-preview) as its core intelligence.

Gemini is used to:

  • Analyze images (crop leaves & seeds)
  • Reason about diseases and quality
  • Generate structured JSON responses
  • Produce farmer-friendly advice text
  • Enable downstream voice generation

⚠️ No heuristic or rule-based logic is used β€” all insights come directly from Gemini.


βš™οΈ Architecture Diagram

flowchart TD
    A[**User**<br/>Browser / Mobile] --> B[**Streamlit UI**<br/>SmartFarm AI Dashboard]

    B -->|Upload Image + Optional Data| C[**FastAPI Backend**]

    C --> D[**Image Validation**<br/>Format β€’ Size β€’ Quality]
    D --> E[**Image Preprocessing**<br/>Resize β€’ Normalize β€’ Enhance]

    E --> F[**Gemini AI Client**<br/>Vision + Reasoning]
    F --> G[**Crop / Seed Analysis**<br/>Disease β€’ Growth β€’ Recommendations]

    G --> H[**JSON Structured Response**<br/>Confidence β€’ Insights β€’ Actions]

    H --> I[**Text Response**<br/>Farmer-Friendly Explanation]
    H --> J[**Voice Generation**<br/>gTTS / Audio Service]

    I --> K[**Final API Response / UI Output**<br/>Text + Confidence + Audio]
    J --> K

    K --> L[**Farmer Decision Support**<br/>Smart Farming Insights ]
Loading

πŸ—οΈ Tech Stack

Backend

  • Python
  • FastAPI
  • Google Gemini 3 API
  • Pillow (Image Processing)
  • gTTS (Text-to-Speech)
  • python-dotenv

Frontend

  • Streamlit
  • Custom CSS
  • Light / Dark Mode
  • REST API Integration

πŸ“ Project Structure

smartfarm-ai/
β”‚
β”œβ”€β”€ backend/
β”‚   └── app/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ api/
β”‚       β”‚   β”œβ”€β”€ __init__.py
β”‚       β”‚   β”œβ”€β”€ routes.py
β”‚       β”‚   └── schemas.py
β”‚       β”‚
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   β”œβ”€β”€ __init__.py
β”‚       β”‚   β”œβ”€β”€ gemini_client.py
β”‚       β”‚   β”œβ”€β”€ image_processing.py
β”‚       β”‚   └── voice_service.py
β”‚       β”‚
β”‚       └── test-data/
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── streamlit_app.py
β”‚
│── assets/
β”‚   │── banner.png
β”‚   │── team_logo.png
β”‚   └── smartfarm_logo.png
|
β”œβ”€β”€ .env
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
└── run_all.py

πŸ‘₯ Team

Name Role & Contribution GitHub
Moneka Meghwar Team Lead, Frontend Developer https://github.com/mmoneka11
Kashmala Saddiqui Backend Developer, API Integration https://github.com/kashmalaasif
Umaima Rizwan Documentation Lead, Development Support https://github.com/umaim691

πŸ” Security Notes

  • .env is ignored via .gitignore
  • API keys are never exposed

πŸ“Œ Future Enhancements

  • Mobile App (Flutter)
  • Multi-language farmer support
  • Offline AI inference
  • Crop advisory dashboard

πŸ™ Acknowledgements

Hackathon

We would like to thank the Google Gemini 3 Hackathon hosted on Devpost for providing the platform and opportunity to build and showcase SmartFarm AI. The hackathon inspired us to explore the capabilities of Gemini 3 multimodal AI for solving real-world agricultural challenges and advancing sustainable farming practices worldwide.

Gemini 3 Hackathon (Devpost)

We are grateful for the opportunity to collaborate, learn, and contribute β€” and for the encouragement to build practical, impact-driven AI for farmers everywhere. 🌱🌍

Community & Open-source Tools

Our sincere thanks to the communities and projects that made this work possible:

These communities, tools, and events inspired and enabled the development of SmartFarm AI, helping us bring practical AI solutions to agriculture worldwide


🀝 Contributing

We welcome contributions! Please open issues or pull requests.

⭐ Support this project: If you find this project useful, please star the repo! GitHub stars


πŸ“œ License

This project is for educational, research, and demonstration purposes | MIT License


🌾 Developed with ❀️ by the IGOGs Team
Building AI for Sustainable Agriculture ✨

About

SmartFarm-AI is an AI-powered smart farming platform that acts as a pocket assistant for farmers, using computer vision to assist with crop monitoring and better farming practices.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages