This project is a full-stack application that demonstrates how to use AI and machine learning for detecting fraudulent financial transactions. It consists of a React frontend and a Python Flask backend with a machine learning model.
- Machine learning-based fraud detection
- Real-time transaction analysis
- Batch processing of transaction data
- Training mode for model improvement
- Interactive dashboard for visualization
project/src/- React frontend applicationproject/backend/- Python Flask API for ML model
- Node.js and npm
- Python 3.7+
- Required Python packages: flask, flask-cors, pandas, numpy, scikit-learn, joblib
-
Install Python dependencies:
cd project/backend pip install -r requirements.txt -
Start the Flask server:
python app.py
The API server will run on http://localhost:5000
-
Install Node.js dependencies:
cd project npm install -
Start the React development server:
npm run dev
Or build for production:
npm run build
-
For a production build, serve the static files:
cd dist python -m http.server 8000The React app will run on http://localhost:8000 (or port 5173 in development mode)
- Switch to "Training Mode" in the top right corner
- Upload a CSV file containing transaction data with fraud labels
- The model will train and display metrics
-
You can analyze transactions in two ways:
- Individual transaction analysis: Fill out the form with transaction details
- Batch analysis: Upload a CSV file with multiple transactions
-
View the results showing fraud probabilities and confidence scores
The application uses a Random Forest classifier to detect fraudulent transactions. It analyzes patterns in transaction amounts, account balances, transaction types, and balance discrepancies.