Classifying sows’ activity types from acceleration ... · Classifying sows’ activity types from...

12
Classifying sows’ activity types from acceleration patterns An application of the Multi-Process Kalman Filter Ce ´cile Cornou a, * , Søren Lundbye-Christensen b a Department of Large Animal Sciences, Faculty of Life Sciences, University of Copenhagen, Groennegaardsvej 2, 1870 Frederiksberg C. Copenhagen, Denmark b Institute of Mathematical Sciences, Center for SundhedStatistik, Aalborg University, Fredrik Bajers Vej 7G, 9220 Aalborg SØ, Denmark Accepted 25 June 2007 Available online 13 August 2007 Abstract An automated method of classifying sow activity using acceleration measurements would allow the individual sow’s behavior to be monitored throughout the reproductive cycle; applications for detecting behaviors characteristic of estrus and farrowing or to monitor illness and welfare can be foreseen. This article suggests a method of classifying five types of activity exhibited by group-housed sows. The method involves the measurement of acceleration in three dimensions. The five activities are: feeding, walking, rooting, lying laterally and lying sternally. Four time series of acceleration (the three-dimensional axes, plus the length of the acceleration vector) are selected for each activity. Each time series is modeled using a Dynamic Linear Model with cyclic components. The classification method, based on a Multi-Process Kalman Filter (MPKF), is applied to a total of 15 times series of 120 observations, which involves 30 min for each activity. The results show that feeding and lateral/sternal lying activities are best recognized; walking and rooting activities are mostly recognized by a specific axis corresponding to the direction of the sow’s movement while performing the activity (horizontal sidewise and vertical). Various possible improvements of the suggested approach are discussed. # 2007 Elsevier B.V. All rights reserved. Keywords: Group-housed sows; Body activity; Dynamic Linear Models; Multi-Process Kalman Filter www.elsevier.com/locate/applanim Applied Animal Behaviour Science 111 (2008) 262–273 * Corresponding author. Tel.: +45 35333364; fax: +45 35333055. E-mail addresses: [email protected] (C. Cornou), [email protected] (S. Lundbye-Christensen). 0168-1591/$ – see front matter # 2007 Elsevier B.V. All rights reserved. doi:10.1016/j.applanim.2007.06.021

Transcript of Classifying sows’ activity types from acceleration ... · Classifying sows’ activity types from...

Classifying sows’ activity types from

acceleration patterns

An application of the Multi-Process

Kalman Filter

Cecile Cornou a,*, Søren Lundbye-Christensen b

a Department of Large Animal Sciences, Faculty of Life Sciences, University of Copenhagen,

Groennegaardsvej 2, 1870 Frederiksberg C. Copenhagen, Denmarkb Institute of Mathematical Sciences, Center for SundhedStatistik, Aalborg University,

Fredrik Bajers Vej 7G, 9220 Aalborg SØ, Denmark

Accepted 25 June 2007

Available online 13 August 2007

Abstract

An automated method of classifying sow activity using acceleration measurements would allow the

individual sow’s behavior to be monitored throughout the reproductive cycle; applications for detecting

behaviors characteristic of estrus and farrowing or to monitor illness and welfare can be foreseen. This

article suggests a method of classifying five types of activity exhibited by group-housed sows. The method

involves the measurement of acceleration in three dimensions. The five activities are: feeding, walking,

rooting, lying laterally and lying sternally. Four time series of acceleration (the three-dimensional axes, plus

the length of the acceleration vector) are selected for each activity. Each time series is modeled using a

Dynamic Linear Model with cyclic components. The classification method, based on a Multi-Process

Kalman Filter (MPKF), is applied to a total of 15 times series of 120 observations, which involves 30 min

for each activity. The results show that feeding and lateral/sternal lying activities are best recognized;

walking and rooting activities are mostly recognized by a specific axis corresponding to the direction of the

sow’s movement while performing the activity (horizontal sidewise and vertical). Various possible

improvements of the suggested approach are discussed.

# 2007 Elsevier B.V. All rights reserved.

Keywords: Group-housed sows; Body activity; Dynamic Linear Models; Multi-Process Kalman Filter

www.elsevier.com/locate/applanim

