UPI fraud has become a major challenge due to the rapid growth of digital payments. Fraudulent activities such as fake payment requests, phishing, identity theft, and unauthorized transactions can cause significant financial losses to users and banks. Therefore, detecting fraud at an early stage is important to ensure secure online transactions. This project develops a UPI Fraud Detection System using the Random Forest machine learning algorithm. The system is trained using a dataset that contains different transaction details such as transaction amount, transaction time, payment method, location, device information, and transaction history. The Random Forest algorithm is chosen because it provides high accuracy, handles large datasets effectively, and reduces the chances of incorrect predictions. The model analyses transaction patterns and classifies each transaction as either genuine or fraudulent. Its performance is evaluated using standard metrics such as accuracy, precision, recall, and F1-score. The results show that the Random Forest algorithm performs better than many traditional machine learning algorithms in detecting fraudulent transactions. The proposed system helps banks and digital payment platforms identify suspicious transactions quickly, reducing financial losses and improving user security. In the future, the system can be enhanced by integrating real-time transaction monitoring, user behaviour analysis, and advanced AI techniques to improve fraud detection accuracy and provide a safer digital payment experience.
Introduction
This project presents a machine learning-based UPI fraud detection system that uses the Random Forest classifier to identify fraudulent digital payment transactions. As UPI adoption grows, frauds such as phishing, identity theft, fake payment requests, and unauthorized transactions have increased, making accurate and real-time fraud detection essential. Unlike traditional rule-based systems, the proposed approach learns transaction patterns from historical data to detect both existing and evolving fraud techniques while reducing false alarms.
The system preprocesses UPI transaction data by handling missing values, removing duplicates, encoding categorical features, and selecting the most relevant attributes. Exploratory Data Analysis (EDA) is performed to understand fraud patterns, class imbalance, and feature importance. The Random Forest model is then trained on the processed data and evaluated using standard metrics including accuracy, precision, recall, F1-score, ROC-AUC, and confusion matrix.
A Streamlit-based web application enables users to enter transaction details and receive real-time predictions indicating whether a transaction is legitimate or fraudulent. The system architecture includes modules for data preprocessing, feature selection, model training, prediction, and user interaction. Compared with traditional fraud detection methods, the proposed model offers higher accuracy, better handling of large datasets, lower false positive rates, scalability, and improved computational efficiency, making it suitable for practical deployment in digital payment security.
Conclusion
The rapid growth of Unified Payments Interface (UPI) has significantly improved the convenience and accessibility of digital payments. However, the increasing number of online transactions has also led to a rise in fraudulent activities, creating a need for intelligent and reliable fraud detection systems. Traditional rule-based approaches often struggle to detect evolving fraud patterns, highlighting the importance of machine learningbased solutions.
In this research, a Random Forest-based UPI Fraud Detection System was developed to accurately classify transactions as legitimate or fraudulent. The proposed methodology included data preprocessing, feature selection, model training, performance evaluation, and real-time prediction using a Streamlit web application. The Random Forest algorithm was selected due to its robustness, ability to handle large datasets, and high classification accuracy.
The experimental results demonstrate that the proposed model effectively detects fraudulent transactions while maintaining a low rate of false positives and false negatives. The evaluation metrics indicate that the Random Forest classifier provides reliable performance, making it suitable for practical fraud detection applications. Furthermore, the integration of a user-friendly Streamlit interface enables real-time prediction, enhancing the usability of the system for demonstration and future deployment.
Overall, the proposed system offers an efficient, scalable, and accurate solution for detecting UPI fraud. It contributes to improving the security and reliability of digital payment systems by helping financial institutions identify suspicious transactions more effectively. The findings of this research demonstrate the potential of machine learning techniques in addressing financial fraud and support the continued adoption of AI-driven security solutions in digital banking.
References
[1] Breiman, L. (2001). Random Forests. Machine Learning, 45(1), 5–
32. https://link.springer.com/article/10.1023/A:1010933404324
[2] Géron, A. (2022). Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow (3rd ed.).
O\'Reilly Media. https://www.oreilly.com/library/view/hands-on-machine-learning/
[3] Goodfellow, I., Bengio, Y., & Courville, A. (2016). Deep Learning. MIT Press. https://www.deeplearningbook.org
[4] Bishop, C. M. (2006). Pattern Recognition and Machine Learning. Springer. https://link.springer.com/book/10.1007/978-0-387-45528-0
[5] Mitchell, T. M. (1997). Machine Learning. McGraw-Hill Education. https://www.cs.cmu.edu/~tom/mlbook.html
[6] Pedregosa, F., Varoquaux, G., Gramfort, A., et al. (2011). Scikit-Learn: Machine Learning in Python.
Journal of Machine Learning Research, 12, 2825–2830. https://scikit-learn.org
[7] McKinney, W. (2024). Pandas Documentation. https://pandas.pydata.org/docs/
[8] Harris, C. R., et al. (2024). NumPy Documentation. https://numpy.org/doc/
[9] Python Software Foundation. (2024). Python Documentation. https://docs.python.org/3/
[10] Streamlit Inc. (2024). Streamlit Documentation. https://docs.streamlit.io/
[11] National Payments Corporation of India (NPCI). (2024). Unified Payments Interface (UPI) Product Overview. https://www.npci.org.in/what-we-do/upi/product-overview
[12] Brownlee, J. (2019). Machine Learning Algorithms for Classification. Machine Learning Mastery.
https://machinelearningmastery.com
[13] Chollet, F. (2021). Deep Learning with Python (2nd ed.). Manning Publications. https://www.manning.com/books/deep-learning-with-python-second-edition
[14] IEEE Xplore Digital Library. (2024). Research Papers on Financial Fraud Detection Using Machine Learning. https://ieeexplore.ieee.org
[15] Springer Nature. (2024). Research Publications on Artificial Intelligence, Machine Learning, and Financial Fraud Detection. https://link.springer.com