Explaining Classifiers Trained on Raw Hierarchical Multiple-Instance Data

Tomás Pevný, Viliam Lisý, Branislav Bosanský, Petr Somol, Michal PechoucekarXiv 2022 · DOI

Introduction

Modern machine learning has achieved remarkable success in processing unstructured data like images and text. However, many critical real-world domains—including cybersecurity, medical diagnostics, and e-commerce—rely on structured, heterogeneous, and variable-sized data formats such as JSON or XML. Hierarchical Multiple-Instance Learning (HMIL) has emerged as a powerful paradigm for training models directly on these formats, bypassing the need for manual feature engineering.

Despite their effectiveness, HMIL models remain "black boxes." For instance, if a classifier flags a 100MB JSON log as malware, a security analyst must understand which specific key-value pairs triggered that decision. Existing explanation methods, such as those designed for Graph Neural Networks (GNNs), often struggle with the scale and tree-like structure of HMIL data, leading to computational inefficiency and "noisy" explanations that contain irrelevant information.

Methodology: Sub-tree Selection

This research proposes a framework that treats model explanation as a minimal subset selection problem. The goal is to identify the smallest possible sub-tree of the original input that maintains the model's original classification. The authors break this process into two distinct phases: ranking and selection.

1. Sub-tree Ranking

To guide the search, the framework first identifies which parts of the tree are likely to be important. The authors evaluated three primary heuristics:

  • Model Gradients: Measuring the magnitude of the gradient with respect to node embeddings.
  • GNN Explainer Masks: Utilizing learned masks to weight edges.
  • Banzhaf Values: Derived from cooperative game theory, these values measure a node's average contribution to the model's output across various subsets of nodes.

Empirical results indicated that while gradients are computationally inexpensive, Banzhaf values provided the most effective guidance for finding truly minimal explanations.

The core innovation of this work is the Level-by-level search strategy. Traditional "flat" searches treat every node in a massive file as an individual candidate, which is computationally prohibitive for large trees. By contrast, the level-by-level approach optimizes one level of the tree at a time. If a high-level branch is pruned, all its descendants are discarded instantly, resulting in massive computational savings. To further refine the results, the authors employ Random Removal (RR) and Fine-tuning (FT) to eliminate any "excess leaves" that might have been included during the initial greedy search phase.

Experimental Evaluation

The framework was tested on both synthetic benchmarks and high-stakes real-world data:

  • Synthetic Benchmarks: Using datasets like deviceid (network scans) and mutagenesis (chemical compounds), the authors established "ground truth" concepts to measure the explainer's precision. The proposed method consistently identified these concepts with near-zero noise.
  • Real-world Stress Test: The authors applied the explainer to Cuckoo Sandbox malware reports. These files can reach up to a gigabyte in size and contain millions of nodes, representing a significant challenge for standard explainability tools.

Key Results and Insights

  • Efficiency and Scalability: The combination of Level-by-level search and Banzhaf values was over 10x faster than the GNN Explainer on large-scale samples.
  • Precision and Minimality: In the Cuckoo Sandbox experiments, the GNN Explainer produced explanations averaging 70.24 leaves, whereas the proposed method achieved the same classification consistency with just 1.33 leaves. This adherence to the "Smoking Gun" principle ensures that analysts are not overwhelmed by irrelevant data.
  • Model Debugging: The explainer revealed a critical flaw in a malware classifier: the model had learned to identify malware based on the timestamp of the report rather than the file's actual behavior. This insight allowed researchers to identify and correct a significant dataset bias.

Conclusion and Future Work

By exploiting the natural hierarchy of structured data, this framework provides a scalable and faithful method for explaining HMIL models. While the current approach focuses on finding a single minimal explanation, future research may explore identifying multiple redundant explanations (counterfactuals) and addressing non-monotonic model behaviors where adding data might unexpectedly decrease classification confidence. Nevertheless, this work represents a significant step toward making complex classifiers actionable for human experts in data-intensive fields.

Summary updated

BibTeX
@misc{pevny2022explaining,
  author = {Tomás Pevný and Viliam Lisý and Branislav Bosanský and Petr Somol and Michal Pechoucek},
  title = {{Explaining Classifiers Trained on Raw Hierarchical Multiple-Instance Data}},
  year = {2022},
  eprint = {2208.02694},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.02694},
}
Figure