<figure><img src="image_1.png" /></figure>

HAL
open science

# Using L-M BP Algorithm Forecast the 305 Days
## Production of First-Breed Dairy

Xiaoli Wei, Guoqiang Qi, Weizheng Shen, Sun Jian

► To cite this version:

Xiaoli Wei, Guoqiang Qi, Weizheng Shen, Sun Jian. Using L-M BP Algorithm Forecast the 305 Days Production of First-Breed Dairy. Third IFIP TC 12 International Conference on Computer and Computing Technologies in Agriculture III (CCTA), Oct 2009, Beijing, China. pp.359-363, 10.1007/978-3-642-12220-0_52. hal-01060511

HAL Id: hal-01060511

https://inria.hal.science/hal-01060511

Submitted on 4 Sep 2014

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
USING L-M BP ALGORITHM FORECASE THE
305 DAYS PRODUCTION OF FIRST-BREED
DARIY

Xiaoli Wei¹, Guoqiang Qi¹*, Weizheng Shen¹, Sun Jian¹

1Agricultural engineer center, Northeast Agricultural University, Harbin, Heilongjiang province, china, 150030

* Corresponding author, Address: Agricultural engineer Center, Northeast Agricultural University, Harbin, Heilongjiang Province, China,150030 Tel: +0451-55191146, Fax: +86-0451-55191146, Email: liuhaiyang790214@163.com

**Abstract:** Aiming at the shortage of conventional BP algorithm, a BP neural network improved by L-M algorithm is put forward. On the basis of the network, a Prediction model for 305 day's milk productions was set up. Traditional methods finish these data must spend at least 305 days, But this model can forecast first-breed dairy's 305 days milk production ahead of 215 days. The validity of the improved BP neural network predictive model was validated through the experiments.

**Keywords:** Dairy Milk production, prediction Neural Networks, BP algorithm-M algorithm.

# 1. INTRODUCTION

Milk yield is the main indexes to reflect and measure the cow's performance, and it is generally measured by a standard of 305 days milk yield in the world. But in the breeding work, we must calculate the milk production of 305 days, whether determining the descendants of bulls or assessing the quality of cows, which will take a long time and then extend the select cycle, thus how to use the cow's early productive performance to judge it good or not, and speed up the process of selection response has become the concerned and important topic(Qin zhirui, 2005).
In this paper, A prediction model based on L-M BP neural network will be introduced to use in estimating the dairy 305 days milk quantities (Jiaoji Cheng, 1992), significantly, the model not only can forecast 305 days milk quantities production of the first-breed cow ahead of 215 days but also speed up the process of breeding dairy.

## 1.1 Improved BP algorithm

Traditional BP algorithm uses the steepest gradient descent method to amend the weights, training course from starting point to reach the minimum point gradually along the slope of error function to reach iteration of each time. As for the complex network, error surface is in the multi-dimensional space, will therefore possibly fall into some local smallest dot in the training process, so that will be unable to restrain, in addition, on the one hand, the stability of traditional BP stable request study rate is very small in the, therefore, the gradient descent law makes the training process very slow, on the other hand, the learning rate of momentum method usually be quicker than the pure gradient descent method, however, it is still slow in the practical application, all of above, two methods are only usually suitable for the increment training(Yin chaotian, 2005).

This thesis will bring up the new method Levenberg-Marquardt training method which based on the characters of nonlinear system and considered to improve the traditional BP network, Levenberg-Marquardt training method can decrease sensitivity of the network regarding the erroneous surface local detail, and can limit the network to fall into the local minimum effectively, its basic idea is no longer along the sole anti-gradient direction to iterate of each time, but it permits error carry on the search along the worsened direction, greatly enhances the convergence rate and thepan-ability of network. This algorithm is much quicker than trainbp and train-bpx function's gradient descent law, but needs more memories (Wang yu, 1992).

# 2. PREDICTION MODEL FOR FIRST-BREEDING DAIRY

## 2.1 Sample deal and realize

Using the survey data which come from Heilongjiang province about the first breeding cow primary production and extracting 200 data recordings mainly include cow's maximum daily production, the 90 days and the 305 days production. Take 100 randomly selected records as the learning and
training sample, other 100 cows records are used as forecast model
examination sample, because the data range of variation is wide and the
dimension is different ,but the input and output based on neural network
should be limited in certain scope , making the biggest input still to fall in
the big place of neuron transforms function gradient , this may speed up the
training speed of network ,and can make the network training to be more
effective , so it must be standardized for the network.

## 2.2 Network design

In order to build up the neural network model, we firstly need to
determine the neural network structure of forecast model, using three-layer
neural network structure(Wen xin,Zhou lu,2005):Input, Hidden-layer,
Output .After building model, using this model can obtain cow's 305 days
milk production on Output. The number of input nodes (N) is related with
the input sample pattern. If the cow's highest milk production and 90 days
milk production are took as the input pattern ,then the number (n)=2, taking
the cow's 305days milk production as the output of network ,because the
samples in this article are few ,and only by an implicit strata, many strata
nodes must be established , the established strata nodal point number is 6n,
therefore ,the network architecture of forecasting model is n×6n×1,namely
2×12×1. The transfer function of input node uses sigmoid hyperbolic tangent
as formula (1)

$$
f(x) = \tanh(x) = \frac{e^x - e^{-x}}{e^x + e^{-x}} \quad (1)
$$

The transfer function of output node uses the linear function as formula
(2).

$$
f(x) = x \tag{2}
$$

2.3 Analysis

