Rule Extraction From Binary Neural Networks With Convolutional Rules for Model Validation

Sophie Burkhardt, Jannis Brugger, Nicolas Wagner, Zahra Ahmadi, Kristian Kersting, Stefan Kramer

Abstract

Deep learning models are notoriously difficult to interpret, especially when applied to image data where individual pixels lack inherent semantic meaning. This paper introduces the Deep Convolutional DNF Learner (DCDL), a method designed to extract human-interpretable, translation-invariant logical rules from Binary Neural Networks (BNNs). By approximating the network's behavior layer-by-layer using first-order convolutional rules, the approach generates visualizable "prototypes" of learned features. Our evaluation across MNIST, Fashion-MNIST, and CIFAR10 demonstrates that DCDL can achieve high fidelity to the original model while providing insights into its internal logic.

1. Introduction

While neural networks have achieved state-of-the-art performance in various domains, their "black-box" nature remains a significant hurdle for deployment in safety-critical applications. Understanding the rationale behind a model's decision is crucial for validation and trust. Traditional rule extraction methods often rely on propositional logic, which is ill-suited for image data. Rules based on absolute pixel positions are brittle and fail to capture the translation invariance inherent in visual patterns. Furthermore, "pedagogical" approaches that treat the entire network as a single black box often fail to capture the complexity of deep architectures. This work addresses these challenges by proposing a decompositional approach that extracts first-order logic rules reflecting the spatial nature of convolutional layers.

2. Methodology: The Deep Convolutional DNF Learner (DCDL)

The DCDL framework integrates several key components to enable effective rule extraction:

2.1 Binary Neural Networks (BNNs)

The method operates on BNNs where inputs, hidden activations, and outputs are strictly binary. To process continuous image data, inputs are binarized using error-diffusion dithering (e.g., Floyd-Steinberg), preserving essential structural information in a format compatible with logical operations.

2.2 Decompositional Rule Extraction

Rather than attempting to map inputs directly to outputs, DCDL employs a decompositional strategy. It approximates each layer of the BNN individually and then chains these approximations together. This ensures that the extracted rules more accurately reflect the internal transformations of the network.

2.3 First-Order Convolutional Rules

The core innovation lies in the use of first-order logic to define rules in Disjunctive Normal Form (k-DNF). These rules function similarly to convolutional filters; they are defined over a small local neighborhood (e.g., 3x3) and "slide" across the input space. This maintains translation invariance and ensures that the complexity of the rules is tied to local features rather than the entire image dimensions.

2.4 Stochastic Local Search (SLS)

To navigate the vast search space of logical formulas, DCDL utilizes an adapted SLS algorithm. SLS iteratively refines k-DNF rules to minimize the discrepancy between the rule's output and the BNN layer's activations, using specialized heuristics to efficiently correct misclassifications.

3. Experimental Setup

The authors evaluated DCDL on three standard image classification benchmarks, treated as one-vs-all binary classification tasks:

  • MNIST: Handwritten digits.
  • Fashion-MNIST: Clothing items.
  • CIFAR10: Natural images.

All datasets were binarized via dithering to ensure compatibility with the BNN and the logical rule extraction process.

4. Results and Discussion

4.1 Fidelity and Accuracy

DCDL demonstrated significantly higher fidelity to the underlying neural network compared to baseline pedagogical approaches. On MNIST and Fashion-MNIST, the accuracy of the extracted rules was comparable to the original BNN, indicating that the logical formulas successfully captured the model's predictive power. However, performance on CIFAR10 was lower, suggesting that the combination of binarization and simple Boolean logic may struggle with the complexity of natural scenes.

4.2 Characteristic vs. Discriminative Rules

A key finding was the trade-off between rule length and interpretability. While short rules (low $k$) are often purely discriminative—focusing on minimal pixel differences—they lack semantic meaning. By increasing the number of terms (e.g., $k=150$), the algorithm learns "characteristic" rules. When visualized, these rules appear as recognizable prototypes (e.g., the outline of a shoe or a digit), providing a clear window into what the model has learned.

5. Conclusion

DCDL represents a significant step toward making deep convolutional models interpretable through symbolic logic. By leveraging the spatial priors of CNNs within a first-order logic framework, it allows for the extraction of rules that are both accurate and visualizable. Future work will explore differentiable versions of this approach to enable end-to-end training of neuro-symbolic systems, potentially overcoming current limitations in handling complex natural datasets.

Summary updated

BibTeX
@article{burkhardt2021rule,
  author = {Sophie Burkhardt and Jannis Brugger and Nicolas Wagner and Zahra Ahmadi and Kristian Kersting and Stefan Kramer},
  title = {{Rule Extraction From Binary Neural Networks With Convolutional Rules for Model Validation}},
  journal = {Frontiers Artif. Intell.},
  year = {2021},
  doi = {10.3389/frai.2021.642263},
}
Figure