This project is a comprehensive fraud detection system designed to identify fraudulent transactions in a dataset. It combines a user-friendly dashboard for data visualization and analysis with a REST API for predictive modeling. Using machine learning techniques, the system identifies potential fraud and provides interactive insights.
- Streamlit Dashboard:
- Visualize transaction data distribution.
- Analyze fraudulent transactions by country and type.
- Interactive world map visualization.
- Machine Learning:
- Random Forest Classifier for fraud detection.
- Preprocessing with feature engineering.
- REST API:
- Predict fraud probability using Flask.
- Programming Language: Python
- Libraries: Streamlit, Flask, Scikit-learn, Plotly, Pandas, NumPy
- Visualization Tools: Plotly for interactive charts, Streamlit for dashboards
- Model Deployment: Flask for API
- Python 3.8 or above
- Required libraries (see
requirements.txt
)
- Clone the repository:
git clone https://github.com/your-repo/fraud-detection-system.git
- Navigate to the project directory:
cd fraud-detection-system
- Install the dependencies:
pip install -r requirements.txt
- Download the dataset and place it in the specified path:
- Update the
data_path
variable infraud_dashboard.py
with the correct dataset location.
- Update the
- Run the Streamlit application:
streamlit run fraud_dashboard.py
- Open the URL provided by Streamlit in your browser (default:
http://localhost:8501
). - Explore data visualizations, analyze fraud distribution, and view model results.
- Start the Flask server:
python flask_api.py
This project uses a transactional dataset that includes:
- Features:
Time_step
: Timestamp of the transaction.USD_amount
: Transaction amount in USD.Sender_Account
,Sender_Country
: Sender details.Bene_Country
: Beneficiary country.Transaction_Type
: Type of transaction.
- Target:
Label
(1 for fraud, 0 for non-fraud).
- Implementing advanced machine learning techniques like ensemble methods or deep learning.
- Adding more robust error handling in the Flask API.
- Including real-time transaction monitoring capabilities.