Skip to the content.

This Food Does Not Exist ๐Ÿช๐Ÿฐ๐Ÿฃ๐Ÿน๐Ÿ”

We trained StyleGAN2 models to generate food pictures. The images below are all synthetic!

This work is done in partnership with the Food & You project by the Digital Epidemiology Lab at EPFL. In this context, we are researching the potential of synthetic data augmention for vision tasks.

This research is part of the technology underlying our AI-generated photography platform Nyx.gallery. You can also follow our work on ๐Ÿฆ Twitter.

The code optimized for TPU training as well as the pretrained models are openly available.

Multi-class 512x512 model ๐Ÿ†•

Release v0.2, October 2022

v0.2 model samples

food-512.pkl

We have released a new and much improved model:

๐Ÿ’ The sample above are cherry-picked: check out the Colab notebook to generate your own, or train your own model.

Single-class 256x256 models

Release v0.1, July 2022

The models below were released in July 2022. Each model was trained on a single food class: cookie, cheescake, cocktail and sushi. They can still be used with the v0.2 code.

cookies

cookie-256.pkl

cheesecake

cheesecake-256.pkl

cocktail

cocktail-256.pkl

sushi

sushi-256.pkl

Why not DALLยทE/diffusion models? ๐Ÿค”

Recent methods like diffusion and auto-regressive models are all the rage these days: DALLยทE 2, Craiyon (formerly DALLยทE mini), ruDALL-Eโ€ฆ Why not go in this direction?

Realism vs control

StyleGAN models shine in terms of photorealism, as can be some by some of our food results. For another example, the website ThisPersonDoesNotExist.com produces very believable face images. While GANs are still better at this, diffusion models are catching up and this may change soon.

Diffusion models offer better control and flexibility, thanks in large part to text guidance. This comes at the cost of larger models and slower generation times.

Training resources

We were able to train the provided models in less than 10h each using a single TPU v4-8:

Training plots

FID (Frรฉchet inception distance) is a metric used to assess the quality of images created by a generative model.

In comparison, Craiyon is being training on a v3-256 TPU pod which means 32x the resources (albeit using the previous TPU generation) and the training has been going on for over a month.

Result comparison

No cherry-picking!

Ours

bdc76775-2c9f-4110-a2f1-fcbc07a588e7

Craiyon (โ€œa pile of cookies on a plateโ€)

a-pile-of-cookies-on-a-plate

DALLยทE 2 (โ€œa pile of cookies on a plateโ€)

Screenshot 2022-07-20 at 15 31 55

Acknowledgements ๐Ÿ™

Follow our Generative AI research: ๐Ÿ“˜ GitHub ๐Ÿฆ Twitter ๐Ÿ“ฉ Newsletter ๐Ÿ‘จโ€๐Ÿ’ผ LinkedIn ๐Ÿ“ท Instagram