No Annotations for Object Detection in Art Through Stable Diffusion

Patrick Ramos, Nicolas Gonthier, Selina Khan, Yuta Nakashima, Noa Garcia

Introduction

Object detection is a fundamental task in computer vision, typically powered by large-scale datasets like MS-COCO. However, these models often struggle when applied to the world of art due to the cross-depiction problem: a "dog" in a 17th-century oil painting bears little resemblance to a "dog" in a modern digital photograph.

Furthermore, the "expertise gap" makes annotating art datasets prohibitively expensive. Identifying specific iconographic figures—such as distinguishing between St. Francis and St. Dominic—requires deep domain knowledge. Consequently, art datasets are often small and lack the dense bounding box annotations required for traditional supervised learning. This paper introduces NADA (No Annotations for Detection in Art), a pipeline that leverages the latent knowledge within Stable Diffusion to detect objects in paintings without any bounding box training.

The NADA Pipeline

NADA operates without fine-tuning the underlying generative models, utilizing two primary modules:

  1. Class Proposer: This module identifies the objects present in an image. In a weakly-supervised context, it uses a small MLP trained on image-level labels via CLIP embeddings. In a zero-shot context, it prompts a Vision-Language Model (VLM) like LLaVA to list visible objects.
  2. Class-Conditioned Detector: This core component performs "Stable Diffusion Inversion" (specifically Null-text inversion) to find the noise and prompt that reconstructs the target painting. During this reconstruction, the model generates cross-attention maps—internal representations of which pixels the model "attends to" for specific text tokens (e.g., "unicorn"). These fuzzy heatmaps are then converted into precise bounding boxes using Otsu’s method and watershed segmentation.

Experimental Results

The researchers evaluated NADA on the ArtDL 2.0 and IconArt datasets, which focus on Christian iconography, as well as WikiArt for broader qualitative testing.

Qualitative detection results across various artistic styles and subjects, including mythological creatures and religious symbols.

Key Performance Metrics

  • Weakly-Supervised Success: NADA achieved an AP50 of 45.8 on ArtDL 2.0, surpassing the previous state-of-the-art (41.5) without requiring a traditional detector architecture like Faster R-CNN.
  • Zero-Shot Baseline: The pipeline established the first benchmark for zero-shot detection in art, reaching 21.8 AP50 on ArtDL 2.0. Notably, this zero-shot performance exceeded several older weakly-supervised methods that had access to image-level labels.
  • The "Oracle" Bottleneck: Ablation studies revealed that the detector's potential is significantly higher than its current output. With a perfect "Class Proposer" (the Oracle setting), AP50 on ArtDL 2.0 would rise to 61.3, suggesting that the primary challenge in zero-shot detection is identifying what is in the image rather than where it is located.

Discussion and Insights

The most significant takeaway is that generative models like Stable Diffusion act as implicit detectors. By forcing the model to reconstruct an artwork, researchers can "peek" at its internal attention to localize complex subjects. Stable Diffusion appears to have "baked-in" iconographic knowledge; for example, it can localize St. Sebastian by recognizing the arrows associated with his martyrdom, even without explicit training on those attributes.

Limitations

Despite its success, NADA faces several hurdles:

  • Computational Intensity: Null-text inversion is slow, requiring hundreds of steps per image, which precludes real-time use.
  • VLM Dependency: The detector is only as good as the Class Proposer. If a VLM misidentifies a subject, the detector will accurately localize the wrong class.
  • Prompt Sensitivity: The specific wording of text prompts significantly impacts localization accuracy, highlighting the ongoing importance of prompt engineering.

Conclusion

NADA demonstrates that the internal representations of large-scale generative models can be repurposed for specialized tasks like art history analysis. By bypassing the need for expensive expert annotations, this approach opens new avenues for large-scale digital humanities research and automated archival of artistic heritage.

Summary updated

BibTeX
@inproceedings{ramos2025no,
  author = {Patrick Ramos and Nicolas Gonthier and Selina Khan and Yuta Nakashima and Noa Garcia},
  title = {{No Annotations for Object Detection in Art Through Stable Diffusion}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
  doi = {10.1109/wacv61041.2025.00607},
}
Figure