The Fraud Detection System is an end-to-end Machine Learning project designed to identify fraudulent financial transactions. The project focuses on solving the real-world challenge of highly imbalanced datasets while maximizing fraud detection performance using multiple classification algorithms.
The system includes data preprocessing, exploratory data analysis (EDA), feature engineering, model training, evaluation, and deployment through a FastAPI backend with an optional React frontend.
- Detect fraudulent transactions with high accuracy.
- Reduce false negatives by maximizing recall.
- Compare multiple machine learning algorithms.
- Handle class imbalance using advanced sampling techniques.
- Deploy the trained model as a REST API.
- Build a user-friendly interface for real-time fraud prediction.
- Data Cleaning and Preprocessing
- Exploratory Data Analysis (EDA)
- Feature Engineering
- Handling Imbalanced Data (SMOTE, Random Oversampling, Undersampling)
- Multiple Machine Learning Models
- Hyperparameter Tuning
- Model Evaluation using industry-standard metrics
- FastAPI Backend
- React Frontend (Optional)
- Model Serialization and Deployment
Fraud-Detection-System/
β
βββ data/
β βββ raw/
β βββ processed/
β βββ external/
β
βββ notebooks/
β βββ 01_data_understanding.ipynb
β βββ 02_data_cleaning.ipynb
β βββ 03_eda.ipynb
β βββ 04_feature_engineering.ipynb
β βββ 05_model_training.ipynb
β βββ 06_model_evaluation.ipynb
β
βββ src/
β βββ preprocessing.py
β βββ features.py
β βββ train.py
β βββ evaluate.py
β βββ predict.py
β βββ utils.py
β
βββ models/
β
βββ reports/
β
βββ app/
β βββ app.py
β βββ templates/
β
βββ requirements.txt
βββ README.md
βββ .gitignore
This project uses the Credit Card Fraud Detection Dataset from Kaggle.
- Total Transactions: 284,807
- Fraudulent Transactions: 492
- Legitimate Transactions: 284,315
This dataset is highly imbalanced, making it ideal for learning fraud detection techniques.
- Python
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Plotly
- Scikit-learn
- XGBoost
- LightGBM
- CatBoost
- imbalanced-learn (SMOTE, ADASYN)
- FastAPI
- Uvicorn
- React.js
- Data Collection
- Data Cleaning
- Exploratory Data Analysis
- Feature Engineering
- Feature Scaling
- Handle Class Imbalance
- Train-Test Split
- Model Training
- Hyperparameter Tuning
- Model Evaluation
- Model Saving
- API Development
- Deployment
- Logistic Regression
- Decision Tree
- Random Forest
- Support Vector Machine
- XGBoost
- LightGBM
- CatBoost
Since fraud detection is an imbalanced classification problem, the following metrics are used:
- Precision
- Recall
- F1 Score
- ROC-AUC Score
- Precision-Recall AUC
- Confusion Matrix
Clone the repository:
git clone https://github.com/your-username/Fraud-Detection-System.gitMove into the project directory:
cd Fraud-Detection-SystemInstall dependencies:
pip install -r requirements.txtStart the FastAPI server:
uvicorn app:app --reloadOpen your browser:
http://127.0.0.1:8000
API documentation:
http://127.0.0.1:8000/docs
- Real-time transaction monitoring
- Explainable AI using SHAP
- Model monitoring and drift detection
- Docker containerization
- CI/CD pipeline
- Cloud deployment (AWS, Azure, GCP)
- Streaming fraud detection with Kafka
- Interactive analytics dashboard
Contributions are welcome.
- Fork the repository.
- Create a new feature branch.
- Commit your changes.
- Push the branch.
- Open a Pull Request.
This project is licensed under the MIT License.
Parm Khurana
B.Tech Computer Science & Engineering Machine Learning | Data Science | Full Stack Development
If you found this project useful, consider giving it a β on GitHub.