Discriminative Models for Multi-instance Problems with Tree Structure

Tomás Pevný, Petr Somol

TL;DR

This paper introduces a novel hierarchical multi-instance learning (MIL) approach for detecting infected computers by analyzing their network traffic. By treating network traffic as a tree structure and leveraging high-level labels (infected/clean computer), it significantly reduces the burden of manual labeling and enables the automatic discovery of "indicators of compromise" (IoCs).

What Problem Does This Paper Address?

Modern network security faces a constant barrage of sophisticated malware that evades traditional signature-based detection. Behavioral analysis offers better recall but often suffers from high false positive rates. A major hurdle in applying machine learning to network security is the difficulty and cost of obtaining accurate labels for individual network connections (e.g., HTTP requests). This paper addresses this by shifting the classification focus from individual connections to entire computers, treating the computer's traffic as a "bag" of "instances" (network flows). However, the inherent hierarchical nature of network traffic (flows to servers, servers visited by a computer) is not well-captured by standard MIL approaches.

Methods

The core contribution is a hierarchical multi-instance learning (MIL) framework implemented using a neural network. This approach models network traffic as a tree:

  • Leaf nodes: Individual network flows (instances).
  • Inner nodes: Servers visited by the computer (sub-bags).
  • Root node: The computer itself (the main bag).

The neural network architecture mirrors this hierarchy, consisting of:

  1. Flow Layer: Processes individual network flows.
  2. Server Layer: Aggregates flow information for each server using a pooling function (e.g., mean or max). This layer learns "weak indicators of compromise" related to specific server interactions.
  3. Computer Layer: Aggregates server-level information to classify the entire computer as infected or clean.

This "stacked MIL" approach allows for simultaneous optimization of both the embedding (feature extraction) and the classifier using standard back-propagation. A key advantage is that it only requires high-level labels (infected/clean computer), not labels for individual flows. The authors also propose a method for explaining the model's decisions by identifying which server communications contributed most to the "infected" classification.

Datasets

The experiments were conducted using web proxy logs collected by Cisco's Cognitive Threat Analytics (CTA) system. The data spanned eight days from November 2015 to February 2016, with additional infected computer data from 25 days.

  • Training set: Approximately 20 million unique computers (172,013 infected) and 850 million flows (50 million from infected computers).
  • Testing set: Approximately 3 million computers (3,000 infected) and 120 million flows (500,000 from infected computers).

The labels were derived from Cisco's CTA, considering a computer infected if it had at least one request known to be caused by malware within a five-minute window.

Key Insights and Ideas

  • Hierarchical MIL is powerful for network traffic: The tree-like structure of network communication (flows -> servers -> computer) is naturally suited for a hierarchical MIL approach, leading to better performance than flat MIL.
  • High-level labels are sufficient: The model demonstrates that it's possible to train effective classifiers using only coarse-grained labels (infected/clean computer), drastically reducing the manual labeling effort.
  • Automatic discovery of IoCs: The neural network architecture inherently learns "weak indicators of compromise" in its lower layers, which can be extracted and interpreted by security analysts.
  • Explainability is crucial: The proposed method for identifying contributing server domains provides valuable context for security investigations, making the model less of a "black box."
  • Max pooling can be faster but prone to overfitting: While max pooling offers significant speedups during training, it can lead to overfitting by learning specific patterns rather than general behavioral indicators, especially with limited data or older testing sets.

Key Results

  • The proposed hierarchical MIL model achieved high precision in detecting infected computers.
  • The model successfully learned "weak indicators of compromise" (IoCs) in its lower layers, including patterns like URL tunneling, sinkholed domains, and specific download requests.
  • The explanation mechanism, using a greedy approximation, could identify key domains contributing to an "infected" classification, with examples showing these domains were indeed linked to malware.
  • Computational efficiency: The hierarchical aggregation significantly reduced computational complexity. The proposed approach was approximately 220 times faster than prior MIL neural network methods for training.
  • Performance comparison: Simpler networks with max pooling tended to overfit, while networks with mean pooling (especially with specific cost functions) showed better generalization.

Limitations and Future Work

  • Labeling imperfections: The authors acknowledge that their ground truth labeling is not perfect, with potential for false negatives (infected labeled clean) and false positives (clean labeled infected).
  • Overfitting with max pooling: The tendency of max pooling to overfit on specific patterns was noted, particularly when testing data was older than training data.
  • Feature set limitations: The paper mentions that some infections might not be detectable with the simple 36 features used, suggesting that more sophisticated feature engineering could improve detection for certain types of malware.
  • Future work: The authors suggest that the learned IoCs, while weak individually, could be combined with other sources of information for more robust detection. The explainability feature also opens avenues for more detailed incident investigation.

Summary updated

BibTeX
@inproceedings{pevny2016discriminative,
  author = {Tomás Pevný and Petr Somol},
  title = {{Discriminative Models for Multi-instance Problems with Tree Structure}},
  booktitle = {AISec@CCS},
  year = {2016},
  doi = {10.1145/2996758.2996761},
}
Figure