I had access to a university server for a class, so I trained CycleGAN while it had a little idle time.
I didn't have enough time to tune it properly. The results are funny, but I can see some potential.
I won't explain the implementation yet. I haven't even cleaned up the code or tuned the model. For now, here are the intermediate results.
Preparing the data
After cropping the faces, I manually made the dataset more consistent. My thinking was that training would be easier if the two groups differed mainly in gender-related appearance rather than in other ways. I removed unusual angles, costumes, and other conspicuous outliers. That left 347 male-face images and 194 female-face images. The second group looks particularly small. Here are some training examples.
There's still plenty of preprocessing to do. Exams aren't over yet, so time is short.
Training curves
I plotted the training curves in TensorBoard. After 800 epochs, the model seems to have overfit.
I don't currently have a numerical evaluation method, so I'm training heuristically. After tuning, perhaps 200–300 epochs will be enough next time. The university GPU was faster than I expected; with batches of ten, training moved quickly.
Intermediate results
Please don't be too shocked. These are just outputs from an early run.
I seriously wondered whether I should ask the celebrities for permission to post these. I hope it's all right.
Honestly, the results look very strange and funny. But don't you see a little potential? Or am I imagining it?
To the celebrities: I'm sorry for what I did to your faces. I'll try to do better next time.
What comes next
As you can see, I mostly just laugh at the outputs. Checking the finished training run in the morning means starting the day with a laugh. It may already be enough to entertain friends, but there's a long way to go before the quality is good.
1. Remove the backgrounds.
This should help keep other differences between the groups under control.
2. Make image quality more consistent.
Training resizes images to 256 × 256, so using sources at least that large should help.
3. Find more photographs.
Really, this has to happen before the previous step. There aren't enough high-resolution images.
4. Look into StarGAN.
It's well known for face generation, so I should read the paper.
5. Tune the model.
Some changes will probably be needed for this project.
I also want to try Kaggle after the semester ends, though I don't know how much time an internship will leave for toy projects. This has been exciting and enjoyable. And once again, apologies to the celebrities.