Skip to content

tanishcode-12/FraudShield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💳 Credit Card Fraud Detection

🚨 A machine learning web application that detects fraudulent credit card transactions in real time. Built with Python and a trained classification model, this project helps identify suspicious activity with high accuracy.


📌 Overview

💡 Credit card fraud is a major financial threat. This project uses a pre-trained ML model (fraud_model.pkl) and a data scaler (scaler.pkl) to predict whether a given transaction is fraudulent or legitimate based on transaction features.

🖥️ The application includes an HTML-based frontend to interact with the model through a simple and clean interface.


✨ Features

  • 🔍 Real-time fraud prediction on transaction data
  • 🤖 Pre-trained machine learning model (scikit-learn)
  • 📊 Trained on real-world credit card transaction dataset
  • 🌐 Simple HTML frontend interface
  • ⚡ Fast and lightweight — no heavy dependencies
  • 🛡️ Helps protect users from financial fraud

🗂️ Project Structure

💳 creditcardfraud/
├── 📁 crditcardfraud/         # Core application (Python + HTML)
├── 🤖 fraud_model.pkl         # Trained ML classification model
├── ⚖️  scaler.pkl              # Feature scaler for preprocessing
├── 📄 transactions.csv        # Sample transaction data
├── 🗜️  creditcard.csv.zip      # Full dataset (zipped)
└── 📝 README.md

⚙️ Installation

🧰 Prerequisites

Make sure you have the following installed:

  • 🐍 Python 3.8+
  • 📦 pip

🪜 Steps

  1. 📥 Clone the repository
git clone https://github.com/tanishcode-12/creditcardfraud.git
cd creditcardfraud
  1. 📦 Install dependencies
pip install -r requirements.txt

⚠️ If there's no requirements.txt, install manually:

pip install flask scikit-learn pandas numpy
  1. 🗜️ Extract the dataset
unzip creditcard.csv.zip -d ./

📂 This will extract creditcard.csv into the project folder. Make sure it's in the root directory before running the app.

  1. ▶️ Run the application
python app.py
  1. 🌐 Open in your browser
http://127.0.0.1:5000

🚀 Usage

  1. 🟢 Launch the app using the steps above.
  2. ✍️ Enter the transaction details in the input form.
  3. 🔮 Click Predict to find out if the transaction is Fraudulent or Legitimate.
  4. ✅ The model will return a result instantly based on the trained data.

📁 You can also test using the sample data in transactions.csv.


🤝 Contributing

🙌 Contributions are welcome! Here's how you can help:

  1. 🍴 Fork the repository
  2. 🌿 Create a new branch (git checkout -b feature/your-feature)
  3. 💾 Make your changes and commit (git commit -m 'Add your feature')
  4. 📤 Push to the branch (git push origin feature/your-feature)
  5. 🔁 Open a Pull Request

✅ Please make sure your code is clean and well-commented.


👤 Author

Tanish@tanishcode-12


⭐ If you found this project helpful, consider giving it a star on GitHub!

About

Real-time credit card fraud detection web app using scikit-learn, Flask and PCA-transformed Kaggle dataset with risk-based classification

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors