How aashmitmckenzie/apif-adaptive-phishing-intelligence-framework works
Project type and purpose
• This is a full-stack, “real-time phishing detection” Python application with an interactive Streamlit dashboard.
• Core functions: URL feature extraction, three parallel detection pipelines (ML, DL, Heuristic), weighted ensemble fusion with reinforcement learning updates, and a feedback loop persisted in SQLite.
Main components
a. Streamlit UI (streamlit_app.py)
b. Data Preprocessor (data_preprocessor.py)
c. ML Pipeline (ml_pipeline.py) – Random Forest + XGBoost
d. DL Pipeline (dl_pipeline.py) – PyTorch feed-forward network
e. Heuristic Rules Engine (embedded in ensemble_rl.py)
f. Ensemble & RL Weight Optimizer (ensemble_rl.py)
g. Training Orchestrator (train_models.py)
h. Feedback Store (SQLite used by streamlit_app.py & ensemble_rl.py)
i. EDA Notebook (APIF_EDA_Analysis.ipynb) – offline analysis
Relationships & data flow
1. URL Input → Streamlit UI
2. UI calls Feature Extraction → output 21 numeric features
3. Split features in parallel into three pipelines:
– ML Pipeline → ML probability
– DL Pipeline → DL probability
– Heuristic Rules → Heuristic probability
4. Probabilities → Ensemble Fusion (weights from ensemble_weights.pkl, updated by RL)
6. User feedback → written to SQLite → triggers Q-Learning update of ensemble weights → saved back
Architectural patterns & principles
• Modular separation: each detection pipeline in its own module
• Parallel execution: concurrency drives low latency (total ≈ slowest pipeline)
• Feedback loop: Reinforcement Learning adjusts ensemble weights over time
• Offline analytics: EDA notebook uses same preprocessor + models for deep dives