Anda di halaman 1dari 6

Machine vision to identify broiler breeder behavior

Danilo F. Pereira
, Bruno C.B. Miyamoto
, Guilherme D.N. Maia
, G. Tatiana Sales
Marcelo M. Magalhes
, Richard S. Gates
School of Business, Univ. Estadual Paulista UNESP at Tup, 780 Domingos da Costa Lopes Av., 17602-496, Tup, SP, Brazil
Department of Agricultural and Biological Engineering, University of Illinois at Urbana-Champaign, 1304 W. Pennsylvania Avenue, Urbana, IL 61801, USA
a r t i c l e i n f o
Article history:
Received 15 February 2013
Received in revised form 23 August 2013
Accepted 18 September 2013
Image analysis
Data mining
Precision agriculture in animal production
a b s t r a c t
Animal behavioral parameters can be used to assess welfare status in commercial broiler breeders.
Behavioral parameters can be monitored with a variety of sensing devices, for instance, the use of video
cameras allows comprehensive assessment of animal behavioral expressions. Nevertheless, the develop-
ment of efcient methods and algorithms to continuously identify and differentiate animal behavior pat-
terns is needed. The objective this study was to provide a methodology to identify hen white broiler
breeder behavior using combined techniques of image processing and computer vision. These techniques
were applied to differentiate body shapes from a sequence of frames as the birds expressed their behav-
iors. The method was comprised of four stages: (1) identication of body positions and their relationship
with typical behaviors. For this stage, the number of frames required to identify each behavior was
determined; (2) collection of image samples, with the isolation of the birds that expressed a behavior
of interest; (3) image processing and analysis using a lter developed to separate white birds from the
dark background; and nally (4) construction and validation of a behavioral classication tree, using
the software tool Weka (model J48). The constructed tree was structured in 8 levels and 27 leaves,
and it was validated using two modes: the set training mode with an overall rate of success of
96.7%, and the cross validation mode with an overall rate of success of 70.3%. The results presented here
conrmed the feasibility of the method developed to identify white broiler breeder behavior for a partic-
ular group of study. Nevertheless, more improvements in the method can be made in order to increase
the validation overall rate of success.
2013 Elsevier B.V. All rights reserved.
1. Introduction
Animal behavior is a parameter commonly used to assess ani-
mal welfare. Behavior was rst strictly dened as movements per-
formed by a living organism. However, other living expressions can
be interpreted as behavior signals and are not characterized by
movements. Vocalization and sounds, color changes, odors, and
production are examples of more complex living expressions
incorporated into the denition of behavior (Costa, 2003).
Animal behavior is a potential tool to identify welfare status of
broiler breeders in commercial production systems (Prayitno et al.,
1997; Archer et al., 2009; Shields et al., 2005; Salgado et al., 2007).
Several types of sensing devices have been applied to monitor ani-
mal behavior. For example, electronic identication transponders
(EIDs) (Curto et al., 2007) and video cameras (Pereira et al.,
2001). In particular, video cameras are advantageous because they
allow thorough assessment of animal behavioral expressions
(Pereira, 2005; Mara et al., 2004; Sevegnani et al., 2005). Further,
video cameras can potentially generate more reliable data owing to
its non-invasive nature during data collection.
An alternative to improve behavioral analysis relies on the
development of a computer vision system to automatically recog-
nize body shapes assumed by the birds when expressing different
behaviors from recorded videos (Sergeant et al., 1998). Computer
vision has been widely used in various processes of different ani-
mal production systems. It includes the automation of milking sys-
tems for dairy (Rossing and Hogewerf, 1997), robotic systems for
beef cattle management (Frost et al., 2000), and to estimate body
mass of pigs (Minagawa and Iechikawa, 1992). Broiler breeder
0168-1699/$ - see front matter 2013 Elsevier B.V. All rights reserved.

Corresponding author. Tel.: +55 14 3404 4200.

