back to top
Home NHSJS Explainable AI for Extreme Class Imbalance: Interpreting Latent Variables in European Credit...

Explainable AI for Extreme Class Imbalance: Interpreting Latent Variables in European Credit Card Transactions

0
16

Abstract

Credit card fraud presents major challenges to our financial ecosystem, and recent studies have been using supervised learning to detect it. Extreme class imbalance, which is common in real-world data, usually hides the true performance of detection models. Techniques like Principal Component Analysis can even turn these models into “black boxes”. In this paper, we look at the trade-off between accuracy and interpretability by comparing XGBoost and Logistic Regression on a dataset of European credit card fraud transactions, which exhibits this extreme class imbalance. We used SMOTE to mitigate this imbalance, as well as leakage, inside the training folds during each iteration of stratified 5-fold cross-validation. XGBoost outperformed Logistic Regression when ranking positive cases, with a PR-AUC of 0.85040.0332 compared to 0.74130.0283, and a Nadeau-Bengio/Holm-adjusted p-value of 0.0022. To add to this, at the fixed F1 threshold, holdout F1, precision, and recall were 0.8364, 0.9857, and 0.7263 respectively for XGBoost, compared to 0.8136, 0.8780, and 0.7579 for Logistic Regression. These differences, however, were not statistically significant. Using the Interventional TreeExplainer in probability space, we were able to identify a few PCA components (V14, V12, and V4) that are primarily responsible for the model’s decision.

Keywords: Explainable AI, Credit Card Fraud, XGBoost, SHAP, Extreme Class Imbalance

Introduction

Credit card fraud – especially card-not-present fraud – is a rare and organized crime that follows a sequence of steps (a crime script)1. However, when a legitimate transaction is flagged or a fraudulent transaction is missed, its consequences can get really expensive2. This means that machine learning models would need to rank risky transactions and choose a cutoff. Accuracy alone would not suffice because of the extreme class imbalance notable in real financial transactions.

Because of this issue, researchers started building cost-sensitive models and choosing thresholds. For example, Almhaithawi et al. treat cost as example-dependent. They combine this with SMOTE, which addresses extreme class imbalance during learning, and a Bayes minimum-risk decision, which then chooses a threshold based on cost3. Sang (2026) argues that with extreme class imbalance, it is not enough to just train a cost-sensitive model; you have to optimize the threshold4. However, Islam et al. show how when fraud is rare and both classes overlap, there is always a tradeoff between false positives and false negatives5. Many papers already treat cost and optimizing the threshold as important, but locking an F1 threshold inside nested cross-validation is less established.

The default model in credit card fraud detection – besides costs and thresholds – are tree ensembles or benchmark comparisons. Randhawa et al., Zhao et al., and Suryanarayana et al. all use boosting methods: AdaBoost6, LightGBM7, and Catboost8, respectively. Other researchers employ several different models and examine their performance in credit card fraud detection. Alarfaj et al. and Gamal et al. compare standard machine learning models (logistic regression, trees, and SVMS) to deep learning models9,10. Al-Bulushi et al. and Farabi et al. compared supervised learning models and ensemble models, and reported their performance metrics11,12. Tiwari et al. conduct a survey of credit-card fraud methods and compare the pros and cons of earlier studies13. Lastly, Praba et al. survey standard machine learning models across their general applications14. These papers usually use accuracy or F1 score as their main metric. They rarely lock the F1 threshold inside nested CV or use a Nadeau-Bengio corrected t-test to actually treat the overlapping CV folds as overlapping.

 Other studies use graphs, transaction sequences, and deep neural networks to detect credit card fraud. Motie & Raahemi and Cheng et al. survey graph neural networks (GNNs) for fraud detection. They treat accounts, merchants, devices, and cards as a network where everything is linked15,16. Cherif et al. and Wei & Lee put this into action by creating graph neural networks with payments, cards, or merchants as the nodes. Cherif et al. created an encoder-decoder GNN for credit card fraud17 while Wei & Lee created a temporal heterogeneous GNN for transaction fraud18. While these are the most specific examples, other studies have created GNNs with other variables – like user accounts19, supply-chain partners20, or colluding accounts21 – as the nodes. Other studies by Benchaji et al.22,23 and El Hachimi et al.24, have used LSTMs (Long Short Term Memory) so that the model can follow payment histories. Yu et al. and Deng et al. use transformers for these, although in different sectors: Yu et al. use it for cards25 while Deng et al. use it for streaming financial fraud26. Deep learning models are also used without graphs or long histories. For example, Fanai et al.27 and Bao et al.28 use autoencoders and anomaly detection respectively. These approaches require a network or an ordered payment history however, which this paper does not study, so they are not missing baselines.

