Skip to main content
QUICK REVIEW

[Paper Review] Cones: Concept Neurons in Diffusion Models for Customized Generation

Zhi‐Heng Liu, Ruili Feng|arXiv (Cornell University)|Mar 9, 2023
Neural Networks and ApplicationsComputer Science19 citations
TL;DR

Cones identifies small clusters of concept neurons in diffusion models that control subject-driven generation; by activating or shutting these neurons, multiple subjects can be generated and combined in one image with high robustness and storage efficiency.

ABSTRACT

Human brains respond to semantic features of presented stimuli with different neurons. It is then curious whether modern deep neural networks admit a similar behavior pattern. Specifically, this paper finds a small cluster of neurons in a diffusion model corresponding to a particular subject. We call those neurons the concept neurons. They can be identified by statistics of network gradients to a stimulation connected with the given subject. The concept neurons demonstrate magnetic properties in interpreting and manipulating generation results. Shutting them can directly yield the related subject contextualized in different scenes. Concatenating multiple clusters of concept neurons can vividly generate all related concepts in a single image. A few steps of further fine-tuning can enhance the multi-concept capability, which may be the first to manage to generate up to four different subjects in a single image. For large-scale applications, the concept neurons are environmentally friendly as we only need to store a sparse cluster of int index instead of dense float32 values of the parameters, which reduces storage consumption by 90\% compared with previous subject-driven generation methods. Extensive qualitative and quantitative studies on diverse scenarios show the superiority of our method in interpreting and manipulating diffusion models.

Motivation & Objective

  • Motivate whether diffusion models contain subject-specific concept neurons similar to human concept neurons.
  • Propose a gradient-based method to locate concept neurons that control a given subject.
  • Demonstrate that shutting concept neurons yields the target subject across diverse scenes.
  • Show that concatenating concept neurons enables multi-subject generation and up to four subjects in one image.
  • Demonstrate significant storage savings compared to prior subject-driven generation methods.

Proposed method

  • Define the objective as identifying a small set of neurons in the K-V attention layers whose scaling controls a target subject.
  • Derive a gradient-based criterion for a neuron to be a concept neuron using the concept-implanting loss L_con and its gradients.
  • Propose a self-adaptive sampling procedure to identify concept neurons by analyzing the sign and magnitude of theta * (dL_con/dtheta).
  • Compute a binary concept neuron mask M indicating which neurons are concept neurons and use it to deactivate non-essential parameters.
  • Show that binary, float16, quaternary, and float32 settings yield similar control performance, indicating robustness of concept neurons.
  • Demonstrate additivity by concatenating concept neurons from multiple subjects to generate combined concepts in a single image.

Experimental results

Research questions

  • RQ1Do diffusion models encode subject-specific concept neurons analogous to biological concept neurons?
  • RQ2Can a gradient-based criterion reliably identify a small set of concept neurons governing a given subject?
  • RQ3Is it possible to control generation by shutting concept neurons, and does this preserve prior information?
  • RQ4Can concatenating concept neurons from multiple subjects produce multi-subject generations in a single image?
  • RQ5What are the storage and robustness benefits of using concept neurons for large-scale customized generation?

Key findings

  • Concept neurons exist as small, sparse clusters in the K-V attention layers that dominate the generation of a given subject.
  • Shutting the identified concept neurons draws the outline of the target subject in attention maps and enables subject generation across contexts.
  • Binary (shut) concept neurons perform comparably to higher-precision variants (float32/float16) and even quaternary representations, indicating robustness.
  • Concatenating concept neurons from multiple subjects enables multi-subject generation, and collaborative fine-tuning improves quality for four-subject results.
  • Storage cost is dramatically reduced; concept neurons require about 10% of memory of previous methods, with sparsity enabling int-index storage.
  • The method achieves high text alignment and competitive image alignment, especially as the number of subjects increases, surpassing competing methods in multi-subject scenarios.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.