TL;DR
This paper introduces Decomposing Generation Networks (DGN), a novel framework for generating cooking recipes from food images and ingredients. DGN addresses the challenge of producing structured, detailed instructions by first predicting the recipe's overall structure and then using specialized sub-generators for each phase, leading to more comprehensive and human-like recipes.
What Problem Does This Paper Address?
Generating cooking instructions from food images and ingredients is a complex task. Unlike simple image captioning, recipes are procedural texts with inherent multi-sentence structures and distinct phases (e.g., preparation, cooking, finishing). Existing methods often generate instructions in a single, monolithic step, which can lead to missing crucial details and a lack of structural coherence. The challenge lies in capturing this underlying procedural structure and ensuring that the generated recipe is both accurate and complete, reflecting the step-by-step nature of cooking.
Methods
The core innovation of DGN is its decomposing generation approach. Instead of a single generator, DGN splits the recipe generation into two main components:
- Global Structure Prediction Component: This component takes the food image and ingredient embeddings as input and predicts the sequence and order of recipe phases. It also determines which specialized "sub-generator" is best suited for each phase. This is achieved using stacked Transformer blocks.
- Sub-Generator Output Component: This component utilizes the predicted structure and sub-generator assignments. Each sub-generator is designed to focus on a specific phase of the recipe. To enhance their output, these sub-generators receive "phase-aware features" that fuse image features, ingredient features, positional information, and phase-specific vectors. This allows each sub-generator to produce a more focused and detailed segment of the recipe.
The authors also explore different ways to construct these phase-aware features, including simple concatenation and more sophisticated attention mechanisms.
Datasets
The primary dataset used is Recipe1M. This dataset is notable for containing a large number of image-recipe pairs, including food images, ingredients, and cooking instructions. The authors use the official split of Recipe1M for training, validation, and testing.
Key Insights and Ideas
- Structure Matters: Recipes are not just sequences of words; they have an underlying procedural structure that, when captured, significantly improves generation quality.
- Decomposition Leads to Detail: Breaking down recipe generation into phases and assigning specialized generators allows for more granular control and the inclusion of finer cooking details that might be missed by a single, monolithic generator.
- Phase-Aware Features are Crucial: Fusing image, ingredient, positional, and phase-specific information into "phase-aware features" provides sub-generators with the necessary context to produce relevant and accurate instructions for their assigned phase.
- Attention Enhances Context: Using attention mechanisms to combine different feature representations (image, ingredient, phase) leads to better phase-aware features and improved generation performance.
Key Results
- DGN significantly outperforms baseline models (including those using BERT for ingredient encoding) across multiple metrics: perplexity (lower is better), BLEU (higher is better), and ROUGE-L (higher is better).
- The full model, BERT + DGN (attn), achieves state-of-the-art performance on the Recipe1M dataset.
- Qualitative analysis shows that DGN generates recipes with an average length closer to ground truth and captures richer cooking details compared to baseline models.
- The generated recipes from DGN are more diverse, as indicated by larger vocabulary sizes, compared to baseline models.
Limitations and Future Work
- Phase Number Hyperparameter: The optimal number of phases (N) per instruction is a hyperparameter. The authors found N=3 to be a good trade-off, but this might vary.
- Precision of Predicted Numbers: While DGN improves generation, some predicted numbers (e.g., cooking times) may not always be precise and can sometimes be misaligned with common sense.
- Diversity Gap: Despite improvements, there remains a gap in diversity between generated recipes and human-written ones.
- Future Work: The authors suggest that their DGN framework can be applied to other general models and tasks requiring structured text generation. Further research could explore more sophisticated methods for phase prediction and feature fusion.
Summary updated