However, whether the model is a decision tree or a neural network, it is still important to understand why the model flagged the transaction. Rudin argues that for important, high-risk decisions, you should use naturally interpretable, not a black-box model plus an explainer like SHAP29. Despite this warning, researchers and banks still use Explainable AI to explain tree models, just not for detecting fraud. For example, Bussmann et al. use it for predicting loan defaults30. Bahlool et al. review this literature more broadly and illustrate how work on explainability and performance is mostly concentration in credit scoring, not fraud detection31. Even so, there is still a trade-off between making a model more secure and making it more accurate. If you optimize the model to be more secure, the accuracy often drops, and vice versa32. So, while studies have focused on explainability and fairness, they have usually focused on them in the context on credit scoring, not credit card fraud

To evaluate the model, we used a leak-free nested cross validation protocol with a fixed F1 threshold. This study asks three research questions:

  • RQ1: After using nested cross-validation, inner-out-of-fold F1 thresholding, and the same SMOTE pipeline, does XGBoost outperform L2 Logistic Regression on threshold-free ranking, specifically PR-AUC, on the holdout set?
  • RQ2: Do F1/precision/recall/FPR/balanced accuracy – at that locked F1 threshold – pass a Nadeau-Bengio corrected paired t-test and a Holm’s procedure at \alpha=0.05?
  • RQ3: Which PCA features dominate mean absolute SHAP in the probability space (real-prevalence background), and do true positive, false positive, and false negative cases share these patterns?

We came up with the following hypotheses to answer these research questions:

  • H1: After the same nested cross-validation protocol, XGBoost will outperform L2 Logistic Regression on threshold-free ranking. Nested-CV and holdout PR-AUC should both be higher for XGBoost, and this gap should remain significant after a Nadeau-Bengio corrected paired t-test and Holm adjustment.
  • H2: XGBoost will outperform L2 Logistic Regression on F1, precision, recall, FPR, and balanced accuracy at the locked F1 threshold. These differences should also remain significant after the t-test and Holm adjustment.
  • H3: A small number of PCA variables will be responsible for most mean absolute SHAP in probability space against a real-prevalance background. True-positive and false-positive cases should share this pattern, while a missed fraud should not.

This paper presents the following contributions on to the current body of literature:

  1. A nested cross-validation protocol that uses a stratified split before scaling, SMOTE only in the training folds, a matched hyperparameter-search budget (n_iter=10), and a locked F1 threshold that is locked on inner out-of-fold scores and fixed for the outer fold and the holdout set.
  2. A comparison of XGBoost and L2 Logistic Regression that used Nadeau-Bengio corrected paired t-test, Holm adjustment across six metrics, and the separation of threshold-free metrics like PR-AUC from threshold-dependent metrics like F1, precision, recall
  3. Interventional TreeExplainer in probability space, using a real-prevalence background, with global mean absolute SHAP values and TP, FP, and FN waterfall plots so the strongest features can be checked on errors as well.

Methods

Dataset

This study uses the European Credit Card Fraud dataset, originally created by the Machine Learning Group at Université Libre de Bruxelles (ULB)33 to study how to calibrate class probabilities when dealing with extreme class imbalance. The dataset contains 284,807 real-world credit card transactions made by European cardholders in September 2013. Accounting for the extreme class imbalance in real-world credit card fraud, only 492 (0.172%) of the transactions are labeled as fraudulent. The dataset contains 28 numerical features (V1-V28) that are masked by PCA to protect consumer privacy. These represent the latent variables. Time and Amount are the only two variables not anonymized by PCA. Finally, the Class feature is the target variable, indicating whether the transaction was fraudulent (1) or legitimate (0).

Data Preprocessing

To address the extreme class imbalance, we used the Synthetic Minority Oversampling Technique (SMOTE)34. SMOTE was configured with a default sampling strategy of ‘auto’ to achieve a perfectly balanced training distribution. We set the number of nearest neighbors (k) to 5 for synthetic interpolation and used a random state seed of 42 to ensure reproducibility.

We used SMOTE over alternative sampling and cost-sensitive methods due to the geometric distribution of the PCA-transformed data. Cost-sensitive methods like class weighting penalize misidentifying the minority class, but they do not provide tree-based algorithms like XGBoost with the diverse data that they need to form non-linear decision boundaries. To add to this, ADASYN adaptively creates synthetic data near complex decision boundaries, but it risks exaggerating noise and outliers. Hybrid methods like SMOTEEN were also not used in order to keep the full scale and behavioral complexity of the majority class. SMOTE provided the optimal balance that was needed to address the extreme imbalance.

To mitigate data leakage, SMOTE was applied only inside the training folds during each iteration of cross-validation. The original data kept its extreme class imbalance to more accurately model reality. We also applied standard scaling to the Time and Amount variables before model training to ensure that subsequent SHAP values were not skewed by variances and to ensure uniformity across all features.

Because the dataset contained no missing values, data imputation was not required. However, we did identify and drop 1081 duplicate rows before the train-test split to mitigate leakage across cross-validation folds. This left 283,726 total transactions and 473 (0.167%) fraudulent ones. We also winsorized the Amount values at the 0.5th and 99.5th percentiles and standardized the Time and Amount features with a scaler. Both were done only on the training split. PCA-transformed variables were left unscaled. Even though roughly 11.17% of the Amount values were considered outliers, these were not deleted. Any extreme values were capped so that they didn’t skew the scaler.

