Monitoring methods revisited Anders Ringgaard Kristensen - - PowerPoint PPT Presentation

monitoring methods revisited
SMART_READER_LITE
LIVE PREVIEW

Monitoring methods revisited Anders Ringgaard Kristensen - - PowerPoint PPT Presentation

Department of Veterinary and Animal Sciences Monitoring methods revisited Anders Ringgaard Kristensen Department of Veterinary and Animal Sciences Outline Filtering techniques applied for monitoring of daily gain in slaughter pigs:


slide-1
SLIDE 1

Monitoring methods – revisited

Anders Ringgaard Kristensen

Department of Veterinary and Animal Sciences

slide-2
SLIDE 2

Outline Filtering techniques applied for monitoring of daily gain in slaughter pigs:

  • Introduction
  • Basic monitoring
  • Shewart control charts
  • DLM and the Kalman filter
  • Simple case
  • Seasonality
  • Online monitoring
  • Used as input to decision support

Department of Veterinary and Animal Sciences

Slide 2

slide-3
SLIDE 3

”E-kontrol”, slaughter pigs

Quarterly calculated production results Presented as a table A result for each of the most recent quarters and aggregated Sometimes comparison with expected (target) values Offered by two companies:

  • AgroSoft A/S
  • Cloudfarms

One of the most important key figures: Average daily gain

slide-4
SLIDE 4

Average daily gain, slaughter pigs We have:

  • 4 quarterly results
  • 1 annual result
  • 1 target value

How do we interpret the results? Question 1: How is the figure calculated?

slide-5
SLIDE 5

How is the figure calculated? The basic principles are:

  • Total (live) weight of pigs delivered:

xxxx

  • Total weight of piglets inserted:

−xxxx

  • Valuation weight at end of the quarter:

+xxxx

  • Valuation weight at beginning of the quarter: −xxxx
  • Total gain during the quarter

yyyy

Daily gain = (Total gain)/(Days in feed) Registration sources?

  • * Slaughter house – rather precise
  • ** Scale – very precise
  • *** ??? – anything from very precise to very uncertain

* ** *** ***

Department of Veterinary and Animal Sciences

Slide 5

slide-6
SLIDE 6

First finding: Observation error All measurements are encumbered with uncertainty (error), but it is most prevalent for the valuation weights. We define a (very simple) model: κ = τ + eo , where:

  • κ is the calculated daily gain (as it appears in the report)
  • τ is the true daily gain (which we wish to estimate)
  • eo is the observation error which we assume is normally distributed

N(0, σo2)

The structure of the model (qualitative knowledge) is the equation The parameters (quantitative knowledge) is the value of σo (the standard deviation of the observation error). It depends

  • n the observation method.

Department of Veterinary and Animal Sciences

Slide 6

slide-7
SLIDE 7

Observation error κ = τ + eo , eo ~ N(0, σo

2)

What we measure is κ What we wish to know is τ The difference between the two variables is undesired noise We wish to filter the noise away, i.e. we wish to estimate τ from κ

τ κ

Department of Veterinary and Animal Sciences

Slide 7

slide-8
SLIDE 8

Second finding: Randomness The true daily gains τ vary at random. Even if we produce under exactly the same conditions in two successive quarters the results will differ. We shall denote the phenomenon as the “sample error”. We have, τ = θ + es, where

  • es is the sample error expressing random variation. We assume es »

N(0, σs

2)

  • θ is the underlying permanent (and true) value

This supplementary qualitative knowledge should be reflected in the stucture of the model: κ = τ + eo = θ + es + eo The parameters of the model are now: σs og σo

Department of Veterinary and Animal Sciences

Slide 8

slide-9
SLIDE 9

Sample error and measurement error

What we measure is κ What we wish to know is θ The difference between the two variables is undesired noise:

  • Sample noise
  • Observation noise

We wish to filter the noise away, i.e. we wish to estimate θ from κ

θ κ τ

Department of Veterinary and Animal Sciences

Slide 9

slide-10
SLIDE 10

The model is necessary for any meaningful interpretation of calculated production results. The standard deviation on the sample error, σs , depends on the natural individual variation between pigs in a herd and the herd size. The standard deviation of the observation error, σo , depends on the measurement method of valuation weights. For the interpretation of the calculated results, it is the total uncertainty, σ , that matters (σ2 = σs

2 + σο 2)

