Abstract
The growing interest in generating recipes from food images has drawn substantial research attention in recent years. Existing works for recipe generation primarily utilize a two-stage training method—first predicting ingredients from a food image and then generating instructions from both the image and ingredients. Large Multi-modal Models (LMMs), which have achieved notable success across a variety of vision and language tasks, shed light on generating both ingredients and instructions directly from images. Nevertheless, LMMs still face the common issue of hallucinations during recipe generation, leading to suboptimal performance. To tackle this issue, we propose a retrieval augmented large multimodal model for recipe generation. We first introduce Stochastic Diversified Retrieval Augmentation (SDRA) to retrieve recipes semantically related to the image from an existing datastore as a supplement, integrating them into the prompt to add diverse and rich context to the input image. Additionally, Self-Consistency Ensemble Voting mechanism is proposed to determine the most confident prediction recipes as the final output. It calculates the consistency among generated recipe candidates, which use different retrieval recipes as context for generation. Extensive experiments validate the effectiveness of our proposed method, which demonstrates state-of-the-art (SOTA) performance in recipe generation on the Recipe1M dataset.
Introduction: The Hallucination Problem in Recipe Generation
Generating a full recipe from a single food image is a complex "inverse" problem. Traditional methods typically relied on a two-stage approach: first identifying ingredients and then synthesizing instructions. While Large Multi-modal Models (LMMs) like LLaVA have recently simplified this into a single-stage process, they are prone to "hallucinations"—predicting ingredients like "ground beef" or "tomatoes" for a chocolate cake simply because of internal model biases. This research addresses these inaccuracies by grounding LMMs with external, semantically relevant knowledge.
Methodology: Retrieval-Augmented Architecture
The proposed framework moves beyond simple image-to-text generation by incorporating a retrieval component that acts as an "anchor" for the model.
The architecture consists of three core innovations:
- Stochastic Diversified Retrieval Augmentation (SDRA): The system uses a retriever to find semantically similar recipes from the Recipe1M datastore. During training, it randomly samples from the top-K results. This stochasticity prevents the model from over-fitting to a single reference and teaches it to synthesize core dish components from diverse examples.
- LMM-based Generator: Built on LLaVA-7B and fine-tuned via Low-Rank Adaptation (LoRA), the generator processes both the visual input and the retrieved text references to produce ingredients and instructions.
- Self-Consistency Ensemble Voting: At inference, the model generates multiple candidate recipes using different retrieved contexts. It then selects the final output based on the highest cosine similarity (agreement) among candidates, effectively filtering out inconsistent hallucinations.
Experimental Results
Evaluated on the Recipe1M dataset, the model achieved state-of-the-art performance across multiple metrics. It reached a BLEU score of 30.11 for instructions and an F1 score of 50.32% for ingredient accuracy, significantly outperforming baselines like FoodLMM and fine-tuned LLaVA.
Qualitative analysis demonstrates that the model is far more adept at identifying specific ingredients in complex dishes and providing realistic cooking times compared to standard LMMs, which often default to generic or incorrect instructions.
Conclusion and Future Directions
By integrating retrieval-based context and a self-consistency mechanism, this framework significantly mitigates the hallucination issues inherent in LMMs for specialized tasks like recipe generation. Future work will explore "co-training" the retriever and generator for tighter alignment and optimizing the inference cost associated with the ensemble voting mechanism.
Summary updated