March 02, 2026
Comparison of predictive models for credit card fraud identification
Gilberto Luiz Angelice de Camargo; Jailson dos Santos SIlva
Summary prepared by the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege focused on synthesis and writing.
This work compares the performance of three supervised learning algorithms — logistic regression, XGBoost, and artificial neural networks — in detecting credit card transaction fraud. The analysis used a public and synthetic dataset, characterized by severe class imbalance, to simulate realistic operational scenarios. The investigation measured technical performance using metrics such as sensitivity and precision and discussed the managerial implications of implementing each approach. The study fills a gap in the literature by conducting a direct and standardized comparison between these algorithms, subjecting them to the same preprocessing and evaluation conditions for a conclusive analysis of their behavior in the challenge of detecting rare events.
The growing digitalization of financial transactions has increased convenience, but also expanded the attack surface for fraudulent activities. Authors like Abdulkreem and Abdulazeez (2024) highlight that technology, by facilitating services, creates new vulnerabilities exploited by malicious actors. The complexity of modern systems, as pointed out by Wiese (2007), requires overcoming traditional methods based on fixed rules, which are insufficient for the volume and speed of digital transactions. In this scenario, the adoption of artificial intelligence-based solutions, especially machine learning, has become imperative for robust defense systems.
Supervised machine learning techniques are effective tools in the fight against fraud, as they identify subtle and non-linear patterns in large volumes of data, distinguishing legitimate and anomalous behaviors. Zhang (2023) demonstrates that models such as XGBoost and deep neural networks learn a customer’s spending patterns and identify deviations that may indicate fraud, even in noisy and unbalanced data. The main advantage is adaptability: models can be retrained with new data to recognize new threats, ensuring dynamic protection against constantly evolving fraud strategies.
One of the most significant technical challenges is the extreme class imbalance. In transactional datasets, fraudulent operations represent a minimal fraction, often less than 1%. This asymmetry makes metrics like accuracy inadequate, as a model that classifies all transactions as legitimate would still achieve an accuracy of over 99%, rendering it useless in practice. Awoyemi et al. (2017) highlight the importance of metrics such as sensitivity (recall), which measures the proportion of actual fraud correctly identified, and precision, which measures the proportion of alerts that were indeed fraud. The balance between them is fundamental, as an excess of false positives harms legitimate customers, while an excess of false negatives results in financial losses.
The literature explores various approaches to these challenges. XGBoost, a gradient-boosted decision tree algorithm, is cited for its robustness and efficiency (Chen & Guestrin, 2016). Neural networks, especially deep architectures, offer flexibility in capturing complex interactions (Singh et al., 2023; Wiese, 2007). Beyond algorithms, preprocessing techniques such as feature engineering and data balancing are crucial for performance (Mienye and Sun, 2023). Few works perform a systematic comparison between different algorithms under a unified framework, a gap this study addresses by evaluating logistic regression, XGBoost, and neural networks under identical conditions.
The methodology of this study was quantitative and experimental, comparing the predictive performance of the algorithms in a binary classification task. The selected database, “Credit Card Transactions Fraud Detection” (Kaggle), was chosen for its strong class imbalance. The training set contained 1,296,675 records, with 0.58% (7,506 cases) of fraud, while the test set had 555,719 records, with 0.39% (2,145 cases) of fraud. This asymmetry required the adoption of specific strategies in training and in the selection of evaluation metrics, prioritizing the detection of the minority class.
Data preprocessing was a critical step. Feature engineering was performed, converting temporal variables such as “transdatetranstime” and “dob” to datetime format and creating new variables like customer age, hour of the day, and day of the week. Irrelevant or noisy variables (“transnum”, “ccnum”, personal information) were removed. The remaining categorical variables (“category”, “gender”, “diasemana”) were encoded with OneHotEncoder, and the numerical variables were standardized with StandardScaler, an essential step for scale-sensitive algorithms like logistic regression and neural networks.
The construction and evaluation of the models followed a structured pipeline. Logistic Regression was implemented as a baseline, being optimized via GridSearchCV with cross-validation to maximize sensitivity, testing different values for the regularization parameter C and for the class weight. XGBoost was evaluated with default parameters (using the aucpr metric) and with hyperparameters optimized via GridSearchCV, focusing on maximizing sensitivity. The optimization included parameters such as maximum tree depth and learning rate.
The third model was a feedforward Artificial Neural Network (TensorFlow/Keras), with an input layer, two hidden layers (32 and 16 neurons, ReLU activation) and a sigmoid output layer. The model was compiled with the Adam optimizer and the binarycrossentropy loss function. Two versions were trained: one without treatment for imbalance and another with the classweight parameter to penalize errors in the minority class. The analysis of this model explored the precision versus sensitivity curve for different decision thresholds, allowing for fine calibration of the cutoff point. All models were trained on the training set and evaluated on the test set to ensure generalization capability.
The comparative analysis of the results revealed substantial differences in performance, highlighting the trade-off between sensitivity and precision. Sensitivity measures the ability to identify fraud, crucial for minimizing losses, while precision measures the proportion of correct alerts, vital for avoiding negative impact on legitimate customers. The choice of which metric to prioritize depends on the business strategy and the institution’s risk tolerance.
The Logistic Regression model demonstrated limited performance. In its initial configuration, without adjustment for imbalance, it achieved a sensitivity of 0%, being unable to identify the minority class. After optimization with GridSearchCV, which adjusted class weights, sensitivity increased to 74%, but with a precision of only 2%. This means that for every 100 fraud alerts, only 2 would be real, making the system operationally unviable due to the high volume of false positives, corroborating the findings of Awoyemi et al. (2017).
XGBoost demonstrated superior technical performance. With default parameters, it achieved a balance of 74% sensitivity and 88% precision, positioning itself as a viable solution. When optimized to maximize sensitivity, it reached 97%, identifying almost all fraud cases. However, this focus resulted in a drop in precision to 19%. This behavior, highlighted by He & Garcia (2009), illustrates that maximizing sensitivity can introduce operational noise. Managerially, implementing a model with this configuration would require a second-layer system to filter false positives, an approach aligned with the recommendations of Zhou et al. (2024).
Neural Networks demonstrated intermediate performance, with the strategic flexibility provided by the calibration of the decision threshold as a differential. Instead of using the standard threshold of 0.5, it was possible to analyze the precision-recall curve. In the first neural network model, without class weights, a threshold of 0.13 resulted in balanced performance with 79% sensitivity and 79% precision. In the second model, with class_weight, the strategy was to maximize sensitivity. With a threshold of 0.6, the model achieved 96% sensitivity, but with 10% precision.
The ability to adjust the decision threshold gives neural networks a strategic advantage. As highlighted by Addo et al. (2021), this flexibility allows institutions to implement dynamic risk policies, applying a stricter threshold for high-value transactions and a more flexible one for low-risk clients. This adaptability, combined with the ability to capture non-linear patterns (Wiese, 2017), makes them a powerful tool, despite interpretability challenges.
The discussion of the results shows that there is no universally superior model. The choice of tool is linked to the risk strategy and operational capacity. XGBoost stood out as the technically most powerful model in detection, but its implementation would require mechanisms to manage the high volume of false positives generated when optimized for high sensitivity. Logistic Regression proved inadequate for the complexity of the problem. The Neural Network emerged as the most flexible and strategically adaptable solution, allowing granular control over the trade-off between sensitivity and precision. The findings of this study are in line with the view of Carcillo et al. (2018), who argue that the effectiveness of an anti-fraud system is measured not only by algorithmic performance but also by operational factors such as explainability and user impact. Successful implementation requires a holistic approach that integrates Data Science and business strategy.
This comparative study demonstrated that, although algorithms like XGBoost and Neural Networks significantly outperform Logistic Regression, the choice of the ideal solution depends on a balance between technical performance and operational feasibility. The central challenge lies in managing the trade-off between sensitivity in fraud detection and the control of false positives. XGBoost proved to be the most powerful in identifying fraud, but at the cost of a high rate of false alarms when optimized. The Neural Network stood out for its flexibility, allowing fine calibration of the balance between sensitivity and accuracy through threshold adjustment, making it a strategically valuable tool.
The limitations of this work include the use of a synthetic dataset, which may not reflect the full complexity of real-world fraud. Additionally, the analysis did not incorporate an assessment of the financial impact of model errors. For future research, it is recommended to validate these models on real databases, explore behavioral variables, and investigate hybrid architectures that combine different algorithms with business rules. It is concluded that the objective was achieved: it was demonstrated that XGBoost algorithms and artificial neural networks significantly outperform logistic regression in detecting fraud in imbalanced scenarios, each offering distinct advantages in terms of detection power and operational flexibility, reinforcing that the effective implementation of anti-fraud systems requires a multidimensional approach that aligns technology, strategy, and operation.
References:
Abdulkreem, R. Z.; Abdulazeez, A. M. 2024. Financial fraud detection based on machine and deep learning: a review. Indonesian Journal of Computer Science 13(3): 4366–4375.
Addo, P. M.; Guegan, D.; Hassani, B. 2021. Financial fraud detection based on machine and deep learning. International Journal of Financial Studies, 9(3): 45–67.
Awoyemi, J. O.; Adetunmbi, A. O.; Oluwadare, S. A. 2017. Credit card fraud detection using machine learning techniques: a comparative analysis. In: 2017 International Conference on Computing Networking and Informatics (ICCNI). IEEE, Lagos, Nigeria. p. 1–9.
Carcillo, F.; Dal Pozzo, A.; Le Borgne, Y.-A.; Bontemps, L.; Cauwenberghs, E.; Bontemps, C. 2018. SCARFF: a scalable framework for streaming credit card fraud detection with Spark. Information Fusion 41: 182–194.
Chen, T.; Guestrin, C. 2016. XGBoost: a scalable tree boosting system. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, San Francisco, CA, USA. p. 785–794.
Géron, A. 2020. Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow. 2nd ed. Alta Books, São Paulo, SP, Brazil.
He, H.; Garcia, E. A. 2009. Learning from imbalanced data. IEEE Transactions on Knowledge and Data Engineering 21(9): 1263–1284.
Mienye, I. D.; Sun, Y. 2023. A machine learning method with hybrid feature selection for improved credit card fraud detection. Applied Sciences 13(12): 7254.
Singh, R. B.; Kumar, M.; Sharma, V. 2024. Enhancing security in digital payments: a comparative evaluation of machine learning models for credit card fraud detection. Financial Technologies and Security of Cyber Life 6: 1–12.
Wiese, B. J. 2007. Credit card transactions, fraud detection, and machine learning: modelling time with LSTM recurrent neural networks. Master’s Thesis in Computer Science. University of the Western Cape, Cape Town, South Africa.
Zhang, F. 2023. Improved credit card fraud detection method based on XGBoost algorithm. BCP Business & Management 38: 2888–2895.
Zhou, G.; Demirhan, H.; İçen, D. 2024. An online fuzzy fraud detection framework for credit card transactions. Expert Systems with Applications 252: 124127.
Executive summary from the Final Course Work of the Specialization in Data Science and Analytics of the MBA USP/Esalq
Learn more about the course; click here: