NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Factor Graph-based Interpretable Neural Networks

Yicong Li, Kuanjiu Zhou, Shuo Yu, Qiang Zhang, Renqiang Luo, Xiaodong Li, Feng Xia

Abstract

Interpretable neural networks, such as Concept Bottleneck Models (CBMs), aim to provide transparency by predicting high-level semantic concepts before a final classification. However, these models are fragile; adversarial perturbations can lead to "incomprehensible" explanations that violate basic logic. We introduce AGAIN (fActor GrAph-based Interpretable neural Network), a novel framework that leverages factor graphs to ensure logical consistency. By shifting defense to the inference phase, AGAIN identifies and rectifies nonsensical explanations without requiring retraining for every new type of noise.

Introduction: The Fragility of Interpretability

Concept Bottleneck Models (CBMs) are designed to be "glass-box" models. For example, to classify a "Bird," the model first identifies concepts like "wings" and "beak." While effective, these models are susceptible to tiny, often invisible input perturbations. These attacks can trick the model into generating explanations that are logically impossible—such as predicting a "Dog" while explaining it with the presence of "Wings" and "Plume."

The problem of illogical explanations in interpretable models where a correct prediction is undermined by a nonsensical explanation.

Standard defenses rely on adversarial training, which acts like a "vaccine" effective only against known "strains" of noise. AGAIN proposes a "sanity check" approach that works regardless of the specific attack by enforcing real-world logical rules during the model's decision-making process.

The AGAIN Framework

The AGAIN framework moves the defense from training to the inference phase, employing three core modules to maintain logical integrity.

The AGAIN framework pipeline: (a) Factor graph construction, (b) Explanatory logic error identification, and (c) Explanation rectification.

1. Factor Graph Construction

Real-world knowledge is encoded into a factor graph where variables represent concepts and categories. "Factors" represent logical constraints, such as coexistence (e.g., "beaks" and "wings" usually appear together) or exclusion (e.g., "dogs" do not have "scales").

2. Explanatory Logic Error Identification

During inference, the model’s initial explanation is mapped onto the factor graph. The graph calculates the likelihood of this explanation based on the encoded rules. If the explanation violates these rules, it is flagged as "incomprehensible."

3. Interactive Intervention (Rectification)

When an error is detected, AGAIN uses a greedy strategy to identify and "flip" the concept activations that are most likely incorrect. This rectification process maximizes logical coherence before the final category prediction is made. Unlike standard CBMs, AGAIN treats logic as exogenous knowledge—external constraints that provide a layer of "common sense."

Experimental Evaluation

The model was evaluated on three diverse datasets: the CUB bird classification benchmark, the MIMIC-III EWS clinical dataset, and a Synthetic-MNIST dataset for testing synthesized logical rules.

Key Results

  • Logical Satisfaction: On the CUB dataset under heavy unknown perturbations, AGAIN maintained a Logical Satisfaction Metric (LSM) of ~92%, significantly outperforming baselines like CBM-AT, which dropped below 48%.
  • Explanatory Accuracy: AGAIN achieved ~93.9% accuracy in identifying correct concepts under attack, compared to ~80.4% for standard adversarial training.
  • Efficiency: The rectification process occurs in milliseconds, ensuring the system is viable for real-time deployment.

Discussion and Future Work

While AGAIN significantly improves robustness, it currently assumes the predicted category is largely correct. If a perturbation is severe enough to cause a total misclassification (e.g., a "Bird" seen as a "Car"), the factor graph will rectify the explanation to match the wrong category. Furthermore, constructing the factor graph currently requires manual domain expertise. Future research will explore automatically learning these logical rules from data to reduce the need for manual knowledge engineering.

Summary updated

BibTeX
@inproceedings{li2025factor,
  author = {Yicong Li and Kuanjiu Zhou and Shuo Yu and Qiang Zhang and Renqiang Luo and Xiaodong Li and Feng Xia},
  title = {{Factor Graph-based Interpretable Neural Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=10DtLPsdro},
}
Figure