ids-detection-eval
Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction — Talukder et al. (2024) (arXiv:2401.12262, 2024)
What this evaluates
Evaluates machine learning classifiers for network intrusion detection on imbalanced, high-dimensional traffic data. Probes the model's ability to distinguish benign from malicious traffic across binary and multilabel settings using standard classification metrics.
Datasets
- UNSW-NB15 — total ?; splits: train (-1), test (-1)
- CIC-IDS2017 — total ?; splits: train (-1), test (-1)
- CIC-IDS2018 — total ?; splits: train (-1), test (-1)
Metrics
Accuracy (primary) — range: [0, 1]
- Proportion of correctly predicted observations to total observations. Formula: (TP + TN) / (TP + FP + FN + TN).
Precision — range: [0, 1]
- Ratio of correctly predicted positive values to total predicted positive values. Formula: TP / (TP + FP).
Recall — range: [0, 1]
- Ratio of correctly predicted positive values to all actual positive values. Formula: TP / (TP + FN).
F1-Score — range: [0, 1]
- Harmonic mean of precision and recall. Formula: 2 * (Precision * Recall) / (Precision + Recall).
AUC — range: [0, 1]
- Area Under the Receiver Operating Characteristic Curve. Measures the model's ability to distinguish between class labels by plotting True Positive Rate against False Positive Rate at various thresholds.
Input / output format
Input: Feature vectors extracted from network traffic records, preprocessed via Random Oversampling, Stacking Feature Embedding, and PCA.
Output: Predicted class label (binary or multilabel classification).
Scoring recipe
def compute_metrics(y_true, y_pred):
tp = sum((t==1) & (p==1) for t, p in zip(y_true, y_pred))
tn = sum((t==0) & (p==0) for t, p in zip(y_true, y_pred))
fp = sum((t==0) & (p==1) for t, p in zip(y_true, y_pred))
fn = sum((t==1) & (p==0) for t, p in zip(y_true, y_pred))
acc = (tp + tn) / (tp + fp + fn + tn)
prec = tp / (tp + fp) if (tp + fp) > 0 else 0
rec = tp / (tp + fn) if (tp + fn) > 0 else 0
f1 = 2 * (prec * rec) / (prec + rec) if (prec + rec) > 0 else 0
return acc, prec, rec, f1
Common pitfalls
- Data imbalance is handled via Random Oversampling on the training folds, so test metrics must be computed on the original, unbalanced test split to reflect real-world performance.
- The protocol evaluates both binary and multilabel classification; metric aggregation (e.g., macro vs micro averaging) is not explicitly specified and may vary across implementations.
- 10-fold cross-validation is used with a 90/10 train/test split per fold, meaning reported scores are averages across 10 runs rather than a single holdout evaluation.
Evidence (verbatim from paper)
Several measures, such as accuracy, precision, recall, F1-score, ROC curve, and confusion matrix, are used to evaluate the performance of our proposed model. ... Accuracy is a fundamental performance metric, representing the proportion of correctly predicted observations to the total observations. It is calculated as follows: $$ Accuracy = rac {T P + T N}{T P + F P + F N + T N} $$
Citation
@misc{talukder2024network,
title={Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction},
author={Talukder et al. (2024)},
year={2024},
note={arXiv:2401.12262}
}
1---2name: ids-detection-eval3description: Evaluates machine learning classifiers for network intrusion detection on imbalanced, high-dimensional traffic data. Probes the model's ability to distinguish benign from malicious traffic across binary and multilabel settings using standard classification metrics. Use when the user wants to benchmark on UNSW-NB15, CIC-IDS2017, CIC-IDS2018, or asks about evaluating this task. Reports Accuracy.4---56# ids-detection-eval78> Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction — Talukder et al. (2024) (arXiv:2401.12262, 2024)910## What this evaluates1112Evaluates machine learning classifiers for network intrusion detection on imbalanced, high-dimensional traffic data. Probes the model's ability to distinguish benign from malicious traffic across binary and multilabel settings using standard classification metrics.1314## Datasets1516- **UNSW-NB15** — total ?; splits: train (-1), test (-1)17- **CIC-IDS2017** — total ?; splits: train (-1), test (-1)18- **CIC-IDS2018** — total ?; splits: train (-1), test (-1)1920## Metrics2122- `Accuracy` **(primary)** — range: [0, 1]23 - Proportion of correctly predicted observations to total observations. Formula: (TP + TN) / (TP + FP + FN + TN).24- `Precision` — range: [0, 1]25 - Ratio of correctly predicted positive values to total predicted positive values. Formula: TP / (TP + FP).26- `Recall` — range: [0, 1]27 - Ratio of correctly predicted positive values to all actual positive values. Formula: TP / (TP + FN).28- `F1-Score` — range: [0, 1]29 - Harmonic mean of precision and recall. Formula: 2 * (Precision * Recall) / (Precision + Recall).30- `AUC` — range: [0, 1]31 - Area Under the Receiver Operating Characteristic Curve. Measures the model's ability to distinguish between class labels by plotting True Positive Rate against False Positive Rate at various thresholds.3233## Input / output format3435**Input**: Feature vectors extracted from network traffic records, preprocessed via Random Oversampling, Stacking Feature Embedding, and PCA.3637**Output**: Predicted class label (binary or multilabel classification).3839## Scoring recipe4041```python42def compute_metrics(y_true, y_pred):43 tp = sum((t==1) & (p==1) for t, p in zip(y_true, y_pred))44 tn = sum((t==0) & (p==0) for t, p in zip(y_true, y_pred))45 fp = sum((t==0) & (p==1) for t, p in zip(y_true, y_pred))46 fn = sum((t==1) & (p==0) for t, p in zip(y_true, y_pred))47 acc = (tp + tn) / (tp + fp + fn + tn)48 prec = tp / (tp + fp) if (tp + fp) > 0 else 049 rec = tp / (tp + fn) if (tp + fn) > 0 else 050 f1 = 2 * (prec * rec) / (prec + rec) if (prec + rec) > 0 else 051 return acc, prec, rec, f152```5354## Common pitfalls5556- Data imbalance is handled via Random Oversampling on the training folds, so test metrics must be computed on the original, unbalanced test split to reflect real-world performance.57- The protocol evaluates both binary and multilabel classification; metric aggregation (e.g., macro vs micro averaging) is not explicitly specified and may vary across implementations.58- 10-fold cross-validation is used with a 90/10 train/test split per fold, meaning reported scores are averages across 10 runs rather than a single holdout evaluation.5960## Evidence (verbatim from paper)6162> Several measures, such as accuracy, precision, recall, F1-score, ROC curve, and confusion matrix, are used to evaluate the performance of our proposed model. ... Accuracy is a fundamental performance metric, representing the proportion of correctly predicted observations to the total observations. It is calculated as follows: $$ Accuracy = rac {T P + T N}{T P + F P + F N + T N} $$6364## Citation6566```bibtex67@misc{talukder2024network,68 title={Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction},69 author={Talukder et al. (2024)},70 year={2024},71 note={arXiv:2401.12262}72}73```7475- arXiv: 2401.12262