A Quaternion-Valued Variational Autoencoder

Eleonora Grassucci, Danilo Comminiello, Aurelio Uncini

Abstract

Traditional Variational Autoencoders (VAEs) often struggle to capture the complex inter-channel correlations inherent in multidimensional data like RGB images. This paper introduces the Quaternion-Valued Variational Autoencoder (QVAE), a novel architecture that operates entirely within the quaternion domain. By leveraging quaternion algebra and the concept of "Q-properness," the QVAE achieves superior reconstruction and generative quality on the CelebA dataset while utilizing significantly fewer parameters than its real-valued counterparts.

Introduction

Standard deep generative models typically treat multidimensional features—such as the red, green, and blue channels of a pixel—as independent entities or flatten them into long vectors. This approach often ignores the latent inter-dependencies between color channels, leading to sub-optimal representations and high parameter redundancy.

The researchers address two primary challenges in generative modeling:

  1. Structural Loss: Real-valued convolutions lack an inherent mechanism to recognize that specific channels belong together as a single structural unit.
  2. Parameter Inefficiency: Maintaining high generative quality usually requires deep, memory-intensive networks.

Methodology

The QVAE shifts the underlying mathematical framework from real-valued algebra to quaternion algebra ($\mathbb{H}$). A quaternion is a four-dimensional number represented as $q = q_a + q_b\mathbf{i} + q_c\mathbf{j} + q_d\mathbf{k}$. For RGB images, the three color channels are mapped to the imaginary components, while the fourth component can represent transparency or be set to zero.

The Hamilton Product

At the heart of the QVAE is the Hamilton product, which replaces standard matrix multiplication in convolutional layers. Unlike real-valued convolutions that process channels as separate stacks, the Hamilton product allows the network to learn the relationships between components. This enables the model to capture how the Red channel correlates with Green and Blue, preserving the internal structure of the data.

Q-Properness and Latent Statistics

The authors introduce "Q-properness" to the VAE latent space. In signal processing, a quaternion random variable is considered "proper" if its components are uncorrelated in a specific, symmetrical way. By assuming the latent variables follow a Q-proper Gaussian distribution, the researchers derived a mathematically grounded, quaternion-specific Kullback-Leibler (KL) divergence loss. This is the first time augmented quaternion second-order statistics have been exploited in a deep learning generative model.

Experimental Results

The model was evaluated using the CelebFaces Attributes Dataset (CelebA), with images scaled to $64 \times 64$ pixels. The QVAE was compared against a standard real-valued VAE of similar depth.

Quantitative Performance

Despite its reduced size, the QVAE outperformed the baseline VAE across all key metrics:

  • Parameter Efficiency: The QVAE used only 1.4 million parameters, a ~62% reduction compared to the VAE’s 3.7 million.
  • Reconstruction Quality: The QVAE achieved a higher SSIM (0.8941 vs. 0.8492) and a lower MSE (0.0031 vs. 0.0047).
  • Generative Realism: The Fréchet Inception Distance (FID), which measures the realism of generated samples, was significantly better for the QVAE (175.7) than the VAE (195.7).

Qualitative Analysis

Visual comparisons highlight the QVAE's ability to maintain structural integrity. While the standard VAE often produced blurry results in complex areas like hair and backgrounds, the QVAE maintained sharper contours and more realistic textures.

Comparison of original images against reconstructions from standard VAE and the proposed QVAE. Note the improved clarity in the QVAE row.

In terms of sample generation, the QVAE demonstrated a more coherent understanding of facial features and lighting, attributed to the Hamilton product's ability to capture long-range correlations.

Comparison of generated samples from a standard VAE (top) and the QVAE (bottom).

Conclusion and Future Work

The QVAE demonstrates that quaternion-valued networks are not only more parameter-efficient but also more structurally aware than traditional real-valued networks. By baking the relationships between data channels into the algebra itself, the model achieves higher fidelity with less than half the memory footprint.

Future research directions include:

  • Hierarchical Architectures: Integrating quaternion convolutions into more complex frameworks like NVAE.
  • Improper Distributions: Exploring "improper" quaternion distributions where latent components have more complex, asymmetrical correlations.
  • Hardware Optimization: Addressing the computational overhead of the Hamilton product to improve training speeds on standard GPUs.

Summary updated

BibTeX
@inproceedings{grassucci2021quaternion,
  author = {Eleonora Grassucci and Danilo Comminiello and Aurelio Uncini},
  title = {{A Quaternion-Valued Variational Autoencoder}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2021},
  doi = {10.1109/icassp39728.2021.9413859},
}
Figure