|Chaerephon:||Pythia – Is there any man alive|
|wiser than Socrates?|
We present Pythia v0.1, a modular framework for Visual Question Answering research, which formed the basis for the winning entry to the VQA Challenge 2018 from Facebook AI Research (FAIR)’s A-STAR222Agents that See, Talk, Act, and Reason. team.
The motivation for Pythia comes from the following observation – a majority of today’s Visual Question Answering (VQA) models fit a particular design paradigm, with modules for question encoding, image feature extraction, fusion of the two (typically with attention), and classification over the space of answers. The long-term goal of Pythia is to serve as a platform for easy and modular research & development in VQA and related directions like visual dialog . The name ‘Pythia’ is an homage to the Oracle of Apollo at Delphi, who answered questions in Ancient Greece.
The starting point for Pythia v0.1 is a modular reimplementation of the bottom-up top-down (up-down) model . In this study, we demonstrate that by making a sequence of subtle but important changes, we can significantly improve the performance as summarized in Table 1333FAIR A-STAR’s entry in the VQA 2018 Challenge was 72.25%. This document describes results produced by our code release which reaches 72.27%..
2 Bottom-Up and Top-Down Attention
We perform ablations and augmentations over the baseline system of the up-down model , which was the basis of the winning entry to the 2017 VQA challenge. The key idea in up-down is the use of an object detector – Faster RCNN  pre-trained on the Visual Genome dataset  – to extract image features with bottom-up attention, i.e
., visual feed-forward attention. Specifically, a ResNet-101 was chosen as the backbone network, and its entire Res-5 block was used as the second-stage region classifier for detection. After training, each region was then represented by the 2048feature after average pooling from a grid.
The question text is then used to compute the top-down attention, i.e
., task specific attention, for each object in the image. Multi-modal fusion is done through a simple Hadamard product followed by a multi-label classifier using a sigmoid activation function to predict the answer scores. Their performance reached 70.34% on VQA 2.0 test-std split with an ensemble of 30 models trained with different seeds. For presentation clarity, we present our proposed changes (and the respective improvements) in a sequence; however, we also found them to be independently useful.
2.1 Model Architecture
followed by ReLU to reduce computation444https://github.com/hengyuan-hu/bottom-up-attention-vqa. We also replaced feature concatenation with element-wise multiplication to combine the features from text and visual modalities when computing the top-down attention. To compute the question representation, we used 300 GloVe vectors to initialize the word embeddings and then passed it to a GRU network and a question attention module to extract attentive text features . For fusing the image and text information, we found the best-performing hidden size to be 5000. With these modifications, we were able to improve the performance of the model from 65.32% to 66.91% on VQA v2.0 test-dev.
2.2 Learning Schedule
Our model is optimized by Adamax, a variant of Adam with infinite norm . In one popular implementation of up-down††footnotemark: learning rate is set to 0.002 with a batch size of 512. We found that reducing the batch size improves performance – which suggests that there is potential for improving performance by increasing the learning rate. However, naively increasing the learning rate resulted in divergence. To increase the learning rate, we thus deployed the warm up strategy  commonly used for large learning-rate training of networks. Specifically, we begin with a learning rate of 0.002, linearly increasing it at each iteration till it reaches 0.01 at iteration 1000. Next, we first reduce the learning rate by a factor of 0.1 at 5 and then reduce it every 2 iterations, and stop training at 12. With this we increase the performance from 66.91% to 68.05% on test-dev.
|up-down Model Adaptation (§2.1)||66.91|
|+ Learning Schedule (§2.2)||68.05|
|+ Detectron & Fine-tuning (§2.3)||68.49|
|+ Data Augmentation (§2.4)||69.24|
|+ Grid Feature (§2.5)||69.81|
|+ 100 bboxes (§2.5)||70.01||70.24|
|Ensemble, 30 same model (§2.6)||70.96|
|Ensemble, 30 diverse model (§2.6)||72.18||72.27|
2.3 Fine-Tuning Bottom-Up Features
Fine tuning pre-trained features is a well known technique to better tailor the features to the task at hand and thus improve model performance .
Different from Anderson et al. , we also used the new state-of-the-art detectors based on feature pyramid networks (FPN)  from Detectron555https://github.com/facebookresearch/Detectron, which uses ResNeXt  as backbone and has two fully connected layers (fc6 and fc7) for region classification. This allows us to extract the 2048 fc6 features and fine-tune the fc7 parameters, as opposed to the original up-down , where fine-tuning previous layers requires significantly more storage/IO and computation on convolutional feature maps. Similar to up-down, we also used Visual Genome (VG)  with both objects and attributes annotations to train the detector.
We set the fine-tune learning rate as 0.1 times the overall learning rate. We are able to reach a performance of 68.49% on test-dev with this fine-tuning.
2.4 Data Augmentation
We added additional training data from Visual Genome  and Visual Dialog (VisDial v0.9)  datasets. For VisDial, we converted the 10 turns in a dialog to 10 independent question-answer pairs. Since both VG and VisDial datasets only have a single ground-truth answer while VQA has 10, we simply replicated the answer to each question in VG and VisDial 10 times to make the data format compatible with the VQA evaluation protocol.
We also performed additional data augmentation by mirroring the images in the VQA dataset. We do some basic processing of the questions and answers for the mirrored images by interchanging the tokens “left” and “right” in the questions and answers which contain them. When adding these additional datasets, we reduce the learning rate as we described in Section 2.2 first at 15 iterations, respectively, and stop training at 22 iterations. As a result of data augmentation, we are able to improve our single model performance from 68.49% to 69.24% on test-dev.
2.5 Post-Challenge Improvements
Anderson et al.  uses only the features pooled from object proposals (called bottom-up features) to represent an image. Our hypothesis is that such a representation does not fully capture a holistic spatial information about the image and visual representations from image regions not covered by the proposals. To test this hypothesis, we combined grid-level image features together with bottom-up features. We follow the same procedure as  to extract grid-level features from ResNet152 . Object-level features and grid-level features are separately fused with features from questions and then are concatenated to fed to classification. Before the challenge deadline, we had experimented with this only on images from the VQA dataset without fine-tuning. After the challenge, we performed more comprehensive experiments and found that adding grid level features helps to further improve the performance to 69.81%.
Instead of using an adaptive protocol for choosing the number of object proposals (between 10 and 100) per image as as done in , we also experimented with using a simpler (but slower) strategy of using 100 objects proposals for all images. As can be seen in Table 1, with features from 100 bounding-boxes, we reach 70.01% for test-dev and 70.24% for test-std on VQA 2.0.
2.6 Model Ensembling
All ensembling experiments described below involve models trained before the challenge deadline. That is, they do not include the two after-challenge experiments described in Section 2.5. We tried two strategies for ensembling. First, we choose our best single model and train the same network with different seeds, and finally average the predictions from each model. As can be seen from Fig 1, the performance plateaus at 70.96%. Second, we choose models trained with different settings, i.e., the tweaked up-down model trained on the VQA dataset with/without data augmentation and models trained with image features extracted from different Detectron models with/without data augmentation. As can be seen, this ensembling strategy is much more effective than the previous one. Ensembling 30 diverse models, we reach 72.18% on test-dev and 72.27% on test-std of VQA v2.0.
We would like to thank Peter Anderson, Abhishek Das, Stefan Lee, Jiasen Lu, Jianwei Yang, Licheng Yu, Luowei Zhou for helpful discussions, Peter Anderson for providing training data for the Visual Genome detector, Deshraj Yadav for responses on EvalAI related questions, Stefan Lee for suggesting the name ‘Pythia’, Abhishek Das, Abhishek Kadian for feedback on our codebase and Meet Shah for making a docker image for our demo.
-  P. Anderson, X. He, C. Buehler, D. Teney, M. Johnson, S. Gould, and L. Zhang. Bottom-up and top-down attention for image captioning and visual question answering. In CVPR, 2018.
-  S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. Lawrence Zitnick, and D. Parikh. VQA: Visual question answering. In ICCV, 2015.
-  A. Das, S. Kottur, K. Gupta, A. Singh, D. Yadav, J. M. Moura, D. Parikh, and D. Batra. Visual Dialog. In CVPR, 2017.
-  A. Fukui, D. H. Park, D. Yang, A. Rohrbach, T. Darrell, and M. Rohrbach. Multimodal compact bilinear pooling for visual question answering and visual grounding. arXiv:1606.01847, 2016.
-  P. Goyal, P. Dollár, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia, and K. He. Accurate, large minibatch SGD: training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
-  Y. Goyal, T. Khot, D. Summers-Stay, D. Batra, and D. Parikh. Making the V in VQA matter: Elevating the role of image understanding in Visual Question Answering. In CVPR, 2017.
-  K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In CVPR, 2016.
-  D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
-  R. Krishna, Y. Zhu, O. Groth, J. Johnson, K. Hata, J. Kravitz, S. Chen, Y. Kalantidis, L.-J. Li, D. A. Shamma, et al. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 2017.
-  T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, and S. Belongie. Feature pyramid networks for object detection. In CVPR, 2017.
-  J. Pennington, R. Socher, and C. Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
-  S. Ren, K. He, R. Girshick, and J. Sun. Faster r-cnn: Towards real-time object detection with region proposal networks. In NIPS, 2015.
T. Salimans and D. P. Kingma.
Weight normalization: A simple reparameterization to accelerate training of deep neural networks.In NIPS, 2016.
-  D. Teney, P. Anderson, X. He, and A. van den Hengel. Tips and tricks for visual question answering: Learnings from the 2017 challenge. CoRR, abs/1708.02711, 2017.
-  S. Xie, R. Girshick, P. Doll r, Z. Tu, and K. He. Aggregated residual transformations for deep neural networks. arXiv preprint arXiv:1611.05431, 2016.
-  Z. Yu, J. Yu, C. Xiang, J. Fan, and D. Tao. Beyond bilinear: Generalized multimodal factorized high-order pooling for visual question answering. TNNLS, 2018.