Applied Animal Behaviour Science 111 (2008) 262–273

* Corresponding author. Tel.: +45 35333364; fax: +45 35333055.

E-mail addresses: [email protected] (C. Cornou), [email protected] (S. Lundbye-Christensen).

0168-1591/$ – see front matter # 2007 Elsevier B.V. All rights reserved.

doi:10.1016/j.applanim.2007.06.021

1. Introduction

When sows are group-housed it can be difficult to gain access to individual animals. Often this

leads to serious management problems. The development of sensor technology (Eradus and

Jansen, 1999) opens up new possibilities for monitoring single animals within a group, and

current automation systems aim to facilitate ’management by exception’ by drawing the farmer’s

attention to particular individuals.

A large range of automation systems for animal husbandry are based on Dynamic Linear

Models and the Kalman Filter (Kalman, 1960). Thus in pig production it is possible to monitor

the condition of young pigs via their drinking behavior (Madsen et al., 2005); and in group-

housed sows it is possible to monitor estrus via individual body activity (Cornou and Heiskanen,

submitted for publication). A similar approach has been described for monitoring milk quality in

dairy cattle (Thysen, 1993), and de Mol et al. (1999) suggest a method of this kind for detecting

estrus and diseases. Finally, an application for use in poultry production is presented in Roush

et al. (1992).

The behavior of the individual sow can be affected both by its physiological state and by

illness: body activity tends to increase at the onset of estrus (Cornou and Heiskanen, submitted

for publication; Freson et al., 1998; Geers et al., 1995; Serlet, 2004); nest-building behavior is

performed at the approach of farrowing (Jensen, 1993) lameness mainly influences the sow’s

walking activity, while other diseases may affect specific behaviors such as feeding (Forbes,

1995). Automated monitoring of the activities of an individual group-housed sow would

therefore help the farmer to detect deviations from normal behavior and provide information

about the specific state of the animal.

The objective of this study is to develop a method for automatically classifying particular

activities that group-housed sows perform. The method tracks acceleration measurements. An

accelerometer, fixed on individual sows, allows activity data to be recorded at any time. The

modeling of activity patterns could allow the individual animal to be monitored for the full

duration of its reproductive cycle, i.e. from the mating section to the farrowing house. Other

applications, such as monitoring animal welfare, can also be foreseen.

The following section describes the collection of acceleration measurements and the five types

of activity selected. Section 3 sets out the methods used to model and classify the activity types.

Section 4 presents and evaluates the results. Section 5 further discusses the results; it explores

perspectives for improvement and suggests new applications of the classification method

presented.

2. Time series of accelerations and activity types

2.1. Collection of acceleration measurements

The time series of acceleration measurements referred to in this article are extracts of data

collected from five group-housed sows in a production herd in Denmark over a period of 20 days

during March 2005. The sows were fed ad libitum; they had access to two electronic sow feeders

(ESF) and three nipple drinkers. Resting areas were straw-bedded and activity areas had plain or

slatted floors. Acceleration data were measured in three dimensions using a digital accelerometer

(LIS3L02DS from STMicroelectronics) four times per second, 24 h a day. A box containing the

accelerometer and the battery package was fitted on a neck collar which was put on the

experimental sow. The neck collars tended to loosen after few days. However, the weight of the

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273 263

box ensured that it generally stayed in position under the neck. Data were transferred to two PCs

via an external Bluetooth dongle which hung from the ceiling in the middle of the pen. Video

recordings covering a large proportion of the pen were also performed over 20 days, 24 h a day

(four pictures being recorded per second). The experimental protocol is described in detail in

Cornou and Heiskanen (submitted for publication).

Acceleration is a vector quantity defining the rate at which the sow changes its velocity. The

sow is treated as accelerating if its velocity is changing. The initial series included values for the

three axes (x, y and z), measured in volts. Of these axes, x corresponded to the vertical dimension;

y corresponded to the horizontal dimension, with the acceleration being measured sidewise,

while z corresponded to the horizontal dimension, with the acceleration being measured

forwards. Before further processing, the data were converted into the acceleration unit (g) and the

length of the acceleration vector was calculated as

acc ¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiacc2

x þ acc2y þ acc2

z

q(1)

