Skip to content

federicatopazio/CreditCardFraudDetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🛡️ Credit Card Fraud Detection using Deep Learning

Python TensorFlow License: MIT

This project reproduces the results of a published study on credit card fraud detection using deep learning methods. It evaluates the performance of 1D CNNs, 2D CNNs, and LSTM networks on two real-world imbalanced datasets.

Nguyen, Thanh Thi, et al.
Deep Learning Methods for Credit Card Fraud Detection.
arXiv preprint arXiv:2012.03754, 2020.


📁 Project Structure

├── data/ # Dynamic retrieval from Kaggle
├── notebooks/
│ └── fraud_detection.ipynb
├── Report.pdf
└── README.md

🧪 Datasets

  • European Card Data (ECD)
    Kaggle link
    284,807 samples, 31 features (0.172% fraud)

  • Small Card Data (SCD)
    Kaggle link
    3,075 samples, 12 features (14.6% fraud)


⚙️ Setup

  1. Clone the repository
    git clone https://github.com/yourusername/credit-card-fraud-naml.git
    cd credit-card-fraud-naml
  2. Add your Kaggle credentials Save your kaggle.json token inside a .kaggle/ directory:
mkdir ~/.kaggle
cp path/to/kaggle.json ~/.kaggle/
chmod 600 ~/.kaggle/kaggle.json
  1. Run the notebook Open and run the main notebook:
jupyter notebook notebooks/fraud_detection.ipynb

🧠 Models

This project implements three neural network architectures, each evaluated on both the European Card Data (ECD) and Small Card Data (SCD) datasets. All models use binary cross-entropy loss and the Adam optimizer.

📌 1D CNN

Designed for structured, sequential data like time series

🧩 2D CNN

Used after reshaping tabular data into 2D matrices (e.g., 5×6) to simulate spatial structure

🔁 LSTM

Captures temporal dependencies and long-term patterns in transaction sequences

Each model was trained on balanced and imbalanced versions of the datasets using:

  • Random Under-Sampling
  • NearMiss
  • SMOTE

Evaluation metrics include accuracy, precision, recall, and F1 score. EarlyStopping and learning rate callbacks were also used to improve generalization and avoid overfitting.

✍️ Author

Federica Topazio

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors