How dev-s-t/frauddetectionsystem works
Main Components
• Frontend Web Pages:
• FSD Landing Page (FSD_landing-main): The central starting page of the platform.
• User Input Form (form-fsd-main): A form designed for users to input data, including CSV mapping files for categories, jobs, merchants, and states.
• API Documentation Page (api_page-main): A dedicated page that documents the API endpoints.
• Prediction Results Page (results-main): A page to display the outcomes of predictions.
• Backend API:
• Prediction API (fsd-v2-main): Contains the main entry point (main.py running with uvicorn) that processes incoming requests, loads models (from the resources directory), and generates prediction results. This component also includes some testing scripts and additional modules.
• Model Development:
• Model Creation (Model_creation): Jupyter notebooks for building and refining the machine learning/deep learning models used for fraud detection. While not part of the live system, they are an essential component for developing and updating your models.
Relationships and Interactions
• The Landing Page to the Input Form and API Documentation.
• The Input Form to the Backend API, representing that user data is submitted via the form.
• Data Flow: From the Backend API to the Results Page, showing that predictions are returned and displayed.
• Internal Processing: Within the Backend API component (fsd-v2-main), highlight that the prediction service loads various pre-trained model files (e.g., knn_model.pkl, neural_network_model.h5, random_forest_model.pkl, scaler.pkl, xgboost_model.pkl) from the resources folder.
• Model Creation: Indicate that the Jupyter notebooks (Model_creation) are used for experimental development and training of models that eventually get deployed to the API server.
Architectural Patterns or Design Principles
• Separation of Concerns: Clearly delineate the presentation (frontend web pages), business logic (backend prediction API), and data/model development (Jupyter notebooks) layers.
• API-Driven Architecture: The backend is built to serve predictions via API endpoints (noted by the uvicorn command for FastAPI or similar), which the frontend utilizes.
• Modular Design: Each folder (landing page, form input, API docs, results, model creation, and prediction server) is its own module, allowing independent development and testing.
Relevant Technologies and Frameworks
• Frontend: Standard web technologies (HTML, CSS) are used in the landing, form page, API documentation, and results pages.
• Backend: Python-based service utilizing uvicorn (likely via FastAPI given the command structure “uvicorn main:app --reload”) that handles API requests.
• Machine Learning: Multiple models are loaded (e.g., KNN, neural network, random forest, XGBoost) with corresponding file formats (pickle for most and .h5 for neural network models). The notebooks in Model_creation likely use typical Python ML libraries (e.g., scikit-learn, TensorFlow/Keras).
Specific Elements
• Each component should be clearly labeled with its folder name (e.g., FSD_landing-main, fsd-v2-main, form-fsd-main, etc.).
• From “User” to “Input Form” to “Backend API”.
• From “Backend API” to “Results Page”.
• Web interfaces (landing, forms, docs, results)
• API/backend service
• Model training environment
• Optionally, insert a note indicating that certain folders (like Model_creation) are used primarily for development/training while fsd-v2-main represents the live API that utilizes these models.
Final Assembly
• This user to the “Landing Page” interface.
• Branch out to the “Form for User Input” and “API Documentation” components.