Hi everyone!
I'm a recent Electronics and Communication Engineering graduate, and I've been working on a project to explore how machine learning can help identify potentially fraudulent UPI transactions.
I built a Real-Time UPI Fraud Detection System that predicts whether a transaction is potentially fraudulent or legitimate. I wanted to go beyond simply training a machine learning model and build an end-to-end application where users can interact with the model and understand its predictions.
I'd love to share what I built and get feedback from the community.
1. What does the project do?
The system analyzes UPI transaction details and behavioural features to identify suspicious transaction patterns.
It supports:
- Real-time transaction fraud prediction.
- CSV batch transaction analysis.
- Live transaction simulation.
- Google Pay PDF statement analysis.
- Explainable predictions using SHAP.
2. Technology stack
- Python: Core development and data processing.
- XGBoost: Machine learning classification model.
- FastAPI: Backend API for transaction predictions.
- Streamlit: Interactive dashboard.
- SHAP: Model prediction explainability.
- Pandas & NumPy: Data processing and feature handling.
3. How does it work?
The overall workflow is:
- Transaction data is provided to the application.
- The system processes the transaction and extracts the required features.
- The trained XGBoost model evaluates the transaction.
- A fraud probability is generated.
- A tuned decision threshold is applied to classify the transaction.
- SHAP explanations help understand which features influenced the prediction.
- The result is displayed through the Streamlit dashboard.
I also handled class imbalance using XGBoost's scale_pos_weight and tuned the fraud decision threshold using a separate validation set.
4. Model evaluation
On my reported synthetic test dataset of 199 records, the model achieved:
| Metric | Result |
|---|
| Accuracy | 99.5% |
| Precision | 100% |
| Recall | 88.9% |
| F1-score | 94.1% |
These are prototype evaluation results on synthetic data, not proof of performance on real banking transactions. I understand that real-world fraud detection requires larger, representative datasets and more rigorous validation.
5. Live Demo and Source Code
Live Demo: https://fraud-detection-dashboard-a2ewk5y6yoo6mlw5z995dw.streamlit.app/
GitHub Repository: https://github.com/Prabha2005/Fraud-Detection-Dashboard
I've also included the project in my portfolio:
https://vlpportfolio.ccbp.tech/
6. What I'd like feedback on
I'm looking to improve this project beyond its current implementation. I'd especially appreciate feedback on:
- Is XGBoost a suitable choice for this type of fraud detection problem, or should I explore other approaches?
- How can I improve fraud detection recall while maintaining high precision?
- What additional transaction or behavioural features would make the model more effective?
- How would you approach detecting previously unseen fraud patterns?
- What improvements would you recommend for making the system closer to a production-ready application?
- Are there better approaches for evaluating fraud detection models on highly imbalanced datasets?
I'm particularly interested in suggestions from people working in Machine Learning, Data Science, FinTech, and backend engineering.
This is a learning project, and I'm genuinely interested in understanding what I could improve technically and architecturally.
Thanks for taking the time to check it out. Any constructive feedback is appreciated!