LOGICDEF: An Interpretable Defense Framework against Adversarial Examples via Inductive Scene Graph Reasoning

Yuan Yang, James Clayton Kerce, Faramarz Fekri

Abstract

LOGICDEF is a novel defense framework designed to protect image classifiers from adversarial attacks by validating predictions against their environmental context. By extracting a scene graph and applying inductive logic reasoning, the system detects and corrects misclassifications—such as a train being misidentified as a "cat"—by recognizing that certain attributes, like running on tracks, are inconsistent with the predicted class. This approach provides a human-interpretable layer of defense that leverages common-sense reasoning.

Introduction

Deep learning models are notoriously fragile. A strategically placed "adversarial patch" can trick a state-of-the-art classifier into misidentifying objects, such as seeing a toaster as a banana or a train as a cat. Existing defenses typically fall into two categories: Adversarial Training, which is often limited to known attack types, and Certified Defenses, which are mathematically rigorous but computationally expensive for real-world applications.

Crucially, most current defenses operate as "black boxes," offering no explanation for why a sample is flagged as adversarial. In contrast, humans use context and common sense to identify errors; we know a cat should not be equipped with doors and windows while running on railroad tracks. LOGICDEF introduces this human-like, interpretable reasoning to machine learning defense.

Methodology

LOGICDEF treats an image as a structured Scene Graph—a network of objects (nodes) and their relationships (edges)—rather than a simple grid of pixels. The framework is built upon three main pillars:

  1. Rule Mining with Inductive Logic Programming (ILP): The system automatically learns "common sense" rules from data, such as: If an object has a door and is on tracks, it is likely a train.
  2. External Knowledge Integration: LOGICDEF can import relational knowledge from ConceptNet, a massive database of human common sense. This enables "zero-shot" defense, allowing the model to protect classes it was not specifically trained to defend.
  3. Posterior Regularization (PR): This mechanism balances the raw output of the visual classifier with logical constraints. If the visual classifier predicts a "cat" with high confidence but logic rules indicate a "train" is more consistent with the context, the PR mechanism shifts the final prediction toward the logically sound class.
Overview of the LOGICDEF defense mechanism. An adversarial patch tricks the classifier into seeing a "cat," but scene graph reasoning identifies the object as a "train" based on its context (doors, windows, and tracks).

Additionally, the authors employ Curriculum Learning based on object taxonomies to improve the efficiency of the rule-learning process.

Experimental Evaluation

The researchers evaluated LOGICDEF using the Visual Genome (VG) dataset, which contains over 100,000 images with detailed scene graph annotations, and ConceptNet for external common-sense triples.

Key Results

  • High Robustness: Under adversarial patch attacks on the Visual Genome dataset, the hybrid version (LOGICDEF-HYB) achieved 97% of the accuracy of an unattacked model.
  • Superiority over Standard Defenses: LOGICDEF significantly outperformed standard Adversarial Training, which recovered only about 42% of clean accuracy in similar scenarios.
  • Resilience to Noise: The framework maintained over 90% of its defensive performance even when scene graphs were generated by imperfect automated tools (e.g., GRCNN) rather than ground-truth labels.
  • Zero-Shot Capability: Using only ConceptNet rules without specific attack training, the model reached 86% of the performance of a fully trained model.

Discussion and Future Work

LOGICDEF demonstrates that context can serve as a shield. While adversarial patches target specific object pixels, the surrounding context often remains intact, providing a path to recovery. Furthermore, because the defense relies on First-Order Logic, it is inherently interpretable, allowing security analysts to inspect the specific rules triggered during a decision.

However, the framework's effectiveness is dependent on the quality of the extracted scene graph. If an attacker successfully fools both the object detector and the relationship extractor, the defense may be bypassed. Additionally, real-world scene graphs are often sparse, potentially missing key relationships required for specific rules to fire. Future work will focus on defending against global scene manipulations and optimizing scene graph generation for real-time applications like autonomous driving.

Summary updated

BibTeX
@inproceedings{yang2022logicdef,
  author = {Yuan Yang and James Clayton Kerce and Faramarz Fekri},
  title = {{LOGICDEF: An Interpretable Defense Framework against Adversarial Examples via Inductive Scene Graph Reasoning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i8.20865},
}
Figure