Data Analysis

We performed an exploratory data analysis using the pandas library in Python in order to understand the distribution of Time and Amount. We did this to locate potential similarities and differences in the distributions of the two classes. We also used SHAP (SHapley Additive exPlanations)35 to identify which variables most influenced the model’s result. This is especially necessary due to the ‘black box’ problem we are investigating in this paper, because SHAP will be able to explain the model’s decisions even and especially when the features lose their original meaning.

Model Architecture and Implementation

We compared XGBoost and Logistic Regression, using Logistic Regression as the baseline. While both models had their hyperparameters optimized via RandomizedSearchCV with 3 inner folds, n_iter = 10, and scoring = PR-AUC, the models used different hyperparameters. XGBoost’s hyperparameters n_estimators = 182, max_depth = 7, learning_rate = 0.1203, subsample = 0.7837, colsample_bytree = 0.7498, min_child_weight = 5, gamma = 1.4261, reg_alpha = 0.00607, and reg_lambda = 0.1479. XGBoost also had a few hyperparameters that were fixed. These were: objective = binary:logistic, eval_metric = aucpr, and tree_method = hist. For Logistic Regression only one hyperparameter, which was C = 3.470, was optimized. The others (penalty = L2, solver = liblinear, max_iter = 2000) were fixed. Both XGBoost and Logistic Regression also had different F1 thresholds, with XGBoost at 0.9773 and Logistic Regression at 0.9999994. Both models were run on an ARM processor (macOS-15.7.5-arm64), with Logistic Regression having an inference time and holdout training time at 0.257 \frac{\mu\text{s}}{\text{transaction}} and 1.23s respectively. This is much lower than XGBoost’s 1.71 \frac{\mu\text{s}}{\text{transaction}} and 5.01s.

Splitting (Testing and Training)

We split the dataset with a stratified 80/20 split (random_state = 42). The 20% holdout data was left untouched until final testing and SHAP analysis while the remaining 80% was trained and tuned using nested cross-validation. The outer loop used five stratified folds with n_splits = 5, shuffle = True, and random_state = 42. We selected hyperparameters for XGBoost and Logistic Regression within each outer training fold by using 3-fold RandomizedSearchCV with the same search budget. We optimized for PR-AUC and did not use early stopping. After the hyperparameters were selected, we chose a single decision threshold to maximize the F1 score for fraudulent transactions on inner out-of-fold predictions and fixed that threshold. Stratification preserved class proportions within every split and SMOTE was applied only in the outer training folds. 

Metrics

Due to the extreme class imbalance of the dataset, accuracy was discarded as a primary evaluation metric, as a classifier could achieve near-perfect accuracy simply by predicting the majority class. Instead, model performance was evaluated using PR-AUC as the predeclared ranking metric and inner-search objective. Precision, recall, F1, FPR, and balanced accuracy were calculated at the F1-maximizing threshold locked on the inner out-of-fold scores. Calibration was summarized with the Brier score. Recall was not optimized on the holdout set.

Results

Figure 1 | Exploratory Data Analysis of the ULB Dataset. (a) The severe native class imbalance. (b) Transaction amount distributions (log scale). (c) Temporal density of legitimate versus fraudulent transactions over 48 hours.

We performed an exploratory data analysis on the cleaned ULB dataset to determine its characteristics. Figure 1(a) shows the distribution of both classes in the cleaned dataset, with 283,253 legitimate transactions and 473 fraudulent transactions (0.167%), showing the dataset’s extreme class imbalance. A logarithmic scale was used so that the fraudulent bar would be visible. Due to the dataset’s extreme class imbalance, accuracy and ROC-AUC would be impressive just by guessing every transaction as legitimate. The model would achieve a 99.833% accuracy. This is why we chose to use PR-AUC and F1-score, among other metrics, because they account for the extreme class imbalance.