where accx, accy and accz are the acceleration values for the axes x, y and z. Acceleration values

for the three axes ranged from 2 to 2. The values of the length of the acceleration vector (acc)

ranged from 0 to 3.46, where 1 g corresponds to no acceleration. When the accelerometer was

placed immobile on a plane surface, the acceleration values for the axes x, y and z, were

respectively 1, 0 and 0 g (the first value being due to the effect of gravity).

2.2. Selection of the activity types and time series associated

With the help of the video recordings, extracts of time series were associated with five activity

types. The activity types were: feeding (FE), rooting (RO), walking (WA), lying sternally (LS)

and lying laterally (LL). Fig. 1 shows the raw values of the length of the acceleration vector (acc)

for the five types of activity (four measurements per second). It can be seen that each activity type

displays a distinct acceleration pattern.

Some of these activities are not exclusive. For example, sows can root and walk at the same

time. Since a walking sow may also pause and stand immobile more or less frequently for a

limited period of time, walking activity, when measured over a sufficient time, will generally be

associated with short periods of temporary immobility.

The data sets selected for this study satisfied two criteria: (i) the selected activities fill the

entire period; (ii) the overlapping of activities are reduced to a minimum (e.g. in extracts

corresponding to the rooting activity the sows only root over a limited area in order to limit the

effects of the walking activity).

For the purpose of modeling and classifying the activities two data sets satisfying the above

criteria were used:

� Learning data set: 10 min of each activity type (presented in Fig. 1); this data set is used to

estimate the model parameters for each activity type.

� Test data set: 10� 2 min of each activity type; this data set is used in the implementation of the

classification method, after each activity type has been modeled.

Each data set included four time series of acceleration measurements: axes x, y, z and the

length of the acceleration vector acc (referred to as the axis acc in the following sections).

The total duration of the data sets was 10 h (30 min of each activity type � 5 activity types �4 axes). These data sets correspond to acceleration measurements collected for three

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273264

different sows: sows 1, 3 and 5 for feeding, walking and lying laterally; sow 5 for rooting;

sows 1 and 3 for lying sternally. The activities of rooting and lying sternally were generally

performed in the straw-bedded resting areas. The videos only covered parts of these

areas, which made it difficult to associate these types of series with videos recordings. Hence,

here, the number of sows for both activities is limited, compared with the other types of

activity.

The selected data sets are relatively short in length. This is, first, to satisfy the criteria

presented above (regarding the filling of an entire period and exclusivity). Secondly, the

experimental conditions hindered efforts to associate particular activity types for a longer period

of time: more often than not the timestamps of the video recordings and the accelerometers were

unsynchronized. Therefore, series were selected around the time at which the sows visited the

ESF; at this time correct timestamps were available. Furthermore, the shifting of the battery

inside of the accelerometer boxes may have resulted in axes inversions when the neck collar was

repositioned. The limited length of the series was also designed to provide an assurance, during

the development of this classification method, that the position of each axis would remain

identical.

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273 265

Fig. 1. Ten minutes selected extracts of the length of the acceleration vector (acc) for the five activity types (four

measurements per second); vertical axes indicate the value of acceleration (g); horizontal axes indicate the duration of the

extracts (min).

3. Modeling of the acceleration patterns and classification of the activities

Modeling of the activity patterns was performed using time series from the learning data set,

previously averaged per second. As Fig. 2 shows, the analysis of correlation, for the x axis, of the

feeding series of the learning data set showed periodic movement, with a period of 22 s.

In the learning data set, periodicity was only observed for this above series (1 out of 20). In the

test data set, periodicity in the range of 15–25 was observed in 12 of the 200 series (10 series� 5

activities � 4 axes). The patterns are pseudo-cyclic, with a smoothly changing wavelength;

therefore, the suggested model includes a gradually changing sinoid movement.

3.1. Model design

The general DLM is represented as a set of two equations (West and Harrison, 1997). The

observation equation (2) defines the sampling distribution for the observation Yt conditional on

an unobservable state vector ut. The system equation (3) defines the time evolution of the state

vector ut.

Yt ¼ F>t ut þ nt; nt �Nð0;VÞ (2)

