Abstract
Learning recipe and food image representation in common embedding space is non-trivial but crucial for cross-modal recipe retrieval. In this paper, we propose a new perspective for this problem by utilizing foundation models for data augmentation. Leveraging on the remarkable capabilities of foundation models (i.e., Llama2 and SAM), we propose to augment recipe and food image by extracting alignable information related to the counterpart. Specifically, Llama2 is employed to generate a textual description from the recipe, aiming to capture the visual cues of a food image, and SAM is used to produce image segments that correspond to key ingredients in the recipe. To make full use of the augmented data, we introduce Data Augmented Retrieval framework (DAR) to enhance recipe and image representation learning for cross-modal retrieval. We first inject adapter layers to pre-trained CLIP model to reduce computation cost rather than fully fine-tuning all the parameters. In addition, multi-level circle loss is proposed to align the original and augmented data pairs, which assigns different penalties for positive and negative pairs. On the Recipe1M dataset, our DAR outperforms all existing methods by a large margin. Extensive ablation studies validate the effectiveness of each component of DAR.
Introduction
Cross-modal recipe retrieval—the task of finding a recipe from a photo or vice versa—presents a significant challenge in computer vision and natural language processing due to inherent data misalignment. Recipes are procedural documents often containing non-visual information (e.g., "marinate for one hour"), while food images contain visual noise irrelevant to the recipe (e.g., background, lighting, or plating). Standard embedding models struggle to align these disparate modalities. While large-scale models like CLIP offer a strong foundation, direct fine-tuning is computationally expensive and does not inherently resolve the semantic gap between procedural text and visual pixels.
Methodology
The proposed Data Augmented Retrieval (DAR) framework addresses these challenges through a two-pronged data augmentation strategy using foundation models to "clean" and "align" the data.
- Textual Augmentation (Llama2): The authors utilize Llama2 to generate a "visual imagination description." Instead of processing the raw recipe, the LLM produces a concise description of the dish's expected visual appearance, focusing strictly on visual cues that a vision model can interpret.
- Visual Augmentation (SAM): The Segment Anything Model (SAM) is employed to extract key ingredient segments from the food image, effectively filtering out background noise and non-essential visual elements.
The DAR framework integrates these augmentations into a specialized architecture. Rather than fully fine-tuning CLIP, the authors inject lightweight adapter layers into a frozen CLIP model. This approach significantly reduces the number of trainable parameters—to approximately 8% of a full fine-tuning setup—while maintaining high performance. Furthermore, a Multi-level Circle Loss is introduced to optimize the common semantic space. Unlike standard triplet loss, circle loss allows for flexible optimization by assigning varying penalties to positive and negative pairs, facilitating a more robust alignment between original and augmented data.
Experiments and Results
The framework was evaluated on the Recipe1M dataset, which includes over 238,000 training pairs. The authors also utilized an additional 482,231 unpaired recipes for self-supervised learning of the recipe encoder.
The DAR framework achieved state-of-the-art results. On the 1k test set, the enhanced version (DAR++), which utilizes augmentation during inference, reached a 77.3% Recall@1 for image-to-recipe retrieval. This outperforms previous leading methods such as MALM (74.0%) and CLP (77.1% with re-ranking). On the more challenging 10k test set, DAR++ achieved 47.8% Recall@1, a notable improvement over the previous state-of-the-art of approximately 45.9%.
Conclusion
The DAR framework demonstrates that foundation models can serve as effective semantic filters, translating procedural instructions into visual descriptions and segmenting relevant visual features. While highly effective, the authors noted limitations in the Segment Anything Model, such as over-segmentation of large objects and occasional omission of small ingredients. Future research will focus on refining automated segmentation and mitigating potential hallucinations in LLM-generated descriptions.
Summary updated