AI-powered real-time wildlife detection and risk assessment for agricultural stakeholders.
Built with React + Flask + TensorFlow | Full-stack ML + Web Engineering
- Full-Stack Engineering: React frontend, Flask backend, TensorFlow ML pipeline, SQLite persistence
- ML + Product: Beyond accuracy metrics—end-to-end system design for real-world decision-making
- UI/UX Intentionality: Design system, component library, dark theme, responsive design
- Production Thinking: Error handling, CORS, file validation, API design, database schema
- Problem-Solving: Rule-based risk engine fuses model confidence with contextual logic
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python api.pyBackend runs on http://localhost:5000
cd frontend
npm install
npm run devFrontend runs on http://localhost:5173
- Sample prediction:
curl http://localhost:5000/predict?sample=true - Upload image:
curl -F "file=@image.jpg" http://localhost:5000/predict - View history:
curl http://localhost:5000/recent
┌─────────────────────────────────────────────────────┐
│ React Frontend (Vite) │
│ ┌────────────────────────────────────────────────┐ │
│ │ Hero | Command Center | Timeline | Insights │ │
│ │ Component Library: Atoms, Molecules, Organisms │ │
│ └────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
↕ (REST API)
┌─────────────────────────────────────────────────────┐
│ Flask API (http://localhost:5000) │
│ /predict (POST/GET), /recent, /sample │
└─────────────────────────────────────────────────────┘
↕ (Model Inference) ↕ (Persistence)
┌──────────────┐ ┌──────────────┐
│ TensorFlow │ │ SQLite DB │
│ Classifier │ │ Detection │
│ (18 classes) │ │ History │
└──────────────┘ └──────────────┘
- Training Data: 18 animal classes (Tigers, Leopards, Elephants, Crocodiles, etc.)
- Architecture: TensorFlow/Keras CNN
- Input: 96×96px RGB images
- Output: Top-3 class predictions with confidence scores
Not all predictions are equal. The system fuses three signals:
-
Model Confidence (0–1.0)
- High confidence (≥0.95) → escalate crop/livestock risk
- Low confidence (<0.6) → de-escalate human risk
-
Historical Sightings (0+)
- 3+ recent detections → increase human/crop urgency
- Informs trend analysis and alert thresholds
-
Contextual Rules (Optional)
- Example: Crocodile near water → elevated human/livestock risk
- Extensible for site-specific logic
Output: Risk scores (low/moderate/high/very_high) + actionable recommendations
Color Palette (Dark, premium)
- Primary background:
#0B1020 - Text:
#E6EEF8(primary),#9AA7BF(muted) - Accent:
#7C3AED(purple) - Risk levels: Green (low) → Orange (medium) → Red (high)
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, CSS (design tokens) |
| Backend | Flask, Python 3.9+ |
| ML | TensorFlow/Keras |
| Database | SQLite |
| Method | Endpoint | Description |
|---|---|---|
| POST | /predict |
Upload image file for classification |
| GET | /predict?sample=true |
Get random sample prediction |
| GET | /predict?sample=Species |
Get prediction for specific species |
| GET | /recent |
Fetch recent detection history |
| Decision | Why |
|---|---|
| 96×96px input | Fast inference, pragmatic for mobile capture |
| Rule-based risk | Interpretability + control for safety-critical domain |
| SQLite | Simplicity + portability for MVP |
| React | Industry standard + hire-ability |
| Component system | Scalability + maintainability |
- Full portfolio breakdown: See PORTFOLIO_PACKAGE.md
- Recruiter demo script: In PORTFOLIO_PACKAGE.md (Section 3)
- Architecture deep-dive: In PORTFOLIO_PACKAGE.md (Section 4)
- Deployment guide: In PORTFOLIO_PACKAGE.md (Section 10)
docker build -t wildguard .
docker run -p 5000:5000 wildguardheroku create wildguard-ai
git push heroku mainConnect GitHub repo → Deploy
- Live camera feed integration (WebRTC)
- Multi-model ensemble (confidence boost)
- Geographic heat maps
- Push notifications for alerts
- Admin dashboard with audit logs
- Model retraining pipeline
MIT — Use freely for learning and portfolio purposes.