Credit Card Fraud Detection_python
Credit Card Fraud Detection_python
AN INTERNSHIP
PROJECT REPORT
Submitted by
DEVADHARSHINI R
Register No. 720323106016
BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
FEBRUARY 2025
AKSHAYA COLLEGE OF ENGINEERING AND
TECHNOLOGY, COIMBATORE-642 109
ANNA UNIVERSITY: CHENNAI- 600 025
Bhagavathipalayam, Kinathukadavu, Coimbatore- 642109
Tamilnadu, India.
BONAFIDE CERTIFICATE
Firstly, I express my heartiest thanks and gratefulness to almighty God for His divine blessing
makes us possible to complete the project work successfully.
I would like to express my heartiest gratitude to Mr.xxxxxx, Department of ECE, for his kind help
to finish my project.
I would also generously welcome each one of those individuals who have helped me straight
forwardly or in a roundabout way in making this project a win. In this unique situation, I might
want to thank the various staff individuals, both educating and non-instructing, which have
developed their convenient help and facilitated my undertaking.
Finally, I must acknowledge with due respect the constant support and patients of my parents.
DEVADHARSHINI R
(720323106016)
TABLE OF CONTENTS
CERTIFICATE
AKCNOWLEDGEMENT
TABLE OF CONTENTS
ABSTRACT 5
CHAPTER 1 COMPANY PROFILE 6
CHAPTER 2 WEEKLY OVERVIEW OF INTERNSHIP ACTIVITIES 8
CHAPTER 3 INTRODUCTION 11
CHAPTER 4 TECHNOLOGY LEARNT 14
CHAPTER 5 SYSTEM SPECIFICATION 15
CHAPTER 6 PROJECT DESCRIPTION 16
CHAPTER 7 CODING 19
CHAPTER 8 RESULTS 22
CHAPTER 9 CONCLUSION 23
CHAPTER 10 REFERENCES 24
ABSTRACT
Credit card fraud is a significant problem, with billions of dollars lost each year.
Machine learning can be used to detect credit card fraud by identifying patterns
that are indicative of fraudulent transactions. Credit card fraud refers to the
physical loss of a credit card or the loss of sensitive credit card information.
Many machine-learning algorithms can be used for detection. This project
proposes to develop a machine-learning model to detect credit card fraud. The
model will be trained on a dataset of historical credit card transactions and
evaluated on a holdout dataset of unseen transactions.
CHAPTER 1
COMPANY PROFILE
VISION:
Be a global force in innovative solutions, quality excellence and redefine
creative thoughts. Striving to be a global force in innovative solutions, quality
excellence, and the redefinition of creative thoughts, we embark on a journey
that transcends boundaries. Our commitment extends beyond mere problem-
solving; it encompasses a vision to reshape industries and leave an indelible
mark on the global landscape. At the core of our mission is a relentless pursuit
of innovation, where we challenge the status quo and push the limits of what is
conceivable.
MISSION:
We endeavour to bring innovative solutions to the forefront, employing a simple
yet effective approach that underscores our commitment to providing deserving
quality. Our mission is rooted in a dedication to pushing the boundaries of
what's possible, embracing creativity, and maintaining a relentless pursuit of
excellence. By adhering to these principles, we aim to not only meet but exceed
the expectations of our users, clients, and partners. Through a combination of
forward-thinking strategies and a focus on quality, we strive to make a
meaningful impact in every endeavour we undertake.
OUR SERVICES
WEBSITE DEVELOPMENT
E-COMMERCE
WORDPRESS DEVELOPMENT
OUTSOURCING
CLOUD SERVICES
DIGITAL MARKETING
SEO
COLLEGE PROJECT
INTERNSHIP
SOFTWARE TRAINING
CHAPTER 2
WEEKLY OVERVIEW OF INTERNSHIP ACTIVITIES
Variables
09/07/2024 Tuesday Datatypes
CHAPTER 3
INTRODUCTION
In today’s era, with the widespread use of credit cards for online
transactions, the risk of fraudulent activities has increased significantly.
Addressing this challenge demands sophisticated methods that can
swiftly and accurately detect fraudulent
transactions to safeguard financial assets and uphold customer trust.
Internship Objectives
Internships are generally thought of to be reserved for college students looking
to gain experience in a particular field. However, a wide array of people can
benefit from Training Internships in order to receive real world experience and
develop their skills.
An objective for this position should emphasize the skills you already possess in
the area and your interest in learning more
Internships are utilized in a number of different career fields, including
architecture, engineering, healthcare, economics, advertising and many more.
Some internship is used to allow individuals to perform scientific research while
others are specifically designed to allow people to gain first-hand experience
working.
Utilizing internships is a great way to build your resume and develop skills that
can be emphasized in your resume for future jobs. When you are applying for a
Training Internship, make sure to highlight any special skills or talents that can
make you stand apart from the rest of the applicants so that you have an
improved chance of landing the position.
This internship also offered a platform to develop essential soft skills such
as teamwork, problem- solving, and project management. Collaborating
with professionals from diverse backgrounds and working on
interdisciplinary projects provided a holistic learning experience that
extended beyond technical knowledge.
Machine Learning
CHAPTER 5
SYSTEM REQUIREMENTS
Hardware Requirements:
Processor : Intel core i5
Memory : 8GB RAM
Hard Disk : 1TB
Algorithms Used:
CHAPTER 6
PROJECT DESCRIPTION
Data Cleaning:
Impute the missing values with the column's mean, median, or mode.
Drop the rows with missing values.
Use a machine learning model to predict the missing values like isnull()
and heatmap().
Normalization is scaling the data so that all features have similar values.
This can improve the performance of machine learning models by making
the parts more comparable.
Model training:
The second phase will involve training the machine learning model on the
collected data. The model will be prepared using a supervised learning
algorithm like SVM.
Model evaluation:
The third phase will involve evaluating the machine learning model's
performance on a holdout dataset of unseen transactions. The model's
performance will be evaluated using accuracy, precision, and recall
metrics.
Existing System
The traditional credit card fraud detection systems primarily rely on rule-based
approaches and manual review processes. These systems have several
limitations:
Rule-Based Systems: Use predefined rules (e.g., transactions above a certain
amount are flagged).High false-positive rates (legitimate transactions get
flagged). Cannot adapt to new fraud patterns dynamically.
Manual Reviews: Involves human analysts reviewing flagged transactions.
Slow, expensive, and not scalable for large transaction volumes.
Static Models: Older machine learning models with limited learning
capabilities. Struggle to detect emerging fraud techniques.
Challenges: High false positives and false negatives. Delayed detection leading
to financial losses. Inability to adapt to evolving fraud tactics.
Proposed System
The proposed system leverages machine learning (ML) and artificial
intelligence (AI) to improve fraud detection with better accuracy and real-time
processing.
Machine Learning Algorithms:
Uses supervised (Decision Trees, Random Forest, SVM, Neural Networks) and
unsupervised learning (K-Means, Isolation Forest, Autoencoders) for anomaly
detection.
Real-Time Detection: ML models process transactions in real-time, instantly
flagging suspicious activity.
Pattern Recognition & Adaptability: Models continuously learn from new
transaction data to detect evolving fraud patterns.
Feature Engineering & Data Analysis: Extracts meaningful features from
transaction data (e.g., transaction location, time, frequency).
Reducing False Positives: ML models improve accuracy, reducing
unnecessary transaction declines.
Deep Learning & Neural Networks: Advanced models like LSTMs can detect
sequential fraud behavior over time.
CHAPTER 7
SOURCE CODE
K-Nearest Neighbor(KNN)
import pandas as pd
import numpy as np
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Credit Card Fraud Detection - Logistic Regression"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "TDnoEQTWStTz"
},
"source": [
"Importing the Dependencies"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"id": "hlNfrSC1PGfZ"
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"from sklearn.model_selection import train_test_split\n",
"from sklearn.linear_model import LogisticRegression\n",
"from sklearn.metrics import accuracy_score"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"id": "W0CTsNioTKnJ"
},
"outputs": [],
"source": [
"# loading the dataset to a Pandas DataFrame\n",
"credit_card_data = pd.read_csv('creditcard.csv')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 218
},
"id": "o_iMfyHsTa6s",
"outputId": "318bdb4d-9f20-4789-c6e6-9b2de1aad091"
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
CHAPTER 8
RESULTS AND DISCUSSION
Expected Result:
A machine learning model that can detect credit card fraud with high
accuracy.
A better understanding of the patterns that are indicative of fraudulent
transactions.
A framework for using machine learning to detect real-time credit
card fraud.
CONCLUSION:
In conclusion, the main objective of this project was to find the most suited
model for credit card fraud detection in terms of the machine learning
techniques chosen for the project. It was met by building the four models and
finding the accuracies of them all; the best in terms of accuracy is KNN and
Decision Tree, which scored 100 on credit card fraud and increased the
customer’s satisfaction as it will provide them with a better experience and
feeling secure.
FUTURE ENHANCEMENT:
There are many ways to improve the model, such as using it on different
datasets with various sizes and data types or by changing the data splitting ratio
and viewing it from a different algorithm perspective. An example can be
merging telecom data to calculate the location of people to have better
knowledge of the location of the card owner while his/her credit card is being
used; this will ease the detection because if the card owner is in Dubai and a
transaction of his card was made in Abu Dhabi, it will easily be detected as
Fraud.
CHAPTER 10
REFERENCES