- Titweng: Cattle Identification Framework for Mitigating Raiding and Enhancing Market Trust in South Sudan
- Biometric nose print recognition system that prevents cattle theft, resolves ownership disputes, and builds trust in livestock markets through secure digital identification.
South Sudan's livestock sector faces endemic cattle raiding and ownership disputes due to the absence of reliable cattle identification systems. Traditional methods and oral testimony create verification failures, allowing stolen cattle to enter markets with impunity and perpetuating cycles of conflict and economic loss.
Titweng is a comprehensive digital cattle identification framework designed to mitigate raiding and enhance market trust in South Sudan. By leveraging biometric nose print recognition - as unique as human fingerprints - the system creates tamper-proof digital identities for cattle, enabling secure ownership verification and building confidence in livestock markets. This framework transforms cattle from untraceable assets into digitally verified commodities, making theft unprofitable and disputes resolvable through objective evidence.
- Biometric Registration: Capture and register cattle nose prints with 93.4% accuracy
- Real-time Verification: Instant cattle identification in under 3 seconds
- Cross-platform Access: Mobile app (Android/iOS) and web dashboard
- Digital Certificates: QR-coded ownership certificates with PDF generation
- Secure Database: PostgreSQL with vector embeddings for scalable matching
- Automated Notifications: Email/SMS alerts for registrations and transfers
- Analytics Dashboard: Real-time monitoring and reporting for administrators
- Admin Dashboard: https://www.titweng.com
- Mobile APK: Download Android App
- Mobile App: Flutter 3.0+ (Android/iOS)
- Admin Dashboard: React 18 + TypeScript
- Backend API: FastAPI + Python 3.8+
- Database: PostgreSQL + pgvector
- ML Models: YOLOv8 + Siamese CNN
- Deployment: Netlify + Azure
- Python 3.8+, Node.js 16+, Flutter 3.0+, PostgreSQL 12+
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Environment variables (.env file)
DATABASE_URL=postgresql://user:password@localhost:5432/titweng
ADMIN_USERNAME=admin
ADMIN_PASSWORD=secure_password
BREVO_API_KEY=your-brevo-key
# Start server
uvicorn main:app --reload --host 0.0.0.0 --port 8000cd admin_dashboard
npm install
npm run dev # Development
npm run build # Productioncd mobile_app
flutter pub get
flutter run # Development
flutter build apk --release # Production APKCREATE DATABASE titweng;
CREATE EXTENSION IF NOT EXISTS vector;| Test Case | Input Data | Expected Result | Actual Result | Status |
|---|---|---|---|---|
| Valid Registration | 3-5 nose images, owner details | Success + Certificate | Success + PDF generated | PASS |
| Invalid Images | Blurry/dark images | Error message | "Image quality too low" | PASS |
| Duplicate Registration | Same cow twice | Duplicate detection | "Similar cow found (85% match)" | PASS |
| Test Case | Concurrent Users | Response Time (avg) | Success Rate | CPU Usage | Memory Usage | Status |
|---|---|---|---|---|---|---|
| Light Load | 10 users | 1.2s | 100% | 45% | 2.1GB | PASS |
| Medium Load | 50 users | 2.8s | 98% | 78% | 3.4GB | PASS |
| Heavy Load | 100 users | 4.5s | 95% | 92% | 4.8GB | PASS |
| Stress Test | 150 users | 7.2s | 89% | 98% | 6.1GB | DEGRADED |
| Peak Load | 200 users | 12.1s | 76% | 100% | 7.8GB | FAIL |
| Test Case | Device Specification | Registration Time | Verification Time | App Launch Time | Status |
|---|---|---|---|---|---|
| Premium Device | iPhone 14 Pro (8GB RAM, A16) | 3.2s | 1.8s | 2.1s | PASS |
| High-end Android | Samsung S23 (8GB RAM, Snapdragon 8) | 3.5s | 2.0s | 2.4s | PASS |
| Mid-range Device | Samsung A54 (6GB RAM, Exynos 1380) | 5.1s | 2.9s | 3.4s | PASS |
| Budget Device | Redmi Note 11 (4GB RAM, Snapdragon 680) | 6.8s | 3.7s | 4.2s | PASS |
| Low-end Device | Android Go (2GB RAM, Unisoc Tiger) | 8.7s | 4.2s | 5.8s | SLOW |
| Test Case | Data Variation | Sample Size | True Positive Rate | False Positive Rate | F1-Score | Status |
|---|---|---|---|---|---|---|
| Optimal Lighting | Bright daylight conditions | 500 images | 94.2% | 2.1% | 0.96 | PASS |
| Low Light | Indoor/evening conditions | 300 images | 89.7% | 4.3% | 0.92 | PASS |
| Variable Angles | Front, side, angled shots | 300 images | 91.8% | 3.4% | 0.94 | PASS |
| High Quality | 4K camera, clear images | 400 images | 96.1% | 1.8% | 0.97 | PASS |
| Compressed Images | Low resolution, compressed | 400 images | 89.5% | 4.2% | 0.92 | PASS |
| Young Cattle | Calves under 1 year | 200 images | 87.3% | 5.1% | 0.91 | PASS |
| Mature Cattle | Adult cattle over 3 years | 200 images | 92.8% | 2.9% | 0.95 | PASS |
Cross-Validation Results: 93.4% ± 0.5% average accuracy across 5 folds
-
Biometric Identification System
- Implemented YOLOv8 for nose detection with 94.2% accuracy
- Developed Siamese CNN for embedding generation
- Achieved 93.4% average identification accuracy
-
Multi-platform Application
- Flutter mobile app supporting Android/iOS
- React web dashboard for administrators
- RESTful API backend with comprehensive endpoints
-
Real-time Processing
- Average verification time: 2.1s on mid-range devices
- Concurrent user support up to 100 users
- Real-time database updates and notifications
- Offline Functionality
- Mobile app supports offline image capture
- Limited offline verification capability
- Gap: Full offline processing requires optimization
- Blockchain Integration
- Reason: Technical complexity exceeded project timeline
- Impact: Reduced decentralization features
- Mitigation: Implemented robust database logging instead
- Accuracy: 93.4% average identification accuracy exceeds industry standards (85-90%)
- Speed: Sub-3-second verification meets real-time requirements
- Scalability: Successfully handles 100 concurrent users
- Reliability: 98% uptime during testing period
# Install Azure CLI and login
az login
az webapp create --resource-group titweng-rg --plan titweng-plan --name titweng-app
az webapp config appsettings set --name titweng-app --resource-group titweng-rg --settings DATABASE_URL=postgresql://...
az webapp deployment source config-zip --name titweng-app --resource-group titweng-rg --src backend.zipcd admin_dashboard
npm run build
# Deploy to Netlify via drag-and-drop or CLI
# Set environment variables in Netlify dashboard:
# VITE_API_URL=https://titweng-app-a3hufygwcphxhkc2.canadacentral-01.azurewebsites.net-- Create database with pgvector
CREATE EXTENSION IF NOT EXISTS vector;
-- Tables created automatically on first run
CREATE INDEX ON embeddings USING ivfflat (embedding vector_cosine_ops);flutter build apk --release --split-per-abi
# Upload to Play Store Console or distribute via GitHub Releases- Health Check:
GET /healthendpoint for system status - Performance Benchmarks: API response time < 2s, uptime > 99%
- Monitoring: Error tracking and uptime monitoring configured
- Backup Strategy: Daily automated database backups
- Project Lead: Geu Aguto Titweng
- Email: g.bior@alustudent.com
- GitHub: @Geu-Pro2023
