Enhancing Hierarchical Vector Quantized Autoencoders for Image Synthesis Through Multiple Decoders

Dario Serez, Marco Cristani, Vittorio Murino, Alessio Del Bue, Pietro Morerio

Abstract

Hierarchical Vector Quantized Variational Autoencoders (VQ-VAEs) are powerful tools for discrete image representation but frequently encounter challenges such as codebook collapse, poor explainability, and loss of fine-grained detail at high resolutions. This paper introduces the Multi-Scale (MS) VQ-VAE, an architecture that utilizes multiple decoders to represent images as an additive sum of multi-scale contributions. By decomposing the reconstruction task into discrete scale-specific residuals, the MS-VQVAE significantly reduces codebook collapse and enhances the interpretability of hierarchical layers. Our evaluations on benchmarks like CelebA-HQ and ImageNet show that this approach yields superior reconstruction metrics and provides a more stable framework for high-fidelity image synthesis.

Introduction

Vector Quantized Variational Autoencoders (VQ-VAEs) have become a cornerstone of modern generative modeling, enabling images to be compressed into discrete tokens suitable for sequence modeling with Transformers. While hierarchical extensions like VQ-VAE 2 aim to capture both global structure and local details, they often struggle with three primary issues:

  1. Codebook Collapse: Models frequently ignore large portions of the learned dictionary, leading to inefficient representations.
  2. Lack of Explainability: It is often unclear what specific information is isolated at different levels of the hierarchy.
  3. Reconstruction Quality: Fine details are often sacrificed during compression, particularly at high resolutions.

The Multi-Scale (MS) VQ-VAE addresses these hurdles by adopting a "divide-and-conquer" strategy for image reconstruction.

Methods: The Multi-Scale Architecture

The core innovation of the MS-VQVAE is the use of a separate decoder for each scale in the hierarchy, rather than concatenating latent sequences into a single decoder.

Residual Reconstruction and Targeted Learning

The final image is produced as the sum of individual "contributions" or residuals from each scale (e.g., Coarse + Medium + Fine = Final Image). To ensure that each level of the hierarchy learns the appropriate features, the authors employ targeted learning: Gaussian-blurred versions of the original image serve as ground truths for coarser scales. This forces the initial decoders to focus on global shapes while subsequent decoders specialize in high-frequency details.

The MS-VQVAE reconstructs images by summing contributions from multiple scales, ensuring each layer captures distinct frequency information.

Information Flow and Attention

Information flows "up" the hierarchy by concatenating intermediate sequences from coarser decoders with the latent features of the next scale before quantization. For the synthesis stage, the authors propose local-kernel attention in Transformers, which optimizes memory usage by restricting token attention to relevant spatial neighborhoods.

Experimental Results

The MS-VQVAE was evaluated on ImageNet ($256 \times 256$), CelebA-HQ ($1024 \times 1024$), and FFHQ ($128 \times 128$).

Reconstruction Performance

On the CelebA-HQ dataset at $1024 \times 1024$ resolution, the "Small" MS-VQVAE configuration achieved a Mean Squared Error (MSE) of 0.52 and a Peak Signal-to-Noise Ratio (PSNR) of 32.79. This significantly outperforms the VQ-VAE 2 baseline, which recorded an MSE of 0.60 and a PSNR of 32.18.

Codebook Utilization

A key advantage of the MS-VQVAE is its robustness against codebook collapse. In "Medium" configuration trials on CelebA-HQ, the MS-VQVAE utilized 100% of its codebook across all scales. In contrast, the VQ-VAE 2 baseline collapsed to an average usage of only 48%.

Discussion and Key Insights

The MS-VQVAE's additive structure provides several unique benefits:

  • Forced Utilization: By making the final image a sum of parts, the model is mathematically compelled to use every hierarchical level, solving codebook collapse without complex auxiliary losses.
  • Explainability: The output of each decoder can be visualized independently. Scale 0 typically captures a blurry global structure, while higher scales act as high-pass filters capturing textures like skin pores or hair strands.
  • Early Exit Sampling: During synthesis, the independent decoding of the coarse layer allows for "previews." Users can discard poor global structures before the model invests compute in fine-grained details.

Limitations and Future Work

The primary trade-off for these improvements is an increase in model size. The MS-VQVAE's multi-decoder approach results in a higher parameter count (e.g., 54.3M vs. 2.2M in the "Large" configuration). Future research will explore integrating Perceptual and GAN losses to further sharpen high-frequency details, moving beyond the current $l2$ loss framework.

Summary updated

BibTeX
@inproceedings{serez2023enhancing,
  author = {Dario Serez and Marco Cristani and Vittorio Murino and Alessio Del Bue and Pietro Morerio},
  title = {{Enhancing Hierarchical Vector Quantized Autoencoders for Image Synthesis Through Multiple Decoders}},
  booktitle = {ICIAP},
  year = {2023},
  doi = {10.1007/978-3-031-43153-1\_33},
}
Figure