ut ¼ Gtut�1 þ vt; vt�Nð0;WtÞ (3)

The error sequences nt and vt are assumed to be internally and mutually independent. The DLM

combined with a Kalman Filter (KF) (Kalman, 1960) estimates the underlying state vector ut by its

conditional mean vector mt and its variance-covariance matrix Ct (the model variance) given all

previous observations Dt ¼ fY1; . . . Ytg of the acceleration measurements. Thus, the conditional

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273266

Fig. 2. Autocorrelation function for the x axis of the feeding series of the learning data set. A periodicity of 22 s is

observed.

distribution of ut is

ðutjDtÞ�N ðmt;CtÞ: (4)

The updating equations of the KF used for stepwise calculation of mt and Ct can be found in West

and Harrison (1997).

The suggested DLM includes a sine-cosine movement that follows the sinoid movement of the

observation data: the state vector ut consists of a set of parameters describing the model level (mt)

and the sine-cosine components (st, ct) at time t, i.e.

ut ¼mt

st

ct

0@

1A (5)

The systems matrices are defined in (6): Ft is labeled the design matrix; Gt is labeled the system

matrix, which is defined here as identity matrix.

F>t ¼�

1; sin

�2p

Tt

�; cos

�2p

Tt

��Gt ¼ I (6)

The period T is defined in the design matrix (6). However, the random variation over time of the

sine-cosine components of the state vector ut (5) allows the model to adapt to periodic

movements with periods varying near T.

The system variance Wt ¼ W (3) is defined as:

W ¼Wm 0 0

0 W sc 0

0 0 W sc

0@

1A (7)

The observation variance V (a scalar) and the parameters Wm and W sc of the system variance W,

characteristic of each axis of the respective activities, were estimated using the EM algorithm

(Dempster et al., 1977; Jørgensen et al., 1996; Dethlefsen, 2001). The EM algorithm is an

iterative algorithm used to estimate unknown parameters by maximum likelihood estimation; it

uses the conditional mean vector mt and the model variance Ct from the Kalman filtering and

their respective smoothed components mt and Ct obtained after Kalman smoothing (West and

Harrison, 1997).

The estimated values for the parameters bV , bWmand bW sc

, for each axis of each activity,

converged after 200 iterations. These values are available on request.

3.2. Multi-Process Kalman Filter

Following the procedure set out in Section 3.1, 20 DLMs (5 activities� 4 axes) were defined.

Each DLM was described by the quadruple at each time t, denoted by:

Mt : fF;G;V;Wgt (8)

In the Multi-Process model of class I, a single DLM (out of a range of possible DLMs) is

appropriate for describing the entire time series. However, there is uncertainty about the ‘true’

value of the defining parameter vector a ¼ aði; jÞ, where aði; jÞ is the set of parameters for the 20

possible DLMs, i.e. the five activity types indexed by i (FE, WA, RO, LL, LS) and their respective

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273 267

axes j (x, y, z, acc).

Mt ¼ MtðaÞ ðt ¼ 1; 2; . . .Þ (9)

Each DLM MtðaÞ was analyzed using the updating equations of the Kalman Filter. At each

observation time t, the model one-step forecast mean f t and its respective variance Qt were

calculated. The posterior probabilities ( pt) were estimated for each DLM, as

ptðiÞ/ftðiÞ � pt�1ðiÞ; (10)

where ftðiÞ is the predictive distribution of the observation given both the past Dt�1, and that

model i is appropriate.

In practice, each DLM was analyzed using the parameters estimated from the learning data

set; the value of the period T was set to 22. Initial values of the posterior probabilities were set to

0.2, corresponding to a uniform initial distribution for the five activity types. At each time t, the

probabilities were updated for the 20 DLMs according to (10).

4. Results

Fig. 3 shows the evolution of posterior probabilities for two time series of 120 observations

(2 min of observation) corresponding to the walking activity. The upper frame (a) corresponds to

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273268

Fig. 3. Evolution of the posterior probabilities for the five activity types, for two time series of 120 observations

corresponding to the walking activity (a) y axis and (b) z axis.

the y axis. The MPKF tends to indicate that the sow is rooting. This indicates that walking and

rooting activities have similar movements in a horizontal sidewise direction. Where the axis z

