Abstract
Pretrained diffusion models, such as Stable Diffusion, have demonstrated an extraordinary grasp of visual semantics. This paper explores how to "talk" to these models to extract semantically consistent keypoints from images without any manual labels. By optimizing text embeddings to produce localized cross-attention maps, the proposed method, StableKeypoints, outperforms existing unsupervised techniques, particularly on challenging, unaligned "in-the-wild" data.
Introduction
Identifying keypoints—specific landmarks like a bird's beak or human joints—is a fundamental task in computer vision. While supervised models excel at this, they rely on thousands of meticulously labeled images, which are costly and often subjective to produce. Existing unsupervised methods frequently fail when images are not perfectly centered or cropped. StableKeypoints addresses this by leveraging the inherent semantic knowledge within frozen text-to-image diffusion models to find robust keypoints across diverse, uncurated datasets.
Methodology: StableKeypoints
The core of the approach lies in the cross-attention maps of diffusion models. During image generation, these maps determine which pixels correspond to specific text tokens. The StableKeypoints pipeline optimizes a set of learnable text embeddings through several key steps:
- Token Optimization: Randomly initialized "text embeddings" are updated to influence the model's internal attention.
- Localization Loss: Embeddings are optimized so their cross-attention maps appear as tight, compact Gaussian blobs, forcing each token to focus on a specific image region.
- Equivariance Loss: To ensure robustness, the method enforces that keypoints move consistently with image transformations like rotation or scaling.
- Selection: After optimization, Furthest Point Sampling (FPS) is used to select a final set of $K$ keypoints that provide optimal coverage of the object.
Experimental Results
StableKeypoints was evaluated across five diverse benchmarks, including CelebA (faces), CUB-200-2011 (birds), and Tai-Chi-HD (human poses).
Performance in the Wild
The method shows significant gains on unaligned data. On the CUB dataset, it achieved a normalized error of 5.4, nearly doubling the accuracy of the previous best unsupervised method (11.3). In some cases, such as the Tai-Chi-HD pose task, it even outperformed supervised baselines.
Data Efficiency and Generalization
A key advantage is extreme data efficiency; the model can learn effective keypoints from as few as 30 images. Furthermore, keypoints learned on one dataset (e.g., Tai-Chi dancers) can generalize to entirely different datasets (e.g., Human3.6m) without further optimization.
Discussion and Limitations
The primary insight is that pretrained diffusion models already "know" the semantic structure of the world. We simply need to find the mathematical "word" (embedding) that triggers the model's internal focus on specific features.
However, limitations remain. The optimization process is computationally demanding, taking approximately two hours on a high-end GPU per dataset. Additionally, while the points are stable, the method does not guarantee exhaustive coverage of all human-interest points. Performance is also inherently tied to the breadth of the underlying diffusion model's pretraining.
Conclusion
StableKeypoints demonstrates that the deep semantic priors in diffusion models can be successfully harvested for unsupervised landmark discovery. This approach provides a robust, label-free alternative for keypoint estimation in complex, uncurated environments.
Summary updated