Smart Breed & Body Trait Detection for Indigenous Cattle
Pashudhan AI is a comprehensive solution designed to revolutionize livestock management in India. By combining Computer Vision and Generative AI, it accurately identifies indigenous cattle breeds and provides detailed, actionable insights about their traits, health, and productivity in both English and Hindi.
India is home to a vast diversity of indigenous cattle breeds, each with unique characteristics. However, accurate identification often requires expert knowledge, which isn't always accessible to farmers.
Pashudhan AI bridges this gap by:
- Identifying the breed from an image using a fine-tuned EfficientNetB0 CNN.
- Retrieving verified breed traits from a curated dataset.
- Generating a farmer-friendly description using Google's Gemini LLM.
This tool empowers farmers, veterinarians, and researchers with instant, accurate information to improve breeding, healthcare, and productivity.
- 📸 Automated Breed Classification: Identifies 39+ Indian cattle breeds with ~91% accuracy.
- 🧠 Generative Insights: Uses Google Gemini to explain breed traits, origin, and utility in simple language.
- 🗣️ Multilingual Support: Provides output in English and Hindi for wider accessibility.
- 📊 Structured Knowledge Base: Backed by a custom "Hamara Dataset" of breed-specific physical and biological traits.
- 💻 User-Friendly Interface: Built with Streamlit for easy image upload, webcam capture, and interactive Q&A.
- 💬 AI Chatbot: Ask open-ended questions about cattle management and get AI-driven answers grounded in verified data.
- Frontend: Streamlit
- Deep Learning: TensorFlow, Keras (EfficientNetB0)
- Generative AI: Google Gemini API
- Computer Vision: OpenCV, Pillow
- Data Processing: Pandas, NumPy
The model is trained on a robust combination of data:
- Image Dataset: Based on the Indian Bovine Breeds dataset, augmented (rotation, zoom, brightness) to balance class distribution across 39 breeds.
- Trait Dataset: A custom-curated dataset containing detailed attributes for each breed:
- Origin & Region
- Physical Characteristics (Horn, Color, Size)
- Milk Yield & Productivity
- Behavioral Traits
We fine-tuned an EfficientNetB0 architecture, achieving state-of-the-art results:
| Metric | Score |
|---|---|
| Test Accuracy | 91.28% |
| Macro F1-Score | 0.91 |
| Validation Loss | 0.84 |
- High Precision: Breeds like Kangayam, Dangi, and Guernsey achieved near 100% classification accuracy.
- Robustness: The model generalizes well, with validation accuracy consistently tracking training progress.
-
Clone the repository
git clone https://github.com/DJ-InfinityCoder/PashudhanAI.git cd PashudhanAI -
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up API Keys Create a
.envfile in the root directory:GOOGLE_API_KEY=your_gemini_api_key
Run the Streamlit application:
streamlit run main.py- Upload an image or use the Camera.
- View the Predicted Breed and confidence score.
- Read the AI-Generated Report in English or Hindi.
- Use the Chat feature to ask specific questions about the breed.
- Offline Inference: Deploying quantized models on mobile devices for use without internet.
- Health Detection: Extending the model to detect common skin diseases (e.g., Lumpy Skin Disease).
- Expanded Dataset: Including more rare breeds and varied environmental conditions.
- Jogi et al. (2024). "Cattle Breed Classification Techniques".
- Indian Bovine Breeds Dataset
- Google Gemini API Documentation
Made with ❤️ for Indian Farmers 🇮🇳