Views
No views yet
pop123-ux/pcap-ml-traffic-classifier on GitHub.| Architecture | CatBoost — symmetric oblivious decision trees |
| Task | Binary classification (0 = benign, 1 = malicious) |
| Input | 78 CICFlowMeter flow features per connection |
| Training data | CIC-IDS-2017 — all 8 daily captures, ~2.8 M labeled flows |
| Class balancing | auto_class_weights='Balanced' (benign traffic ~4× more common) |
| Regularization | L2 leaf reg, early stopping on validation F1 |
| File | cicids_catboost.cbm (CatBoost native binary) |
| Class | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| Benign (0) | 1.000 | 0.999 | 0.999 | 681,396 |
| Malicious (1) | 0.995 | 1.000 | 0.997 | 166,967 |
| Accuracy | 0.999 | 848,363 | ||
| Macro avg | 0.997 | 0.999 | 0.998 | 848,363 |
| Weighted avg | 0.999 | 0.999 | 0.999 | 848,363 |
⚠️ Read before deploying. These numbers come from a random hold-out drawn from the same 8-day capture as the training data — same network, same attack tools, same time window. Cross-network generalization to a different corporate LAN or novel attacker tooling is not measured here and is expected to be lower. Treat this as a strong CIC-IDS-2017 benchmark result, not a plug-and-play production IDS.
1from catboost import CatBoostClassifier
2from huggingface_hub import hf_hub_download
3import pandas as pd
4
5# Download and load the model (cached under ~/.cache/huggingface after first run)
6path = hf_hub_download(
7 repo_id="pop123ux/pcap-ml-traffic-classifier",
8 filename="cicids_catboost.cbm",
9)
10model = CatBoostClassifier().load_model(path)
11
12# X must be a DataFrame containing the 78 CICFlowMeter features in the same
13# order the model was trained on — check with model.feature_names_
14X = pd.read_csv("your_cicflowmeter_output.csv")
15preds = model.predict(X) # 0 = benign, 1 = malicious
16probs = model.predict_proba(X) # calibrated malicious probability1cicflowmeter -f suspicious.pcap -c flows.csv
2python3 load_pretrained.py flows.csv # helper script in the GitHub repocicids_catboost.json (also included in this repo).early_stopping_rounds=501@misc{pcap_ml_traffic_classifier_2026,
2 author = {pop123-ux},
3 title = {pcap-ml-traffic-classifier: CatBoost-Powered Network Intrusion Detection},
4 year = {2026},
5 publisher = {GitHub},
6 howpublished = {\url{https://github.com/pop123-ux/pcap-ml-traffic-classifier}}
7}