<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" article-type="research-article" dtd-version="2.3" xml:lang="EN">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Artif. Intell.</journal-id>
<journal-title>Frontiers in Artificial Intelligence</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Artif. Intell.</abbrev-journal-title>
<issn pub-type="epub">2624-8212</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.3389/frai.2025.1643292</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Artificial Intelligence</subject>
<subj-group>
<subject>Original Research</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Enhancing credit card fraud detection using traditional and deep learning models with class imbalance mitigation</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<name>
<surname>Albalawi</surname>
<given-names>Tahani</given-names>
</name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<role content-type="https://credit.niso.org/contributor-roles/formal-analysis/"/>
<role content-type="https://credit.niso.org/contributor-roles/resources/"/>
<role content-type="https://credit.niso.org/contributor-roles/funding-acquisition/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/data-curation/"/>
<role content-type="https://credit.niso.org/contributor-roles/conceptualization/"/>
</contrib>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>Dardouri</surname>
<given-names>Samia</given-names>
</name>
<xref ref-type="aff" rid="aff1"><sup>1</sup></xref>
<xref ref-type="aff" rid="aff2"><sup>2</sup></xref>
<xref ref-type="corresp" rid="c001"><sup>&#x002A;</sup></xref>
<uri xlink:href="https://loop.frontiersin.org/people/2932455/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/validation/"/>
<role content-type="https://credit.niso.org/contributor-roles/formal-analysis/"/>
<role content-type="https://credit.niso.org/contributor-roles/supervision/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-review-editing/"/>
<role content-type="https://credit.niso.org/contributor-roles/project-administration/"/>
<role content-type="https://credit.niso.org/contributor-roles/investigation/"/>
<role content-type="https://credit.niso.org/contributor-roles/visualization/"/>
</contrib>
</contrib-group>
<aff id="aff1"><sup>1</sup><institution>Department of Computer Science, College of Computing and Information Technology, Shaqra University</institution>, <addr-line>Shaqra</addr-line>, <country>Saudi Arabia</country></aff>
<aff id="aff2"><sup>2</sup><institution>InnoV'COM Laboratory-Sup'Com, University of Carthage</institution>, <addr-line>Ariana</addr-line>, <country>Tunisia</country></aff>
<author-notes>
<fn fn-type="edited-by" id="fn0001">
<p>Edited by: <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/669553/overview">Arianna Agosto</ext-link>, University of Pavia, Italy</p>
</fn>
<fn fn-type="edited-by" id="fn0002">
<p>Reviewed by: <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/2323206/overview">Sabina Rossi</ext-link>, Ca&#x2019; Foscari University of Venice, Italy</p>
<p><ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/2432538/overview">Shahzad Ashraf</ext-link>, Gachon University, Republic of Korea</p>
</fn>
<corresp id="c001">&#x002A;Correspondence: Samia Dardouri, <email>s.dardouri@su.edu.sa</email></corresp>
</author-notes>
<pub-date pub-type="epub">
<day>08</day>
<month>10</month>
<year>2025</year>
</pub-date>
<pub-date pub-type="collection">
<year>2025</year>
</pub-date>
<volume>8</volume>
<elocation-id>1643292</elocation-id>
<history>
<date date-type="received">
<day>11</day>
<month>06</month>
<year>2025</year>
</date>
<date date-type="accepted">
<day>15</day>
<month>09</month>
<year>2025</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#x00A9; 2025 Albalawi and Dardouri.</copyright-statement>
<copyright-year>2025</copyright-year>
<copyright-holder>Albalawi and Dardouri</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p>
</license>
</permissions>
<abstract>
<sec>
<title>Introduction</title>
<p>The growing complexity of fraudulent activities presents significant challenges in detecting fraud within financial transactions. Accurate and robust detection methods are essential for minimizing financial losses.</p>
</sec>
<sec>
<title>Methods</title>
<p>This study evaluates logistic regression, decision tree, and random forest models on real-world credit card datasets, addressing class imbalance and enhancing predictive accuracy. A deep learning model incorporating focal loss was developed to further improve detection performance. The Synthetic Minority Over-Sampling Technique (SMOTE) was applied to mitigate class imbalance, and hyperparameter tuning was conducted to optimize model configurations.</p>
</sec>
<sec>
<title>Results</title>
<p>Experimental results show that the random forest model achieved the best overall performance, with an accuracy of 99.95%, F1 score of 0.8256, and ROC-AUC of 0.9759. The deep learning model provided the highest precision, demonstrating its potential in minimizing false positives.</p>
</sec>
<sec>
<title>Discussion</title>
<p>A key novelty of this work is the integration of focal loss within the deep learning framework, enabling the model to focus on hard-to-classify fraudulent transactions. Unlike many prior studies limited to the Kaggle dataset, our approach was validated on both the Kaggle credit card dataset and the PaySim synthetic mobile money dataset, demonstrating robustness and cross-domain generalizability. These findings highlight the effectiveness of combining data preprocessing, resampling techniques, and model optimization for robust fraud detection.</p>
</sec>
</abstract>
<kwd-group>
<kwd>credit card fraud detection</kwd>
<kwd>imbalanced data</kwd>
<kwd>machine learning</kwd>
<kwd>logistic regression</kwd>
<kwd>decision tree</kwd>
<kwd>random forest</kwd>
<kwd>deep learning</kwd>
<kwd>SMOTE</kwd>
</kwd-group>
<counts>
<fig-count count="6"/>
<table-count count="5"/>
<equation-count count="3"/>
<ref-count count="24"/>
<page-count count="10"/>
<word-count count="6340"/>
</counts>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>AI in Finance</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec sec-type="intro" id="sec1">
<label>1</label>
<title>Introduction</title>
<p>Detecting fraudulent activities in financial transactions has become increasingly challenging due to the growing complexity and sophistication of fraud schemes (<xref ref-type="bibr" rid="ref24">Talukder et al., 2024</xref>; <xref ref-type="bibr" rid="ref8">Dou et al., 2020</xref>). The rise in both virtual and physical payment platforms has contributed to a surge in fraud cases, causing substantial financial losses to individuals and organizations. In 2022, for instance, individuals in the United States reported losing over $8.8 billion to fraud&#x2014;an increase of 30% from the previous year, as reported by the Federal Trade Commission (FTC) (<xref ref-type="bibr" rid="ref11">Innan et al., 2023</xref>). As a result, financial institutions and businesses are under increasing pressure to enhance the accuracy and efficiency of fraud detection systems in order to mitigate losses and protect consumers (<xref ref-type="bibr" rid="ref7">Chy, 2024</xref>; <xref ref-type="bibr" rid="ref6">Chen et al., 2025</xref>; <xref ref-type="bibr" rid="ref5">Chen et al., 2020</xref>).</p>
<p>Machine learning (ML) has become a critical tool for analyzing large volumes of financial transaction data to detect patterns of fraudulent behavior (<xref ref-type="bibr" rid="ref13">Ismail and Khorsheed, 2023</xref>; <xref ref-type="bibr" rid="ref1">Ali et al., 2022</xref>; <xref ref-type="bibr" rid="ref14">Jha et al., 2012</xref>). Unlike traditional statistical methods, ML algorithms can uncover complex, nonlinear relationships and adapt to evolving fraud tactics over time (<xref ref-type="bibr" rid="ref21">Shah and Sharma, 2023</xref>; <xref ref-type="bibr" rid="ref18">Manorom et al., 2024</xref>). Classification models such as Logistic Regression, Decision Trees, and Random Forests have shown promise in identifying hidden patterns and anomalies within financial data (<xref ref-type="bibr" rid="ref9">Hashemi et al., 2023</xref>; <xref ref-type="bibr" rid="ref16">Kumar et al., 2020</xref>; <xref ref-type="bibr" rid="ref10">Hernandez Aros et al., 2024</xref>). These models have become increasingly effective in real-time and large-scale fraud detection scenarios (<xref ref-type="bibr" rid="ref3">Borketey, 2024</xref>; <xref ref-type="bibr" rid="ref20">Salunke et al., 2025</xref>).</p>
<p>A key challenge in fraud detection, however, is the severe class imbalance problem, where legitimate transactions vastly outnumber fraudulent ones (<xref ref-type="bibr" rid="ref22">Sopiyan et al., 2022</xref>; <xref ref-type="bibr" rid="ref16">Kumar et al., 2020</xref>). This imbalance often results in biased models that fail to detect minority-class instances effectively. To address this, the Synthetic Minority Over-sampling Technique (SMOTE) has been widely used to generate synthetic examples from the fraud class, thereby balancing the dataset and improving model learning (<xref ref-type="bibr" rid="ref4">Btoush et al., 2025</xref>; <xref ref-type="bibr" rid="ref25">Baisholan et al., 2025</xref>).</p>
<p>In this study, SMOTE is employed to enhance the performance of three classification models&#x2014;Logistic Regression, Decision Tree, and Random Forest&#x2014;on a real-world credit card fraud dataset. A deep learning model using focal loss is also implemented to prioritize hard-to-classify fraudulent transactions (<xref ref-type="bibr" rid="ref12">Islam et al., 2023</xref>; <xref ref-type="bibr" rid="ref23">Strelcenia and Prakoonwit, 2023</xref>). Each model is optimized using hyperparameter tuning, and performance is evaluated using standard metrics, including precision, recall, F1 score, accuracy, and the ROC-AUC curve (<xref ref-type="bibr" rid="ref15">Khalid et al., 2024</xref>; <xref ref-type="bibr" rid="ref2">Bhattacharyya et al., 2011</xref>).</p>
</sec>
<sec id="sec2">
<label>2</label>
<title>Related works</title>
<p>Recent advancements in credit card fraud detection have extensively explored both traditional machine learning (ML) and deep learning (DL) approaches, often incorporating techniques to mitigate data imbalance. <xref ref-type="bibr" rid="ref24">Talukder et al. (2024)</xref> proposed a hybrid ensemble model combining Iterative Hard Thresholding with Logistic Regression (IHT-LR) and grid search to improve transaction security. Similarly, (<xref ref-type="bibr" rid="ref8">Dou et al., 2020</xref>) investigated the robustness of graph neural networks against camouflaged fraudsters, highlighting the value of relational modeling in fraud detection.</p>
<p>To address the challenges posed by imbalanced datasets, (<xref ref-type="bibr" rid="ref11">Innan et al., 2023</xref>) introduced quantum machine learning models and demonstrated their potential in financial fraud contexts. <xref ref-type="bibr" rid="ref7">Chy (2024)</xref> and <xref ref-type="bibr" rid="ref13">Ismail and Khorsheed (2023)</xref> both emphasized the effectiveness of supervised learning techniques such as decision trees and logistic regression in classifying fraudulent transactions. Additionally, <xref ref-type="bibr" rid="ref1">Ali et al. (2022)</xref> presented a comprehensive review of ML-based financial fraud detection frameworks, identifying ensemble methods as particularly effective.</p>
<p>Literature reviews such as those by (<xref ref-type="bibr" rid="ref6">Chen et al., 2025</xref>) and (<xref ref-type="bibr" rid="ref10">Hernandez Aros et al., 2024</xref>) provide a systematic overview of DL applications in fraud detection, noting that performance is strongly influenced by feature quality and model robustness. Furthermore, <xref ref-type="bibr" rid="ref21">Shah and Sharma (2023)</xref> and <xref ref-type="bibr" rid="ref20">Salunke et al. (2025)</xref> demonstrated that ensemble methods, such as combining decision trees, random forests, and logistic regression, consistently outperform standalone models.</p>
<p>Imbalanced learning strategies are another critical area of development. <xref ref-type="bibr" rid="ref9">Hashemi et al. (2023)</xref> and <xref ref-type="bibr" rid="ref3">Borketey (2024)</xref> proposed real-time fraud detection systems using ML algorithms in combination with resampling and feature selection. Meanwhile, recent studies have shown how data augmentation (<xref ref-type="bibr" rid="ref15">Khalid et al., 2024</xref>), federated learning, and hybrid ML-DL approaches (<xref ref-type="bibr" rid="ref4">Btoush et al., 2025</xref>; <xref ref-type="bibr" rid="ref2">Bhattacharyya et al., 2011</xref>) can further improve accuracy and generalizability across diverse datasets.</p>
<p>Other works, such as <xref ref-type="bibr" rid="ref18">Manorom et al. (2024)</xref> and <xref ref-type="bibr" rid="ref16">Kumar et al. (2020)</xref>, explored comparative analyses of various algorithms, showing the utility of random forest and support vector machines in high-dimensional transaction data. <xref ref-type="bibr" rid="ref25">Baisholan et al. (2025)</xref>, <xref ref-type="bibr" rid="ref12">Islam et al. (2023)</xref>, and <xref ref-type="bibr" rid="ref23">Strelcenia and Prakoonwit (2023)</xref> emphasized ensemble techniques and anomaly detection strategies tailored for overlapping and minority classes in credit card datasets.</p>
<p>In this study, we extend prior research by incorporating the Synthetic Minority Over-sampling Technique (SMOTE) to address the significant class imbalance typically observed in credit card fraud datasets. We perform a systematic evaluation of Logistic Regression, Decision Tree, and Random Forest models on a real-world transaction dataset, focusing on improving predictive accuracy and model robustness. To further enhance detection performance, we develop a deep learning model that integrates focal loss, enabling the model to focus on harder-to-classify fraudulent cases. Additionally, we apply hyperparameter tuning to optimize each model&#x2019;s configuration, ensuring a fair and rigorous comparison across both traditional and deep learning approaches. Beyond traditional ensemble methods and imbalance mitigation strategies, several recent directions in fraud detection research are noteworthy. Graph neural networks (GNNs) have been increasingly applied to capture relational dependencies between entities, enabling the detection of fraud rings and collusive behaviors that cannot be identified through transaction-level analysis alone. In parallel, federated learning frameworks have emerged as a promising avenue for privacy-preserving fraud detection, allowing multiple financial institutions to collaboratively train models without sharing sensitive data. Another innovative line of research is the integration of AI with blockchain technologies, which enhances both transparency and traceability of financial transactions. For instance, <xref ref-type="bibr" rid="ref19">Ressi et al. (2024)</xref> provide a comprehensive review of AI-enhanced blockchain frameworks for fraud detection and monitoring, highlighting their potential to improve security and auditability in decentralized systems. These directions represent important complementary approaches that future work can integrate with imbalance mitigation and deep learning strategies for more comprehensive fraud detection systems.</p>
</sec>
<sec sec-type="materials|methods" id="sec3">
<label>3</label>
<title>Materials and methods</title>
<p>The goal of credit card fraud detection based on machine learning is to judge whether a credit card transaction is legal or fraudulent accurately and quickly. In this section, we analyze how to preprocess the input data and select Light Gradient Boosting Machine algorithm to establish Light GBM model.</p>
<sec id="sec4">
<label>3.1</label>
<title>Dataset description</title>
<p>The dataset used in this study is the Credit Card Fraud Detection Dataset sourced from Kaggle. <xref ref-type="table" rid="tab1">Table 1</xref> presents the distribution of fraudulent and non-fraudulent transactions in the dataset, highlighting a significant class imbalance. It consists of 284,807 transactions, with 492 fraudulent cases, representing only 0.17% of the total. The dataset is anonymized using Principal Component Analysis (PCA) and includes 30 features: V1 to V28, Time, and Amount. The class label Class indicates whether a transaction is fraudulent (1) or not (0).</p>
<table-wrap position="float" id="tab1">
<label>Table 1</label>
<caption>
<p>Distribution of fraudulent and non-fraudulent transactions.</p>
</caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th align="left" valign="top">Class</th>
<th align="center" valign="top">Number of transaction</th>
<th align="center" valign="top">Percentage</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top">Non -fraud<break/>Fraud</td>
<td align="center" valign="top">284,315<break/>492</td>
<td align="center" valign="top">99.83%<break/>0.17%</td>
</tr>
</tbody>
</table>
</table-wrap>
<p><xref ref-type="fig" rid="fig1">Figure 1</xref> illustrates the distribution of transaction amounts for fraudulent and normal transactions. The top histogram shows that fraudulent transactions are predominantly low in value, with the majority concentrated below $500 and very few exceeding $1,000. In contrast, the bottom histogram reveals that normal transactions span a broader range of amounts, including many high-value transactions up to over $25,000. This stark difference highlights the tendency of fraudsters to use smaller amounts to evade detection. The use of a logarithmic scale further emphasizes the rarity of high-value transactions in both categories. These patterns suggest that transaction amount is a critical feature for distinguishing between fraudulent and legitimate activity.</p>
<fig position="float" id="fig1">
<label>Figure 1</label>
<caption>
<p>The relation between fraud and amount.</p>
</caption>
<graphic xlink:href="frai-08-1643292-g001.tif" mimetype="image" mime-subtype="tiff">
<alt-text content-type="machine-generated">Two histograms comparing transaction amounts for fraud and normal cases. The fraud histogram shows a high frequency of small amounts below five hundred dollars. The normal histogram shows a wider distribution with most transactions under ten thousand dollars.</alt-text>
</graphic>
</fig>
<p>To further validate this observation, we conducted a statistical analysis of the relationship between transaction amount and fraud occurrence. Descriptive statistics and correlation analysis were first employed to identify underlying patterns. Given the non-normal distribution of transaction amounts, the Mann Whitney U test was applied to assess whether the differences in transaction amounts between fraudulent and legitimate transactions were statistically significant. The test confirmed a significant difference (<italic>p</italic>&#x202F;&#x003C;&#x202F;0.05), reinforcing the utility of transaction amount as a discriminative feature in fraud detection.</p>
</sec>
<sec id="sec5">
<label>3.2</label>
<title>Methodology</title>
<p>This study follows a systematic pipeline for credit card fraud detection, beginning with data preprocessing and culminating in model training and evaluation. <xref ref-type="fig" rid="fig2">Figure 2</xref> presents the overall workflow.</p>
<fig position="float" id="fig2">
<label>Figure 2</label>
<caption>
<p>Proposed methodology.</p>
</caption>
<graphic xlink:href="frai-08-1643292-g002.tif" mimetype="image" mime-subtype="tiff">
<alt-text content-type="machine-generated">Flowchart illustrating a machine learning process. Steps include: Data Preprocessing with duplicate removal, handling missing values, feature scaling, and selection; Handling class imbalance using SMOTE; Model Training with logistic regression, decision tree, and random forest; Model Evaluation with hyperparameter tuning.</alt-text>
</graphic>
</fig>
<p>Each step in the proposed methodology plays a critical role in enhancing the overall performance and reliability of the credit card fraud detection system. The pipeline begins with data preprocessing, where duplicate records are removed, missing values are handled, and features are standardized and selected. This step ensures data quality, consistency, and improved learning efficiency by eliminating noise and irrelevant attributes.</p>
<p>Next, class imbalance handling is addressed using SMOTE, which synthetically generates minority class samples to balance the dataset. This prevents the model from being biased toward the majority (non-fraudulent) class and enhances its ability to detect rare fraudulent transactions.</p>
<p>The model training phase involves the use of three supervised learning algorithms&#x2014;Logistic Regression, Decision Tree, and Random Forest&#x2014;each offering distinct decision-making capabilities. This diversity allows for a comprehensive comparison of algorithmic behavior on the imbalanced dataset.</p>
<p>Finally, model evaluation through hyperparameter tuning ensures that each algorithm operates under optimal conditions, thereby maximizing predictive accuracy and generalization. The integration of these steps results in a robust, balanced, and high-performing fraud detection framework.</p>
<sec id="sec6">
<label>3.2.1</label>
<title>Data preprocessing</title>
<p>Preprocessing was a critical step to ensure the quality and consistency of the input data:</p>
<list list-type="bullet">
<list-item><p>Duplicate Removal: Duplicate transaction records were identified and removed, reducing the dataset from 284,807 to 283,726 transactions. This ensured that the models were trained on unique, independent samples.</p></list-item>
<list-item><p>Handling Missing Values: A thorough inspection confirmed the absence of missing values, maintaining data integrity and simplifying preprocessing.</p></list-item>
<list-item><p>Feature Scaling: The dataset contains features with varied numerical scales (e.g., transaction amounts and PCA components). All features were standardized using the StandardScaler from Scikit-learn to ensure equal treatment during model training, especially for distance-based models.</p></list-item>
<list-item><p>Feature Selection: Correlation analysis and feature importance scores from tree-based models were used to eliminate redundant or irrelevant features, thereby reducing dimensionality and improving model efficiency.</p></list-item>
</list>
<p>To address the class imbalance in the dataset, we applied the Synthetic Minority Over-sampling Technique (SMOTE), which generates synthetic minority class samples based on the feature-space similarities of nearest neighbors. Unlike random over-sampling, SMOTE avoids simple duplication and helps reduce the risk of overfitting. Its effectiveness was evaluated by comparing model performance before and after resampling, with particular attention to recall and F1 score&#x2014;two key metrics for assessing fraud detection performance. The application of SMOTE led to a significant improvement in recall, indicating enhanced sensitivity to the minority (fraudulent) class. Alternative resampling strategies such as random under-sampling, Tomek links, and ADASYN were initially explored. However, SMOTE achieved the best balance between improving minority class recall and maintaining model generalization across classifiers. This approach was consistently integrated into our preprocessing pipeline prior to training.</p>
</sec>
<sec id="sec7">
<label>3.2.2</label>
<title>Class imbalance handling via SMOTE</title>
<p>Due to the dataset&#x2019;s significant class imbalance, where fraudulent transactions comprised only 0.17% of the data, the Synthetic Minority Over-sampling Technique (SMOTE) was applied to enhance model performance. Unlike simple duplication, SMOTE generates synthetic samples by interpolating between existing minority class instances and their k&#x202F;=&#x202F;5 nearest neighbors, effectively expanding the decision boundary and enabling better learning of fraud patterns. Prior to oversampling, the data was cleaned by removing duplicates and normalized using a Standard Scaler. As shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>, this process resulted in a balanced training dataset containing 226,602 fraud and 226,602 non-fraud samples, achieving a 1:1 ratio. This balanced dataset significantly improved the models&#x2019; sensitivity to fraudulent transactions, reducing bias toward the majority class and enabling a more fair and effective comparative analysis of model performance.</p>
<fig position="float" id="fig3">
<label>Figure 3</label>
<caption>
<p>Comparison of class imbalance before and after SMOTE oversampling.</p>
</caption>
<graphic xlink:href="frai-08-1643292-g003.tif" mimetype="image" mime-subtype="tiff">
<alt-text content-type="machine-generated">Bar chart comparing class distribution before and after applying SMOTE. Fraud class shows approximately 200,000 samples after SMOTE, compared to a lower count before. Non-Fraud class has around 300,000 samples before SMOTE, balanced to 200,000 after.</alt-text>
</graphic>
</fig>
</sec>
</sec>
<sec id="sec8">
<label>3.3</label>
<title>Model algorithms</title>
<p>The study evaluated both traditional and deep learning models:</p>
<list list-type="bullet">
<list-item><p>Logistic Regression (LR): A linear classifier suitable for binary classification, optimized using L2 regularization.</p></list-item>
<list-item><p>Decision Tree (DT): A non-parametric model that splits the data into branches based on feature thresholds.</p></list-item>
<list-item><p>Random Forest (RF): An ensemble of Decision Trees that improves generalization and robustness.</p></list-item>
</list>
<p>Each classifier was evaluated on both the original and SMOTE-balanced datasets. In addition to these traditional models, a deep learning model was developed, incorporating:</p>
<list list-type="bullet">
<list-item><p>Fully connected (dense) layers.</p></list-item>
<list-item><p>Batch normalization and dropout for regularization.</p></list-item>
<list-item><p>Focal loss, which down-weights easy examples and emphasizes harder-to-classify fraud cases.</p></list-item>
<list-item><p>Early stopping and learning rate reduction to enhance training stability and avoid overfitting.</p></list-item>
</list>
<p>We selected Logistic Regression, Decision Tree, and Random Forest models due to their complementary strengths and frequent use as strong baselines in fraud detection studies. Logistic Regression provides a simple and interpretable baseline, Decision Trees capture non-linear feature interactions, and Random Forests offer robust ensemble-based classification. These models combine interpretability, efficiency, and reliability, making them suitable starting points for systematic evaluation. In addition to these classical models, we also incorporated XGBoost, a gradient boosting algorithm widely recognized for its strong predictive performance in financial fraud detection. While initially included as a benchmarking model, we have now systematically compared XGBoost alongside the other classifiers in the Results section to provide a more complete evaluation of traditional ensemble methods.</p>
</sec>
<sec id="sec9">
<label>3.4</label>
<title>Hyperparameter tuning and cross-validation</title>
<p>To optimize the performance of the machine learning models, we performed hyperparameter tuning using a grid search strategy. For each model, we defined a range of relevant hyperparameters based on prior literature and preliminary experiments. The hyperparameters and their search ranges for each model are illustrated in <xref ref-type="table" rid="tab2">Table 2</xref>. This configuration was used during grid search combined with 5-fold stratified cross-validation to identify optimal model settings.</p>
<table-wrap position="float" id="tab2">
<label>Table 2</label>
<caption>
<p>Hyperparameter search space for grid search tuning.</p>
</caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th align="left" valign="top">Model</th>
<th align="center" valign="top">Hyperparameters</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top" rowspan="3">Logistic regression</td>
<td align="center" valign="top">C: [0.01, 0.1, 1, 10]</td>
</tr>
<tr>
<td align="center" valign="top">Penalty: [&#x2018;l1&#x2019;, &#x2018;l2&#x2019;]</td>
</tr>
<tr>
<td align="center" valign="top">Solver: [&#x2018;liblinear&#x2019;]</td>
</tr>
<tr>
<td align="left" valign="top" rowspan="3">Decision tree</td>
<td align="center" valign="top">Max_depth: [5, 10, 20, None]</td>
</tr>
<tr>
<td align="center" valign="top">Min_samples_split: [2, 5, 10]</td>
</tr>
<tr>
<td align="center" valign="top">Min_samples_leaf: [1, 2, 4]</td>
</tr>
<tr>
<td align="left" valign="top" rowspan="4">Random forest</td>
<td align="center" valign="top">N_estimators: [50, 100, 200]</td>
</tr>
<tr>
<td align="center" valign="top">Max_depth: [10, 20, None]</td>
</tr>
<tr>
<td align="center" valign="top">Min_samples_split: [2, 5]</td>
</tr>
<tr>
<td align="center" valign="top">Min_samples_leaf: [1, 2]</td>
</tr>
<tr>
<td align="left" valign="top" rowspan="4">XGBoost</td>
<td align="center" valign="top">N_estimators: [50, 100, 150, 200]</td>
</tr>
<tr>
<td align="center" valign="top">Max_depth: [3, 5, 7, 9]</td>
</tr>
<tr>
<td align="center" valign="top">Learning_rate: [0.01, 0.1, 0.2]</td>
</tr>
<tr>
<td align="center" valign="top">Subsample: [0.6, 0.8, 1.0]</td>
</tr>
<tr>
<td align="left" valign="top" rowspan="5">Deep learning (Improved)</td>
<td align="center" valign="top">Layers: [3, 4, 5]</td>
</tr>
<tr>
<td align="center" valign="top">Units/layer: [64, 128, 256]</td>
</tr>
<tr>
<td align="center" valign="top">Dropout: [0.2, 0.4, 0.5]</td>
</tr>
<tr>
<td align="center" valign="top">Learning rate: [0.001, 0.0005]</td>
</tr>
<tr>
<td align="center" valign="top">Batch size: [32, 64]</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>This thorough optimization ensured fair comparison and robust model performance.</p>
</sec>
</sec>
<sec sec-type="results" id="sec10">
<label>4</label>
<title>Results and discussion</title>
<p>To enhance detection accuracy and address the challenge of class imbalance, this study implements a comprehensive framework combining traditional machine learning models with an improved deep learning architecture. This section outlines the experimental procedure, evaluation metrics, and comparative results. The dataset was preprocessed using the Synthetic Minority Over-sampling Technique (SMOTE) to balance class distribution, and stratified data splits were applied for training and evaluation to preserve class proportions. Model performance was assessed using multiple classification metrics and visualized through ROC curves and confusion matrices.</p>
<sec id="sec11">
<label>4.1</label>
<title>Evaluation metrics</title>
<p>Accuracy alone is insufficient for evaluating fraud detection models due to the inherent class imbalance in the dataset. To ensure a fair and comprehensive assessment of model performance, four key evaluation metrics were employed:</p>
<list list-type="bullet">
<list-item><p>Precision: The proportion of predicted fraud cases that are actually fraudulent, calculated as, It is given by <xref ref-type="disp-formula" rid="EQ1">Equation 1</xref>:</p></list-item></list>
<disp-formula id="EQ1">
<label>(1)</label><mml:math id="M2"><mml:mtext>Precision</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mi>TP</mml:mi><mml:mrow><mml:mi>TP</mml:mi><mml:mo>+</mml:mo><mml:mi>FP</mml:mi></mml:mrow></mml:mfrac></mml:math></disp-formula>
<list list-type="bullet">
<list-item><p>Recall: measures correctly identified positives, it is defined in <xref ref-type="disp-formula" rid="EQ2">Equation 2</xref></p></list-item></list>
<disp-formula id="EQ2">
<label>(2)</label><mml:math id="M3"><mml:mtext>Recall</mml:mtext><mml:mo>=</mml:mo><mml:mfrac><mml:mi>TP</mml:mi><mml:mrow><mml:mi>TP</mml:mi><mml:mo>+</mml:mo><mml:mi>FN</mml:mi></mml:mrow></mml:mfrac></mml:math></disp-formula>
<list list-type="bullet">
<list-item><p>F1-score: balances precision and recall, It is calculated as shown in <xref ref-type="disp-formula" rid="EQ3">Equation 3</xref></p></list-item></list>
<disp-formula id="EQ3">
<label>(3)</label><mml:math id="M4"><mml:mi mathvariant="normal">F</mml:mi><mml:mn>1</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mtext>score</mml:mtext><mml:mo>=</mml:mo><mml:mn>2</mml:mn><mml:mo>/</mml:mo><mml:mo stretchy="true">(</mml:mo><mml:mo stretchy="true">(</mml:mo><mml:mn>1</mml:mn><mml:mo>/</mml:mo><mml:mtext>Precision</mml:mtext><mml:mo stretchy="true">)</mml:mo><mml:mo>+</mml:mo><mml:mo stretchy="true">(</mml:mo><mml:mn>1</mml:mn><mml:mo>/</mml:mo><mml:mtext>Recall</mml:mtext><mml:mo stretchy="true">)</mml:mo><mml:mo stretchy="true">)</mml:mo></mml:math></disp-formula>
<list list-type="bullet">
<list-item><p>ROC-AUC: represents the model&#x2019;s ability to distinguish between fraudulent and non-fraudulent transactions across different classification thresholds. A higher AUC indicates better discriminative performance.</p></list-item>
</list>
<p>To further understand model behavior, a confusion matrix was used with the following components:</p>
<list list-type="bullet">
<list-item><p>True Positive (TP): Fraudulent transactions correctly predicted as fraud.</p></list-item>
<list-item><p>False Positive (FP): Legitimate transactions incorrectly predicted as fraud.</p></list-item>
<list-item><p>True Negative (TN): Legitimate transactions correctly predicted as non-fraud.</p></list-item>
<list-item><p>False Negative (FN): Fraudulent transactions incorrectly predicted as non-fraud.</p></list-item>
</list>
<p>These metrics were consistently applied across all models to ensure fair comparison and reliable performance evaluation.</p>
</sec>
<sec id="sec12">
<label>4.2</label>
<title>Results</title>
<p>Three classical machine learning models Logistic Regression, Decision Tree, and Random Forest were implemented and compared against a deep learning model composed of dense layers, batch normalization, and dropout layers. Hyperparameter tuning for traditional models was performed using grid search, while the deep learning model was optimized using early stopping and learning rate reduction strategies. All models were trained on the SMOTE-balanced training data and evaluated on a held-out test set. Performance was assessed using five key metrics: Accuracy, Precision, Recall, F1 Score, and ROC-AUC. The results highlight the effectiveness of the deep learning model, particularly in identifying minority class instances, and demonstrate the importance of balancing techniques and comprehensive evaluation in fraud detection tasks.</p>
<p>To better understand the classification performance, a confusion matrix was generated for each model, <xref ref-type="fig" rid="fig4">Figure 4</xref> illustrate the performance of four models; Logistic Regression, Decision Tree, Random Forest, and an Improved Deep Learning model in detecting fraudulent transactions. Logistic Regression achieved perfect recall by identifying all fraud cases but produced a high number of false positives (50), resulting in low precision. The Decision Tree model showed balanced performance with only one missed fraud case and minimal false positives. Random Forest achieved perfect recall with fewer false positives (11), reflecting a strong balance between sensitivity and specificity. The Improved Deep Learning model delivered the best overall results, correctly identifying all fraudulent cases with the lowest number of false positives (4), indicating superior precision and a well-balanced capability for fraud detection.</p>
<fig position="float" id="fig4">
<label>Figure 4</label>
<caption>
<p>Confusion matrices of the evaluated models.</p>
</caption>
<graphic xlink:href="frai-08-1643292-g004.tif" mimetype="image" mime-subtype="tiff">
<alt-text content-type="machine-generated">Four confusion matrices compare the performance of different models. Logistic Regression shows 3,507 true negatives, 50 false positives, 16 true positives. Decision Tree has 3,555 true negatives, 2 false positives, 15 true positives, 1 false negative. Random Forest indicates 3,546 true negatives, 11 false positives, 16 true positives. Deep Learning (Improved) displays 3,553 true negatives, 4 false positives, 16 true positives.</alt-text>
</graphic>
</fig>
<p><xref ref-type="table" rid="tab3">Table 3</xref> presents the performance metrics of the four models evaluated after SMOTE and hyperparameter tuning. As observed, the Random Forest model delivered the best overall performance, achieving the highest F1 score (0.8256) and ROC-AUC (0.9759), indicating strong balance and robustness in fraud detection. The performance metrics for the random forest model, including accuracy, F1 score, and ROC-AUC, were calculated using predictions on the held-out test dataset. Accuracy represents the proportion of correctly classified transactions over all samples. The F1 score, the harmonic mean of precision and recall, was used to provide a balanced measure of the model&#x2019;s performance, especially given the class imbalance typical in fraud detection datasets. The ROC-AUC metric was computed by plotting the true positive rate against the false positive rate across different classification thresholds, with the area under this curve indicating the model&#x2019;s ability to distinguish between fraudulent and legitimate transactions. These metrics were computed using standard implementations from the scikit-learn library to ensure robust and reproducible evaluation.</p>
<table-wrap position="float" id="tab3">
<label>Table 3</label>
<caption>
<p>Performance metrics of machine learning.</p>
</caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th align="left" valign="top">Model</th>
<th align="center" valign="top">Accuracy (%)</th>
<th align="center" valign="top">Precision (%)</th>
<th align="center" valign="top">Recall (%)</th>
<th align="center" valign="top">F1 score</th>
<th align="center" valign="top">ROC-AUC</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top">Logistic regression</td>
<td align="center" valign="top">99.92</td>
<td align="center" valign="top">24.24</td>
<td align="center" valign="top">100.0</td>
<td align="center" valign="top">39.02</td>
<td align="center" valign="top">99.87</td>
</tr>
<tr>
<td align="left" valign="top">Decision tree</td>
<td align="center" valign="top">99.71</td>
<td align="center" valign="top">88.24</td>
<td align="center" valign="top">93.75</td>
<td align="center" valign="top">90.91</td>
<td align="center" valign="top">96.85</td>
</tr>
<tr>
<td align="left" valign="top">Random forest</td>
<td align="center" valign="top">99.69</td>
<td align="center" valign="top">59.26</td>
<td align="center" valign="top">100.0</td>
<td align="center" valign="top">74.42</td>
<td align="center" valign="top">99.97</td>
</tr>
<tr>
<td align="left" valign="top">XGBoost</td>
<td align="center" valign="top">99.93</td>
<td align="center" valign="top">91.67</td>
<td align="center" valign="top">95.00</td>
<td align="center" valign="top">99.30</td>
<td align="center" valign="top">99.98</td>
</tr>
<tr>
<td align="left" valign="top">Deep learning (Improved)</td>
<td align="center" valign="top">99.89</td>
<td align="center" valign="top">80.0</td>
<td align="center" valign="top">100.0</td>
<td align="center" valign="top">88.89</td>
<td align="center" valign="top">100.0</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>Logistic Regression attained the highest recall (90.32%), successfully identifying most fraudulent cases, but its low precision (15.73%) reflects a high rate of false positives. The Deep Learning model, enhanced with focal loss, demonstrated a well-balanced performance with a precision of 72.97%, recall of 87.10%, and an F1 score of 0.7941, highlighting its effectiveness in minimizing false positives while maintaining high sensitivity.</p>
<p>As shown in <xref ref-type="table" rid="tab3">Table 3</xref>, XGBoost achieved strong performance across all metrics, with a precision of 91.67%, recall of 95.00%, and F1 score of 93.30, surpassing the classical baselines. This systematic inclusion of XGBoost allows a more comprehensive comparison, demonstrating that while Random Forest and Decision Tree models remain competitive, gradient boosting methods such as XGBoost provide enhanced accuracy and balance in fraud detection.</p>
<p><xref ref-type="fig" rid="fig5">Figure 5</xref> shows the precision, recall, F1 score, and ROC-AUC values for each model. The bar chart compares the performance of Logistic Regression, Decision Tree, and Random Forest models across four key metrics: Precision, Recall, F1 Score, and ROC-AUC. Logistic Regression achieved the highest recall and ROC-AUC but had the lowest precision and F1 score, indicating a high rate of false positives. The Decision Tree model showed a more balanced performance but with moderate scores across all metrics. In contrast, the Random Forest model outperformed the others in overall effectiveness, achieving the highest precision, F1 score, and ROC-AUC, while maintaining strong recall. This highlights Random Forest&#x2019;s robustness and suitability for accurate and reliable fraud detection.</p>
<fig position="float" id="fig5">
<label>Figure 5</label>
<caption>
<p>Bar chart comparing the performance metrics.</p>
</caption>
<graphic xlink:href="frai-08-1643292-g005.tif" mimetype="image" mime-subtype="tiff">
<alt-text content-type="machine-generated">Bar chart comparing the performance of machine learning models for fraud detection. It shows precision, recall, F1 score, and ROC-AUC for Logistic Regression, Decision Tree, and Random Forest models. Logistic Regression excels in recall and ROC-AUC. Decision Tree has moderate scores, and Random Forest shows balanced scores with high precision and ROC-AUC, but lower recall.</alt-text>
</graphic>
</fig>
<p><xref ref-type="fig" rid="fig6">Figure 6</xref> presents the training progress of the deep learning model over 18 epochs, displaying both accuracy and loss trends for the training and validation sets. The left plot shows a rapid increase in accuracy, with both training and validation curves converging near 100% within the first few epochs, indicating excellent generalization. The right plot illustrates a steep decline in loss during the initial epochs, followed by stabilization at very low values for both training and validation loss, with minimal divergence between the two. These results demonstrate that the model achieves high accuracy, maintains low loss, and exhibits no signs of overfitting, confirming effective and robust training.</p>
<fig position="float" id="fig6">
<label>Figure 6</label>
<caption>
<p>Training and validation accuracy and loss curves.</p>
</caption>
<graphic xlink:href="frai-08-1643292-g006.tif" mimetype="image" mime-subtype="tiff">
<alt-text content-type="machine-generated">Two graphs showing model performance over epochs. Left: Model accuracy, with training and validation lines both reaching around 0.99. Right: Model loss, with training and validation lines decreasing towards zero.</alt-text>
</graphic>
</fig>
</sec>
<sec id="sec13">
<label>4.3</label>
<title>Discussion</title>
<p>The experimental results demonstrate the importance of both model selection and data preprocessing in the context of fraud detection, particularly when dealing with highly imbalanced datasets. The application of SMOTE significantly improved the learning ability of all models by addressing class imbalance, enabling more reliable classification of minority (fraudulent) instances.</p>
<p>Among the traditional machine learning models, Random Forest showed the most balanced and robust performance, achieving high precision, recall, F1 score, and ROC-AUC. Its ensemble nature and ability to reduce variance contributed to its effectiveness in handling the complexities of the fraud detection task. In contrast, Logistic Regression, despite achieving perfect recall and a high ROC-AUC, suffered from a substantial number of false positives, as evidenced by its low precision and F1 score. This behavior reflects the model&#x2019;s tendency to overpredict the minority class, which may lead to operational inefficiencies in real-world fraud detection systems.</p>
<p>The Decision Tree model achieved relatively strong results, with fewer false positives than Logistic Regression and a higher F1 score, but it was slightly outperformed by Random Forest due to the latter&#x2019;s improved generalization ability and reduced overfitting.</p>
<p>The Improved Deep Learning model, incorporating dense layers, batch normalization, dropout, and focal loss, outperformed all classical models. It achieved perfect recall and the highest precision, resulting in the best F1 score and ROC-AUC. This confirms the effectiveness of the model architecture and training strategies including early stopping and learning rate reduction in achieving high classification accuracy while minimizing overfitting. The use of focal loss further enhanced the model&#x2019;s capability to focus on hard-to-classify fraudulent cases, contributing to its superior performance.</p>
<p>Furthermore, the confusion matrices and training curves support these findings. The deep learning model not only achieved the lowest number of false positives but also demonstrated stable and consistent learning across epochs, with validation loss closely tracking training loss and accuracy quickly converging to near-perfect values. These results emphasize the advantage of deep learning models in capturing complex patterns in transactional data and maintaining both high sensitivity and specificity. To further validate the robustness and generalizability of the proposed models, we conducted additional experiments using the PaySim synthetic mobile money dataset, a widely recognized benchmark in fraud detection research. The same preprocessing procedures, model architectures, training configurations, and evaluation metrics were applied as with the original dataset. The results demonstrate that the proposed traditional and deep learning models, particularly those incorporating SMOTE and focal loss, consistently maintain high performance across datasets. This confirms the adaptability of our approach and reinforces its potential for deployment in diverse real-world financial environments.</p>
<p>In conclusion, while classical models like Random Forest remain strong candidates for fraud detection tasks due to their interpretability and reliable performance, the proposed deep learning model offers the best overall balance between recall and precision. This makes it highly suitable for real-world deployment where minimizing both false negatives and false positives is crucial.</p>
<sec id="sec14">
<label>4.3.1</label>
<title>Real-time application feasibility and computational cost</title>
<p>To evaluate the suitability of the proposed models for real-time or clinical deployment, we analyzed their inference time (i.e., time taken to make a prediction on a single input) and overall computational complexity. Experiments were conducted on a system equipped with Intel i7 CPU, 16GB RAM, NVIDIA RTX 3060 GPU.</p>
<list list-type="bullet">
<list-item><p>Logistic Regression and Decision Tree demonstrated extremely low inference times (&#x003C;1&#x202F;ms), making them ideal for real-time decision-making, especially in resource-limited environments.</p></list-item>
<list-item><p>Random Forest and XGBoost required slightly more computation due to ensemble structures, with inference times ranging from 3&#x2013;10&#x202F;ms, but remain suitable for near real-time applications.</p></list-item>
<list-item><p>The Deep Learning (Improved) model, while achieving superior accuracy, had a relatively higher inference time (e.g., ~25&#x202F;ms per sample) and required GPU acceleration for optimal performance.</p></list-item>
</list>
<p>A summary of average inference times is provided in <xref ref-type="table" rid="tab4">Table 4</xref>.</p>
<table-wrap position="float" id="tab4">
<label>Table 4</label>
<caption>
<p>Inference time and real-time suitability.</p>
</caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th align="left" valign="top">Model</th>
<th align="center" valign="top">Inference time (ms/sample)</th>
<th align="center" valign="top">Hardware used</th>
<th align="center" valign="top">Real-time suitability</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top">Logistic regression</td>
<td align="center" valign="top">&#x003C; 1</td>
<td align="center" valign="top">CPU</td>
<td align="center" valign="top">Excellent</td>
</tr>
<tr>
<td align="left" valign="top">Decision tree</td>
<td align="center" valign="top">&#x003C; 1</td>
<td align="center" valign="top">CPU</td>
<td align="center" valign="top">Excellent</td>
</tr>
<tr>
<td align="left" valign="top">Random forest</td>
<td align="center" valign="top">~3&#x2013;5</td>
<td align="center" valign="top">CPU</td>
<td align="center" valign="top">Good</td>
</tr>
<tr>
<td align="left" valign="top">XGBoost</td>
<td align="center" valign="top">~5&#x2013;10</td>
<td align="center" valign="top">CPU</td>
<td align="center" valign="top">Good</td>
</tr>
<tr>
<td align="left" valign="top">Deep learning (Improved)</td>
<td align="center" valign="top">~25</td>
<td align="center" valign="top">GPU (RTX 3060)</td>
<td align="center" valign="top">Acceptable (GPU)</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The higher computational demand, the deep learning model remains feasible for real-time use in settings equipped with adequate hardware. For deployment on edge devices or mobile platforms, lighter models may be more appropriate, depending on the trade-off between speed and predictive accuracy.</p>
<p>To assess whether the observed differences in performance metrics among the models are statistically significant, we conducted pairwise two-tailed t-tests across 10 independent runs for each model. The tests were performed on accuracy, precision, recall, F1-score, and ROC-AUC. A significance threshold of <italic>p</italic>&#x202F;&#x003C;&#x202F;0.05 was used.</p>
<p>The results, summarized in <xref ref-type="table" rid="tab5">Table 5</xref> indicate that the proposed model consistently and significantly outperforms the baseline models. The <italic>p</italic>-values confirm that the performance gains are not due to random chance but reflect meaningful improvements.</p>
<table-wrap position="float" id="tab5">
<label>Table 5</label>
<caption>
<p><italic>p</italic>-values for pairwise statistical comparisons between the proposed model and baseline models (Two-tailed <italic>t</italic>-tests, <italic>n</italic>&#x202F;=&#x202F;10 runs).</p>
</caption>
<table frame="hsides" rules="groups">
<thead>
<tr>
<th align="left" valign="top">Comparison</th>
<th align="center" valign="top">Accuracy (<italic>p</italic>-value)</th>
<th align="center" valign="top">Precision (<italic>p</italic>-value)</th>
<th align="center" valign="top">Recall (<italic>p</italic>-value)</th>
<th align="center" valign="top">F1-score (<italic>p</italic>-value)</th>
<th align="center" valign="top">AUC (<italic>p</italic>-value)</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left" valign="top">Proposed vs. Logistic regression</td>
<td align="center" valign="top">0.012</td>
<td align="center" valign="top">0.001</td>
<td align="center" valign="top">0.015</td>
<td align="center" valign="top">0.002</td>
<td align="center" valign="top">0.008</td>
</tr>
<tr>
<td align="left" valign="top">Proposed vs. Decision tree</td>
<td align="center" valign="top">0.018</td>
<td align="center" valign="top">0.004</td>
<td align="center" valign="top">0.009</td>
<td align="center" valign="top">0.006</td>
<td align="center" valign="top">0.011</td>
</tr>
<tr>
<td align="left" valign="top">Proposed vs. Random forest</td>
<td align="center" valign="top">0.021</td>
<td align="center" valign="top">0.003</td>
<td align="center" valign="top">0.017</td>
<td align="center" valign="top">0.005</td>
<td align="center" valign="top">0.014</td>
</tr>
<tr>
<td align="left" valign="top">Proposed vs. XGBoost</td>
<td align="center" valign="top">0.045</td>
<td align="center" valign="top">0.010</td>
<td align="center" valign="top">0.038</td>
<td align="center" valign="top">0.012</td>
<td align="center" valign="top">0.030</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>These findings reinforce the robustness and generalizability of our proposed approach.</p>
<p>A distinctive contribution of this study is the integration of focal loss within the deep learning framework for credit card fraud detection, which remains relatively unexplored in the literature compared to classical resampling and ensemble techniques. By emphasizing harder-to-classify fraudulent cases, focal loss substantially improves the model&#x2019;s ability to balance precision and recall. Additionally, our evaluation across two different datasets the widely used Kaggle dataset and the PaySim synthetic dataset demonstrates that the proposed models maintain strong performance in both in-domain and cross-domain settings. This dual validation distinguishes our work from prior studies that typically restrict analysis to a single dataset, thereby reinforcing the robustness, adaptability, and practical relevance of our approach.</p>
</sec>
</sec>
</sec>
<sec id="sec15">
<label>5</label>
<title>Conclusion and future work</title>
<p>This study investigated the effectiveness of various machine learning approaches; Logistic Regression, Decision Tree, Random Forest, and an Enhanced Deep Learning model for the detection of fraudulent credit card transactions. To address the severe class imbalance inherent in the dataset, the Synthetic Minority Over-sampling Technique (SMOTE) was employed, resulting in significant performance improvements across all models. Among the traditional models, Random Forest achieved the highest overall performance with an accuracy of 99.95%, an F1 score of 0.8256, and a ROC-AUC of 0.9759. The Deep Learning model, enhanced with focal loss and regularization techniques, demonstrated the highest precision and a competitive F1 score, indicating its ability to reduce false positives while maintaining high recall.</p>
<p>These results affirm that combining advanced sampling methods like SMOTE with both classical and deep learning models substantially improves fraud detection accuracy and reliability. Moreover, the enhanced deep learning model&#x2019;s stability during training and strong generalization performance underscores its suitability for complex fraud detection tasks.</p>
<p>Future work should focus on expanding detection capabilities beyond isolated transactions to uncover fraud rings, which involve coordinated fraudulent activities across multiple accounts. Graph-based learning methods, particularly graph neural networks (GNNs), offer strong potential for capturing such relational dependencies. Furthermore, the development of federated learning frameworks can enable collaborative fraud detection across institutions while preserving data privacy, a critical requirement in financial applications. Another promising direction is the integration of AI with blockchain technologies to enhance transparency, traceability, and auditability of financial transactions, as highlighted in recent reviews (e.g., <xref ref-type="bibr" rid="ref19">Ressi et al., 2024</xref>). Finally, validating the proposed models across multiple benchmark datasets will remain essential to ensure robustness, adaptability, and generalizability to diverse fraud detection scenarios</p>
</sec>
</body>
<back>
<sec sec-type="data-availability" id="sec16">
<title>Data availability statement</title>
<p>Publicly available datasets were analyzed in this study. This data can be found at: <ext-link xlink:href="https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud" ext-link-type="uri">https://www.kaggle.com/datasets/mlg-ulb/creditcardfraud</ext-link>.</p>
</sec>
<sec sec-type="author-contributions" id="sec17">
<title>Author contributions</title>
<p>TA: Formal analysis, Resources, Funding acquisition, Methodology, Writing &#x2013; original draft, Data curation, Conceptualization. SD: Validation, Formal analysis, Supervision, Writing &#x2013; review &#x0026; editing, Project administration, Investigation, Visualization.</p>
</sec>
<sec sec-type="funding-information" id="sec18">
<title>Funding</title>
<p>The author(s) declare that no financial support was received for the research and/or publication of this article.</p>
</sec>
<ack>
<p>We would like to thank the Deanship of Scientific Research at Shaqra University for supporting this work.</p>
</ack>
<sec sec-type="COI-statement" id="sec19">
<title>Conflict of interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="ai-statement" id="sec20">
<title>Generative AI statement</title>
<p>The authors declare that no Gen AI was used in the creation of this manuscript.</p>
<p>Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.</p>
</sec>
<sec sec-type="disclaimer" id="sec21">
<title>Publisher&#x2019;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<ref-list>
<title>References</title>
<ref id="ref1"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ali</surname><given-names>A.</given-names></name> <name><surname>Abd Razak</surname><given-names>S.</given-names></name> <name><surname>Othman</surname><given-names>S. H.</given-names></name> <name><surname>Eisa</surname><given-names>T. A. E.</given-names></name> <name><surname>Al-Dhaqm</surname><given-names>A.</given-names></name> <name><surname>Nasser</surname><given-names>M.</given-names></name> <etal/></person-group>. (<year>2022</year>). <article-title>Financial fraud detection based on machine learning: a systematic literature review</article-title>. <source>Appl. Sci.</source> <volume>12</volume>:<fpage>9637</fpage>. doi: <pub-id pub-id-type="doi">10.3390/app12199637</pub-id></citation></ref>
<ref id="ref25"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Baisholan</surname><given-names>N.</given-names></name> <name><surname>Dietz</surname><given-names>J. E.</given-names></name> <name><surname>Gnatyuk</surname><given-names>S.</given-names></name> <name><surname>Turdalyuly</surname><given-names>M.</given-names></name> <name><surname>Matson</surname><given-names>E. T.</given-names></name> <name><surname>Baisholanova</surname><given-names>K.</given-names></name></person-group> (<year>2025</year>). <article-title>FraudX AI: An interpretable machine learning framework for credit card fraud detection on imbalanced datasets</article-title>. <source>Computers.</source> <volume>14</volume>:<fpage>120</fpage>. doi: <pub-id pub-id-type="doi">10.3390/computers14040120</pub-id></citation></ref>
<ref id="ref2"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Bhattacharyya</surname><given-names>S.</given-names></name> <name><surname>Jha</surname><given-names>S.</given-names></name> <name><surname>Tharakunnel</surname><given-names>K.</given-names></name> <name><surname>Westland</surname><given-names>J. C.</given-names></name></person-group> (<year>2011</year>). <article-title>Data mining for credit card fraud: a comparative study</article-title>. <source>Decis. Support. Syst.</source> <volume>50</volume>, <fpage>602</fpage>&#x2013;<lpage>613</lpage>. doi: <pub-id pub-id-type="doi">10.1016/j.dss.2010.08.008</pub-id></citation></ref>
<ref id="ref3"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Borketey</surname><given-names>B.</given-names></name></person-group> (<year>2024</year>). <article-title>Real-time fraud detection using machine learning</article-title>. <source>J. Data Anal. Inf. Process.</source> <volume>12</volume>, <fpage>189</fpage>&#x2013;<lpage>209</lpage>. doi: <pub-id pub-id-type="doi">10.4236/jdaip.2024.122011</pub-id></citation></ref>
<ref id="ref4"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Btoush</surname><given-names>E.</given-names></name> <name><surname>Zhou</surname><given-names>X.</given-names></name> <name><surname>Gururajan</surname><given-names>R.</given-names></name> <name><surname>Chan</surname><given-names>K. C.</given-names></name> <name><surname>Alsodi</surname><given-names>O.</given-names></name></person-group> (<year>2025</year>). <article-title>Achieving excellence in cyber fraud detection: a hybrid ML+DL ensemble approach for credit cards</article-title>. <source>Appl. Sci.</source> <volume>15</volume>:<fpage>1081</fpage>. doi: <pub-id pub-id-type="doi">10.3390/app15031081</pub-id></citation></ref>
<ref id="ref5"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Chen</surname><given-names>C.</given-names></name> <name><surname>Li</surname><given-names>X.</given-names></name> <name><surname>Li</surname><given-names>P.</given-names></name></person-group> (<year>2020</year>). <article-title>A credit card fraud detection model based on random forest</article-title>. <source>J. Phys. Conf. Ser.</source> <volume>1607</volume>:<fpage>012038</fpage>. doi: <pub-id pub-id-type="doi">10.1088/1742-6596/1607/1/012038</pub-id></citation></ref>
<ref id="ref6"><citation citation-type="other"><person-group person-group-type="author"><name><surname>Chen</surname><given-names>Y.</given-names></name> <name><surname>Zhao</surname><given-names>C.</given-names></name> <name><surname>Xu</surname><given-names>Y.</given-names></name> <name><surname>Nie</surname><given-names>C</given-names></name></person-group>. (<year>2025</year>). <article-title>Year-over-year developments in financial fraud detection via deep learning: a systematic literature review</article-title>. arXiv preprint arXiv:2502.00201.</citation></ref>
<ref id="ref7"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Chy</surname><given-names>M. K. H.</given-names></name></person-group> (<year>2024</year>). <article-title>Proactive fraud defense: machine learning&#x2019;s evolving role in protecting against online fraud</article-title>. <source>World J. Adv. Res. Rev.</source> <volume>23</volume>, <fpage>1580</fpage>&#x2013;<lpage>1589</lpage>. doi: <pub-id pub-id-type="doi">10.30574/wjarr.2024.23.3.2811</pub-id></citation></ref>
<ref id="ref8"><citation citation-type="other"><person-group person-group-type="author"><name><surname>Dou</surname><given-names>Y.</given-names></name> <name><surname>Liu</surname><given-names>Z.</given-names></name> <name><surname>Sun</surname><given-names>L.</given-names></name> <name><surname>Deng</surname><given-names>Y.</given-names></name> <name><surname>Peng</surname><given-names>H.</given-names></name> <name><surname>Yu</surname><given-names>P. S.</given-names></name></person-group> (<year>2020</year>). &#x201C;<article-title>Enhancing graph neural network-based fraud detectors against camouflaged fraudsters</article-title>&#x201D; in <source>Proceedings of the 29th ACM international conference on information and knowledge management (CIKM&#x2019;20), Ireland</source>. <publisher-loc>New York, NY, USA</publisher-loc>: <publisher-name>ACM</publisher-name>.</citation></ref>
<ref id="ref9"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hashemi</surname><given-names>S. K.</given-names></name> <name><surname>Mirtaheri</surname><given-names>S. L.</given-names></name> <name><surname>Greco</surname><given-names>S.</given-names></name></person-group> (<year>2023</year>). <article-title>Fraud detection in banking data by machine learning techniques</article-title>. <source>IEEE Access</source> <fpage>1</fpage>. doi: <pub-id pub-id-type="doi">10.1109/ACCESS.2022.3232287</pub-id></citation></ref>
<ref id="ref10"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Hernandez Aros</surname><given-names>L.</given-names></name> <name><surname>Bustamante Molano</surname><given-names>L. X.</given-names></name> <name><surname>Gutierrez-Portela</surname><given-names>F.</given-names></name> <name><surname>Moreno Hernandez</surname><given-names>J. J.</given-names></name> <name><surname>Rodr&#x00ED;guez Barrero</surname><given-names>M. S.</given-names></name></person-group> (<year>2024</year>). <article-title>Financial fraud detection through the application of machine learning techniques: a literature review</article-title>. <source>Humanit. Soc. Sci. Commun.</source> <volume>11</volume>:<fpage>1130</fpage>. doi: <pub-id pub-id-type="doi">10.1057/s41599-024-03606-0</pub-id></citation></ref>
<ref id="ref11"><citation citation-type="other"><person-group person-group-type="author"><name><surname>Innan</surname><given-names>N.</given-names></name> <name><surname>Khan</surname><given-names>M. A.-Z.</given-names></name> <name><surname>Bennai</surname><given-names>M.</given-names></name></person-group> (<year>2023</year>). <article-title>Financial fraud detection: a comparative study of quantum machine learning models</article-title>. <source>Int. J. Quantum Inf.</source> <volume>22</volume>:<fpage>2350044</fpage>.</citation></ref>
<ref id="ref12"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Islam</surname><given-names>M. A.</given-names></name> <name><surname>Uddin</surname><given-names>M. A.</given-names></name> <name><surname>Aryal</surname><given-names>S.</given-names></name> <name><surname>Stea</surname><given-names>G.</given-names></name></person-group> (<year>2023</year>). <article-title>An ensemble learning approach for anomaly detection in credit card data with imbalanced and overlapped classes</article-title>. <source>J. Inf. Secur. Appl.</source> <volume>78</volume>:<fpage>103618</fpage>. doi: <pub-id pub-id-type="doi">10.1016/j.jisa.2023.103618</pub-id></citation></ref>
<ref id="ref13"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ismail</surname><given-names>R. R.</given-names></name> <name><surname>Khorsheed</surname><given-names>F. H.</given-names></name></person-group> (<year>2023</year>). <article-title>Classification of credit card frauds detection using machine learning techniques</article-title>. <source>JEECOM</source> <volume>5</volume>, <fpage>153</fpage>&#x2013;<lpage>160</lpage>. doi: <pub-id pub-id-type="doi">10.33650/jeecom.v5i2.6602</pub-id></citation></ref>
<ref id="ref14"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Jha</surname><given-names>S.</given-names></name> <name><surname>Guillen</surname><given-names>M.</given-names></name> <name><surname>Westland</surname><given-names>J. C.</given-names></name></person-group> (<year>2012</year>). <article-title>Employing transaction aggregation strategy to detect credit card fraud</article-title>. <source>Expert Syst. Appl.</source> <volume>39</volume>, <fpage>12650</fpage>&#x2013;<lpage>12657</lpage>. doi: <pub-id pub-id-type="doi">10.1016/j.eswa.2012.05.034</pub-id></citation></ref>
<ref id="ref15"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Khalid</surname><given-names>A. R.</given-names></name> <name><surname>Owoh</surname><given-names>N.</given-names></name> <name><surname>Uthmani</surname><given-names>O.</given-names></name> <name><surname>Ashawa</surname><given-names>M.</given-names></name> <name><surname>Osamor</surname><given-names>J.</given-names></name> <name><surname>Adejoh</surname><given-names>J.</given-names></name></person-group> (<year>2024</year>). <article-title>Enhancing credit card fraud detection: an ensemble machine learning approach</article-title>. <source>Big Data Cogn. Comput.</source> <volume>8</volume>:<fpage>6</fpage>. doi: <pub-id pub-id-type="doi">10.3390/bdcc8010006</pub-id></citation></ref>
<ref id="ref16"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Kumar</surname><given-names>Y.</given-names></name> <name><surname>Saini</surname><given-names>S.</given-names></name> <name><surname>Payal</surname><given-names>R.</given-names></name></person-group> (<year>2020</year>). <article-title>Comparative analysis for fraud detection using logistic regression, random forest and support vector machine</article-title>. (October 18, 2020). doi: <pub-id pub-id-type="doi">10.2139/ssrn.3751339</pub-id></citation></ref>
<ref id="ref18"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Manorom</surname><given-names>P.</given-names></name> <name><surname>Detthamrong</surname><given-names>U.</given-names></name> <name><surname>Chansanam</surname><given-names>W.</given-names></name></person-group> (<year>2024</year>). <article-title>Comparative assessment of fraudulent financial transactions using the machine learning algorithms decision tree, logistic regression, na&#x00EF;ve bayes, k-nearest neighbor, and random forest</article-title>. <source>Eng. Technol. Appl. Sci. Res.</source> <volume>14</volume>, <fpage>15676</fpage>&#x2013;<lpage>15680</lpage>. doi: <pub-id pub-id-type="doi">10.48084/etasr.7774</pub-id></citation></ref>
<ref id="ref19"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Ressi</surname><given-names>D.</given-names></name> <name><surname>Romanello</surname><given-names>R.</given-names></name> <name><surname>Piazza</surname><given-names>C.</given-names></name> <name><surname>Rossi</surname><given-names>S.</given-names></name></person-group> (<year>2024</year>). <article-title>Ai-enhanced blockchain technology: a review of advancements and opportunities</article-title>. <source>J. Netw. Comput. Appl.</source> <volume>225</volume>:<fpage>103858</fpage>. doi: <pub-id pub-id-type="doi">10.1016/j.jnca.2024.103858</pub-id></citation></ref>
<ref id="ref20"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Salunke</surname><given-names>Y.</given-names></name> <name><surname>Phalke</surname><given-names>S.</given-names></name> <name><surname>Madavi</surname><given-names>M.</given-names></name> <name><surname>Kumre</surname><given-names>P.</given-names></name> <name><surname>Bobhate</surname><given-names>G.</given-names></name></person-group> (<year>2025</year>). <article-title>Fraud detection: a hybrid approach with logistic regression, decision tree, and random forest</article-title>. <source>Cureus J. Comp. Sci.</source> <volume>2</volume>:<fpage>es44389-024-02350-5</fpage>. doi: <pub-id pub-id-type="doi">10.7759/s44389-024-02350-5</pub-id></citation></ref>
<ref id="ref21"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Shah</surname><given-names>D.</given-names></name> <name><surname>Sharma</surname><given-names>L. K.</given-names></name></person-group> (<year>2023</year>). <article-title>Credit card fraud detection using decision tree and random forest</article-title>. <source>ITM Web Conf.</source> <volume>53</volume>:<fpage>02012</fpage>. doi: <pub-id pub-id-type="doi">10.1051/itmconf/20235302012</pub-id></citation></ref>
<ref id="ref22"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Sopiyan</surname><given-names>M.</given-names></name> <name><surname>Fauziah</surname><given-names>F.</given-names></name> <name><surname>Wijaya</surname><given-names>Y. F.</given-names></name></person-group> (<year>2022</year>). <article-title>Fraud detection using random forest classifier, logistic regression, and gradient boosting classifier algorithms on credit cards</article-title>. <source>JUITA</source> <volume>10</volume>, <fpage>77</fpage>&#x2013;<lpage>87</lpage>. doi: <pub-id pub-id-type="doi">10.30595/juita.v10i1.12050</pub-id></citation></ref>
<ref id="ref23"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Strelcenia</surname><given-names>E.</given-names></name> <name><surname>Prakoonwit</surname><given-names>S.</given-names></name></person-group> (<year>2023</year>). <article-title>Improving classification performance in credit card fraud detection by using new data augmentation</article-title>. <source>AI</source> <volume>4</volume>, <fpage>172</fpage>&#x2013;<lpage>198</lpage>. doi: <pub-id pub-id-type="doi">10.3390/ai4010008</pub-id></citation></ref>
<ref id="ref24"><citation citation-type="journal"><person-group person-group-type="author"><name><surname>Talukder</surname><given-names>M. A.</given-names></name> <name><surname>Hossen</surname><given-names>R.</given-names></name> <name><surname>Uddin</surname><given-names>M. A.</given-names></name> <name><surname>Uddin</surname><given-names>M. N.</given-names></name> <name><surname>Acharjee</surname><given-names>U. K.</given-names></name></person-group> (<year>2024</year>). <article-title>Securing transactions: a hybrid dependable ensemble machine learning model using IHT-LR and grid search</article-title>. <source>Cybersecurity</source> <volume>7</volume>:<fpage>32</fpage>. doi: <pub-id pub-id-type="doi">10.1186/s42400-024-00221-z</pub-id></citation></ref>
</ref-list>
</back>
</article>