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

Q2ATransformer: Improving Medical VQA via an Answer Querying Decoder

Yunyi Liu, Zhanyu Wang, Dong Xu, Luping Zhou

TL;DR

Q2ATransformer introduces a "semi-open" framework for Medical Visual Question Answering (VQA) that bridges the gap between rigid classification and "hallucinatory" generation models. By using a Transformer decoder to query learnable answer embeddings against fused image-text features, it achieves massive performance leaps—including a staggering 41% absolute improvement on open-ended pathology questions.

What Problem Does This Paper Address?

Medical VQA systems help clinicians interpret images by answering specific questions. Traditionally, researchers have used two approaches:

  1. Closed-type (Classification): Treats every possible answer as a fixed category. It’s simple and works well for "Yes/No" questions but fails miserably on long, varied, open-ended answers.
  2. Open-type (Generation): Predicts answers word-by-word. While flexible, these models often "hallucinate" non-existent medical terms because the search space (the entire vocabulary) is too vast.

The authors identify a "gap": classification is too restrictive, but generation is too unconstrained for the high-stakes world of medicine. They sought a unified architecture that handles both simple and complex questions with high precision.

Methods

The authors propose Q2ATransformer, which they categorize as a "semi-open" type. The architecture consists of three main stages:

  • Visual-Question Encoder: It uses a Swin Transformer for medical images (better at capturing fine-grained details than standard CNNs) and BERT for the questions.
  • Cross-modality Attention Network (CMAN): Instead of multiplying or summing image and text features (which can lose information), CMAN concatenates them and passes them through Transformer encoder layers. This allows the model to learn complex relationships between specific image regions and words in the question.
  • Answer Querying Decoder: This is the core innovation. The model maintains a set of learnable candidate answer embeddings. These embeddings act as "queries" in a Transformer decoder. They "interrogate" the fused image-question features to determine if a specific answer class is present.
  • Asymmetric Loss: To handle the massive class imbalance (where "Yes/No" answers far outnumber specific medical terms), the authors used a simplified asymmetric loss (a variant of focal loss) to ensure the model doesn't ignore rare but important open-ended answers.

Datasets

The model was evaluated on two major medical VQA benchmarks:

  • VQA-RAD: A radiology dataset containing 315 images and 3,515 question-answer pairs covering various body parts (head, chest, abdomen).
  • PathVQA: A much larger pathology dataset with 32,799 question-answer pairs extracted from digital textbooks and libraries.

Key Insights and Ideas

  • Answers as Queries: The "aha moment" here is treating the answer classes themselves as active participants in the attention mechanism. By letting answer semantics interact with the image-text features, the model learns why an answer is relevant, rather than just memorizing a mapping.
  • The Power of Concatenation: The authors found that simply concatenating features before applying self-attention (CMAN) outperformed more complex bilinear pooling or matrix multiplication methods commonly used in VQA.
  • Classification with a Generative "Feel": Even though the model ultimately performs classification (choosing from a pool of candidates), the querying mechanism mimics the way generative models attend to context, providing the "best of both worlds."

Key Results

The Q2ATransformer set new State-of-the-Art (SOTA) records on both benchmarks, with the most dramatic improvements seen in open-ended questions:

  • VQA-RAD: Achieved 79.19% accuracy on open-ended questions, a 16.09% absolute improvement over the previous best model (MMBERT).
  • PathVQA: Achieved 54.85% on open-ended questions, a massive 41.45% absolute improvement over the previous SOTA (MMQ).
  • Overall Accuracy: Reached 80.48% on VQA-RAD and 74.61% on PathVQA, outperforming both pure classification and pure generation models.

Limitations and Future Work

The primary limitation is scalability. Because the model treats every answer as a learnable embedding and performs global self-attention across them, the computational cost increases as the number of possible answers grows. For datasets with tens of thousands of unique answers, this could become a bottleneck.

The authors suggest that future work could involve dynamic sparse attention—only querying a subset of likely answers—to reduce computational overhead while maintaining the high accuracy of the querying approach.

Summary updated

BibTeX
@inproceedings{liu2023q,
  author = {Yunyi Liu and Zhanyu Wang and Dong Xu and Luping Zhou},
  title = {{Q2ATransformer: Improving Medical VQA via an Answer Querying Decoder}},
  booktitle = {IPMI},
  year = {2023},
  url = {https://openreview.net/forum?id=1U87oskI1f},
}

Loading related content...

Figure