In addition to plotting the distribution of both classes, we also illustrated the distribution of the Time and Amount. As illustrated in Figure 1(b), legitimate transactions showed a higher median transaction amount at 22.00 vs.9.82 for fraud, showing that fraudulent transactions are typically of lower value than legitimate transactions. However, the mean for fraudulent transactions is higher than the mean for legitimate transactions, at 124.00 vs.88.00. While both distributions are right-skewed and show significantly higher mean transaction amounts than their medians, the small minority of large fraudulent transactions gives fraudulent transactions the higher mean. Even so, extremely large charges usually indicate a legitimate transaction, and most transactions – both legitimate and fraudulent – usually stay below 100. The kernel density estimate in Figure 1(c) illustrates the distribution of transactions across time. Both classes showed bimodal distributions, albeit with different peaks. Fraudulent transactions usually occurred during night-time or early morning hours, when volume and monitoring of transactions is usually low. Both variables show patterns, but not significant enough to show causation, meaning V1-V28 still have to be analyzed. <!-- /wp:paragraph -->  <!-- wp:table {"hasFixedLayout":false} --> <figure class="wp-block-table"><table><tbody><tr><td><strong>Model</strong></td><td><strong>Evaluation</strong></td><td><strong>PR-AUC</strong></td><td><strong>F1 Score</strong></td><td><strong>Precision</strong></td><td><strong>Recall</strong></td><td><strong>FPR</strong></td><td><strong>Balanced Accuracy</strong></td></tr><tr><td>Logistic Regression</td><td>Nested 5-Fold CV</td><td>0.7413 ± 0.0283</td><td>0.8072 ± 0.0427</td><td>0.8591 ± 0.0406</td><td>0.7671 ± 0.0860</td><td>0.000216 ± 0.000092</td><td>0.8834 ± 0.0430</td></tr><tr><td>Logistic Regression</td><td>Holdout</td><td>0.6929</td><td>0.8136</td><td>0.8780</td><td>0.7579</td><td>0.000177</td><td>0.8789</td></tr><tr><td>XGBoost</td><td>Nested 5-Fold CV</td><td>0.8504 ± 0.0332</td><td>0.8564 ± 0.0306</td><td>0.9225 ± 0.0300</td><td>0.8015 ± 0.0578</td><td>0.000115 ± 0.000050</td><td>0.9007 ± 0.0289</td></tr><tr><td>XGBoost</td><td>Holdout</td><td>0.8107</td><td>0.8364</td><td>0.9857</td><td>0.7263</td><td>0.000018</td><td>0.8631</td></tr></tbody></table><figcaption class="wp-element-caption">Table 1 | Predictive Performance of Baseline vs. Gradient-Boosted Architectures.</figcaption></figure> <!-- /wp:table -->  <!-- wp:paragraph --> <strong><em>NOTE: </em></strong><em>At that locked threshold, holdout confusion counts were 69 true positives, 1 false positive, and 26 false negatives for XGBoost, versus 72, 10, and 23 for Logistic Regression. Holdout Brier scores were 0.00076 and 0.02383, respectively. </em> <!-- /wp:paragraph -->  <!-- wp:image {"id":64056,"width":"692px","height":"auto","aspectRatio":"1.0987141012959578","sizeSlug":"large","linkDestination":"media","align":"center"} --> <figure class="wp-block-image aligncenter size-large is-resized"><a href="https://nhsjs.com/wp-content/uploads/2026/11/Figure_2-scaled.png"><img src="https://nhsjs.com/wp-content/uploads/2026/11/Figure_2-1024x932.png" alt="" class="wp-image-64056" style="aspect-ratio:1.0987141012959578;width:692px;height:auto"/></a><figcaption class="wp-element-caption"><em>Figure 2 | Model Evaluation on the 20% Holdout Set. (a) and (b) Holdout confusion matrices detailing the absolute classifications counts for the XGBoost and Logistic Regression architectures at their respective locked F1-maximizing thresholds. (c) Precision-Recall curves demonstrating the threshold-free ranking superiority of the XGBoost model (PR-AUC = 0.811) over the baseline</em>.</figcaption></figure> <!-- /wp:image -->  <!-- wp:table {"hasFixedLayout":false} --> <figure class="wp-block-table"><table><tbody><tr><td><strong>Metric</strong></td><td><strong>Mean Difference</strong></td><td><strong>t</strong></td><td><strong>p-score (raw)</strong></td><td><strong>Cohen's D</strong></td><td><strong>95% CI</strong></td><td><strong>Holm Threshold</strong></td><td><strong>Significant?</strong></td></tr><tr><td>PR-AUC</td><td>0.1091</td><td>7.01</td><td>0.0022</td><td>4.70</td><td>[0.0894, 0.1282]</td><td>0.0083</td><td>Yes</td></tr><tr><td>Precision</td><td>0.0634</td><td>3.40</td><td>0.0272</td><td>2.28</td><td>[0.0472, 0.0883]</td><td>0.0100</td><td>No</td></tr><tr><td>F1 Score</td><td>0.0492</td><td>2.51</td><td>0.0662</td><td>1.68 </td><td>[0.0267, 0.0718] </td><td>0.0125 </td><td>No</td></tr><tr><td>FPR</td><td>-0.000101</td><td>-2.19</td><td>0.0936 </td><td>-1.47</td><td>[-0.000163, -0.000062]</td><td>0.0167 </td><td>No</td></tr><tr><td>Balanced Accuracy</td><td>0.0173</td><td>0.84</td><td>0.4468</td><td>0.57 </td><td>[-0.0065, 0.0411] </td><td>0.0250</td><td>No</td></tr><tr><td>Recall</td><td>0.0345</td><td>0.84</td><td>0.4484</td><td>0.56 </td><td>[-0.0132, 0.0821]</td><td>0.0500</td><td>No</td></tr></tbody></table><figcaption class="wp-element-caption">Table 2 | Statistical Significance of XGBoost vs. Logistic Regression.</figcaption></figure> <!-- /wp:table -->  <!-- wp:paragraph --> <strong><em>NOTE: </em></strong><em>Table sorted by raw p-value to reflect the Holm step-down procedure sequence. Statistical significance was evaluated using a Nadeau-Bengio corrected resampled t-test (df = 4). All cross-validation splits and subsequent statistical tests were executed using a fixed random seed of 42 to ensure exact reproducibility.</em> <!-- /wp:paragraph -->  <!-- wp:paragraph --> We evaluated both XGBoost and Logistic Regression with PR-AUC, F1 score, precision, recall, balanced accuracy, and FPR. Both were evaluated using nested 5-fold cross validation and on the holdout set. Table 1 shows the performance of each model on each evaluation. XGBoost achieved a better threshold-free ranking with a nested CV PR-AUC of 0.8504 ± 0.0332 vs. 0.7413 ± 0.0283 for Logistic Regression. On the holdout set, XGBoost achieved a better PR-AUC (0.811 vs. 0.693), precision (0.986 vs. 0.878), and F1-score (0.836 vs. 0.814) than Logistic Regression, but achieved a slightly worse recall (0.726 vs. 0.758). The difference in PR-AUC is also shown in the precision-recall curves in Figure 2(c). These results show that while XGBoost identified fewer true positive transactions than Logistic Regression, it also identified fewer false positive transactions and more false negative transactions.  <!-- /wp:paragraph -->  <!-- wp:paragraph --> This is confirmed in the confusion matrices in Figures 2(a) and 2(b). XGBoost has 69 true positives compared to Logistic Regression's 72 true positives. To add to this, XGBoost also had only 1 false positive and 26 false negatives, while Logistic Regression had 10 false positives and 23 false negatives. <!-- /wp:paragraph -->  <!-- wp:paragraph --> We then compared XGBoost and Logistic Regression to see if the differences were statistically significant. Due to overlapping folds, a regular paired t-test is invalid. Using a Nadeau-Bengio corrected t-test and a Holm's procedure atalpha=0.05$, we found that only the difference in PR-AUC was statistically significant, with a difference of 0.1091, a p-value of 0.0022, and a 95% confidence interval of [0.0894, 0.1282]. While some of the other differences – like in F1 Score, Precision, and FPR – might seem statistically significant at first glance, these did not survive significance testing.

