Sentinel is an end-to-end, machine-learning-powered fraud detection system that analyzes financial transactions within milliseconds.
Built using modern MLOps principles, it unifies data processing, model training, API services, database logging, and monitoring dashboards under a single architecture.
graph LR
User[Client / Simulator] -->|POST /predict| API[FastAPI Service]
API -->|1. Preprocessing| Preproc[Feature Engineering]
Preproc -->|2. Inference| Model[XGBoost Pipeline]
Model -->|3. Prediction| API
API -->|4. Logging| DB[(SQLite / Postgres)]
API -->|Response| User
User -->|Monitor| Dashboard[Streamlit App]
- Advanced Feature Engineering: Time-based and geo-mismatch feature extraction.
- Imbalance Handling: Uses
scale_pos_weightfor highly imbalanced datasets. - Robust API: Async FastAPI architecture with Pydantic v2 validation.
- Audit Trail: Every prediction is logged into the database.
- Dockerized: Entire system can be launched with a single command.
make up
# Stop the system
make downAPI: http://localhost:8000/docs Dashboard: http://localhost:8501
# Create a virtual environment
python -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run training
python src/ml_core/train.py
# Start the API
python src/main.py
# Start the dashboard
streamlit run dashboard.pyAutomated tests ensure system reliability.
make test
# or
pytest -vsentinel-fraud-detection-system/
├── src/
│ ├── ml_core/ # Model training & artifacts
│ ├── routers/ # API endpoints
│ ├── services/ # Business logic (Inference & Preprocessing)
│ ├── db/ # Database connections
│ └── models/ # SQLAlchemy schemas
├── tests/ # Integration tests
├── dashboard.py # Streamlit monitoring dashboard
├── Dockerfile # Container definition
└── Makefile # Command automation
Developed by Efekan Salman — 2025