Competent guesses of the value of σ using different observation methods (1250 pigs):

  • Weighing of all pigs: σ = 3 g
  • Stratified sample: σ = 7 g
  • Random sample: σ = 20 g
  • Visual assessment: σ = 29 g

The model in practice: Preconditions

Department of Veterinary and Animal Sciences

Slide 10

slide-11
SLIDE 11

Different observation methods

θ κ τ κ κ κ

σ = 3 g σ = 7 g σ = 20 g σ = 29 g

Department of Veterinary and Animal Sciences

Slide 11

slide-12
SLIDE 12

The model in practice: Interpretation Calculated daily gain in a herd was 750 g, whereas the expected target value was 775 g. Shall we be worried? It depends on the observation method! A lower control limit (LCL) is the target minus 2 times the standard deviation, i.e. 775 – 2σ Using each of the 4 observation methods, we

  • btain the following LCLs:
  • Weighing of all pigs: 775 g – 2 x 3 g = 769
  • Stratified sample: 775 g – 2 x 7 g = 761
  • Random sample: 775 g – 2 x 20 g = 735
  • Visual assessment: 775 g – 2 x 29 g = 717

Department of Veterinary and Animal Sciences

Slide 12

slide-13
SLIDE 13

Third finding: Dynamics, time

Daily gain, slaughter pigs

600 650 700 750 800 850 900 950

  • 2. quarter 97
  • 3. quarter 97
  • 4. quarter 97
  • 1. quarter 98
  • 2. quarter 98
  • 3. quarter 98
  • 4. quarter 98
  • 1. quarter 99
  • 2. quarter 99
  • 3. quarter 99
  • 4. quarter 99
  • 1. quarter 00
  • 2. quarter 00
  • 3. quarter 00
  • 4. quarter 00
  • 1. quarter 01
  • 2. quarter 01

Quarter g

Daily gain in a herd over 4 years. Is this good or bad?

slide-14
SLIDE 14

Modeling dynamics

We extend our model to include time. At time n we model the calculated result as follows: κn = τsn + eon = θ + esn + eon Only change from before is that we know we have a new result each quarter. We can calculate control limits for each quarter and plot everything in a diagram: A Shewart Control Chart …

κ1 τ1 θ κ2 τ2 κ3 τ3 κ4 τ4 …

Department of Veterinary and Animal Sciences

Slide 14

slide-15
SLIDE 15

A simple Shewart control chart: Weighing all pigs

Daily gain, slaughter pigs

600 650 700 750 800 850 900 950

  • 2. kvartal 97
  • 3. kvartal 97
  • 4. kvartal 97
  • 1. kvartal 98
  • 2. kvartal 98
  • 3. kvartal 98
  • 4. kvartal 98
  • 1. kvartal 99
  • 2. kvartal 99
  • 3. kvartal 99
  • 4. kvartal 99
  • 1. kvartal 00
  • 2. kvartal 00
  • 3. kvartal 00
  • 4. kvartal 00
  • 1. kvartal 01
  • 2. kvartal 01

Period g Observed gain Expected Upper control limit Lower control limit

Periode

Department of Veterinary and Animal Sciences

Slide 15

slide-16
SLIDE 16

Daily gain, slaughter pigs

600 650 700 750 800 850 900 950

  • 2. kvartal 97
  • 3. kvartal 97
  • 4. kvartal 97
  • 1. kvartal 98
  • 2. kvartal 98
  • 3. kvartal 98
  • 4. kvartal 98
  • 1. kvartal 99
  • 2. kvartal 99
  • 3. kvartal 99
  • 4. kvartal 99
  • 1. kvartal 00
  • 2. kvartal 00
  • 3. kvartal 00
  • 4. kvartal 00
  • 1. kvartal 01
  • 2. kvartal 01

Period g Observed gain Expected Upper control limit Lower control limit

Simple Shewart control chart: Visual assessment

Periode

Department of Veterinary and Animal Sciences

Slide 16

slide-17
SLIDE 17

Interpretation: Conclusion

Something is wrong! Possible explanations:

  • The pig farmer has serious problems with fluctuating

daily gains.

  • Something is wrong with the model:
  • Structure – our qualitative knowledge
  • Parameters – the quantitative knowledge (standard

deviations).

Department of Veterinary and Animal Sciences

Slide 17

slide-18
SLIDE 18

