Orthogonal Jacobian Regularization for Unsupervised Disentanglement in Image Generation

Yuxiang Wei, Yupeng Shi, Xiao Liu, Zhilong Ji, Yuan Gao, Zhongqin Wu, Wangmeng Zuo

Abstract

Unsupervised disentanglement in generative models aims to map independent factors of variation to distinct latent dimensions without manual labels. We introduce Orthogonal Jacobian Regularization (OroJaR), a method that encourages orthogonality between Jacobian vectors of the output with respect to different latent dimensions. Unlike previous pixel-wise approaches, OroJaR captures spatially correlated variations holistically. Our experiments demonstrate that OroJaR consistently outperforms state-of-the-art methods like SeFa and Hessian Penalty across various benchmarks, including CLEVR and ImageNet, discovering precise and interpretable directions for factors like rotation, zoom, and color.

Introduction

In a perfectly disentangled generative model, modifying a single dimension of the input latent code should result in a change to exactly one physical characteristic of the generated image—such as hair color or object rotation—while leaving others untouched. Achieving this without supervision remains a significant challenge.

Existing approaches often fall short. For instance, SeFa is limited to post-processing the first layer of pre-trained models. The Hessian Penalty attempts to diagonalize the output's Hessian matrix but does so pixel-wise, treating every entry independently. This localized focus struggles with spatially correlated variations, where complex changes involve many pixels moving in concert, such as 3D pose shifts or object translation.

The OroJaR Framework

The core of Orthogonal Jacobian Regularization (OroJaR) lies in the Jacobian matrix. For a generator $G(z)$, the Jacobian vector for a specific latent dimension $z_i$ represents the gradient of the entire output image with respect to that dimension.

Orthogonality as Disentanglement

OroJaR posits that if two latent dimensions $z_i$ and $z_j$ are truly disentangled, the "directions of change" they induce in the output space should be orthogonal. By enforcing this constraint, the model learns to isolate global, spatially correlated factors of variation.

Efficiency and Versatility

To overcome the computational cost of full Jacobian calculations, OroJaR utilizes a first-order finite difference approximation combined with Hutchinson’s estimator. This makes the regularization efficient enough for standard GAN training. OroJaR can be integrated as a loss term during training or used to identify interpretable directions in pre-trained models like BigGAN.

Experimental Results

The researchers evaluated OroJaR on several benchmarks, including Edges+Shoes, various CLEVR configurations, Dsprites, and ImageNet.

Qualitative Comparison

On synthetic datasets like CLEVR, OroJaR demonstrates superior separation of factors. While competing methods often entangle color with shape or position, OroJaR maintains clean boundaries between these attributes.

Comparison of SeFa, Hessian Penalty, and OroJaR on a synthetic dataset showing disentangled factors like axis movement, shape, and color.

Scalability to Real-World Data

When applied to BigGAN pre-trained on ImageNet, OroJaR successfully discovers highly precise directions for complex variations. As shown in the figures below, it isolates "zoom," "rotate," and "color" more effectively than baseline methods.

Qualitative results on BigGAN (ImageNet) showing discovered directions for rotation, zoom, and color for golden retriever and church classes.

Quantitative Performance

OroJaR consistently achieved the highest Variation Predictability (VP) scores, indicating that latent factors were more distinct. It also improved Perceptual Path Length (PPL), suggesting a smoother and more stable latent space.

Key Insights

  • Indirect Hessian Diagonalization: Mathematically, forcing Jacobian vectors to be orthogonal indirectly encourages the Hessian matrix to be diagonal, making OroJaR a more holistic extension of the Hessian Penalty.
  • Generalizing SeFa: OroJaR can be viewed as an end-to-end generalization of SeFa, applying its benefits across the entire network architecture rather than just the first layer.
  • Automatic Dimension Deactivation: OroJaR can "turn off" redundant latent dimensions. If the latent space exceeds the true factors of variation, the regularization encourages extra dimensions to have zero impact, effectively discovering the data's intrinsic dimensionality.

Conclusion

OroJaR provides a simple yet powerful mechanism for unsupervised disentanglement. While currently focused on GANs and requiring some hyperparameter tuning, its ability to handle spatially correlated variations marks a significant step forward. Future work may extend this framework to other generative architectures like Variational Autoencoders (VAEs).

Summary updated

BibTeX
@inproceedings{wei2021orthogonal,
  author = {Yuxiang Wei and Yupeng Shi and Xiao Liu and Zhilong Ji and Yuan Gao and Zhongqin Wu and Wangmeng Zuo},
  title = {{Orthogonal Jacobian Regularization for Unsupervised Disentanglement in Image Generation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.00665},
}
Figure