Method, medium and system for optimizing formula of hangui coffee
By constructing a subjective and objective fusion model and using knowledge distillation technology, the problem that the design optimization of the hanger coffee coffee needs to rely on a lot of manual experience is solved, and the impact of formula parameters on quality is systematically explored, and optimization efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411572259.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The existing design optimization of the hanging coffee formula requires the accumulation of a lot of manual experience and lacks systematic exploration of the influence pattern of different formula parameters on the final quality.
By collecting samples of hanger coffee from a variety of different brands, origins and roasting degrees, obtain subjective and objective evaluation data, build a subjective and objective fusion model, optimize the formula using the method of fine-tuning and augmentation of data seeds, and train students' models through knowledge distillation technology to achieve formula optimization.
It realizes the effective integration of subjective sensory evaluation and objective testing indicators, systematically explores the impact of formula parameters on quality, reduces the burden of artificial experience accumulation, and improves the efficiency and accuracy of formula optimization.
Smart Images

Figure CN119515161A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of drip coffee formula, and in particular, relates to a drip coffee formula optimization method, medium and system. Background Art
[0002] As one of the most popular beverages in the world, coffee has extremely significant taste differences due to different origins and roasting processes. For drip coffee, its unique brewing method can better highlight the original taste of coffee beans. At present, there are many brands of drip coffee products on the market. They vary in formula parameters such as coffee bean type, grinding particle size, and roasting degree, and ultimately present rich and diverse flavor characteristics. Professional coffee tasters can score the aroma, taste, and flavor of these drip coffee products through sensory evaluation. At the same time, some laboratories will also conduct objective index tests on these samples, such as solubility and caffeine content. These subjective sensory evaluations and objective test indicators are important bases for reflecting the quality of drip coffee.
[0003] However, there are still some problems with the existing product development model. First, subjective sensory evaluation and objective test indicators are independent of each other and lack an effective fusion mechanism. Relying solely on one aspect of evaluation information cannot lead to a comprehensive and objective quality judgment. Secondly, the existing product optimization process mostly relies on empirical adjustments, and it is difficult to systematically explore the impact of different formula parameter combinations on the final quality. Furthermore, even if a high-quality formula has been determined, it is still necessary to make targeted adjustments based on the differences in raw material batches in actual production, which requires a lot of manual experience accumulation. In other words, the existing design optimization of drip coffee formulas needs to rely on the accumulation of a lot of manual experience. Summary of the invention
[0004] In view of this, the present invention provides a drip coffee formula optimization method, medium and system, which can solve the technical problem that the existing drip coffee formula design optimization requires relying on the accumulation of a large amount of manual experience.
[0005] The present invention is achieved in that:
[0006] A first aspect of the present invention provides a method for optimizing a drip coffee formula, comprising the following steps:
[0007] S10. Collect the formulas of drip coffee samples of various brands, origins and roasting degrees;
[0008] S20, obtaining evaluation data of each drip coffee, including subjective indicators and objective indicators;
[0009] S30, inputting the evaluation data of each drip coffee into a pre-trained subjective and objective fusion model to obtain an evaluation vector of each drip coffee;
[0010] S40, constructing a drip coffee recipe feature vector;
[0011] S50, establishing a data pair of a recipe and an evaluation vector as a basic data pair; fine-tuning the recipe by using a data seed fine-tuning and augmentation method to obtain an augmented recipe set, wherein the evaluation vector corresponding to each augmented recipe is the evaluation vector corresponding to the augmented seed; and establishing an augmented data pair;
[0012] S60, training a teacher model using the basic data pair and the augmented data pair to predict the evaluation vector according to the recipe feature vector;
[0013] S70. Design a student model with a simpler structure and use knowledge distillation technology to transfer the knowledge of the teacher model to the student model. The training objectives of the student model include: minimizing the difference between the student model prediction results and the teacher model prediction results; minimizing the difference between the student model prediction results and the true evaluation vector;
[0014] S80, obtaining a basic formula to be optimized, using a data seed fine-tuning and augmentation method to obtain a basic formula augmentation set, using the student model to calculate each formula data in the basic formula augmentation set to obtain an evaluation vector, and selecting multiple formulas with the best evaluation vectors as candidate formulas;
[0015] S90, obtaining evaluation data of each candidate formula, and scoring them using an empirical scoring formula for the evaluation data, with the formula with the highest score being used as the optimized formula of the basic formula to be optimized.
[0016] On the basis of the above technical solution, the method for optimizing the drip coffee formula of the present invention can also be improved as follows:
[0017] Among them, the subjective indicators include aroma, taste, flavor, mellowness, balance and aftertaste.
[0018] Furthermore, the objective indicators include solubility, soaking time, optimal water temperature range, caffeine content, total acidity, and total solid content.
[0019] Furthermore, the drip coffee recipe feature vector includes coffee bean type, grinding degree, roasting degree, recipe ratio, and powder particle size distribution.
[0020] Furthermore, the subjective-objective fusion model adopts a multi-layer perceptron, the input of which includes a subjective indicator vector and an objective indicator vector, and the output is a comprehensive evaluation vector.
[0021] Furthermore, the teacher model adopts a multi-layer perceptron structure, and its goal is to minimize the MSE loss between the predicted evaluation vector and the true evaluation vector.
[0022] Furthermore, the training objectives of the student model include two parts: one is to minimize the difference between the student model prediction results and the teacher model prediction results; the other is to minimize the difference between the student model prediction results and the true evaluation vector Ei.
[0023] Furthermore, the empirical scoring formula is a weighted sum of the subjective indicator score and the objective indicator score.
[0024] Specifically, step S10 specifically includes: collecting multiple samples of major drip coffee brands on the market, covering coffee samples of different origins and roasting degrees. First, for the mainstream drip coffee brands on the market, the corresponding coffee samples are comprehensively collected. These samples should cover typical multiple coffee bean types, different grinding particle sizes and roasting degrees. By widely collecting a large amount of sample data, more comprehensive drip coffee formula information can be obtained, providing a basic basis for subsequent evaluation analysis and formula optimization.
[0025] Specifically, the specific steps of step S20 include: inviting professional tasters with rich experience to conduct sensory evaluation on the collected drip coffee samples, with a score range of 0 to 10 points, and the evaluation indicators include six aspects such as aroma, taste, flavor, body, balance and aftertaste; at the same time, using laboratory instruments to test the objective indicators of each drip coffee sample, including solubility, soaking time, optimal water temperature range, caffeine content, total acidity and total solid content. By combining sensory evaluation and experimental testing, comprehensive evaluation data of each drip coffee sample can be obtained, providing a basis for subsequent subjective and objective fusion model training.
[0026] Specifically, the specific implementation of step S30 includes: constructing a subjective-objective fusion model using a multi-layer perceptron (MLP) structure, whose input includes a subjective index vector and an objective index vector, and outputs a comprehensive evaluation vector. The subjective index vector consists of six sub-indexes: aroma, taste, flavor, alcohol content, balance, and aftertaste, and the objective index vector consists of six objective test indicators. Through supervised learning, using actual expert evaluation data as training labels, the subjective-objective fusion model is trained so that it can effectively integrate subjective sensory evaluation and objective test indicators to output a more comprehensive evaluation vector.
[0027] Specifically, the specific implementation of step S40 includes: constructing a drip coffee recipe feature vector containing five dimensions, namely, coffee bean type, grinding degree, roasting degree, recipe ratio and powder particle size distribution. Among them, the coffee bean type is represented by a numerical code; the grinding degree is quantified by visual particle size, in microns; the roasting degree is also represented by a numerical code; the recipe ratio is represented by the percentage of various coffee beans; and the powder particle size distribution is described by two indicators, the average particle size and the standard deviation. This feature vector will be used as the input data of the subsequent optimization model.
[0028] Specifically, the specific implementation of step S50 includes: on the basis of retaining the original recipe features, generating an augmented recipe feature vector by fine-tuning. Specifically, the original recipe feature vector F is randomly perturbed by a fine-tuning vector δ that obeys a normal distribution to obtain an augmented recipe feature vector F aug =F+δ. This data augmentation method helps improve the generalization ability of subsequent models. The augmented recipe feature vector and its corresponding true evaluation vector constitute the augmented data set, which will be used for model training together with the original data set.
[0029] Specifically, the specific implementation of step S60 includes: using a multi-layer perceptron structure to train a complex teacher model. The training goal of the teacher model is to minimize the MSE loss between its predicted evaluation vector and the true evaluation vector. By training the teacher model using basic data pairs and augmented data pairs, it can learn the complex mapping relationship between recipe features and evaluations, providing support for subsequent knowledge distillation.
[0030] Specifically, the specific implementation of step S70 includes: using the knowledge distillation method to train a simpler and more efficient student model. The training objectives of the student model include two parts: one is to minimize the difference between the student model prediction results and the teacher model prediction results; the other is to minimize the difference between the student model prediction results and the true evaluation. Through this distillation training method, the student model can further improve its fitting ability and generalization performance while retaining the teacher model knowledge.
[0031] Specifically, the specific implementation of step S80 includes: firstly, using the data seed fine-tuning augmentation method to obtain the basic formula augmentation set. Then, these augmented formulas are input into the trained student model to obtain the prediction evaluation vector corresponding to each formula. Finally, the top K formulas with the best prediction evaluation vectors are selected as the candidate formula set. Through this step, several candidate formulas with the best quality can be screened out from a large number of formula variants.
[0032] Specifically, the specific implementation of step S90 includes: performing actual sensory evaluation and experimental testing on the candidate formula set selected in step S80 to obtain complete evaluation data for each formula. Then, an empirical scoring formula is used to comprehensively score each formula, and the formula with the highest score is the final optimized formula. The scoring formula includes a weighted sum of subjective index scores and objective index scores, and the weight coefficient can be set by expert experience or determined by using a hierarchical analysis method.
[0033] Furthermore, in step S30, the calculation process of the subjective and objective fusion model can be expressed as follows:
[0034] E = f(S,O);
[0035] In the formula, E is the evaluation vector; S is the subjective indicator vector; O is the objective indicator vector; and f is the pre-trained subjective and objective fusion model function.
[0036] The method for obtaining the subjective index vector S is:
[0037] S = [s1, s2, s3, s4, s5, s6];
[0038] In the formula, s1 is the aroma score; s2 is the taste score; s3 is the flavor score; s4 is the body score; s5 is the balance score; s6 is the aftertaste score. These scores are obtained by professional tasters, with a score range of 0-10.
[0039] The method for obtaining the objective indicator vector O is:
[0040] O = [o1,o2,o3,o4,o5,o6];
[0041] In the formula, o1 is solubility (%); o2 is soaking time (seconds); o3 is the optimal water temperature range (℃); o4 is caffeine content (mg / 100ml); o5 is total acidity (pH value); o6 is total solid content (%). These indicators are measured by laboratory instruments.
[0042] Among them, the subjective and objective fusion model:
[0043] (1) Model structure:
[0044] The subjective and objective fusion model adopts a multi-layer perceptron (MLP) structure, as follows:
[0045] h1=σ(W1[S,O]+b1);
[0046] h2=σ(W2h1+b2);
[0047] E=W3h2+b3;
[0048] Where h1, h2 are hidden layer outputs; W1, W2, W3 are weight matrices; b1, b2, b3 are bias vectors; σ is the activation function, using the ReLU function: σ(x) = max(0, x).
[0049] (2) Training Dataset:
[0050] Training dataset D fusion ={(S i ,O i ,E i )|i=1,2,…,N}, where N is the number of samples. i ,O i are the subjective index vector and objective index vector of the i-th sample, E i is the comprehensive evaluation vector given by experts.
[0051] (3) Training steps:
[0052] a. Initialize model parameters θ = {W1, W2, W3, b1, b2, b3};
[0053] b. Define the loss function:
[0054] c. Minimize the loss function using stochastic gradient descent (SGD) or Adam optimizer:
[0055]
[0056] Where η is the learning rate and t is the number of iterations.
[0057] d. Repeat step c until the model converges or the preset number of iterations is reached.
[0058] In step S40, the process of constructing the recipe feature vector is as follows:
[0059] F = [f1,f2,f3,f4,f5];
[0060] Where F is the recipe feature vector; f1 is the type of coffee beans (expressed by numerical code); f2 is the grinding degree (visual particle size, unit: μm); f3 is the roasting degree (expressed by numerical code, such as 1-10); f4 is the recipe ratio (the ratio of various coffee beans, expressed in percentage); f5 is the powder particle size distribution (expressed by average particle size and standard deviation).
[0061] In step S50, the process of data seed fine-tuning and augmentation can be expressed as follows:
[0062] F aug =F+δ;
[0063] In the formula, Faug is the augmented formula feature vector; F is the original formula feature vector; δ is the fine-tuning vector, where each element follows the normal distribution N(0,σ 2 ), σ is the preset fine-tuning strength.
[0064] In step S60, the training process of the teacher model can be expressed as follows:
[0065]
[0066] In the formula, θ T is the teacher model parameter; N is the number of data pairs; E i is the true evaluation vector of the i-th sample; F i is the recipe feature vector of the i-th sample; T(F i θ T ) is the prediction result of the teacher model for the i-th sample.
[0067] In step S70, the training process of the student model can be expressed as follows:
[0068]
[0069] In the formula, θ S is the student model parameter; S(F i θ S ) is the prediction result of the student model for the i-th sample; α and β are weight coefficients used to balance the importance of the two loss terms.
[0070] In step S80, the selection process of the candidate formula can be expressed as follows:
[0071] F selected =TopK({S(F j θ S )|F j ∈F aug_base},K);
[0072] In the formula, F selected is the set of candidate recipes to be selected; F aug_base is the augmented set of basic recipes; TopK is a function for selecting the top K recipes with the best evaluation vectors, where K defaults to 3 to 10.
[0073] In step S90, the empirical scoring formula for evaluation data can be expressed as follows:
[0074]
[0075] In the formula, Score is the final score; w k is the subjective indicator weight; s k is the subjective index score; mis the objective indicator weight; m It is the score of objective indicators. The weight coefficient is set by expert experience or determined by using the analytic hierarchy process (AHP).
[0076] The selection process of the final optimized formula is:
[0077]
[0078] In the formula, F opt The final optimized formula; Score (F j ) is formula F j score.
[0079] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the above-mentioned method for optimizing a drip coffee recipe.
[0080] A third aspect of the present invention provides a drip coffee recipe optimization system, which includes the above-mentioned computer-readable storage medium.
[0081] Compared with the prior art, the beneficial effects of the drip coffee formula optimization method, medium and system provided by the present invention are as follows: First, the scheme of the present invention realizes the effective fusion of subjective sensory evaluation and objective test indicators. By constructing a subjective and objective fusion model, these two types of evaluation information can be integrated together to output a more comprehensive and objective quality evaluation vector. This fusion mechanism can make up for the limitations of a single evaluation indicator and provide a more reliable basis for subsequent formula optimization.
[0082] Secondly, the scheme of the present invention adopts the technical means of data augmentation and knowledge distillation, making full use of limited sample data to train a relatively simple and efficient student model. This model not only has a strong fitting ability, but also can be well generalized to new formula conditions. Therefore, compared with the traditional method that relies on experience adjustment, the scheme of the present invention can more systematically explore the influence of different formula parameter combinations on the final quality.
[0083] Furthermore, the optimization process of the scheme of the present invention is based on model prediction rather than direct manual judgment. Once the optimal formula is determined, in actual production, only the model needs to be used for rapid prediction to quickly adjust the formula to adapt to the difference in raw materials. This model-based optimization method greatly reduces the burden of manual experience accumulation.
[0084] In general, the subjective and objective fusion formula optimization method of the present invention gives full play to the advantages of combining quantitative analysis with qualitative evaluation, and solves the technical problem that the existing drip coffee formula design optimization needs to rely on the accumulation of a large amount of manual experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION
[0086] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0087] like Figure 1 FIG. 1 is a flow chart of a drip coffee recipe optimization method provided by the present invention, and the method comprises the following steps:
[0088] S10. Collect the formulas of drip coffee samples of various brands, origins and roasting degrees;
[0089] S20, obtaining evaluation data of each drip coffee, including subjective indicators and objective indicators;
[0090] S30, inputting the evaluation data of each drip coffee into a pre-trained subjective and objective fusion model to obtain an evaluation vector of each drip coffee;
[0091] S40, constructing a drip coffee recipe feature vector;
[0092] S50, establishing a data pair of a recipe and an evaluation vector as a basic data pair; fine-tuning the recipe by using a data seed fine-tuning and augmentation method to obtain an augmented recipe set, wherein the evaluation vector corresponding to each augmented recipe is the evaluation vector corresponding to the augmented seed; and establishing an augmented data pair;
[0093] S60, training a teacher model using the basic data pair and the augmented data pair to predict the evaluation vector according to the recipe feature vector;
[0094] S70. Design a student model with a simpler structure and use knowledge distillation technology to transfer the knowledge of the teacher model to the student model. The training objectives of the student model include: minimizing the difference between the student model prediction results and the teacher model prediction results; minimizing the difference between the student model prediction results and the true evaluation vector;
[0095] S80, obtaining a basic formula to be optimized, using a data seed fine-tuning and augmentation method to obtain a basic formula augmentation set, using a student model to calculate each formula data in the basic formula augmentation set to obtain an evaluation vector, and selecting multiple formulas with the best evaluation vectors as candidate formulas;
[0096] S90, obtaining evaluation data of each candidate formula, and scoring them using an empirical scoring formula for the evaluation data, with the formula with the highest score being used as the optimized formula of the basic formula to be optimized.
[0097] The specific implementation methods of the above steps are described in detail below:
[0098] The specific implementation method of step S10 is: collect a variety of drip coffee samples of different brands, origins and roasting degrees. First, it is necessary to comprehensively collect coffee samples of major drip coffee brands on the market, including coffee samples of different origins and roasting degrees. These samples should cover a variety of typical coffee bean types, different grinding particle sizes and roasting degrees. By collecting a large number of samples, more comprehensive drip coffee formula data can be obtained, providing basic data for subsequent evaluation, analysis and optimization.
[0099] The specific implementation of step S20 is: obtaining the evaluation data of each drip coffee. First, the collected drip coffee samples need to be professionally sensory evaluated and tested in laboratory indicators. The sensory evaluation mainly includes six aspects of aroma, taste, flavor, alcohol content, balance and aftertaste, with a scoring range of 0-10 points. This requires inviting professional tasters with rich experience to score. The sensory evaluation vector can be expressed as:
[0100] S = [s1, s2, s3, s4, s5, s6];
[0101] Among them, s1 is the aroma score, s2 is the taste score, s3 is the flavor score, s4 is the body score, s5 is the balance score, and s6 is the aftertaste score.
[0102] At the same time, each drip coffee sample needs to be tested for objective indicators, including solubility, soaking time, optimal water temperature range, caffeine content, total acidity and total solid content. These objective indicators can be measured by laboratory instruments and equipment. The objective evaluation vector can be expressed as:
[0103] O = [o1,o2,o3,o4,o5,o6];
[0104] Among them, o1 is solubility (%), o2 is soaking time (seconds), o3 is optimal water temperature range (°C), o4 is caffeine content (mg / 100ml), o5 is total acidity (pH value), and o6 is total solid content (%).
[0105] Through sensory evaluation and experimental testing, comprehensive evaluation data of each drip coffee sample can be obtained.
[0106] The specific implementation of step S30 is: constructing a subjective and objective fusion model. First, a multi-layer perceptron (MLP) structure is used to construct a subjective and objective fusion model. The input of the model includes a subjective index vector S and an objective index vector O, and the output is a comprehensive evaluation vector E. The calculation process of the subjective and objective fusion model can be expressed as:
[0107] E = f(S,O);
[0108] Among them, f is the pre-trained subjective and objective fusion model function.
[0109] The model structure is as follows:
[0110] h1=σ(W1[S,O]+b1);
[0111] h2=σ(W2h1+b2);
[0112] E=W3h2+b3;
[0113] Among them, h1, h2 are hidden layer outputs, W1, W2, W3 are weight matrices, b1, b2, b3 are bias vectors, σ is the activation function, and the ReLU function is used: σ(x) = max(0, x).
[0114] Training dataset D fusion It consists of several triples (S i ,O i ,E i ),where S i ,O i are the subjective index vector and objective index vector of the i-th sample, E i is the comprehensive evaluation vector given by experts.
[0115] The training steps are as follows:
[0116] a. Initialize model parameters θ = {W1, W2, W3, b1, b2, b3};
[0117] b. Define the loss function:
[0118] c. Minimize the loss function using stochastic gradient descent (SGD) or Adam optimizer:
[0119]
[0120] Among them, η is the learning rate and t is the number of iterations;
[0121] d. Repeat step c until the model converges or reaches the preset number of iterations
[0122] Through such training, the subjective-objective fusion model can learn the complex mapping relationship between subjective sensory evaluation and objective test indicators, and output a more comprehensive evaluation vector.
[0123] The specific implementation of step S40 is: constructing a drip coffee recipe feature vector. The recipe feature vector F includes five aspects:
[0124] F = [f1,f2,f3,f4,f5];
[0125] Among them, f1 is the type of coffee beans (expressed by numerical code), f2 is the grinding degree (visual particle size, unit: μm), f3 is the roasting degree (expressed by numerical code, such as 1-10), f4 is the recipe ratio (the ratio of various coffee beans, expressed in percentage), and f5 is the powder particle size distribution (expressed by average particle size and standard deviation).
[0126] Through these five feature dimensions, the recipe characteristics of a drip coffee can be described more comprehensively. This feature vector will be used as the input of the subsequent optimization model.
[0127] The specific implementation of step S50 is: fine-tuning and augmenting the data seed. First, based on the original recipe feature vector F, an augmented recipe feature vector F is generated by fine-tuning. aug Specifically,
[0128] F aug =F+δ;
[0129] Among them, δ is the normal distribution N(0,σ 2 ) is a fine-tuning vector, and σ is the preset fine-tuning strength. In this way, some approximate recipe variants can be generated by random perturbation while retaining the original recipe features. These augmented recipe feature vectors and their corresponding true evaluation vectors constitute an augmented dataset, which will be used together with the original dataset for subsequent model training. This data augmentation method helps to improve the generalization ability of the model.
[0130] The specific implementation of step S60 is: training the teacher model. First, a complex teacher model is trained using the basic data pairs and the augmented data pairs. The training goal of the teacher model is to minimize the predicted evaluation vector T(F i θ T ) and the true evaluation vector E i The MSE loss between can be expressed as:
[0131]
[0132] Among them, θ T is the teacher model parameter, N is the number of data pairs, F iis the recipe feature vector of the i-th sample. Through such training, the teacher model can learn the complex mapping relationship between recipe features and evaluations. This complex teacher model will be used as the object of subsequent knowledge distillation.
[0133] The specific implementation of step S70 is: training the student model. In order to obtain a simpler and more efficient model, the knowledge of the teacher model is transferred to the student model using the knowledge distillation method. The training objectives of the student model include two parts:
[0134]
[0135] Among them, θ S is the student model parameter, S(F i θ S ) is the prediction result of the student model for the i-th sample, and α and β are weight coefficients.
[0136] Through this distillation training method, the student model can further improve its fitting and generalization capabilities while retaining the knowledge of the teacher model.
[0137] The specific implementation of step S80 is: select the recipe to be optimized. First, use the data seed fine-tuning and augmentation method to obtain the basic recipe augmentation set F aug_base Then, these augmented recipes are input into the trained student model S(F i θ S ), the prediction evaluation vector corresponding to each recipe is obtained. Finally, the top K recipes with the best prediction evaluation vectors are selected as the candidate recipe set F selected , which can be expressed as:
[0138] F selected =TopK({S(F j θ s )|F j ∈F aug_base},K);
[0139] Among them, TopK is a function for selecting the top K recipes with the best evaluation vector.
[0140] Through this step, several candidate formulations with the best quality can be screened out from a large number of formulation variations.
[0141] The specific implementation of step S90 is: evaluating the data experience and scoring. selected , it is necessary to further collect their actual evaluation data. Then, an empirical scoring formula is used to comprehensively score each recipe:
[0142]
[0143] Among them, w k and v m are the weight coefficients of subjective and objective indicators, s k and m The weight coefficients can be set by expert experience or determined by using the analytic hierarchy process (AHP).
[0144] The formula with the highest score is the final optimized formula F opt , which can be expressed as:
[0145]
[0146] In general, this drip coffee recipe optimization method makes full use of subjective sensory evaluation and objective test indicators, and finally selects the optimal recipe through a series of steps such as building a subjective and objective fusion model, performing data augmentation, and training a teacher-student model. The entire process embodies the optimization idea of combining quantitative analysis and qualitative evaluation, and can comprehensively evaluate the quality characteristics of different recipes.
[0147] A second aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are run in a computer, they are used to execute the above-mentioned method for optimizing a drip coffee recipe.
[0148] A third aspect of the present invention provides a drip coffee recipe optimization system, which includes the above-mentioned computer-readable storage medium.
[0149] Specifically, the principle of the present invention is to construct a model framework that can effectively integrate subjective sensory evaluation and objective test indicators. Through the comprehensive collection and evaluation of a large number of drip coffee samples, rich subjective indicator data (such as aroma, taste, etc.) and objective indicator data (such as solubility, caffeine content, etc.) are obtained. These data provide a basis for the subsequent subjective and objective fusion model training.
[0150] The subjective and objective fusion model adopts the structure of a multi-layer perceptron (MLP). The input includes a subjective indicator vector and an objective indicator vector, and the output is a comprehensive evaluation vector. The model is trained in a supervised learning manner, that is, actual expert evaluation data is used as the training target. By minimizing the difference between the model prediction results and the actual evaluation, a complex mapping relationship that integrates subjective sensory and objective test indicators can be learned. Such a fusion model can provide a more comprehensive and objective quality evaluation, providing support for subsequent formula optimization.
[0151] In order to further improve the generalization performance of the model, the present invention also adopts the technical means of data augmentation. On the basis of retaining the original formula characteristics, some approximate formula variants are generated by fine-tuning. These augmented formulas and their corresponding evaluation data together constitute the training set, which can help the model learn a wider range of formula-quality relationships.
[0152] In addition, the present invention also proposes a model compression method based on knowledge distillation. First, a complex teacher model is used to learn the complex mapping relationship between recipe features and evaluations, and then this knowledge is transferred to a student model with a simpler structure. By minimizing the difference between the student model prediction results and the teacher model prediction results and the true evaluation as the training goal, the fitting ability and generalization performance of the student model can be further improved while retaining the teacher model knowledge. The student model obtained in this way not only has low computational complexity, but also has high prediction accuracy.
[0153] Based on the trained student model, the scheme of the present invention also designs a recipe optimization process based on model prediction. First, a large number of recipe variants are generated by data augmentation, and then input into the student model for evaluation and prediction, and those with the best predicted quality are selected as candidate recipes. Finally, the actual evaluation data of these candidate recipes are collected for comprehensive scoring, and the one with the highest score is selected as the final optimized recipe. This model-based optimization method can effectively explore the influence of recipe parameters on quality and guide actual recipe adjustments.
[0154] In general, the scheme of the present invention gives full play to the advantages of combining subjective sensory evaluation with objective test indicators, and realizes the systematic analysis and optimization of the drip coffee formula through a series of innovative technical means such as constructing a subjective and objective fusion model, performing data augmentation, and training a teacher-student model.
[0155] In order to better understand and implement the present invention, an embodiment of a specific application scenario of the present invention is provided below: a coffee company hopes to develop a better quality product by optimizing the formula of drip coffee to meet the needs of consumers. Based on the subjective and objective fusion formula optimization method proposed in the present invention, the company's R&D team carried out the following specific implementation work.
[0156] First, the team collected samples of 10 mainstream drip coffee brands on the market, covering different origins and roasting degrees. These samples include typical coffee bean types such as Kenya AA, Colombian Waffle, and Brazilian Yellow Azalea. The grinding size ranges from medium-fine to coarse, and the roasting degree ranges from light roasting to dark roasting. By extensively collecting a large amount of sample data, the foundation was laid for subsequent evaluation analysis and formula optimization.
[0157] Next, the R&D team invited three professional coffee tasters with rich experience to conduct sensory evaluations on the 10 drip coffee samples. Each taster scored independently, and the evaluation indicators included six aspects: aroma, taste, flavor, body, balance and aftertaste, with a score range of 0-10 points. At the same time, the team also conducted laboratory tests on these samples and obtained six objective indicators such as solubility, soaking time, optimal water temperature range, caffeine content, total acidity and total solids content. Through a combination of sensory evaluation and experimental testing, a complete evaluation data set for each drip coffee sample was finally obtained, as shown in Table 1.
[0158] Table 1. Coffee sample evaluation dataset
[0159]
[0160]
[0161] With these comprehensive evaluation data, the R&D team then built a subjective and objective fusion model. The model uses a multi-layer perceptron (MLP) structure, with the input being the subjective index vector S and the objective index vector O, and the output being a comprehensive evaluation vector E. The model training process is as follows:
[0162] 1. Initialize model parameters θ = {W1, W2, W3, b1, b2, b3}.
[0163] 2. Define the loss function: Where N is the number of samples, E i is the true evaluation vector of the i-th sample.
[0164] 3. Use the stochastic gradient descent (SGD) optimizer to minimize the loss function:
[0165]
[0166] Among them, η is the learning rate and t is the number of iterations.
[0167] 4. Repeat step 3 until the model converges.
[0168] After training, the subjective-objective fusion model can better integrate subjective sensory evaluation and objective test indicators, and output a more comprehensive and objective evaluation vector.
[0169] In order to further improve the generalization performance of the model, the R&D team also adopted data augmentation technology. On the basis of retaining the original recipe features, some approximate recipe variants were generated through fine-tuning. Specifically, for the original recipe feature vector F, we have:
[0170] F aug =F+δ;
[0171] Among them, δ is the normal distribution N(0,σ 2 ), and σ is set to 0.1. The generated augmented recipe feature vector and the corresponding true evaluation vector constitute the expanded training data set.
[0172] With the expanded training data set, the R&D team then used the knowledge distillation method to train a student model with a simpler structure. The training objectives of the student model are as follows:
[0173]
[0174] Among them, θ S is the student model parameter, S(F i θ S ) is the prediction result of the student model for the i-th sample, T(F i θ T ) is the prediction result of the teacher model, α and β are weight coefficients, which are 0.6 and 0.4 respectively. Through this distillation training method, the student model can further improve its fitting ability and generalization performance while retaining the knowledge of the teacher model.
[0175] With the trained student model, the R&D team optimized the recipe of a drip coffee called "Kenya AA Dark Roast". First, based on the feature vector F of the recipe, the above data augmentation method was used to generate 100 approximate recipe variants F. aug_base Then, these augmented recipes are input into the student model for evaluation prediction, and the top 5 with the smallest norm of the predicted evaluation vector are selected as candidate recipes F selected , as shown in Table 2.
[0176] Table 2 Alternative formula table
[0177]
[0178]
[0179] Next, the R&D team collected actual evaluation data for these five alternative formulations, as shown in Table 3.
[0180] Table 3 Evaluation data table
[0181]
[0182] Then, the R&D team used the following empirical scoring formula to comprehensively score the five candidate formulations:
[0183] Score=0.15·s1+0.15·s2+0.15·s3+0.10·s4+0.10·s5+0.10·
[0184] s6+0.05·o1+0.05·o2+0.05·o3+0.05·o4+0.05·o5+0.05·o6;
[0185] Among them, s i and j are the scores of subjective and objective indicators respectively. Through calculation, it can be concluded that the highest comprehensive score of formula 3 is 92.0 points, so it is selected as the final optimized formula.
[0186] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for optimizing drip coffee formula, characterized in that: The following steps are involved: S10. Collect the formulas of drip coffee samples of various brands, origins and roasting degrees; S20, obtaining evaluation data of each drip coffee, including subjective indicators and objective indicators; S30, inputting the evaluation data of each drip coffee into a pre-trained subjective and objective fusion model to obtain an evaluation vector of each drip coffee; S40, constructing a drip coffee recipe feature vector; S50, establishing a data pair of a recipe and an evaluation vector as a basic data pair; The recipe is fine-tuned by using data seed fine-tuning and augmentation to obtain an augmented recipe set. The evaluation vector corresponding to each augmented recipe is the evaluation vector corresponding to the augmented seed. And establish augmented data pairs; S60, training a teacher model using the basic data pair and the augmented data pair to predict the evaluation vector according to the recipe feature vector; S70. Design a student model with a simpler structure and use knowledge distillation technology to transfer the knowledge of the teacher model to the student model. The training objectives of the student model include: minimizing the difference between the student model prediction results and the teacher model prediction results; minimizing the difference between the student model prediction results and the true evaluation vector; S80, obtaining a basic formula to be optimized, using a data seed fine-tuning and augmentation method to obtain a basic formula augmentation set, using the student model to calculate each formula data in the basic formula augmentation set to obtain an evaluation vector, and selecting multiple formulas with the best evaluation vectors as candidate formulas; S90, obtaining evaluation data of each candidate formula, and scoring them using an empirical scoring formula for the evaluation data, with the formula with the highest score being used as the optimized formula of the basic formula to be optimized.
2. The method for optimizing drip coffee formula according to claim 1, characterized in that: The subjective indicators include aroma, taste, flavor, mellowness, balance, and aftertaste.
3. The method for optimizing drip coffee recipe according to claim 2, characterized in that: The objective indicators include solubility, soaking time, optimal water temperature range, caffeine content, total acidity, and total solid content.
4. The method for optimizing drip coffee recipe according to claim 3, characterized in that: The drip coffee recipe feature vector includes coffee bean type, grinding degree, roasting degree, recipe ratio, and powder particle size distribution.
5. The method for optimizing drip coffee recipe according to claim 4, characterized in that: The subjective and objective fusion model adopts a multi-layer perceptron, the input includes a subjective index vector and an objective index vector, and the output is a comprehensive evaluation vector.
6. The method for optimizing drip coffee recipe according to claim 5, characterized in that: The teacher model adopts a multi-layer perceptron structure, and its goal is to minimize the MSE loss between the predicted evaluation vector and the true evaluation vector.
7. The method for optimizing drip coffee recipe according to claim 6, characterized in that: The training objectives of the student model include two parts: one is to minimize the difference between the student model prediction results and the teacher model prediction results; the other is to minimize the difference between the student model prediction results and the true evaluation vector Ei.
8. The method for optimizing drip coffee recipe according to claim 7, characterized in that: The empirical scoring formula is a weighted sum of the subjective index score and the objective index score.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed in a computer, the method for optimizing a drip coffee recipe according to any one of claims 1 to 8 is used to execute the method.
10. A drip coffee recipe optimization system, characterized in that: A computer-readable storage medium comprising the computer-readable storage medium of claim 9.
Citation Information
Patent Citations
Formula generation method, device and equipment and computer readable storage medium
CN117632923A
Energy storage multi-scene model selection subjective and objective weight fusion method, medium and system
CN117709781A
Methods, devices and media for re-weighting to improve knowledge distillation
US20220343175A1