A liquor blending process optimization method based on deep reinforcement learning
By optimizing the blending process of baijiu through deep reinforcement learning algorithms, the intelligent agent autonomously learns the optimal blending ratio of base liquor, solving the problems of large errors and waste in manual blending, and achieving efficient and stable baijiu production.
Patent Information
- Application Number
- CN202310549550.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-05-16
AI Technical Summary
Existing technologies for blending baijiu suffer from problems such as large errors due to human tasting, unstable quality, and serious waste of base liquor. Furthermore, conventional mathematical methods rely on historical experience, leading to limitations and significant errors in the blending results.
By employing deep reinforcement learning algorithms, the agent interacts with the environment and utilizes Markov processes and actor-critic network structures to train the agent to autonomously learn the optimal base liquor blending ratio during the baijiu blending process. Combined with objective functions of cost and physicochemical index errors, an autonomous decision-making and reward mechanism is implemented to reduce errors and waste.
It achieves a balance between physicochemical index errors and taste deviations during the blending process of baijiu while reducing costs, reducing reliance on historical experience, improving blending efficiency and quality stability, and supporting the research and development of new formulas and mass production.
Smart Images

Figure CN116401959B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent learning and relates to an optimization method for the blending process of baijiu (Chinese liquor) based on deep reinforcement learning. Background Technology
[0002] The flavor of baijiu (Chinese white liquor) is influenced by various factors, such as brewing time, temperature, humidity, raw material ratios, and blending ratios. Blending is a crucial step in determining the final quality of baijiu, involving mixing base liquor and flavoring liquor in different proportions to create the finished product. In traditional production methods, the blending ratio is usually determined by manual tasting. However, due to the significant differences in human sensory evaluation, errors are prone to occur, leading to inconsistent quality and substantial waste of base liquor during the blending process.
[0003] By combining computer technology, the blending process of baijiu (Chinese liquor) can be better quantified. The flavor and quality of baijiu can be described using physicochemical indicators, namely the content of various trace elements. Blending essentially involves mixing base liquors with different physicochemical indicators to achieve the required physicochemical indicators for the finished product. Computer-aided blending technology calculates the blending ratio that satisfies these indicators. Due to the influence of brewing time, temperature, humidity, and raw materials, even original baijiu brewed according to the same formula may have different physicochemical indicators. Therefore, considering the variable nature of the physicochemical indicators of original baijiu over time and seasons, the self-learning characteristics of deep reinforcement learning can be used to simulate the process of determining the blending ratio multiple times. This allows for finding the base liquor ratio that best meets cost and trace element constraints, enabling the optimal blending ratio to be obtained for base liquors with different physicochemical indicators.
[0004] In existing technologies, conventional mathematical methods are frequently used to solve for proportions, mostly linear programming and goal programming. However, these direct solutions are prone to various problems. Linear programming has limitations; contradictory constraints can easily lead to no solution. Goal programming introduces cost error and physicochemical index error into the objective function, which to some extent solves the problem of linear programming easily getting stuck in local unsolvable situations due to hard constraints. However, the algorithm requires pre-setting weight coefficients, and the values of these coefficients depend on historical blending experience. If the values are inappropriate, it is easy to have excessively large local errors while ensuring the overall error is optimal, seriously affecting the taste of the blended liquor. In addition, there are fuzzy linear programming methods that relax the constraints by adjusting the scaling factor, and methods that use neural networks to fit the relationship between the physicochemical index and the weight coefficients before solving with goal programming. However, both of these methods rely on historically optimal blending experience to pre-determine the scaling factor or weight coefficients, which has certain limitations. The quality of historical data directly affects subsequent calculations and function fitting processes.
[0005] Reinforcement learning is a major branch of machine learning, drawing inspiration from animal learning. It learns how to choose the most appropriate action given a situation through trial and error. Deep reinforcement learning combines reinforcement learning and deep learning, emphasizing the characteristics of intelligence. Deep learning handles the perception part, while reinforcement learning handles the control and decision-making parts. The learning and decision-making parts of the algorithm are called the agent, and the computational unit that interacts with the agent is called the environment.
[0006] In this invention, the optimal blending ratio is quantified using an objective function and a reward function. During the deep reinforcement learning process, the agent operates on a trial-and-error basis. Through interactive learning with the environment, the agent learns how to maximize the system's reward value through multiple trials, resulting in a low objective function value after blending and a small difference from the expected physicochemical indicators. The reward function encourages good blending experiences and penalizes bad ones. Corresponding to the optimization process of the blending ratio, the decision-making process has a strong autonomous learning ability, similar to the process of accumulating experience through manual training. Due to the speed of computer computation, the experience accumulation process is more efficient than manual processing, and the process of determining the optimal blending ratio through interactive training has universality and can be applied to the blending process of different finished wines. Summary of the Invention
[0007] In view of this, the purpose of this invention is to provide an optimization method for the blending process of baijiu based on deep reinforcement learning. By using deep reinforcement learning algorithms, the agent can accumulate experience and learn the correct decision-making method through trial and error, so as to save costs, improve efficiency, and achieve the expected physicochemical indicators of the finished baijiu.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] 1. A method for optimizing the blending process of baijiu (Chinese liquor) based on deep reinforcement learning, characterized by the following steps:
[0010] S1: Select the type of finished wine and the base wine to be blended;
[0011] The expected physicochemical indicators of trace elements in the finished wine are obtained from the formula database. Let the target finished wine contain a total of m trace components, and the corresponding physicochemical indicators for these m trace components be (γ1, γ2, ..., γ...). m There are p types of base liquors used in the blending. The corresponding trace component contents are obtained by collecting chromatographic skeleton components of baijiu or from an established database of trace component contents of base liquors. The trace component content of the i-th type of base liquor is (r 1i ,r 2i ,…,r mi (i = 1, ..., p)
[0012] S2: Determine the objective function that includes cost and physicochemical index error for the liquor blending process;
[0013] The target function is set as follows:
[0014]
[0015]
[0016] x j ≥0, j=1,…,p
[0017] In the formula, J is the objective function, and the optimization objective is to minimize the function value, x j c represents the blending ratio of the j-th base spirit. j The price corresponding to the j-th type of base spirit or original spirit, c g r is the expected cost of the finished wine corresponding to the formula. ij γ represents the content of the i-th trace component corresponding to the j-th base liquor. i This refers to the content of trace components corresponding to the finished wine in the formula;
[0018] S3: Update the corresponding initialization parameters in S1;
[0019] If there is a need to establish a database of physicochemical indicators for base liquor, then the physicochemical indicators will be entered into the database and retrieved when needed.
[0020] S4: The optimal ratio is obtained through training with a deep reinforcement learning algorithm;
[0021] S41: Describe the process of blending baijiu as a Markov process, and provide the parameters used in the training and the reward and punishment criteria.
[0022] In the initial state, the agent selects action 'a', and the environment responds to this action by updating its state. During this process, the environment generates a reward value R, which includes positive rewards and negative penalties.
[0023] The training objective of the deep reinforcement learning algorithm is to optimize the proportion of base liquor, so that the blended liquor deviates little from the expected finished liquor formula; the liquor blending process is as follows:
[0024] The base liquors are mixed to obtain a blending sample, and the proportions of various base liquors in the blending sample constitute the initial state. In the initial state, the algorithm's decision-making part selects action 'a', which is the amount of base liquor to be added [Δx1,…,Δx]. p The environment responds to this action by having the computing unit calculate the ratio X between the base liquors in the newly blended sample after increasing the base liquor content, and the parameter J of the characterization error. In this process, the environment generates a reward value R, which is used to measure the effectiveness of the strategy.
[0025] The training process is quantified using mathematical formulas. Let there be p types of base wine, with a blending ratio of X = [x1, ..., x]. p The training process of a deep reinforcement learning algorithm in one round is defined as follows: the initial base wine ratio is... After each decision, a deviation parameter J is calculated based on the base liquor ratio to measure the difference between cost and taste. k :
[0026]
[0027] In the formula, J k The deviation parameter corresponding to the k-th time step, This represents the blending ratio of the j-th base liquor in the k-th decision;
[0028] The control action a determined by the deep reinforcement learning algorithm k The amount of base liquor that should be increased is defined as:
[0029]
[0030] The proportion of base liquor added in a single instance shall not exceed 0.05, meaning the amount added satisfies 0 ≤ Δx. ip ≤0.05, i=1,…,p, the new allocation ratio calculated based on the control variables is:
[0031]
[0032] Current state s k Updated to:
[0033] s k =[X k J k ]
[0034] The k-th state is related to the control variables of the previous state and the execution, and satisfies the Markov property.
[0035] Based on the proposed objective function for the liquor blending process, a reward function R related to the objective function is pre-set; the reward function corresponding to time k is defined as follows:
[0036]
[0037] In the formula J k Let J be the bias parameter in the k-th decision. k-1 Here are the parameters corresponding to the (k-1)th iteration, b, w, and d are adjustment coefficients, and M... i This describes the degree of deviation in taste, and the value is determined by the following rules:
[0038]
[0039] S k To ensure a positive reward for optimizing the decision in one round, the reward value is determined by the following rules:
[0040]
[0041] S42: Describe the decision-making process of the deep reinforcement learning algorithm DDPG in conjunction with the selected actor-critic network structure;
[0042] The DDPG actor-critic structure consists of a policy network and a value network. The actor network is a neural network that takes the optimal action based on the current state; this is called the policy network. The critic network is the value network that evaluates the value based on the state and the action. The input is the state space S:{J k ,X k}, the output is the action space A:{a k The training process involves a given initial state: the blending ratio of base liquor and the deviation parameter. Given this initial state, the actor network takes the optimal action decided at this step, updates the state and action taken by the critic network, and updates the predicted value. The optimal action is output, yielding a new blending ratio of base liquor, deviation parameter, and reward value. The critic network then judges the accuracy of the prediction based on the feedback reward signal. The error is used to update the learned parameters of both the actor and critic networks, adjusting the probability of making this action in the future.
[0043] The DDPG algorithm introduces convolutional neural networks, namely the value network and the policy network. To ensure the stability of the learning process, an experience replay mechanism is introduced. Each network creates two copies of the neural network, namely the online network and the target network.
[0044] In the current state s k Next, execute action a. k That is, at the current mixing sample ratio X k The following action increases the amount of base liquor. Get the state s of the next moment k+1 The actions adopt a deterministic strategy, represented by the parameters θ of the actor network:
[0045] a k =v(s k ,θ)
[0046] The M-function is used to evaluate the quality of a strategy ν, defined as the expected value of the discount reward, using the defined reward value R:
[0047]
[0048] In the formula, γ is the discount factor, and R k This is the reward value corresponding to the k-th time step;
[0049] Finding the optimal strategy corresponds to maximizing M.
[0050]
[0051] By differentiating the objective M-function using the chain rule, we obtain the update method for the actor network:
[0052]
[0053] In the formula, θ represents the policy network parameters, and Q... ν (s k ,v(s k )) represents the state s k Below, through a deterministic strategy v(s) k The state-action value generated by taking an action;
[0054] Optimize the above equation along the direction of gradient ascent so that the neural network parameters θ are updated along the direction of increasing state-action values;
[0055] The critic parameter ω is updated using a deep Q-network (DQN). The gradient of the critic network is represented as follows:
[0056]
[0057] In the formula s k+1 For state s k Next, execute action a k The next state obtained from the transition:
[0058]
[0059] Where θ′ and ω′ are the network parameters in the policy network and value network, respectively;
[0060] The loss function in a Critic network is defined as:
[0061] Loss=(R+γQ′(s k+1 ,v(s k+1 ;θ′))-Q(s k ,a k ;ω)) 2
[0062] Update the network parameters ω along the direction of gradient descent, so that the parameters are updated in the direction that the loss function decreases;
[0063] The parameters of the online networks in the policy network and value network are updated using gradient ascent or gradient descent methods respectively, and the parameters in the target network are updated using a soft update method. The update process is as follows:
[0064]
[0065] In the formula, ρ is taken as 0.001;
[0066] The training objective of the algorithm is to maximize M and minimize Loss, and to update the network parameters θ and ω using gradient ascent and gradient descent methods, respectively.
[0067] The neural network is used to simulate the policy function and the value function, and is trained using deep learning methods. The update training process is as follows: first, train with a mini-batch of data, then update the online network parameters, where the policy network parameters θ are updated using the gradient ascent method and the value network parameters ω are updated using the gradient descent method; then, the parameters θ′ and ω′ in the two target networks are updated separately using a soft update method.
[0068] During training, the deep reinforcement learning algorithm simulates the process of a blender learning and accumulating experience through multiple rounds of decision-making. Different finished liquor recipes can be selected using a computer to complete this trial-and-error learning and experience-accumulation process. Combined with the deep reinforcement learning algorithm, each round of decision-making is viewed as a decision sequence of human attempts to blend finished liquor. The metrics include the sum of total cost error and physicochemical index error, as well as the deviation in the taste of the blended liquor. The decision result is compared with the expected recipe. If there is a large deviation in trace components (i.e., the deviation of a single trace component from the recipe is greater than one-tenth of the recipe value), it is recorded as a penalty term. The reward value for a particular decision is given to the decision-making part, similar to the process of human experience accumulation. This penalty term ensures a balance in taste.
[0069] The beneficial effects of this invention are as follows:
[0070] (1) Through the training process of deep reinforcement learning algorithm, the base wine blending ratio determined can reduce cost error and trace component physicochemical indicators while avoiding excessive deviation in taste and balancing the taste. Most existing technologies consider the global optimum. For example, in the multi-objective programming model, cost deviation and physicochemical indicator deviation are both regarded as error terms that need to be reduced. Under multiple equality constraints and inequality constraints, there may be some indicators with excessive deviation, but from the global perspective, it is the optimal situation.
[0071] (2) This invention does not require a training process based on historical mixing experience, thus avoiding the influence of bad historical data. In some processes with established mixing ratios, historical experience is needed to assist in selection, which is highly dependent on data. This invention reduces the dependence on data by utilizing the algorithm training process.
[0072] (3) It is conducive to the research and development and mass production of new formulas in practical applications. Operations such as adjusting the formula and changing the type of base liquor can be quickly realized. It only requires the computer to accumulate experience on its own through interactive learning. By inputting the physicochemical indicators of the new finished wine and selecting the base liquor, the appropriate blending ratio can be recommended through deep reinforcement learning algorithm. Compared with the current method that requires historical blending experience, it is more valuable for implementation.
[0073] (4) Integrating the concept of artificial intelligence is conducive to the development of intelligent blending automation in the liquor industry and improves production efficiency. It ensures the homogenization and mass production of liquor, and through numerical methods, it not only guarantees the output but also the quality of the finished liquor.
[0074] (5) The training process proposed in this invention simulates the process of manual blending, which can avoid the large amount of waste of base wine and flavoring wine in the failure of traditional manual blending.
[0075] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0076] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0077] Figure 1 The operating plan for the winery;
[0078] Figure 2 This is a flowchart of the present invention;
[0079] Figure 3 This refers to the interaction process between an intelligent agent and its environment.
[0080] Figure 4 This refers to the traditional manual blending process for baijiu (Chinese liquor).
[0081] Figure 5 This is a flowchart of the algorithm decision-making process of the present invention;
[0082] Figure 6 It is an actor-critic network structure;
[0083] Figure 7It is a DDPG network structure;
[0084] Figure 8 Implementation framework for the DDPG algorithm;
[0085] Figure 9 For comparison of physicochemical indicators. Detailed Implementation
[0086] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0087] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0088] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0089] This invention addresses the process of determining different base liquor blending ratios based on the finished liquor formula during the baijiu blending stage. It designs a method using deep reinforcement learning to optimize blending costs and minimize errors in physicochemical indicators. A minimization function for cost and physicochemical indicator errors is provided. This minimization function is universal; for different formulas and base liquor physicochemical indicator contents, only the corresponding contents need to be substituted. The algorithm's objective is to output the blending ratios of different base liquors. A reward function suitable for optimizing the objective function is designed within the algorithm framework. Through multiple training iterations, the algorithm's decision-making part learns through trial and error, simulating the traditional manual blending process, accumulating experience to obtain a better base liquor ratio that meets the requirements of minimizing the objective function.
[0090] The operating procedure for wineries in this invention is as follows: Figure 1 As shown in the figure, (x1,…,x) p ) represents the blending ratio of base liquor, and p represents the quantity of base liquor. To achieve the above objectives, such as... Figure 2 As shown, the specific design process includes the following five steps:
[0091] S1: Select the type of finished wine and the base wine to be blended.
[0092] The expected physicochemical indicators of trace elements in the finished wine are obtained from the formula database. Let the target finished wine contain a total of m trace components, and the corresponding physicochemical indicators for these m trace components be (γ1, γ2, ..., γ...). m There are p types of base liquors used in the blending. The corresponding trace component contents are obtained by collecting chromatographic skeleton components of the liquor or from an established database of trace component contents of base liquors. The trace component content of the i-th base liquor is (r 1i ,r 2i ,…,r mi Let i = 1, ..., p be used to represent this.
[0093] S2: For the blending process of baijiu, determine the objective function that includes cost and physicochemical index error.
[0094] The target function is set as follows:
[0095]
[0096]
[0097] x j ≥0 (j=1,…,p)
[0098] In the formula, J is the objective function, and the optimization objective is to minimize the function value, x j c represents the blending ratio of the j-th base spirit. j The price corresponding to the j-th type of base spirit or original spirit, c g r is the expected cost of the finished wine corresponding to the formula. ij γ represents the content of the i-th trace component corresponding to the j-th base liquor. i This refers to the content of trace components corresponding to the finished wine in the formula.
[0099] S3: Update the corresponding initialization parameters in S1.
[0100] If there is a need to establish a database of physicochemical indicators for base liquor, the physicochemical indicators can be entered into the database and retrieved when needed.
[0101] S4: The optimal ratio is obtained through training with a deep reinforcement learning algorithm.
[0102] S41: Describe the traditional artificial blending process of baijiu as a Markov process, and provide the parameters used in the training and the reward and punishment criteria.
[0103] In a typical reinforcement learning decision-making process, "agent" and "environment" are used in a broad sense. The part that learns and makes action decisions is called the agent, and the part that interacts with the agent is called the environment. The process of the agent interacting with the environment is the process of accumulating experience. In the initial state, the agent chooses action 'a', and the environment responds by updating its state. During this process, the environment also generates a reward value R, which includes both positive rewards and negative penalties. The reward value is what the agent aims to maximize during the decision-making process. The interaction process between the agent and the environment is as follows: Figure 3 As shown.
[0104] A Markov process is a stochastic process and a mathematical form of reinforcement learning. It defines a time step where the state and reward value depend only on the state and action chosen in the previous time step, and are independent of the state and actions in earlier time steps. Such a process is called a Markov process and possesses the Markov property.
[0105] The training objective of a deep reinforcement learning algorithm is to optimize the proportion of base liquor, so that the blended liquor deviates little from the expected finished product formula. (See reference...) Figure 4 The traditional manual blending process for baijiu is shown below:
[0106] During training, we used a one-round decision-making process from a deep reinforcement learning algorithm to simulate the traditional manual tasting and blending process. For example... Figure 4 The blending process shown can be represented as a typical Markov process, where the blending ratio of base liquor at the current time step depends only on the proportion of the blended sample from the previous time step and the amount of base liquor added. The process of making correct decisions using a deep reinforcement learning algorithm relies on hundreds or thousands of rounds of exploration and training. When there is a significant deviation in the indicators, the deep reinforcement learning algorithm makes the decision to increase the content of a certain base liquor. Through the interaction between the agent and the environment, the decision-making process is as follows... Figure 5 As shown.
[0107] In the traditional manual blending process, base spirits are mixed to obtain a blending sample, and the proportions of various base spirits in the blending sample constitute the initial state. In this initial state, the algorithm's decision-making part selects action 'a', which determines the amount of base spirits [Δx1,…,Δx] to be added. pThe environment responds to this action by having the computing unit calculate the proportional relationship X between the base liquors in the newly blended sample after increasing the base liquor content, along with the parameter J representing the error. During this process, the environment also generates a reward value R, which measures the effectiveness of the strategy. The reward value encourages actions that reduce error and have fewer items with large deviations, while penalizing actions that increase error and have more items with large deviations. Through this interaction, the agent accumulates experience and makes decisions with higher reward values.
[0108] The training process is quantified using mathematical formulas, consistent with the description of S2. Let there be p types of base wine, with a blending ratio of X = [x1, ..., x]. p The training process of a deep reinforcement learning algorithm in one round is defined as follows: the initial base wine ratio is... After each decision, a deviation parameter J is calculated based on the base liquor ratio to measure the difference between cost and taste. k
[0109]
[0110] In the formula, J k The deviation parameter corresponding to the k-th time step, The value represents the blending ratio of the j-th type of base wine in k decisions. Other parameters are consistent with the description in the objective function and are all related to the initialization choices.
[0111] Based on human operational experience, a control action 'a' is determined by a deep reinforcement learning algorithm. k The amount of base liquor that should be increased is defined as...
[0112]
[0113] In this invention, the proportion of base liquor added in a single instance is specified to be no more than 0.05, that is, the amount added satisfies 0 ≤ Δx. ip ≤0.05 (i=1,…,p), the new allocation ratio calculated based on the control variables is:
[0114]
[0115] Current state s k Updated to
[0116] s k =[X k J k ]
[0117] This equation also shows that the state at the kth step is related to the control variables of the previous step and the execution, thus satisfying the Markov property.
[0118] Based on the proposed objective function for the liquor blending process, a reward function R related to the objective function is pre-defined. The reward function needs to consider both cost and physicochemical indicators. Under the constraint of only minimizing the global ratio, there may be situations where the differences in local trace components in certain blending decisions are too large. Therefore, to ensure the flavor, a penalty term for excessive flavor differences needs to be added to the reward function. Simultaneously, to ensure that each decision is as close as possible to the optimization deviation index and that the deep reinforcement learning optimization algorithm can learn decision-making experience in the desired direction, the reward function corresponding to time k is defined as follows:
[0119]
[0120] In the formula J k Let J be the bias parameter in the k-th decision, and similarly... k-1 Here are the parameters corresponding to the (k-1)th iteration, b, w, and d are adjustment coefficients, and M... i This describes the degree of deviation in taste, and the value is determined by the following rules:
[0121]
[0122] S k It is guaranteed that a positive reward will be given for optimizing the decision in one round, and the value selection rule is as follows:
[0123]
[0124] S42: Further describe the decision-making process of the deep reinforcement learning algorithm in conjunction with the selected actor-critic network structure.
[0125] In this invention, a deep reinforcement learning algorithm based on an actor-critic network structure, DDPG (Deep Deterministic Policy Gradient Algorithm), is selected. The implementation process of the network structure is as follows: Figure 6 As shown.
[0126] The DDPG actor-critic structure consists of a policy network and a value network. The actor network, called the policy network, is a neural network that takes the optimal action based on the current state. The critic network is the value network that evaluates the value based on the state and the action. The input is the state space. The output is the action space A:{a kThe training process, given an initial state (base wine blending ratio and deviation parameters), involves the actor network taking the optimal action at that step, updating the state and action used by the critic network, and obtaining the predicted value. Outputting this optimal action yields the new base wine blending ratio, deviation parameters, and reward value. The critic network then judges the accuracy of the prediction based on the feedback reward signal. The error is used to update the parameters learned by both the actor and critic networks, adjusting the probability of future decisions based on this action.
[0127] like Figure 7 As shown, the DDPG algorithm introduces convolutional neural networks, namely the value network and the policy network. To ensure the stability of the learning process, an experience replay mechanism is introduced. Each network creates two copies of the neural network, namely the online network and the target network.
[0128] In the current state s k Next, execute action a. k That is, at the current mixing sample ratio X k The following action increases the amount of base liquor. The state s of the next moment can be obtained. k+1 The actions adopt a deterministic strategy, represented by the parameters θ of the actor network:
[0129] a k =v(s k ,θ)
[0130] The M-function is used to evaluate the quality of a strategy ν, defined as the expected value of the discount reward, using the defined reward value R:
[0131]
[0132] In the formula, γ is the discount factor, and R k This is the reward value corresponding to the k-th time step.
[0133] Finding the optimal strategy corresponds to maximizing M.
[0134]
[0135] By differentiating the objective M-function using the chain rule, the update method of the actor network is obtained.
[0136]
[0137] In the formula, θ represents the policy network parameters, and Q... ν (s k ,v(s k )) represents the state sk Below, through a deterministic strategy v(s) k The state-action value generated by taking an action.
[0138] The equation is optimized along the direction of gradient ascent, so that the neural network parameters θ are updated along the direction of increasing state-action values.
[0139] The critic parameter ω is updated using a deep Q-network (DQN), and the gradient of the critic network can be represented as:
[0140]
[0141] In the formula s k+1 For state s k Next, execute action a k The next state obtained from the transition:
[0142]
[0143] Where θ′ and ω′ are the network parameters in the policy network and value network, respectively.
[0144] The loss function in a Critic network is defined as:
[0145] Loss=(R+γQ′(s k+1 ,v(s k+1 ;θ′))-Q(s k ,a k ;ω)) 2
[0146] Update the network parameters ω along the direction of gradient descent, so that the parameters are updated in the direction of decreasing loss function.
[0147] The parameters of the online networks in the policy network and value network are updated using gradient ascent or gradient descent methods respectively, and the parameters in the target network are updated using a soft update method. The update process is as follows:
[0148]
[0149] In the formula, ρ is taken as 0.001.
[0150] The essence of training a value network is to find the optimal solution for its parameters, and the essence of training a policy network is to find the optimal solution for its parameters. The training objective of the algorithm is to maximize M and minimize Loss; therefore, gradient ascent and gradient descent are used to update the network parameters θ and ω, respectively.
[0151] The neural network is used to simulate the policy and value functions, and is further trained using deep learning methods. The training process involves first training on a mini-batch of data, then updating the online network parameters. The policy network parameters θ are updated using gradient ascent, and the value network parameters ω are updated using gradient descent. Then, the parameters θ′ and ω′ in the two target networks are updated using a soft update method. The algorithm implementation framework is as follows: Figure 8 As shown.
[0152] During training, the deep reinforcement learning algorithm simulates the process of a blender learning and accumulating experience through multiple rounds of decision-making. This process is repeatable; different finished liquor formulas can all be selected using a computer to complete this trial-and-error learning and experience-accumulation process. Combining the deep reinforcement learning algorithm, each round of decision-making is viewed as a decision sequence of human attempts to blend finished liquor. The evaluation index includes not only the sum of total cost error and physicochemical index error, but also the deviation in the taste of the blended liquor. The decision result is compared with the expected formula. If there is a significant deviation in trace components (defined in this invention as a deviation of a single trace component from the formula greater than one-tenth of the formula value), it is recorded as a penalty term. The reward value given to a certain decision in the decision part is similar to the process of human experience accumulation. The goal of the deep reinforcement learning algorithm is to maximize the reward value, while simultaneously ensuring a balanced taste through this penalty term.
[0153] S43: Results Display
[0154] A classic case study of baijiu blending was selected. Given the formula for the finished product, four base spirits of different strengths were chosen for blending, each with varying levels of trace components. A deep reinforcement learning algorithm (DDPG) was selected with an expected cost of 6.8. Through experiments, the optimal blending ratio of the four base spirits for this finished product formula was obtained as X = (0.0339, 0.3009, 0.3530, 0.3122). The comparison of the blended baijiu's physicochemical indicators with the formula is shown below. Figure 9 As shown, the blending ratio obtained basically meets the expected requirements of the physicochemical indicators of the finished wine, and the taste deviation is small.
[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for optimizing the blending process of baijiu (Chinese liquor) based on deep reinforcement learning, characterized in that: The method includes the following steps: S1: Select the type of finished wine and the base wine to be blended; The expected physicochemical indicators of trace elements in the finished wine are obtained from the formula database. Let the target finished wine contain a total of m trace components, and the corresponding physicochemical indicators for these m trace components be (γ1, γ2, ..., γ...). m There are p types of base liquors used in the blending. The corresponding trace component contents are obtained by collecting chromatographic skeleton components of baijiu or from an established database of trace component contents of base liquors. The trace component content of the i-th type of base liquor is (r 1i ,r 2i ,…,r mi (i = 1, ..., p) S2: Determine the objective function that includes cost and physicochemical index error for the liquor blending process; The target function is set as follows: x j ≥0,j=1,…,p In the formula, J is the objective function, and the optimization objective is to minimize the function value, x j c represents the blending ratio of the j-th base spirit. j The price corresponding to the j-th type of base spirit or original spirit, c g r is the expected cost of the finished wine corresponding to the formula. ij γ represents the content of the i-th trace component corresponding to the j-th base liquor. i This refers to the content of trace components corresponding to the finished wine in the formula; S3: Update the corresponding initialization parameters in S1; If there is a need to establish a database of physicochemical indicators for base liquor, then the physicochemical indicators will be entered into the database and retrieved when needed. S4: The optimal ratio is obtained through training with a deep reinforcement learning algorithm; S41: Describe the process of blending baijiu as a Markov process, and provide the parameters used in the training and the reward and punishment criteria. In the initial state, the agent selects action 'a', and the environment responds to this action by updating its state. During this process, the environment generates a reward value R, which includes positive rewards and negative penalties. The training objective of the deep reinforcement learning algorithm is to optimize the proportion of base liquor, so that the blended liquor deviates little from the expected finished liquor formula; the liquor blending process is as follows: The base liquors are mixed to obtain a blending sample, and the proportions of various base liquors in the blending sample constitute the initial state. In the initial state, the algorithm's decision-making part selects action 'a', which is the amount of base liquor to be added [Δx1,…,Δx]. p The environment responds to this action by having the computing unit calculate the ratio X between the base liquors in the newly blended sample after increasing the base liquor content, and the parameter J of the characterization error. In this process, the environment generates a reward value R, which is used to measure the effectiveness of the strategy. The training process is quantified using mathematical formulas. Let there be p types of base wine, with a blending ratio of X = [x1, ..., x]. p The training process of a deep reinforcement learning algorithm in one round is defined as follows: the initial base wine ratio is... After each decision, a deviation parameter J is calculated based on the base liquor ratio to measure the difference between cost and taste. k : In the formula, J k The deviation parameter corresponding to the k-th time step, This represents the blending ratio of the j-th base liquor in the k-th decision; The control action a determined by the deep reinforcement learning algorithm k The amount of base liquor that should be increased is defined as: The proportion of base liquor added in a single instance shall not exceed 0.05, meaning the amount added satisfies 0 ≤ Δx. ip ≤0.05, i=1,…,p, the new allocation ratio calculated based on the control variables is: Current state s k Updated to: s k =[X k ,J k ] The k-th state is related to the control variables of the previous state and the execution, and satisfies the Markov property. Based on the proposed objective function for the liquor blending process, a reward function R related to the objective function is pre-set; the reward function corresponding to time k is defined as follows: In the formula J k Let J be the bias parameter in the k-th decision. k-1 Here are the parameters corresponding to the (k-1)th iteration, b, w, and d are adjustment coefficients, and M... i This describes the degree of deviation in taste, and the value is determined by the following rules: S k To ensure a positive reward for optimizing the decision in one round, the reward value is determined by the following rules: S42: Describe the decision-making process of the deep reinforcement learning algorithm DDPG in conjunction with the selected actor-critic network structure; The DDPG actor-critic structure consists of a policy network and a value network. The actor network is a neural network that takes the optimal action based on the current state; this is called the policy network. The critic network is the value network that evaluates the value based on the state and the action. The input is the state space S:{J k ,X k }, the output is the action space A:{a k The training process involves a given initial state: the blending ratio of base liquor and the deviation parameter. Given this initial state, the actor network takes the optimal action decided at this step, updates the state and action taken by the critic network, and updates the predicted value. The optimal action is output, yielding a new blending ratio of base liquor, deviation parameter, and reward value. The critic network then judges the accuracy of the prediction based on the feedback reward signal. The error is used to update the learned parameters of both the actor and critic networks, adjusting the probability of making this action in the future. The DDPG algorithm introduces convolutional neural networks, namely the value network and the policy network. To ensure the stability of the learning process, an experience replay mechanism is introduced. Each network creates two copies of the neural network, namely the online network and the target network. In the current state s k Next, execute action a. k That is, at the current mixing sample ratio X k The following action increases the amount of base liquor. Get the state s of the next moment k+1 The actions adopt a deterministic strategy, represented by the parameters θ of the actor network: a k =v(s k ,i) The M-function is used to evaluate the quality of a strategy ν, defined as the expected value of the discount reward, using the defined reward value R: In the formula, γ is the discount factor, and R k This is the reward value corresponding to the k-th time step; Finding the optimal strategy corresponds to maximizing M. By differentiating the objective M-function using the chain rule, we obtain the update method for the actor network: In the formula, θ represents the policy network parameters, and Q... ν (s k ,v(s k )) represents the state s k Below, through a deterministic strategy v(s) k The state-action value generated by taking an action; Optimize the above equation along the direction of gradient ascent so that the neural network parameters θ are updated along the direction of increasing state-action values; The critic parameter ω is updated using a deep Q-network (DQN). The gradient of the critic network is represented as follows: In the formula s k+1 For state s k Next, execute action a k The next state obtained from the transition: Where θ′ and ω′ are the network parameters in the policy network and value network, respectively; The loss function in a Critic network is defined as: Loss=(R+γQ′(s k+1 ,v(s k+1 ;θ′))-Q(s k ,a k ;ω)) 2 Update the network parameters ω along the direction of gradient descent, so that the parameters are updated in the direction that the loss function decreases; The parameters of the online networks in the policy network and value network are updated using gradient ascent or gradient descent methods respectively, and the parameters in the target network are updated using a soft update method. The update process is as follows: In the formula, ρ is taken as 0.001; The training objective of the algorithm is to maximize M and minimize Loss, and to update the network parameters θ and ω using gradient ascent and gradient descent methods, respectively. The neural network is used to simulate the policy function and the value function, and is trained using deep learning methods. The update training process is as follows: first, train with a mini-batch of data, then update the online network parameters, where the policy network parameters θ are updated using the gradient ascent method and the value network parameters ω are updated using the gradient descent method; then, the parameters θ′ and ω′ in the two target networks are updated separately using a soft update method. During training, the deep reinforcement learning algorithm simulates the process of a blender learning and accumulating experience through multiple rounds of decision-making. Different finished liquor recipes can be selected using a computer to complete this trial-and-error learning and experience-accumulation process. Combined with the deep reinforcement learning algorithm, each round of decision-making is viewed as a decision sequence of human attempts to blend finished liquor. The metrics include the sum of total cost error and physicochemical index error, as well as the deviation in the taste of the blended liquor. The decision result is compared with the expected recipe. If there is a large deviation in trace components (i.e., the deviation of a single trace component from the recipe is greater than one-tenth of the recipe value), it is recorded as a penalty term. The reward value for a particular decision is given to the decision-making part, similar to the process of human experience accumulation. This penalty term ensures a balance in taste.
Citation Information
Patent Citations
White spirit blending control method and blending control system based on artificial intelligence
CN110540918A
Average SAC deep reinforcement learning method and system based on Q learning
CN114881228A
