The Art of Food: Meal Image Synthesis from Ingredients

Fangda Han, Ricardo Guerrero, Vladimir PavlovicarXiv 2019

TL;DR

This paper introduces a novel framework for generating realistic meal images from ingredient lists. By combining an attention-based ingredient-image association model with a StackGAN architecture and a cycle-consistency constraint, the authors achieve impressive synthesis quality, paving the way for better computational food analysis tools.

What Problem Does This Paper Address?

Generating realistic images from textual descriptions is a challenging task, especially for complex subjects like meals. Unlike simpler objects (e.g., birds, flowers), meal images are highly variable due to the interplay of multiple ingredients, their preparation methods, and cooking techniques. Existing text-to-image synthesis models often struggle with this complexity, producing images that are spatially compact and well-defined but lack the nuanced appearance of real food. This paper aims to bridge this gap by creating a system that can synthesize photo-realistic meal images directly from ingredient lists, addressing the need for better computational food analysis tools in areas like health monitoring and meal planning.

Methods

The proposed framework consists of two main components:

  1. Attention-based Cross-Modal Association Model (FoodSpace): This model learns a shared latent space (FoodSpace) where ingredient descriptions and meal images can be represented and compared. It uses an attention mechanism to weigh the importance of individual ingredients for image appearance, acknowledging that not all ingredients contribute equally. This is achieved by training an ingredients encoder ($F_p$) and an image encoder ($F_q$) to maximize the similarity between corresponding ingredient-image pairs while minimizing it for mismatched pairs.
  2. Generative Meal Image Network (StackGAN-v2 + Cycle-Consistency): A conditional generative adversarial network (GAN), specifically StackGAN-v2, is employed to synthesize meal images. The ingredients' latent representation from the association model is used to condition the GAN. To enhance image quality and control appearance, a cycle-consistency constraint is introduced. This constraint ensures that if an image is generated from ingredients, and then those ingredients are extracted from the generated image, the process should ideally lead back to the original ingredient representation. This helps to maintain contextual similarity and prevent mode collapse.

Datasets

The primary dataset used is Recipe1M. The authors focus on a subset of 402,760 recipes with at least one image and a reasonable number of ingredients and instructions. They further refine the ingredient list by:

  • Focusing on the 4,000 most frequent ingredients.
  • Stemming ingredient names and fusing similar ones.
  • Using a word2vec model to identify and merge ingredients that are semantically close in embedding space, with human annotation for final approval. This process results in a canonical list of 1,989 ingredients. For experiments, they train on specific meal categories like salad, cookie, and muffin.

Key Insights and Ideas

  • Ingredient Importance Matters: Not all ingredients are equally visually significant. An attention mechanism is crucial for learning which ingredients have the most impact on the final meal's appearance.
  • Canonical Ingredients are Key: Preprocessing the ingredient list into a canonical vocabulary significantly improves the performance of the association model, leading to better retrieval and synthesis.
  • Cycle-Consistency for Quality: Adding a cycle-consistency constraint is vital for improving the quality and controllability of generated meal images, ensuring they accurately reflect the input ingredients.
  • Meals are Complex: The inherent complexity of meal images (multiple ingredients, preparation variations) requires more sophisticated models than those used for simpler object generation.

Key Results

  • Improved Ingredient Association: The proposed attention-based association model, using a refined ingredient list, significantly reduces the median retrieval rank (MedR) from 71.00 to 24.00 for retrieving recipes from images, demonstrating better understanding of ingredient-image relationships.
  • Enhanced Image Synthesis: The model achieves better Inception Scores (IS) and Frechet Inception Distances (FID) compared to StackGAN-v2 on salad, cookie, and muffin datasets, indicating more meaningful and diverse generated images. For instance, on the salad subset, the model's IS is 3.46 compared to StackGAN-v2's 3.07, and its FID is 78.79 compared to StackGAN-v2's 55.43 (lower FID is better, but the paper notes their model is better on most subsets, implying a trade-off or specific subset performance).
  • Qualitative Improvements: Generated images are visually more aligned with the input ingredients, capturing more realistic appearances and ingredient-like features compared to previous methods. The cycle-consistency constraint helps in generating images that better reflect the ingredients.

Limitations and Future Work

  • Nuisance Factors: While the model can synthesize images from ingredients, it still struggles to fully control nuisance factors like viewpoint. The paper notes that generated images, while ingredient-correct, might not perfectly match the real image's viewpoint.
  • Retrieval Gap: Despite improvements, synthesized images still lag behind real images in retrieval ability, highlighting the difficulty of photo-realistic meal image synthesis.
  • Future Directions: The authors propose incorporating additional information like recipe instructions and titles to provide more context for meal preparation. They also aim to synthesize images with arbitrary ingredient quantities, moving beyond just the presence or absence of ingredients.

Summary updated

BibTeX
@misc{han2019art,
  author = {Fangda Han and Ricardo Guerrero and Vladimir Pavlovic},
  title = {{The Art of Food: Meal Image Synthesis from Ingredients}},
  year = {2019},
  eprint = {1905.13149},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.13149},
}
Figure