mlsanityData to 7 Oct 2026

Detection-Driven Object Count Optimization for Text-to-Image Diffusion Models

arXiv 2408.11721 ↗First posted 21 Aug 2024cs.CV cs.AI cs.GRcited by 4

On the map: Diffusion models → Image generation, text-to-image and editing

Abstract (arXiv)

Accurately controlling object count in text-to-image generation remains a key challenge. Supervised methods often fail, as training data rarely covers all count variations. Methods that manipulate the denoising process to add or remove objects can help; however, they still require labeled data, limit robustness and image quality, and rely on a slow, iterative process. Pre-trained differentiable counting models that rely on soft object density summation exist and could steer generation, but employing them presents three main challenges: (i) they are pre-trained on clean images, making them less effective during denoising steps that operate on noisy inputs; (ii) they are not robust to viewpoint changes; and (iii) optimization is computationally expensive, requiring repeated model evaluations per image. We propose a new framework that uses pre-trained object counting techniques and object detectors to guide generation. First, we optimize a counting token using an outer-loop loss computed on fully generated images. Second, we introduce a detection-driven scaling term that corrects errors caused by viewpoint and proportion shifts, among other factors, without requiring backpropagation through the detection model. Third, we show that the optimized parameters can be reused for new prompts, removing the need for repeated optimization. Our method provides efficiency through token reuse, flexibility via compatibility with various detectors, and accuracy with improved counting across diverse object categories.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in Image generation, text-to-image and editing, one of 14 directions in Diffusion models. Builds on 33 of its 39 references that are in the map. First posted on arXiv 21 Aug 2024.

Builds on

33 of 39 references.

Closest ancestors · 13

Same direction, newest first

  1. 2024Make It Count: Text-to-Image Generation with an Accurate Number of Objects14 Jun
  2. 2024InitNO: Boosting Text-to-Image Diffusion Models via Initial Noise Optimization6 Apr
  3. 2023Counting Guidance for High Fidelity Text-to-Image Synthesis30 Jun
  4. 2023Uni-ControlNet: All-in-One Control to Text-to-Image Diffusion Models25 May
  5. 2023Generating images of rare concepts using pre-trained diffusion models27 Apr
  6. 2023Discriminative Class Tokens for Text-to-Image Diffusion Models30 Mar
  7. 2023Adding Conditional Control to Text-to-Image Diffusion Models10 Feb
  8. 2023Attend-and-Excite: Attention-Based Semantic Guidance for Text-to-Image Diffusion Models31 Jan
  9. 2023GLIGEN: Open-Set Grounded Text-to-Image Generation17 Jan
  10. 2022Null-text Inversion for Editing Real Images using Guided Diffusion Models17 Nov
  11. 2022DreamBooth: Fine Tuning Text-to-Image Diffusion Models for Subject-Driven Generation25 Aug
  12. 2022Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding23 May
1 more
  1. 2022Hierarchical Text-Conditional Image Generation with CLIP Latents13 Apr

Other references · 20

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
  2. 2020Denoising Diffusion Probabilistic Modelscited by 20,851
  3. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,694
  4. 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,185
  5. 2022Classifier-Free Diffusion Guidancecited by 5,717
  6. 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,290
  7. 2022Prompt-to-Prompt Image Editing with Cross Attention Controlcited by 2,409
  8. 2021CLIPScore: A Reference-free Evaluation Metric for Image Captioningcited by 2,388
  9. 2022An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversioncited by 2,231
  10. 2023Zero-1-to-3: Zero-shot One Image to 3D Objectcited by 1,483
  11. 2022Scaling Autoregressive Models for Content-Rich Text-to-Image Generationcited by 1,287
  12. 2023Training Diffusion Models with Reinforcement Learningcited by 939
8 more
  1. 2023Adversarial Diffusion Distillationcited by 741
  2. 2022CogView2: Faster and Better Text-to-Image Generation via Hierarchical Transformerscited by 305
  3. 2022VQGAN-CLIP: Open Domain Image Generation and Editing with Natural Language Guidancecited by 285
  4. 2023Teaching CLIP to Count to Tencited by 194
  5. 2021Learning To Count Everythingcited by 149
  6. 2023CLIP-Count: Towards Text-Guided Zero-Shot Object Countingcited by 82
  7. 2018Learning to Count Objects in Natural Images for Visual Question Answeringcited by 40
  8. 2024AFreeCA: Annotation-Free Counting for Allcited by 12

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 1; 2026: 1.

4 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025CountDiffusion: Text-to-Image Synthesis with Training-Free Counting-Guidance Diffusion
  2. 2025CountSteer: Steering Attention for Object Counting in Diffusion Models
  3. 2025CountCluster: Training-Free Object Quantity Guidance with Cross-Attention Map Clustering for Text-to-Image Generation
  4. 2025T2ICount: Enhancing Cross-modal Understanding for Zero-Shot Counting
  5. 2025Demystifying Numerosity in Diffusion Models -- Limitations and Remedies
  6. 2026Test-Time Training for Robust Text-Guided Open-Vocabulary Object Counting
  7. 2025Text-to-Image Diffusion Models Cannot Count, and Prompt Refinement Cannot Help
  8. 2025CoDi -- an exemplar-conditioned diffusion model for low-shot counting