TL;DR
Machine learning models for network security often fail when deployed in new environments due to poor generalizability, largely stemming from inadequate training data. This paper introduces netUnicorn, a novel closed-loop ML pipeline and data-collection platform that iteratively gathers realistic network data guided by explainable AI (XAI) insights, significantly improving model generalizability.
What Problem Does This Paper Address?
The effectiveness of machine learning (ML) models in network security is severely hampered by their inability to generalize across different network environments. Models trained on data from one network often perform poorly when deployed elsewhere because network behaviors, attack patterns, and even benign traffic can vary significantly. This "generalizability problem" is a major roadblock to adopting ML in real-world security systems. Existing approaches to improve generalizability, like data augmentation, often create unrealistic datasets for network security, while manual data collection is fragmented and inefficient. The authors aim to solve this by creating a systematic, iterative process for collecting high-quality, realistic network data that directly addresses model weaknesses.
Methods
The core contribution is a closed-loop ML pipeline that augments the standard ML workflow with an explainability step. This pipeline works as follows:
- Train an ML model on collected data.
- Use Explainable AI (XAI) tools (like Trustee, LIME, SHAP) to identify "shortcuts" or inductive biases in the model's decision-making. These shortcuts are often learned from unrealistic patterns in the training data.
- Synthesize new data collection policies based on XAI insights to specifically target and remove these identified biases.
- Collect new, more realistic data using the
netUnicornplatform, guided by these policies. - Repeat the process until the model demonstrates sufficient generalizability.
netUnicorn is a novel data-collection platform designed to facilitate this iterative process. It adopts an "hourglass" model, with learning problems at the top and network environments at the bottom, and netUnicorn as the "thin waist." It achieves this by:
- Decoupling data-collection intents (what to collect) from mechanisms (how to collect it).
- Disaggregating intents into reusable tasks and pipelines.
- Providing a unified API for diverse network infrastructures and node types.
Datasets
The paper uses several datasets and scenarios for evaluation:
- CIC-IDS-2017 dataset: Used for initial experiments on Heartbleed detection.
- nPrint dataset: Used for OS Fingerprinting experiments.
- Custom datasets: Generated using
netUnicornacross three distinct network environments: - UCSB network: Emulated using the PINOT infrastructure.
- UCSB-cloud: A hybrid of UCSB and cloud providers (AWS, Azure, Digital Ocean).
- Multi-cloud environment: Emulating across multiple cloud providers and regions.
These datasets are collected "in vivo" (within the network environment) and are iteratively refined based on XAI feedback, differing from static, exogenous datasets.
Key Insights and Ideas
- XAI is crucial for data curation: Simply collecting more data (naive augmentation) isn't enough. XAI provides the necessary insights to understand why a model fails and what kind of data is needed to fix it.
- "Shortcuts" are a major generalizability killer: ML models in network security often learn spurious correlations (e.g., relying on a single feature like TTL) that don't hold up in new environments.
netUnicorn's iterative approach directly targets and removes these. - Realistic data collection is paramount: The "in vivo" data collection approach of
netUnicornensures that the training data reflects actual network conditions, leading to models that are more likely to generalize. - A unified platform simplifies complex experiments:
netUnicornabstracts away the complexities of managing diverse network infrastructures and tasks, making iterative data collection feasible for researchers.
Key Results
- Improved Generalizability: Models trained using the
netUnicornpipeline consistently showed significantly better F1 scores on unseen (multi-cloud) test sets compared to models trained with data augmented using exogenous methods (Naive Aug., Noise Aug., Feature Drop, SYMPROD). For instance, in Iteration #2, thenetUnicornapproach achieved F1 scores around 0.93-0.96, while exogenous methods struggled to break 0.75. - Shortcut Removal: The paper demonstrates the successful identification and removal of specific shortcuts (e.g., reliance on TTL, "Bwd Init Win Bytes") through iterative data collection guided by Trustee's decision trees. Figure 4 visually shows the shift from obvious shortcuts to no obvious shortcuts across iterations.
- Out-of-Distribution (OOD) Resilience: The approach showed effectiveness in combating OOD issues, such as attack adaptation (changing attack tools) and environment adaptation (testing in a different cloud environment). Retraining with
netUnicornafter an attack tool change improved performance from an average of 0.85 to 0.93. - Reduced Effort:
netUnicornsignificantly reduces the effort (measured in Lines of Code - LLoC) required to set up complex, iterative data collection experiments compared to traditional deployment systems (Kubernetes, SaltStack, ACI), often by factors of 2-13x. - Scalability and Efficiency: The
netUnicornplatform and its executors are shown to be efficient, with low computing and memory overheads, making them suitable for deployment on low-end devices like Raspberry Pis.
Limitations and Future Work
- Manual Effort: While
netUnicornautomates much of the process, domain experts are still needed to articulate data-collection intents and interpret XAI results. Future work aims to develop quantitative methods to reduce this manual effort. - Active Data Collection: The current approach focuses on endogenously generated (labeled) data. The authors acknowledge that passively collected data could also be valuable but is outside the scope of this paper.
- Feature Pre-processing: The paper uses CICFlowMeter for pre-processing but suggests exploring alternative pre-processing, model selection, and optimization techniques as future work.
- Infrastructure Limitations: The current prototype primarily supports Linux/Windows nodes with Docker. Extending support to other environments like IoT devices or specialized switches is planned.
- Subjectivity and Biases: The reliance on domain experts for XAI interpretation can introduce subjectivity. Future work includes using multiple experts for cross-validation and developing quantitative metrics for explanation fidelity.
- Complexity of Decomposition: Decomposing complex learning problems into self-contained tasks might be cumbersome for highly integrated systems.
Summary updated