Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saranshbansal/rtfd
Reat Time Fraud Detection using ML
https://github.com/saranshbansal/rtfd
flask fraud-detection machine-learning python streamlit transaction-processing
Last synced: 3 months ago
JSON representation
Reat Time Fraud Detection using ML
- Host: GitHub
- URL: https://github.com/saranshbansal/rtfd
- Owner: saranshbansal
- Created: 2024-07-27T09:17:56.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-08-01T04:55:23.000Z (6 months ago)
- Last Synced: 2024-08-01T11:02:00.794Z (6 months ago)
- Topics: flask, fraud-detection, machine-learning, python, streamlit, transaction-processing
- Language: Jupyter Notebook
- Homepage: https://real-time-fraud-detection.streamlit.app/
- Size: 6.86 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Real-time Fraud Detection using Machine Learning
![alt text](static/images/rtfd_base.gif)
This is a Streamlit application for showcasing real-time fraud detection using machine learning algorithms.
https://real-time-fraud-detection.streamlit.app/
## 🗿 History
Ever since the advent of internet the digital revolution has rising and has crept into all aspects to our
lives. One of the most important digital revolution happened in financial system and especially transacting money to
someone from any part of the world digitally. Digital transactions have become a part of daily life like purchasing a
product online, sending money to friends, depositing cash in bank account, investment purposes etc., They had a lot of
benefits so does pave way for fraudulent activities. People started using digital money transactions medium to launder
money and make the money look like it comes from a legal source.## 🎯 Objective
The objective of this application is to find the patterns of transactions performed and help algorithms learn
those patterns in identifying the fraudulent transactions and flag them.## 📌 Goals
- Exploratory analysis of data to extract the pattern of fraudulent activities.
- Build a machine learning model to classify fraud and non-fraud transactions.
- Reduce the false negatives by tuning the model.## 📁 Dataset
The dataset used in this project is obtained from the file [PS_20174392719_1491204439457_log.csv](https://www.kaggle.com/datasets/ealaxi/paysim1).
It contains transaction logs with various features including `step, type, amount, nameOrig, nameDest, isFlaggedFraud, and isFraud`.### Dataset description
`step` - maps a unit of time in the real world. In this case 1 step is 1 hour of time. Total steps 744 (30 days simulation).
`type` - CASH-IN, CASH-OUT, DEBIT, PAYMENT and TRANSFER.
`amount` - amount of the transaction in local currency.
`nameOrig` - customer who started the transaction
`oldbalanceOrg` - initial balance before the transaction
`newbalanceOrig` - new balance after the transaction
`nameDest` - customer who is the recipient of the transaction
`oldbalanceDest` - initial balance recipient before the transaction. Note that there is not information for customers that start with M (Merchants).
`newbalanceDest` - new balance recipient after the transaction. Note that there is not information for customers that start with M (Merchants).
`isFraud` - This is the transactions made by the fraudulent agents inside the simulation. In this specific dataset the fraudulent behavior of the agents aims to profit by taking control or customers accounts and try to empty the funds by transferring to another account and then cashing out of the system.
`isFlaggedFraud` - The business model aims to control massive transfers from one account to another and flags illegal attempts. An illegal attempt in this dataset is an attempt to transfer more than 200.000 in a single transaction.
## 📥 Installation
1. Clone the repository:
`git clone https://github.com/your-username/your-project.git`
2. Navigate to the project directory:
`cd your-project`
3. Create a virtual environment (optional but recommended):
`python -m venv env source env/bin/activate`
4. Install the required dependencies:
`pip install -r requirements.txt`
5. Set up the environment variables (if applicable):
`export SECRET_KEY=your-secret-key`
`export DATABASE_URL=your-database-url`
6. Run the Streamlit application:
`streamlit run streamlit_app.py`
The application should now be running at `http://localhost:8502`.
## Screens
![alt text](static/images/app_5.png)
![alt text](static/images/app_4.png)
![alt text](static/images/app_3.png)
![alt text](static/images/app_2.png)
![alt text](static/images/app_1.png)