Figure 3 | Global Feature Analysis and Directional Impact via SHAP Summary Analysis for the XGBoost Architecture.
RankFeatureMean |SHAP| ValueRankFeatureMean |SHAP| Value
1V140.01981911V280.001368
2V120.00823012V220.001234
3V40.00743813V270.001171
4V100.00682214Amount0.001169
5V30.00575415V60.001166
6V110.00313216V20.001131
7V170.00259617V50.001125
8V70.00236618V90.001070
9V80.00216419Time0.001009
10V10.00213520V180.000933
Table 3 | Global Feature Importance Rankings (Top 20).

We used SHAP in the probability space to determine each feature’s influence on XGBoost’s decisions. The top 20 features, ordered by decreasing mean SHAP, is shown in Table 3. V14 had the strongest influence, with a mean SHAP value of 0.019819, with V12, V4, and V10 following at 0.008230, 0.007438, and 0.006822 respectively. Amount and Time, as shown back in Figure 1, have relatively little influence on XGBoost’s decisions, with mean SHAP values of 0.001169 and 0.001009 respectively. All of this is also visually illustrated in the beeswarm plot in Figure 3. Lower values in V14, V12, and V10 typically indicate higher probabilities of fraud. Conversely, higher values in V4 also indicate higher fraud probabilities. 

Figure 4 | SHAP Dependence Plot Illustrating the Non-Linear Predictive Threshold of Feature V14 and its Primary Interactive Effect.

Figure 4 shows a SHAP dependence plot, compared V14 against its SHAP values. The color of each dot depends on the value of V7. A bluer dot indicates a more negative value of V7, while a redder dot indicates a more positive value. V14 values greater than -5 generally have SHAP values near 0, meaning they have minimal effect on the fraud probability. However, around -5, V14 SHAP values start to rapidly increase before flattening out into a “tail” towards the left (extremely negative V14 values). In this “tail”, most values of V7 are negative (blue).

Figure 5 | SHAP Waterfall Plot Illustrate Local Feature Attribution and Step-by-step Probability Progression for a Single True Positive Fraud Instance.

Methodological Note: Explanations were computed using SHAP (v0.52.0), with TreeExplainer configured for model_output=’probability’ and feature_perturbation=’interventional’. The baseline expected value (E[f(X)] = 0.005) was anchored against a background dataset of 256 instances, sampled uniformly without replacement from the original imbalance training to reflect operational fraud prevalence rather than the SMOTE-balanced training. Predictions reflect the final XGBoost architecture utilizing a locked classification threshold of 0.9773.

