All notable changes to this project will be documented in this file.
- Real Kaggle run results: All documentation updated with actual numbers from the Kaggle multi-dataset notebook run. CICIDS2017 F1=0.9964, UNSWNB15 F1=0.7982, CICIDS2018 F1=0.9990 (2 classes).
- Jaccard similarity updated: Overall SHAP-LIME Jaccard = 0.216 (was 0.324 from synthetic data). Per-dataset: CICIDS2017=0.180, UNSWNB15=0.111, CICIDS2018=0.429.
- XCS results updated: Real data values — CICIDS2017 mean=0.517, UNSWNB15 mean=0.424 (14/80 flagged), CICIDS2018 mean=0.550.
- CICIDS2018 still has 2 classes (Benign + DDoS-LOIC-HTTP) — the Kaggle dataset source only contains these two classes. The stratified sampling fix works correctly but cannot create classes absent from source data.
- Real-time XCS in API:
/explainendpoint now computes full XCS = 0.4×Conf + 0.3×(1-SHAP_Instability) + 0.3×Jaccard(SHAP,LIME) withxcs_componentsbreakdown andxcs_reliableflag. - Statistical significance testing:
src/evaluation/stats.pywith McNemar's test, paired t-test, and cross-validation with pairwise model comparisons. - SMOTE oversampling:
src/models/train.pynow supportsuse_smote=Trueflag for minority class boosting. - Adversarial robustness evaluation:
src/evaluation/adversarial.pywith FGSM attacks via ART, accuracy degradation curves, and XCS drop analysis on adversarial inputs. - Counterfactual explanations:
src/explainability/counterfactual.pyusing DiCE library with gradient-free fallback. - Temporal drift detection:
src/evaluation/drift.pywith KS-test per feature and sequential temporal split evaluation. - Cross-dataset generalization:
src/evaluation/cross_dataset.pywith feature name mapping and domain shift metrics. - API /health/features endpoint: Returns training feature statistics for client-side drift detection.
- Test coverage expanded: Added test_api.py (all endpoints), test_explainability.py (SHAP+LIME+counterfactuals), test_xcs.py (XCS formula properties), test_stats.py (McNemar+t-test), test_regression.py (performance threshold guards).
- BENCHMARKS.md: Comprehensive benchmark table with all models, datasets, train/test sizes, accuracy, F1, and latency.
- API version: 2.0.0 → 3.0.0
- generate_sample.py: minimum 200 samples per rare class (was 10)
- README.md: Added paper-style abstract and expanded Key Findings
- AUDIT.md: Added Threats to Validity section
- RESULTS.md: Expanded Key Findings with 8 scientific findings
- SMOTE type annotation: Fixed sampling_strategy dict typing
- API model loading: Prioritizes .joblib files over .pkl fallbacks
- XCS recomputed with full formula: LIME per-sample Jaccard component was 0 in v2.0.1 CSVs because LIME never ran during XCS computation. Added scripts/recompute_xcs.py which runs the complete XCS = 0.4×Conf + 0.3×(1-Instab) + 0.3×Jaccard formula and commits the corrected explanations/xcs_*_v2.csv files.
- test_model_prediction.py: fixed dict-vs-bare-model assumption; tests now pass on the committed bare-model joblib files.
- Documentation: all XCS tables updated with v2 recomputed values.
- scripts/recompute_xcs.py — full XCS recomputation with LIME
- scripts/verify_results.py — model artifact integrity checker
- scripts/generate_xcs_plots.py — regenerate XCS plots from v2 CSVs
- api: /xcs-summary endpoint returns offline XCS evaluation summary
- Standardised model save format from .pkl to .joblib throughout
- Updated README.md, RESULTS.md, MODEL_CARD.md, AUDIT.md, PROJECT_STATUS.md
- api/app.py
/explain: replaced misleading globalfeature_importances_with real per-sample SHAP TreeExplainer values; global importances kept as fallback if SHAP fails - api/app.py XCS score: added inline documentation clarifying that the API returns the confidence component only (fast-path); full XCS = 0.4×Conf + 0.3×(1−Instab) + 0.3×Jaccard is computed offline in the Kaggle evaluation notebook
- RESULTS.md: filled in XCS and SHAP–LIME Jaccard tables with actual numbers (previously "See CSV"); added per-class XCS breakdown
- RESULTS.md: honest framing for CICIDS2018 — 2 classes captured, not "binary classification"; stratified sampling fix applied to notebook
- README.md: synced CICIDS2018 class count and XCS results table
- CICIDS2018 full multi-class results (14+ classes) require re-running
xai_ids_multidataset.ipynbon Kaggle withCICIDS2018_ROWS_PER_FILE = 20_000andload_csv_files_stratified()— the code fix is already in the notebook
- Multi-Dataset Support: Evaluation on 3 datasets (CIC-IDS-2017, UNSW-NB15, CSE-CIC-IDS-2018)
- New Models: LightGBM and VotingEnsemble (from Kaggle notebook)
- XCS Metric: Novel XAI Confidence Score for explanation reliability
- RESULTS.md: Comprehensive results tables for all datasets and models
- CONTRIBUTING.md: Contribution guidelines
- SECURITY.md: Security policy and best practices
- PR Template: Pull request template for consistent contributions
- Model Prediction Tests: Tests for loading saved models and making predictions
- Example Scripts:
examples/predict_example.pyfor model usage - API Improvements: XCS score in predictions, lifespan context manager, input validation
- README.md: Complete overhaul with architecture diagram, multi-dataset results, XCS formula
- MODEL_CARD.md: Updated with actual metrics from all 3 datasets
- docs/methodology.md: Added XCS formula, multi-dataset discussion, UNSW-NB15 and CICIDS2018 details
- ROADMAP.md: Updated to reflect completed phases
- BENCHMARK_PLAN.md: Updated with completed benchmark results
- api/app.py: Modernized with FastAPI lifespan, improved model loading, input validation
- requirements.txt: Added lightgbm, imbalanced-learn; pinned upper bounds
- CITATION.cff: Removed placeholder ORCID
- .gitignore: Added __MACOSX/, .DS_Store, .ipynb_checkpoints/, logs
- XGBoost deprecated
use_label_encoderparameter removed - File handle leak in
src/data/loader.py - HTTP URL changed to HTTPS in
src/data/download.py - Typo fix:
MACHINELEARNIGCVE_PATH→MACHINE_LEARNING_CVE_PATH - Unicode corruption in
model_metadata.jsonclass names - Removed committed
__MACOSX/macOS artifact directory
pyyamlfrom requirements.txt (config.yaml is reference-only, not loaded)
- Models: Added balanced class weights to address class imbalance
- Logistic Regression: class_weight='balanced'
- Random Forest: class_weight='balanced'
- XGBoost: sample_weight based on class frequencies
- Evaluation: Added cross-validation support (
--cv-folds) - Evaluation: Added precision-recall curves (
--pr-curves) - Evaluation: Added calibration curves (
--calibration) - Evaluation: Added failure analysis report (
--failure-analysis) - Data: Added Zenodo fallback for CIC-IDS-2017 download
- API: Added FastAPI inference endpoint (api/app.py)
- Infrastructure: Added config.yaml for pipeline configuration
- Infrastructure: Added Dockerfile for containerized deployment
- Testing: Added unit tests (tests/test_evaluation.py)
- Documentation: Added MODEL_CARD.md
- Documentation: Added AUDIT.md, ROADMAP.md, PROJECT_STATUS.md
- README.md: Updated results with per-class metrics
- README.md: Expanded limitations section with class imbalance details
- ROADMAP.md: Updated with completed items
- Macro F1 improved from 0.44 to 0.51
- 4 of 5 previously failing attack classes now have detection
- SQL Injection remains at 0% detection (20 samples)
- DoS attacks commonly confused with each other
- Default training on synthetic data
- Initial release
- Logistic Regression, Random Forest, XGBoost models
- SHAP and LIME explainability
- Synthetic data generation
- GitHub Pages documentation