Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
24 views

Credit Card Fraud Detection Using Hybrid Machine Learning Algorithm

Published in International Journal of Trend in Scientific Research and Development (ijtsrd), ISSN: 2456-6470, Volume-7 | Issue-6 , December 2023, Url: https://www.ijtsrd.com/papers/ijtsrd60102.pdf Paper URL: https://www.ijtsrd.com/computer-science/other/60102/credit-card-fraud-detection-using-hybrid-machine-learning-algorithm/tripti-gautam

Uploaded by

Editor IJTSRD
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Credit Card Fraud Detection Using Hybrid Machine Learning Algorithm

Published in International Journal of Trend in Scientific Research and Development (ijtsrd), ISSN: 2456-6470, Volume-7 | Issue-6 , December 2023, Url: https://www.ijtsrd.com/papers/ijtsrd60102.pdf Paper URL: https://www.ijtsrd.com/computer-science/other/60102/credit-card-fraud-detection-using-hybrid-machine-learning-algorithm/tripti-gautam

Uploaded by

Editor IJTSRD
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

International Journal of Trend in Scientific Research and Development (IJTSRD)

Volume 7 Issue 6, November-December 2023 Available Online: www.ijtsrd.com e-ISSN: 2456 – 6470

Credit Card Fraud Detection Using


Hybrid Machine Learning Algorithm
Tripti Gautam1, Ghanshyam Sahu2, Lalit Kumar P. Bhiaya3
1
M Tech Scholar, CSE Department, BCET, Durg, Chhattisgarh, India
2
Professor, CSE Department, BCET, Durg, Chhattisgarh, India
3
Associate Professor, Bharti University, Durg, Chhattisgarh, India

ABSTRACT How to cite this paper: Tripti Gautam |


