Real-Time Credit Card Fraud Detection Using Machine Learning: Design, Evaluation and Deployment of an Interactive Fraud Detection System
Abstract Credit card fraud detection presents a significant machine-learning challenge because fraudulent transactions typically represent only a small proportion of financial activity. This study presents the design, development, evaluation and deployment of a machine-learning system for detecting potentially fraudulent credit card transactions. The study uses a dataset containing 339,607 transactions, including 1,782 fraudulent transactions (0.52%), representing a highly imbalanced binary classification problem. An end-to-end machine-learning pipeline was developed incorporating exploratory data analysis, feature engineering, categorical encoding, stratified train-test splitting, class-imbalance treatment using the Synthetic Minority Over-sampling Technique (SMOTE), comparative model training and performance evaluation. Four supervised machine-learning algorithms were evaluated: Logistic Regression, Decision Tree, Random Forest and XGBoost. Performance was assessed using AUC-ROC, Precision-Recall AUC (PR-AUC), precision, recall and F1-score, rather than relying solely on classification accuracy. XGBoost achieved the strongest overall performance, with an AUC-ROC of 0.9956 and PR-AUC of 0.8633. At the standard 0.50 classification threshold, the model achieved 89.33% recall, 43.80% precision and an F1-score of 58.78%. Decision-threshold optimisation was subsequently performed to investigate the trade-off between precision and recall. At an optimised threshold of 0.95, XGBoost achieved 91.03% precision, 74.16% recall and an F1-score of 81.73%, demonstrating a substantial improvement in the balance between precision and recall for the evaluated dataset. The selected XGBoost model was integrated into an interactive Streamlit application providing exploratory data analysis, model comparison, ROC and precision-recall visualisation, confusion matrices, feature-importance analysis, threshold optimisation and transaction-level fraud probability prediction. The study demonstrates an end-to-end application of artificial intelligence and machine learning to financial fraud detection, combining data preprocessing, imbalance handling, predictive modelling, model evaluation, threshold optimisation and interactive deployment.
Authors
- Emmanuel Odigie Okohe
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-09-01
- DOI
- https://doi.org/10.5281/zenodo.22233223
- Primary Topic
- Imbalanced Data Classification Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00