Dataset Link: Kaggle
Reference: GitHub
GitHub Repository: Fraud Detection System
Financial institutions face challenges in detecting and preventing fraudulent transactions. UPI-based financial fraud leads to significant monetary losses.
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.
- 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.
- Logistic Regression
- Decision Tree
- K-Nearest Neighbors (KNN)
- Random Forest
- Naïve Bayes
- XGBoost (Best Performing)
- Python
- Flask (Web App)
- Pandas
- Scikit-learn
- XGBoost
- Transaction type, amount, source & destination balances, timestamp
- Feature engineering, normalization using
scaler.pkl
- Trained on historical transaction data
- Best accuracy achieved using XGBoost
- Clone the repository:
git clone https://github.com/PRIYAtechky/Fraud-Detection-System-for-Financial-Transaction.git
- Navigate to the project directory:
cd Fraud-Detection-System-for-Financial-Transaction
- Install dependencies:
pip install -r requirements.txt
- Update File Paths:
- Open
app.py
and update the file paths forscaler.pkl
,xgb_model.pkl
, andcolumn_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)
- Open
- Run the Flask application:
python app.py
- 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/
).
- Once
- Input transaction details to check for fraud risk.