Hybrid CNN–Random Forest Framework for Real-Time Credit Card Fraud Detection
Keywords:
Class imbalance, Convolutional neural networks, Deep learning, Financial security, Fraud detection, Random forest, SMOTEAbstract
Modern financial ecosystems increasingly depend on digital channels for everyday transactions, creating an environment where automated fraud detection has become operationally essential. High-throughput payment networks — spanning mobile wallets, contactless point-of-sale terminals, and instant fund transfer protocols — produce transaction streams at a scale that renders human-supervised screening impractical. Conventional rule-based screening mechanisms, though widely deployed, carry two well-documented structural weaknesses: their inability to respond to previously unseen fraud patterns without manual rule revision, and their tendency to misclassify valid transactions as suspicious, imposing both direct operational costs and customer-experience penalties. Overcoming these weaknesses simultaneously demands a machine learning solution capable of learning adaptive decision boundaries, scaling to high-volume transaction environments, and producing outputs that comply with emerging algorithmic accountability standards in regulated financial markets. To address these challenges, this paper proposes a two-stage sequential pipeline that couples CNN-based spatial feature extraction with Random Forest ensemble classification. During preprocessing, log transformation is applied to the heavily right-skewed Amount feature; all 30 input dimensions are rescaled to a [0, 1] interval using Min-Max normalisation fitted solely on training data; and SMOTE is employed exclusively within the training fold to counteract severe class imbalance (0.172% fraud prevalence) without contaminating held-out evaluation sets. Each processed feature vector is then restructured into a 5×6 two-dimensional matrix, allowing convolutional kernels to capture cross-feature spatial dependencies undetectable by flat-vector classifiers. The 384-dimensional abstract representation produced by the CNN is subsequently passed to a 500-tree Random Forest for final binary classification. Evaluation under stratified 10-fold cross-validation on the publicly available ULB Credit Card Fraud Detection benchmark demonstrates that the proposed hybrid model attains 98.6% classification accuracy, precision of 0.97, recall of 0.95, F1-score of 0.94, and AUC-ROC of 0.99 — surpassing five independently evaluated baselines (Logistic Regression, K-Nearest Neighbours, Support Vector Machine, standalone CNN, and standalone Random Forest) on every reported metric. Compared to the standalone CNN, the hybrid framework reduces false-positive alerts by 12%, while an average inference time of 4.2 milliseconds per transaction confirms viability for live payment authorisation systems. The proposed framework delivers a reproducible, interpretable, and rigorously validated contribution to the intersection of deep learning, data mining, and financial security.
References
A. Alarcon, C. Sanchez, and F. Velasquez, “Machine learning approaches for credit card fraud detection: A survey,” Expert Systems with Applications, vol. 204, no. 1, p. 117530, 2022.
V. Van Vlasselaer et al., “APATE: A novel approach for automated credit card transaction fraud detection using network-based extensions,” Decision Support Systems, vol. 75, no. 1, pp. 38–48, 2015.
N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer, “SMOTE: Synthetic minority over-sampling technique,” Journal of Artificial Intelligence Research, vol. 16, no. 1, pp. 321–357, 2002.
B. Goodman and S. Flaxman, “European Union regulations on algorithmic decision-making and a ‘right to explanation’,” AI Magazine, vol. 38, no. 3, pp. 50–57, 2017.
L. Breiman, “Random forests,” Machine Learning, vol. 45, no. 1, pp. 5–32, 2001.
J. A. Hanley and B. J. McNeil, “The meaning and use of the area under a receiver operating characteristic (ROC) curve,” Radiology, vol. 143, no. 1, pp. 29–36, 1982.
A. Fernandez, S. Garcia, F. Herrera, and N. V. Chawla, “SMOTE for learning from imbalanced data: Progress and challenges, marking the 15-year anniversary,” Journal of Artificial Intelligence Research, vol. 61, no. 1, pp. 863–905, 2018.
A. Dal Pozzolo et al., “Learned lessons in credit card fraud detection from a practitioner perspective,” Expert Systems with Applications, vol. 41, no. 10, pp. 4915–4928, 2014.
G. Louppe, L. Wehenkel, A. Sutera, and P. Geurts, “Understanding variable importances in forests of randomized trees,” in Advances in Neural Information Processing Systems (NIPS), vol. 26, pp. 431–439, 2013.
U. Fiore et al., “Using generative adversarial networks for improving classification effectiveness in credit card fraud detection,” Information Sciences, vol. 479, no. 1, pp. 448–455, 2019.
K. Fu, D. Cheng, Y. Tu, and L. Zhang, “Credit card fraud detection using convolutional neural networks,” Lecture Notes in Computer Science, vol. 9949, no. 1, pp. 504–514, 2016.
A. Dal Pozzolo et al., “Credit card fraud detection: A realistic modeling and a novel learning strategy,” IEEE Transactions on Neural Networks and Learning Systems, vol. 29, no. 8, pp. 3784–3797, 2018.
A. C. Bahnsen, D. Aouada, and B. Ottersten, “Example-dependent cost-sensitive decision trees,” Expert Systems with Applications, vol. 42, no. 19, pp. 6609–6619, 2016.
J. Brownlee, Data Preparation for Machine Learning: Data Cleaning, Feature Selection, and Data Transforms in Python. Machine Learning Mastery, 2020.
Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, 2015.
D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” Proceedings of the International Conference on Learning Representations (ICLR), 2015, pp. 1–13.
T. Fawcett, “An introduction to ROC analysis,” Pattern Recognition Letters, vol. 27, no. 8, pp. 861–874, 2006.
S. Bhattacharyya, S. Jha, K. Tharakunnel, and J. C. Westland, “Data mining for credit card fraud: A comparative study,” Decision Support Systems, vol. 50, no. 3, pp. 602–613, 2011.
J. Davis and M. Goadrich, “The relationship between precision-recall and ROC curves,” in Proceedings of the International Conference on Machine Learning, vol. 148, pp. 233–240, 2006.
T. G. Dietterich, “Ensemble methods in machine learning,” Lecture Notes in Computer Science, vol. 1857, no. 1, pp. 1–15, 2000.
A. Dal Pozzolo, O. Caelen, R. A. Johnson, and G. Bontempi, “Calibrating probability with under sampling for unbalanced classification,” in Proceedings IEEE Symp. on Computational Intelligence and Data Mining (CIDM), Cape Town, South Africa, pp. 159–166, 2015.