Figure 5 shows a waterfall plot for a true positive instance in the holdout set, starting from the baseline probability of E[f(X)] = 0.005 and ending at the final predicted probability of 1. V14 (-13.695) contributes the most to the model’s final decision, contributing +0.34 to the final probability. This is followed by V12 (-13.064) with +0.16, V10 (-12.806) with +0.1, and V4 (8.925) with +0.1. This matches the dependence plot in Figure 4, where extremely low values of V14 were typically correlated with the highest SHAP values.

Figures 6 | SHAP waterfalls in probability space for a false positive on the holdout set.
NOTE: Same explainer, background, and probability space as Figure 4.
Figures 7 | SHAP waterfalls in probability space for a false negative on the holdout set.
NOTE: Same explainer, background, and probability space as Figure 4.

Figures 6 and 7 both show waterfall plots for instances where the model incorrectly identified a legitimate or fraudulent transaction. Figure 6 illustrates a false-positive instance while Figure 6 illustrates a false-negative instance. Both start with a baseline probability of E[f(X)] = 0.005. The false positive instance in Figure 6 ends with a final fraud probability of 1. Again, like the true positive instance in Figure 5, V14 (-7.11), V12 (-7.105), V10 (-5.622) most influenced the model’s final decision, contributing +0.43, +0.16, and +0.14 to the final fraud probability. This false positive instance showed similar, extremely low V14, V12, and V10 values as the true positive instance in Figure 5, causing the model to incorrectly classify it as fraudulent.

On the contrary, the false-negative instance in Figure 7 ends with a final fraud probability of 0. V14 (0.984), V11 (-1.475), and V10 (2.689) contribute the most to bringing the final probability down to zero, although even they contribute very little. This false negative instance does not have an extremely low V14 value, so unlike Figures 5 and 6, the model classifies this as a legitimate transaction even though it is fraudulent.

Discussion

XGBoost had a statistically significant improvement in threshold-free ranking when compared to Logistic Regression. It achieved a nested-CV PR-AUC of 0.8504 ± 0.0332 and a holdout PR-AUC of 0.8107. Logistic Regression only achieved a nested-CV PR-AUC of 0.7413 ± 0.0283 and a holdout PR-AUC of 0.6929. This was the only difference that passed the Nadeau-Bengio corrected t-test and Holm adjustment. XGBoost ordered the rare fraudulent transactions more effectively than Logistic Regression, making it easier to correctly predict fraudulent cases when ranked by predicted fraud probability.

While PR-AUC passed significance testing, other metrics, which were evaluated on the fixed F1 threshold, did not. XGBoost achieved a precision of 0.986, a recall of 0.726, and an F1 score of 0.836. Logistic Regression, on the other hand, achieved a slightly lower precision and F1 score at 0.878 and 0.814, but also achieved a slightly higher recall at 0.758. XGBoost also had 69 true positives and 1 false positive vs. Logistic Regression’s 72 true positives and 10 false positives. This means that while Logistic Regression identified 3 more fraudulent transactions than XGBoost, it also falsely identified 9 more legitimate transactions as fraudulent. However, the differences in these metrics did not pass Holm adjustment, so they cannot be considered statistically significant. While a bank may still choose to use XGBoost due to preferences, this was not confirmed by the differences in the threshold-dependent metrics.

A few PCA features – V14 (0.019819), V12 (0.008230), V4 (0.007438), and V10 (0.006822) – contributed most to the model’s final predicted fraud probability. However, the SHAP dependence plot in Figure 4 showed that V14 only truly mattered when it is extremely negative. V14 values greater than -5 contribute almost zero to the final fraud probability. Figures 5 and 6 show this pattern with extreme negative values of V14. Both the true positive instance in Figure and the false positive instance in Figure showed extremely low values of V14, causing the model to incorrectly label the legitimate transaction in Figure 6 as fraudulent because it shares similar patterns to the actually fraudulent one in Figure 5. On the contrary, the false negative instance in Figure 7 didnt have a low value of V14, so even though it was fraudulent, it classified it as legitimate.

However, there are some limitations that must be acknowledged. The dataset was created in 2013, meaning it might not be able to fully represent modern credit card fraud. The dataset also only considered two days of transactions, so seasonal changes cannot be considered. 28 of the features (V1-V28) were also anonymized via PCA, meaning that we cannot accurately interpret each feature. Additionally, while SMOTE was used, it was manually chosen in advance, not picked using an ablation study, so there might be other techniques that could have fared better for this paper. To add to this, Figures 5 and 7 show the “loudest” true positive and the “quietest” false negative, not every scenario. Since there was also only 1 false positive for XGBoost, the SHAP waterfall plot in Figure 6 is the only false positive. In conclusion, XGBoost showed significant increases in PR-AUC, but improvements in F1, precision, recall, and FPR at a fixed threshold were not sufficiently supported.

Acknowledgements

