liveBook · Manning

LPIPS

As explained in Build a Text-to-Image Generator (from Scratch)

LPIPS is a learned perceptual image similarity metric that compares images using features extracted by pretrained neural networks.

LPIPS is a perceptual image-similarity metric that compares learned features from pretrained neural networks rather than raw pixel differences, aligning more closely with human judgments of visual quality. section 11.4.2

LPIPS fits into image reconstruction in two stages:

  • A pretrained network such as VGG or AlexNet extracts features from real and generated images. section 11.4.2
  • Feature differences provide a perceptual reconstruction loss that complements adversarial and quantization losses. section 11.4.2

VQGAN reconstruction

In VQGAN, LPIPS helps ensure that decoded images resemble their originals perceptually, while adversarial training encourages realistic appearance and quantization keeps encoder outputs near codebook vectors. section 11.4.2

Figure 11.6 VQGAN architecture and training process in which VQGAN combines a VQ-VAE generator with a discriminator in a GAN framework
A diagram of a fish

AI-generated content may be incorrect.

Trace LPIPS's role as the perceptual reconstruction component within the VQ-VAE generator and discriminator training process. section 11.4.2

How Build a Text-to-Image Generator (from Scratch) covers it

How deep it goes
Explains feature-based perceptual comparison and its loss role, without detailing the metric's formula or implementation.
Examples
Uses VGG and AlexNet features and VQGAN image reconstruction as concrete examples.
What you can do after
Apply LPIPS as a perceptual reconstruction-loss component when training VQGANs.
How it connects
Connects perceptual loss with VQGAN, VQ-VAE, GAN training, reconstruction loss, adversarial loss, and quantization loss.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Text-to-Image Generator (from Scratch). The section links point to the parts of the book it draws on.