An end-to-end machine learning system that detects fraudulent transactions using classification models, real-time prediction, analytics dashboard, and explainable AI.
This project demonstrates a production-style AI pipeline including preprocessing, model training, evaluation, feature importance, and batch prediction.
- ✅ Real-time fraud prediction
- ✅ Fraud probability scoring
- ✅ Risk classification (Low / Medium / High)
- ✅ Batch fraud detection (CSV upload)
- ✅ Fraud analytics dashboard
- ✅ Feature importance visualization
- ✅ Model performance metrics
- ✅ Confusion matrix
- ✅ ROC curve
- ✅ Downloadable prediction results
- ✅ Explainable AI system
Dataset → Preprocessing → Train Model → Save Model ↓ Prediction Engine ↓ Streamlit Dashboard
- Scikit-learn
- Random Forest Classifier
- Feature Importance
- Model Evaluation Metrics
- Pandas
- NumPy
- StandardScaler
- OneHotEncoder
- Matplotlib
- Streamlit Charts
- Analytics Dashboard
- Streamlit
fraud-detection-ai
│
├── app.py
├── train_model.py
├── preprocess.py
├── utils.py
├── requirements.txt
├── README.md
├── .gitignore
│
├── data/
│ └── fraud_data.csv
│
├── models/
│ ├── fraud_model.pkl
│ ├── feature_importance.pkl
│ └── model_metrics.pkl
git clone https://github.com/imalkaperera13/fraud-detection-ai.git
cd fraud-detection-ai
pip install -r requirements.txt
python train_model.py
streamlit run app.py
The system evaluates the model using:
- Accuracy
- Precision
- Recall
- F1 Score
- Confusion Matrix
- ROC Curve
Input:
Transaction Amount: 5000 Time: 02:00 AM Location: NewYork Device: Laptop
Output:
Fraud Probability: 0.92 Risk Level: HIGH Prediction: Fraud
- Fraud distribution chart
- Risk level analytics
- Transaction history
- Probability histogram
- Batch fraud detection results
- Banking fraud detection
- Credit card fraud detection
- Payment gateway monitoring
- E-commerce fraud detection
- Telecom fraud detection
- Insurance fraud detection
- Load dataset
- Data preprocessing
- Feature encoding
- Model training
- Model evaluation
- Feature importance extraction
- Save trained model
- Real-time prediction
- Dashboard analytics
This project demonstrates:
- End-to-end AI system design
- Machine learning pipeline
- Explainable AI
- Model evaluation
- Dashboard development
- Real-time prediction
- Industry-level fraud detection
- XGBoost model integration
- Deep learning fraud detection
- Real-time API deployment
- Database integration
- User authentication
- Cloud deployment (AWS / Streamlit Cloud)
Imalka Perera
AI Engineer | DevOps | Machine Learning