How kulitipri/project_2 works
IDS ML Pipeline turns CICIDS network-traffic CSVs into trained attack classifiers and evaluation reports. Its main workflow is config-driven preprocessing and splitting, model training and tuning, then test evaluation; trained artifacts also support new-file and Streamlit predictions. Separate branches detect unknown attacks with Isolation Forest and explain model features with SHAP. The README documents cross-validation, class-imbalance options, threshold tuning, and visualizations. Sampled excerpts establish key module behavior, but some orchestration and subsystem wiring is inferred from README descriptions, so uncertain internal links are omitted.
Main entry points: main.py Pipeline Orchestrator · utils.py Model and Data Artifacts · train.py Baseline Training · data_preprocessing.py Preprocess and Split
Components 18
Pipeline Core
- Pipeline Orchestrator
main.py - Preprocess and Split
src/data_preprocessing.py - Pipeline Config
configs/default.yaml
Modeling and Evaluation
- Baseline Training
src/train.py - Hyperparameter Tuning
src/train.py - Cross Validation
src/train.py - Test Evaluation
src/evaluate.py - Class Threshold Tuning
src/evaluate.py
Inference Interfaces
- CSV Prediction
src/predict.py - Streamlit Demo
app.py
Detection and Explanation
- Anomaly Detection
src/anomaly.py - SHAP Explanation
src/explain.py - Pipeline Charts
src/visualization.py
Shared Resources
- Model and Data Artifacts
src/utils.py - Config and Artifact Utilities
src/utils.py
Other components
- CLI User
- Web User
- CICIDS CSVs
Connections 28
- CLI User → Pipeline Orchestrator: runs
- Web User → Streamlit Demo: uploads CSV
- CICIDS CSVs → Preprocess and Split: loads traffic
- Pipeline Orchestrator → Config and Artifact Utilities: loads config
- Pipeline Orchestrator → Preprocess and Split: runs preprocessing
- Pipeline Orchestrator → Baseline Training: runs training
- Pipeline Orchestrator → Test Evaluation: runs evaluation
- Pipeline Orchestrator → CSV Prediction: dispatches prediction
- Pipeline Orchestrator → Anomaly Detection: dispatches detection
- Pipeline Orchestrator → SHAP Explanation: dispatches explanation
- Pipeline Orchestrator → Pipeline Config: reads settings
- Preprocess and Split → Pipeline Config: reads settings
- Preprocess and Split → Model and Data Artifacts: writes splits
- Preprocess and Split → Pipeline Charts: generates charts
- Baseline Training → Hyperparameter Tuning: tunes models
- Baseline Training → Cross Validation: runs validation
- Baseline Training → Model and Data Artifacts: saves models
- Baseline Training → Pipeline Charts: generates comparisons
- Test Evaluation → Class Threshold Tuning: tunes class thresholds
- Test Evaluation → Model and Data Artifacts: saves evaluation
- Test Evaluation → Pipeline Charts: generates charts
- CSV Prediction → Model and Data Artifacts: loads inference artifacts
- Streamlit Demo → Config and Artifact Utilities: loads config and artifacts
- Streamlit Demo → CSV Prediction: prepares input
- Anomaly Detection → Model and Data Artifacts: loads and saves detector
- Anomaly Detection → Pipeline Charts: plots scores
- SHAP Explanation → Model and Data Artifacts: loads model
- SHAP Explanation → Pipeline Charts: saves explanation chart