Smart Vision for Smarter Livestock β Empowering Farmers with AI
NandiVision is an AI-driven system designed to classify Indian cow and buffalo breeds using deep learning. India's livestock diversity is vast, but identifying breeds manually is difficult and requires expert knowledge.
Key Components:
- Stage 1 Model: Species classification β EfficientNet-B0 (ONNX)
- Stage 2 Model: Breed identification β EfficientNet-B3 (ONNX)
- Frontend: Next.js with modern UI
- Backend: FastAPI with ONNX inference
- Authentication: Supabase with role-based dashboard
- Classify 08 cow breeds and 07 buffalo breeds accurately
- Build a two-stage inference pipeline to improve classification reliability
- Provide a modern, responsive, animated frontend UI
- Enable admin control panel for sending notifications
- Enable users to raise queries directly from dashboard
- Build a complete production-ready system using ONNX models for fast inference
- Deoni
- Rathi
- Red Sindhi
- Sahiwal
- Tharparkar
- Gir
- Hariana
- Kankrej
- Banni
- Jaffrabadi
- Mehsana
- Murrah
- Nagpuri
- Nili Ravi
- Toda
| Stage | Purpose | Model | Reason |
|---|---|---|---|
| Stage-1 | Cow vs Buffalo vs None | EfficientNet-B0 | Lightweight, fast, accurate for coarse classification |
| Stage-2 | Breed Prediction | EfficientNet-B3 | Higher depth β best for fine-grain features distinguishing breeds |
Note: Both models are optimized & exported to ONNX to reduce inference latency.
ββββββββββββββββββββββββββββββ
β User Browser β
β (Next.js Frontend UI) β
ββββββββββββββββ¬ββββββββββββββ
β
βΌ
HTTP Request (Image Upload)
β
βΌ
ββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β - Handles API routes β
β - Preprocess image β
β - Coordinates model inference β
ββββββββββββββββ¬ββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ONNX Inference Engine β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Stage 1 Model (EffNet-B0) β β
β β Determines: Cow / Buffalo / None β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Stage 2 Model (EffNet-B2) β β
β β Predicts Breed (if Cow/Buffalo) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
JSON Prediction Response
β
βΌ
Rendered on Next.js UI Dashboard
ββββββββββββββββββββββββββββββββββ
β Supabase DB β
β - Authentication β
β - Role-based Profiles β
β - Notifications β
β - User Queries β
ββββββββββββββββββββββββββββββββββ
| # | Title | Year | Link |
|---|---|---|---|
| 1 | Identification of Cattle Breed using CNN | 2021 | ResearchGate |
| 2 | Computer Vision-Based Detection of Dairy Cow Breed | 2022 | MDPI Electronics |
| 3 | Cattle Breed Classification Techniques | 2024 | Propulsion Tech Journal |
| 4 | Ensemble Learning for Cattle Breed Identification | 2023 | EAI |
| 5 | Animal Breed Classification using Deep Learning | 2021 | IJARSCT |
| 6 | Attention-based Transfer Learning | 2024 | PubMed |
- Transfer Learning significantly improves performance on limited datasets
- EfficientNet outperforms traditional CNN models
- Data augmentation is crucial for breed variability
- Real-world lighting/pose variance demands robust models (EffNet-B3 excels here)
Dataset Source: Indian Bovine Breeds - Kaggle
dataset/
βββ cows/
β βββ Banni/
β βββ Amritmahal/
β βββ ...
βββ buffaloes/
βββ Murrah/
βββ Surti/
βββ ...
- Rotate
- Flip
- Brightness/Contrast
- Zoom
- Crop
- CLAHE (Contrast Limited Adaptive Histogram Equalization)
- Email + Password login/signup
- Profiles table with role column (admin, user)
- Auto-redirect dashboard based on role
- β Send notifications (text, image, video, audio, links)
- β View all user queries
- β Respond to user queries
- β Receive notifications
- β Raise queries to admin
- β See AI classification history (optional future upgrade)
- Drag & Drop upload
- Live preview of image
- Animated transitions (Framer Motion)
- Modern blue-shaded theme
- Responsive layout for mobile, tablet, desktop
- Loading animation while inferencing
- Role-protected routes
- Real-time breed detection via camera (mobile/web)
- Disease classification model
- Farm management dashboard
- Offline mode via TF Lite
- Large-scale Indian cattle dataset creation
Mayank Kumar
AI/ML Engineer & Full-Stack Developer
- π§ Email: 02mayankk@gmail.com
- π GitHub: https://github.com/02mayankk
This project is licensed under the MIT License.
Last Updated: December 2025