Logo Lanfrica

Ushakhero/fraudshield-ai

Domain:

digital infrastructure

Record type:

software
Creator:
Ush
Host:
AI-powered fraud detection system for African financial institutions β€” Cyber4Africa Programme # πŸ›‘οΈ FraudShield AI β€” MVP AI-powered fraud detection system for African financial institutions. Built for the **Cyber4Africa Programme** by the AI Hub for Sustainable Development. --- ## πŸš€ Quick Start (Local) ```bash # 1. Install dependencies pip install -r requirements.txt # 2. Train the model python train_model.py # 3. Run the app python app.py # 4. Open browser # localhost ``` --- ## ☁️ Deploy to Render.com (Free - 5 mins) 1. Push this folder to a GitHub repository 2. Go to render.com β†’ New β†’ Web Service 3. Connect your GitHub repo 4. Set these settings: - **Build Command:** `pip install -r requirements.txt && python train_model.py` - **Start Command:** `gunicorn app:app` 5. Click **Deploy** β€” you'll get a live URL! --- ## ☁️ Deploy to Railway.app (Free alternative) 1. Go to railway.app 2. New Project β†’ Deploy from GitHub 3. Add environment variable: `PORT=5000` 4. Done! --- ## πŸ”Œ API Endpoints ### Single Transaction Analysis ``` POST /api/analyze Content-Type: application/json { "amount": 25000, "hour": 14, "day_of_week": 2, "num_transactions_today": 3, "avg_transaction_amount": 18000, "account_age_days": 365, "failed_attempts": 0, "is_international": 0, "device_change": 0, "location_change": 0 } ``` ### Batch Analysis ``` POST /api/batch Content-Type: multipart/form-data file: transactions.csv ``` ### Demo Data ``` GET /api/demo ``` --- ## πŸ€– Model Details - **Algorithm:** Random Forest Classifier - **Features:** 10 transaction features - **Training Data:** 10,000 synthetic transactions (97% legitimate, 3% fraud) - **Accuracy:** 99.8% - **Fraud Recall:** 98% --- ## πŸ“ Project Structure ``` fraud-mvp/ β”œβ”€β”€ app.py # Flask web application β”œβ”€β”€ train_model.py # Model training script β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ start.sh # Startup script β”œβ”€β”€ model/ β”‚ β”œβ”€β”€ fraud_model.pkl # Trained model β”‚ β”œβ”€β”€ scaler.pkl # Data scaler β”‚ β”œβ”€β”€ features.pkl # Feature list β”‚ └── sam …