An advanced machine learning-powered system for detecting fraudulent financial transactions. Features interactive dashboards, real-time analysis, and secure user authentication.
- Machine Learning Detection: Detects suspicious activity using Random Forest and Isolation Forest algorithms
- Interactive Dashboard: Real-time statistics and visualization of transaction data
- CSV Upload & Analysis: Upload transaction data and analyze with custom sensitivity
- Comprehensive Reports: Generate detailed fraud analysis reports with visualizations
- Transaction Deep Dive: View risk factors and breakdowns for each transaction
- User Authentication: Secure registration, login, and session management
- Backend: Flask, SQLAlchemy, PostgreSQL
- Machine Learning: scikit-learn, pandas, NumPy
- Frontend: Bootstrap, Chart.js, JavaScript
- Authentication: Flask-Login
- Python 3.10+
- PostgreSQL database
- Modern web browser
- Clone the repository
git clone https://github.com/Adithya17-star/AI-Enabled-Fraud-Detection.git
cd AI-Enabled-Fraud-Detection
- Install dependencies
pip install -r requirements.txt
- Configure environment variables
DATABASE_URL=postgresql://username:password@localhost:5432/fraud_detection
SESSION_SECRET=your-secure-secret-key
- Initialize the database
python -c "from app import db; db.create_all()"
- Run the application
python main.py
- Open your browser and navigate to
http://localhost:5000
- Create a new account via the Registration page
- Log in using your credentials
- Navigate to the Upload page
- Upload a CSV file with transaction data (see format below)
- Preview the data and start analysis
Your CSV file should include the following columns:
transaction_id
: Unique identifieramount
: Transaction amounttimestamp
: Date and time (YYYY-MM-DD HH:MM:SS)merchant
: Merchant namemerchant_category
: Category of merchant (optional)description
: Transaction description (optional)location
: Transaction location (optional)ip_address
: IP address (optional)device_id
: Device identifier (optional)
- Select detection model (Random Forest or Isolation Forest)
- Adjust detection sensitivity
- Start analysis to identify fraudulent transactions
- View key metrics including total transactions, fraud count, and amounts
- Analyze transaction trends over time
- Examine fraud distribution by merchant category
- Create a new report by specifying date range and title
- View detailed fraud patterns and statistics
- Export reports for record-keeping
AI-Enabled-Fraud-Detection/
├── static/ # Static assets
│ ├── css/ # CSS stylesheets
│ └── js/ # JavaScript files
├── templates/ # HTML templates
├── app.py # Flask application setup
├── main.py # Application entry point
├── models.py # Database models
├── routes.py # Application routes
├── fraud_detection.py # Fraud detection algorithms
├── data_preprocessing.py # Data preprocessing utilities
└── utils.py # Helper functions
- All passwords are securely hashed using werkzeug's security functions
- PostgreSQL database with secure connection
- Input validation on all form submissions
- Session management via Flask-Login
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Adithya Kakarla - Initial work - Adithya17-star
- Bootstrap for the UI components
- Chart.js for data visualization
- Flask for the web framework
- scikit-learn for machine learning capabilities
This project is part of an ongoing effort to improve fraud detection systems using artificial intelligence and machine learning techniques.