[Paper Review] Cross-Modal Food Retrieval: Learning a Joint Embedding of Food Images and Recipes with Semantic Consistency and Attention Mechanism
This paper proposes SCAN, a novel framework for cross-modal food retrieval that learns joint embeddings of food images and recipes using semantic consistency loss and self-attention mechanisms. By aligning image and recipe semantic probabilities and highlighting discriminative ingredients and instructions, SCAN significantly reduces intra-class variance and improves retrieval accuracy on the Recipe1M dataset, achieving state-of-the-art performance.
Food retrieval is an important task to perform analysis of food-related information, where we are interested in retrieving relevant information about the queried food item such as ingredients, cooking instructions, etc. In this paper, we investigate cross-modal retrieval between food images and cooking recipes. The goal is to learn an embedding of images and recipes in a common feature space, such that the corresponding image-recipe embeddings lie close to one another. Two major challenges in addressing this problem are 1) large intra-variance and small inter-variance across cross-modal food data; and 2) difficulties in obtaining discriminative recipe representations. To address these two problems, we propose Semantic-Consistent and Attention-based Networks (SCAN), which regularize the embeddings of the two modalities through aligning output semantic probabilities. Besides, we exploit a self-attention mechanism to improve the embedding of recipes. We evaluate the performance of the proposed method on the large-scale Recipe1M dataset, and show that we can outperform several state-of-the-art cross-modal retrieval strategies for food images and cooking recipes by a significant margin.
Motivation & Objective
- To address the challenge of large intra-class variance and small inter-class variance in cross-modal food retrieval between images and recipes.
- To improve discriminative representation learning for recipes, especially in the presence of noisy or common ingredients and instructions.
- To reduce dependency on image quality and high-quality visual data for effective recipe embedding.
- To develop a unified framework that enhances alignment between image and recipe embeddings in a shared feature space.
- To achieve superior retrieval performance on large-scale, real-world food datasets like Recipe1M.
Proposed method
- Introduces a semantic consistency loss based on Kullback-Leibler (KL) divergence to align the output semantic probability distributions of paired image and recipe embeddings.
- Employs a self-attention mechanism over LSTM-encoded recipe features to identify and emphasize key ingredients and cooking instructions for improved representation.
- Trains the model using a triplet loss objective to enforce margin-based ranking between positive and negative cross-modal pairs.
- Combines the self-attention mechanism with LSTM to generate more discriminative recipe embeddings without requiring visual input.
- Uses t-SNE visualization and intra-class distance analysis to validate the effectiveness of the semantic consistency loss in reducing feature variance.
- Applies the framework end-to-end on the Recipe1M dataset, enabling both recipe-to-image and image-to-recipe retrieval.
Experimental results
Research questions
- RQ1Can a semantic consistency loss effectively reduce intra-class variance in cross-modal food retrieval by aligning image and recipe semantic probabilities?
- RQ2To what extent does integrating self-attention with LSTM improve the discriminative power of recipe embeddings in the absence of visual data?
- RQ3How does the proposed SCAN framework compare to baseline methods like vanilla triplet loss in terms of retrieval ranking accuracy?
- RQ4Does the self-attention mechanism remain robust to low-quality or noisy food images during retrieval?
- RQ5Can the model generalize to complex, similar recipes with shared ingredients by focusing on key distinguishing components?
Key findings
- SCAN outperforms several state-of-the-art cross-modal retrieval methods on the Recipe1M dataset, achieving the best performance in both recipe-to-image and image-to-recipe retrieval tasks.
- The semantic consistency loss significantly reduces the mean intra-class feature distance between paired image and recipe embeddings, as shown by t-SNE visualization and quantitative analysis on chocolate chip recipes.
- The self-attention mechanism effectively identifies and highlights key ingredients and instructions, such as 'frozen whipped topping' in a recipe, even when they are visually absent or ambiguous in images.
- Models trained with only semantic consistency loss (TL+SC) or self-attention (TL+SA) show suboptimal results, indicating that the combination of both components is essential for optimal performance.
- The attention mechanism remains effective even on low-quality food images, demonstrating robustness to visual noise and variation.
- Ablation studies confirm that both the semantic consistency loss and self-attention mechanism contribute independently and synergistically to improved retrieval accuracy.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.