(lower frame) is concerned, the MPKF recognizes the ‘true’ activity type; the posterior

probabilities reach the value 1 after 40 observations.

Fig. 4 shows the mean posterior probabilities (wide line) for each axis for the five activity

types. The parameters estimated from the learning data set are applied to the respective activity

type/axis of the test data set.

The feeding activity is best recognized, while the walking activity is recognized only on one

axis, i.e. the horizontal z axis measuring forwards acceleration; the posterior probabilities exceed

the value 0.5 after approximately 30 s. Lying laterally is correctly recognized by the y axis

(horizontal sidewise direction). Lying sternally is also rapidly recognized. However, the results

here should be regarded with precaution, since both the learning and test data set are extracts of

time series from two sows only. The speed of recognition of the rooting activity is relatively slow,

and the posterior probabilities tend to stay around 0.5 for axes y and z; rooting is best recognized

by the x axis (vertical direction). Closer observation of the posterior probabilities of walking and

rooting activities indicates that these activities tend to be confused with each other: indeed for the

walking activity, in 8 out of the 10 times series the posterior probabilities of the y axis tend to

indicate that the sow is rooting. Similarly, for the rooting activity, the posterior probabilities of

the z axis indicate that the sow is walking in 8 out of 10 series. Particular axes perform better

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273 269

Fig. 3. (Continued ).

when used to classify specific activity types. These results are in keeping with the types of

movement that a sow performs for each activity type: sidewise movements are very limited when

a sow is lying laterally, so the activity is better recognized by the horizontal sidewise y axis.

Upwards and downwards movements are performed while the sows is rooting, which may

explain the better recognition on the vertical x axis. The fact that a sow tends to walk while

rooting may explain why neither of these activities are clearly recognized.

In order to corroborate the results of the classification method, new parameters were estimated

from the test data set and applied on the learning data set, which had previously been divided into

five series of 2 min. Table 1 indicates the percentage of posterior probabilities (pp) above 0.5

during the 2-min time series. The left panel shows the results from the test data set, where the

DLMs were analyzed using the parameters estimated from the learning data set. The right panel

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273270

Fig. 4. Posterior probabilities for the axes x, y and z, and acc for the five types of activity. Implementation of the

classification method on the test data set. Mean of the 10 time series (wide plain line) and 95% confidence intervals. The

horizontal axes indicate the observation time (s) (120 observations, i.e. 2 min).

shows the results from the learning data set, where the DLMs were analyzed using the

parameters estimated from the test data set.

The activities of feeding, rooting and lying sternally are well recognized on most axes of both

data sets. Walking activity is best recognized on the forward horizontal z axis; when the MPKF is

applied to the test data set, the very low percentage of recognition for the y axis confirms the

observation derived from Fig. 3(a): the classification method tends to indicate that the sow is

rooting. Where the acc axis is concerned, results indicate that the sow is either rooting or lying

sternally. The activity of lying laterally is also very poorly recognized on the acc axis: the

percentages of posterior probabilities > 0:5 are 12.7% and 2.5%, respectively, for the test and

learning data set, and the classification method tends to indicate that the sow is feeding; results

from the other three axes are in the range 56.2–97.9%. Differences between the two panels

observed here may be explained by the value chosen for the threshold, i.e. 0.5. As shown in

Fig. 3(a), some activities may be partly recognized, but the values of the posteriors probabilities

generally stay below, and rarely exceed, the 0.5 threshold.

5. Discussion and conclusion

The results of the classification method explored in this article show that all activity types can

be recognized, either by using all axes or by focusing on a specific axis. Both the three axes (x, y,

z) and the length of the acceleration vector (acc) were included. Reference to each of the three

dimensions appears to be desirable; this was especially seen in connection with the walking

activity, where the z axis (horizontal forward direction) showed the best results.

The results presented in Table 1 may be used as an indicator in an initial classification of the

activity types. The choice of a 2-min ‘window’ is in accordance with the average speed of

recognition by the axis, which can take up to 1 min (as happens, for instance, with the x axis of

rooting). Specific activities, such as feeding, may be of short duration: in our experimental

conditions the duration of feeding activity was approximately 10 min/day, which corresponds to a

