Professional Documents
Culture Documents
Abstract—The usage of credit card is constantly improving due application fraud and behavior fraud [5]. Application fraud
to the ease in making transactions in online system. These huge occurs when a fraudster uses false information or other people’s
number of usages cause many fraudsters to commit a fraud credit information to apply for a new credit card. On the other hand,
card to surpass the online payment. Because of the usage of credit behavior fraud is done by stealing legitimate card details to make
card are very high, detecting them with only human resources may purchases. According to [6], falsification accounts are the
not be effective. Hence, the aim of this paper is to propose and greatest type of card fraud among the other different methods of
evaluate several models in detecting the credit card fraud, such as obtaining other personal details to get a legal card which
Random Forest, XGBoost, and Artificial Neural Network. From afterwards can be duplicated and used without the permission of
the gathered dataset, we found that the ratio between fraud and
the cardholder. In contrary, stealing a credit card is a minor type
non-fraud class are not balanced. Hence, we decided to conduct
several sampling methods, such as Random Undersampling and
of fraud.
SMOTE. Based on the results, all models conducted in this Once fraudsters successfully obtain personal details from the
research are performing quite well without any help from the cardholder, they begin to use this opportunity to create a fraud
sampling methods. Furthermore, it is found that Random card to do transactions illegally. This dangerous incident caused
Undersampling caused a negative performance in detecting credit many cardholders to become frustrated since they were not
card fraud. Moreover, models that are conducted with SMOTE capable of reporting the theft, loss, or fraudulent use of the card
show a relatively balanced between precision and recall. [7]. It is estimated that the worldwide card fraud accounts are
about 0.055 percent of the sum of all credit card accounts [6].
Keywords—Credit Card Fraud, Machine Learning, Sampling, Statistics from [8] believed that these number of credit card
Random Forest, XGBoost, Artificial Neural Network frauds may cause loss which about $1 billion and it was expected
to reach more than $3 billion in future. These enormous number
I. INTRODUCTION of losses pose a threat to many enterprises and public institutions
where they must face a growing presence of fraudulent activities
The popularity of credit card payments is continuously and at the same time, they must find an automatic system that is
increasing as people move further to online shopping and capable of detecting fraud. For this case, automatic systems are
technological developments. Most people use a card-not-present far more effective due to the incapability of humans detecting
transaction through online payment systems to make payment in fraudulent patterns in transaction datasets that are often provided
e-commerce or other transactions [1]. This integration between by a vast number of samples that consist of many labels and
a credit card and e-payment platform brings convenience to online updates [7].
many people in their daily life. For this reason, the usage of As credit cards have assisted the needs of many people, of
credit cards has started to spread all over the world, which causes course, they have some drawbacks, including security, and this
credit cards slowly to become the most popular and efficient loophole that is used by irresponsible people to take advantage
means of payment [2]. Due to these large usage levels, it is of these loopholes for their own benefit which can harm others.
claimed that it may lure fraudsters to commit more criminal This loss can be categorized as an economic loss that can be felt
activities, including credit card fraud [3]. by both the client and the bank itself. For this reason, a model
Fraud is defined as any activity that involves deceiving that is capable of detecting fraud is important to avoid any
another for the purpose of obtaining a gain such as money or unintended economic consequences that could result in a bad
property [4]. With fraud being so common, there are numerous way [6].
ways to categorize it, and credit card fraud is one of them. In There are many types of algorithms that are used for model
general, there are two types of credit card fraud, such as detection. Most studies that are conducting research about
• How individual trees are constructed. This section involves building the ANN model in
detecting credit card fraud. ANN (Artificial Neural
• Based on the procedure used to generate
Network) is a model that consists of several connected
modified data sets on each tree.
layers where each layer contains a certain purpose. There
• The aggregation of each prediction on each tree
are 3 typical layers in ANN, such as input layer, hidden
to produce unique consensus prediction.
layer, and output layer. The input layer is the beginning
For the Random Forest that we implemented, each tree
layer for the workflow for ANN that used to receive
uses decrease of Gini impurity (DGI) as a splitting
variable input. The hidden layer is the layer located
criterion and selects the splitting predictor from a random
between the input and output layer that is used to
selected subset of predictors, and the predictions from the
transform the value according to the assigned function.
trees are aggregated through majority voting.
The output layer is the last layer that produces the result
Furthermore, RF has a feature called out-of-bag (OOB)
of the ANN.
error. OOB error is the average error frequency obtained
The implementation of ANN starts with deciding what
from data set observations that are predicted by the trees
layers are going to be used in the network. The detailed
which are OOB. This validation can be a good estimator
list of layers in ANN is provided sequentially in Table VI.
of the errors that are to be expected for independent data.
The model is also added with Adam optimizer to modify
The implementation of Random Forest is used from
the attributes in the ANN. The loss function that is used
ensemble learning module that is provided by Sklearn
in this model is binary cross entropy. Moreover, every
library. To improve the model’s performance, we decided
implementation of ANN is used from the Keras module
to set some of the parameters which can be seen in Table
that is provided by TensorFlow library. The layers are
IV. The parameters setting is applied to all Random Forest
implemented by using the Keras Sequential model.
models.
TABLE VI. LIST OF LAYERS IN ANN
TABLE IV. PARAMETERS SETTING ON RANDOM FOREST
Layer form Description
Parameter form Value
Input layer Receive the training dataset
Number of trees 200
Output 300 units with ReLU
Maximum depth of the tree 15 Dense layer (ReLU activation)
activation
Criterion split Gini Batch normalization Normalize values
Minimum number of samples to split 2 Randomly set input to 0 with the
Dropout
Minimum number of samples to be rate of 0.3 (prevent overfitting)
1 Output 300 units with ReLU
leaf node Dense layer (ReLU activation)
Maximum leaf nodes None activation
Batch normalization Normalize values
Maximum samples None
Randomly set input to 0 with the
Number of jobs run in parallel None Dropout
rate of 0.3 (prevent overfitting)
Output layer with Sigmoid
Dense layer (Sigmoid activation)
b. XGBoost activation (value either 0 or 1)
This section involves building the XGBoost model in After the model is compiled, then the model can directly
detecting credit card fraud. XGBoost (Extreme Gradient fit the given training dataset. To improve the model's
Boosting) is an ensemble learning method that performance, there are several parameters that need to be
implements several machine learning algorithms under assigned to help the model perform effectively in the
the gradient boosting framework [40]. The training. Moreover, we also decided to use early stopping
implementation of the model is used from the XGBoost in the ANN to prevent the model from becoming
library. To improve the model's performance, we are
overfitting. Early stopping is activated when the model in predicting positive class (fraud) but performing well in
did not gain any improvement in reducing the training loss predicting negative class (non-fraud). Therefore, Random
in certain epochs. If the model is stopped early, then the Undersampling is not an effective method for the credit card
result of the training will return the model that performs fraud detection.
the least loss. Moreover, the parameters setting is Furthermore, models conducted with SMOTE bring a
provided in Table VII. balance precision-recall score for Random Forest and ANN. On
the other hand, XGBoost conducted with SMOTE is showing a
TABLE VII. PARAMETER SETTINGS ON ANN poor performance in precision. The XGBoost is overfitting due
Parameter form Value to the excessive number of samples. Hence, SMOTE method
Batch size 2100
may need to be considered for certain model.
Number of epochs 100 V. CONCLUSIONS
Minimum improvement 0.001
This paper presented the results of Random Forest,
Number of epochs to wait if there is no improvement 5
XGBoost, and ANN in detecting credit card fraud. There are
two sampling methods for dealing with imbalance dataset
IV. RESULTS AND DISCUSSION which are Random Undersampling and SMOTE. Overall, the
models are still performing quite good without any help from
This section shows the results of several models with the sampling methods. Random Undersampling may not be
different kind of sampling methods in dealing with imbalanced appropriate for improving the model performance since it is
dataset. Each model was trained and evaluated using the credit randomly removed majority class which it can waste certain
card fraud dataset. After that, it is followed up with a discussion potential information. SMOTE may be suitable for certain
about the relation between each model performance. models that are not too sensitive to overfitting. It can be seen
Due to imbalance dataset, evaluation metrics need to be from the results that Random Forest and ANN shows a balance
discussed prior. As suggested from research [36], precision- score between precision and recall. Nevertheless, conducted
recall metrics are relatively better in measuring model models can still be improved with other kind of methods and
performance when the classes are imbalance. It is claimed that different sets of parameters. Hence, more research is needed.
precision-recall metrics are more sensitive to imbalance classes. Moreover, proposed sampling methods may not fully improve
Hence, precision-recall metrics such as precision, recall, and the model performance in detecting credit card fraud.
AUC-PR (area under curve in precision-recall curve) are Therefore, this topic can become a future study to find an
assigned as the evaluation metrics for this research. effective method in dealing with imbalanced dataset.
TABLE VIII. LIST OF MODELS PERFORMANCE
REFERENCES
Model Precision Recall AUC-PR
[1] S. Gupta and R. Johari, “A new framework for credit card transactions
RF 92.79 69.59 81.05 involving mutual authentication between cardholder and merchant,” in
RF + RU 7.08 85.81 46.28 Proceedings - 2011 International Conference on Communication Systems
and Network Technologies, CSNT 2011, 2011, pp. 22–26. doi:
RF + SMOTE 72.56 80.41 76.33
10.1109/CSNT.2011.12.
XGB 81.67 66.22 73.80
[2] J. M. Pavía, E. J. Veres-Ferrer, and G. Foix-Escura, “Credit card incidents
XGB + RU 3.67 87.16 45.25 and control systems,” International Journal of Information Management,
XGB + SMOTE 13.34 81.76 47.39 vol. 32, no. 6, pp. 501–503, 2012, doi: 10.1016/j.ijinfomgt.2012.03.003.
ANN 90.08 73.65 79.93 [3] A. Somasundaram and S. Reddy, “Parallel and incremental credit card
fraud detection model to handle concept drift and data imbalance,” Neural
ANN + RU 6.72 85.81 34.12
Computing and Applications, vol. 31, pp. 3–14, 2019, doi:
ANN + SMOTE 82.22 75.00 77.92 10.1007/s00521-018-3633-8.
RF: Random Forest [4] [4] I. Sadgali, N. Sael, and F. Benabbou, “Performance of machine
XGB: XGBoost learning techniques in the detection of financial frauds,” in Procedia
ANN: Artificial Neural Network Computer Science, 2019, vol. 148, pp. 45–54. doi:
RU: Random Undersampling 10.1016/j.procs.2019.01.007.
SMOTE: Synthetic Minority Oversampling Technique
[5] S. Xuan, G. Liu, Z. Li, L. Zheng, S. Wang, and C. Jiang, “Random forest
for credit card fraud detection,” in 2018 IEEE 15th International
Table VIII shows the performance scores of precision, Conference on Networking, Sensing and Control (ICNSC), 2018, pp. 1–
recall, and AUC-PR of all models described in the previous 6. doi: 10.1109/ICNSC.2018.8361343.
section. Based on the results, Random Forest without any [6] J. M. Pavía, E. J. Veres-Ferrer, and G. Foix-Escura, “Credit card incidents
sampling method achieved the highest precision and AUC-PR and control systems,” International Journal of Information Management,
vol. 32, no. 6, pp. 501–503, 2012, doi: 10.1016/j.ijinfomgt.2012.03.003.
which are 92.79 and 81.05. On the other hand, XGBoost with
[7] A. Dal Pozzolo, O. Caelen, Y. A. le Borgne, S. Waterschoot, and G.
Random Undersampling achieved the highest recall which is Bontempi, “Learned lessons in credit card fraud detection from a
87.16. practitioner perspective,” Expert Systems with Applications, vol. 41, no.
Models conducted with Random Undersampling have a 10, pp. 4915–4928, 2014, doi: 10.1016/j.eswa.2014.02.026.
poor precision score and decent recall score. This means that [8] ACFE, “The 2007 Fraud Examiners Manual,” ACFE, 2007.
the models with Random Undersampling are underperformed [9] G. Pang, C. Shen, and A. van den Hengel, “Deep anomaly detection with
deviation networks,” in Proceedings of the ACM SIGKDD International
Conference on Knowledge Discovery and Data Mining, Jul. 2019, pp. Conference on Intelligent Computing and Control Systems (ICICCS), pp.
353–362. doi: 10.1145/3292500.3330871. 1264–1270, 2020.
[10] A. RB and S. K. KR, “Credit card fraud detection using artificial neural [26] Trivedi, Naresh & Simaiya, Sarita & Kumar Lilhore, Dr & Sharma, and
network,” Global Transitions Proceedings, vol. 2, no. 1, pp. 35–41, Jun. Sanjeev, “An Efficient Credit Card Fraud Detection Model Based on
2021, doi: 10.1016/j.gltp.2021.01.006. Machine Learning Methods,” MATTER: International Journal of Science
[11] T. Sarkar, “XBNet : An Extremely Boosted Neural Network,” Jun. 2021, and Technology, 2020.
[Online]. Available: http://arxiv.org/abs/2106.05239 [27] P. Th. Ib. Sk. Sm. M, “Credit Card Fraud Detection Using Deep Learning
[12] D. and T. Y. and Z. L. Fu Kang and Cheng, “Credit Card Fraud Detection Technique,” Proceedings - 2018 4th International Conference on
Using Convolutional Neural Networks,” in Neural Information Advances in Computing, Communication and Automation, ICACCA
Processing, 2016, pp. 483–490. 2018 (2018), pp. 32–36, 2018, doi: 10.1109/RAICS51191.2020.9332497.
[13] S. Xuan, G. Liu, Z. Li, L. Zheng, S. Wang, and C. Jiang, “Random forest [28] J. Jurgovsky et al., “Sequence classification for credit-card fraud
for credit card fraud detection,” in ICNSC 2018 - 15th IEEE International detection,” Expert Systems with Applications, vol. 100, pp. 234–245, Jun.
Conference on Networking, Sensing and Control, 2018, pp. 1–6. doi: 2018, doi: 10.1016/j.eswa.2018.01.037.
10.1109/ICNSC.2018.8361343. [29] F. Zhang, G. Liu, Z. Li, C. Yan, and C. Jiang, GMM-based
[14] V. N. Dornadula and S. Geetha, “Credit Card Fraud Detection using Undersampling and Its Application for Credit Card Fraud Detection.
Machine Learning Algorithms,” in Procedia Computer Science, 2019, 2020. [Online]. Available: http://www.ieee.org/publications
vol. 165, pp. 631–641. doi: 10.1016/j.procs.2020.01.057. [30] H. Wang, P. Zhu, X. Zou, and S. Qin, “An ensemble learning framework
[15] K. Gupka and V. Mall, “Comparative Analysis of Classification for credit card fraud detection based on training set partitioning and
Techniques for Credit Card Fraud Detection,” International Research clustering,” Proceedings - 2018 IEEE SmartWorld, Ubiquitous
Journal of Computer Science, 2022, doi: 10.26562/irjcs.2022.v0902.00. Intelligence and Computing, Advanced and Trusted Computing, Scalable
Computing and Communications, Cloud and Big Data Computing,
[16] P. H. Tran, K. P. Tran, T. T. Huong, C. Heuchenne, P. HienTran, and T. Internet of People and Smart City Innovations,
M. H. Le, “Real Time Data-Driven Approaches for Credit Card Fraud SmartWorld/UIC/ATC/ScalCom/CBDCo, pp. 94–98, 2018, doi:
Detection,” in Proceedings of the 2018 International Conference on E- 10.1109/SmartWorld.2018.00051.
Business and Applications, 2018, pp. 6–9. doi:
10.1145/3194188.3194196. [31] S. Mittal and S. Tyagi, “Performance Evaluation of Machine Learning
Algorithms for Credit Card Fraud Detection,” 2019 9th International
[17] A. Thennakoon, C. Bhagyani, S. Premadasa, S. Mihiranga, and N. Conference on Cloud Computing, Data Science & Engineering
Kuruwitaarachchi, “Real-time Credit Card Fraud Detection Using (Confluence), pp. 320–324, 2019.
Machine Learning,” 2019 9th International Conference on Cloud
Computing, Data Science & Engineering (Confluence), pp. 488–493, [32] V. N. Dornadula and S. Geetha, “Credit Card Fraud Detection using
2019. Machine Learning Algorithms,” in Procedia Computer Science, 2019,
vol. 165, pp. 631–641. doi: 10.1016/j.procs.2020.01.057.
[18] S. Khatri, A. Arora, and A. P. Agrawal, “Supervised Machine Learning
Algorithms for Credit Card Fraud Detection: A Comparison,” 2020 10th [33] U. Fiore, A. de Santis, F. Perla, P. Zanetti, and F. Palmieri, “Using
International Conference on Cloud Computing, Data Science & generative adversarial networks for improving classification effectiveness
Engineering (Confluence), pp. 680–683, 2020. in credit card fraud detection,” Information Sciences, vol. 479, pp. 448–
455, 2019, doi: https://doi.org/10.1016/j.ins.2017.12.030.
[19] C. V. Priscilla and D. P. Prabha, “Influence of optimizing xgboost to
handle class imbalance in credit card fraud detection,” Proceedings of the [34] Y. Lucas et al., “Multiple Perspectives HMM-Based Feature Engineering
3rd International Conference on Smart Systems and Inventive for Credit Card Fraud Detection,” in Proceedings of the 34th
Technology, ICSSIT 2020, no. Icssit 2020, pp. 1309–1315, 2020, doi: ACM/SIGAPP Symposium on Applied Computing, 2019, pp. 1359–
10.1109/ICSSIT48917.2020.9214206. 1361. doi: 10.1145/3297280.3297586.
[20] A. S. Hussein, R. S. Khairy, S. M. Mohamed Najeeb, and H. T. Salim [35] K. Divakar, “Performance Evaluation of Credit Card Fraud Transactions
ALRikabi, “Credit Card Fraud Detection Using Fuzzy Rough Nearest using Boosting Algorithms,” 2019.
Neighbor and Sequential Minimal Optimization with Logistic [36] S. Makki, Z. Assaghir, Y. Taher, R. Haque, M. S. Hacid, and H.
Regression,” International Journal of Interactive Mobile Technologies, Zeineddine, “An Experimental Study With Imbalanced Classification
vol. 15, no. 5, pp. 24–42, 2021, doi: 10.3991/ijim.v15i05.17173. Approaches for Credit Card Fraud Detection,” IEEE Access, vol. 7, pp.
[21] I. Sohony, R. Pratap, and U. Nambiar, “Ensemble Learning for Credit 93010–93022, 2019, doi: 10.1109/ACCESS.2019.2927266.
Card Fraud Detection,” in Proceedings of the ACM India Joint [37] Y. Sahin and E. Duman, “Detecting credit card fraud by ANN and logistic
International Conference on Data Science and Management of Data, regression,” in 2011 International Symposium on Innovations in
2018, pp. 289–294. doi: 10.1145/3152494.3156815. Intelligent Systems and Applications, Jun. 2011, pp. 315–319. doi:
[22] A. A. Taha and S. J. Malebary, “An Intelligent Approach to Credit Card 10.1109/INISTA.2011.5946108.
Fraud Detection Using an Optimized Light Gradient Boosting Machine,” [38] T. Hasanin and T. Khoshgoftaar, “The Effects of Random Undersampling
IEEE Access, vol. 8, pp. 25579–25587, 2020, doi: with Simulated Class Imbalance for Big Data,” in 2018 IEEE
10.1109/ACCESS.2020.2971354. International Conference on Information Reuse and Integration (IRI),
[23] S. P. Maniraj, A. Saini, S. Ahmed, and S. D. Sarkar, “Credit Card Fraud 2018, pp. 70–79. doi: 10.1109/IRI.2018.00018.
Detection using Machine Learning and Data Science,” [39] A. L. Boulesteix, S. Janitza, J. Kruppa, and I. R. König, “Overview of
INTERNATIONAL JOURNAL OF ENGINEERING RESEARCH & random forest methodology and practical guidance with emphasis on
TECHNOLOGY (IJERT), vol. 8, no. 9, 2019. computational biology and bioinformatics,” Wiley Interdisciplinary
[24] Rajora et al., “A Comparative Study of Machine Learning Techniques for Reviews: Data Mining and Knowledge Discovery, vol. 2, no. 6, pp. 493–
Credit Card Fraud Detection Based on Time Variance,” pp. 1958–1963, 507, Nov. 2012, doi: 10.1002/widm.1072.
2018. [40] T. Chen and C. Guestrin, “XGBoost: A scalable tree boosting system,” in
[25] R. Sailusha, V. Gnaneswar, R. Ramesh, and G. R. Rao, “Credit Card Proceedings of the ACM SIGKDD International Conference on
Fraud Detection Using Machine Learning,” 2020 4th International Knowledge Discovery and Data Mining, Aug. 2016, vol. 13-17-August-
2016, pp. 785–794. doi: 10.1145/2939672.2939785.