Abstract
The use of symbolic knowledge representation and reasoning as a way to resolve the lack of transparency of machine learning classifiers is a research area that lately attracts many researchers. In this work, we use knowledge graphs as the underlying framework providing the terminology for representing explanations for the operation of a machine learning classifier. In particular, given a description of the application domain of the classifier in the form of a knowledge graph, we introduce a novel method for extracting and representing black-box explanations of its operation, in the form of first-order logic rules expressed in the terminology of the knowledge graph.
Introduction
Deep learning models are often described as "black boxes"—they are incredibly accurate but notoriously tight-lipped about why they make specific decisions. While methods exist to highlight which pixels in an image triggered a classification (sub-symbolic explanations), these are often unintuitive for humans. This research proposes a bridge between raw data and human logic by leveraging Knowledge Graphs (KGs) to extract clear, symbolic "if-then" rules that explain classifier operations.
Methodology
The researchers treat the problem of explaining a black-box model as a "semantic query reverse engineering" task. By mapping raw data to a Knowledge Graph, they automatically generate first-order logic rules (e.g., "If an image contains a large cylinder and a gray cube, then it is Class X") that provide formal guarantees and human-readable insights.
The framework uses Description Logics (DL) and Horn rules to generate global, post-hoc explanations through three main steps:
- Explanation Dataset Construction: Mapping classifier exemplars to semantic descriptions within a Knowledge Graph.
- Classifier Observation: Recording how the black-box model labels these exemplars.
- Logic Reverse Engineering: Utilizing a novel
QuerySpaceDAGalgorithm to find the most specific logical queries describing common characteristics of items in a specific class.
Experimental Setup
The method, dubbed KGrules, was evaluated across three distinct data types:
- Mushroom Dataset: A standard tabular dataset for benchmarking against state-of-the-art rule-based explainers.
- CLEVR-Hans3: A synthetic image dataset with intentional biases (e.g., Class 1 always containing a large gray cube) to test if the explainer can detect confounded factors.
- Visual Genome (VGD): A real-world image dataset with rich annotations and a complex hierarchy, representing a more expressive knowledge environment.
Key Results and Discussion
KGrules demonstrated significant advantages in both fidelity and interpretability. On the CLEVR-Hans3 dataset, it achieved 85.07% fidelity using only 4 rules, whereas the competing RuleMatrix required 42 rules to reach only 58.09% fidelity.
A key insight was the discovery of hidden biases. In the Visual Genome dataset, the system revealed that a Wide ResNet (WRN) classifier tended to classify any image containing a "surfboard" as an "Aquatic Animal." This demonstrates the tool's utility for model debugging. Furthermore, the researchers found that choosing exemplars near the "semantic border"—items from different classes sharing similar descriptions—significantly improved rule accuracy.
Conclusion
While KGrules shows great promise, computational complexity remains a challenge when scaling to high-depth knowledge bases. The quality of explanations is also intrinsically linked to the quality of the underlying Knowledge Graph. Future work will focus on human usability studies and the exploration of counterfactual explanations to further enhance model transparency.
Summary updated