02 Sep Gender Swap GAN Filter for Deep Art Effects
This article was written by Ilya Polishchuk, a Lead Software Developer at Akvelon’s Ivanovo office, and was originally published in Medium.
In April 2020, Akvelon released Deep Art Effects, an application that allows you to edit photos by applying AI-powered filters and effects. Deep Art is accessible via theses apps: web, iOS, and Android applications:
The Deep Art Effects application launched with Akvelon’s custom trained Gender Swap GAN filter that transforms the face of a subject in a photo to look like the opposite gender by altering their features to look more masculine or feminine. Here, we are going to describe the methodology and approach that we used to develop this filter.
We tried a few novel techniques to train a Gender Swap GAN filter. In general, we tried to use generative adversarial networks in order to generate images of people with opposing genders.
Generative adversarial network or GAN is a type of neural network that is composed of two different parts — generator and discriminator. During the training procedure, both of these components take part in the learning procedure by “competing” with each other. The generator’s task is to create an image that will suit our given parameters and the discriminator’s task is to decide if the image is generated by the network or not. The discriminator is rewarded for correctly determining if a photo was synthetically generated or not and the generator is rewarded for successfully “fooling” the discriminator.
Our first task was to prepare a large dataset that contained numerous photos of people’s faces. Although there are plenty of prepared photo datasets on the internet, they are not always suitable for a particular task like this or they may have poor image quality.
For quality control of target images, we used the RetinaFace neural net that allowed us to crop faces from high-quality images of human subjects for further editing. We also shared this data with the InsightFace gender detection model to verify the target subject’s gender. This was necessary for us to ensure that the neural net will correctly distinguish the style of the target’s gender.
With all of our data prepared, the question arose: which particular GAN architecture should we use for a successful solution to this task?
We tried two different approaches to the training process: supervised and unsupervised.
Ilya Polishchuk is a Lead Software Developer at Akvelon’s Ivanovo office. Special thanks to Gleb Vasyagin and Anton Nesterenko for their help writing this article.
SWIFTUI IN Action
Nail Shakirov, the Director of Engineering at Akvelon’s Kazan office, has written an article on “SwiftUI in Action” that was published on Medium.com. Read more here.
Webinar on Empowering and Innovating in Times of Change
Guest speakers from Microsoft, Limeade, and Quantarium join Akvelon’s Mark Boyes to discuss best practices for companies to encourage their teams to consolidate, innovate, grow, and thrive in times of enormous change and disruption. Watch the webinar recording here
Building In-app notification systems in react native
Akvelon Mobile & Front End Developer Vadim Korobeinikov has written an article on cross-platform mobile development with a focus on how to develop a reliable notification system using the power of React Native. Originally published on Medium. Read more here