Experimenting with Self-Supervision using Rotation Prediction for Image Captioning

Ahmed Elhagry, Karima KadaouiarXiv 2021

Introduction

Traditional image captioning models—which generate natural language descriptions for visual inputs—rely heavily on massive, human-annotated datasets like MS COCO. However, human annotation is costly, time-consuming, and difficult to scale for niche domains like medical imaging. This research explores reducing this dependency through self-supervised learning (SSL). By training a vision encoder on a "pretext task"—predicting image rotations—the authors demonstrate that models can learn foundational visual features from unlabeled data that are comparable to those learned through traditional supervised methods.

Methodology

The authors utilize an encoder-decoder architecture and a two-stage training pipeline to bridge the gap between visual pixels and linguistic tokens.

  1. The Pretext Task (Self-Supervision): A ResNet-50 encoder is trained on a subset of OpenImages (approx. 1,000 images per class). Instead of object recognition, the model is tasked with predicting whether an image has been rotated by 0°, 90°, 180°, or 270°. This forces the network to identify salient objects and understand their spatial orientations to succeed.
  2. The Downstream Task (Captioning): The pre-trained encoder is connected to a Long Short-Term Memory (LSTM) decoder. The system is then fine-tuned on a small subset (10%) of labeled MS COCO data to translate visual features into natural language sentences.
The two-stage training pipeline: Pre-processing for rotation prediction followed by fine-tuning for the downstream captioning task.

The study also compares this "Rotnet" approach against other SSL frameworks, including SimCLR (contrastive learning), Jigsaw (shuffled tile puzzles), and Colorization.

Key Insights and Ideas

Geometry as a Teacher

A primary finding is that rotation prediction effectively forces the encoder to localize objects and understand spatial relationships. Qualitative analysis shows that the attention maps—the regions the model focuses on—for the SSL rotation model are remarkably similar to those of a fully supervised model, particularly in deeper layers like Conv5.

Comparison of attention maps between a supervised model and the rotation SSL model across different convolutional layers.

The SimCLR Paradox

Interestingly, while SimCLR achieved the highest accuracy on the pretext task (64.4%), it did not significantly outperform simpler methods like rotation prediction in the final captioning results. This suggests that in low-resource settings, higher pretext accuracy does not always translate to superior linguistic descriptions.

Data Integrity in Rotation

The authors specifically utilized 90-degree increments for the pretext task. Rotating images by arbitrary angles (e.g., 45 degrees) introduces "black corners" and data loss, creating low-level artifacts that can distract the neural network from learning meaningful semantic features.

Key Results

Performance was evaluated using Perplexity and BLEU scores (measuring word overlap with human captions). While the scores are lower than state-of-the-art fully supervised models (which typically exceed 0.30), they establish a proof-of-concept for SSL in captioning:

  • Baseline: BLEU score of 0.03.
  • Rotation SSL (Ours): BLEU score of 0.04.
  • Pre-trained Comparisons: Using Facebook’s VISSL models, both Rotnet and Jigsaw reached a BLEU score of 0.05.

Limitations and Future Work

The study identified several challenges for rotation-based SSL:

  • The "Round Object" Problem: Rotation prediction is logically impossible for radially symmetric objects (e.g., balls, flowers) or objects without a fixed orientation (e.g., rocks).
  • Hardware and Data: Training sophisticated models like SimCLR requires immense computational resources. Furthermore, dataset imbalances in the OpenImages subset likely hindered the encoder's generalization.

Future research will focus on balancing datasets through advanced augmentation and exploring hybrid SSL methods that combine rotation with other tasks like colorization to create more robust visual representations.

Summary updated

BibTeX
@misc{elhagry2021experimenting,
  author = {Ahmed Elhagry and Karima Kadaoui},
  title = {{Experimenting with Self-Supervision using Rotation Prediction for Image Captioning}},
  year = {2021},
  eprint = {2107.13111},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.13111},
}
Figure