UPI_FRAUD_DETECTION
Research Article • Article ID: IJREK-2026-00178
Abstract
UPI now carries a very large share of retail payments in India, and payment scams have grown alongside it: fake collect requests, impersonation calls and takeover of accounts are all common. Fixed rules catch the obvious cases but are slow to change when fraudsters change tactics. This paper describes a small, reproducible Python prototype that labels a UPI transaction as legitimate or fraudulent from behavioural signals such as the amount compared with the user’s usual spending, the hour of the day, the age of the payee and whether the device has changed. Real UPI records are not public, so a synthetic set of 20,000 transactions (5.04% labelled fraud) was generated to follow documented scam patterns. A logistic regression baseline and a random forest were trained with class weighting and tested on a stratified hold-out set. The random forest reached a ROCAUC of 0.887, a fraud precision of 0.985 and a recall of 0.758 (F1 = 0.857), and a five-fold cross-validated ROC-AUC of 0.907. We also show how moving the decision threshold trades precision for recall. The numbers show that the pipeline works; they do not predict accuracy on real traffic, and the limits of synthetic data are discussed.
Keywords
I. INTRODUCTION
The Unified Payments Interface (UPI) has changed how people in India pay for things. In the financial year 2025–26 it handled more than 24,000 crore transactions (about 241 billion) worth roughly ₹314 lakh crore, and monthly volume passed 2,300 crore for the first time in May 2026 [1]. A system used this widely, and mostly for small and fast payments, is an attractive target. Payment platforms report that scams are the main difficulty: a payer is tricked into approving a request, sharing a PIN, or paying someone who is not who they claim to be [2]. Many banks and apps still rely on hand-written rules, such as blocking a transfer above a fixed amount. Rules like this are easy to understand, but they are blunt. A limit that is too low annoys honest users, and one that is too high lets fraud through. Fraudsters also learn the rules quickly. Machine learning offers another route, because a model can combine many weak signals at once and can be retrained when behaviour changes [3], [4]. This paper presents a deliberately small prototype built as a third-year student project. It is meant to be easy to install and run, and easy to read. The contributions are as follows. First, a generator for a synthetic UPI-style dataset that encodes several well-known scam patterns. Second, a feature set that describes how unusual a transaction is for the user, not only how large it is. Third, a comparison of a logistic regression baseline and a random forest using metrics suited to imbalanced data, including a look at how the decision threshold changes the outcome. Fourth, an honest account of what the results can and cannot claim. The rest of the paper is organised as follows. Section II reviews related work. Section III describes the data, features and models. Section IV reports and discusses the results. Section V lists limitations, and Section VI concludes.
II. RELATED WORK
Most published fraud-detection work uses card payments, where datasets are easier to obtain. Dal Pozzolo et al. studied card fraud under realistic conditions and stressed three problems that also apply to UPI: extreme class imbalance, delayed feedback on labels, and change in behaviour over time [3]. Bhattacharyya et al. compared logistic regression, support vector machines and random forests on real card data and reported strong results for random forests [5]. Ahmed et al. surveyed anomaly-detection methods in the financial domain and showed how varied the approaches are, from clustering to neural networks [6]. Work that targets UPI is newer. Sirisha et al. compared several tree-based algorithms, including random forest and gradient boosting, for UPI fraud classification [4]. Dahiphale et al. described a system built on Google Pay data in which a large language model classified scams and explained its reasoning for human reviewers; their classifier had high recall but a precision of only about 30%, which shows how hard it is to keep false alarms low at that scale [2]. Neither study releases its data, which is typical because transaction records are sensitive. Because of this, simulation is common. PaySim generates mobile-money transactions from aggregated real logs so that researchers can test detectors without exposing customers [7]. We follow the same spirit but use a much simpler generator tailored to UPI behaviours. For imbalance, oversampling methods such as SMOTE are widely used [8], although we use class weights instead to keep the prototype short. Saito and Rehmsmeier argue that precision–recall measures are more informative than ROC curves when positives are rare [9], so we report both.
III. METHODOLOGY
| Feature | Meaning |
|---|---|
| amount | g Transaction value (INR) |
| hour, day_of_week | Time of the transaction |
| txn_type | P2P, merchant or collect |
| txn_count_1h | Transactions in last hour |
| avg_amount_30d | User’s 30-day mean amount |
| is_new_payee | First payment to this payee |
| device_changed | New device for this user |
| location_mismatch | Unusual location |
| failed_attempts_24h | Failed attempts, last 24 h |
| payee_age_days | Age of payee account |
| amount_ratio* | amount / (avg_amount_30d + 1) |
| is_night* | 1 if hour is 22–05 |
TABLE I FEATURES USED BY THE MODELS Feature Meaning amount Transaction value (INR) hour, day_of_week Time of the transaction txn_type P2P, merchant or collect txn_count_1h Transactions in last hour avg_amount_30d User’s 30-day mean amount is_new_payee First payment to this payee device_changed New device for this user location_mismatch Unusual location failed_attempts_24h Failed attempts, last 24 h payee_age_days Age of payee account amount_ratio amount / (avg_amount_30d + 1) is_night 1 if hour is 22–05 * engineered feature. C. Models Two classifiers were used. The baseline is logistic regression on standardised inputs. The second model is a random forest of 200 trees [10], which averages many decision trees trained on random subsets of the data and features, and which handles mixed feature types without scaling. Both were implemented with scikit-learn [11] and use balanced class weights, so the rare fraud class counts for more during training. D. Evaluation The data were split 75/25 with stratification, giving 15,000 training and 5,000 test records, of which 252 are fraud. We report precision, recall and F1 for the fraud class, ROC-AUC [12] and PR-AUC (average precision). Plain accuracy is shown but not relied on, since a model that never flags fraud would still score about 95%. To check stability, five-fold stratified cross-validation was run on the full set. The default threshold is 0.5, and a threshold sweep is reported separately.
IV. RESULTS AND DISCUSSION
| Metric | LogReg | RF |
|---|---|---|
| Precision | 0.540 | 0.985 |
| Recall | 0.782 | 0.758 |
| F1-score | 0.639 | 0.857 |
| Accuracy | 0.955 | 0.987 |
| ROC-AUC | 0.876 | 0.887 |
| PR-AUC | 0.789 | 0.802 |
| False positives | 168 | 3 |
| False negatives | 55 | 61 |
TABLE II HOLD-OUT TEST RESULTS (FRAUD CLASS) Metric LogReg RF Precision 0.540 0.985 Recall 0.782 0.758 F1-score 0.639 0.857 Accuracy 0.955 0.987 ROC-AUC 0.876 0.887 PR-AUC 0.789 0.802 False positives False negatives
| Thr. | Prec. | Recall | F1 | FP |
|---|---|---|---|---|
| 0.5 | 0.985 | 0.758 | 0.857 | 3 |
| 0.4 | 0.970 | 0.774 | 0.861 | 6 |
| 0.3 | 0.965 | 0.774 | 0.859 | 7 |
| 0.2 | 0.938 | 0.778 | 0.850 | 13 |
| 0.1 | 0.763 | 0.778 | 0.770 | 61 |
C. Error Analysis and Feature Importance Recall stays near 0.77 however low the threshold is set. The reason is mostly in how the data were built. With 1% of labels flipped, about 50 of the 5,000 test records are expected to be legitimate-looking transactions labelled as fraud. This is close to the 56–61 frauds the forest misses, so most misses are probably noise records that no behavioural model could separate. The ceiling is therefore a property of the synthetic labels, not a weakness we can claim to have measured in real fraud.
Fig. 3 shows that payee account age is the strongest feature (importance 0.291), followed by the raw amount (0.162), the amount ratio (0.092), the number of transactions in the past hour (0.092) and the new-payee flag (0.086). These rankings should be read carefully. They reflect the fraud profile we chose to simulate, so they show that the model finds the patterns we put in, not that payee age is the best signal in real UPI traffic. Even so, the ordering is plausible: new payees, sudden spikes and bursts of activity are the signs that scam victims and fraud analysts commonly describe.
V. LIMITATIONS
The main limitation is the data. The generator encodes our own assumptions, so the scores above measure how well a model recovers those assumptions and should not be quoted as expected accuracy on real UPI traffic. Second, the split is random and not time-based, so concept drift, which is a central problem in real fraud systems [3], is not tested. Third, the features describe a single transaction and a short history; they ignore the network of payers and payees, device fingerprints and message text, which production systems use [2]. Fourth, we did not tune hyper-parameters or compare gradient boosting, which other UPI studies have used [4]. Finally, we did not measure inference latency, which matters because UPI payments complete in seconds.
VI. CONCLUSION AND FUTURE WORK
We built and tested a compact Python pipeline for UPI fraud detection, from data generation through training to a three-level risk decision. On synthetic data, a random forest gave a precision of 0.985 and a recall of 0.758 at the default threshold, with far fewer false alarms than logistic regression, and a lower threshold lifted recall slightly at modest cost. The main value of the work is a clear, reproducible baseline that other students can run in a few minutes. Future work should test the same pipeline on a realistic public dataset or on anonymised data from a bank partner, use time-based splits to study drift, add oversampling [8] and gradient-boosted trees, and bring in graph features and explanations such as SHAP values so that analysts can see why a payment was flagged. Privacy-preserving training would also be needed before any real deployment.
REFERENCES
How to Cite this Contribution
SHELAR PALLAVI RAJENDRA et al. (2026). UPI_FRAUD_DETECTION. International Journal of Research, Exploration & Knowledge (IJREK), 1(1).
Distributed under Creative Commons Attribution 4.0 International (CC BY 4.0).
