How hxtanishq/ddos_prediction works
Project type and purpose
• From the file tree and README, this is a full-stack web application with an embedded machine-learning pipeline.
• Purpose: Real-time DDoS detection using an LSTM-RNN model, plus a Flask-based web UI for monitoring, testing, and managing the system.
File structure
• Top-level scripts:
• server.py: Flask app exposing REST endpoints
• prediction.py: real-time inference code loading the trained model
• train_model.py + dataloader.py: offline ML training pipeline
• attack.py: synthetic DDoS traffic generator for test mode
• main.py: (likely) orchestrator or legacy entry point
• Directories:
• data/: raw or preprocessed CSV data for training/testing
• model/: stored artifacts (Keras .h5, scalers, encoders, metrics)
• logs/: runtime prediction logs for download and audit
• templates/: Jinja2 HTML (index.html, monitor.html) for the UI
• test/: unit or integration tests
• Config/build files:
• requirements.txt: Python dependencies (Flask, TensorFlow/Keras, Chart.js, etc.)
README for architecture hints
• Three primary subsystems described:
a. Real-time traffic monitoring (endpoints /status, /total_count)
b. DDoS detection via LSTM-RNN (offline training vs online inference)
c. Web interface (dashboard, charts, test trigger, log download)
• Simulation & testing via attack.py and “Test Detection” UI button
• Logging and model-metrics reporting endpoints