E-mail addresses: (D.F. Pereira),
(B.C.B. Miyamoto), (G.D.N. Maia),
(G. Tatiana Sales), (M.M. Magalhes),
(R.S. Gates).
Tel.: +55 14 3404 4200.
Tel.: +1 (859) 608 7570.
Tel.: +1 (217) 244 2791; fax: +1 (217) 244 0323.
Computers and Electronics in Agriculture 99 (2013) 194199
Contents lists available at ScienceDirect
Computers and Electronics in Agriculture
j our nal homepage: www. el sevi er . com/ l ocat e/ compag
management is critical to the broiler production chain because
housing conditions will affect oviposition, egg quality, hatching
rate, and chicks thermotolerance (Yahav et al., 2001).
The objective of this study was to develop a behavioral classi-
cation method for white broiler breeders using a novel machine vi-
sion technique method that incorporates datamining in the
analysis. The hypothesis of this work is that computer vision com-
bined with datamining analysis will aid the identication of broiler
breeder behavioral expressions. The objective was achieved with
the following steps: (a) selection of known broiler breeder behav-
ior expressions from body shape images, (b) collection of image
samples from a group of birds, (c) image processing and analysis
and (d) use of data mining and computer vision techniques to con-
struct and validate a behavioral classication tree.
2. Materials and methods
The data utilized in the methods presented here derived from
videos recorded from experiments performed in an environmen-
tally controlled chamber. Ten Hybro-PG broiler breeders were
placed in the chamber and exposed to three levels of temperature
(26, 29, and 35 C). For each temperature, the relative humidity
was kept between 60% and 70%. The oor was covered with shav-
ing bedding. Wooden nests, a tubular feeder, and bell drinkers
were installed in the chamber. A video camera with capacity of
registering 16-frames-per-second was installed down-faced from
the ceiling and used to monitor the birds behavior during the
experiment period.
This study is divided into four sessions: (1) studying body
shapes assumed by broiler breeders when expressing certain
behaviors using sequence of frames, (2) collecting image samples,
(3) processing and analyzing images, and (4) constructing and val-
idating a behavioral classication tree.
2.1. Behavior expression identication using sequences of image
Videos were recorded to capture various behavior expressions
as described by in the ethogram below (Table 1). The choice of
the behavior types was based on the high frequency of occurrence
of these behaviors in the video. Nest visits were also observed,
however, the birds were out of the coverage of the camera during
the expression of this behavior, hence, this behavior could not be
analyzed using the proposed methods.
The video analysis consisted of dening the number of frames
necessary to complete or to identify each behavior described in Ta-
ble 1. Videos with the birds were recorded and analyzed using im-
age processing and image analysis (as explained below), until a
behavior expression was dened. Each type of behavior and num-
ber of frames were determined from ten independent samples. The
frames allowed the observation of sequence of body shape changes
that occur when the birds express the selected behaviors.
2.2. Collecting image samples
A sample size n = 30 was chosen for analysis for each behavior.
Each sample unit was comprised by the number of frames deter-
mined using the method of Section 2.1. During video analyses, se-
quences of frames were collected every time a broiler breeder was
identied expressing any of the behaviors described in Table 1. A
sequence of frames starts at the beginning of each behavioral
expression thus composing a sample of that specic behavior.
2.3. Image processing and analysis
The method of image processing is critical to increase measure-
ment precision and analysis reliability. Images were processed
with white broiler chickens on a dark background dened by wood
shavings bedding. However, feathers and other objects in the envi-
ronment such as nests, feeders, and drinkers are often perceived as
birds, which can compromise correct classication of behavior. Im-
age processing was applied to improve and brighten up bird
images, prior to the image analysis, as a measure to reduce the
number of objects mistakenly identied as birds, and explained
2.3.1. Image processing
The image sample used for the behavior analysis was subjected
to a ve-step image processing. The procedure was performed to
increase the contrast of the image in study from its background.
Objects that were mistakenly classied as birds were removed,
or minimized in order to emphasize the contour of the birds.
First step: Images were converted from RGB (Red, Green, and
Blue) to the color system HSI (Hue, Saturation, and Intensity).
Hue (H) represents a specic color; Saturation (S) represents how
pure or saturated a color is when compared to white; and Intensity
(I) represents the brightness of a color. Thus, the color system HSI
is appropriate for intensifying contrast of colored images since H, S,
and I can be processed separately. In the RGB system, on the other
hand, these components are combined together (Predirni and Sch-
wartz, 2008).
Second step: Each pixel of the bands R, G, B, S, and I was normal-
ized to the interval [0, 1]. Once normalized, the pixels were then
represented by the letters r, g, b, s, and i, respectively. According
to Polidorio et al. (2005), normalization of pixels is necessary for
performing mathematical operations on pixel matrices.
Table 1
Ethogram of behaviors observed in the experiments.
Behavior Description Response variable
Wing spreading Birds spread their wings wide open Frequency of occurrence
Bristling Birds bristles their plumage and move their body laterally Frequency of occurrence
Drinking Birds approach drinkers and drink water Length of behavioral expression and frequency of
Scratching Birds explore their surroundings by scratching the ground with their feet and
Length of behavioral expression and frequency of
Resting Birds stay in resting position (lying or sitting) Length of behavioral expression and frequency of
Stretching Birds stretch out a wing and a leg of the same side of the body Frequency of occurrence
Preening Birds contort to reach their uropygial glands and groom their feathers with their
Length of behavioral expression and frequency of
Mounting A bird climbs another birds back Frequency of occurrence
Inactivity Birds stand on their feet without executing any of the activities described above Length of behavioral expression and frequency of
D.F. Pereira et al. / Computers and Electronics in Agriculture 99 (2013) 194199 195
Third step: White regions in the images were contrasted out
from the background and dened as possible chickens by using
Eq. (1). This equation was adapted from the study of Polidorio
et al. (2005) who adopted a similar relationship to contrast clouds
in satellite images.
ck 2 i s 1

1 b
The deduction of the inverse of r and b in the previous relation-
ship allows the subtraction of shapes such as bedding (which al-
ready shows saturation higher than intensity) from high values.
It also allows the subtraction of low values from lighter regions
(which show low saturation and high intensity). Therefore, apply-
ing Eq. (1)yields positive values for lighter regions (possible chick-
ens) and negative values for the remainder regions.
Fourth step: A binary-like image was obtained with positive pix-
els (possible chickens) converted to 1, and the remainder negative
pixels converted to 0.
Fifth step: The last step was characterized by purging the
lighter regions that did not represent chickens and that had small
area, by using the erosion-dilation technique (Predirni and Sch-
wartz, 2008). During the erosion-dilation process, a structuring
element was dened and acted on the contours of regions with
pixels equal to 1. First, the contour was eroded by the size of the
structuring element. Then, the same contour was dilated to the size
of the structuring element. This technique is efcient to eliminate
contour imperfections and regions that are not of interest (smaller
than the structuring element).
2.3.2. Image analysis
Image analysis is a process that falls between image processing
and computer vision, aiding the identication of the shapes of the
objects in study. Once images were processed as described previ-
ously, the following measurements of the regions corresponding
to chickens were extracted: Area (A) calculated by summing pixels
within a contour which constitutes a chicken; Perimeter (P)
calculated by summing pixels that were different from 1 which
constitute the contour; and, the Maximum (Dmax) and the Mini-
mum (Dmin) are the distances between the center of mass and
the perimeter. Fig. 1 shows the position of each of the measure-
ments extracted from lighter regions (chickens).
The shape coefcients were then calculated by entering the
parameters extracted from the images into Eqs. (2)(4). The ap-
proach is somehow different than the usual approach since it uses
the maximum and minimum distance from the center of mass to
the image perimeter.
4 p A
CCm ax
p Dm

p Dmin
From the variables recorded in each frame, we computed the
rates of variation of individual and combined variables, including
distance and velocity variables used to describe movements. Once
measurements were extracted from image samples, shape coef-
cients were calculated and measurements related to the analysis
of sequence of frames were obtained (Table 2).
2.4. Constructing and validating a behavioral classication tree
The parameters obtained with image analysis comprised a
supervised dataset, where each set of measurements was associ-
ated to a class (behavior). The dataset was generated from the vi-
deo analysis described in the introduction of Section 2. Each
registry was formed with the values of the variables described in
Table 1. These values were calculated for each sequence of frames
determined for each behavior. Trends in the data were investigated
by means of data mining techniques in order to create a classica-
tion tree. For that, the model J48 of supervised classication was
used in Software Weka

version 3.4.11. Two training algorithms

Fig. 1. (a) Original image amplied, (b) processed binary color image, (c) Birds contour boundaries and (d) parameters used to describe a chicken drinking water.
196 D.F. Pereira et al. / Computers and Electronics in Agriculture 99 (2013) 194199
were adopted to validate the tree model: cross validation and set
Cross validation is a suitable statistical method used to validate
an experimental model. This method was applied to a dataset di-
vided into ten parts. Nine parts were selected to generate one iter-
ation model, and the remaining tenth part was used for validation.
The processed is completed when each part was selected to vali-
date the nine-part model, for a total of ten iterations or validation
tests. Ideally, it is expected that the model can be extrapolated to
other datasets with precisions comparable to the precision esti-
mates obtained with this model.
Set training is a method that utilizes a dataset to generate a
model, using the same dataset in the validation process, for only
one iteration. A higher precision is expected in this model (lower
degrees of freedom) if compared to the cross-validation method.
However, a limitation this is that the model was applied to the
same birds, subjected to similar experimental conditions of illumi-
nation. This method was included as a way to compare two ac-
cepted parametric validation methods.
3. Results and discussion
The number of frames required to identify each behaviors was:
wing spreading (2), bristling (4), drinking (2), scratching (5), rest-
ing (4), stretching (4), preening (4), mounting (2), and inactivity
(3). Taking as an example the behavior preening, each of its sam-
ples was comprised by a sequence of frames formed by four images
of the same bird expressing that behavior, as shown in Fig. 2.
All behaviors had a sample size n = 30 except for stretching and
mounting with sample sizes n = 20 and n = 12, respectively. This
discrepancy was owing to a lower frequency of appearance of
those particular behaviors in the videos watched.
The classication tree (Fig. 3) yielded 8 levels and 27 leaves. The
validation of the classication tree was performed in cross
validation and in set training modes. The same data obtained
from the sampled images that generated the classication tree
were used for its validation in the set training mode resulting
in a behavioral classication rate of success of 96.7%.
Most of the behaviors were classied according to the class they
belonged to, however, some classication errors were observed.
The behavior preening, for instance, had 28 samples classied
correctly out of 30 samples taken. The remainder two samples
were incorrectly identied as resting and bristling. Moreover,
one sample from the behavior bristling and one sample from
the behavior stretching were incorrectly classied as preening
(see Table 3).
Data were divided into ten exclusive partitions of approxi-
mately the same size in the cross validation mode. One of the
partitions is used for validation whereas the remainder partitions
are used to generate the classication tree. This procedure is exe-
cuted ten times with a different partition each time for validation
(Meira et al., 2008). The overall rate of success in this validation
mode was 70.25%, using ten data partitions. Table 4 shows a higher
occurrence of classication errors. The behavior preening, for in-
stance, that had some samples incorrectly classied as resting
and bristling in the set training mode, had samples also mis-
taken by stretching and scratching in the cross validation
mode. In the latter, only 14 out of the 30 samples taken were clas-
sied correctly.
Computer vision image classication has been used in
several applications (Silva et al., 2004; Su et al., 2006). However,
the identication or correct classication of shapes in
situations where it is difcult to distinguish between colors be-
comes a challenge for computer vision systems (Duan et al.,
Selecting a bird is a challenge during the identication of indi-
vidually expressed chicken behaviors, because very often the bed-
ding is dirty and covered in feathers. In cases like this, the
Table 2
Measurements extracted from the shapes assumed by the birds when expressing the behaviors in study.
Measurements Description Measurements Description
Average area CC
Standard deviation of shape coefcient
Average perimeter Ccmax
Standard deviation of maximum shape
Average maximum distance between center of mass and perimeter CCmin
Standard deviation of minimum shape
Average minimum distance between center of mass and perimeter
Area gain velocity
Average shape coefcient
Perimeter gain velocity
Average maximum shape coefcient
Maximum distance increase velocity
Average minimum shape coefcient
Minimum distance increase velocity
Standard deviation of area
Coefcient of shape convergence velocity
Standard deviation of perimeter
Maximum coefcient of shape convergence
Standard deviation of the maximum distance between center of mass
and perimeter
Minimum coefcient of shape convergence
Standard deviation of the minimum distance between center of mass
and perimeter
Dmin/Dmax Minimum and maximum distances ratio
N is the number of frames of each analyzed behavioral sample.
Fig. 2. Sequence of frames that comprises one of the preening behavioral samples: (a) frame 1, (b) frame 2, (c) frame 3, and (d) frame 4.
D.F. Pereira et al. / Computers and Electronics in Agriculture 99 (2013) 194199 197
algorithm must identify only larger shapes after image processing
(Chen et al., 2002), which will eliminate any strange objects in the
scene. When it comes to image analysis, it is necessary to investi-
gate signicant and differentiable shape parameters related to
each behavior, which usually present repeatable and similar
The methodology adopted to analyze measurements extracted
from shapes in sequence of frames has proven successful. A classi-
cation tree of behaviors expressed by broiler breeders has been
generated with a rate of success higher than 87% (Su et al., 2006)
for detecting contaminants in wool, and higher than 90% (Shao
and Xin, 2007) for classifying images of pigs.
4. Conclusions
The methodology developed to identify broiler breeders behav-
iors by means of machine vision techniques has shown a rate of
success higher than 70% for both validation methods adopted. Nev-
ertheless, the overall rate of success could be improved if the video
illumination could be better controlled. It was observed that the
illumination affected the selection of image processing methods
used to differentiate the birds from other objects and background.
Hence, improved illumination techniques would ameliorate the
process of differentiation of the birds from the background, which
would, in turn, increase the precision of the applied methods. An-
other factor that would improve identication precision is the
development of methods to track bird trajectory. For example,
the use of trajectory tracking methods for drinking and eating
behaviors implemented in areas where these behaviors occur with
high frequency.
Archer, G.S., Shivaprasad, H.L., Mench, J.A., 2009. Effect of providing light during
incubation on the health, productivity, and behavior of broiler chickens. Poultry
Science 88, 2937.
Chen, Y.R., Chao, K., Kim, M.S., 2002. Machine vision technology for agricultural
applications. Computer and Electronics in Agriculture 36, 173191.
Costa, M.J.R.P., 2003. Princpios de etologia aplicados ao bem-estar das aves.
Conferncia Apinco de Cincia e Tecnologia Avcola. Anais. Campinas, pp. 169
Curto, F.P.F., Ns, I.A., Pereira, D.F., Salgado, D.D., 2007. Estimativa do padro de
preferncia trmica de matrizes pesadas (frango de corte). Revista Brasileira de
Engenharia Agrcola e Ambiental 11 (2), 211216.
Duan, F., Wang, Y.N., Liu, H.J., Li, Y.G., 2007. A machine vision inspector for beer
bottle. Engineering Applications of Articial Intelligence 20, 10131021.
Frost, A.R., Tillett, R.D., Welk, S.K., 2000. The development and evaluation of image
analysis procedures for guiding a livestock monitoring sensor placement robot.
Computers and Electronics in Agriculture 28, 229242.
Mara, G.A., Escs, J., Alados, C.L., 2004. Complexity of behavioural sequences and
their relation to stress conditions in chickens (Gallus gallus domesticus): a
non-invasive technique to evaluate animal welfare. Applied Animal Behaviour
Science 86, 93104.
Fig. 3. Classication tree of behaviors expressed by broiler breeders.
Table 3
Classication trees confusion matrix (set training mode).
a b c d e f g h i
30 0 0 0 0 0 0 0 0 a = wing spreading
0 28 0 0 0 1 0 1 0 b = bristling
0 0 30 0 0 0 0 0 0 c = drinking
0 0 0 29 1 0 0 0 0 d = scratching
0 0 2 0 28 0 0 0 0 e = resting
0 0 0 0 0 19 0 1 0 f = stretching
0 0 0 0 0 0 30 0 0 g = inactivity
0 1 0 1 0 0 0 28 0 h = preening
0 0 0 0 0 0 0 0 12 i = mounting
Table 4
Classication trees confusion matrix (cross validation mode).
a b c d e f g h i
30 0 0 0 0 0 0 0 0 a = wing spreading
0 17 0 2 0 7 0 3 1 b = bristling
0 0 21 7 1 0 1 0 0 c = drinking
0 1 2 21 3 1 2 0 0 d = scratching
0 0 3 3 20 0 1 3 0 e = resting
1 8 0 0 0 10 0 1 0 f = stretching
0 1 1 0 1 0 27 0 0 g = inactivity
0 3 0 5 6 2 0 14 0 h = preening
0 0 0 0 0 2 0 0 10 i = mounting
198 D.F. Pereira et al. / Computers and Electronics in Agriculture 99 (2013) 194199
Meira, C.A.A., Rodrigues, L.H.A., Moraes, S.A., 2008. Anlise da epidemia da ferrugem
do cafeeiro com rvore de deciso. Tropical Plant Pathology 33, 114124.
Minagawa, H., Iechikawa, T., 1992. Measurement of pig weights by an image
analysis. ASAE Paper 92-0000, pp. 18.
Predirni, H., Schwartz, W.R., 2008. Anlise de imagens digitais: princpios,
algoritmos e aplicaes. Thomson Learning Edies, So Paulo, SP, p. 508.
Pereira, D.F., Naas, I.A., Curto, F.P.F., Murayama, M., 2001. Avaliao do local do
implante de microchip utilizados para identicao eletrnica em matrizes
pesadas (Evaluating the place for transponder implant used in EID for broilers
breeder). Supplement of Brazilian Journal of Poultry Science 1, 53 (Campinas,
Pereira, D.F. Metodologia para estimativa de bem-estar de matrizes pesadas
utilizando monitoramento digital e construo de modelos de simulao.
Programa de Ps-Graduao (Tese), FEAGRI-UNICAMP, 2005. p. 138.
Polidorio, A.M., Flores, F.C., Franco, C., Imai, N.N; Tommaselli, A.M.G. Deteco
automtica de sombras e nuvens em imagens CBERS e Landsat 7 ETM. Simpsio
Brasileiro de Sensoriamento Remoto, Brasil, 2005, pp. 42334240.
Prayitno, D.S., Phillips, C.J.C., Stokes, D.K., 1997. The effect of color and intensity of
the light on behavior and leg disorder in broiler chickens. Poultry Science 76,
Rossing, W., Hogewerf, P.H., 1997. State of the art of automatic milking systems.
Computers and Electronics in Agriculture 17, 117.
Salgado, D.D., Ns, I.A., Pereira, D.F., Moura, D.J., 2007. Modelos estatsticos
indicadores de comportamentos associados a bem-estar trmico para matrizes
pesadas. Engenharia Agrcola Jaboticabal 27 (3), 619629.
Sergeant, D., Boyle, R., Forbes, M., 1998. Computer visual tracking of poultry.
Computer and Electronics in Agriculture 21, 118.
Sevegnani, K.B., Caro, I.W., Pandor, H., Silva, I.J.O., Moura, D.J., 2005. Zootecnia de
preciso: anlise de imagens no estudo do comportamento de frangos de corte
em estresse trmico. Revista Brasileira de Engenharia Agrcola e Ambiental 9,
Shao, B., Xin, H., 2007. A real-time computer vision assessment and control of
thermal comfort for group-housed pigs. Computers and Electronics in
Agriculture 62, 1521.
Shields, S.J., Garner, J.P., Mench, J.A., 2005. Effect of sand and wood-shavings
bedding on the behavior of broiler chickens. Poultry Science 84, 18161824.
Silva, W.T., Moura, D.J., Ns, I.A., Mendes, A.S., Lima, K.A.O., 2004. Estimativa de
bem-estar de leites utilizando a viso computacional. Revista Brasileira de
Informtica 6, 7989.
Su, Z., Tian, G.Y., Gao, C., 2006. A machine vision system for on-line removal of
contaminants in wool. Mechatronics 16, 243247.
Yahav, S., Straschnow, A., Vax, E., Razpakovski, V., Shinder, D., 2001. Air velocity
alters broiler performance under harsh environmental conditions. Poultry
Science 80, 724726.
D.F. Pereira et al. / Computers and Electronics in Agriculture 99 (2013) 194199 199