sow consuming her entire ration at once. This also supports the argument for classifying activities

over a short time. In this study, a threshold of 0.5 was arbitrarily set in order to evaluate the results of

the classification method. As seen in Table 1, this resulted in differences in the recognition of the

same activity according to the data sets. Other threshold values should be tested and optimized by

mean of larger data sets. Other methods, based on time-moving windows (Shasha and Zhu, 2004),

may be used to detect whether or not the sow is active, using the length of the acceleration vector.

Class II Multi-Process models (West and Harrison, 1997, pp. 443–456) offer another kind of

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273 271

Table 1

Percentage of posterior probabilities where pp> 0:5 during the 2-min windows for the respective axes of each activity

type

Test data set Learning data set

x y z acc x y z acc

FE 79.3 91.9 87.3 90.8 90.2 39.0 95.5 92.2

WA 22.8 05.0 81.9 00.0 49.2 42.3 66.2 49.3

RO 57.6 54.1 36.5 78.1 46.5 64.3 74.7 86.7

LL 77.9 97.9 65.6 12.7 85.3 97.3 56.2 02.5

LS 81.7 87.7 82.3 82.1 70.5 87.0 71.7 42.7

Left panel: application of the MPKF on the test data set (1200 observations per result); right panel: application of the

MPKF on the learning data set (600 observations per result).

classification, over a shorter period of time. The interest of this method appears, however, to be

limited for two reasons. First, it is more complex: prior distributions for each activity type are

defined according to the average daily length of the activity, and this may vary from one sow to

another. Second, it is more demanding from a computational point of view, and this may limit its

interest so far as practical application is concerned.

Further developments of the method explored in this article may include combining the three

axes into a single multivariate model. For longer-term perspectives it may be desirable to fit

accelerometers to an ear tag. The use of an ear tag, rather than fitting accelerometers to a neck

collar, will generate more noise in the time series. If that happens, the direction of each axis may

become less clear, which will limit their effectiveness as separate entities.

The five activity types were selected by associating acceleration patterns with specific

activities observed in video recordings. The number and choice of activity types depends on the

practical application of the method being envisaged. In group-housed sows fed by ESF the

detection of feeding activity is less important, since the ESF already registers the sow entering

the feeding station. However, for group-housed sows not being fed by ESF, or sows at any other

stages (mating or farrowing section), the monitoring of feeding activity may be used to detect,

for example, illness: reduced feed intake is considered one of the first signs that an animal is ill

(Forbes, 1995). Some pairs of activities, such as standing and lying sternally, and walking and

rooting, may also present similar acceleration patterns, and may be difficult to distinguish one

from another. The interest of detecting walking and rooting separately is likely to be very

limited, except in the detection of lameness; and in that particular case a more detailed analysis

of the walking pattern should be carried out. It can be argued that a larger number of activities

will make acceleration patterns more difficult to recognize and may, therefore, affect the

performance and reliability of the classification method. Types of activity may also be grouped

and reduced to two general categories: ‘active behaviors’ (e.g. eating, walking, rooting) and

‘passive behaviors’ (e.g. lateral/sternal lying). These general categories could be used, as

indicators of general activity level, to detect estrus (Cornou and Heiskanen, submitted for

publication). Finally, the frequency of change in activity type, or posture, may be used as an

indicator of restlessness, in order to monitor, for example, parturition (Harris and Gonyou,

1998; Hartsock and Barczewski, 1997).

In further experimentation, inter-pig and inter-pen variations need to be explored. Particular

behaviors, such as walking activity, may be influenced by the size of the pen. However, the

method presented in this article does not detect the daily distribution of the duration of an activity

(which is needed in an MPKF of class II). Differences may be observed more readily within the

variance parameters, as a result of the speed of walking, for instance; this may nevertheless be

due to inter-pig variability. The data sets used in this study were obtained under ideal conditions:

a single activity type filled the whole period, and the activities were either not overlapping or such

that overlapping was reduced to a minimum. This may have resulted in overestimation of the

performance of the method. More extensive data sets including several types of activity should

now be tested. The use of a more complete data set, covering a larger number of individuals and

with optimal synchronization between video recordings and acceleration measurements, may

