Object-Aware Cropping for Self-Supervised Learning

Shlok Mishra, Anshul Shah, Ankan Bansal, Abhyuday Jagannatha, Janit Anjaria, Abhishek Sharma, David Jacobs, Dilip Krishnan

TL;DR

Standard self-supervised learning (SSL) relies heavily on random image cropping to learn visual representations, but this approach breaks down on real-world datasets containing multiple small, off-center objects. This paper introduces Object-Aware Cropping (OAC), a method that leverages unsupervised object proposals to ensure crops capture actual objects and their surrounding context. By fixing this fundamental flaw in data augmentation, OAC significantly closes the performance gap between self-supervised and fully supervised models on complex downstream tasks.

What Problem Does This Paper Address?

State-of-the-art self-supervised learning methods (like MoCo, BYOL, and SwAV) have nearly matched supervised learning performance on benchmarks like ImageNet. They do this primarily through contrastive learning: taking two random crops of the same image ("positive views") and teaching a neural network that they represent the same underlying concept.

This strategy relies on a massive implicit assumption: that a single, large object dominates the center of the image (an "iconic" view). While true for ImageNet, this assumption fails spectacularly on real-world, uncurated datasets like COCO or OpenImages. In these complex scenes, images contain multiple small, scattered objects. Randomly cropping such an image often results in views that capture completely different objects or empty backgrounds. Forcing a model to treat these semantically distinct crops as "identical" degrades representation quality, leading to a massive performance drop compared to supervised learning.

Methods

The authors propose Object-Aware Cropping (OAC), a simple, framework-agnostic pre-processing pipeline designed to inject object-awareness into SSL:

  1. Unsupervised Object Proposals: Instead of cropping blindly, the authors use an unsupervised object discovery algorithm called LOD (Large-scale Unsupervised Object Discovery) to generate up to 10 object bounding box proposals per image. One box is selected at random.
  2. Obj-Obj+Dilate Crop: To capture both the object and its context, the selected bounding box serves as the first view. The second view is created by dilating (expanding) this box by 10% to 20% of the image size. Finally, standard random cropping and resizing are applied within these two boxes to generate the final pair of positive views.
  3. Auxiliary Loss Objectives: To further guide the network, the authors introduce two new unsupervised losses:
  4. Relative Rotation Task ($L_{rot}$): The object crop is randomly rotated, and the model must predict its orientation relative to the scene crop. This avoids the pitfalls of absolute rotation prediction on uncurated datasets where objects naturally appear in various poses.
  5. Object Localization Task ($L_{loc}$): The full image is divided into a grid of patches, and the model must predict which patches contain the object based solely on the extracted features.
[Original Image] ---> [LOD Object Proposal] 
                             |
              +--------------+--------------+
              |                             |
       [Object Crop]                [Dilated Object Crop]
              |                             |
     (Random Crop/Resize)          (Random Crop/Resize)
              |                             |
          [View 1]                      [View 2]

Datasets

The authors evaluated their approach across several standard and custom benchmarks:

  • ImageNet & MS-COCO: Standard benchmarks for self-supervised pre-training and downstream evaluation.
  • PASCAL-VOC: Used to evaluate downstream object detection and segmentation.
  • OHMS (OpenImages Hard Multi-object Subset): A new, challenging subset curated by the authors to rigorously test multi-object scenes. It contains 212,753 images across 208 classes, specifically filtering for images that contain at least two distinct object classes and an average of 12 objects per image.

Key Insights and Ideas

  • The ImageNet Bias in SSL: Standard data augmentation pipelines are over-fitted to ImageNet's clean structure. When applied to complex scenes, random cropping actively harms learning by creating false positives.
  • Context is Crucial: Purely cropping tightly around an object removes environmental context, which is vital for downstream tasks. The "Obj-Obj+Dilate" strategy successfully balances object-level semantics with scene-level correlations.
  • Tight Fits Aren't Necessary: Ablation studies using ground-truth bounding boxes showed only marginal improvements over unsupervised LOD proposals. This indicates that the object proposal mechanism doesn't need to be perfect to provide massive representation gains.

Key Results

  • Closing the Supervised Gap: On the challenging OHMS dataset, OAC improved MoCo-v2 classification performance by 8.8% mAP over standard scene cropping, cutting the performance gap to fully supervised learning in half.
  • Outperforming ImageNet Pre-training: Pre-training on the multi-object OHMS dataset using OAC achieved 57.13% mAP on VOC object detection, outperforming models pre-trained on ImageNet by 6.52% mAP.
  • Universal Framework Compatibility: Adding OAC to various state-of-the-art SSL frameworks (MoCo-v2, BYOL, Dense-CL) consistently yielded performance boosts on COCO object detection and semantic segmentation, showing up to a +3.2% AP improvement.

Limitations and Future Work

  • Pipeline Dependency: OAC relies on an external, multi-step unsupervised object proposal algorithm (LOD). While completely unsupervised, it adds an extra pre-processing step before training can begin.
  • Dataset Specificity: While OAC provides massive boosts on complex, multi-object datasets, its performance gains on "iconic" datasets like ImageNet are more modest, meaning its utility is highly dependent on the nature of the pre-training data.
  • Future Directions: A promising next step would be integrating the object proposal mechanism directly into the end-to-end training loop of the self-supervised network, eliminating the decoupled pre-processing phase.

Summary updated

Abstract

A core component of the recent success of self-supervised learning is cropping data augmentation, which selects sub-regions of an image to be used as positive views in the self-supervised loss. The underlying assumption is that randomly cropped and resized regions of a given image share information about the objects of interest, which the learned representation will capture. This assumption is mostly satisfied in datasets such as ImageNet where there is a large, centered object, which is highly likely to be present in random crops of the full image. However, in other datasets such as OpenImages or COCO, which are more representative of real world uncurated data, there are typically multiple small objects in an image. In this work, we show that self-supervised learning based on the usual random cropping performs poorly on such datasets. We propose replacing one or both of the random crops with crops obtained from an object proposal algorithm. This encourages the model to learn both object and scene level semantic representations. Using this approach, which we call object-aware cropping, results in significant improvements over scene cropping on classification and object detection benchmarks. For example, on OpenImages, our approach achieves an improvement of 8.8% mAP over random scene-level cropping using MoCo-v2 based pre-training. We also show significant improvements on COCO and PASCAL-VOC object detection and segmentation tasks over the state-of-the-art self-supervised learning approaches. Our approach is efficient, simple and general, and can be used in most existing contrastive and non-contrastive self-supervised learning frameworks.
BibTeX
@article{mishra2022object,
  author = {Shlok Mishra and Anshul Shah and Ankan Bansal and Abhyuday Jagannatha and Janit Anjaria and Abhishek Sharma and David Jacobs and Dilip Krishnan},
  title = {{Object-Aware Cropping for Self-Supervised Learning}},
  journal = {Accepted by TMLR},
  year = {2022},
  url = {https://openreview.net/forum?id=WXgJN7A69g},
}
Figure