Skip to content

Ghan07/BovisionAI

Repository files navigation

Bovision AI - पशु दृष्टि बुद्धिः [ Animal Vision Intelligence ]

AI-powered system for morphometric measurement and ATC scoring of cattle and buffaloes from side-view images.

Features

  • 🐄 AI-based breed classification for cattle and buffaloes
  • 📏 Automated morphometric measurements (body length, heart girth, height, hip width)
  • 📊 ATC scoring and body condition assessment
  • 📈 Dashboard with analytics and charts
  • 🔐 JWT authentication
  • 🌙 Dark/light mode
  • 📱 Responsive design

Tech Stack

  • Frontend: React 18, Vite, TailwindCSS, Recharts, Framer Motion, Zustand
  • Backend: Node.js, Express, MongoDB, Mongoose, JWT
  • Tools: Multer (uploads), bcryptjs, helmet, CORS

Setup

Prerequisites

  • Node.js 18+
  • MongoDB running locally or a MongoDB Atlas URI

Installation

# Install all dependencies
npm run install:all

# Copy and configure environment
cp server/.env.example server/.env
# Edit server/.env with your MongoDB URI and JWT secret

# Seed sample data
npm run seed

# Start development (both client and server)
npm run dev

Demo Account

After seeding: demo@example.com / password123

API Endpoints

Method Endpoint Description
POST /api/auth/register Register user
POST /api/auth/login Login
GET /api/auth/me Get current user
PUT /api/auth/profile Update profile
PUT /api/auth/password Change password
GET /api/classifications List classifications
POST /api/classifications Create classification (multipart)
GET /api/classifications/:id Get single classification
DELETE /api/classifications/:id Delete classification
GET /api/classifications/dashboard Dashboard stats

ML Engine

The classification engine uses Google Gemini Vision API (free tier) as the primary AI backend:

Engine Purpose Cost
Gemini 2.0 Flash (primary) Species, breed, BCS, measurements, ATC — all in one vision call Free (1500 req/day)
Local Python ML service (optional fallback) CLIP + Keras + OpenCV pipeline Self-hosted

Supported Breeds

  • Cattle (10): Holstein Friesian, Jersey, Angus, Hereford, Brahman, Sahiwal, Gir, Red Sindhi, Tharparkar, Ongole
  • Buffalo (10): Murrah, Nili-Ravi, Surti, Mehsana, Jaffarabadi, Bhadawari, Nagpuri, Pandharpuri, Toda, Marathwadi

Fallback Chain

Gemini Vision API → Local ML Service (if configured) → Random fallback

Deployment

Architecture

Vercel (Frontend) → Render (Node API) → Gemini Vision API (free)

No separate ML service to deploy — the Node backend calls Google Gemini directly.

1. Get a free Gemini API key

Go to aistudio.google.com/apikey and create a key (free, instant).

2. Node Backend → Render

Set these environment variables on Render:

MONGODB_URI=<your-mongodb-atlas-uri>
JWT_SECRET=<your-secret>
CLIENT_URL=https://bovisionai.vercel.app
GEMINI_API_KEY=<your-free-gemini-key>
CLOUDINARY_CLOUD_NAME=<your-cloudinary>
CLOUDINARY_API_KEY=<your-key>
CLOUDINARY_API_SECRET=<your-secret>

3. Frontend → Vercel (already deployed)

Update VITE_API_URL in Vercel env vars to point to your Render backend URL.

Project Structure

├── server/              # Express API
│   ├── config/          # DB & app config
│   ├── controllers/     # Route handlers
│   ├── middleware/       # Auth, upload, errors
│   ├── models/          # Mongoose schemas
│   ├── routes/          # API routes
│   ├── services/        # Classification engine (Gemini + ML fallback)
│   ├── ml-service/      # Python ML microservice (optional fallback)
│   │   ├── predict_service.py   # CLIP + Keras + OpenCV pipeline
│   │   ├── bovision_ai_classifier.h5  # Trained species model
│   │   ├── Dockerfile           # For Docker deploy
│   │   └── requirements.txt     # Python dependencies
│   └── seed.js          # Sample data seeder
├── client/              # React SPA
│   └── src/
│       ├── components/  # UI components
│       ├── pages/       # Route pages
│       ├── stores/      # Zustand stores
│       ├── services/    # API client
│       └── hooks/       # Custom hooks
└── README.md

About

A Web App designed and works for Cattle & Breed recognition using Computer Vision.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors