Eleonora Grassucci, Luigi Sigillo, Aurelio Uncini, and Danilo Comminiello
The official repository is: ispamm/HI2I.
Image-to-image translation (I2I) aims at transferring the content representation from an input domain to an output one, bouncing along different target domains. Recent I2I generative models which gain outstanding results in this task comprise a set of diverse deep networks each with tens of million parameters. Moreover, images are usually three-dimensional being composed of RGB channels and common neural models do not take dimensions correlation into account, losing beneficial information. In this paper, we propose to leverage hypercomplex algebra properties to define lightweight I2I generative models capable of preserving pre-existing relations among images dimensions, thus exploiting additional input information. On manifold I2I benchmarks, we show how the proposed Quaternion StarGANv2 and parameterized hypercomplex StarGANv2 (PHStarGANv2) reduce parameters and storage memory amount while ensuring high domain translation performance and good image quality as measured by FID and LPIPS score.
Model Architecture (from StarGANv2) 🎬
| Model | Params | Storage Mem | Savings | FID Reference | LPIPS Reference | FID Latent | LPIPS Latent | Checkpoint |
|---|---|---|---|---|---|---|---|---|
| StarGANv2 | 87M | 307MB | 0% | 21.24 | 0.24 | 17.16 | 0.25 | Link |
| Quaternion StarGANv2 | 22M | 76MB | 75% | 23.09 | 0.22 | 27.90 | 0.12 | Link |
| PHStarGANv2 n=3 | 29M | 137MB | 67% | 28.11 | 0.29 | 16.63 | 0.33 | Link |
| PHStarGANv2 n=4 | 22M | 76MB | 75% | 24.33 | 0.27 | 16.54 | 0.29 | Link |
First, please install the requirements:
pip install -r requirements.txt
We upload a sample config.json, to run different experiments please edit this file, i.e:
datasetscan be eitherafhqandceleba_hq.num_domainsdepends on the number of domains of the chosen dataset:3forafhq,2forceleba_hq.w_hpfis set to0forafhqsince it does not employ the support network, while is set to1forceleba_hq.lambda_dsis equal to2forafhqand1forceleba_hq.phm=Truefor PHStarGANv2,Falsefor running the real-valued baseline.Nis the hyperparameter for parameterized hypercomplex layers, we testN=2,3,4.seed=777is to reproduce our experiments.
Then, run python main.py. The experiment will be directly tracked on Weight&Biases (we strongly suggest to use W&B!).
Experiments require approximately 80 hours on a single NVIDIA Tesla V100-32GB GPU. For a fast training one can edit the code involving torch.nn.parallel.DistributedDataParallel employing more than one GPU.
Please cite our work if you found it useful:
@inproceedigns{grassucci2022HI2I,
title={Hypercomplex Image-to-Image Translation},
author={Grassucci, Eleonora and Sigillo, Luigi and Uncini, Aurelio and Comminiello, Danilo},
year={2022},
month={July},
booktitle={{IEEE} International Joint Conference on Neural Networks (IJCNN)}
}
Check also:
- Lightweight Convolutional Neural Network by Hypercomplex Parameterization, Under Review, 2021 [Paper] [GitHub].
- Quaternion-Valued Variational Autoencoder, ICASSP, 2021 [Paper] [GitHub].
- An Information-Theoretic Perspective on Proper Quaternion Variational Autoencoders, Entropy, 2021 [Paper] [GitHub].
- Quaternion Generative Adversarial Networks, Generative Adversarial Learning: Architectures and Applications, editors: Dr Roozbeh Razavi-Far, Dr Ariel Ruiz-Garcia, Professor Vasile Palade, Professor Jürgen Schmidhuber, Springer, Jan 2022. [Paper][GitHub].
