As part of my Major ProjeI developed a few-shot concept unlearning algorithm for the Stable Diffusion v2 model using Low-Rank Adaptation (LoRA), enabling effective unlearning with as few as five images and reducing the unlearning time to approximately one minute. The approach involved selective fine-tuning of the text encoder’s final layers while freezing gradients for the remaining components, optimizing for minimal retain loss and maximal forget loss. I also designed a custom loss function that combined image reconstruction loss, forget/retain embedding losses, and perturbation normalization, which was backpropagated over five training epochs to ensure efficient and targeted unlearning.
Flowchart explaining the whole approach of Few-Shot Unlearning of concepts from Stable Diffusion v2