Abstract
Most online recipe repositories are dominated by nutritionally poor options, making it difficult for users to find healthy meals based on available ingredients. This paper introduces NutRec, a novel recipe recommendation framework designed for the "recipe completion" task. NutRec utilizes an embedding-based ingredient predictor and a neural network-based amount predictor to generate a nutritionally optimized "pseudo-recipe" aligned with World Health Organization (WHO) guidelines. By retrieving real-world recipes that most closely match this healthy ideal, NutRec successfully identifies more nutritious options within standard datasets. Experimental results on Allrecipes and Yummly datasets demonstrate that NutRec outperforms baseline methods in both ingredient prediction accuracy and the healthiness of recommended recipes.
Introduction
The "recipe completion" task is a common scenario for home cooks: given a few available ingredients, what complete dish can be prepared? While recipe search engines exist, they often prioritize popularity over health. Research indicates that highly-rated recipes in online repositories are frequently the most nutritionally poor. Furthermore, existing recommendation systems often ignore ingredient quantities—the primary determinant of nutritional value—or rely on small, pre-filtered healthy datasets that lack variety.
Methodology
The proposed NutRec framework addresses these gaps through a three-stage process that mimics human culinary deliberation.
1. Ingredient Predictor (IP-embedding)
To determine compatible ingredients, NutRec treats recipes as sequences and ingredients as tokens. A distributed representation model, similar to Word2Vec, embeds ingredients into a latent space. This approach allows the system to learn semantic relationships; for instance, "pasta" clusters with "spaghetti" and "noodles" without explicit categorization.
2. Amount Predictor
Nutritional analysis requires knowing the specific quantity of each ingredient. NutRec employs a Multi-Layer Perceptron (MLP) to predict realistic ingredient amounts in grams based on the presence of other ingredients in the recipe.
3. Pseudo-Recipe Generation and Retrieval
NutRec generates a "pseudo-recipe" by iteratively adding ingredients that minimize the Mean Squared Error (MSE) between predicted macro-nutrients and WHO dietary targets. The final step involves a similarity search within the original dataset to find real recipes that match the pseudo-recipe's composition and quantities using a weighted combination of Cosine and Jaccard similarity.
Datasets and Evaluation
The framework was evaluated using two large-scale datasets: Allrecipes (36,429 recipes) and Yummly (89,413 recipes). Nutritional values were calculated by fuzzy matching ingredient strings against the USDA National Nutrient Database.
Healthiness was quantified using a WHO score (0–7 scale). Baseline recipes for common ingredient sets typically scored low (approx. 1.8). NutRec improved these scores significantly, reaching average WHO scores of 2.22 on Allrecipes and 2.47 on Yummly for its top-10 recommendations.
Key Results
- Ingredient Prediction: The IP-embedding model achieved a top-10 hit rate of over 51% on both datasets, outperforming graph-based and NMF baselines.
- Amount Prediction: The MLP predictor achieved a Mean Absolute Error (MAE) of approximately 1.0 to 1.25 grams, ensuring high precision in nutritional estimation.
- Healthier Recommendations: By first constructing a mathematically healthy ideal (the pseudo-recipe), NutRec successfully surfaced healthier real-world recipes that simple filtering or popularity-based ranking would miss.
Conclusion
NutRec demonstrates that explicit modeling of ingredient quantities is crucial for healthy recipe recommendation. While training on exclusively healthy data proved counterproductive due to data sparsity, the similarity-search approach over a large, diverse dataset effectively bridges the gap between culinary variety and nutritional requirements. Future work includes exploring ensemble models for ingredient prediction and incorporating user ratings into the retrieval process.
Summary updated