Rethinking Image Cropping: Exploring Diverse Compositions from Global Views

Gengyun Jia, Huaibo Huang, Chaoyou Fu, Ran He

Abstract

Automatic image cropping has traditionally been approached through either fixed-grid anchor evaluation or single-output coordinate regression. While the former offers diversity at the cost of spatial precision, the latter provides a global view but fails to capture multiple valid compositions. This paper introduces a novel framework that treats image cropping as a set prediction problem. By utilizing learnable anchors within a transformer-based architecture, the proposed model achieves both global search capabilities and the ability to generate a diverse set of high-quality crops. Experimental results on standard benchmarks like GAICv2 demonstrate state-of-the-art performance, significantly improving top-k accuracy and precision.

Introduction

Automatic image cropping aims to identify aesthetically pleasing sub-regions within an image, mimicking the artistic eye of a photographer. Historically, models fell into two camps: anchor evaluation and coordinate regression. Anchor evaluation models score a pre-defined grid of boxes; while they can find multiple "good" crops, they are limited by the fixed grid. Conversely, coordinate regression models look at the whole image and predict coordinates directly, but typically only output one "best" crop, ignoring the fact that a single image often contains multiple valid compositions.

Comparison of traditional cropping paradigms (evaluation and regression) versus the proposed set-prediction model.

The authors aim to bridge this gap, creating a model that can search the entire image space to find a diverse set of high-quality crops by treating cropping as a set prediction problem.

Methodology

The proposed framework is inspired by recent advances in object detection, specifically the DEtection TRansformer (DETR).

Set Prediction with Learnable Anchors

Instead of a fixed grid, the model uses a set of "learnable anchors." These are flexible queries that "probe" the image features to find potential crops. The system uses a CNN backbone to extract features, followed by a Transformer encoder and decoder. The decoder takes the learnable anchors and transforms them into specific crop coordinates and "validity" scores, representing the probability that a crop is aesthetically sound.

The proposed C-Transformer architecture, featuring coordinate regression, validity classification, and label smoothing strategies.

Training and Label Smoothing

During training, the model uses the Hungarian algorithm for bipartite matching between predicted crops and ground-truth annotations. A key innovation is the handling of "bad" crops through label smoothing. Rather than treating all non-labeled crops as hard zeros, the authors propose two methods:

  • Quality Guidance: For dense datasets, quality is estimated based on overlap (IoU) with known high-quality neighbors.
  • Self-Distillation: For sparse datasets, a "teacher" version of the model provides "soft" labels to help the model understand the nuances of aesthetic quality.

Experimental Results

The model was evaluated on several standard benchmarks, including GAICv1, GAICv2, the Competitive Photography Collection (CPC), and Functional Learning for Multiple Subjects (FLMS).

The model achieved state-of-the-art (SOTA) performance across the board:

  • Accuracy: On the GAICv2 dataset, the model achieved an $ACC_{10}$ of 92.6%, a significant jump from the previous best of 85.8%.
  • Precision: Using Average Precision (AP) metrics, the model consistently outperformed competitors, proving it is better at ranking the "best" crops at the top of its list.

Key Insights

  • Cropping is not Binary: Treating cropping as a continuous spectrum of quality rather than a 0-or-1 classification task stabilizes training and improves results.
  • Breaking the Grid: Moving away from fixed anchor grids allows for "globality," enabling the model to find compositions of any size and position.
  • Diversity via Set Prediction: Treating the output as a set allows the model to provide users with multiple valid options, mimicking real-world use cases where different aspect ratios or focal points might be desired from the same source image.

Conclusion and Future Work

By reimagining image cropping as a set prediction problem, this framework achieves a superior balance of global search and compositional diversity. While highly effective, the authors acknowledge a potential cropping scale bias toward larger crops inherited from existing datasets. Future work involves addressing this bias and potentially incorporating personalized aesthetics to tune the model to individual user preferences.

Summary updated

BibTeX
@inproceedings{jia2022rethinking,
  author = {Gengyun Jia and Huaibo Huang and Chaoyou Fu and Ran He},
  title = {{Rethinking Image Cropping: Exploring Diverse Compositions from Global Views}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.00248},
}
Figure