To forecast the cow's 305days milk production by improved BP network,
under Matlab programming environment, network setting allow to make the
max error is 0.01, the largest circulation is 10000 times, After training in
3904 iteration step-by-step ,consuming one minute and three seconds , the
network is restrain ,then we use the traditional bp network to test
samples(100 first-breeding cows ), compare with the milk production
between predicted production and actual production in 305 days milk
yield, we can find the max error of network is about 77kg, the smallest error is about 5 kg.

In order to reflect the superiority of improved BP(L-M BP) or traditional BP algorithm, fig.1 and fig.2 give the network's convergence situation of improved and traditional BP network in the same experimental data. As shown in fig 2 about the traditional BP network, the SSE is no longer to renew when training achieves the certain extent, and the slackness of network appeared, causing the network not to go on training, but the improved BP network can overcome this question, it can jump out local minimum by regulating network parameter constantly, thus the network could be trained rapidly(Wei xiaoli, 2006).

<figure><img src="image_3.png" /><figcaption>Fig.1 Improved BP network</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Fig.2 Traditional BP network</figcaption></figure>
3. EXPERIMENTS

L-M BP will not only improve the speed but also to improve the
operation stability, we use L-M BP for the three months testing in several

<table><caption>Tab.1 The result of the forecast model</caption>
  <thead>
    <tr>
      <th>n<br>um</th>
      <th>CowID</th>
      <th>the<br>maximum daily<br>milk production</th>
      <th>the 90 days<br>production /kg</th>
      <th>the 305 days<br>production /kg</th>
      <th>the<br>production<br>of 305 days<br>/kg</th>
      <th>forecasting<br>r/kg</th>
      <th>erro</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>491007</td>
      <td>20.2</td>
      <td>1541</td>
      <td>4597</td>
      <td>4641</td>
      <td></td>
      <td>44</td>
    </tr>
    <tr>
      <td>2</td>
      <td>20004001</td>
      <td>28.3</td>
      <td>2213</td>
      <td>6977</td>
      <td>7047</td>
      <td></td>
      <td>70</td>
    </tr>
    <tr>
      <td>3</td>
      <td>20004002</td>
      <td>15.2</td>
      <td>1026</td>
      <td>3841</td>
      <td>3852</td>
      <td></td>
      <td>11</td>
    </tr>
    <tr>
      <td>4</td>
      <td>20004003</td>
      <td>22.1</td>
      <td>1713</td>
      <td>5758</td>
      <td>5826</td>
      <td></td>
      <td>68</td>
    </tr>
    <tr>
      <td>5</td>
      <td>20004005</td>
      <td>32.3</td>
      <td>2143</td>
      <td>6780</td>
      <td>6687</td>
      <td></td>
      <td>7</td>
    </tr>
    <tr>
      <td>6</td>
      <td>7977</td>
      <td>20.6</td>
      <td>1351</td>
      <td>5020</td>
      <td>4997</td>
      <td></td>
      <td>-23</td>
    </tr>
    <tr>
      <td>7</td>
      <td>7822</td>
      <td>28.1</td>
      <td>2286</td>
      <td>6836</td>
      <td>6798</td>
      <td></td>
      <td>-38</td>
    </tr>
    <tr>
      <td>8</td>
      <td>7945</td>
      <td>28.6</td>
      <td>1930</td>
      <td>7045</td>
      <td>6978</td>
      <td></td>
      <td>-67</td>
    </tr>
    <tr>
      <td>9</td>
      <td>7936</td>
      <td>22.3</td>
      <td>1717</td>
      <td>5755</td>
      <td>5832</td>
      <td></td>
      <td>77</td>
    </tr>
    <tr>
      <td>10</td>
      <td>7969</td>
      <td>28</td>
      <td>2115</td>
      <td>6065</td>
      <td>6070</td>
      <td></td>
      <td>5</td>
    </tr>
  </tbody>
</table>

farms, the following example to illustrate this point, Through the forecast
about twenty first-breeding cows' 305 days milk production from
Mudanjiang Hailing dairy farm, 8511 cattle farm and XiangFang cattle farm,
the result as shown in table1.

4. CONCLUSIONS

To use the forecast model, we can forecast first-breeding dairy's 305
days milk production when the dairy has just begin to product for three
months(90 days), in other word we will forecast the cow's production ahead
of 215 days, by this method, you can choose a good milk production dairy
in favor of breeding work.
It will supply us the condition for the advantaged of choosing excellent
cows. It is known from the experiment, although this forecast model also has
certain error, but it in the allowed scope, it is totally feasible to create a
nonlinear system forecast model about cow's 305 days milk production with
improved BP network in the production.

ACKNOWLEDGEMENTS

This paper is supported by the animal science center of northeast
agricultural university, dairy experimental data、Experimental information
and experimental methods are all coming from the topics “dairy science and
technology major project” subject No is 2006BAD04A09 ,thanks of topic
groups’ helping, significantly, I want to express my thankful for Harbin
Intelligent Agricultural Center of Northeast Agricultural University. Xiang-
Fang Farm, Animal Medicine Center of Northeast Agricultural University.

REFERENCES

Qin zhirui.Introduction of dairy cattle breeding guidance, Beijing: jindun press, 2005:1-5

Jiaoji Cheng. Neural network introduction. Xi'an: Xi'an University of Electronic Science and Technology Publish, 1992,32,22-28

Wang yu.The prediction model and using of the improved BP model [J], Compute Measurement And Control, 2005, 13(1):39

Wen xin, Zhou lu, Matlab neural network using and design[M]. Beijing: science publish

Yin chaotian, Artificial intelligence and expert system [M], Beijing,

Dong changhong. Matlab network design and application, Beijing: science publish, 2004, 54:23-28

Weixiaoli, Zhang yonggen. Using BP forecast the first-breeding dairy's 305 production, Beijing, China dairy.2006(7):24-25