Fraud detection
Improving Fraud Detection Accuracy Through Advanced Feature Engineering and Comparative Model Evaluation
- Type
- Bachelor's thesis
- Date
- June 2025
- University
- Royal University of Phnom Penh
- Length
- 42 pages
Read it
Prefer the files? Download the PDF (2.4 MB) or the notebook (1.7 MB).
Abstract
Financial fraud detection is a critical and challenging task, especially in the context of large-scale transaction datasets that exhibit high class imbalance and complex behavioral patterns. In this study, we propose a comprehensive machine learning pipeline designed to enhance fraud detection accuracy by integrating advanced feature engineering, outlier analysis, and comparative model evaluation. We begin by transforming raw transactional data into informative features, such as account balance behavior (emptied_account), temporal transaction indicators (hour_risk_level), and custom behavioral flags (e.g., matching amount and balance). These engineered features are supplemented with outlier indicator variables that capture extreme financial anomalies, enabling the model to retain important variance while mitigating noise through winsorization.
To evaluate the effectiveness of our feature-enriched dataset, we train and compare several state-of-the-art classification models: CatBoost, XGBoost, LightGBM, Random Forest, K-Nearest Neighbors (KNN), and Logistic Regression. All models are evaluated using a balanced set of performance metrics including accuracy, precision, recall, F1-score, and the Area Under the Receiver Operating Characteristic Curve (ROC-AUC). Additionally, we address the issue of class imbalance by applying cost-sensitive learning through class weighting, particularly in boosting models like CatBoost. The performance is further scrutinized through overfitting analysis, using both training and test metrics to quantify generalization.
Our experiments show that gradient boosting models, particularly CatBoost, consistently outperform traditional models in detecting fraudulent transactions, thanks to their ability to handle categorical variables, class imbalance, and complex feature interactions effectively. The study emphasizes the critical role of domain-specific feature engineering and cost-aware learning strategies in developing robust fraud detection systems. These findings provide a scalable and interpretable framework for financial institutions seeking to enhance their fraud prevention capabilities in real time.
In the thesis
- Cover page 1
- Title page page 2
- Abstract (Khmer) page 3
- Abstract page 4
- Supervisor's statement page 5
- Candidate's statement page 6
- Acknowledgements page 7
- Contents page 8
- Figures and tables page 10
- 1. Introduction page 12
- 2. Literature review page 16
- 3. Methodology page 21
- 4. Model training and results page 30
- 5. Discussion page 36
- 6. Conclusion page 40
- References page 41
In the notebook
- Imports and settings cell 0
- Look at the data cell 1
- Exploratory analysis cell 5
- Fraud by transaction type cell 8
- Correlations and distributions cell 12
- Missing values and zeros cell 23
- Feature engineering cell 25
- Fraud by hour of day cell 30
- Feature correlations cell 34
- Train and test split cell 38
- XGBoost cell 41
- LightGBM cell 42
- Random forest cell 46
- Logistic regression cell 50
- k-nearest neighbours cell 54
- Decision tree cell 58
- Outlier handling cell 60
- CatBoost cell 61
- k-NN, outliers handled cell 66
- Logistic regression, outliers handled cell 70
- Undersampling and XGBoost cell 73
- Comparison plots (commented out) cell 77
Cite it
The DOI is the Zenodo record's: 10.5281/zenodo.15618190.
Panhathun, D. (2025). Improving Online Payment Fraud Detection with Feature Engineering and Cost-Sensitive Machine Learning [Thesis, Royal University of Phnom Penh]. Zenodo. https://doi.org/10.5281/zenodo.15618190
@thesis{panhathun2025fraud,
author = {Panhathun, Duch},
title = {Improving Online Payment Fraud Detection with Feature Engineering and Cost-Sensitive Machine Learning},
type = {Bachelor's thesis},
institution = {Royal University of Phnom Penh},
year = {2025},
doi = {10.5281/zenodo.15618190},
url = {https://doi.org/10.5281/zenodo.15618190}
}
Files and links
- research_paper.pdf, the thesis, 2.4 MB, opens in your browser's PDF viewer
SHA-256
b8b3df65ce315ad24a26b8bf04a04643895ce29b20635c4a28ec42dbeb703f35 - online-payment-fraud-detection-v7.ipynb, the notebook, 1.7 MB
SHA-256
0882c3bd15f21b7b574bea96d0c47ac163a8d8f5ffbe813f59328f7ab70858c1 - Zenodo record, 8 June 2025, CC BY 4.0
- The dataset on Kaggle. 6,362,620 transactions with 11 features each, from Kaggle. It is not hosted here: the notebook expects you to download it.
Which version is this?
This PDF is the thesis as bound: its cover is dated June 2025 and the file was produced on 30 June 2025. The Zenodo record was published on 8 June 2025 and holds the Word manuscript, under a different title. The two differ in their wording in places, so cite the version you read. The DOI resolves to the Zenodo record.
Good to know
- Both viewers work without JavaScript. The thesis is shown as page images, and there is a text version for searching and for screen readers.
- The notebook is shown as it was saved: cells in file order, with the output stored in the file. The numbers beside the cells are the saved execution counts, so they are not always in sequence.
- Nothing is re-run here. The numbers you see are the ones the notebook saved.