Semantic Queries Explaining Opaque Machine Learning Classifiers

Jason Liartis, Edmund Dervakos, Orfeas Menis-Mastromichalakis, Alexandros Chortaras, Giorgos StamouDAO-XAI 2021

Abstract

Deep Neural Networks (DNNs) are increasingly deployed in high-stakes domains despite their inherent opacity. This research introduces a novel framework that bridges sub-symbolic machine learning with symbolic AI to generate global, rule-based explanations. By treating explainability as a Query Reverse Engineering (QRE) problem over Knowledge Graphs, the authors propose the EXPLAIN and MINIMIZE algorithms to derive human-readable semantic queries. The approach is validated on the CLEVR-Hans3 dataset, successfully identifying hidden biases in a ResNet34 classifier and demonstrating the utility of symbolic rules in auditing black-box models.

Introduction

While Deep Neural Networks achieve state-of-the-art performance across various domains, they function as "black boxes," making their decision-making processes difficult to audit. In critical fields like healthcare and finance, this lack of transparency raises significant ethical and legal concerns. Existing eXplainable AI (XAI) techniques often focus on local explanations—identifying features relevant to a single prediction. However, there is a pressing need for global explanations that describe a model's overall logic. This paper addresses this gap by translating opaque decision boundaries into transparent, logical rules using Knowledge Graphs and Description Logics.

Methodology: Query Reverse Engineering

The authors frame the extraction of global explanations as a Query Reverse Engineering (QRE) problem. The objective is to identify a conjunctive query within a Knowledge Graph that aligns with the set of instances predicted as positive by a black-box classifier.

The EXPLAIN and MINIMIZE Algorithms

The core of the framework is the EXPLAIN algorithm. It generates candidate explanations by grouping individuals based on their Most Specific Queries (MSQs). These queries are iteratively merged using the Least Common Subsumer (LCS) operation, computed via a Kronecker product of graphs.

To ensure the resulting logical statements remain human-readable, the authors developed the MINIMIZE algorithm. This heuristic approach condenses complex queries by removing redundant variables and conjuncts, addressing the inherent complexity of the minimization problem (which is coNP-complete).

Explanation Types and Metrics

The framework distinguishes between two types of approximate explanations:

  • Under-explanations: High-precision rules that capture a "pure" subset of the model's positive predictions.
  • Over-explanations: High-recall rules that encompass all positive predictions, potentially including some noise.

Alignment is measured using adapted versions of Precision, Recall, and the Jaccard similarity (referred to as Degree).

Experimental Evaluation

The framework was tested using a semantically enriched version of the CLEVR-Hans3 dataset. This dataset consists of 3D-rendered shapes designed to test bias detection. For instance, Class 1 is defined by the presence of a "Large Cube" and a "Large Cylinder," but the training data is confounded by the color "Gray."

The authors converted the dataset's JSON metadata into a Description Logic Knowledge Base, mapping objects, colors, shapes, and materials to semantic concepts. A ResNet34 CNN was then trained on the images, achieving varying F1-scores (0.27, 0.54, and 0.92) across the three classes due to the injected biases.

Key Insights: Exposing Model Bias

The semantic queries generated by the framework provided immediate insight into the model's "cheating" behavior. For Class 1, the best under-explanation (Precision = 1.00) was: “Image contains a Large Gray Cube, a Large Cylinder, and a Large Metal Object.”

By manually removing the "Gray" attribute from this query and observing the change in metrics, the authors found that the number of false positives captured by the query skyrocketed from 0 to 547. This quantitative shift proved that the CNN was relying almost entirely on the confounding color factor rather than the intended geometric rules. This demonstrates how symbolic rules can act as a powerful diagnostic tool for sub-symbolic models.

Conclusion and Future Work

This research demonstrates that bridging neural networks with symbolic reasoning can produce interpretable global explanations. While the framework successfully identifies model biases, it currently relies on the availability of semantically rich Knowledge Graphs. Future work will focus on developing metrics for human-readability and applying the framework to specialized domains like medical imaging, where explainability is a prerequisite for deployment.

Summary updated

BibTeX
@inproceedings{liartis2021semantic,
  author = {Jason Liartis and Edmund Dervakos and Orfeas Menis-Mastromichalakis and Alexandros Chortaras and Giorgos Stamou},
  title = {{Semantic Queries Explaining Opaque Machine Learning Classifiers}},
  booktitle = {DAO-XAI},
  year = {2021},
  url = {https://openreview.net/forum?id=diyUyRGJDSt},
}
Figure