A Lightweight Auto-Crop Based on Deep Reinforcement Learning

Kunxiang Liu, Shaoqiang Zhu, Junsong ZhangATAIT 2021

TL;DR

This paper introduces LA2C, a lightweight deep reinforcement learning framework for automatic image cropping. By framing cropping as a sequential decision-making problem and using IOU as a reward signal, LA2C achieves state-of-the-art performance with significantly fewer steps and faster processing times compared to existing methods.

What Problem Does This Paper Address?

Creating visually appealing images often requires careful composition, and a key aspect of this is image cropping. While manual cropping allows for artistic control, it's a skill that many people lack. Automatic image cropping aims to bridge this gap by intelligently removing unwanted parts of an image to improve its framing, aspect ratio, or subject emphasis. However, existing automatic cropping methods face challenges: quantifying image aesthetics is notoriously difficult and subjective, and many approaches are computationally expensive, requiring the generation and evaluation of thousands of candidate crops. This paper addresses the need for a fast, efficient, and accurate automatic image cropping system that overcomes these limitations.

Methods

The core of this work is the LA2C (Lightweight Auto-Crop) method, which leverages a deep reinforcement learning approach, specifically the Advantage Actor-Critic (A2C) algorithm. The image cropping process is modeled as a Markov Decision Process (MDP), where an "agent" interacts with an "environment."

  • Agent: The agent's "brain" is a policy network built upon a pre-trained MobileNetV2 model. MobileNetV2 is chosen for its efficiency in feature extraction, making the overall system lightweight. This network takes the current image observation and outputs probabilities for nine possible actions: four for expanding the crop, four for zooming out, and one for terminating the cropping process.
  • Environment: The environment receives the agent's chosen action, applies the crop to the image, and returns a new "observation" (the cropped image) along with a reward.
  • Reward Function: A key innovation is the abandonment of subjective aesthetic scores as rewards. Instead, LA2C uses the Intersection over Union (IOU) value between the predicted crop and a ground truth bounding box as the primary reward signal. This provides a more objective and quantifiable measure of cropping quality. The reward is positive if the IOU increases and negative if it decreases, encouraging the agent to find better crops.
  • Action Space: The action space is simplified to basic cropping adjustments and a termination action, allowing the agent to learn when to stop cropping.
  • Parallel Environments: To accelerate training, the authors employ multiple parallel environments (16 in their setup) that run independently and interact with the same agent, allowing for synchronized updates.

Datasets

The paper evaluates its method on two publicly available datasets:

  • CUHK-ICD: This dataset contains images with ground truth crops provided by multiple annotators, allowing for evaluation of cropping accuracy and consistency.
  • Flickr Cropping Dataset (FCD): This dataset features images with manually defined "callout boxes," which are used to calculate cropping accuracy.

Key Insights and Ideas

  • IOU as a Reward: Shifting from subjective aesthetic scores to objective IOU values as the reward signal is a crucial insight. This makes the learning process more stable and directly optimizes for accurate cropping.
  • Lightweight Architecture: Utilizing a pre-trained MobileNetV2 for feature extraction significantly reduces computational overhead, making the system efficient and suitable for real-time applications.
  • Sequential Decision-Making: Framing cropping as a sequential decision-making problem allows the agent to learn a policy for iteratively refining the crop, rather than relying on a single-shot prediction or exhaustive search.
  • Efficiency Gains: The combination of a lightweight architecture and a focused reward signal leads to a substantial reduction in cropping steps and time compared to previous methods.

Key Results

The LA2C method demonstrates strong performance across both datasets:

  • FCD Dataset: LA2C outperforms existing methods like RankSVM-DECAF, VFN+SW, and A2-RL in terms of average IOU, average displacement error, average steps, and average cropping time. Notably, it achieves a significant reduction in cropping steps (an average of 5.6 times fewer) and a notable speedup in cropping time.
  • CUHK-ICD Dataset: LA2C performs comparably to the A2-RL method, indicating its effectiveness in achieving high-quality crops.

Limitations and Future Work

The authors acknowledge several limitations:

  • Lack of Explicit Aesthetic Knowledge: The current model learns cropping solely from data, without explicit integration of professional photography or aesthetic principles. This might lead to crops that differ from human aesthetic preferences.
  • Positive Sample Bias: The training data primarily consists of positive samples, meaning the model doesn't explicitly learn from "bad" or non-aesthetic crops.

Future work directions include:

  • Integrating Aesthetic Knowledge: Exploring ways to incorporate professional photography and aesthetic knowledge into the model's learning process.
  • Quantifying Aesthetic Quality: Developing better methods to quantify and evaluate image aesthetic quality for improved model learning.
  • Video Cropping: Extending the method to automatic video cropping and composition.

Summary updated

BibTeX
@inproceedings{liu2021lightweight,
  author = {Kunxiang Liu and Shaoqiang Zhu and Junsong Zhang},
  title = {{A Lightweight Auto-Crop Based on Deep Reinforcement Learning}},
  booktitle = {ATAIT},
  year = {2021},
  url = {https://openreview.net/forum?id=ZinWZziKyq},
}
Figure