Livestock farming is a major source of food and income in Niger, but diseases often kill animals before farmers can access veterinary care. Our AI-powered system helps farmers detect livestock diseases early using images, enabling faster treatment, reducing animal deaths, minimizing financial losses, and improving rural livelihoods.
# AI Livestock Disease Detection System
An AI-powered mobile app that helps farmers in Niger detect livestock diseases
early by photographing a sick animal and getting an instant, AI-generated diagnosis with a confidence score and next-step recommendation.
Link to app:
livestock-disease-detection…
Overview
- Problem: Livestock diseases are often caught too late because
veterinary services are far away, causing farmers to lose animals and income.
- Solution: A farmer photographs their animal in the app. The photo is
first checked to confirm it's actually an animal, then a CNN
(Convolutional Neural Network) classifies it into a known disease and
gives a confidence score and recommendation. A veterinarian can later
review and confirm or correct any AI diagnosis.
Architecture
```
React Native App (Expo)
│
├──► Supabase (Auth, Postgres database, image storage...)
│
└──► FastAPI service (runs ONLY the CNN models, /api/predict)
│
├─ 1. Animal-detection gate (pretrained ImageNet MobileNetV2)
└─ 2. Disease classifier (custom-trained MobileNetV2 head)
```
Authentication, user profiles, farms, animals, and the disease/prediction
records all live in Supabase. The Python/FastAPI backend does nothing except
receive an image and an auth token, verify the token, run the two-stage
model pipeline, and return a prediction, it never stores anything
permanently (the app writes the result to Supabase itself).
Tech Stack
| Layer | Technology | Role |
|---|---|---|
| Mobile app | React Native + Expo | Camera/gallery capture, UI, navigation |
| Navigation | React Navigation (stack + bottom tabs) | Screen routing |
| Backend-as-a-Service | Supabase (Auth, Postgres, Storage) | Users, data, images |
| AI inference service | FastAPI + Uvicorn (Python) | Exposes `/api/predict` |
| AI framework | TensorFlow / Keras | Builds and runs the CNNs |
| AI model | MobileNetV2 (transfer learning) | Disease classification |
| AI safeguard | MobileNetV2 (pretrained …