FraudSniff is a secure, interactive banking system that performs real-time fraud detection using a trained machine learning model.
It includes OTP-based transaction verification and stores all user data in an SQLite database.
A lightweight Streamlit-based Banking Simulation App that enables users to deposit, withdraw, and transfer funds while detecting fraudulent transactions using a trained Machine Learning model.
- 🧠 Machine Learning Fraud Detection: Predicts fraudulent transactions using Random Forest Classifier.
- 🔄 OTP Email Verification: Secure transfers with 6-digit OTP emailed to the user.
- 🧾 Transaction History: View past transfers and deposits.
- 👥 Multi-user Support: Login and manage accounts securely.
- 💾 SQLite Integration: Persistent storage of user data and transactions.
| Component | Technology |
|---|---|
| Frontend | Streamlit |
| Backend | Python (Flask-style logic) |
| ML Model | RandomForest (scikit-learn) |
| Database | SQLite |
| Email Service | SMTP via Gmail |
| Deployment Ready | ✅ Yes |
banking\_system/
├── app.py # Main Streamlit app
├── db.py # DB helper functions
├── train\_model.py # ML model training script
├── utils.py # Fraud detection, OTP, etc.
├── transactions.csv # Sample dataset for training
├── model/
│ ├── fraud\_model.pkl # Trained ML model
│ └── scaler.pkl # Feature scaler
└── bank.db # SQLite database
git clone https://github.com/yourusername/fraudsniff-banking-system.git
cd fraudsniff-banking-systempip install -r requirements.txtIn utils.py, update the following lines with your Gmail and App Password:
sender_email = "[email protected]"
password = "your_app_password"streamlit run app.pyTo retrain the fraud detection model with your own data:
python train_model.pyMake sure your transactions.csv includes:
amounttimestampavg_daily_tx(optional, can be derived)is_fraud(0 or 1)
The model uses:
- Transaction
amount - User's
avg_daily_txover past few days hourof transaction
Prediction is made using:
model.predict(scaler.transform([[amount, avg_daily_tx, hour]]))- ✅ Add transaction reversal on fraud detection
- 🔒 Password hashing for better security
- 📈 Real-time dashboard with fraud stats
- 📊 Improve ML accuracy using XGBoost or SMOTE