Abstract
Generative Adversarial Networks (GAN) have been widely investigated for image synthesis based on their powerful representation learning ability. In this work, we explore the StyleGAN and its application of synthetic food image generation. Despite the impressive performance of GAN for natural image generation, food images suffer from high intra-class diversity and inter-class similarity, resulting in overfitting and visual artifacts for synthetic images. Therefore, we aim to explore the capability and improve the performance of GAN methods for food image generation. Specifically, we first choose StyleGAN3 as the baseline method to generate synthetic food images and analyze the performance. Then, we identify two issues that can cause performance degradation on food images during the training phase: (1) inter-class feature entanglement during multi-food classes training and (2) loss of high-resolution detail during image downsampling. To address both issues, we propose to train one food category at a time to avoid feature entanglement and leverage image patches cropped from high-resolution datasets to retain fine details. We evaluate our method on the Food-101 dataset and show improved quality of generated synthetic food images compared with the baseline. Finally, we demonstrate the great potential of improving the performance of downstream tasks, such as food image classification by including high-quality synthetic training samples in the data augmentation.
Introduction
Automated dietary assessment is a critical component of modern health technology, yet deep learning models for food recognition require vast amounts of labeled data. Existing datasets often exhibit a "long-tailed" distribution, where common items like hamburgers are overrepresented while niche or regional dishes are scarce. While Generative Adversarial Networks (GANs) offer a theoretical solution for data augmentation, food images present unique challenges: high intra-class diversity and significant inter-class similarity. Standard models like StyleGAN3 often struggle with "feature entanglement"—where textures from one food type bleed into another—and the loss of fine-grained details due to low-resolution training bottlenecks.
Methodology
To overcome these hurdles, we refined the StyleGAN3 architecture with a two-pronged strategy:
Single-Class Training
Instead of training a single conditional model on a diverse multi-class dataset, we found that training on individual food categories prevents feature entanglement. This "quarantining" of features ensures that the generator does not mistakenly apply the texture of a spring roll to a hamburger bun.
Any-resolution Patch Training (Anyres GAN)
To preserve high-resolution textures without the prohibitive computational cost of full high-res training, we implemented a patch-based approach. The model first learns global structure at a low resolution and is subsequently trained on random high-resolution patches cropped from the original images. This allows the generator to capture fine details, such as the seeds on a bun or the texture of a strawberry, which are typically lost during standard downsampling.
Key Results
Our approach yielded significant improvements in both visual realism and functional utility:
- Visual Realism: In a subjective study involving 82 adults, participants mistook synthetic food images for real ones 64.75% of the time. This suggests that the generated images successfully crossed the "uncanny valley" of food representation.
- Quantitative Texture Improvement: The transition to any-resolution training resulted in a dramatic drop in patch-FID (pFID) from 90.113 to 30.863, indicating a substantial increase in the quality of fine-grained details.
- Downstream Task Performance: We tested the utility of synthetic data for food classification using a ResNet-50 backbone. Training on 200 real images achieved 62.33% accuracy. Supplementing this with 200 synthetic images boosted accuracy to 71.33%, a nearly 10% improvement that validates the use of GANs as a "force multiplier" for small datasets.
Conclusion
This work demonstrates that by addressing feature entanglement and detail loss, GANs can produce high-quality, realistic food images suitable for data augmentation. While currently focused on single-label images, future research will explore multi-label training for complex meal scenes and the application of synthetic data to tasks like food localization and volume estimation.
Summary updated