Pixel-wise RL on Diffusion Models
Mo Kordzanganeh, Danial Keshvary, and Nariman Arian
Solofied Limited
Abstract
Results
We performed three sets of experiments to determine how well PXPO works:
- Preference-based manual human feedback on a single image
- Segmentation feedback from an AI model
- Colour-channel feedback
Experiment 1: Pixel-wise Human Feedback
In this experiment, Stable Diffusion v1.4 [2] was prompted to generate a nature landscape. Then a human subject was asked to fill in the areas they liked with the colour green (corresponding to a feedback of +2 for each pixel filled) and areas they disliked with red (which was -2). The user decided that they liked the lake and disliked the trees, and filled up the first image accordingly. The model was updated using PXPO based on this single-image feedback, and the process was repeated 15 times, and with each iteration the model improved itself. At the end of this process, the resultant image had significantly more water and fewer trees. The experiment was repeated from scratch, this time the user provided the opposite feedback. This was to ensure the model actually followed instructions. The result, similarly was a significant adaptation of the image to the user's preferences.
Experiment 2: Segmentation Feedback
The human user was replaced with an AI segmentation model (SegFormer clothes [3]) that could detect various categories of human clothes and body parts. The synthesier was prompted to generate portrait of a man on the beach. The SegFormer had to find the person's hair and provide negative feedback in the areas where hair existed. After 160 reward queries, the synthesiser had learned to reduce the possibility of any hair being detected by the SegFormer.
Experiment 3: Colour-channel Feedback
This time, the aim was provide an algorithmic feedback. The model was prompted to generate a red taxi in traffic, and as feedback, each pixel with the colour blue in it was penalised proportionally to the amount of blue present in the image. The model managed to dramatically reduce the colour blue from the images after 1024 reward queries.
References
[1] K. Black, M. Janner, Y. Du, I. Kostrikov, and S. Levine, "Training diffusion models with reinforcement learning" (2024), arXiv:2305.13301 [cs.LG].
[2] R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer, "High-resolution image synthesis with latent diffusion models," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2022) pp. 10684–10695.
[3] M. Dziemian, "mattmdjaga/segformer b2 clothes - hugging face," https://huggingface.co/mattmdjaga/segformer_b2_clothes (2023).