Method and device for predicting, regulating and controlling intramuscular fat of broiler chicken based on deep learning
Through deep learning technology, combined with time convolution network and MAMBA model, and combined with improved dung beetle optimization algorithm, the problems of fat prediction and growth environment regulation in broiler are solved, and the quality of broiler and health protection is improved.
Patent Information
- Application Number
- CN202411249599.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-27
AI Technical Summary
The quality of broiler is difficult to control and cannot be regulated based on the real-time broiler growth environment, resulting in inaccurate prediction of the fat content in the chicken, affecting the quality of chicken and consumer health.
Using a deep learning-based method, the time convolution network (TCN) and MAMBA fusion model is constructed, combined with the improved dung beetle optimization algorithm (ODBO), the accurate prediction of fat in broiler muscles and the precise regulation of the growth environment are achieved.
It significantly improves the efficiency and accuracy of predicting fat content in broiler muscles, achieves accurate regulation of the broiler growth environment, and improves the quality of chicken and consumers' health.
Smart Images

Figure CN119202718A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the prediction of intramuscular fat content of broilers and the regulation of the production and breeding environment of broilers, and in particular to a method and device for predicting and regulating intramuscular fat content of broilers based on deep learning. Background Art
[0002] Chicken is a popular healthy food that not only tastes delicious but also has high nutritional value. Chicken is rich in protein, which is essential for maintaining good health. The intramuscular fat of broilers is one of the important indicators of chicken quality. Too high a fat content may cause the chicken to taste bad, while too low a fat content may mean a decrease in the nutritional value of the chicken. Therefore, accurately predicting the intramuscular fat content of chicken is very important to ensure the quality of chicken and the health of consumers. However, the current broiler production has problems such as the difficulty in controlling the quality of broilers and the inability to regulate according to the real-time broiler growth environment.
[0003] In view of the above problems, the present invention proposes a method and device for predicting and regulating intramuscular fat of broilers based on deep learning, which mainly includes a data acquisition module, a broiler growth period prediction module, an optimization and regulation module, and a growth environment control module. The research method realizes accurate prediction of intramuscular fat of broilers by constructing a temporal convolutional network (TCN) and MAMBA fusion model, and accurately regulates the growth environment of broilers, providing technical support for improving the quality of chicken. Summary of the invention
[0004] Purpose of the invention: In response to the problems in the background technology, the present invention discloses a method and device for predicting and regulating intramuscular fat of broilers based on deep learning, which can accurately predict the intramuscular fat of broilers, provide a broiler intramuscular fat prediction device, and provide a control method and a broiler growth environment control device with small errors and capable of accurately adjusting the broiler growth environment.
[0005] Technical solution: The present invention discloses a method for predicting and regulating intramuscular fat of broilers based on deep learning, comprising the following steps:
[0006] Step (1): collecting broiler growth condition parameters including temperature, humidity, food intake and exercise volume, as well as intramuscular fat data corresponding to each broiler; correcting the original missing and abnormal data, and performing normalization processing;
[0007] Step (2): Divide the preprocessed data into a training set, a validation set, and a test set; construct a TCN-MAMBA fusion model through the temporal convolutional network TCN and the MAMBA model, the temporal convolutional network TCN extracts the spatiotemporal features in the time series, the MAMBA model captures the global temporal correlation of the time series, and performs spatiotemporal feature fusion; use the training set to train the TCN-MAMBA fusion model;
[0008] Step (3): using piecewise chaotic mapping to initialize the population of the dung beetle optimization algorithm DBO, integrating the osprey algorithm OOA to make up for the problem that the dung beetle algorithm only relies on the worst value in the rolling stage, and obtaining the improved dung beetle optimization algorithm ODBO; using the improved dung beetle optimization algorithm ODBO to optimize the hyperparameters of the TCN-MAMBA fusion model, the hyperparameters include learning rate and the number of neurons in the hidden layer;
[0009] Step (4): using the optimized TCN-MAMBA fusion model to predict broiler intramuscular fat and establish a broiler growth period prediction model, specifically including using broiler growth condition parameters including temperature, humidity, food intake and exercise as inputs of the optimized TCN-MAMBA fusion model to obtain broiler growth period prediction results;
[0010] Step (5): Based on the established broiler growth period prediction model, the optimal broiler growth environment parameters are found through the improved dung beetle optimization algorithm ODBO, and then regulated to achieve precise adjustment of the broiler growth environment.
[0011] Furthermore, the step (1) corrects the original missing and abnormal data and performs normalization processing as follows:
[0012] Step 1.1: Use the 3σ rule to correct abnormal data. Set the values of data Y to be concentrated in the interval (μ-3σ, μ+3σ). The possibility of exceeding this range is less than 0.3%. Data outside the range are considered to be abnormal values, that is, the abnormal values are deleted;
[0013] Step 2.2: Use the min-max normalization method to normalize the corrected data.
[0014] Furthermore, the specific process of step (2) is as follows:
[0015] Step 2.1: Divide the data preprocessed in step (1) into training set, validation set and test set in a ratio of 6:2:2;
[0016] Step 2.2: Fuse the temporal convolutional network TCN and MAMBA models; first extract spatial features of the input time series through causal convolution;
[0017] Step 2.3: Perform pooling operations, introduce activation functions, weight normalization, and Dropout operations;
[0018] Step 2.4: Input the output of TCN into the MAMBA neural network;
[0019] Step 2.5: Construct the MAMBA model, the formula is as follows:
[0020]
[0021] y t =Ch t
[0022]
[0023]
[0024] Among them, h t is the hidden state at time step t, x t is the input at time t, y t is the output at time t, h t-1 is the hidden state at time step t-1; A is the discretized state matrix, which controls the system state change; B is the discretized input matrix, which is used to map the input signal to the system state; C is also one of the discretized parameters, which is used to map the system state to the output signal; and It is the parameter matrix calculated dynamically based on the input, which is used to update the hidden state; ΔA is the index of the discretized state matrix A, which is used to calculate the value of the discrete state matrix A; ΔB is the adjustment term of the discretized input matrix B, which is used to calculate the value of the discrete input matrix B; I is the unit matrix.
[0025] Step 2.6: Use the training set and validation set divided in step 2.1 to train and validate the TCN-MAMBA fusion model, and use the TCN-MAMBA fusion model to predict the test set.
[0026] Furthermore, the improved dung beetle optimization algorithm ODBO in step (3) is specifically:
[0027] Step 3.1: Set the population size and number of iterations of the ODBO algorithm, as well as the upper and lower limits of the search space;
[0028] Step 3.2: Use piecewise chaotic mapping to randomly initialize the population position. The population position is the number of hidden layer neurons and the learning rate. The piecewise chaotic mapping formula is as follows:
[0029]
[0030] Where: X n It represents the initial condition of the chaotic mapping; P represents the control parameter of the chaotic mapping; the value of P is 0.4;
[0031] Step 3.3: Take the prediction error of broiler intramuscular fat as the objective function and calculate the fitness value of each individual;
[0032] Step 3.4: Select the global optimal solution, update the position of all dung beetles, that is, the position and speed of each individual, and determine whether each individual exceeds the boundary. The position update formulas are respectively for rolling dung beetles, breeding dung beetles, foraging dung beetles, and thief dung beetles; the global exploration strategy of the Osprey optimization algorithm OOA in the first stage is used to replace the rolling stage position update formula of the original dung beetle algorithm DBO to make up for the shortcomings of the dung beetle algorithm in the rolling behavior that only relies on the worst value, cannot communicate with other dung beetles in time, and has more parameters;
[0033] Step 3.5: Select the best individual, that is, in each iteration, select the individual with the best fitness and record its individual position;
[0034] Step 3.6: Determine whether the maximum number of iterations has been reached. If so, end the process. Otherwise, return to step 3.3 and repeat the above steps.
[0035] Step 3.7: Return the optimal individual position and its fitness value, map the optimal individual position into the number of neurons and learning rate in the hidden layer of the model, and the optimization is completed.
[0036] Furthermore, in step 3.4, the global optimal solution is selected to update the positions of all dung beetles, as follows:
[0037] Step 3.4.1: Rolling ball dung beetle: The global exploration strategy of the Osprey optimization algorithm OOA in the first stage is used to replace the rolling ball stage position update formula of the original dung beetle algorithm DBO to make up for the shortcomings of the dung beetle algorithm in the rolling ball behavior that only relies on the worst value, cannot communicate with other dung beetles in time, and has too many parameters; the global exploration strategy formula of the Osprey optimization algorithm in the first stage is as follows:
[0038]
[0039] in, is the new position of the i-th osprey in the first stage, and x i,j is the current position of the i-th osprey in the j-th dimension; r i,j is a random number between [0,1]; SF i,j The location of the fish selected for the i-th osprey; I i,j is a random number in the set {1,2}, used to decide whether to increase or decrease the position update;
[0040] Step 3.4.2: Reproduction of dung beetles: In order to safely reproduce offspring, it is crucial for dung beetles to choose a suitable oviposition site; the boundary selection strategy of female dung beetles for laying eggs is expressed as:
[0041] Lb* =max(X * ×(1-R),Lb)
[0042] Ub * =min(X * ×(1+R),Ub)
[0043] The formula for updating the position of the dung beetle is as follows:
[0044] B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * )
[0045] Where: X * Indicates the current local optimal position, Lb * and Ub * Respectively represent the lower and upper limits of the spawning area: R = 1-t / T max , T max represents the maximum number of iterations, Lb and Ub represent the lower and upper bounds of the optimization problem respectively; B i (t) is the position information of the i-th egg ball at the t-th iteration, b1 and b2 represent two independent random variables of size 1×D, and D represents the dimension of the optimization problem;
[0046] Step 3.4.3: Foraging dung beetles: Grown-up adults need to drill out of the ground to forage, so an optimal foraging area is established to guide dung beetles to forage. The boundaries of the optimal foraging area are:
[0047] L b =max(X b *(1-R), L)
[0048] U b =max(X b *(1+R),U)
[0049] Where, L b represents the lower bound of the optimal foraging area; U b represents the upper bound of the optimal foraging area; X b represents the global best foraging position, and the position of the dung beetle is updated as follows:
[0050] x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b )
[0051] Where: x i (t+1) represents the updated position information, x i (t) represents the position information of the i-th dung beetle at the t-th iteration, C1 represents a random number that obeys a normal distribution, and C2 represents a random vector of (0,1); Lb b and Ub b represent the upper and lower limits of the optimal foraging area, respectively;
[0052] Step 3.4.4: Thief dung beetle: steal food from other dung beetles. From step 3.4.3, we know the global optimal foraging position X b This is the best food source location, so set X b Competing for the best food position, during the iteration process, the position of the thief dung beetle is:
[0053] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |)
[0054] Where: x i (t) represents the location information of the i-th thief at the t-th iteration, g is a random vector of size 1×D that obeys the normal distribution, and S represents a constant.
[0055] Furthermore, the step (4) is specifically as follows:
[0056] The optimal hyperparameters found by iteratively using the improved dung beetle optimization algorithm ODBO in step (3) are introduced into the TCN-MAMBA fusion model; the broiler growth condition parameters of temperature, humidity, food intake and exercise amount are used as the input of the TCN-MAMBA fusion model, and the broiler intramuscular fat is used as the output to complete the prediction of broiler intramuscular fat.
[0057] Furthermore, the broiler growth environment optimization in step (5) is specifically as follows:
[0058] Step 5.1: Initialize the dung beetle population position, each dung beetle population position corresponds to a broiler growth environment parameter value;
[0059] Step 5.2: The deviation between the intramuscular fat content of broilers under the current production environment conditions and the intramuscular fat content of mature broilers is used as the objective function, and the fitness of each individual is calculated. The fitness function formula is as follows:
[0060] F(x)=|xx k |
[0061] Among them, F(x) represents the fitness value, x is the intramuscular fat content of broiler chickens under the current production environment conditions, and x k is the intramuscular fat content of mature broiler chickens;
[0062] Step 5.3: Select the global optimal solution, update the positions of all dung beetles, that is, the position and speed of each individual, and determine whether each individual exceeds the boundary;
[0063] Step 5.4: Select the best individual, that is, in each iteration, select the individual with the best fitness and record the position of the best individual;
[0064] Step 5.5: Determine whether the maximum number of iterations has been reached, if so, end the process, otherwise return to step S5.2 to continue execution;
[0065] Step 5.6: Return the optimal individual position and its fitness value, map the optimal individual position into broiler growth condition parameters, and the optimization is completed.
[0066] The present invention also discloses a device based on the above-mentioned deep learning-based broiler intramuscular fat prediction and regulation method, comprising a data acquisition module, a broiler growth period prediction module, an optimization regulation module and a growth environment control module;
[0067] The data acquisition module includes: an exercise monitoring device, a food intake monitoring device, a temperature sensor and a humidity sensor. The exercise detection device and the food intake monitoring device are realized by equipping each broiler with a Bluetooth foot ring and using a camera to collect the broiler's exercise status and food intake status, and uploading them to the server through a switch to monitor the exercise and food intake of each broiler; the temperature sensor and the humidity sensor are installed around the chicken house to realize the collection of real-time data;
[0068] The broiler growth period prediction module is used to build a TCN-MAMBA fusion model; the DBO optimization algorithm is improved by using Piecewise chaos mapping and fusion OOA optimization algorithm; the hyperparameters of the TCN-MAMBA model are optimized based on the improved ODBO optimization algorithm; the broiler growth condition parameters including temperature, humidity, feed intake and exercise volume are used as the input of the TCN-MAMBA prediction model, and the broiler intramuscular fat is used as the output to complete the prediction of broiler intramuscular fat;
[0069] The central control module includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, a method for predicting intramuscular fat of growing broilers is implemented to obtain a prediction result of intramuscular fat of broilers;
[0070] The optimization and control module is used to find the optimal broiler growth environment parameters based on the established broiler growth period prediction model through the ODBO algorithm, and perform regulation to achieve precise regulation of the broiler growth environment;
[0071] The growth environment control module includes a temperature regulator, a humidity regulator, an automatic feeding device and an automatic driving device.
[0072] Beneficial effects:
[0073] (1) The present invention constructs a TCN-MAMBA fusion model by combining the temporal convolutional network (TCN) and the MAMBA model, which significantly improves the efficiency and accuracy of the model in predicting the intramuscular fat content of broilers;
[0074] (2) The Piecewise chaotic mapping method is used to initialize the population position of the algorithm, which can introduce a certain degree of randomness into the algorithm and improve the convergence speed of the algorithm; the Osprey algorithm (OOA) is integrated to make up for the problem that the dung beetle algorithm only relies on the worst value in the rolling stage, and the improved dung beetle optimization algorithm (ODBO) is obtained; ODBO is used to optimize the hyperparameters of the TCN-MAMBA joint model, making the optimized hyperparameters more accurate and improving the prediction accuracy of broiler intramuscular fat. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 It is a schematic diagram of the process of the present invention;
[0076] Figure 2 It is the structure diagram of TCN;
[0077] Figure 3 This is the MAMBA structure diagram;
[0078] Figure 4 It is the flow chart of ODBO algorithm;
[0079] Figure 5 Schematic diagram of the prediction and control device. DETAILED DESCRIPTION
[0080] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0081] The present invention discloses a method and device for predicting and regulating intramuscular fat in broilers based on deep learning, see Figures 1 to 5 , specifically including the following steps:
[0082] (1) Collect broiler growth condition parameters including temperature, humidity, food intake and exercise volume, as well as the corresponding intramuscular fat data of each broiler; further correct the original missing and abnormal data and perform normalization.
[0083] Step 1.1: Use the 3σ rule to correct abnormal data. Generally speaking, it can be considered that the values of data Y are almost all concentrated in the interval (μ-3σ, μ+3σ), and the possibility of exceeding this range is less than 0.3%. These data beyond the range can be considered as outliers, that is, the outliers are deleted.
[0084] Step 1.2: Use the min-max normalization method to normalize the above corrected data. The formula is as follows:
[0085]
[0086] In the formula, x * is the normalized data, x is the original data to be processed, and x min is the minimum value in the original data, x max It is the maximum value in the original data, and the normalized data value is between 0 and 1.
[0087] (2) The preprocessed data is divided into training set, validation set and test set. The TCN-MAMBA fusion model is constructed through the temporal convolutional network (TCN) and the MAMBA model. The TCN extracts the spatiotemporal features in the time series, and the MAMBA model captures the global temporal correlation of the time series and performs spatiotemporal feature fusion.
[0088] Step 2.1: Divide the data preprocessed in step (1) into training set, validation set and test set in a ratio of 6:2:2;
[0089] Step 2.2: Fuse the temporal convolutional network TCN and MAMBA models, and extract spatial features of the input time series through causal convolution. The formula is:
[0090]
[0091] Where F = (f1, f2, ..., f k ) is the filter, X=(x1,x2,…,x T ) is the input sequence, x t is the input layer node, K is the complete width of the convolution kernel, and k is the effective width of the convolution kernel;
[0092] Step 2.3: Perform pooling operation, the formula is:
[0093]
[0094] Among them, y kij Represents the rectangular area related to the kth feature map, R ij The maximum pooling output value, x kpqRepresents the rectangular area R ij The element at (p, q) in .
[0095] Step 2.4: Introduce activation function, weight normalization and Dropout operation;
[0096] Step 2.5: Input the output of TCN into the MAMBA neural network;
[0097] Step 2.6: Construct the MAMBA model, the formula is as follows:
[0098]
[0099] Among them, h t is the hidden state at time step t, x t is the input at time t, y t is the output at time t, h t-1 is the hidden state at time step t-1; A is one of the discretized parameters, which controls the system state change; B is one of the discretized parameters, which is used to map the input signal to the system state; C is also one of the discretized parameters, which is used to map the system state to the output signal; and It is the parameter matrix calculated dynamically based on the input, which is used to update the hidden state; ΔA is the index of the discretized state matrix A, which is used to calculate the value of the discrete state matrix A; ΔB is the adjustment term of the discretized input matrix B, which is used to calculate the value of the discrete input matrix B; I is the unit matrix.
[0100] The TCN-MAMBA fusion model can effectively extract local features of time series and capture long-term dependencies of time series through the MAMBA model. This combination enables the model to capture short-term changes and understand long-term trends when processing time series data; and the TCN-MAMBA model introduces selective state space models (Selective SSMs), which allows the model to selectively propagate or forget information dynamically based on input data, and enhances the model's reasoning ability on content.
[0101] Step 2.7: Use the training set and validation set divided in step 3.1 to train and validate the TCN-MAMBA fusion model, and use the fusion model to predict the test set.
[0102] (3) Piecewise chaotic mapping is used to initialize the population of the dung beetle optimization algorithm (DBO), and the osprey algorithm (OOA) is integrated to make up for the problem that the dung beetle algorithm only relies on the worst value in the rolling stage, and the improved dung beetle optimization algorithm (ODBO) is obtained; ODBO is used to optimize the hyperparameters of the TCN-MAMBA joint model, including the learning rate and the number of hidden layer neurons.
[0103] Step 3.1: Set the population size of the ODBO algorithm to 50, the maximum number of iterations to 200, and the upper and lower limits of the search space.
[0104] Step 3.2: Use piecewise chaotic mapping to randomly initialize the population position. The population position is the number of hidden layer neurons and the learning rate. The piecewise chaotic mapping formula is as follows:
[0105]
[0106] Where: X n It represents the initial condition of the chaotic mapping; P represents the control parameter of the chaotic mapping; the value of P is 0.4;
[0107] Step 3.3: Take the prediction error of broiler intramuscular fat as the objective function and calculate the fitness value of each individual.
[0108] Step 3.4: Select the global optimal solution, update the positions of all dung beetles, that is, the position and speed of each individual, and determine whether each individual exceeds the boundary. The position update formulas are respectively for rolling dung beetles, breeding dung beetles, foraging dung beetles, and thief dung beetles. The specific formulas are as follows:
[0109] Step 3.4.1: Rolling ball dung beetle: The global exploration strategy of the Osprey Optimization Algorithm (OOA) in the first stage is used to replace the rolling ball stage position update formula of the original dung beetle algorithm (DBO) to make up for the shortcomings of the dung beetle algorithm in rolling ball behavior, which only relies on the worst value, cannot communicate with other dung beetles in time, and has too many parameters. The global exploration strategy formula of the Osprey Optimization Algorithm in the first stage is as follows:
[0110]
[0111] in, is the new position of the i-th osprey in the first stage, and x i,j is the current position of the i-th osprey in the j-th dimension; r i,j is a random number between [0,1]; SF i,j The location of the fish selected for the i-th osprey; I i,j is a random number in the set {1,2}, used to decide whether to increase or decrease the position update;
[0112] Step 3.4.2: Reproduction of dung beetles: In order to safely reproduce offspring, it is crucial for dung beetles to choose a suitable place to lay eggs. The boundary selection strategy of female dung beetles for laying eggs is expressed as:
[0113] Lb * =max(X * ×(1-R),Lb)
[0114] Ub * =min(X * ×(1+R),Ub)
[0115] The formula for updating the position of the dung beetle is as follows:
[0116] B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * )
[0117] Where: X * Indicates the current local optimal position, Lb * and Ub * Respectively represent the lower and upper limits of the spawning area: R = 1-t / T max , T max represents the maximum number of iterations, Lb and Ub represent the lower and upper bounds of the optimization problem respectively. i (t) is the position information of the i-th egg ball at the t-th iteration, b1 and b2 represent two independent random variables of size 1×D, and D represents the dimension of the optimization problem.
[0118] Step 3.4.3: Foraging dung beetles: Grown-up adults need to drill out of the ground to forage, so an optimal foraging area is established to guide dung beetles to forage. The boundaries of the optimal foraging area are:
[0119] L b =max(X b *(1-R), L)
[0120] U b =max(X b *(1+R),U)
[0121] Where, L b represents the lower bound of the optimal foraging area; U b represents the upper bound of the optimal foraging area; X b represents the global optimal foraging position. The position of the dung beetle is updated as follows:
[0122] x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b )
[0123] Where: x i(t) represents the position information of the i-th dung beetle at the t-th iteration; C1 represents a random number that obeys the normal distribution; C2 represents a random vector of (0,1); Lb b and Ub b Represent the upper and lower limits of the optimal foraging area respectively.
[0124] Step 3.4.4: Thief dung beetles: They steal food from other dung beetles. From step 4.3.3, we know that X b is the best food source location, so you can set X b Compete for the best food. During the iteration, the position of the thief dung beetle is:
[0125] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |)
[0126] Where: x i (t) represents the location information of the i-th thief at the t-th iteration, g is a random vector of size 1×D that obeys the normal distribution, and S represents a constant.
[0127] Step 3.5: Select the best individual, that is, in each iteration, select the individual with the best fitness and record its individual position;
[0128] Step 3.6: Determine whether the maximum number of iterations has been reached. If so, end the process. Otherwise, return to step 3.3 and repeat the above steps.
[0129] Step 3.7: Return the optimal individual position and its fitness value, map the optimal individual position to the number of neurons and learning rate in the hidden layer of the model, and the optimization is completed;
[0130] (4) The optimized TCN-MAMBA joint model was used to predict the intramuscular fat of broilers and a broiler growth period prediction model was established. Specifically, the broiler growth condition parameters including temperature, humidity, feed intake and exercise amount were used as the input of the ODBO-TCN-MAMBA prediction model to obtain the broiler growth period prediction results.
[0131] (5) Based on the established broiler growth period prediction model, the ODBO algorithm is used to find the optimal broiler growth environment parameters and regulate them to achieve precise adjustment of the broiler growth environment.
[0132] Step 5.1: Initialize the dung beetle population position, each dung beetle population position corresponds to a broiler growth environment parameter value;
[0133] Step 5.2: The deviation between the intramuscular fat content of broilers under the current production environment conditions and the intramuscular fat content of mature broilers is used as the objective function, and the fitness of each individual is calculated. The fitness function formula is as follows:
[0134] F(x)=|xx k |
[0135] Among them, F(x) represents the fitness value, x is the intramuscular fat content of broiler chickens under the current production environment conditions, and x k It is the intramuscular fat content of mature broiler chickens.
[0136] Step 5.3: Select the global optimal solution, update the positions of all dung beetles, that is, the position and speed of each individual, and determine whether each individual exceeds the boundary.
[0137] Step 5.4: Select the best individual, that is, in each iteration, select the individual with the best fitness and record the position of the best individual.
[0138] Step 5.5: Determine whether the maximum number of iterations has been reached. If so, end the process; otherwise, return to step 5.2 to continue.
[0139] Step 5.6: Return the optimal individual position and its fitness value, map the optimal individual position into broiler growth condition parameters, and the optimization is completed.
[0140] (6) Construct a broiler intramuscular fat prediction and control device based on deep learning, which mainly includes: data acquisition module, broiler growth period prediction module, optimization and control module and growth environment control module.
[0141] Step 6.1: The data acquisition module includes:
[0142] The apparatus comprises an exercise volume monitoring device, a food intake monitoring device, a temperature sensor and a humidity sensor. The exercise volume monitoring device and the food intake monitoring device are characterized in that each broiler is equipped with a Bluetooth anklet, and the camera is used to collect the exercise status and food intake status of the broiler, and the data are uploaded to the server through the switch to realize the monitoring of the exercise volume and food intake of each broiler; the temperature sensors and humidity sensors are installed around the chicken house to realize the collection of real-time data.
[0143] Step 6.2: The broiler growth period prediction module includes:
[0144] Construct a TCN-MAMBA fusion model; use Piecewise chaotic mapping and fusion OOA optimization algorithm to improve the DBO optimization algorithm; optimize the hyperparameters of the TCN-MAMBA model based on the improved ODBO optimization algorithm; use broiler growth condition parameters including temperature, humidity, feed intake and exercise as the input of the TCN-MAMBA prediction model, and use broiler intramuscular fat as the output to complete the prediction of broiler intramuscular fat.
[0145] And, a central control module includes a memory and a processor, wherein a first computer program is stored in the memory, and when the first computer program is executed by the processor, a method for predicting intramuscular fat of growing broilers is implemented to obtain a prediction result of intramuscular fat of broilers.
[0146] Step 6.3: The optimization control module and the growth environment control module include:
[0147] The optimization and control module includes: based on the established broiler growth period prediction model, the ODBO algorithm is used to find the optimal broiler growth environment parameters, and then control them to achieve precise adjustment of the broiler growth environment.
[0148] Broiler growth environment regulation equipment, including temperature regulator, humidity regulator, automatic feeding device and automatic driving device.
[0149] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting and regulating intramuscular fat in broilers based on deep learning, characterized in that: The steps include: Step (1): collecting broiler growth condition parameters including temperature, humidity, food intake and exercise volume, as well as intramuscular fat data corresponding to each broiler; correcting the original missing and abnormal data, and performing normalization processing; Step (2): Divide the preprocessed data into a training set, a validation set, and a test set; construct a TCN-MAMBA fusion model through the temporal convolutional network TCN and the MAMBA model. The temporal convolutional network TCN extracts the spatiotemporal features in the time series, and the MAMBA model captures the global temporal correlation of the time series and performs spatiotemporal feature fusion; Use the training set to train the TCN-MAMBA fusion model; Step (3): using piecewise chaotic mapping to initialize the population of the dung beetle optimization algorithm DBO, integrating the osprey algorithm OOA to make up for the problem that the dung beetle algorithm only relies on the worst value in the rolling stage, and obtaining the improved dung beetle optimization algorithm ODBO; using the improved dung beetle optimization algorithm ODBO to optimize the hyperparameters of the TCN-MAMBA fusion model, the hyperparameters include learning rate and the number of neurons in the hidden layer; Step (4): using the optimized TCN-MAMBA fusion model to predict broiler intramuscular fat and establish a broiler growth period prediction model, specifically including using broiler growth condition parameters including temperature, humidity, food intake and exercise as inputs of the optimized TCN-MAMBA fusion model to obtain broiler growth period prediction results; Step (5): Based on the established broiler growth period prediction model, the optimal broiler growth environment parameters are found through the improved dung beetle optimization algorithm ODBO, and then regulated to achieve precise adjustment of the broiler growth environment.
2. The method for predicting and controlling broiler intramuscular fat based on deep learning according to claim 1, characterized in that: The step (1) corrects the original missing and abnormal data and performs normalization processing, specifically: Step 1.1: Use the 3σ rule to correct abnormal data. Set the values of data Y to be concentrated in the interval (μ-3σ, μ+3σ). The possibility of exceeding this range is less than 0.3%. Data outside the range are considered to be abnormal values, that is, the abnormal values are deleted; Step 2.2: Use the min-max normalization method to normalize the corrected data.
3. The method for predicting and controlling broiler intramuscular fat based on deep learning according to claim 1, characterized in that: The specific process of step (2) is as follows: Step 2.1: Divide the data preprocessed in step (1) into training set, validation set and test set in a ratio of 6:2:2; Step 2.2: Fuse the temporal convolutional network TCN and MAMBA models; first extract spatial features of the input time series through causal convolution; Step 2.3: Perform pooling operations, introduce activation functions, weight normalization, and Dropout operations; Step 2.4: Input the output of TCN into the MAMBA neural network; Step 2.5: Construct the MAMBA model, the formula is as follows: the t =Ch t Among them, h t is the hidden state at time step t, x t is the input at time t, y t is the output at time t, h t-1 is the hidden state at time step t-1; A is the discretized state matrix, which controls the system state change; B is the discretized input matrix, which is used to map the input signal to the system state; C is also one of the discretized parameters, which is used to map the system state to the output signal; and It is the parameter matrix calculated dynamically based on the input, which is used to update the hidden state; ΔA is the index of the discretized state matrix A, which is used to calculate the value of the discrete state matrix A; ΔB is the adjustment term of the discretized input matrix B, which is used to calculate the value of the discrete input matrix B; I is the unit matrix. Step 2.6: Use the training set and validation set divided in step 2.1 to train and validate the TCN-MAMBA fusion model, and use the TCN-MAMBA fusion model to predict the test set.
4. The method for predicting and controlling broiler intramuscular fat based on deep learning according to claim 1, characterized in that: The improved dung beetle optimization algorithm ODBO in step (3) is specifically: Step 3.1: Set the population size and number of iterations of the ODBO algorithm, as well as the upper and lower limits of the search space; Step 3.2: Use piecewise chaotic mapping to randomly initialize the population position. The population position is the number of hidden layer neurons and the learning rate. The piecewise chaotic mapping formula is as follows: Where: X n It represents the initial condition of the chaotic mapping; P represents the control parameter of the chaotic mapping; the value of P is 0.4; Step 3.3: Take the prediction error of broiler intramuscular fat as the objective function and calculate the fitness value of each individual; Step 3.4: Select the global optimal solution, update the position of all dung beetles, that is, the position and speed of each individual, and determine whether each individual exceeds the boundary. The position update formulas are respectively for rolling dung beetles, breeding dung beetles, foraging dung beetles, and thief dung beetles; the global exploration strategy of the Osprey optimization algorithm OOA in the first stage is used to replace the rolling stage position update formula of the original dung beetle algorithm DBO to make up for the shortcomings of the dung beetle algorithm in the rolling behavior that only relies on the worst value, cannot communicate with other dung beetles in time, and has more parameters; Step 3.5: Select the best individual, that is, in each iteration, select the individual with the best fitness and record its individual position; Step 3.6: Determine whether the maximum number of iterations has been reached. If so, end the process. Otherwise, return to step 3.3 and repeat the above steps. Step 3.7: Return the optimal individual position and its fitness value, map the optimal individual position into the number of neurons and learning rate in the hidden layer of the model, and the optimization is completed.
5. The method for predicting and controlling broiler intramuscular fat based on deep learning according to claim 4, characterized in that: In step 3.4, the global optimal solution is selected to update the positions of all dung beetles, as follows: Step 3.4.1: Rolling ball dung beetle: The global exploration strategy of the Osprey optimization algorithm OOA in the first stage is used to replace the rolling ball stage position update formula of the original dung beetle algorithm DBO to make up for the shortcomings of the dung beetle algorithm in the rolling ball behavior that only relies on the worst value, cannot communicate with other dung beetles in time, and has too many parameters; the global exploration strategy formula of the Osprey optimization algorithm in the first stage is as follows: in, is the new position of the i-th osprey in the first stage, and x i,j is the current position of the i-th osprey in the j-th dimension; r i,j is a random number between [0,1]; SF i,j The location of the fish selected for the i-th osprey; I i,j is a random number in the set {1,2}, used to decide whether to increase or decrease the position update; Step 3.4.2: Reproduction of dung beetles: In order to safely reproduce offspring, it is crucial for dung beetles to choose a suitable oviposition site; the boundary selection strategy of female dung beetles for laying eggs is expressed as: Lb*=max(X*×(1-R),Lb) Ub*=min(X*×(1+R),Ub) The formula for updating the position of the dung beetle is as follows: B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * ) Where: X * Indicates the current local optimal position, Lb * and Ub * Respectively represent the lower and upper limits of the spawning area: R = 1-t / T max , T max represents the maximum number of iterations, Lb and Ub represent the lower and upper bounds of the optimization problem respectively; B i (t) is the position information of the i-th egg ball at the t-th iteration, b1 and b2 represent two independent random variables of size 1×D, and D represents the dimension of the optimization problem; Step 3.4.3: Foraging dung beetles: Grown-up adults need to drill out of the ground to forage, so an optimal foraging area is established to guide dung beetles to forage. The boundaries of the optimal foraging area are: L b =max(X b *(1-R),L) U b =max(X b *(1+R),U) Where, L b represents the lower bound of the optimal foraging area; U b represents the upper bound of the optimal foraging area; X b represents the global best foraging position, and the position of the dung beetle is updated as follows: x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b ) Where: x i (t+1) represents the updated position information, x i (t) represents the position information of the i-th dung beetle at the t-th iteration, C1 represents a random number that obeys a normal distribution, and C2 represents a random vector of (0,1); Lb b and Ub b represent the upper and lower limits of the optimal foraging area, respectively; Step 3.4.4: Thief dung beetle: steal food from other dung beetles. From step 3.4.3, we know the global optimal foraging position X b This is the best food source location, so set X b Competing for the best food position, during the iteration process, the position of the thief dung beetle is: x i (t+1)=X b +S×g×(x i (t)-X * +x i (t)-X b |) Where: x i (t) represents the location information of the i-th thief at the t-th iteration, g is a random vector of size 1×D that obeys the normal distribution, and S represents a constant.
6. The method for predicting and controlling broiler intramuscular fat based on deep learning according to claim 1, characterized in that: The step (4) is specifically: The optimal hyperparameters found by iteratively using the improved dung beetle optimization algorithm ODBO in step (3) are introduced into the TCN-MAMBA fusion model; the broiler growth condition parameters of temperature, humidity, food intake and exercise amount are used as the input of the TCN-MAMBA fusion model, and the broiler intramuscular fat is used as the output to complete the prediction of broiler intramuscular fat.
7. The method for predicting and controlling broiler intramuscular fat based on deep learning according to claim 1, characterized in that: The optimization of the broiler growth environment in step (5) is specifically as follows: Step 5.1: Initialize the dung beetle population position, each dung beetle population position corresponds to a broiler growth environment parameter value; Step 5.2: The deviation between the intramuscular fat content of broilers under the current production environment conditions and the intramuscular fat content of mature broilers is used as the objective function, and the fitness of each individual is calculated. The fitness function formula is as follows: F(x)=|x-x k | Among them, F(x) represents the fitness value, x is the intramuscular fat content of broiler chickens under the current production environment conditions, and x k is the intramuscular fat content of mature broiler chickens; Step 5.3: Select the global optimal solution, update the positions of all dung beetles, that is, the position and speed of each individual, and determine whether each individual exceeds the boundary; Step 5.4: Select the best individual, that is, in each iteration, select the individual with the best fitness and record the position of the best individual; Step 5.5: Determine whether the maximum number of iterations has been reached, if so, end the process, otherwise return to step S5.2 to continue execution; Step 5.6: Return the optimal individual position and its fitness value, map the optimal individual position into broiler growth condition parameters, and the optimization is completed.
8. A device for predicting and regulating broiler intramuscular fat based on deep learning according to any one of claims 1 to 7, characterized in that: It includes data acquisition module, broiler growth period prediction module, optimization and regulation module and growth environment control module; The data acquisition module includes: an exercise monitoring device, a food intake monitoring device, a temperature sensor and a humidity sensor. The exercise detection device and the food intake monitoring device are realized by equipping each broiler with a Bluetooth foot ring and using a camera to collect the broiler's exercise status and food intake status, and uploading them to the server through a switch to monitor the exercise and food intake of each broiler; the temperature sensor and the humidity sensor are installed around the chicken house to realize the collection of real-time data; The broiler growth period prediction module is used to build a TCN-MAMBA fusion model; the DBO optimization algorithm is improved by using Piecewise chaos mapping and fusion OOA optimization algorithm; the hyperparameters of the TCN-MAMBA model are optimized based on the improved ODBO optimization algorithm; the broiler growth condition parameters including temperature, humidity, feed intake and exercise volume are used as the input of the TCN-MAMBA prediction model, and the broiler intramuscular fat is used as the output to complete the prediction of broiler intramuscular fat; The central control module includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, a method for predicting intramuscular fat of growing broilers is implemented to obtain a prediction result of intramuscular fat of broilers; The optimization and control module is used to find the optimal broiler growth environment parameters based on the established broiler growth period prediction model through the ODBO algorithm, and perform regulation to achieve precise regulation of the broiler growth environment; The growth environment control module includes a temperature regulator, a humidity regulator, an automatic feeding device and an automatic driving device.
Citation Information
Cited By
Electric power data leakage identification method and system based on deep learning
CN120579221A
Power data leakage identification method and system based on deep learning
CN120579221B