I would like to thank Dr. Ganesh Mani (Carnegie Mellon University) for mentorship guidance during the development of this paper.

Data and Code Availability

The source code can be found in this GitHub Repository: https://github.com/MegaMonster799/creditcard-fraud-xai 

Appendix A

MetricFold 1Fold 2Fold 3Fold 4Fold 5
PR-AUC (XGBoost)0.82650.87150.80370.87680.8733
PR-AUC (Logistic)0.75080.73050.69690.76370.7644
PR-AUC (XGB – LR)0.07570.14100.10680.11310.1089
F1 Score (XGBoost)0.84210.88730.81160.86110.8800
F1-Score (Logistic)0.82610.80290.73680.82050.8497
F1-Score(XGB – LR)0.01600.08440.07480.04060.0303
Precision (XGBoost)0.96550.94030.90320.91180.8919
Precision (Logistic)0.90480.88710.85960.80000.8442
Precision (XGB – LR)0.06080.05320.04360.11180.0477
Recall (XGBoost)0.74670.84000.73680.81580.8684
Recall (Logistic)0.76000.73330.64470.84210.8553
Recall (XGB – LR)-0.01330.10670.0921-0.02630.0132
FPR (XGBoost)0.0000440.0000880.0001320.0001320.000177
FPR (Logistic)0.0001320.0001540.0001770.0003530.000265
FPR (XGB – LR)-0.000088-0.000066-0.000044-0.000221-0.000088
Balanced Acc. (XGBoost)0.87330.92000.86840.90780.9341
Balanced Acc. (Logistic)0.87990.86660.82230.92090.9275
Balanced Acc. (XGB – LR)-0.00660.05340.0461-0.01300.0066

