Abstract
We motivate our research with a real-world problem of classifying malicious web domains using a remote service that provides various information. Crucially, some of the information can be further analyzed into a certain depth and this process sequentially creates a tree of hierarchically structured multiple-instance data. Each request sent to the remote service is associated with a cost (e.g., time or another cost per request) and the objective is to maximize the accuracy, constrained with a budget. We present a generic framework able to work with a class of similar problems. Our method is based on Classification with Costly Features (CwCF), Hierarchical Multiple-Instance Learning (HMIL) and hierarchical decomposition of the action space. It works with samples described as partially-observed trees of features of various types (similar to a JSON/XML file), which allows to model data with complex structure. The process is modeled as a Markov Decision Process (MDP), where a state represents acquired features, and actions select yet unknown ones. The policy is trained with deep reinforcement learning and we demonstrate our method with both real-world and synthetic data.
Introduction: The Challenge of Hierarchical Data
In many high-stakes domains, such as cybersecurity and medical diagnostics, data acquisition is not free. Whether querying a paid security API or performing an expensive laboratory test, every feature comes with a cost. This challenge is formalized as Classification with Costly Features (CwCF).
Traditional CwCF approaches typically assume data is a flat, fixed-length vector. However, modern data—such as user profiles on social networks or domain metadata—is often nested and hierarchical. Forcing this rich structure into a flat vector leads to significant information loss or inefficient, sparse representations. This research introduces a framework that natively handles hierarchical, tree-structured data, allowing models to intelligently "buy" only the most relevant information.
Methodology: HMIL-CwCF
The proposed HMIL-CwCF framework extends the CwCF paradigm to hierarchical data through three core components:
- Hierarchical Multiple-Instance Learning (HMIL): Utilizing an extension of "Deep Sets," the model creates mathematical embeddings of variable-sized lists and nested objects. It recursively summarizes information from the leaves of the data tree up to the root.
- Reinforcement Learning (A2C): The classification process is modeled as a Markov Decision Process (MDP). An agent, trained using the Advantage Actor-Critic (A2C) algorithm, observes the currently known features and decides whether to acquire a new feature (at a cost) or terminate the search and classify the sample.
- Hierarchical Softmax for Action Selection: Because the data is structured as a tree, the available actions (which feature to acquire next) are also hierarchical. A hierarchical softmax decomposes the policy, enabling the agent to learn which specific branches of the data tree are most informative.
By decoupling the classifier from the policy—separating the "what is this?" from the "what should I buy next?"—the framework achieves faster convergence and more stable learning.
Experimental Evaluation
The researchers evaluated the method across seven diverse datasets, including real-world security data (Threatcrowd), medical data (Hepatitis), and large-scale user behavior data (Stats and SAP). To facilitate future research, these datasets were released in a unified hierarchical format.
Key Results
- Efficiency and Cost Savings: In the Threatcrowd security experiment, the model achieved the same accuracy as a "full-knowledge" model while making only two API requests on average, compared to the 15 requests required to access the full dataset—a 7.5x reduction in cost.
- Pareto Optimality: Across nearly all benchmarks, the HMIL-CwCF method consistently remained on the Pareto front, providing the highest accuracy for any given budget compared to random selection or flattened baseline models.
- Resistance to Overfitting: In the SAP dataset, the CwCF model actually outperformed the full-knowledge model. By assigning a cost to features, the agent learned to ignore noisy, irrelevant data that typically leads to overfitting in standard classifiers.
Discussion and Explainability
A significant advantage of this sequential acquisition approach is its inherent explainability. By observing the agent's "train of thought," researchers can see which features are prioritized. For instance, in malicious domain detection, the model often checks for known malware hashes first before proceeding to more expensive reverse DNS lookups only if necessary.
Despite its success, the authors note that deep reinforcement learning remains sample-intensive, with complex datasets requiring significant training time. Additionally, the current framework is optimized for strict hierarchies (trees) rather than general graphs with cycles.
Conclusion
The HMIL-CwCF framework represents a significant step forward in cost-sensitive classification for complex data. By combining the representational power of Hierarchical Deep Sets with the strategic decision-making of Reinforcement Learning, the model achieves high accuracy with minimal data acquisition costs, offering a robust solution for real-world applications where information is both structured and expensive.
Summary updated