[Paper Review] Knowledge Enhanced Machine Learning Pipeline against Diverse Adversarial Attacks
This paper proposes Knowledge Enhanced Machine Learning Pipeline (KEMLP), a framework that improves model robustness against diverse adversarial attacks by integrating domain knowledge—specifically, logical rules linking predictions from auxiliary models to the main DNN—into a probabilistic graphical model. KEMLP achieves significantly higher robust accuracy than state-of-the-art defenses like adversarial training, including +16.72% robust accuracy gain on physical attacks and +10.95% on unforeseen attacks, while maintaining high clean accuracy.
Despite the great successes achieved by deep neural networks (DNNs), recent studies show that they are vulnerable against adversarial examples, which aim to mislead DNNs by adding small adversarial perturbations. Several defenses have been proposed against such attacks, while many of them have been adaptively attacked. In this work, we aim to enhance the ML robustness from a different perspective by leveraging domain knowledge: We propose a Knowledge Enhanced Machine Learning Pipeline (KEMLP) to integrate domain knowledge (i.e., logic relationships among different predictions) into a probabilistic graphical model via first-order logic rules. In particular, we develop KEMLP by integrating a diverse set of weak auxiliary models based on their logical relationships to the main DNN model that performs the target task. Theoretically, we provide convergence results and prove that, under mild conditions, the prediction of KEMLP is more robust than that of the main DNN model. Empirically, we take road sign recognition as an example and leverage the relationships between road signs and their shapes and contents as domain knowledge. We show that compared with adversarial training and other baselines, KEMLP achieves higher robustness against physical attacks, $\mathcal{L}_p$ bounded attacks, unforeseen attacks, and natural corruptions under both whitebox and blackbox settings, while still maintaining high clean accuracy.
Motivation & Objective
- To address the vulnerability of deep neural networks (DNNs) to diverse adversarial attacks, including physical, $ε$-bounded, and unforeseen attacks.
- To investigate whether integrating domain knowledge—specifically, logical relationships between predictions—can enhance robustness without sacrificing clean accuracy.
- To develop a principled framework that systematically combines weak auxiliary models with logical constraints to improve joint inference robustness.
- To theoretically prove conditions under which knowledge integration leads to improved robustness over the main DNN model alone.
- To empirically validate KEMLP’s superiority over state-of-the-art defenses across white-box, black-box, and natural corruption settings.
Proposed method
- KEMLP constructs a factor graph where the main DNN’s output and auxiliary model outputs are modeled as random input variables, and the final prediction is a random output variable.
- Domain knowledge is encoded as first-order logic rules (e.g., 'A stop sign is an octagon'), which are translated into factor functions connecting relevant random variables in the factor graph.
- Statistical inference is performed over the factor graph to compute the marginal probability of the output variable, incorporating logical constraints during prediction.
- The framework supports both permissive rules (B ⇒ A) and preventive rules (A ⇒ B), enabling flexible integration of auxiliary knowledge.
- Robustness is evaluated using weighted robust accuracy, a metric balancing performance on clean and adversarial examples.
- KEMLP is evaluated on road sign recognition using real-world physical attacks, $ε$-bounded perturbations, and natural corruptions under both white-box and black-box settings.

Experimental results
Research questions
- RQ1Under what conditions does integrating domain knowledge via logical rules improve the robustness of machine learning models?
- RQ2Can knowledge integration in KEMLP outperform state-of-the-art defenses like adversarial training across diverse attack types?
- RQ3What is the trade-off between robustness and clean accuracy when integrating auxiliary models with logical constraints?
- RQ4How do different types of logical rules—permissive (B ⇒ A) and preventive (A ⇒ B)—affect the robustness of joint inference in KEMLP?
- RQ5Does KEMLP maintain high clean accuracy while achieving superior robustness against unforeseen and physical attacks?
Key findings
- KEMLP achieved 91.46% weighted robust accuracy on physical attacks, a gain of +16.72% over the main DNN and +10.95% over adversarial training.
- On unforeseen attacks, KEMLP achieved 78.37% robust accuracy, a +9.72% improvement over the main DNN and +6.46% over adversarial training.
- In the black-box setting, KEMLP maintained high clean accuracy (84.95%) while achieving 79.09% robust accuracy on $ε$-bounded attacks, outperforming adversarial training.
- For natural corruptions, KEMLP achieved 84.95% robust accuracy under the standard test set, significantly outperforming the main DNN and adversarial training.
- Theoretical analysis shows that under mild conditions, KEMLP’s prediction is more robust than the main DNN’s, especially when multiple weak auxiliary models are integrated.
- KEMLP’s performance was stable across different attack types, including 5x5 and 7x7 physical attacks, with minimal drop in clean accuracy (e.g., -0.02% on DOA 5x5), demonstrating strong generalization.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.