More findings: κn = θ + esn + eon The true underlying daily gain in the herd, θ , may change over time:

  • Trend
  • Seasonal variation

The sample errors esn may be auto correlated

  • Temporary influences

The observation error eon is obviously auto correlated:

  • Valuation weight at the end of Quarter n is the same as

the valuation weight at the start of Quarter n+1

Department of Veterinary and Animal Sciences

Slide 18

slide-19
SLIDE 19

”Dynamisk e-kontrol”

Developed and described by Madsen & Ruby (2000). Principles:

  • Avoid labor intensive valuation weighing.
  • Calculate new daily gain every time pigs have been sent

to slaughter (typically weekly)

  • Use a simple Dynamic Linear Model to monitor daily

gain

  • κn = θn + esn + eon = θn + vn , where vn ~ N(0, σv

2)

  • θn = θn-1 + wn, where wn ~ N(0, σw

2)

  • The calculated results are filtered by the Kalman filter in
  • rder to remove random noise (sample error +
  • bservation error)

Department of Veterinary and Animal Sciences

Slide 19

slide-20
SLIDE 20

”Dynamisk E-kontrol”, results

Raw data to the left – filtered data to the right Figures from:

  • Madsen & Ruby (2000). An application for early detection of growth

rate changes in the slaughter pig production unit. Computers and Electronics in Agriculture 25, 261-270.

Still: Results only available after slaughter

slide-21
SLIDE 21

The Dynamic Linear Model (DLM)

Example

Observation equation

κn = θn + vn , vn » N(0, σv

2)

System equation

θn = θn-1 + wn, wn » N(0, σw

2)

θ1 κ1 τ1 θ2 κ2 τ2 θ3 κ3 τ3 θ4 κ4 τ4

Department of Veterinary and Animal Sciences

Slide 21

slide-22
SLIDE 22

Extending the model

Fnθn is the true level described as a vector product. A general level, θ0n, and 4 seasonal effects θ1n, θ2n, θ3n and θ4n are included in the model. From the model we are able to predict the expected daily gain for next quarter. As long as the forecast errors are small, production is in control (no large change in true underlying level)!

slide-23
SLIDE 23

Observed and predicted

Daily gain

600 650 700 750 800 850 900 950 2 . k v a r t a l 9 7 4 . k v a r t a l 9 7 2 . k v a r t a l 9 8 4 . k v a r t a l 9 8 2 . k v a r t a l 9 9 4 . k v a r t a l 9 9 2 . k v a r t a l 4 . k v a r t a l Quarter g

Blue: Observed Pink: Predicted

Department of Veterinary and Animal Sciences

Slide 23

slide-24
SLIDE 24

Analysis of forecast errors

Daily gain

  • 100
  • 80
  • 60
  • 40
  • 20

20 40 60 80 100 2 . k v a r t a l 9 7 4 . k v a r t a l 9 7 2 . k v a r t a l 9 8 4 . k v a r t a l 9 8 2 . k v a r t a l 9 9 4 . k v a r t a l 9 9 2 . k v a r t a l 4 . k v a r t a l Quarter g

Department of Veterinary and Animal Sciences

Slide 24

slide-25
SLIDE 25

The last model Dynamic Linear Model Structure of the model (qualitative knowledge):

  • Seasonal variation allowed (no assumption about the size).
  • The general level as well as the seasonal pattern may change over

time.

Are those assumptions correct? Parameters of the model:

  • The observation and sample variance and the system variance.

The model learns as observations are done, and adapts to the

  • bservations over time.

Seasonal varation may be modeled more sophistically as demonstrated by Thomas Nejsum Madsen in FarmWatch™

Department of Veterinary and Animal Sciences

Slide 25

slide-26
SLIDE 26

Moral

If we wish to analyze the daily gain of a herd you need to:

  • Know exactly how the observations are done (and know

the precision).

  • Know how it may naturally develop over time.

Without professional knowledge you may conclude anything. Without a model you may interpret the results inadequately. Through the structure of the model we apply our professional knowledge to the problem.

Department of Veterinary and Animal Sciences

Slide 26

slide-27
SLIDE 27

On-line monitoring of slaughter pigs: PigVision Innovation project led by the Danish Pig Research Centre:

  • Aarhus University
  • Videometer (external assistance)
  • Skov A/S
  • University of Copenhagen

