{"id":13738144,"url":"https://github.com/eveningglow/multitask-CycleGAN","last_synced_at":"2025-05-08T16:32:49.284Z","repository":{"id":201269805,"uuid":"107218848","full_name":"eveningglow/multitask-CycleGAN","owner":"eveningglow","description":"Pytorch implementation of multitask CycleGAN with auxiliary classification loss","archived":false,"fork":false,"pushed_at":"2019-12-28T15:02:28.000Z","size":53006,"stargazers_count":95,"open_issues_count":4,"forks_count":24,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T07:33:52.303Z","etag":null,"topics":["computer-vision","cyclegan","deep-learning","gan","generative-adversarial-network","image-translation","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eveningglow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-10-17T04:42:33.000Z","updated_at":"2024-08-23T04:42:14.000Z","dependencies_parsed_at":"2023-10-19T19:06:36.223Z","dependency_job_id":null,"html_url":"https://github.com/eveningglow/multitask-CycleGAN","commit_stats":null,"previous_names":["eveningglow/multitask-cyclegan"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eveningglow%2Fmultitask-CycleGAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eveningglow%2Fmultitask-CycleGAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eveningglow%2Fmultitask-CycleGAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eveningglow%2Fmultitask-CycleGAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eveningglow","download_url":"https://codeload.github.com/eveningglow/multitask-CycleGAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253105376,"owners_count":21855013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","cyclegan","deep-learning","gan","generative-adversarial-network","image-translation","pytorch"],"created_at":"2024-08-03T03:02:12.349Z","updated_at":"2025-05-08T16:32:49.274Z","avatar_url":"https://github.com/eveningglow.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Multitask-CycleGAN\nImplementation of [CycleGAN : Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks](https://arxiv.org/abs/1703.10593) using __pytorch__. \nFuthermore, this implementation is using __multitask learning with semi-supervised leaning__ which means utilize labels of data. This model converts male to female or female to male.\nFollowing image shows improvements such as facial features(make-up, mustache, beard, etc) and image qualities.\n\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/1.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e original : without semi-supervised learning / improved : with semi-supervised learning\n\n## What are differences with original CycleGAN?\n1. Batch size 1 -\u003e 16\n2. Instance Normalization -\u003e Batch Normalization\n3. Model architecture\n4. Smooth labeling  \n5. __Multitask learning with classification loss (semi-supervised learning)__.\n\n## Effects and Details  \n__1. Increasing Batch Size \u0026 Replacing Instance Norm with Batch Norm__  \nThis change makes the model recognize the difference of hair length between male and female. The generator started to draw or erase hair after applying this change.  \n\n__2. Smooth Labeling \u0026 Model Architecture Change__  \nBasicially, the discriminator easily overwhelms the generator. If it happens, the generator tries to fool the discriminator in an improper way. The balance between discriminator and generator is important for the performance. To solve this problem, smooth labeling is used and model architecture is changed.\n\n__3. No Batch Norm in the First Convolution in Discriminator__  \nDCGAN suggests not to use normalization in the first convolution. If you don't follow this, the generator will make images with range of approximately -0.7 ~ 0.7 instead of -1.0 ~ 1.0, the blurry images.\n\n__4. Semi-Supervised Learning with Classification Loss__  \nDiscriminators need to classify domains not only measure the realism. The weight of classification loss, cls_lambda is 1 for training the discriminators and 0.1 for training generators to encourage the generators to focus more on the realism. The Followings are effects of this change.  \n  \n* The image quality and clearity increase in most cases.\n* The model recognizes the features of each gender such as mustache, beard, color lens and make-up better\n* However, recognition of hair length becomes worse.\n  \n  \n## Process\n### Discriminator\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/discriminator.png\" /\u003e\u003c/p\u003e\n\n### Generator\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/generator.png\" /\u003e\u003c/p\u003e\n  \n## Prerequisites\n* [Python 3.5+](https://www.continuum.io/downloads)\n* [PyTorch 0.2.0](http://pytorch.org/)  \n\n## Dataset\n__CelebA__ dataset is used. After downloading the dataset, all images are supposed to be located in the following path.\n  \n* ```data/train/0``` : Training male images\n* ```data/train/1``` : Training female images\n* ```data/val/0``` : Validation male images\n* ```data/val/1``` : Validation female images\n* ```data/test/0``` : Test male images\n* ```data/test/1``` : Test female images\n  \n## Results\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_4.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_5.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_6.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_7.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_1.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_2.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_3.png\" /\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003cimg width=\"100%\" src=\"png/new_8.png\" /\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feveningglow%2Fmultitask-CycleGAN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feveningglow%2Fmultitask-CycleGAN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feveningglow%2Fmultitask-CycleGAN/lists"}