A unified, machine learning-based IDS/IPS framework for ROS2-based UGV platforms. A critical contribution is a rigorous empirical evaluation of four ML approaches — Logistic Regression, Isolation Forest (broken baseline), Isolation Forest (corrected), and Random Forest — applied to two primary cyber-physical datasets (ROSpace, TON_IoT Modbus) with extended validation across four additional CIC-IDS2017 and UNSW-NB15 datasets, including a class imbalance case study. Random Forest achieves 91.7% accuracy on TON_IoT and 100% on ROSpace; unsupervised approaches reach only 50–72%.
| Approach | Algorithm | Mode | TON_IoT Acc. | TON_IoT F1 | ROSpace Acc. | ROSpace F1 | Status |
|---|---|---|---|---|---|---|---|
| Approach 1 | Logistic Regression | Supervised | ~52% | ~52% | ~81% | ~49% | Failed — linear boundary |
| Approach 2 | Isolation Forest (bugs) | Unsupervised | 4.5% | 8.6% | 49.7% | 66.4% | Invalid — 3 bugs (TN=0) |
| Approach 3 | Isolation Forest (fixed) | Unsupervised | 50.0% | 51.1% | 72.7% | 29.2% | Unsupervised ceiling |
| Approach 4 | Random Forest ✓ | Supervised | 91.7% | 91.9% | 100.0% | 99.9% | PRODUCTION |
| Metric | Value | Note |
|---|---|---|
| Accuracy | 100.0% | Near-perfect |
| Precision | 100.0% | Zero false alarms |
| Recall | 99.8% | 1,725 / 1,729 caught |
| F1 Score | 99.9% | Excellent |
| AUC-ROC | 1.000 | Perfect discrimination |
| Metric | Value | Note |
|---|---|---|
| Accuracy | 91.7% | 9,332 test rows |
| Precision | 92.9% | Strong |
| Recall | 91.0% | 4,395 / 4,832 caught |
| F1 Score | 91.9% | Balanced |
| AUC-ROC | 0.974 | Genuine data challenge |
| Metric | Value | Interpretation |
|---|---|---|
| Accuracy | 100.0% | Misleading |
| Precision | 100.0% | Correct — no false alarms |
| Recall | 27.3% | Only 3 of 11 attacks caught |
| F1 Score | 42.9% | True measure of imbalance |
| TP / TN / FP / FN | 3 / 86,570 / 0 / 8 | Full matrix counts |
| Dataset | Attack Rate | Attacks in Test Set | RF Recall | RF F1 | Detection Feasibility |
|---|---|---|---|---|---|
| ROSpace UGV | 19.2% | 1,729 | 99.8% | 99.9% | Excellent |
| TON_IoT Modbus | 51.8% | 4,832 | 91.0% | 91.9% | Strong |
| UNSW-NB15 | 20.2% | 26,668 | 98.6% | 98.5% | Excellent |
| CIC-IDS2017 DDoS | 56.7% | 38,407 | 100% | 100% | Excellent |
| CIC-IDS2017 PortScan | 55.5% | 47,679 | 100% | 100% | Excellent |
| CIC-IDS2017 Infiltration | 0.013% | 11 | 27.3% | 42.9% | Limited — class imbalance |
| Limitation | Category | Impact |
|---|---|---|
| Limited Modbus features | Data/ML | 91.7% accuracy ceiling on TON_IoT |
| Simulated physical sensors | Hardware | Not validated on real hardware |
| Single attack type (ROSpace) | Data | May not generalize to diverse ROS2 attacks |
| Labels required for RF | ML | Cannot operate without training labels |
| No real robot deployment | System | Simulation only — RPi4 deployment pending |