Continuous monitoring of daily gain while still in herd:

  • Dynamic Linear Models
  • Chance of interference in the fattening period
  • Adaptation of delivery policy

Kristensen, A. R., L. Nielsen & M.S. Nielsen. 2012. Optimal slaughter pig marketing with emphasis on information from on- line live weight assessment. Livestock Science 145, 95-108.

Department of Veterinary and Animal Sciences

Slide 27

slide-28
SLIDE 28

PigVision: Principles

A camera is placed above the pen. In case of movements a series of pictures are recorded and sent to a computer. The computer automatically identifies the pig (by use of a model) and calculates the area (seen from above). If the computer doesn’t belief that a pig has been identified, the picture is ignored. The area is converted to live weight (using a model). Through many pictures, the average weight and the standard deviation are estimated.

Figure by Teresia Heiskanen

slide-29
SLIDE 29

What is online weight assessment used for? Continuous monitoring of gain. Collection of evidence about growth capacity (learning) Adaptation of delivery policies depending on:

  • Whether the pigs grow fast or slowly
  • Whether the uniformity is small or big
  • Whether a new batch of piglets is ready
  • Prices

Direct advice about pigs to deliver

Department of Veterinary and Animal Sciences

Slide 29

slide-30
SLIDE 30

The decision support model

Technique:

  • A hierarchical Markov Decision Process (dynamic programming) with a

Dynamic Linear Model (DLM) embedded. Every week, the average weight and the standard deviation is observed After each observation the parameters of the DLM are opdated using a dynamic linear model:

  • Permanent growth capacity of pigs, L
  • Temporary deviation, e(t)
  • Within-pen standard deviation, ρ(t)

Decisions based on (state space):

  • Number of pigs left
  • Estimated values of the 3 parameters

Decision: Deliver all pigs with live weight bigger than a threshold Uncertainty of knowledge is directly built into the model through the DLM

Department of Veterinary and Animal Sciences

Slide 30

slide-31
SLIDE 31

On-line weight assessment Pen with n pigs is monitored. No identification of pigs. At any time t we have: The precision 1/σ2 is assumed known

Department of Veterinary and Animal Sciences

Slide 31

slide-32
SLIDE 32

A dynamic linear weight model, I

Known average herd specific growth curve: True weights at time t distributed as:

Department of Veterinary and Animal Sciences

Slide 32

slide-33
SLIDE 33

The scaling factor L

In principle unknown and not directly

  • bservable

Initial belief: The belief is updated each time we

  • bserve a set of live weights from the

pen. Let L ~ N(1, σL

2) be the true average

weight Then

Department of Veterinary and Animal Sciences

Slide 33

slide-34
SLIDE 34

Observation & system equation 1

Full observation equation for mean: Auto-correlated sample error (system eq.):

Department of Veterinary and Animal Sciences

Slide 34

slide-35
SLIDE 35

Observation & system equation 2

Far more information available from the

  • bserved live weights

Sample variance not normally distributed. Use the 0.16 sample quantile: The symbol ρ(t) is the standard deviation

  • f the observed values. System equation:

Department of Veterinary and Animal Sciences

Slide 35

slide-36
SLIDE 36

Full equation set

Department of Veterinary and Animal Sciences

Slide 36

slide-37
SLIDE 37

Learning, permanent growth capacity

L = 1,00

0,85 0,95 1,05 1,15 1 2 3 4 5 6 7 8 9 10 11 12 Sand værdi Lært værdi

L= 0,85

0,85 0,95 1,05 1,15 1 2 3 4 5 6 7 8 9 10 11 12 Sand værdi Lært værdi

L = 1,07

0,85 0,95 1,05 1,15 1 2 3 4 5 6 7 8 9 10 11 12 Sand værdi Lært værdi

L = 1,12

0,85 0,95 1,05 1,15 1 2 3 4 5 6 7 8 9 10 11 12

Sand værdi Lært værdi

slide-38
SLIDE 38

Learning: Homogeneity (standard deviation)

Spredning = 3

3 6 9 12 15 18 21 1 2 3 4 5 6 7 8 9 10 11 12 Sand værdi Lært værdi

Spredning = 11

3 6 9 12 15 18 21 1 2 3 4 5 6 7 8 9 10 11 12 Sand værdi Lært værdi

Department of Veterinary and Animal Sciences

Slide 38