Overview
This research, presented as a Master’s thesis by Šimon Mandlík, introduces HMill (Hierarchical multi-instance learning library). HMill is a unified framework designed to bridge the gap between the complex, structured reality of real-world data and the rigid, vector-based requirements of standard machine learning algorithms. By treating data as hierarchical trees, HMill allows models to process formats like JSON and large-scale graphs without the need for manual feature engineering.
The Problem: Flat Models in a Structured World
Most traditional machine learning models are "flat-earthers"—they require input data to be formatted as a fixed-size vector of numbers. However, real-world data is rarely so simple. It is typically:
- Hierarchical: For example, a JSON file where fields contain lists of objects, which in turn contain nested data.
- Relational: In network security, a domain is defined by its relationships—the clients visiting it and the IP addresses it resolves to.
- Incomplete: Data fragments are often missing due to privacy constraints or technical failures.
Traditionally, engineers solve this by "flattening" data through manual feature engineering—calculating averages or counts to force data into a vector. This process is time-consuming, loses structural information, and often fails when the underlying data distribution shifts (concept drift). HMill seeks to let models learn directly from raw, structured data.
The HMill Framework
The core of the HMill framework is the definition of data and models as matching tree structures. It utilizes three fundamental building blocks:
- Array Nodes: The leaves of the tree, representing raw values (numbers, strings, or categorical data) mapped into Euclidean space.
- Bag Nodes: These handle sets of variable size using Multi-Instance Learning (MIL). They employ permutation-invariant aggregation functions (such as mean, max, or $p$-norm) to summarize a "bag" of instances into a single representative vector.
- Product Nodes: These join heterogeneous data sources. For instance, if an object has both a "name" (string) and a "list of ports" (bag), the Product node concatenates their processed representations.
Unrolling Graph Inference
A significant contribution of this work is showing that graph inference (similar to message-passing in Graph Neural Networks) can be "unrolled" into HMill trees. By treating a node’s neighborhood as a "bag," the model can iteratively aggregate information from neighbors. The entire structure is end-to-end differentiable, allowing the model to learn the optimal way to aggregate information at every level of the hierarchy.
Theoretical Grounding and Missing Data
Mandlík provides a rigorous mathematical justification for this architecture by extending the Universal Approximation Theorem. He proves that HMill models can, in theory, approximate any continuous function defined over these hierarchical spaces.
Furthermore, HMill addresses missing data through learned "default vectors" ($\psi$). Instead of simple imputation (like filling with zeros), the model learns the most statistically likely representation for an absent data branch, improving robustness.
Experimental Evaluation
The framework was validated on three critical cybersecurity challenges:
- IoT Device Identification: Using JSON documents describing network behavior, HMill achieved 96.9% accuracy, outperforming a production system of over a thousand expert rules and a specialized SVM.
- Behavior-based Malware Classification: On a massive dataset of "Identity Protection" (IDP) graphs representing process-file interactions, adding neighborhood information via HMill improved the AUROC from 0.8768 to 0.9855.
- Domain Blacklist Extension: By integrating eleven different relational data sources (e.g., domain-client, domain-binary) through Product nodes, the model improved Precision-Recall performance (AUPRC) by 3x compared to single-source models.
Conclusion and Future Work
HMill demonstrates that structure itself is a powerful feature. While highly flexible, the author notes that computational complexity can scale with tree depth. Future work involves implementing attention mechanisms to allow models to focus on specific instances within a bag and developing formal frameworks for extracting human-readable explanations from the hierarchical trees.
Summary updated