{"url":"/method/wipa","slug":"wipa","name":"WIPA","full_name":"Wavelet-integrated Identity Preserving Adversarial Network for face super-resolution","full_name_withheld":false,"description_markdown":"# WIPA: Wavelet-integrated, Identity Preserving, Adversarial network for Face Super-resolution\r\nPytorch implementation of WIPA: Super-resolution of very low-resolution face images with a **W**avelet Integrated, **I**dentity **P**reserving, **A**dversarial Network. \r\n# Paper:\r\n[Super-resolution of very low-resolution face images with a Wavelet Integrated, Identity Preserving, Adversarial Network](https://www.sciencedirect.com/science/article/abs/pii/S0923596522000753?dgcid=coauthor).\r\nYou can download the pre-proof version of the article [here](https://drive.google.com/file/d/1GHWiCcScPF1PK4xozoRf-88Rytom-kvl/view?usp=sharing) but  please refer to the origital manuscript for citation.\r\n## Citation\r\nIf you find this work useful for your research, please consider citing our paper:\r\n```\r\n@article{DASTMALCHI2022116755,\r\ntitle = {Super-resolution of very low-resolution face images with a wavelet integrated, identity preserving, adversarial network},\r\njournal = {Signal Processing: Image Communication},\r\nvolume = {107},\r\npages = {116755},\r\nyear = {2022},\r\nissn = {0923-5965},\r\ndoi = {https://doi.org/10.1016/j.image.2022.116755},\r\nurl = {https://www.sciencedirect.com/science/article/pii/S0923596522000753},\r\nauthor = {Hamidreza Dastmalchi and Hassan Aghaeinia},\r\nkeywords = {Super-resolution, Wavelet prediction, Generative Adversarial Networks, Face Hallucination, Identity preserving, Perceptual quality},\r\n```\r\n## Linkdin Profile:\r\n**Hamidreza Dastmalchi linkdin profile:**\r\nhttps://www.linkedin.com/in/hamidreza-dastmalchi-80bb4574/\r\n## WIPA Algorithm\r\nwe present **Wavelet\r\nPrediction blocks** attached to a **Baseline CNN network** to predict wavelet missing details of facial images. The\r\nextracted wavelet coefficients are concatenated with original feature maps in different scales to recover fine\r\ndetails. Unlike other wavelet-based FH methods, this algorithm exploits the wavelet-enriched feature maps as\r\ncomplementary information to facilitate the hallucination task. We introduce a **wavelet prediction loss** to push\r\nthe network to generate wavelet coefficients. In addition to the wavelet-domain cost function, a combination of\r\n**perceptual**, **adversarial**, and **identity loss** functions has been utilized to achieve low-distortion and perceptually\r\nhigh-quality images while maintaining identity. The training scheme of the Wavelet-Integrated network with the combination of five loss terms is shown as below:\r\n<p align=\"center\">\r\n  <img width=\"500\" src=\"./block-diagram/WIPA-Training-Scheme.jpg\">\r\n</p>\r\n\r\n## Datasets\r\nThe [Celebrity dataset](https://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) used for training the proposed FH algorithm. The database contains more than 200 K different face images under significant pose, illumination, and expression variations. In our experiment, two distinct groups of 20 thousand images are randomly selected from the CelebA dataset as our train and test dataset. In order to test the generalizing capacity of the method, we have further evaluated the performance of the proposed approach on [FW](http://vis-www.cs.umass.edu/lfw/) and [Helen dataset](http://www.ifp.illinois.edu/~vuongle2/helen/) too. All the testing and training images are roughly aligned using similarity transformation with landmarks detected by the well-known MTCNN network. The images are rescaled to the size of 128 × 128. The corresponding LR images are also constructed by down-sampling the HR images using bicubic interpolation. The experiments are accomplished in two different **scaling** factors of 8X and 16X with LR images of size 16 × 16 and 8 × 8, respectively.\r\n **Before starting to train or test the network**, you must put the training images in the corresponding folders:\r\n- Put training images in “.\\data\\train” directory.\r\n- Put celeba test images in “.\\data\\test\\celeba” , lfw test images in “.\\data\\test\\lfw” and helen test images in “.\\data\\test\\helen”.\r\n\r\n## Pretrained Weights\r\nThe pretrained weights can be downloaded [here](https://drive.google.com/drive/folders/18V1kPDHW6F05L0xOOODNHZHO566SA6iC?usp=sharing).\r\n\r\n## Code\r\nThe codes are consisted of two main files: the **main.py** file for training the network and the **test.py** file for evaluating the algorithm with different metrics like PSNR, SSIM and verification rate.\r\n### Training \r\nTo train the network, simply run this code in Anaconda terminal:\r\n```\r\n>>python main.py\r\n```\r\nWe designed different input arguments for controlling the training procedure. Please use --help command to see the available input arguments. \r\n\r\n#### Example: \r\nFor example, to train the wavelet-integrated network through GPU with scale factor of 8, without having pre-trained model coefficients, with learning rate of 5e-5, you can simply run the following code in the terminal:\r\n```\r\npython main.py –scale 8 –wi_net “” –disc_net “” –wavelet_integrated True –lr 0.00005\r\n```\r\n\r\n### Testing\r\nfor evaluating (testing), simply run the following code in terminal:\r\n```\r\n>>python test.py\r\n```\r\nWe have also developed different options as input arguments to control the testing procedure. You can evaluate psnr, ssim, fid score and also verification rate by the “test.py” file. To do this, you have to put the test images in the corresponding folders in data root at first.\r\n\r\n#### Example: \r\nFor example, to evaluate the psnr and ssim of a wavelet-integrated pretrained model in scale of 8 and save the super-resolved results in folder of “./results/celeba”, you can write the following code in the command window:\r\n```\r\n>> test.py --wavelet_integrated True --scale 8 --wi_net gen_net_8x --save_flag True --save_folder ./results/celeba --metrics psnr ssim\r\n```\r\nTo estimate the fid score, you have to produce the super-resolved test images first. Therefore, if you have not generated the super-resolved images, you have to call –metrics psnr ssim with fid simultaneously. You can also add the acc option to the metrics to evaluate the verification rate of the model:\r\n```\r\n>>python test.py --wavelet_integrated True --scale 8 --wi_net gen_net_8x --save_flag True --save_folder ./results/celeba --metrics psnr ssim fid acc\r\n```\r\n### Demo \r\nIn addition, we have developed a “demo.py” python file to demonstrate the results of some sample images in the “./sample_images/gt” directory. To run the demo file, simply write the following code in the terminal:\r\n```\r\n>>python demo.py\r\n```\r\nBy default, the images of “./sample_images/gt” folder will be super-resolved by the wavelet-integrated network by a scale factor of 8 and the results will be saved in the “./sample_images/sr” folder. To change the scaling factor, one must alter not only the –scale option but also the corresponding –wi_net argument to import the relevant pretrained state dictionary.","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":null,"title":null,"url_on_a_paper_host":false},"code_snippet_url":"https://github.com/hamidreza-dastmalchi/WIPA-Face-Super-Resolution","code_snippet_url_on_a_code_host":true,"categories":[{"area":"Computer Vision","area_id":"computer-vision","collection":"Face Restoration Models","url":"/methods/category/face-restoration-models","pwc_aliases":[]}],"n_papers_tagged":0,"archive_num_papers":0,"papers_newest_first":[],"papers_shown":0,"tasks":[],"tasks_shown":0,"n_tasks":0,"usage_by_year":[],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/wipa"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}