Abstract
Image outpainting involves extending the visual content of an image beyond its original borders while maintaining structural and stylistic coherence. Traditional methods based on Convolutional Neural Networks (CNNs) often fail to capture long-range dependencies, while pure Vision Transformers (ViTs) suffer from slow convergence and boundary artifacts. We introduce QueryOTR (Query Outpainting TRansformer), a hybrid framework that treats outpainting as a patch-wise sequence-to-sequence task. By incorporating a Query Expansion Module (QEM) to accelerate training and a Patch Smoothing Module (PSM) to eliminate patch artifacts, QueryOTR achieves state-of-the-art results in both realism and efficiency.
Introduction
The task of image extrapolation, or outpainting, requires a model to "imagine" a plausible continuation of a scene. This is challenging because the generated content must align perfectly with the existing pixels in terms of texture, lighting, and global structure.
CNN-based approaches are limited by their local receptive fields, often losing global context in large-scale extrapolations. Conversely, Transformers excel at global modeling but are computationally expensive to train from scratch and frequently produce "checkerboard" artifacts due to their discrete patch-based processing. QueryOTR addresses these issues by combining the strengths of both architectures.
Methods
QueryOTR utilizes a hybrid encoder-decoder architecture. The encoder processes known image patches, while the decoder generates predicted patches for the surrounding areas.
Query Expansion Module (QEM)
To overcome the slow convergence of standard Transformers, the QEM uses stacked CNN blocks to initialize queries based on the encoder's features. This provides a "warm start" for the transformer decoder, significantly reducing training time. As shown in the training loss curves, the QEM leads to much faster and more stable convergence.
Patch Smoothing Module (PSM)
To resolve the boundary artifacts typical of patch-based generation, the authors introduce overlapping patches. The PSM re-allocates and averages these overlapping regions, ensuring smooth transitions between generated content and the original image, effectively removing visible seams.
Results
The model was rigorously tested on Scenery, Building Facades, and WikiArt datasets.
Quantitative Performance
QueryOTR outperformed existing models like NSIPO and Uformer, achieving the lowest Fréchet Inception Distance (FID) and highest Inception Score (IS). Notably, the inclusion of QEM resulted in a 3.3x speedup in training convergence. Inference is also highly efficient, clocking in at approximately 13.3ms per image.
Qualitative Analysis
Visual evaluations demonstrate that QueryOTR maintains superior geometric consistency in architectural scenes and realistic textures in natural landscapes compared to CNN-only baselines. The model is capable of recursive outpainting, extending the frame multiple times while preserving the core artistic or structural style.
Conclusion
QueryOTR demonstrates that the inductive biases of CNNs can be effectively leveraged to enhance the training and output quality of Vision Transformers for image outpainting. By treating the problem as a sequence-to-sequence task with hybrid query initialization, the model achieves a balance of global consistency and local smoothness. Future work will explore integrating explicit semantic layouts to further improve the logical structure of generated environments.
Summary updated