A full-stack Banking Management System built using Python, Flask, MySQL, HTML/CSS, Bootstrap, and Scikit-Learn, integrated with a Random Forest-based Machine Learning transaction fraud detection system.
-
Project Setup & Execution: Watch Video
-
Banking Management System - Working Process: Watch Video
-
Codebase Walkthrough: Watch Video
-
MySQL Workbench & Database Setup: Watch Video
- Python
- Flask
- MySQL Connector
- Scikit-Learn
- Random Forest Classifier
- Pandas
- NumPy
- Joblib
- HTML5
- CSS3
- Bootstrap 5
- JavaScript
- Chart.js
- MySQL
- MySQL Workbench
Traditional banking management systems primarily focus on storing customer information and processing transactions.
However, transaction processing alone is not sufficient for identifying potentially fraudulent activities.
Some common challenges include:
- Limited real-time transaction risk assessment
- Difficulty identifying unusual transaction behavior
- Manual fraud monitoring
- Financial losses caused by suspicious transactions
- Lack of automated risk scoring
- Limited visibility into transaction-level risk
- Separation between banking operations and fraud detection systems
A banking application therefore needs a mechanism that can analyze transactions automatically and provide an immediate indication of potential risk.
This project combines a complete Banking Management System with an integrated Machine Learning-based transaction fraud detection module.
The application provides normal banking operations through a Flask web interface while automatically sending transaction information to a trained Machine Learning model.
The proposed system provides two major capabilities:
The Flask application manages:
- Customer information
- Bank accounts
- Deposits
- Withdrawals
- Transfers
- Loans
- Cards
- Employees
- Activity logs
- Reports
- Dashboard analytics
Whenever a transaction is created, the system:
- Collects transaction information
- Generates transaction features
- Preprocesses the features
- Sends them to the trained Random Forest model
- Generates a fraud probability/risk score
- Applies the classification threshold
- Classifies the transaction as Normal or Suspicious
- Assigns a Low, Medium, or High risk level
- Stores the ML result in MySQL
- Displays the result in the dashboard, transactions page, activity logs, and ML analytics
The Customer Management module allows administrators to:
- Add customers
- View customer details
- Update customer information
- Delete customer records
- Search customers
- Manage customer-related banking information
Customer information is stored securely in the MySQL database.
The Account Management module provides:
- Account creation
- Savings and Current account support
- Account balance management
- Account status tracking
- Customer-account relationship management
- Account search and viewing
Each account is linked to its respective customer.
The system supports major banking transactions:
Deposit
- Allows money to be deposited into a customer account.
Withdrawal
- Allows money to be withdrawn while checking the available account balance.
Transfer
- Allows money to be transferred between accounts.
Transaction History
- All transactions are recorded and can be searched and reviewed.
Supported transaction types include:
- Deposit
- Withdrawal
- Transfer
- UPI
- NEFT
- RTGS
- IMPS
The major feature of this project is the integrated Machine Learning fraud detection module.
-
Whenever a new transaction is created:
-
The model analyzes transaction characteristics such as:
-
Transaction amount
-
Transaction hour
-
Day of week
-
Day of month
-
Month
-
Weekend information
-
Account average transaction amount
-
Account standard deviation
-
Account transaction count
-
Amount deviation
-
Amount-to-average ratio
-
Amount z-score
-
Transaction type
-
Transaction status
The project uses a Random Forest Classifier for transaction classification.
The model uses transaction and account-behavior features to estimate the likelihood that a transaction is suspicious.
- Feature categories
- Transaction Features
- Amount
- Transaction type
- Transaction status
- Transaction hour
- Day of week
- Day of month
- Month
- Weekend indicator
- Account Behavioral Features
- Account average transaction amount
- Account standard deviation
- Account transaction count
- Amount deviation
- Amount-to-average ratio
- Amount z-score
- Encoded Features
Categorical values are converted into numerical features before being passed to the model.
The system generates two related outputs.
-
Transaction Classification
-
ML Score Classification
-
< 55% Normal
-
= 55% Suspicious
-
Risk Level
-
Risk Score Risk Level
-
< 40% Low
-
40% – 69.99% Medium
-
= 70% High
The ML Analytics module provides an overview of transaction risk.
It displays:
- ML model name
- Model version
- Number of features
- Classification threshold
- Transactions analyzed
- Normal transactions
- Suspicious transactions
- Low-risk transactions
- Medium-risk transactions
- High-risk transactions
- High-risk transaction details
- Recent ML analysis
HISTORICAL TRANSACTION DATA
│
▼
DATA PREPROCESSING
│
▼
FEATURE ENGINEERING
│
▼
┌──────────────────────────┐
│ Transaction Features │
│ │
│ Amount │
│ Hour │
│ Day of Week │
│ Day of Month │
│ Month │
│ Weekend Indicator │
│ Account Average Amount │
│ Account Std Deviation │
│ Transaction Count │
│ Amount Deviation │
│ Amount/Average Ratio │
│ Amount Z-Score │
│ Transaction Type │
│ Transaction Status │
└────────────┬─────────────┘
│
▼
CATEGORICAL ENCODING
│
▼
NUMERICAL SCALING
│
▼
RANDOM FOREST MODEL
│
▼
RISK PROBABILITY
│
▼
THRESHOLD EVALUATION
│
┌─────────┴─────────┐
│ │
< 55% >= 55%
│ │
▼ ▼
NORMAL SUSPICIOUS
The system includes administrative functionality for managing the banking application.
Administrative features include:
- Admin login
- Session-based access control
- Logout
- Customer management
- Account management
- Transaction management
- Loan management
- Card management
- Employee management
- Activity logs
- Reports
- ML analytics
The application uses MySQL as its persistent database.
When a transaction is created, the transaction information and ML analysis results are stored in the database.
ML-related fields include:
- ml_prediction
- ml_risk_score
- ml_risk_level
- ml_checked_at
- ml_model_version
Important application activities are recorded through the activity logging module.
This provides traceability between banking operations and Machine Learning analysis.
The ML Analytics page provides:
-
Model name
-
Model version
-
Number of features
-
Classification threshold
-
Transactions analyzed
-
Normal transactions
-
Suspicious transactions
-
Low-risk transactions
-
Medium-risk transactions
-
High-risk transactions
-
High-risk transaction details
-
Recent ML analysis
-
Current model configuration:
-
Model : Random Forest
-
Version : v1.0
-
Features : 24
-
Threshold : 55%
The Random Forest model was evaluated using a held-out test dataset.
- Metric Score
- Accuracy 98.0%
- Precision 76.0%
- Recall 47.0%
- F1-Score 58.0%
The operational classification threshold is 55%.
Important: The 98% accuracy should not be described as "98% fraud detection accuracy." Precision, recall, and F1-score provide a more meaningful view of suspicious-transaction classification performance.
git clone https://github.com/Hathi-ram/Banking-Management-System-ML-Fraud-Detection.git cd Banking-Management-System-ML-Fraud-Detection
Windows
- python -m venv venv
- venv\Scripts\activate
- Linux / macOS
- python3 -m venv venv
- source venv/bin/activate
pip install -r requirements.txt
Create the database:
CREATE DATABASE BankingDB;
- Then configure the required banking tables.
The database contains:
- Customers
- Accounts
- Transactions
- Loans
- Cards
- Employees
- Activity Logs
- ML Transaction Results
Use environment variables for database credentials.
Do not commit MySQL passwords or secret keys to GitHub.
python app.py
Open:
For production deployment, the following improvements should be implemented:
- Store credentials in environment variables
- Use secure password hashing
- Enable HTTPS
- Configure secure Flask sessions
- Validate and sanitize inputs
- Restrict database permissions
- Protect sensitive banking information
- Secure ML model files
- Use a production WSGI server
- Implement stronger authentication and authorization
Possible future improvements include:
- Cloud deployment
- Advanced fraud detection models
- Real-time fraud alerts
- Email/SMS notifications
- Fraud investigation interface
- Customer behavior analysis
- Automated model retraining
- Improved authentication
- Advanced role-based access control
- REST API integration
- Banking Management
- Customer Management
- Account Management
- Deposit
- Withdrawal
- Transfer
- Loan Management
- Card Management
- Employee Management
- Activity Logging
- Reports
- Machine Learning
- Transaction feature engineering
- Data preprocessing
- Categorical encoding
- Numerical scaling
- Random Forest classification
- Risk score generation
- Threshold-based classification
- Risk-level categorization
- Real-time transaction inference
- ML result persistence
- Banking dashboard
- ML analytics dashboard
- Risk distribution
- High-risk transaction monitoring
- Recent ML analysis
- Excel reports
- PDF reports
- This project demonstrates the integration of full-stack web development, relational database management, banking operations, and Machine Learning into a single application.
The system uses:
-
Python + Flask + MySQL + Scikit-Learn + Random Forest + Pandas + HTML/CSS + Bootstrap
-
The main contribution is the integration of a Machine Learning transaction risk assessment pipeline directly into the banking transaction workflow.
Vislavath Hathiram
B.Tech
Indian Institute of Information Technology, Design and Manufacturing (IIITDM) Kancheepuram Chennai Tamilnadu






















