Multimodal Continuous Visual Attention Mechanisms

António Farinhas, André F. T. Martins, Pedro M. Q. AguiarICCVW 2021

Abstract: Visual attention mechanisms are a key component of neural network models for computer vision. By focusing on a discrete set of objects or image regions, these mechanisms identify the most relevant features and use them to build more powerful representations. Recently, continuous-domain alternatives to discrete attention models have been proposed, which exploit the continuity of images. These approaches model attention as simple unimodal densities (e.g. a Gaussian), making them less suitable to deal with images whose region of interest has a complex shape or is composed of multiple non-contiguous patches. In this paper, we introduce a new continuous attention mechanism that produces multimodal densities, in the form of mixtures of Gaussians. We use the EM algorithm to obtain a clustering of relevant regions in the image, and a description length penalty to select the number of components in the mixture. Our densities decompose as a linear combination of unimodal attention mechanisms, enabling closed-form Jacobians for the backpropagation step. Experiments on visual question answering in the VQA-v2 dataset show competitive accuracies and a selection of regions that mimics human attention more closely in VQA-HAT. We present several examples that suggest how multimodal attention maps are naturally more interpretable than their unimodal counterparts, showing the ability of our model to automatically segregate objects from ground in complex scenes.

Introduction: The Evolution of Visual Attention

In computer vision, "attention" is the critical mechanism that directs a model toward the most relevant portions of an image for a given task, such as answering a question about a scene. Historically, this has been implemented through Discrete Attention, where an image is divided into a grid. While effective, this often results in "scattered" focus that lacks a clear object-centric structure.

To address this, researchers introduced Unimodal Continuous Attention, which treats the image as a smooth surface and identifies a single elliptical region (a Gaussian) of interest. While this approach provides a cleaner, more mathematically grounded focus, it struggles significantly when a task requires attending to multiple distinct objects or complex, non-elliptical shapes. For instance, when asked to count objects, a unimodal model may stretch its single focus area across the entire scene, leading to incorrect inferences.

Comparison of attention mechanisms: Discrete (left), Unimodal Continuous (center), and Multimodal Continuous (right). The unimodal model fails to isolate the two planes, leading to an incorrect count, whereas the multimodal approach correctly identifies both.

Methodology: Mixtures of Gaussians and EM

The proposed multimodal continuous attention mechanism bridges the gap between discrete and unimodal approaches by representing attention as a Mixture of Gaussians (MoG). Instead of a single "spotlight," the model can project multiple spotlights simultaneously.

The EM Algorithm and Model Selection

To determine the optimal placement of these spotlights, the authors adapted the Expectation-Maximization (EM) algorithm to work with weighted image data. This process clusters raw importance scores into distinct Gaussian components. A crucial challenge is determining the number of components ($K$) needed for a specific image. The researchers utilized a description length penalty (similar to BIC) to automatically select the optimal $K$, ensuring the model uses only as much complexity as the scene requires.

Mathematical Efficiency

One of the most significant technical contributions is the proof that the resulting "context vector" is a linear combination of individual unimodal attentions. This allows for closed-form Jacobians, enabling the model to be trained efficiently using standard backpropagation. Furthermore, this mechanism is a "plug-and-play" extension that adds zero parameter overhead to the underlying neural network.

Experimental Results and Human Alignment

The researchers evaluated the multimodal approach on two primary benchmarks: VQA-v2 for task accuracy and VQA-HAT for alignment with human attention patterns.

  • Task Accuracy: On the VQA-v2 test-standard split, the multimodal model achieved 70.79% accuracy, performing on par with discrete softmax (70.94%) and slightly outperforming unimodal continuous attention (70.73%).
  • Human Alignment: The model's true strength lies in its interpretability. It achieved a Jensen-Shannon (JS) divergence of 0.54 on VQA-HAT, significantly outperforming both discrete (0.64) and unimodal (0.59) models. This indicates that the model's focus areas align much more closely with where humans look to solve the same problems.

Interpretability and Object Segregation

The multimodal approach naturally excels at "segregating" objects from their background. In complex scenes, it can wrap individual Gaussians around distinct objects rather than stretching a single Gaussian across the whole frame, which would inevitably include irrelevant background noise. By increasing the number of components, the model can approximate almost any continuous density, allowing it to "trace" complex shapes that a single ellipse could not capture.

Multimodal continuous attention successfully segregates two distinct objects (planes) by placing separate Gaussian components on each, leading to a correct count.

Conclusion and Future Directions

While the multimodal model offers superior alignment and interpretability, it is not without limitations. The authors noted occasional "hallucinations" where the model over-attends to similar-looking but irrelevant objects (e.g., mistaking a zebra for a giraffe in a counting task).

Future work will explore the use of sparse distributions, such as truncated paraboloids, which have hard boundaries to prevent attention from "bleeding" into irrelevant areas. Additionally, the researchers aim to apply this mechanism to video tasks, where the ability to track multiple moving objects simultaneously is essential.

Summary updated

BibTeX
@inproceedings{farinhas2021multimodal,
  author = {António Farinhas and André F. T. Martins and Pedro M. Q. Aguiar},
  title = {{Multimodal Continuous Visual Attention Mechanisms}},
  booktitle = {ICCVW},
  year = {2021},
  url = {https://openreview.net/forum?id=I28v781ECcl},
}
Figure