References

  1. Whitty, M. T. Card-not-present fraud: using crime scripts to inform crime prevention initiatives. https://doi.org/10.1057/s41284-022-00359-w, 2022. [↩]
  2. S. Höppner, B. Baesens, W. Verbeke, T. Verdonck. Instance-dependent cost-sensitive learning for detecting transfer fraud. https://doi.org/10.1016/j.ejor.2021.05.028, 2022. [↩]
  3. D. Almhaithawi, A. Jafar, M. Aljnidi. Example-dependent cost-sensitive credit cards fraud detection using SMOTE and Bayes minimum risk. https://doi.org/10.1007/s42452-020-03375-w, 2020. [↩]
  4. V. Ngoc Thanh Sang. Enhancing credit card fraud detection under severe class imbalance using cost-sensitive learning and threshold optimization. https://doi.org/10.4108/eetismla.12078, 2026. [↩]
  5. M. A. Islam, M. A. Uddin, S. Aryal, G. Stea. An ensemble learning approach for anomaly detection in credit card data with imbalanced and overlapped classes. https://doi.org/10.1016/j.jisa.2023.103618, 2023. [↩]
  6. K. Randhawa, C. K. Loo, M. Seera, C. P. Lim, A. K. Nandi. Credit card fraud detection using AdaBoost and majority voting. https://doi.org/10.1109/access.2018.2806420, 2018. [↩]
  7. X. Zhao, Y. Liu, Q. Zhao. Improved LightGBM for extremely imbalanced data and application to credit card fraud detection. https://doi.org/10.1109/access.2024.3487212, 2024. [↩]
  8. V. Suryanarayana, K. Maddileti, D. Satyanarayana, R. L. Jyothi, K. Sreekanth, P. Mande, R. N. Miriyala, O. Sudhakar. An efficient implementation of credit card fraud detection using CatBoost algorithm. https://doi.org/10.11591/ijeecs.v38.i3.pp1914-1923, 2025. [↩]
  9. F. K. Alarfaj, I. Malik, H. U. Khan, N. Almusallam, M. Ramzan, M. Ahmed. Credit card fraud detection using state-of-the-art machine learning and deep learning algorithms. https://doi.org/10.1109/ACCESS.2022.3166891, 2022. [↩]
  10. Gamal, N., Younis, E. M. G., Makram, W. M. Enhancing credit card fraud detection with a hybrid approach using machine and deep learning. https://doi.org/10.1038/s41598-026-42891-4, 2026. [↩]
  11. A. Al-Bulushi, A. K. Shaikh, N. Adhikari. Applying supervised machine learning algorithms and ensemble models to enhance credit card fraud detection. https://doi.org/10.3389/frai.2026.1813728, 2026. [↩]
  12. S. F. Farabi, M. Prabha, M. Alam, M. Z. Hossan, M. Arif, M. R. Islam, A. Uddin, M. Bhuiyan, M. Z. A. Biswas. Enhancing credit card fraud detection: A comprehensive study of machine learning algorithms and performance evaluation. https://doi.org/10.32996/jbms.2024.6.13.21, 2024. [↩]
  13. P. Tiwari, S. Mehta, N. Sakhuja, J. Kumar, A. K. Singh. Credit card fraud detection using machine learning: A study. https://doi.org/10.48550/arXiv.2108.10005, 2021. [↩]
  14. R. Praba, G. Darshan, K. T. Roshanraj, B. Surya Prakash. Study on machine learning algorithms. https://doi.org/10.32628/CSEIT2173105, 2021. [↩]
  15. S. Motie, B. Raahemi. Financial fraud detection using graph neural networks: A systematic review. https://doi.org/10.1016/j.eswa.2023.122156, 2023. [↩]
  16. D. Cheng, Y. Zou, S. Xiang, C. Jiang. Graph neural networks for financial fraud detection: A review. https://doi.org/10.1007/s11704-024-40474-y, 2025. [↩]
  17. A. Cherif, H. Ammar, M. Kalkatawi, S. Alshehri, A. Imine. Encoder-decoder graph neural network for credit card fraud detection. https://doi.org/10.1016/j.jksuci.2024.102003, 2024. [↩]
  18. S. Wei, S. Lee. Internet fraud transaction detection based on temporal-aware heterogeneous graph oversampling and attention fusion network. https://doi.org/10.1371/journal.pone.0337208, 2025. [↩]
  19. D. Wang, J. Lin, P. Cui, Q. Jia, Z. Wang, Y. Fang, Q. Yu, J. Zhou, S. Yang, Y. Qi. A semi-supervised graph attentive network for financial fraud detection. https://doi.org/10.1109/ICDM.2019.00070, 2019. [↩]
  20. B. Wu, K. M. Chao, Y. Li. Heterogeneous graph neural networks for fraud detection and explanation in supply chain finance. https://doi.org/10.1016/j.is.2023.102335, 2024. [↩]
  21. S. Ghosh, R. L. Anand, T. Bhowmik, S. Chandrashekhar. GoSage: Heterogeneous graph neural network using hierarchical attention for collusion fraud detection. https://doi.org/10.1145/3604237.3626856, 2023. [↩]
  22. I. Benchaji, S. Douzi, B. El Ouahidi. Credit card fraud detection model based on LSTM recurrent neural networks. https://doi.org/10.12720/jait.12.2.113-118, 2021. [↩]
  23. I. Benchaji, S. Douzi, B. El Ouahidi, J. Jaafari. Enhanced credit card fraud detection based on attention mechanism and LSTM deep model. https://doi.org/10.1186/s40537-021-00541-8, 2021. [↩]
  24. K. EL Hachimi, G. Orhanou, L. Ballihi. Credit card fraud detection model based on optimized long short-term memory: Imbalanced class solution and overfitting reduction. https://doi.org/10.1016/j.eswa.2025.130871, 2026. [↩]
  25. C. Yu, Y. Xu, J. Cao, Y. Zhang, Y. Jin, M. Zhu. Credit card fraud detection using advanced transformer model. https://doi.org/10.1109/metacom62920.2024.00064, 2024. [↩]
  26. T. Deng, S. Bi, J. Xiao. Transformer-based financial fraud detection with cloud-optimized real-time streaming. https://doi.org/10.1145/3724154.3724271, 2024. [↩]
  27. H. Fanai, H. Abbasimehr. A novel combined approach based on deep autoencoder and deep classifiers for credit card fraud detection. https://doi.org/10.1016/j.eswa.2023.119562, 2023. [↩]
  28. Q. Bao, J. Wang, H. Gong, Y. Zhang, X. Guo, H. Feng. A deep learning approach to anomaly detection in high-frequency trading data. https://doi.org/10.1109/iscait64916.2025.11010680, 2025. [↩]
  29. C. Rudin. Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. https://doi.org/10.1038/s42256-019-0048-x, 2019. [↩]
  30. N. Bussmann, P. Giudici, D. Marinelli, J. Papenbrock. Explainable machine learning in credit risk management. https://doi.org/10.1007/s10614-020-10042-0, 2020. [↩]
  31. R. Bahlool, N. Hewahi, W. Elmedany. Performance, fairness, and explainability in AI-based credit scoring: A systematic literature review. https://doi.org/10.3390/jrfm19020104, 2026. [↩]
  32. A. Kumiega, R. Xu. Governing the tradeoff between predictive accuracy and adversarial robustness: An enterprise model risk framework. https://doi.org/10.3390/risks14080184, 2026. [↩]
  33. A. Dal Pozzolo, O. Caelen, R. A. Johnson, G. Bontempi. Calibrating probability with undersampling for unbalanced classification. https://doi.org/10.1109/SSCI.2015.33, 2015. [↩]
  34. N. V. Chawla, K. W. Bowyer, L. O. Hall, W. P. Kegelmeyer. SMOTE: Synthetic minority over-sampling technique. https://doi.org/10.1613/jair.953, 2002. [↩]
  35. S. M. Lundberg, S.-I. Lee. A unified approach to interpreting model predictions. https://doi.org/10.48550/arXiv.1705.07874, 2017. [↩]

LEAVE A REPLY

Please enter your comment!
Please enter your name here