As we know and living in the era of digital world, Credit card fraud is Ghanshyam Sahu | Lalit Kumar P.
increasing rapidly by transactions of unauthorized or any fraudulent Bhiaya "Credit Card Fraud Detection
use of someone else information of credit card to purchase and obtain Using Hybrid Machine Learning
benefits of financial. The victims of credit card fraud may have Algorithm" Published in International
Journal of Trend in
severe repercussions. Financial losses, harm to credit scores, and the
Scientific Research
trouble of dealing with unauthorized transactions can all arise from it. and Development
Secure your card information, keep a close eye on your account (ijtsrd), ISSN:
activity, and alert your card issuer right away to any odd transactions 2456-6470,
if you want to prevent credit card theft. To help combat fraud, many Volume-7 | Issue-6,
financial institutions additionally provide extra security features like December 2023, IJTSRD60102
two-factor authentication and fraud detection systems. To resolve pp.274-279, URL:
these problem we developed a system of Credit Card Fraud detection www.ijtsrd.com/papers/ijtsrd60102.pdf
by hybrid techniques of machine learning which combines supervised
and unsupervised methods to improve the system of fraud detection. Copyright © 2023 by author (s) and
International Journal of Trend in
In this paper we are using machine learning algorithms like K Scientific Research and Development
Nearest Neighbor, Logistic Regression and XGBoost model and we Journal. This is an
had made a comparison of accuracy score with other different models Open Access article
by using the data of European Cardholders 2013, by that data we had distributed under the
make comparison and decided that which model is best for defining terms of the Creative Commons
the fraud system of credit card. Attribution License (CC BY 4.0)
(http://creativecommons.org/licenses/by/4.0)
KEYWORDS: Credit Card, Fraud Detection, Fraud Detection
Framework, Supervised and Unsupervised Techniques

INTRODUCTION
We are advancing into the digital age, and information may be utilised in fraudulent transactions
cybersecurity is playing an increasingly important or sold on the black market for their use
role in our daily lives. The primary problem when Card skimming: it is when a card is swiped or
discussing digital life security is identifying unusual
inserted at an ATM, a payment terminal or a petrol
behaviour. Credit cards are often preferred by many
pump, fraudsters employ tools called skimmers to
people when they transact online or buy something. record credit card information. The stolen information
Credit card credit limits occasionally enable us to
is then used to build fake cards or buy things online.
make purchases even when we don't have the money
on hand. On the other hand, online criminals abuse The examination of a card's spending patterns and
these features. classification of its transactions into fraudulent and
lawful transactions form the basis for the detection of
Credit card fraud can be done in various ways like
credit card fraud. There are many challenges in
Phishing: where deceive people into entering their detecting credit card fraud:
credit card information on phoney websites, emails or Due to privacy and security considerations, credit
text. To win trust and obtain sensitive information,
card transaction datasets are rarely available, and the
these scam pose as reliable institutions.
ones that are are greatly skewed. Fraudulent
Data Breaching: online, it means if any company's behaviour patterns are dynamic in nature, meaning
systems are breached, hackers may able to access any that fraudulent transactions typically look legitimate.
credit card data of its customers. The stolen

@ IJTSRD | Unique Paper ID – IJTSRD60102 | Volume – 7 | Issue – 6 | Nov-Dec 2023 Page 274
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
Related Work y= mx + b
In this paper we are defining and analyzing many
where
machine learning algorithms that can help us classify
y is the dependent variable/ response / goal variable
abnormal transactions. The only requirement is the
past data and the suitable algorithm that can fit our x is independent variable/feature/predictor variable,
data in a better form. It helps you in the complete The slope of the line, m, shows how much the change
end-to-end model training process and finally, we will in y changes when the x value changes by a unit.The
get the best model that can classify the transaction value of y when x is 0 is represented by the y-
into normal and abnormal types. intercept, or b.
First, we describe what is supervised and B. Logistic Regression- the objective is to predict a
unsupervised modes and algorithms which we binary outcome (e.g., true/false, yes/no, 0/1)
approached for our model. Secondly, the algorithms based on a set of independent variables or
which we used to researched and analyzed over credit features, logistic regression is a popular
card fraud detection supervised learning approach. Contrary to its
1. Supervised and Unsupervised name, logistic regression is typically employed to
A. Supervised Learning-A type of machine learning solve classification issues as opposed to
called supervised learning uses labelled data to regression issues. The logistic function, also
teach the algorithm new things. Labelled data is a referred to as the sigmoid function, is used by the
term used to describe input samples that come logistic regression model to translate the linear
with the required output labels. The purpose of combination of independent variables to the
supervised learning is to build a model that interval [0, 1].
generalises and can correctly classify or predict p = 1 / (1 + e^(-z))
unknown or upcoming data.The training data
serves as a teacher in supervised learning, Where:
instructing the algorithm on how to learn the The positive class's anticipated probability is denoted
correspondence between input features and their by the letter p.
related labels. When given new, unlabeled The independent variables are combined linearly to
examples, the algorithm looks for patterns, form the variable z.
correlations, or decision boundaries in the data to
create predictions. The feature vector (x), learning weights (coefficients)
of the model, and an intercept term (b) are used to
B. Unsupervised Learning- As the name implies, create the linear combination (z).
unsupervised learning entails learning from
unlabeled data. Without any predefined labels or C. Naive Bayes -The Bayes theorem of probability
goal outcomes, the algorithm in unsupervised serves as its foundation, and it makes the
learning investigates the data to discover innate assumption that the features are conditionally
patterns, structures, or relationships. Finding independent given the class. Naive Bayes is a
hidden patterns or clusters in the data is the goal. well-liked option for text categorization tasks like
In unsupervised learning, the algorithm attempts spam filtering and sentiment analysis due to its
to cluster or group together related data points popularity and computational efficiency despite
based on their shared characteristics. It seeks to its simplicity and "naive" premise. Naïve Bayes
discover the data's underlying distribution or to works on Data Preparation, Calculating Class
isolate important features for future investigation Priors, Calculating Feature Likelihoods,
or decision-making. Calculating Posterior Probability, Class
Prediction
2. Algorithms
In this paper we used some supervised and D. K-Nearest Neighbors (KNN) -Machine learning
unsupervised algorithm for the comparison and dis commonly uses the K-Nearest Neighbors (KNN)
A. Linear Regression- It is a simple and frequently algorithm for both classification and regression
used algorithm, by fitting and observing data in problems. It is a non-parametric and instance-
the model through connecting a dependent and based learning method, which means it depends
independent variables. Finding the best-fitting on the training data alone to produce predictions
line that reduces the discrepancy between the rather than making firm assumptions about the
anticipated and actual values of the dependent distribution of the underlying data. KNN works as
variable is the aim of linear regression. The follows, Data Preparation, Choosing K,
equation below represents the line: Calculating Distances, Finding K Neighbors,

@ IJTSRD | Unique Paper ID – IJTSRD60102 | Volume – 7 | Issue – 6 | Nov-Dec 2023 Page 275
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
Class Prediction (Classification), Value False Negative (FN) describes a situation in which
Prediction (Regression) the model incorrectly predicted a result that was
E. Random Forest - An effective and popular actually positive when it should have been negative.
ensemble learning algorithm in machine learning Accuarcy: The number of accurate predictions your
is Random Forest. It is well-liked for both model made is a measure of accuracy. It is a solid
classification and regression tasks and is a fundamental metric to gauge a model's performance,
member of the family of decision tree-based but a simple accuracy metric has the drawback of
techniques. For more precise and reliable being better in balanced datasets and worse in
forecasts, Random Forest aggregates the unbalanced datasets.
predictions of various separate decision trees. =( + )/ + + +
Basically it works on Data Preparation, Random
Sampling, Growing Decision Trees, Ensemble Out of all the positives in the dataset, recall measures
Prediction. how many real positives are anticipated. A high recall
indicates that the majority of positive cases were
Because of its reliability, adaptability, and strong classified as such. There are a lot of false negatives
generalisation skills, Random Forest has gained when recall is low.
popularity across many fields. Compared to
= /( + N)
individual decision trees, it is less prone to overfitting
and is successful with complicated datasets. However, Precision is the degree to which a positive forecast is
compared to simpler models, it can be more difficult accurate is measured by precision. This phrase asks
to read the results and comprehend how Random how certain you may be that a result is actually
Forest makes decisions. positive if it is projected to be positive.
F. Gradient Boosting Algorithms : A group of = / +
machine learning techniques known as gradient F1, or their harmonic mean, combines precision and
boosting algorithms combine a collection of weak memory. When maintaining the proper balance
prediction models, often decision trees, to between recall and precision, it is necessary.
produce a powerful predictive model. Gradient 1=2( ∗ )/ ( + )
boosting's main principle is to iteratively create new B. DATA SET
models that fix the errors created by the prior models, We had taken a data set of the actual bank
enhancing the performance of prediction as a whole. transactions that European cardholders conducted in
It works on Gradient Boosting Machine (GBM), 2018 are included in this dataset. The original
XGBoost: XGBoost (Extreme Gradient Boosting), variables have been changed PCA versions since
LightGBM, CatBoost, Ensemble of Weak Learners, sharing them would compromise security. Thus, there
Loss Function Optimization, Regularization are 29 feature columns and 1 final class column to be
Working Performances found.
A. Parameters for Analysis
We use a number of parameters to assess the
performance of a specific model. The number of
correct predictions versus the number of incorrect
guesses is plotted in a confusion matrix, a summary
table that demonstrates how accurate the model is at
making predictions. Four categories make up it:
True Positive (TP), where the actual value and the
projected value agree. The model anticipated a
positive value, and the actual result was positive.
True Negative (TN), where the actual value and the
projected value are identical.
False Positive (FP) means that the predicted value in
this case was incorrectly predicted. Although the
model had projected a positive result, the actual value Figure 1 Sample of European Cardholder data
was negative. Importing Dataset
Importing the dataset is pretty much simple. we can
use pandas module in python to import it.

@ IJTSRD | Unique Paper ID – IJTSRD60102 | Volume – 7 | Issue – 6 | Nov-Dec 2023 Page 276
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
Data Processing
The dataset is imbalanced towards a feature. Which
seems pretty valid for such kind of data. Because
today many banks have adopted different security
mechanisms — so it is harder for hackers to make
such moves.
Still, sometimes when there is some vulnerability in
the system — the chance of such activities can
increase.
That’s why we can see the majority of transactions
belongs to our datasets are normal and only a few
percentages of transactions are fraudulent. can also
Figure 3 Distribution of Data Sets
check for null values

Figure 4 Collection of Customer profile data’s in


30 rows
In figure 2 We can make a quick check that the
generated transactions follow the customer profile
properties:
 The terminal IDs are indeed those in the list of
available terminals (0, 1, 2 and 3)
 The transaction amounts seem to follow the
amount parameters of the customer
Figure 2 Sample of data types (mean_amount=62.26 and std_amount=31.13)
Result Analysis  The number of transactions per day varies
The experiment's dataset was obtained from the according to the transaction frequency parameters
Cardholders of 2018 in website. It includes credit of the customer (mean_nb_tx_per_day=2.18).
card transactions from 2013. The dataset has 492 out
of the 284,807 total transactions that are marked as Now produce the transactions for each and every
fake. Due to the 0.173% fraud cases, the data is customer. Using the pandas groupby and apply
therefore deemed to be imbalanced. The distribution methods, this is simple:
of the dataset is shown in Figure 1. Without the “transactions_df=customer_profiles_table.
column labels, there are 30 columns. A PCA
projection was applied to all columns with the Groupby ('CUSTOMER_ID').
exception of the time and amount features in order to apply (lambda x: generate_transactions_table
preserve privacy. All columns are therefore numerical (x.iloc[0], nb_days=5)).
variables. The two classes are broken down in the
reset_index(drop=True)
labels columns, where a genuine transaction is
represented by a value of 0 and a fraudulent transactions_df “
transaction by a value of 1

@ IJTSRD | Unique Paper ID – IJTSRD60102 | Volume – 7 | Issue – 6 | Nov-Dec 2023 Page 277
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
instance, the local outlier factor performs poorly
based on accuracy and F1 values while having a
99.67% accuracy rate. So, when choosing the
optimum algorithm for fraud detection, precision,
recall, and F1 score values are important
considerations. The most effective supervised
learning algorithm is the XGboost algorithm, and
support vector machine outperforms all other
algorithms.
References:
[1] Abhinav Srivastava, Amlan Kundu, Shamik
Sural, Arun K. Majumdar, “Credit Card Fraud
Detection using Hidden Markov Model,” IEEE
Transactions On Dependable And Secure
Figure 5 Graph of Transaction Table of Computing, vol. 5, Issue no. 1, pp.37-48,
Customers January-March 2008

Analysis [2] Schneider, Gary (2010). Electronic Commerce.


MODELS ACCURACY F1 SCORE Cambridge: Course Technology.
DECISION TREE 0.999288 0.776255 p. 497. ISBN 978-0-538-46924-1.
K NEAREST [3] S. Benson Edwin Raj, A. Annie Portia,
0.9995066 0.836538462
NEIGHBOURS “Analysis on Credit Card Fraud Detection
LOGISTIC Methods”, International Conference on
0.9991148 0.693467337
REGRESSION Computer, Communication and Electrical
SUPPORT VECTOR Technology – ICCCET2011, 18th & 19th
0.99936154 0.77777777 March, 2011
MACHINES
RANDOM FOREST 0.999361 0.78431372 [4] Seeja, K. R., and Zareapoor, M., (2014).
XG BOOST 0.9995211 0.842105263 FraudMiner: A Novel Credit Card Fraud
Figure 6 Result Analysis Detection Model Based on Frequent Itemset
Mining, The Scientific World Journal, Hindawi
Publishing Corporation, Volume 2014, Article
ID 252797, pp. 1 – 10,
http://dx.doi.org/10.1155/2014/252797
[5] The Nilson Report. (2015). U.S. Credit & Debit
Cards 2015. David Robertson
[6] Bolton, R. J. and Hand, D. J., (2001).
Unsupervised profiling methods for fraud
detection, Conference on Credit Scoring and
Credit Control, Edinburgh.
[7] Kou, Y., Lu, C-T., Sinvongwattana, S. and
Huang, Y-P., (2004). Survey of Fraud
Detection Techniques, In Proceedings of the
2004 IEEE International Conference on
Figure 7 Graph of Accuracy and F Score Networking, Sensing & Control, Taipei,
Conclusion: Taiwan, March 21-23.
In order to identify fraudulent transactions from a [8] Bhattacharyya, S., Jha, S., Tharakunnel, K.,
sizable unbalanced dataset, we have constructed Westland, J.C.: Data mining for credit card
different supervised models. Accuracy, and F1 score fraud: a comparative study. Decis. Support
comparison statistics have been provided, and the Syst. 50(3), 602–613 (2011)
percentage of properly recognising fraudulent
transactions is the comparison parameter. In [9] Padvekar SA, Kangane PM, Jadhav KV (2016)
situations where it misrepresents a machine learning Credit card fraud detection system. Int J Eng
technique, accuracy can actually be deceptive. For Comput Sci 5(4):16183–16186

@ IJTSRD | Unique Paper ID – IJTSRD60102 | Volume – 7 | Issue – 6 | Nov-Dec 2023 Page 278
International Journal of Trend in Scientific Research and Development @ www.ijtsrd.com eISSN: 2456-6470
[10] Xuan S, Liu G, Li Z, Zheng L, Wang S, Jiang C Foundations, trends, and future challenges.
(2018) Random forest for credit card fraud Pattern Recognition”, 2018, 81, 674–693.
detection. In: ICNSC 2018—15th IEEE
[13] Lee, H. K., & Kim, S. B. “An overlap-sensitive
International conference on networking, margin classifier for imbalanced and
sensing and control, pp 1–6 overlapping data. Expert Systems with
[11] Fernandes, E. R., & de Carvalho, A. C. Applications”,2018, 98, 72–83.
“Evolutionary inversion of class distribution in [14] Zhou, C., & Paffenroth, R. C. “Anomaly
overlapping areas for multi-class imbalanced detection with robust deep autoencoders”, In
learning”. Information Sciences, 2019, 494, Proceedings of the 23rd ACM SIGKDD
141–154
International Conference on Knowledge
[12] Das, S., Datta, S., & Chaudhuri, B. B., Discovery and Data Mining, 2017(pp. 665–
“Handling data irregularities in classification: 668)

@ IJTSRD | Unique Paper ID – IJTSRD60102 | Volume – 7 | Issue – 6 | Nov-Dec 2023 Page 279

You might also like