Skip to content

A machine learning-based web application to detect financial fraud in real time. Users can input transaction details and get instant fraud predictions.

Notifications You must be signed in to change notification settings

PRIYAtechky/Fraud-Detection-System-for-Financial-Transaction

Repository files navigation

Fraud Detection System for Financial Transactions

Dataset Link: Kaggle

Reference: GitHub

GitHub Repository: Fraud Detection System

Problem Statement

Financial institutions face challenges in detecting and preventing fraudulent transactions. UPI-based financial fraud leads to significant monetary losses.

Project Overview

This project aims to detect fraudulent financial transactions in real time using machine learning. It leverages AI/ML models to analyze transaction patterns, ensuring scalability and adaptability to emerging fraud tactics. A web application built with Flask provides an interface for users to input transaction details and receive fraud risk predictions.

Objective & Solution Approach

  • Develop an AI/ML model to analyze transaction patterns and detect fraud in real time.
  • Ensure scalability for handling large transaction volumes.
  • Implement adaptive learning for detecting emerging fraud patterns.

Technology & Models Used

Machine Learning Models:

  • Logistic Regression
  • Decision Tree
  • K-Nearest Neighbors (KNN)
  • Random Forest
  • Naïve Bayes
  • XGBoost (Best Performing)

Technology Stack:

  • Python
  • Flask (Web App)
  • Pandas
  • Scikit-learn
  • XGBoost

Implementation

Dataset Features:

  • Transaction type, amount, source & destination balances, timestamp

Preprocessing:

  • Feature engineering, normalization using scaler.pkl

Model Training & Evaluation:

  • Trained on historical transaction data
  • Best accuracy achieved using XGBoost

Installation

  1. Clone the repository:
    git clone https://github.com/PRIYAtechky/Fraud-Detection-System-for-Financial-Transaction.git
  2. Navigate to the project directory:
    cd Fraud-Detection-System-for-Financial-Transaction
  3. Install dependencies:
    pip install -r requirements.txt

How to Use

  1. Update File Paths:
    • Open app.py and update the file paths for scaler.pkl, xgb_model.pkl, and column_names.pkl to match your system's directory structure.
    with open(r'path/to/scaler.pkl', 'rb') as file:
        scaler = pickle.load(file)
    
    with open(r'path/to/xgb_model.pkl', 'rb') as file:
        model = pickle.load(file)
    
    with open(r'path/to/column_names.pkl', 'rb') as file:
        column_names = pickle.load(file)
  2. Run the Flask application:
    python app.py
  3. Access the Web Application:
    • Once app.py runs successfully, it will display a local server address in the output.
    • Open your browser and enter the URL provided in the terminal (default: http://127.0.0.1:5000/).
  4. Input transaction details to check for fraud risk.

About

A machine learning-based web application to detect financial fraud in real time. Users can input transaction details and get instant fraud predictions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published