Abstract
While modern nutritional applications effectively track ingredients and caloric intake, they often overlook the physiological impact of cooking methods. Extracting specific cooking actions from natural language recipes is challenging due to high textual variance and class imbalance. This paper introduces Cook-Gen, a lightweight generative framework that utilizes aggregation-based methods to distill cooking actions from irregular recipe data. Our results demonstrate that Cook-Gen-PF, a polynomial-based variant, achieves near-perfect precision and recall (98-99%), significantly outperforming much larger models like XLNET and ChatGPT while maintaining a minimal parameter footprint of 13.3 million.
Introduction
The health profile of a meal is determined not only by its ingredients but also by the techniques used to prepare them. For instance, steaming vegetables preserves water-soluble vitamins, whereas high-heat grilling of meats can introduce carcinogenic compounds. Despite this, most AI-driven diet management tools focus exclusively on ingredient lists.
The primary barrier to integrating cooking actions into these tools is the difficulty of automated extraction. Natural language recipes are notoriously "messy," characterized by irregular data patterns that baffle standard Natural Language Processing (NLP) tools. This research presents Cook-Gen, a specialized generative model designed to bridge this gap with high efficiency and accuracy.
The Challenge of Recipe Data
Extracting cooking actions (e.g., "braise," "sauté," "marinate") is complicated by two main factors:
- High Variance: Recipe authors use diverse phrasing. One might specify "marinate the chicken," while another provides a lengthy instruction like "marinate the meat and leave in the refrigerator overnight."
- Imbalanced Frequency: Common actions like "add" or "stir" appear with high frequency, whereas specialized techniques like "poaching" or "blanching" are rare. Standard models often fail to generalize across these underrepresented classes.
Traditional discriminative models, such as Part-of-Speech (POS) taggers or Named Entity Recognition (NER) systems, typically require massive datasets to handle such irregularities.
The Cook-Gen Framework
Cook-Gen shifts the paradigm from word-by-word classification to a generative approach centered on aggregation. By aggregating information across the entire recipe text, the model identifies global patterns that are more robust than local word features.
The researchers evaluated two primary architectures:
- Cook-Gen-NN (Neural Network): This model utilizes a two-layer feedforward network with ReLU activation. It employs an aggregation operation—averaging the outputs of hidden layers—to identify consistent patterns across varied input words.
- Cook-Gen-PF (Polynomial-based): This variant enhances expressive power by raising word representations to higher-order polynomial powers before aggregation. This allows the model to capture complex, non-linear relationships without the massive parameter overhead associated with deeper neural networks.
Experimental Setup
The models were trained and evaluated using a subset of the Recipe1M dataset. The researchers randomly sampled 10,000 recipes, which were then manually annotated by graduate students to establish a ground-truth set of cooking actions.
Cook-Gen was benchmarked against several industry standards, including standard NLP tools (SpaCy, Stanford NER), fine-tuned LLMs (ELECTRA, XLNET), and general-purpose LLMs (ChatGPT/GPT-3.5 via API).
Results and Discussion
The experimental results highlight a significant victory for specialized, lightweight architectures over generalized "black-box" models.
Performance
Cook-Gen-PF emerged as the top performer, achieving Precision and Recall scores between 98% and 99%. It consistently outperformed fine-tuned models like XLNET and ELECTRA. Notably, ChatGPT struggled with this specific task, likely due to a lack of domain-specific fine-tuning on the nuances of recipe text.
Efficiency: "Small is Beautiful"
Perhaps the most striking finding is the efficiency of the Cook-Gen models. While a model like XLNET requires approximately 400 million parameters and substantial GPU resources, Cook-Gen operates with only 13.3 million parameters. This small footprint allows the model to run locally on mobile devices with negligible memory consumption, a critical requirement for real-time health and diet-management applications.
Conclusion
Cook-Gen demonstrates that tailored generative architectures can outperform massive language models in specialized domains. By focusing on aggregation and polynomial complexity, the framework provides a robust solution for extracting health-critical cooking data from irregular text.
Future research will focus on integrating Cook-Gen into comprehensive diet recommendation systems. Such systems could provide real-time warnings regarding cooking methods (e.g., identifying high-temperature risks) and expand the model’s scope to include the recognition of cooking utensils and specific temperature requirements.
Summary updated