Formal Verification of Bayesian Network Classifiers

Andy Shih, Arthur Choi, Adnan DarwichePGM 2018

Introduction

As AI systems are increasingly deployed in high-stakes fields like medicine and law, the "black-box" nature of many models becomes a significant liability. It is no longer sufficient to know what a model predicted; we must understand why and ensure the model adheres to logical constraints. This paper introduces a symbolic approach to formally verify and explain the behavior of Bayesian network classifiers by compiling them into Ordered Decision Diagrams (ODDs).

The Challenge of Black-Box Models

A critical requirement for trustworthy AI is monotonicity. For instance, in a medical diagnostic tool, if a patient exhibits more symptoms of a disease, the probability of a positive diagnosis should not decrease. However, verifying such properties in probabilistic models like Bayesian Networks is computationally intensive. The authors bridge this gap by translating probabilistic reasoning into the realm of formal logic verification.

Methodology: From Probabilities to Logic

The core innovation is a two-step compilation process. First, a Bayesian network classifier and its decision threshold (e.g., "classify as 'Sick' if probability > 0.9") are compiled into an Ordered Decision Diagram (ODD). An ODD serves as a tractable symbolic representation of the model's decision function.

A naive Bayes classifier (a) and its corresponding Ordered Binary Decision Diagram (b).

Once in ODD form, complex verification tasks that were previously difficult become computationally efficient (often linear or polynomial in the size of the ODD):

  • Monotonicity/Unateness: Proving that "better" inputs always lead to equal or better outcomes.
  • Irrelevant Features: Identifying variables that have zero impact on the final decision.
  • Robustness: Calculating the minimum number of feature "flips" required to change a specific classification.
  • If-Then Rules (Implicants): Finding the smallest set of features that guarantee a specific outcome, regardless of all other variables.

Experimental Evaluation

The authors evaluated their approach on several real-world Bayesian networks, including educational assessment tools (adaptive-testing and math-skills) and medical diagnostics (mammography).

Compilation statistics and ODD sizes for various benchmark networks.

The results demonstrate that while ODD compilation is theoretically difficult (NP-hard), it is highly practical for real-world applications. For example, the mammography network compiled in just 7 seconds, resulting in a compact ODD of 156 nodes—significantly smaller than a full decision tree, which would require over 32,000 nodes ($2^{15}$).

Key Insights

  • Debugging Models: In the educational datasets, the authors discovered non-monotone behavior where a correct answer could actually lower a student's predicted proficiency. This highlights the ODD's value as a powerful "debugging" tool for machine learning.
  • Robustness as Explanation: ODDs allow systems to provide deeper transparency, such as informing a user how close they were to a different classification outcome (e.g., "You were only one specific answer away from failing").
  • Minimal Explanations: For the breast cancer model, the authors extracted "prime implicants"—minimal sets of just 7 features (out of 15) sufficient to guarantee a "Malignant" diagnosis, providing clear "rules of thumb" for clinicians.

Conclusion

By treating probabilistic models as discrete symbolic functions once a threshold is set, researchers can leverage the powerful toolkit of formal verification usually reserved for hardware and software. While compilation remains a potential bottleneck for extremely large or highly connected networks, this work provides a scalable path toward more transparent and verifiable AI systems.

Summary updated

BibTeX
@inproceedings{shih2018formal,
  author = {Andy Shih and Arthur Choi and Adnan Darwiche},
  title = {{Formal Verification of Bayesian Network Classifiers}},
  booktitle = {PGM},
  year = {2018},
}
Figure