help researchers to carry out these further analyzes.

The main interest of classifying activity types automatically is to supplement visual

observation with automatic registration. This makes it possible to monitor a larger number of

individuals at the same time, instantaneously, if the method performs well. Development of a

method of automatically classifying activity types is the first step towards further automated

methods designed to detect estrus, farrowing, illness or welfare status.

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273272

In conclusion, then, the classification method presented in this article opens up new

possibilities for automatic monitoring of the types of activity an individual sow performs. Further

developments, involving the modeling each activity type, will require larger data sets to be used.

It will also be necessary to incorporate a method of assessing inter-pig and inter-pen variation.

Acknowledgements

The authors gratefully acknowledge the Department of Computer Science, Copenhagen

University, for assistance with data collection. Funding was provided by the Danish Research

Agency.

References

Cornou, C., Heiskanen, T. Pilot experiment: oestrus detection for group housed sows using sow’s acceleration

measurements, submitted for publication.

de Mol, R.M., Keen, A., Kroeze, G.H., Achten, J.M.F.H., April 1999. Description of a detection model for oestrus and

diseases in dairy cattle based on time series analysis combined with a Kalman Filter. Comput. Electron. Agric. 22 (2–

3), 171–185.

Dempster, A., Laird, N., Rubin, D., 1977. Maximum likelihood from incomplete data via the em algorithm (with

discussion). JRSS(B) 39, 1–38.

Dethlefsen, C., 2001. Space time problems and applications. Ph.D. thesis, Aalborg University.

Eradus, W.J., Jansen, M.B., 1999. Animal identification and monitoring. Comput. Electron. Agric. 24 (1–2), 91–98.

Forbes, J.M., 1995. Voluntary Food Intake and Diet Selection in Farms Animals. CAB International, Wallingford, Oxon

OX10DE, UK.

Freson, L., Godrie, S., Bos, N., Jourquin, J., Geers, R., 1998. Validation of an infra-red sensor for oestrus detection of

individually housed sows. Comput. Electron. Agric. 20 (1), 21–29.

Geers, R., Janssens, S., Spoorenberg, S., Goedseels, V., Noordhuizen, J., Ville, H., Jourquin, J., 1995. Automated oestrus

detection of sows with sensors for body temperature and physical activity. In: Proceedings of ARBIP95, Kobe, Japan.

Harris, M.J., Gonyou, H.W., 1998. Increasing available space in a farrowing crate does not facilitate postural changes or

maternal responses in gilts. Appl. Anim. Behav. Sci. 59 (4), 285–296.

Hartsock, T., Barczewski, R., 1997. Prepartum behavior in swine: effects of pen size. J. Anim. Sci. 75 (11), 2899–2904.

Jensen, P., 1993. Nest building in domestic sows: the role of external stimuli. Anim. Behav. 45, 351–358.

Jørgensen, B., Lundbye-Christensen, S., Song, P., Sun, L., 1996. State-space models for multivariate longitudinal data of

mixed types. Can. J. Stat. 24 (3), 385–402.

Kalman, R., 1960. A new approach to linear filtering and prediction problems. J. Basic Eng. 82.

Madsen, T., Andersen, S., Kristensen, A., 2005. Modeling the drinking pattern of young pigs using a state space model.

Comput. Electron. Agric. 48, 39–62.

Roush, W., Tomiyama, K., Garaoui, K., Alfonso, T., Cravener, T., 1992. Kalman Filter and an example of its use to detect

changes in poultry production responses. Comput. Electron. Agric. 6, 347–356.

Serlet, S., 2004. Optimalisatie van bronstdetectie bij zeugen. Thesis/dissertation.

Shasha, D., Zhu, Y., 2004. High Performance Discovery in Time Series. Springer.

Thysen, I., 1993. Monitoring bulk tank somatic cell counts by a Multi-Process Kalman Filter. Acta Agric. Scand. Sect. A

Animal Sci. (43), 58–64.

West, M., Harrison, J., 1997. Bayesian Forecasting and Dynamic Models, second ed. Springer.

C. Cornou, S. Lundbye-Christensen / Applied Animal Behaviour Science 111 (2008) 262–273 273