Abstract
The Unified Payments Interface (UPI) has drastically changed how digital transactions are conducted in India. But along with this expansion comes a rise in fraudulent activity that takes advantage of holes in digital infrastructure. A machine learning-based fraud detection system designed specifically for UPI transactions is shown in this study. The system detects abnormal behavior with high accuracy by using Random Forest and K-Nearest Neighbors (KNN) algorithms on a carefully selected dataset of transactional information (Transaction ID, Timestamp, Amount, Sender/Receiver UPI IDs, and Status). To deal with dimensionality and class imbalance, methods like data resampling and Principal Component Analysis (PCA) are used. The system's ability to boost security in digital payment ecosystems is demonstrated by experimental results that show better fraud detection performance.
Introduction
The Unified Payments Interface (UPI) has revolutionized the Indian fintech landscape by enabling instant, interoperable, and seamless cashless transactions. However, this convenience has attracted malicious actors who exploit digital vulnerabilities through phishing, identity spoofing, and bot-driven attacks.
Traditional rule-based fraud detection systems are struggling to keep up. They are inherently reactive—relying on hardcoded rules based on known past behaviors—and frequently generate high false-positive rates, which frustrate users and waste administrative resources. Furthermore, fraud datasets are notoriously imbalanced, causing many standard models to become biased toward the majority class. This study aims to replace rigid rule-based systems with a dynamic, machine learning-driven approach tailored specifically for UPI transactions.
Methodology
The authors designed a supervised machine learning pipeline to classify transactions as either legitimate or fraudulent. The architecture involves data cleaning, feature standardization, and dimensionality reduction via Principal Component Analysis (PCA) to minimize noise and computational overhead.
The study evaluated two primary algorithms: K-Nearest Neighbors (KNN) and Random Forest (RF). Interestingly, the authors chose to maintain the natural distribution of the data rather than using synthetic oversampling (like SMOTE), relying instead on the inherent robustness of the Random Forest ensemble to handle outliers and class imbalance. The final model is integrated into a batch-processing framework designed for post-transaction audits and security assessments.
Dataset
The study utilized a custom dataset comprising 2,666 UPI transaction records. Features included Transaction ID, Timestamp, Sender and Receiver UPI IDs, Transaction Amount, User Age, Location information (State, Zip), and a binary label indicating fraud or authenticity. The dataset was split using a standard 80:20 ratio for training and testing.
Results and Discussion
Random Forest proved highly effective at capturing non-linear correlations in transaction frequency and timing. Its ensemble nature made it highly resistant to the overfitting that often plagues single decision trees or simpler distance-based algorithms like KNN.
Based on the confusion matrix for the test set, the Random Forest model successfully identified 292 fraudulent transactions (True Positives) while missing only 24 (False Negatives). It correctly identified 147 genuine transactions (True Negatives) with 71 false alarms (False Positives). While the model performed well, the test set distribution (316 fraud vs. 218 genuine) suggests the dataset used for evaluation may have been pre-filtered, as it does not reflect the extreme imbalance typically seen in real-world financial data.
Conclusion
This research demonstrates that machine learning models can significantly enhance the security of digital payment ecosystems. While the current system operates in a batch-processing environment, it provides a robust framework for identifying anomalous behavior. Future work will focus on deploying these models into real-time streaming pipelines and implementing continuous learning to adapt to evolving fraud tactics.
Summary updated