Abstract: Image-to-image translation is a learning task to establish a visual mapping between an input and output image. This project evaluates the robustness of the Pix2Pix model, a conditional generative adversarial network (cGAN), by applying it to datasets of cartoonized images. The goal is to determine if the network can effectively generate realistic human faces from stylized cartoon inputs, reversing the information loss inherent in the cartoonization process.
Introduction
Image-to-image translation—mapping an image from one domain (e.g., a sketch) to another (e.g., a photo)—is a cornerstone of modern computer vision. While many models excel at "cartoonizing" photos, the inverse—generating a high-fidelity human face from a simplified cartoon—is significantly harder due to the massive loss of texture, shading, and fine lines. This study, conducted by researchers at Delft University of Technology, investigates whether the Pix2Pix framework can accurately reconstruct realistic human faces from these stylized inputs.
Methodology
The study centers on Pix2Pix, a cGAN implementation that uses a U-Net 256 generator and a PatchGAN discriminator. Unlike standard encoder-decoder networks, the U-Net uses skip connections to pass low-level information directly across layers, which is vital for maintaining facial geometry. The model optimizes a weighted combination of adversarial loss and L1 loss to ensure the generated image is both realistic and pixel-wise close to the ground truth.
For comparison, the authors also implemented CycleGAN, which is designed to learn mappings between domains without requiring perfectly paired examples.
Data and Experimental Setup
The researchers utilized the colorFERET database, containing 11,337 facial images. Since no paired "cartoon-to-real" dataset exists, they generated synthetic cartoon versions using an OpenCV-based script. The final filtered dataset consisted of 8,933 high-quality image pairs. Four different cartoon styles were generated to test the model's adaptability to different artistic domains.
Key Insights
The Batch Size Paradox
In many deep learning tasks, larger batches improve stability. However, the authors found that a batch size of 1 significantly outperformed larger batches (8 or 64). Larger batches led to higher discriminator loss and produced blurry, low-quality outputs that failed to generalize. This suggests that for this specific high-frequency translation task, the discriminator becomes too unstable when processing multiple samples simultaneously.
The "Filter" Overfitting Trap
A critical finding was that the model did not necessarily learn the general essence of human faces; instead, it learned to "undo" the specific OpenCV filter used in training. When presented with out-of-distribution data, such as hand-drawn sketches, the model failed to produce realistic results, outputting blurry artifacts instead.
Results
Quantitatively, the model trained with a batch size of 1 achieved a Cosine Dissimilarity score of 0.00136, nearly ten times better than the batch size 64 model (0.01052). To measure realism objectively, the authors used a pre-trained Inception V3 model to classify the gender of generated faces. The batch size 8 model showed the smallest Mean Absolute Difference in prediction probability compared to real images, suggesting a "sweet spot" for maintaining categorical features.
Qualitatively, CycleGAN outperformed Pix2Pix in this domain, showing better approximation of skin tones and clearer eye preservation, whereas Pix2Pix often produced "ghostly" or washed-out features.
Conclusion
While Pix2Pix can recreate basic facial structures from cartoonized inputs, its performance is highly sensitive to hyperparameters and dataset cleanliness. The reliance on synthetic filters remains a primary limitation, as real-world cartoons feature varied artistic exaggerations that a simple filter cannot replicate. Future work should focus on more diverse, non-synthetic datasets and exploring the causes of discriminator instability at higher batch sizes in translation tasks.
Summary updated