Home  >  Article  >  Technology peripherals  >  The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

王林
王林forward
2023-04-10 10:21:081508browse

In recent years, multimodal learning has received attention, especially in the two directions of text-image synthesis and image-text contrastive learning. Some AI models have attracted widespread public attention due to their application in creative image generation and editing, such as the text image models DALL・E and DALL-E 2 launched by OpenAI, and NVIDIA's GauGAN and GauGAN2.

Not to be outdone, Google released its own text-to-image model Imagen at the end of May, which seems to further expand the boundaries of caption-conditional image generation.

The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

Given just a description of a scene, Imagen can generate high-quality, high-resolution images, regardless of whether the scene makes sense in the real world. The following figure shows several examples of Imagen text-generated images, with corresponding subtitles displayed below the image.

The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

These impressive generated images make you wonder: How does Imagen work?

Recently, developer lecturer Ryan O'Connor wrote a long article "How Imagen Actually Works" on the AssemblyAI blog, explaining in detail the working principle of Imagen, giving an overview of Imagen, analyzing and understanding its High-level components and the relationships between them.

Overview of Imagen's working principle

In this part, the author shows the overall architecture of Imagen and gives a high-level explanation of other working principles; and then analyzes each of Imagen's features more thoroughly in turn. components. The following animation shows the workflow of Imagen.

The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

First, input the subtitles into the text encoder. This encoder converts text subtitles into numerical representations that encapsulate semantic information in the text. The text encoder in Imagen is a Transformer encoder, which ensures that the text encoding understands how the words in the subtitles relate to each other, using self-attention methods.

If Imagen only focuses on individual words rather than the associations between them, although high-quality images capable of capturing individual elements of subtitles can be obtained, describing these images cannot reflect the subtitle semantics in an appropriate manner. As shown in the example below, if the association between words is not considered, a completely different generation effect will occur.

The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

Although the text encoder generates a useful representation for Imagen's subtitle input, a method still needs to be devised to generate images that use this representation, that is, Image Generator. To do this, Imagen uses the diffusion model, a generative model that has gained popularity in recent years thanks to its SOTA performance on multiple tasks.

The diffusion model destroys the training data by adding noise to achieve training, and then learns to recover the data by reversing this noise process. Given an input image, the diffusion model will iteratively corrupt the image with Gaussian noise over a series of time steps, eventually leaving Gaussian noise or TV static. The following figure shows the iterative noise process of the diffusion model:

The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

The diffusion model will then work backwards, learning how to isolate and eliminate the noise at each time step, canceling out what just happened the destruction process. After training is complete, the model can be split into two. In this way, you can start from randomly sampling Gaussian noise and use a diffusion model to gradually denoise to generate an image, as shown in the following figure:

The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

Подводя итог, можно сказать, что обученная модель диффузии начинается с гауссовского шума, а затем итеративно генерирует изображения, аналогичные обучающим изображениям. Очевидно, что нет никакого контроля над фактическим выводом изображения: просто введите в модель гауссов шум, и она выведет случайное изображение, которое выглядит так, как будто оно принадлежит набору обучающих данных. Однако

цель состоит в том, чтобы создать изображения, которые инкапсулируют семантическую информацию субтитров, входящую в Imagen, поэтому необходим способ включения субтитров в процесс распространения

. Как это сделать? Как упоминалось выше, кодировщик текста создает репрезентативную кодировку субтитров, которая на самом деле представляет собой векторную последовательность. Чтобы внедрить эту закодированную информацию в модель диффузии,

эти векторы объединяются вместе, и модель диффузии

корректируется на их основе. Регулируя этот вектор, модель диффузии учится настраивать процесс шумоподавления для создания изображений, которые хорошо соответствуют субтитрам. Визуализация процесса показана ниже: The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

Поскольку генератор изображений или базовая модель выводит небольшое изображение размером 64x64, чтобы повысить частоту этой модели до окончательной версии 1024x1024,

Интеллектуальное повышение разрешения изображений с использованием моделей сверхвысокого разрешения

.

Для модели сверхвысокого разрешения Imagen снова использует модель диффузии. Общий процесс в основном такой же, как и в базовой модели, за исключением того, что он настраивается исключительно на основе кодирования субтитров, а также с повышением разрешения изображений меньшего размера. Визуализация всего процесса выглядит следующим образом: The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

Вывод этой модели со сверхвысоким разрешением на самом деле не является конечным результатом, а изображением среднего размера

. Чтобы масштабировать это изображение до окончательного разрешения 1024x1024, используется другая модель сверхвысокого разрешения. Две архитектуры сверхвысокого разрешения примерно одинаковы, поэтому они не будут описываться снова. Результат второй модели сверхвысокого разрешения является окончательным результатом Imagen.

Почему Imagen лучше, чем DALL-E 2?

Точно ответить, почему Imagen лучше, чем DALL-E 2, сложно. Однако значительная часть разницы в производительности связана с различиями в субтитрах и репликах. DALL-E 2 использует контрастные цели, чтобы определить, насколько тесно текстовые кодировки связаны с изображениями (по сути, CLIP). Кодеры текста и изображения корректируют свои параметры таким образом, чтобы косинусное подобие аналогичных пар субтитр-изображение было максимальным, в то время как косинусное подобие несходных пар субтитр-изображение было минимизировано.

Значительная часть разницы в производительности связана с тем, что текстовый кодер Imagen намного больше и обучен на большем количестве данных, чем текстовый кодер DALL-E 2. В качестве доказательства этой гипотезы мы можем изучить производительность Imagen при масштабировании кодировщика текста. Вот кривая Парето для производительности Imagen: The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen

Эффект от масштабирования текстовых кодировщиков на удивление высок, тогда как эффект от масштабирования U-Net на удивление низок. Этот результат показывает, что относительно простые модели диффузии могут давать высококачественные результаты, если они обусловлены строгим кодированием.

Учитывая, что текстовый кодер T5 намного больше, чем текстовый кодер CLIP, а также тот факт, что данные для обучения естественному языку обязательно богаче, чем пары «изображение-подпись», большая часть разницы в производительности, вероятно, связана с этой разницей. .

###Кроме того, автор также перечисляет несколько ключевых моментов Imagen, в том числе следующие: ###
  • Расширение кодировщика текста очень эффективно;
  • Расширение кодировщика текста более важно, чем увеличение размера U-Net;
  • Динамическое пороговое определение имеет решающее значение;
  • Улучшение условий шума имеет решающее значение в моделях сверхвысокого разрешения;
  • Очень важно использовать перекрестное внимание для обработки текста;
  • Эффективная U-Net имеет решающее значение.

Эти идеи дают ценные указания для исследователей, работающих над моделями диффузии, которые полезны не только в области преобразования текста в изображение.

The above is the detailed content of The powerful combination of diffusion + super-resolution models, the technology behind Google’s image generator Imagen. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:51cto.com. If there is any infringement, please contact admin@php.cn delete