Deploying XGBoost for Credit Card Fraud Detection on Serverless Cloud Infrastructure: A Practical Evaluation of Latency, Cost, and Scalability
Abstract
In this paper, the practical usage of fraud detection models on a serverless cloud platform is considered, focusing on improving the current state in terms of reporting latency, cost per inference, and auto-scaling behavior, compared to lab experiments. Three machine learning models such as Logistic Regression, Random Forest, and XGBoost are implemented and evaluated on AWS Lambda. The benchmarking utilizes the credit card fraud data set from OpenML (ID: 1597; number of observations: 284,807; fraud ratio: 0.172%). Class imbalance issues are addressed by using SMOTE. Apart from traditional performance metrics, such as AUC-ROC and F1 score, cloud-native KPIs are provided for each model including p99 inference latency, cost per 10,000 predictions, cold-start time, and maximum throughput while auto-scaling. It was found that XGBoost produces the best results in terms of fraud detection performance (AUC-ROC = 0.98, F1 = 0.88), however, the latency is significantly higher (87 ms) together with costs (cost per 1,000,000 requests: $2.65) in comparison with Logistic Regression (latency 27 ms; $1.45). XGBoost has approximately 3.2× more latency and 1.7× more cost. The decision tree is provided to help the user choose the right model depending on transaction volume and latency requirements. This work provides the first benchmark of fraud detection models on serverless infrastructure, contributing to intelligent decision-making for cloud-based fraud detection deployments.