Learning to Learn Cropping Models for Different Aspect Ratio Requirements

Debang Li, Junge Zhang, Kaiqi HuangCVPR 2020

Abstract

Image cropping aims at improving the framing of an image by removing its extraneous outer areas, which is widely used in the photography and printing industry. In some cases, the aspect ratio of cropping results is specified depending on some conditions. In this paper, we propose a meta-learning (learning to learn) based aspect ratio specified image cropping method called Mars, which can generate cropping results of different expected aspect ratios. In the proposed method, a base model and two meta-learners are obtained during the training stage. Given an aspect ratio in the test stage, a new model with new parameters can be generated from the base model. Specifically, the two meta-learners predict the parameters of the base model based on the given aspect ratio. The learning process of the proposed method is learning how to learn cropping models for different aspect ratio requirements, which is a typical meta-learning process. In the experiments, the proposed method is evaluated on three datasets and outperforms most state-of-the-art methods in terms of accuracy and speed. In addition, both the intermediate and final results show that the proposed model can predict different cropping windows for an image depending on different aspect ratio requirements.

Introduction

Image cropping is a fundamental task in photography and design, aimed at improving composition by removing extraneous areas. However, real-world applications—like printing a photo for a specific frame or resizing a thumbnail for social media—often require a specified aspect ratio.

Existing methods generally fall into two categories, both with significant drawbacks:

  1. Sliding Window/Candidate Ranking: These generate thousands of potential crops and rank them. While flexible with aspect ratios, they are computationally expensive and slow.
  2. Direct Prediction: These predict a cropping window directly. While fast, they often ignore aspect ratios entirely or use "multi-head" architectures that only support a few fixed, discrete ratios (e.g., 1:1, 4:3).

The challenge lies in creating a model that is both fast and flexible enough to handle any arbitrary, continuous aspect ratio (like 1.23:1) without needing to train a separate model for every possibility.

Methodology: The Mars Framework

The researchers propose a "learning to learn" approach called Mars. Instead of using fixed weights, the parameters of the cropping model change dynamically based on the input aspect ratio.

The Mars architecture: Meta-learners predict parameters for the base model's transformation and prediction layers based on the requested aspect ratio.

The system consists of a base model and two meta-learners:

  • Feature Extraction: A standard backbone (like MobileNetV2 or ResNet50) extracts features from the image.
  • Aspect Ratio Embedding: To handle the continuous nature of aspect ratios, the model uses a set of learned embedding vectors. For a specific requested ratio, it performs linear interpolation in log-space between the two nearest learned embeddings.
  • Meta-Learners: These are small sub-networks that take the aspect ratio embedding as input and predict the weights for two specific modules in the base model:
  • ARS-FTM (Aspect Ratio Specified Feature Transformation Matrix): This transforms global image features into a space that accounts for the desired shape.
  • ARS-PWP (Aspect Ratio Specified Pixel-Wise Predictor): A $1 \times 1$ convolution layer that predicts which pixels should be included in the final crop.

By predicting these weights dynamically, the model essentially "reconfigures" itself for every new task.

Datasets

The model was trained and evaluated on three major image cropping benchmarks:

  • FAT (Feature-Aware Thumbnail): A large-scale dataset containing over 24,000 images with 63,000+ annotations. This served as the primary training set.
  • HCDB (HCP-based Cropping Database): 500 images, each annotated by 10 different experts to capture subjective quality.
  • FCDB (Functional Cropping Database): 343 testing images used to evaluate generalization.

Key Insights

  • Weight Prediction vs. Feature Concatenation: Instead of just "telling" the model the aspect ratio by appending a number to the features, Mars uses the ratio to generate the model's parameters. This allows for a much deeper integration of the constraint into the prediction process.
  • Log-Space Symmetry: The authors choose to interpolate aspect ratios in log-space. This treats a "tall" crop (e.g., 1:2) and a "wide" crop (e.g., 2:1) symmetrically, reflecting the fact that they are essentially 90-degree rotations of each other.
  • Efficiency of Meta-Learning: The study found that even a lightweight backbone (MobileNetV2) combined with the meta-learning modules could match or beat much heavier models (ResNet50). This suggests that the logic of how to adapt to a ratio is more important than raw feature depth for this specific task.

Results

Mars outperformed existing state-of-the-art (SOTA) methods like VEN and GAIC across all three datasets in terms of Intersection-over-Union (IoU) and Boundary Displacement Error (BDE).

Cropping results for different aspect ratios generated by the Mars model, demonstrating its ability to adapt to varying requirements.
  • Speed: Because it avoids sliding windows and uses a lightweight architecture, Mars runs at over 100 FPS on a single GPU, making it suitable for real-time mobile applications.
  • User Preference: In a study where professional photographers ranked different cropping results, Mars was selected as the "best" crop more frequently than any other automated method.

Conclusion and Future Work

While Mars performs well on benchmarks, image cropping remains highly subjective. The authors suggest that future work could involve "personalizing" the meta-learners to match individual user styles. Additionally, while the model captures composition well, it is unclear how it handles complex semantic constraints (e.g., avoiding cutting off a subject's limbs) compared to object-detection-heavy approaches. The current model was primarily tested on aspect ratios between 0.5 and 2.0; extremely wide panoramas or very thin vertical strips might require different embedding strategies or more specialized training data.

Summary updated

BibTeX
@inproceedings{li2020learning,
  author = {Debang Li and Junge Zhang and Kaiqi Huang},
  title = {{Learning to Learn Cropping Models for Different Aspect Ratio Requirements}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  url = {https://openreview.net/forum?id=ZSw4YuUr7vK},
}
Figure