How ahad-2004/fraud-detection-using-dl works
Project type and purpose
• This is a full-stack, single-page web application for real-time insurance fraud detection.
• It consists of a modern HTML/Bootstrap frontend, a FastAPI backend, and an AI/ML component (Keras model + sklearn preprocessing).
File structure
• Top-level files:
• main.py – FastAPI server entrypoint
• index.html – Static dashboard UI
• professional_fraud_model.h5 – Trained Keras model
• professional_preprocessor.pkl – sklearn preprocessing pipeline
• test_preprocessor.py – Unit test for the preprocessing stage
• fix_preprocessor.py – (Presumed) utility to rebuild/fix the pipeline
• start_server.bat, upload_to_github.bat – Deployment scripts
• requirements.txt – Python dependencies
• No separate “frontend” or “backend” folders: components are co-located but logically separated.
README for additional insights
• Frontend: HTML5, Bootstrap 5, JavaScript, CSS3
• Backend: Python, FastAPI, Uvicorn
• AI/ML: TensorFlow/Keras, Scikit-Learn, Pandas
• Key workflow: user submits claim → backend loads preprocessor → transforms data → feeds model → returns risk score → frontend renders animated risk meter.
a. Main components (group into layers):
1) Client Layer
• Web Browser (UI)
• index.html + JS/CSS in browser
• User form for claim input, animated risk meter
2) API Layer
• FastAPI Server (main.py + Uvicorn)
• POST /predict endpoint
• Error handling, JSON request/response
3) ML Layer
• Preprocessor Module
• professional_preprocessor.pkl loaded via sklearn
• Prediction Model
• professional_fraud_model.h5 loaded via TensorFlow/Keras
4) Dev/Deploy Utilities
• test_preprocessor.py (CI/QA)
• fix_preprocessor.py (rebuild pipeline)
• start_server.bat, upload_to_github.bat (automation)
b. Relationships & interactions
c. Architectural patterns/design principles
• Separation of concerns: UI vs. API vs. ML pipeline
• Stateless REST API: each request loads pipeline + model (or could be cached)
• Pipeline abstraction: serialization of feature engineering
• Modular design: utilities/scripts decoupled from core runtime
d. Key technologies/frameworks
• Frontend: HTML5, Bootstrap 5, JavaScript, CSS3
• Backend: FastAPI, Uvicorn
• ML: TensorFlow/Keras (.h5), sklearn Pipeline (.pkl), Pandas
• Dev: Python scripts, Windows batch for automation
Final recommendations
• Be exhaustive but avoid clutter: group files into logical modules