Visual Explanations from Hadamard Product in Multimodal Deep Networks

Jin-Hwa Kim, Byoung-Tak ZhangarXiv 2017 · arXiv

Introduction

Deep neural networks, particularly in multimodal tasks like Visual Question Answering (VQA), often operate as "black boxes," making it difficult to understand the reasoning behind their outputs. While explicit attention mechanisms are frequently used to provide interpretability, many high-performing models rely on the Hadamard product (element-wise multiplication) for feature fusion. This research explores how the Hadamard product itself acts as an implicit attention mechanism and introduces a novel gradient-based visualization technique to extract human-readable explanations from these fusion points.

Methodology: The Hadamard Product as Implicit Attention

The study focuses on the Multimodal Low-rank Bilinear (MLB) attention network. In this architecture, visual features ($V$) and textual features ($Q$) are merged via element-wise multiplication to create a joint representation ($F$).

Architecture of the MLB attention network showing the fusion of visual and textual features via the Hadamard product.

The core contribution is a gradient-based visualization method that treats the Hadamard product as an unsupervised source of information. By calculating the gradient of the difference between the input and the joint output (e.g., $V - F$) and applying "guided back-propagation," the researchers generate sharp "importance scores" for both image pixels and question words simultaneously. This approach filters noise by only passing positive gradients through ReLU layers, resulting in clear visualization maps.

Key Insights and Results

The proposed method reveals that the Hadamard product implicitly performs the work of an attention mechanism by filtering and weighting features from both modalities. Unlike explicit attention heads that may split focus across different regions, this gradient-based method produces a comprehensive "explanation map" representing the total focus of the joint function.

Comparison of explicit attention maps and the proposed gradient-based visualization ("Proposed" column) alongside word importance scores for various VQA queries.

Qualitative Alignment

As shown in the visualizations, the "Proposed" gradient-based maps closely align with regions highlighted by learned attention weights, validating the method's effectiveness. Furthermore, the textual importance scores ($z_i$) highlight a significant "noun bias" in current VQA models. For a question like "What is the person eating?", words like "eating" and "person" receive high scores, while functional words like "is" and "the" are largely ignored.

Performance and Interpretability

The researchers demonstrate that these implicit explanations are as competitive as those from models with explicit textual attention. This suggests that complex attention layers might sometimes serve primarily as a form of regularization rather than being strictly necessary for interpretability.

Limitations and Future Directions

A key finding is the models' lack of true linguistic comprehension; the heavy reliance on nouns suggests a struggle with complex reasoning involving verbs and prepositions. Future work aims to use these visualization techniques to "debug" models—identifying instances where a model provides the correct answer for the wrong reasons (e.g., guessing a color based on object category rather than visual evidence). Improving the inferential capability of multimodal AI remains a critical challenge.

Summary updated

Abstract

The visual explanation of learned representation of models helps to understand the fundamentals of learning. The attentional models of previous works used to visualize the attended regions over an image or text using their learned weights to confirm their intended mechanism. Kim et al. (2016) show that the Hadamard product in multimodal deep networks, which is well-known for the joint function of visual question answering tasks, implicitly performs an attentional mechanism for visual inputs. In this work, we extend their work to show that the Hadamard product in multimodal deep networks performs not only for visual inputs but also for textual inputs simultaneously using the proposed gradient-based visualization technique. The attentional effect of Hadamard product is visualized for both visual and textual inputs by analyzing the two inputs and an output of the Hadamard product with the proposed method and compared with learned attentional weights of a visual question answering model.
BibTeX
@misc{kim2017visual,
  author = {Jin-Hwa Kim and Byoung-Tak Zhang},
  title = {{Visual Explanations from Hadamard Product in Multimodal Deep Networks}},
  year = {2017},
  eprint = {1712.06228},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.06228},
}
Figure