Visual Transformers with Primal Object Queries for Multi-Label Image Classification

Vacit Oguz Yazici, Joost van de Weijer, Longlong Yu

TL;DR

This paper introduces "primal object queries" for multi-label image classification, a novel approach that significantly improves performance and speeds up convergence compared to existing transformer-based methods. By strategically feeding object queries into the transformer decoder, the authors achieve state-of-the-art results on challenging datasets like MS-COCO and NUS-WIDE.

What Problem Does This Paper Address?

Multi-label image classification is the task of assigning multiple relevant class labels to a single image. This is a complex problem due to the vast number of potential classes, their varying scales, and intricate inter-dependencies. While transformers have shown great promise in sequence-to-sequence tasks and even vision tasks like object detection, their application to multi-label classification has faced challenges. Specifically, previous transformer models for this task, like DETR, used object queries (learnable positional encodings) that were fed into every decoder layer. The authors hypothesize and demonstrate that this repeated use of the same queries across different hierarchical levels of the decoder hinders training, leading to suboptimal performance and slower convergence. They aim to address this by proposing a more efficient way to utilize object queries within the transformer architecture.

Methods

The core innovation of this paper lies in the introduction of primal object queries. Unlike standard object queries that are incorporated into every decoder layer, primal object queries are introduced only at the beginning of the transformer decoder stack. This strategic placement is hypothesized to lead to faster convergence and better performance by avoiding the need for queries to adapt to multiple hierarchical levels.

The proposed architecture consists of a CNN backbone for feature extraction, followed by a transformer encoder and decoder. The CNN features are linearized into a sequence for the encoder. The transformer encoder uses self-attention and linear layers. The decoder then utilizes cross-attention modules. The key difference is how object queries are integrated: they are fed directly into the first decoder layer as primal object queries, rather than being added as positional encodings in every layer.

Additionally, the authors improve the mixup technique for multi-label classification. Mixup, a data augmentation method, involves blending images and their labels. They adapt this by proposing "hard mixup" and "restricted hard mixup," which handle label unions and are applied strategically during training to improve generalization and avoid biases towards frequent classes.

Datasets

The paper evaluates its proposed methods on two widely used multi-label image classification datasets:

  • MS-COCO: This dataset contains 82,081 training images and 40,137 test images, annotated with 80 object categories.
  • NUS-WIDE: This dataset is significantly larger, with 269,648 images and over 5,000 unique labels. For evaluation, the authors focus on a subset of 81 more trustworthy labels, resulting in 209,347 images.

Key Insights and Ideas

  • Primal Object Queries are Key: The central insight is that the way object queries are introduced into the transformer decoder significantly impacts performance. Feeding them only at the start (as primal object queries) is more efficient and effective than distributing them across all layers.
  • Hierarchical Query Adaptation is Problematic: The authors' experiments confirm their hypothesis that forcing the same object queries to be useful at multiple hierarchical levels within the decoder is detrimental to training.
  • Mixup Adaptation Matters: The proposed "restricted hard mixup" technique proves beneficial for multi-label classification, leading to improved precision and mAP, likely by better handling label correlations and reducing variance.
  • Transformers Excel at Recall: The transformer-based approach, particularly with more decoder layers, shows a notable improvement in recall, indicating its ability to capture a wider range of relevant concepts and reduce false negatives.
  • Efficiency Gains: The primal object query approach not only improves accuracy but also leads to substantial speedups in training convergence.

Key Results

The proposed "primal object queries" (T-POQ) approach achieves state-of-the-art results on both MS-COCO and NUS-WIDE datasets.

  • Performance Improvement: T-POQ improves the class-wise F1 metric by 2.1% on MS-COCO and 1.8% on NUS-WIDE compared to previous methods.
  • Faster Convergence: The model achieves a significant speed-up in training convergence, by 79.0% on MS-COCO and 38.6% on NUS-WIDE.
  • DETR Comparison: T-POQ outperforms DETR, especially in terms of C-F1 scores, and requires fewer decoder layers to achieve comparable performance.
  • Mixup Impact: The restricted hard mixup strategy leads to higher precision and mAP scores, indicating more confident predictions.
  • Recall Enhancement: The transformer model, in general, shows improved recall compared to LSTM models, especially on images with a higher number of labels.

Limitations and Future Work

  • Computational Cost: While T-POQ offers faster convergence, transformers, in general, still require a large number of parameters and computational resources compared to some traditional models. The paper notes that their transformer model slightly increases the total parameters and computational cost compared to the backbone model.
  • Dataset Specificity: The effectiveness of the primal object queries and mixup adaptations is demonstrated on specific datasets. Further validation on a wider range of datasets would be beneficial.
  • Future Directions: The paper implicitly suggests that further exploration of query design and their interaction with decoder layers could yield even better results. The authors also highlight the potential for transformers to excel in tasks requiring the understanding of long-term dependencies and complex relationships between visual concepts.

Summary updated

BibTeX
@inproceedings{yazici2022visual,
  author = {Vacit Oguz Yazici and Joost van de Weijer and Longlong Yu},
  title = {{Visual Transformers with Primal Object Queries for Multi-Label Image Classification}},
  booktitle = {ICPR},
  year = {2022},
  url = {https://openreview.net/forum?id=_qV43HQWk-},
}
Figure