Paper8 20341
Paper8 20341
2, March 2023
Abstract: Recently, with the development of online transactions, the credit-card transactions begun to be the most prevalent
online payment methods. Credit-card fraud refers to the use fake Credit-Cards to purchase goods without paying. With the fast
research and development in the area of information technology and data mining methods including the neural networks and
decision trees, to advanced machine learning and deep learning methods, researchers have proposed a wide range of
antifraud systems. Mainly, the Machine Learning (ML) and Deep Learning (DL) methods are employed to perform the fraud
detection task. This paper aims to explore the existing credit-card fraud detection methods, and categorize them into two main
categories. In addition, we investigated the deployment of neural network models with credit-card fraud detection problem,
since we employed the Artificial Neural Network (ANN) and Convolutional Neural Network (CNN). ANN and CNN models are
implemented and assessed using a credit-card dataset. The main contribution of this paper focuses on increasing the fraud-
detection classification accuracy through developing an efficient deep neural network model.
Keywords: Credit-card, fraud detection, machine learning, deep learning, neural networks, classifications.
fraud detection models. In section three, the experiment showed that these two methods increase the
setup is discussed in details, whereas in Section four, accuracy of the prediction process.
the results obtained from real experiments are presented
Feature mining used to extend the features of credit-
and analysed. Section five discusses the results of the
card transaction with time dimension to categorize the
ANN and CNN models, and finally, Section six,
distinct payment habits for legal users and criminals,
concludes the work presented in this paper and presents
the other methods was Capsule Network (CapsNet)
future works.
employed to further pick other deep features base on
the extended features. CapsNet is a powerful feature
2. Related Works extraction model, which further increases the
The credit-card fraud detection issue is one of the most efficiency of the fraud detection model. Although the
discovered domains of fraud detection, and it depends CapsNet offers the best performance, but it still has a
on automatic analysis of documented transactions to number of limitations, as with large time consumption
detect fraudulent actions [6]. Lucas [4], introduced an [23]. Chen et al. [5], combined the sparse autoencoder
exhaustive comparison of a large number of algorithms (SAF) and discriminator of Generative Adversarial
and modelling techniques on two real datasets, where Networks (GAN) to perceive whether a certain
authors focused on testing three different supervised transaction is fraud or not. The experimental results
algorithms: NN, Random Forests (RF), and Support show that the combined solution offers a significant
Vector Machine (SVM). They revealed that RF method increment in the detection accuracy.
clearly outperforms its competitors and accuracy is The recent developed systems offer reasonable
improved by increasing the training size. credit-card fraud detection accuracy; however, the
According to [17], 49 different supervised learning fraud detection accuracy must be high. Therefore, in
techniques are reviewed, where authors conclude that this paper, we focus on developing an accurate credit-
decision trees, NN, SVM, and logistic regression are card fraud detection system using deep neural
employed more than others. Maes et al. [15], applied networks.
two ML techniques, Artificial Neural Networks (ANN) In this article used the ANN and Convolutional
and Bayesian Belief Networks (BBN), and study the Neural Network (CNN) with and without pooling, in
impact of those techniques on real world financial data. order to detect fraud [9, 10]. CNN is better to convert
The main idea is correctly classify a transaction that it the data to picture and train the CNN to detect the
has never ever seen before as fraudulent or not. Pillai et fraud. From the previous, this article introduce the
al. [18], the authors aimed to offer a guidance on how best accuracy reach to more than 99%. In all the
to pick the finest model to achieve the optimal results previous this search on the high accuracy.
with the minimal cost, using an efficiency of Multi-
Layer Perception (MLP). The results show the highest 3. Methodology
precision 96%. The benefit of auto-encoder method is
The credit-card fraud detection problem involves
the generality virtues, and has the ability to work with
modelling past credit-card transactions with the
huge datasets. Because of the large number of
previous knowledge of existing transactions that
behaviours of customers in the banking transactions,
turned out to be fraud. This section covers the
the extracting of the appropriate features to detect the
experimental setup including the development
fraudulent is a very complex task. Therefore,
environment, the selected credit-card dataset, and
employing deep auto-encoder is a beneficial idea to
experimental setup.
solve out the aforementioned issue [11].
Unsupervised fraud detection system by auto-
3.1. Development Environment
encoder-based clustering used to detect the fraud
transactions in unsupervised manner. The results from For evaluation purposes, several experiments have
applying k-means clustering appear that accuracy of been conducted in order to validate the developed
98.7% was achieved [24]. Shenvi et al. [22], proposed a models’ efficiency. This section discusses the
credit-card fraud detection system using DL neural development environment, that includes the
networks. Author reveals that even if the NN is trained followings:
over a huge number of iterations, it is not accurate
1. Colab or Colaboratory: is a cloud and supports free
enough to classify the transactions data as fraudulent or
GPU. Moreover, Colab supports many popular ML
non-fraudulent because of the skewness of the dataset.
libraries such as Tensorflow and Keras. We apply
On the other hand, author proposed two sampling
our experiments on Colab environment.
mechanisms named:
2. TensorFlow: is an open-source library for
1. The under-sampling, through reducing the number of numerical computations and large-scale ML. We
non-fraudulent observations. used TensorFlow library to execute the
2. The over-sampling, where the fraudulent class experiments.
observations are duplicated. The obtained results 3. Keras: is a neural network library running on the
236 The International Arab Journal of Information Technology, Vol. 20, No. 2, March 2023
top of Tensorflow. Keras was designed to offer fast correlation matrix shows that none of the V1 to V28
experimentation and help the user to apply NN in components have any correlation to each other.
easy methods. We used the Keras library command Moreover, the Class attribute has no correlation with
to achieve experiments. Amount and Time attributes, whereas in various cases,
the Class attribute has positive and negative
3.2. Dataset correlations with some V attributes.
After considering an extensive search on the available
Credit-card datasets, a few credit-card transaction
datasets are available online. This is because, Credit-
card transactions contain sensitive information which
must be kept secure and unrevealed. In this Section, he
selected credit-card dataset is discussed and analysed.
The Credit-card Fraud Detection dataset at Kaggle
consists of credit-card transactions made in September
2013 by the European cardholders for two days [4]. The
selected credit-card dataset has been adopted in many
research works [1, 8, 12], and this indicates the
importance of the selected dataset. Table 1, shows
general statistics about the credit-card dataset.
The selected credit-card dataset consists of 248,807
transaction records where very few transactions are
actually fraudulent (0.1727%) 492 fraud transactions;
this means that this dataset is highly unbalanced. The
dataset contains numerical input variables, which are Figure 1. The heat map for the credit-card dataset.
the results of Principal Component Analysis (PCA)
transformation. This dataset does not deliver the 3.3. Neural Network Models
original features and clarifications about the data.
Features V1, V2, V3, V28 are the principal In this section, the neural network models are
component values acquired with PCA. However, there discussed in details: ANN, and CNN. The defined
models are then used to identify whether a new
is no metadata about the original featured provided,
therefore pre-analysis or feature study could not be transaction is normal or fraudulent ones. The main aim
accomplished. On the other hand, the Time and of the implemented prediction models is to detect
Amount features are not transformed data, and the maximum possible ratio of the fraudulent transactions
dataset does not contain any missing data. Since all while reducing the number of incorrect fraud
features presented in the credit-card dataset are classifications. Figure 2, presents the developed ANN
anonymous, Time and Amount features will be model for fraud-detection in credit-card transactions.
analysed. The designed ANN model is based on Sequential
model, which is appropriate for a plain stack of layers.
Table 1. Credit-card dataset general statistics.
Parameter name Total # Input Hidden Hidden Hidden Output
Total number of transactions 284,807 layer layer 1 layer 2 layer 3 layer
Total number of columns 31
Total number of features 28 Input #1
Total number of labels 1 0 0 0
Total number of normal transactions 284,315
Total number of fraudulent transactions 492 Input #2
% of fraudulent transactions 00.1727% 1 1 1
% of normal transactions 99.8273% Result
Input #3
There are three non-transformed values: Time, 2 2 2
Amount, and Class. The 'Time' attribute includes the . . . .
seconds passed between any transaction and the 1st . . . .
transaction in the dataset. On the other hand, the feature . . . .
'Amount' is the total amount for each transaction.
Input #29 255 127 63
Moreover, feature 'Class' is the type of transaction
value; it is '0' for normal transaction and '1' for fraud Figure 2. The credit-card of the ANN model.
transaction. Figure 1, presents the heat map for the
credit-card attributes in the credit-card dataset, where Convolutional networks are neural networks that
there is a high correlation between the Time and V3, employ convolution in place of general matrix
Amount and V2, and Amount and V4. In addition, the multiplication in at least one of the CNN layers. As
Credit-card Fraud Detection System using Neural Networks 237
with normal neural network model, the CNN contains the NN model, and it is used once the NN model is
an input and output layers, in addition to multiple completely trained. Table 2, presents general statistics
hidden layers. However, in the CNN, the hidden layers for the credit-card dataset, where it consists of number
consist of a series of convolutional layers that convolve of train, validation, and testing records.
with a multiplication. In this paper, a one-dimensional
Table 2. Statistics of the credit-card dataset.
CNN model is adopted for credit-card fraud detection.
The CNN architecture is presented in Figure 3. On the Parameter name Normal Fraud
Training records 159,207 284
other hand, in this paper we study the performance of Validation records 39,812 61
the Pooling layer with the one-dimensional CNN Testing records 85,296 147
model, therefore, another CNN model for credit-card Transaction records 284,315 492
Input #2
Result
Input #3
. .
. . . . . .
. . . . . .
. . . .
Input #29
4. Results
This section discusses the real experiments, which have
been conducted in order to validate the developed
credit-card fraud detection system. For both models
(ANN and CNN), the training dataset consists of
samples of data used to fit the ANN and CNN models, Figure 5. The training loss graph for the ANN model.
where the NN model sees and learns from the training
dataset. On the other hand, the validation dataset is
used to evaluate the NN model and tune the model
hyper-parameters. The validation dataset helps during
the development phase of the NN model. Finally, the
testing dataset, offers the gold standard used to assess
238 The International Arab Journal of Information Technology, Vol. 20, No. 2, March 2023
Figure 6. The training loss graph for the CNN model with Pooling
layer.
Figure 9. The training accuracy graph for the CNN model with
Pooling layer.
Figure 7. The training loss graph for the CNN model without
Pooling layer.
Figure 10. The training accuracy graph for the CNN model
without Pooling layer.
Credit-card Fraud Detection System using Neural Networks 239
4.2. Results of Classifications On the other hand, the CNN model is one of the
most popular models employed nowadays. CNN
This section discusses the classification results for the model is a class of deep neural networks, which is
three models: ANN, CNN with Pooling layer and CNN most commonly used to analyse visual imagery. CNN
without Pooling layer. After considering several learns the filters in an autonomous way without
experiments, Table 3, shows the classification report mentioning it explicitly, where these filters help in
for the ANN classification, which determines the extracting the correct and relevant features from the
quality of predictions. In ANN model, the False input dataset. CNN uses various multilayer
Negative Rate (FNR) is almost 23%, this is because the perceptions and includes one or more convolutional
selected credit-card dataset is unbalanced, where the layers, which can be either completely connected or
fraud transaction rate is very low. On the other hand, pooled. In CNN, the convolutional layers are very
the False Positive Rate (FPR) is a quite low with effective in learning low-level features and hence
0.018%, since the normal transaction records are high increase the efficiency of choosing the correct features
in total. On the other hand, Table 4, shows the
from the credit-card dataset. The main advantage of
classification report for the CNN model, and Table 5,
convolutional layers is to create a feature maps
presents the CNN without pooling layer classification without human supervision.
report. As presented below, CNN without pooling layer In CNN model, the Pooling layer usually applied
achieves better results in classifying the fraud after the convolutional layer in order to minimize the
transactions than the CNN with pooling layer. Both spatial size of the input array, hence, pooling layer
models (CNN with Pooling layer and CNN without aims to minimize the number of training parameters,
pooling layer) offer high precision in classifying the and therefore governing the overfitting. In this paper,
normal transactions. In overall, the CNN without two different CNN models have been experimented,
Pooling layer offers better results than the CNN with as follows: CNN model with pooling layer, and CNN
Pooling layer and the ANN models. model without pooling layer, in order investigate the
Table 3. ANN classification report for the testing dataset. effect of pooling layer on the credit-card fraud
Class Precision recall F1-score support detection problem. As presented in section 4,
0 1.00 1.00 1.00 85296 employing Pooling layers with CNN does not usually
1 0.96 0.53 0.68 147 enhance the efficiency of the credit-card fraud
Accuracy 1.00 85443 detection model. Hence, the Pooling is loss and does
Macro average 0.98 0.77 0.84 85443 not reserve all the spatial information well by
Weighted average 1.00 1.00 1.00 85443 dropping spatial resolution. In addition, Max Pooling
Table 4. CNN with pooling layer classification report. selects discrete maximum values of the input array of
features, which is not truly the maximum. As
Class Precision recall F1-score support
0 1.00 1.00 1.00 85,307 presented earlier in section 4, the CNN model
1 0.74 0.87 0.80 136 achieves low FNR (13%) whereas the ANN achieves
almost (46%), and therefore CNN model is more
Accuracy 1.00 85,443
Macro average 0.87 0.93 0.90 85,443 secure credit-card fraud detection model, since rarely
Weighted average 1.00 1.00 1.00 85,443 the CNN model predicts a fraud transaction as a
normal transaction. On the other hand, the CNN with
Table 5. CNN without pooling layer classification report.
pooling layer offers the best True Positive Rate (TPR)
Class Precision recall F1-score support
0 1.00 1.00 1.00 85,307
with (86.76%), the CNN without pooling layer
1 0.83 0.84 0.84 136 (83.82%), and the ANN model (77.23%). This result
better than using other algorithm such as [3, 14].
Accuracy 1.00 85,443
Macro average 0.92 0.92 0.92 85,443
The loss and metric values are also studied for each
Weighted average 1.00 1.00 1.00 85,443 experimented model. Table 6, presents the loss and
metrics values for the ANN, CNN with pooling layer,
5. Discussion and the CNN without pooling layer. As presented, the
CNN model without pooling layer achieves the best
In this paper, two main NN algorithms (ANN and results in terms of loss and metrics values.
CNN) have been employed, implemented, and
experimentally tested for credit-card fraud detection Table 6. Loss and metrics for the ANN and CNN models.
applications. ANN model is able of learning any Parameter name Normal Fraud
nonlinear function, and has the capacity to learn NN model 0.00392 0.94986
CNN model with Pooling Layer 0.00301 0.95855
weights that map any input value to any output value. CNN model without Pooling Layer 0.00244 0.96991
Moreover, activation function plays a significant rule to
adapt nonlinear functions, and helps the network to The F1-score is also evaluated for the three models.
learn any complex relationship between the input and F1-score is the weighted average of precision and
output values. recall, where both the false positives and false
240 The International Arab Journal of Information Technology, Vol. 20, No. 2, March 2023
negatives are taken into account. F1-score is considered Credit Card Fraud Detection,” Expert Systems
as more useful than accuracy when evaluating any with Applications, vol. 51, pp. 134-142, 2016.
classification model, and especially when the dataset is [2] Bhattacharyya S., Jha S., Tharakunnel K., and
unbalanced. Accuracy is more useful when the false Westland J., “Data Mining for Credit Card
positives and false negatives are almost equal (balanced Fraud: A Comparative Study,” Decision Support
dataset), however, with the selected dataset the F1- Systems, vol. 50, no. 3, p. 602-613, 2011.
score is more significant to assess the employed ANN [3] Buonaguidi B., Mira A., Bucheli H., and Vitanis
models. As presented in Table 7, the CNN model V., “Bayesian Quickest Detection of Credit Card
without pooling layer achieves the best F1-score, Fraud,” Bayesian Analysis, vol. 17, no.1, pp. 1-
whereas the CNN model with pooling layer comes in 30, 2021.
the second place, because using pooling leads to reduce [4] Cardholders E., “Credit-card Fraud Detection
the visibility, and the worse F1-score was with the NN Dataset [cited; Available
model. from:https://www.kaggle.com/mlg-
ulb/creditcardfraud, Last Visited, 2021.
Table 7. Evaluating of F1-score for the three classifiers.
[5] Chen J., Shen Y., and Ali R., “Credit Card Fraud
Parameter name F1-score Detection Using Sparse Autoencoder and
ANN model 71.01%
CNN model with Pooling Layer 81.38% Generative Adversarial Network,” in
CNN model without Pooling Layer 83.72% Proceedings of IEEE 9th Annual Information
Technology, Electronics and Mobile
According to [2, 16], experimental results offers the Communication Conference, Vancouver, 2018.
best accuracy result (99.47%). The proposed system [6] Dal Pozzolo A., Caelen O., Le Borgne Y.,
achieves (99.64%) accuracy better than [21]. In [7], Waterschoot S., and Bontempi G., “Learned
proposed a Credit-Card fraud detection model using Lessons in Credit Card Fraud Detection from A
ANN and Back propagation, the experimental results Practitioner Perspective,” Expert Systems with
show high accuracy (99.76%) compared to the existing applications, vol. 41, no.10, pp. 4915-4928,
models. However, the implemented CNN model in this 2014.
work achieves higher accuracy (99.81%), and this [7] Dubey S., Mundhe K., and Kadam A., “Credit
indicates the significance of the developed CNN model. Card Fraud Detection using Artificial Neural
As a result, the developed deep neural network Network and BackPropagation,” in Proceedings
model achieves efficient classification accuracy, and of 4th International Conference on Intelligent
offers an improvement in the classification accuracy Computing and Control Systems, Madurai, 2020.
over the existing credit-card fraud detection systems. [8] Fiore U., De Santis A., Perla F., Zanetti P., and
Palmieri, F., “Using Generative Adversarial
6. Conclusions and Future Work Networks for Improving Classification
Effectiveness in Credit Card Fraud Detection,”
This paper aims to investigate the existing credit-card
Information Sciences, vol. 479, pp. 448-455,
fraud detection methods, and to design and implement a
2019.
credit-card fraud detection method using NN models.
[9] Gholamalinezhad H. and Khosravi H., “Pooling
The recent credit-card fraud detection systems are
Methods in Deep Neural Networks, a Review,”
categorized, presented, analysed, and discussed. In
arXiv preprint arXiv:2009.07485, 2020.
addition, two different NN models have been
[10] Hussain F., Abbas S., Husnain M., Fayyaz U.,
experimentally tested, where the performance for each
Shahzad F., and Shah G., “IoT DoS and DDoS
model has been assessed through analysing several
Attack Detection using ResNet,” in Proceedings
parameters. The effect of pooling layer in CNN models
of IEEE 23rd International Multitopic
is also studied, analysed, and experimentally tested. As
Conference, Bahawalpur, 2020.
a result, the developed deep neural network model
[11] Kazemi Z. and Zarrabi H., “Using Deep
offers efficient classification accuracy. For future work,
Networks for Fraud Detection in The Credit
we aim to consider balanced credit-card dataset in order
Card Transactions,” in Proceedings of IEEE 4th
to assess the performance of the developed ANN and
International Conference on Knowledge-Based
CNN model. In addition, we aim to implement machine
Engineering and Innovation, Tehran, 2017.
learning models to assess the precision and accuracy for
[12] Lakshmi S. and Kavilla S., “Machine Learning
these models, and compare the obtained results with the
for Credit Card Fraud Detection System,”
deep neural network models.
International Journal of Applied Engineering
Research, vol. 13, no. 24, pp. 16819-16824,
References 2018.
[1] Bahnsen A., Aouada D., Stojanovic A., and [13] Lebichot B., Le Borgne Y., He-Guelton L., Oblé
Ottersten B., “Feature Engineering Strategies for F., and Bontempi G., “Deep-Learning Domain
Adaptation Techniques for Credit Cards Fraud
Credit-card Fraud Detection System using Neural Networks 241
Detection,” in Proceedings of INNS Big Data and Salwa Al Balawi, I have a Bachelor’s degree in
Deep Learning Conference, Genova, 2019. Computer Science from the University of Tabuk,
[14] Lucas Y., “Credit Card Fraud Detection Using Saudi Arabia, in 2015, and I obtained a master’s
Machine Learning With Integration of Contextual degree in information security from the University of
Knowledge, Thesis Université de Lyon; Tabuk, Saudi Arabia, in 2020. I worked as a lecturer at
Universität Passau (Deutscheland), 2019. Unaizah College in Qassim in the Department of
[15] Maes S., Tuyls K., Vanschoenwinkel B., and Cybersecurity from 2021 to in 2022, my research
Manderick B., “Credit card fraud Detection Using interests include machine learning, deep learning, and
Bayesian and Neural Networks, in Proceedings of information steganography.
the 1st International Naiso Congress on Neuro
Fuzzy Technologies, Havana, 2002. Njood Aljohani, I obtained a Ph.D. in artificial
[16] Mubarek A. and Adalı E., “Multilayer Perceptron intelligence and I am currently working as an
Neural Network Technique for Fraud Detection,” associate professor at the Faculty of Computer at the
in Proceedings of International Conference on University of Tabuk. And I am currently working as a
Computer Science and Engineering, Antalya, dean of the Faculty of Computer at the University of
2017. Tabuk
[17] Ngai E., Hu Y., Wong Y., Chen Y., and Sun X.,
“The Application of Data Mining Techniques in
Financial Fraud Detection: A Classification
Framework and an Academic Review of
Literature,” Decision Support Systems, vol. 50,
no. 3, p. 559-569, 2011.
[18] Pillai T., Hashem I., Brohi S., Kaur S., and
Marjani M., “Credit Card Fraud Detection Using
Deep Learning Technique,” in Proceedings of 4th
International Conference on Advances in
Computing, Communication and Automation,
Subang Jaya, 2018.
[19] Pokkuluri K., Nedunuri S., and Devi U., “Crop
Disease Prediction with Convolution Neural
Network (CNN) Augmented with Cellular
Automata,” The International Arab Journal of
Information Technology, vol. 19, no. 5, pp. 765-
773, 2022.
[20] Raghavan P. and El Gayar N., “Fraud Detection
Using Machine Learning And Deep Learning,” in
Proceedings of International Conference on
Computational Intelligence and Knowledge
Economy, Dubai, 2019.
[21] Sahin Y. and Duman E., “Detecting Credit Card
Fraud by ANN and Logistic Regression,” in
Proceedings of International Symposium on
Innovations in Intelligent Systems and
Applications, Istanbul, 2011.
[22] Shenvi P., Samant N., Kumar S., Kulkarni V.,
“Credit Card Fraud Detection Using Deep
Learning,” in Proceedings of IEEE 5th
International Conference for Convergence in
Technology, Bombay, 2019.
[23] Wang S., Liu G., Li Z., Xuan S., Yan C., and
Jiang C., “Credit Card Fraud Detection Using
Capsule Network,” in Proceedings of IEEE
International Conference on Systems, Man, and
Cybernetics, Miyazaki, 2018.
[24] Zamini M. and Montazer G., “Credit Card Fraud
Detection Using Autoencoder Based Clustering,”
in Proceedings of 9th International Symposium on
Telecommunications, Tehran, 2018.