Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Journal of Mammalogy, 91(6):1350–1359, 2010

Computer-aided photo-identification system with an application to


polar bears based on whisker spot patterns
CARLOS J. R. ANDERSON,* NIELS DA VITORIA LOBO, JAMES D. ROTH, AND JANE M. WATERMAN
Department of Biology, University of Central Florida, Orlando, FL 32816, USA (CJRA, JDR, JMW)
Department of Computer Science, University of Central Florida, Orlando, FL 32816, USA (NDVL)
* Correspondent: carlosja@msu.edu

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


Ecologists often rely on unique natural markings to identify individual free-ranging animals without disturbing
them. We developed a computer-aided photo-identification system for identifying polar bears (Ursus
maritimus) based on whisker spot pattern recognition. We automated our system so that the selection of 3
reference points on the input image is the only manual step required during image preprocessing. Our pattern-
matching algorithm is unique in that the variability within spot patterns is considered fully rather than
representing them as points and applying a point-pattern matching algorithm. We also measured the reliability
of our method as probabilities of true positives and false positives using photographs of various qualities taken
at different angles. When we excluded photographs of poor quality and angle the probability of true positives
was .80% at a false positive probability of 10%. A new photograph could be preprocessed in ,1 min and
tested against a reference library of 100 individuals in ,10 min. Our computer-aided identification system
could be extended for use in other species with variable spot patterns, which could be useful in efforts to
estimate various population dynamics parameters essential for the study and conservation of wildlife,
particularly threatened and endangered species. DOI: 10.1644/09-MAMM-A-425.1.

Key words: capture–recapture, Chamfer, computer vision, image pattern matching, noninvasive identification, reliability,
Ursus maritimus

E 2010 American Society of Mammalogists

In studies of population dynamics using capture–recapture threatened or endangered species this method can be
models, estimates of population size and rates of survival, especially undesirable or even prohibited (Kelly 2001;
reproduction, and migration can be obtained only if animals Pennycuick and Rudnai 1970). Additionally, visible tags or
can be identified uniquely (Nichols 1992). Because animals tattoos can interfere with recreational or professional wildlife
often differ in their individual behavior (Fagen and Fagen photography. Marking animals can be convenient, however,
1996; Martin and Kraemer 1987), individual recognition of when handling is necessary for measuring physiological traits,
animals is also essential in studies of behavioral ecology. In sampling blood or tissue, or attaching radiocollars for tracking
analyses of animal movement patterns individual animals are (Ramsay and Stirling 1986).
frequently tracked through space and time (Parks et al. 2006). An alternative method of identifying animals individually is
Thus, many kinds of ecological studies involve identifying through natural markings, such as pelage spot patterns on
individual animals in the field (Nietfeld et al. 1994). cheetahs (Acinonyx jubatus—Kelly 2001), fin marks on
One method of identifying animals individually is by cetaceans (Hammond et al. 1990), and whisker spot patterns
applying artificial markings, such as tags, tattoos, or tissue on lions (Panthera leo—Pennycuick and Rudnai 1970) or
removal (Nietfeld et al. 1994). Artificial markings are unique polar bears (Ursus maritimus—Anderson et al. 2007). The
for each animal, making this method very reliable, unless the main advantage of using natural markings is that it is generally
animal loses its markings (Diefenbach and Alt 1998). noninvasive because the animal can be identified from a
Applying artificial markings, however, is invasive because distance without disturbing it. In addition, using natural
the animal typically must be captured and handled to be markings is practical and affordable because it involves
marked and often recaptured to be identified (Pennycuick and operating accessible equipment (e.g., a photographic camera).
Rudnai 1970). Consequently, this method could be difficult
and expensive to use and possibly detrimental to the health or
behavior of the animal (Kelly 2001; Pennycuick 1978). For www.mammalogy.org
1350
December 2010 ANDERSON ET AL.—AUTOMATED IDENTIFICATION OF POLAR BEARS 1351

The main disadvantage, however, is that unless the entire A reliable identification system should produce similarity
study population is sampled, it is not possible to know for scores for photographs of the same individual that are well
certain whether natural markings of every individual are below the similarity threshold (in this study, we assume that
unique (Pennycuick 1978). In addition, natural markings can the lower the score, the better the match, but this criterion
be difficult to distinguish from a distance, or might be lacking depends on the specific identification system). Two main
altogether, which can lead to incorrect identification (Oliveira- types of error, however, degrade the reliability of an
Santos et al. 2010). Furthermore, searching for an individual’s identification system: photographs of different individuals
identity by visually comparing hundreds or thousands of are incorrectly recognized as a match (i.e., a false positive);
natural patterns can be tedious, error-prone, and time- and photographs of the same individual are not recognized as a
consuming (Hillman et al. 2003; Kelly 2001). match (i.e., a false negative—Hastings et al. 2008; Kelly
To overcome these disadvantages various computer-aided 2001). The 1st type of error, or probability of false positives,

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


identification systems have been developed to recognize and reflects the proportion of individuals in the reference library
match natural markings. Recognition of pelage or skin spot that must be evaluated by the user for every identification
patterns, for example, has been used to identify individual attempt. For example, if a reference library contains 100
seals (Hastings et al. 2008; Hiby and Lovell 1990), cheetahs individuals and the probability of false positives is 10%, every
(Kelly 2001), whale sharks (Rhincodon typus—Arzoumanian attempt would list (on average) 10 incorrect individuals below
et al. 2005), and spotted raggedtooth sharks (Carcharias the similarity threshold. The 2nd type of error commonly is
taurus—van Tienhoven et al. 2007). Sperm whales (Physeter assessed not by the probability of false negatives but by the
catodon—Huele and de Haes 1998; Whitehead 1990) and probability of true positives (12probability of false nega-
many other marine animals have been identified uniquely by tives), or simply the probability of obtaining a correct match
computerized recognition of edge patterns on their fins or between the same individuals.
flukes (Hillman et al. 2003). Stripes or bands have been used Both types of error are controlled by the similarity threshold
by computer-aided identification systems, most recently in simultaneously. For example, the probability of true positives
zebras (Equus burchellii—Foster et al. 2007) and marbled can be made as high as desired by modifying the similarity
salamanders (Ambystoma opacum—Gamble et al. 2008). threshold. The trade-off, however, is that the higher the
In many computer-aided identification systems each new probability of true positives, the higher the probability of false
image required substantial preprocessing (e.g., cropping or positives. To evaluate this trade-off the assessment of an
enhancing brightness and contrast), which can be time- identification system should include both its probability of
consuming, require training, and introduce subjectivity and true positives and probability of false positives. Often,
error (Kelly 2001). Furthermore, individual features (e.g., however, only the probability of true positives is reported,
spots and stripes) of natural patterns often vary in shape and which not only makes it difficult to compare performance
size, yet many computer-aided identification systems ignore among various systems but also obscures the amount of
this variability and focus on the arrangement of these features additional user effort required in evaluating potential matches.
instead. Some identification systems use ‘‘blob extraction’’ to We developed and evaluated a novel computer-aided photo-
translate a pattern into a set of (x, y) points, to then apply a identification system for animals with distinct natural patterns
point pattern matching algorithm to compare a pair of patterns. and applied it to polar bears using their whisker spot patterns.
This method works well for features with little variation in Polar bear whisker spots are found at the base of the whisker
shape or size (Arzoumanian et al. 2005; van Tienhoven et al. follicles, arranged in a distinct pattern on each side of the
2007) or when the arrangement of the features composing the anterior end of the muzzle, and can be used to identify
pattern is more important than the shape or size of the features individual bears reliably (Anderson et al. 2007). Because the
themselves. When the individual features of a pattern are size and shape of these spots can vary, we developed a unique
important, however, translating these features to simpler matching algorithm that operates on the image itself without
representations can reduce the reliably of identification. translating the pattern into an alternative representation. We
Moreover, irregular or complex natural patterns cannot be determined the trade-off between the probability of true
translated easily to a simpler representation. positives and the probability of false positives in our system
Computer-aided identification systems often work by and evaluated its performance against photographs of different
comparing the photograph of the animal in question with the quality taken at various angles. To automate the matching
photographs of known individuals (i.e., a reference library). process as much as possible, minimizing user involvement, the
For each comparison of the unknown photograph with a only steps in our system involving the user are choosing 3
reference photograph, the system produces a numerical reference locations on an input image and verifying that
similarity score. If the similarity score is below—or above, putative matches are correct.
depending on the system—a specified similarity threshold, the
photographs are considered a potential match (i.e., they likely
belong to the same individual). Similarity scores often are MATERIALS AND METHODS
ranked to place the best scores 1st, making it easier for the Study site and collection of polar bear photographs.—We
user to evaluate potential matches. photographed polar bears approximately 30 km east of the
1352 JOURNAL OF MAMMALOGY Vol. 91, No. 6

town of Churchill, Manitoba, Canada (58u459N, 93u459W).


Polar bears congregate along the western shore of Hudson Bay
as the sea ice melts in August and remain on the coast until
freeze-up in mid-November (Latour 1981). We accessed our
study site via a tundra vehicle, a large bus adapted for
travelling on tundra and normally used for ecotourism (Dyck
and Baydack 2004). No more than 18 tundra vehicles were
permitted within our site. Polar bears rarely responded to the
approach of a vehicle (Eckhardt 2005) and were free to leave
the site at any time. All procedures were in accordance the
guidelines of the American Society of Mammalogists (Gannon

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


et al. 2007) and were approved by the University of Central
Florida Animal Care Committee (04-34W).
Photographs of polar bears were taken daily (0900–1500 h)
by trained volunteers and ourselves during 18 October–11
November 2003, 18 October–10 November 2004, and 18
October–10 November 2005, using Nikon D100 6.0-mega-
pixel digital cameras and 70–300 and 80–400 mm lenses
(Nikon, Melville, New York). When possible, polar bears
were identified individually by facial scars, sex, and body
shape and size (Eckhardt 2005; Eckhardt et al. 2002).
Photographs of the same polar bear were taken multiple times
throughout each field season. We used photographs of the
same polar bear taken 1 day apart (in some cases, 1 year
apart) to evaluate our system.
Computer-aided identification system.—Our identification
system consists of 3 main components: the reference library,
the image preprocessing method, and the matching algorithm.
The reference library stores images of known individuals and
is used as the source of images to match new animals. The
image preprocessing method automatically extracts the natural
pattern of interest from an image by standardizing and
enhancing the image. Finally, the matching algorithm
computes the similarity score between 2 images. The user
must select 3 locations, or reference points, on an input image
for the system to orient the image automatically and find the
whisker spot pattern region. For polar bears these points are FIG. 1.—a) Polar bear photograph marked by the user with 3
the front corner of the eye, the notch of the nose, and the reference points required by the identification system: 1) front corner
trailing edge of the mouth (Fig. 1a). Our identification system of the eye, 2) notch of the nose, and 3) trailing edge of the mouth. b)
Standardization of the photograph by an affine geometric transform.
was written in Microsoft Visual C# 2005 Express Edition
(.NET Framework 2.0; Microsoft Corp., Redmond, Washing-
ton). All computer development and analyses were conducted on pixels to the right of the corner of the eye and the edge of the
a Latitude D620 (Dell, Round Rock, Texas) with dual 2.0 GHz mouth lay 128 pixels to the right and 128 pixels below the eye
processors and 2.0 GB of memory. A summary of the steps taken (Fig. 1b). The resulting image was small enough to keep the
by our polar bear identification system is found in Appendix I. computational time reasonable while allowing small whisker
Image preprocessing.—The input image was 1st converted spots to remain visible. Standardizing the input image to a
to grayscale using the luminance formula 0.30 3 R + 0.59 3 G predefined orientation and size facilitated comparing it with
+ 0.11 3 B (Bunks 2000), where R, G, and B are the red, green, the reference library images, which also were standardized.
and blue values of a pixel. Grayscale conversion simplified Next, the image was cropped around the region where
the implementation of the methods used below without whisker spots typically are found (Fig. 2a). The cropped
sacrificing information loss, given that whisker spot regions image then was enhanced 1st by histogram matching
of polar bears are not colorful. With use of the 3 reference (Gonzalez and Woods 2002), which adjusts the histogram of
points selected by the user, the image was geometrically pixel values of the image to match the histogram of a good-
(affine-) transformed (Foley et al. 1995) to a predefined quality image of polar bear whisker spots; and 2nd, by
orientation and size using the Graphics.Transform property in logarithmic transformation (Fisher et al. 2004; Gonzalez and
Visual C# (Petzold 2002) so that the notch of the nose lay 240 Woods 2002), which applies a logarithmic function to every
December 2010 ANDERSON ET AL.—AUTOMATED IDENTIFICATION OF POLAR BEARS 1353

the 2nd image, and uses the mean of these distances as the
final distance between the images. Note that ‘‘nearest’’ does
not imply nearby because the nearest black pixel of the 2nd
image could be relatively far from the 1st and therefore will
have a large Euclidean distance that will increase the overall
Chamfer distance between the images. Also, note that if 2
black pixels are closely aligned, the distance used in the
Chamfer calculation is very small (0 for a perfect alignment),
regardless of the presence of other black pixels. However,
when 2 images come from the same individual but 1 of the
images contains spurious pixels (i.e., black pixels that are not

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


true identifying spots), the distance between each spurious
pixel and the nearest black pixel of the other image will be
large. These large distances will cause the overall Chamfer
distance to be large even though the images come from the
same individual.
To reduce the influence that spurious pixels had on the
resulting similarity score, our implementation used the median
of distances (rather than the mean) to calculate the Chamfer
distance because the median of a set of numbers is less
FIG. 2.—Preprocessing of the input photograph of a polar bear. a) affected by outliers than the mean. Because the Chamfer
The image was cropped automatically around a fixed area where distance differs depending upon which image is 1st or 2nd, our
whisker spots are typically found, b) enhanced by histogram algorithm also calculated the Chamfer distance of the images
matching and logarithmic transformation, c) smoothed by neighbor- in reverse order and averaged these 2 distances (Fig. 3).
hood averaging, and d) turned to black and white by applying Furthermore, to account for image misalignments caused by
adaptive thresholding repeatedly. foreshortening (i.e., rotations toward or away from the
camera), our algorithm calculated the Chamfer distance
pixel value of the image to improve its contrast (Fig. 2b). The repeatedly while moving one image about the other up to 16
enhanced image was smoothed by neighborhood averaging pixels in each direction (in 2-pixel increments for faster
(Gonzalez and Woods 2002) with a neighborhood radius of 2 computation, but this increment value can be changed by the
to remove noise (Fig. 2c). user), and used the minimum of these distances as the final
The smoothed image was converted to black and white (not similarity score (Fig. 4). The affine transformation applied
grayscale) using adaptive thresholding (Davies 2004; Foster during image preprocessing best handled clockwise or
et al. 2007), which changes to black any pixel whose value is counterclockwise rotations, but the shifting procedure above
lower than a threshold relative to its neighborhood— handled rotations due to foreshortening.
otherwise, the pixel is changed to white. We found, however, Reliability of the identification system.—Photographs of the
that using a predefined threshold value for adaptive thresh- same polar bear were chosen so that they were taken 1 day
olding did not preserve the original size of whisker spots on apart (in some cases, 1 year apart). Photographs were
low-quality images. Thus, the threshold value for a particular categorized according to angle (excellent, moderate, and poor)
image was determined by testing adaptive thresholding with and quality (excellent, moderate, and poor). Angle was based on
multiple, increasing threshold values (starting with a value of how perpendicular the facial profile of a polar bear was to the
2) until the total number of black pixels on the entire image camera axis: excellent deviated ,15u from the camera axis,
was 300. Because the total number of black pixels on an moderate deviated 15–30u, and poor deviated 30–45u. Photo-
image decreases each time the threshold value is increased, graphs with angle .45u were not used in our study because
our condition of the upper limit on the number of black pixels whisker spots were imperceptible to us. We estimated these
always will be met. This limit value on the number of black angle deviations using a miniature polar bear model rotated to
pixels and the size of the neighborhood (radius of 4 pixels) match the perspective of the polar bear in the photograph.
were determined empirically by testing this algorithm with Quality was estimated based on image sharpness (Fig. 5).
several preprocessed high-quality images. Finally, the result- We used our identification system to compute the similarity
ing image was cropped again to eliminate extraneous artifacts scores for pairs of photographs of the same polar bear with
around the edges left by adaptive thresholding (Fig. 2d). excellent angle and quality. Then, to examine the effect of
Computation of the similarity score.—We used the Chamfer photographic angle and quality we computed the scores for
distance algorithm (Borgefors 1986) to compute the similarity pairs of photographs of the same bear, with one photograph
score between 2 preprocessed images. The Chamfer distance having excellent angle and quality and the other having either
algorithm looks at each black pixel of the 1st image and medium angle and excellent quality or excellent quality and
determines its Euclidean distance to the nearest black pixel of medium angle. Also, we computed the scores for photographs
1354 JOURNAL OF MAMMALOGY Vol. 91, No. 6

quality, 19 had another photograph of excellent angle and


moderate quality, 14 had another photograph of excellent
angle and poor quality, 18 had another photograph of
moderate angle and excellent quality, and 18 had another
photograph of poor angle and excellent quality.
The mean similarity score for comparisons of different
photographs of the same polar bear increased (i.e., photo-
graphs were less alike) as the level of quality or angle of one
of the photographs decreased from excellent to moderate to
poor (Fig. 6). The mean score was highest, however, for
comparisons of photographs of different polar bears (Fig. 6).

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


As we increased the similarity threshold the proportion of
comparisons between different polar bears with scores below
that threshold (i.e., the probability of false positives) also
increased (Fig. 7).
The probability of true positives increased as the probability
of false positives increased (Fig. 8). The probability of true
positives decreased, however, when we used photographs of
moderate angle or quality and decreased further with
photographs of poor angle or quality (Fig. 8). For example,
the probability of true positives using photographs of moderate
angle was only 80% when the probability of false positives
was 5%, but the probability of true positives increased to 90%
when the probability of false positives was 10%. When we
used photographs of excellent quality and angle only (albeit a
small sample), the probability of true positives was 100%
when the probability of false positives was only 2%.
When the similarity scores of 37 matching attempts using
FIG. 3.—Sample images A and B overlapped to illustrate how the photographs of excellent and moderate angle and quality were
similarity score between 2 images was calculated. Each square sorted from lowest to highest (i.e., best to worst), the correct
corresponds to a pixel of either image. The number on each black
match was listed first 27 (73%) times (Table 1). This sorted
pixel is the Euclidean distance, rounded to the nearest 0.1, between
list of scores is how our identification system reports all
the center of that pixel and the center of the nearest black pixel on the
other image. The distance of image A to B is 1.0 (median of numbers matching results, such that the user is always able to verify
on image A). The distance of image B to A is 1.2 (median of numbers matches (or mismatches) by eye. The overall mean position of
on image B). Thus, the similarity score between images A and B is 1.1 the correct match in the sorted list was 2.0 6 0.4 SE (n 5 37)
(average of above distances). in a reference library of either 25 (left-sided photographs) or
32 (right-sided photographs).
of different polar bears with excellent angle and quality to
examine the relationship between the probability of true
positives and the probability of false positives. As an
DISCUSSION
additional measure of reliability we sorted the similarity Our computer-aided identification system, which includes
scores in ascending order (i.e., best to worst) of 37 matching information on the size and shape of whisker spots and their
attempts using photographs of excellent and moderate quality location, proved reliable when applied to polar bear whisker
and angle. We recorded the position in the sorted list of the spots. Our system had a reasonable probability of true
correct match, which would indicate the number of matches in positives (80%) with a low probability of false positives
our identification system that would have to be verified before (10%) when we excluded photographs of poor angle and
encountering the correct match. quality. At this false positive probability about 3 potential
matches using a reference library of 30 individuals would have
to be verified by the user to obtain an expected probability of
RESULTS true positives of 80%. We found the correct match 86.5% of
From .200 individuals photographed we found 57 the time when we verified the top 3 potential matches when
individuals with photographs of excellent angle and quality, similarity scores were ranked (Table 1). The probability of a
resulting in 796 possible comparisons of the same side of the true positive improved when similarity scores were sorted
face of different polar bears (25 photographs of the left side because correct matches often had lower scores than the other
and 32 of the right side). Of these 57 individuals, 8 had a 2nd potential matches, even if the scores of correct matches were
photograph of the same side of the face of excellent angle and above the similarity threshold.
December 2010 ANDERSON ET AL.—AUTOMATED IDENTIFICATION OF POLAR BEARS 1355

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


FIG. 4.—Surface plots of similarity scores (0 to 8) determined from 2 images, shifted up to 16 pixels in each direction (horizontal and
vertical). Each column of plots corresponds to comparisons of images with various photographic angles: 1) excellent angle (EA) for both images
of the same polar bear, 2) 1 excellent and 1 moderate angle (MA) image, 3) 1 excellent and 1 poor angle (PA) image, and 4) excellent angle for
both images of different polar bears. No polar bear was used more than once for any comparison in this figure.

Poor-angle photographs caused our system to misalign the because the user would have to verify only about 20 individuals
images while computing the similarity score because polar bear on average before finding the correct one. In contrast, if our
whisker spot patterns were foreshortened. In a computer-aided database was large—for example, 1,000 individuals—we might
identification system for whale sharks (R. typus) based on skin tolerate a 5% probability of false positives at the cost of a lower
spot patterns, foreshortening also produced mismatches when probability of true positives. We then can use the relationship
using photographs with angle .30u (Arzoumanian et al. 2005). between the similarity threshold and the probability of false
Nevertheless, using poor-angle photographs is useful because positives to determine the similarity threshold we need to use.
having a record of an individual at various angles improves its We recommend that future evaluations of identification systems
chance of being recognized in the future (Arzoumanian et al. show the relationship between the probability of true positives
2005; Hillman et al. 2003; Kelly 2001). and probability of false positives, or at least report the
Polar bear photographs with poor quality caused smaller probability of false positives alongside the reported probability
whisker spots to disappear during preprocessing, effectively of true positives at the chosen similarity threshold.
changing the extracted pattern. Our method of repeatedly We found that most excellent- and moderate-quality
applying adaptive thresholding to improve robustness was photographs were taken at a distance ,50 m from the polar
most effective with moderate-quality photographs. Objective bears. Anderson et al. (2007) found that whisker spots of polar
definitions of photographic quality are difficult to compare bears were most distinguishable in photographs taken ,50 m
across studies, but others also have found that using poor- away from the bears. Future improvements in digital
quality photographs reduces the probability of true positives photography and more advanced optical equipment should
(Kelly 2001; Whitehead 1990). allow more-distant animals to be recognized. The current
The appropriate similarity threshold for our system can be distance limitation might preclude the use of our system in
chosen based on the trade-off between the probability of true remote locations where achieving proximity to polar bears is
positives and probability of false positives. For example, we difficult (Anderson et al. 2007).
might tolerate a 20% probability of false positives if our In species lacking stripes or spots authors often argue that
reference library was small—for example, 100 individuals— they can use subtle marks, scars, and other attributes to
1356 JOURNAL OF MAMMALOGY Vol. 91, No. 6

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


FIG. 7.—Relationship between the similarity threshold and the
probability of a false positive for comparisons of polar bear
photographs. The higher the threshold is set, the more comparisons
with a similarity score below the threshold (i.e., incorrect matches).

lowland tapirs (Tapirus terrestris) to 14 researchers for


FIG. 5.—Photographs of different polar bears were manually identification and found that errors in identification ranged
categorized as a) excellent quality, b) and c) moderate quality, and d) up to 75% even though they used a small sample size of
poor quality. Excellent-quality photographs were well focused and individuals and photographs. They concluded that haphazard
crisp, clearly showing individual whisker spots. Moderate-quality identification of individuals from photographs can lead to
photographs lacked sharpness, but individual whisker spots could still numerous misidentifications. Like tapirs, polar bears have
be discerned. Poor-quality photographs were unfocused and blurry,
little in the way of external identifying marks to use to
making it difficult to distinguish individual whisker spots.
discriminate among individuals. In our research we are
identify individuals reliably (Oliveira-Santos et al. 2010). investigating the behavior of polar bears in a population of
Oliveira-Santos et al. (2010) tested the ability of researchers to approximately 1,000 animals (Regehr et al. 2007), more
discriminate among individuals in a species without clear individuals than we could possibly match by eye based on
identifying marks. They sent 55 photographs of 8 individual natural marks. The use of whisker spots is a reliable
discriminator among individuals for this species (Anderson
et al. 2007), but whisker spots vary in position, number, and

FIG. 6.—Mean similarity score for comparisons of different


photographs of the same polar bear (first 2 sets of bars) and
photographs of different bears. The score for comparisons of the same
bears increased (i.e., decreased in similarity) as the quality or angle of
one of the photographs decreased from excellent to moderate to poor FIG. 8.—Relationship between the probability of a false positive
(the other photograph in each comparison had excellent quality and and the system accuracy for photographs of excellent, moderate, and
angle). The mean score was highest when we compared photographs poor quality and angle. In general, as the probability of false positives
of different bears (both photographs in each comparison had excellent increased the system accuracy increased. For any specific probability
quality and angle). Error bars represent 1 SE. Numbers above bars of false positives the system accuracy decreased with decreasing
represent the number of comparisons in each category. quality or angle.
December 2010 ANDERSON ET AL.—AUTOMATED IDENTIFICATION OF POLAR BEARS 1357

TABLE 1.—Number of matching attempts (from a total of 37) that (Anderson et al. 2007). Adult polar bear whisker spot patterns
placed the correct match between 2 polar bear photographs (of change little from year to year, but it is unknown whether
excellent and moderate angle and quality) at the specified position in whisker spot patterns change with the bear’s maturation or
the sorted list of similarity scores. whether they are similar among related polar bears (Anderson et
Position of correct match No. matching attempts al. 2007). In African penguins (Spheniscus demersus), chest
spots on juveniles are not reliable (T. Burghardt, University of
1 27
2 4 Bristol, pers. comm.), and thus only adults could be identified
3 1 using an identification system. Kelly (2001) found no difference
5 1 between similarity scores of related cheetahs (A. jubatus) and
6 2 scores of unrelated cheetahs, implying that cheetah spot patterns
7 1
were not similar among related individuals.

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


13 1
We already have used our identification system in studies of
polar bear behavior in western Hudson Bay. With our system
size. The combination of patterns to discern individuals is too we have identified several polar bears that were previously
complicated for us to determine, 1st, individual identity by eye unknown due of lack of distinct markings (other than whisker
in a sample of 37, or even as few as 20, bears (it would take spots). Our identification system can be modified for use with
more than a day to do 100 individuals), and 2nd, if an other species where invasive identification can be difficult or
individual is new and not one from our known catalog of undesirable. For example, we recently modified our system to
bears. Our computer program, on a laptop, would allow us to recognize individual boreal toads (Bufo boreas boreas) from
narrow down possible matches to 1 or 2 individuals and thus their irregular belly markings (in collaboration with K.
avoid the problems found by Oliveira-Santos et al. (2010). Thompson, Colorado Division of Wildlife, Montrose, Colora-
Our identification system took up to 5 s to compute the do), where we have had good preliminary results. Our system
similarity score for a single image comparison using a Latitude is especially ideal for identifying animals with irregular
D620 laptop with dual 2.0 GHz processors and 2.0 GB of markings because our algorithm considers the shape and size
memory. Thus, our system would take ,10 min to match 1 of individual spots or other features. Finally, our system could
photograph against a reference library of 100 individuals (i.e., be used in conjunction with capture–recapture methods to
length of time grows linearly with the size of the reference estimate ecological parameters essential for the study,
library). Because we often observed no more than 10 new polar management, and conservation of animals.
bears in the field per day, our system is fast enough to be used in
the field (i.e., on a laptop). Inputting a photograph into the ACKNOWLEDGMENTS
system took ,1 min, including selecting the 3 reference points
Funding was provided by The Earthwatch Institute, Polar Bears
and the time the system took to enhance, or preprocess, the International, and the Cotswold Foundation. We are grateful to the
image automatically. In contrast, some identification systems many volunteers who helped us in the field (especially M. Miller, B.
require the user to preprocess images or perform additional Pettitt, and A. Wubbels), our tundra buggy driver B. Debits, and the
steps manually, which can take several more minutes. staff of the Churchill Northern Studies Centre. We thank R.
The matching algorithm we used to compute the similarity Buchanan and C. Buchanan for their generous support. We are
score of a pair of images was based on the Chamfer distance grateful to C. Schwarz for his programming assistance and K. Osborn
algorithm, a computer vision technique that works on images for providing additional literature. We thank K. Thompson for his
directly. Other systems use ‘‘blob extraction’’ to transform a interest and involvement in applying our system to identifying boreal
toads. Finally, we thank J. Holmberg for providing valuable
pattern of spots into a set of coordinates and then apply a point
comments that helped improve the quality of this paper.
pattern matching algorithm to compute the similarity score,
which works well for spots with regular shapes (Arzoumanian
et al. 2005). Because polar bear whisker spots can vary in LITERATURE CITED
shape and size, however, we applied an algorithm that ANDERSON, C. J. R., J. D. ROTH, AND J. M. WATERMAN. 2007. Can
captured this variability using image pattern matching rather whisker spot patterns be used to identify individual polar bears?
than simplifying the pattern into dimensionless points. Our Journal of Zoology (London) 273:333–339.
unique method of matching is especially useful in recognizing ARZOUMANIAN, Z., J. HOLMBERG, AND B. NORMAN. 2005. An
species that have natural patterns other than spots (e.g., stripes, astronomical pattern-matching algorithm for computer-aided
rings, and irregular blotches). Gamble et al. (2008) also identification of whale sharks Rhincodon typus. Journal of Applied
Ecology 42:999–1011.
considered the shape and size of features through direct
BORGEFORS, G. 1986. Distance transformations in digital images.
comparison of images and obtained excellent results (95% Computer Vision, Graphics, and Image Processing 34:344–371.
true positives with 1% false positives), although their system BUNKS, C. 2000. Grokking the GIMP. New Riders Publishing,
took 4–5 min per image comparison whereas our system took Thousand Oaks, California.
only about 5 s per comparison. DAVIES, E. R. 2004. Machine vision: theory, algorithms, practicalities.
The success of our identification system depended on the 3rd ed. Morgan Kaufmann Publishers Inc., San Francisco,
reliability of whisker spot patterns, which is high in polar bears California.
1358 JOURNAL OF MAMMALOGY Vol. 91, No. 6

DIEFENBACH, D. R., AND G. L. ALT. 1998. Modeling and evaluation of NIETFELD, M. T., M. W. BARRET, AND N. SILVY. 1994. Wildlife
ear tag loss in black bears. Journal of Wildlife Management marking techniques. Pp. 147–159 in Research and management
62:1292–1300. techniques for wildlife and habitats (T. A. Bookhout, ed.). Wildlife
DYCK, M. G., AND R. K. BAYDACK. 2004. Vigilance behaviour of polar Society, Bethesda, Maryland.
bears (Ursus maritimus) in the context of wildlife-viewing OLIVEIRA-SANTOS, L. G. R., C. A. ZUCCO, P. C. ANTUNES, AND P. G.
activities at Churchill, Manitoba, Canada. Biological Conservation CRAWSHAW, JR. 2010. Is it possible to individually identify
116:343–350. mammals with no natural markings using camera-traps? A
ECKHARDT, G. H. 2005. The effects of ecotourism on polar bear controlled case-study with lowland tapirs. Mammalian Biology—
behavior. M.S. thesis, University of Central Florida, Orlando. Zeitschrift für Säugetierkunde 75:375–378.
ECKHARDT, G. H., J. M. WATERMAN, AND J. D. ROTH. 2002. The PARKS, E. K., A. E. DEROCHER, AND N. J. LUNN. 2006. Seasonal and
functional significance of play fighting in polar bears: are they annual movement patterns of polar bears on the sea ice of Hudson
asocial? Integrative and Comparative Biology 42:1224. Bay. Canadian Journal of Zoology 84:1281–1294.

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


FAGEN, R., AND J. M. FAGEN. 1996. Individual distinctiveness in brown PENNYCUICK, C. J. 1978. Identification using natural markings. Pp.
bears, Ursus arctos L. Ethology 102:212–226. 147–159 in Animal markings (B. Stonehouse, ed.). MacMillan,
FISHER, R., S. PERKINS, A. WALKER, AND E. WOLFART. 2004. London, United Kingdom.
Hypermedia image processing reference. http://homepages.inf.ed. PENNYCUICK, C. J., AND J. RUDNAI. 1970. A method of identifying
ac.uk/rbf/HIPR2. Accessed 15 May 2010. individual lions Panthera leo with an analysis of reliability of
FOLEY, J. D., A. VAN DAM, S. K. FEINER, AND J. F. HUGHES. 1995. identification. Journal of Zoology (London) 160:497–508.
Computer graphics: principles and practice. 2nd ed. Addison- PETZOLD, C. 2002. Programming Microsoft Windows with C#.
Wesley, Reading, Massachusetts. Microsoft Press, Redmond, Washington.
FOSTER, G., H. KRIJGER, AND S. BANGAY. 2007. Zebra fingerprints: RAMSAY, M. A., AND I. STIRLING. 1986. Long-term effects of drugging
towards a computer-aided identification system for individual and handling free-ranging polar bears. Journal of Wildlife
zebra. African Journal of Ecology 45:225–227. Management 50:619–626.
GAMBLE, L., S. RAVELA, AND K. MCGARIGAL. 2008. Multi-scale REGEHR, E. V., N. J. LUNN, S. C. AMSTRUP, AND L. STIRLING. 2007.
features for identifying individuals in large biological databases: an Effects of earlier sea ice breakup on survival and population size of
application of pattern recognition technology to the marbled polar bears in western Hudson Bay. Journal of Wildlife
salamander Ambystoma opacum. Journal of Applied Ecology Management 71:2673–2683.
45:170–180. VAN TIENHOVEN, A. M., J. E. DEN HARTOG, R. A. REIJNS, AND V. M.
GANNON, W. L., R. S. SIKES, AND THE ANIMAL CARE AND USE COMMITTEE PEDDEMORS. 2007. A computer-aided program for pattern-matching
OF THE AMERICAN SOCIETY OF MAMMALOGISTS. 2007. Guidelines of of natural marks on the spotted raggedtooth shark Carcharias
the American Society of Mammalogists for the use of wild taurus. Journal of Applied Ecology 44:273–280.
mammals in research. Journal of Mammalogy 88:809–823. WHITEHEAD, H. 1990. Computer assisted individual identification of
GONZALEZ, R. C., AND R. E. WOODS. 2002. Digital image processing. sperm whale flukes. Reports of the International Whaling
2nd ed. Prentice Hall, Upper Saddle River, New Jersey. Commission 12:71–77.
HAMMOND, P. S., S. A. MIZROCH, AND G. P. DONOVAN. 1990. Individual
recognition of cetaceans: use of photo-identification and other Submitted 30 December 2009. Accepted 15 June 2010.
techniques to estimate population parameters. International
Whaling Commission, Cambridge, Massachusetts. Associate Editor was William F. Perrin.
HASTINGS, K. K., L. A. HIBY, AND R. J. SMALL. 2008. Evaluation of a
computer-assisted photograph-matching system to monitor natu-
rally marked harbor seals at Tugidak Island, Alaska. Journal of
Mammalogy 89:1201–1211. APPENDIX I
HIBY, L., AND P. LOVELL. 1990. Computer aided matching of natural The following is a summary of the steps taken by our identification
markings: a prototype system for grey seals. Reports of the system, including image preprocessing and matching. We follow the
International Whaling Commission 12:3–17. summary by pseudocode of the iterative adaptive thresholding
HILLMAN, G. R., ET AL. 2003. Computer-assisted photo-identification algorithm (which calls the adaptive thresholding algorithm) and the
of individual marine vertebrates: a multi-species system. Aquatic Chamfer distance algorithm.
Mammals 29:117–123.
HUELE, R., AND H. U. DE HAES. 1998. Identification of individual 1. The user loads the input image, selects the side of the face (left or
sperm whales by wavelet transform of the trailing edge of the right), and selects the 3 reference points: 1) front corner of the
flukes. Marine Mammal Science 14:143–145. eye, 2) notch of the nose, and 3) trailing edge of the mouth
KELLY, M. J. 2001. Computer-aided photograph matching in studies (Fig. 1a).
using individual identification: an example from Serengeti 2. The image is converted to grayscale using the equation 0.30 3 R
cheetahs. Journal of Mammalogy 82:440–449. + 0.59 3 G + 0.11 3 B, where R, G, and B are the red, green, and
LATOUR, P. B. 1981. Spatial relationships and behavior of polar bears blue values of a pixel.
(Ursus-maritimus Phipps) concentrated on land during the ice free 3. The image is standardized by applying an affine geometric
season of Hudson Bay. Canadian Journal of Zoology 59:1763–1774. transform such that the nose reference point lies 240 pixels to
MARTIN, P., AND H. C. KRAEMER. 1987. Individual differences in behavior the right of the eye reference point and the mouth reference
and their statistical consequences. Animal Behaviour 35:1366–1375. point is 128 pixels to the right and 128 pixels below the eye
NICHOLS, J. D. 1992. Capture–recapture models: using marked (Fig. 1b).
animals to study population dynamics. BioScience 42:94–102. 4. The image is cropped around the whisker spot region.
December 2010 ANDERSON ET AL.—AUTOMATED IDENTIFICATION OF POLAR BEARS 1359

5. The histogram of the image is modified using histogram Adaptive thresholding (pseudocode)
matching to match the histogram of a good-quality image of Input: integer array A (grayscale image); integer r (neighbor-
polar bear whisker spots. hood radius); integer c
6. Logarithmic transformation (base e) is applied to the image. The Output: an integer array B (black-and-white image)
standard logarithmic function is p 5 c log(1 + p), where c 5 255/ set B 5 integer array with dimensions of A
log(1 + max) and max is the highest pixel value of the image. We for i 5 1, …, width of A
modified the function to account for the minimum value of an for j 5 1, …, height of A
image not always being 0, and we used p 5 c log[(1 + p)/(1 + set mean 5 mean of Ai,j neighborhood (r)
min)], where c 5 255/log[(1 + max)/(1 + min)] and min is the if Ai,j , mean 2 c then
lowest pixel value of the image. set Bi,j 5 black
7. Neighborhood averaging is applied to the image with a else
neighborhood radius of 2. set Bi,j 5 white

Downloaded from https://academic.oup.com/jmammal/article/91/6/1350/888329 by guest on 29 February 2024


8. Iterative adaptive thresholding is applied to the image with
end if
neighborhood radius of 4 and a maximum black pixel count of
end for
300 (see below for pseudocode).
end for
9. The image is cropped again around a slightly tighter whisker spot
region, and this cropped image is the final preprocessed input Chamfer distance (pseudocode)
image. Input: integer array A (black-and-white image); integer array B
10. For each preprocessed image in the reference library: (black-and-white image)
a. Let D1 be the Chamfer distance from input image to Output: real s (similarity score)
reference image. set mindistances 5 real array of size equal to the number of
b. Let D2 be the Chamfer distance from reference image to black pixels in A
input image. set n 5 1
c. Let D be the mean of D1 and D2. for i 5 1, …, width of A
d. Repeat steps a–c with one image shifted up, down, left, and for j 5 1, …, height of A
right in increments of 2 pixels for a total of 16 pixels each if Ai,j 5 black then
direction. These settings will repeat steps a–c (8 + 8 + 1)2 5 set mindistance 5 infinity
289 times. for k 5 1, …, width of B
e. Let the similarity score be the minimum of all distances for l 5 1, …, height of B
produced by step d. if Bk,l 5 black then
11. Sort similarity scores in ascending order (i.e., best to worst match) set distance 5 Euclidean distance between (i, j)
and display to the user each reference image next to its score. and (k, l)
Iterative adaptive thresholding (pseudocode) if distance , mindistance then
Input: integer array A (grayscale image); integer r (neighbor- mindistance 5 distance
hood radius); integer maxcount (maximum number of black end if
pixels desired) end if
Output: an integer array B (black-and-white image) end for
set c 5 2 end for
set count 5 infinity mindistancesn 5 mindistance
while count . maxcount n5n+1
set B 5 adaptive thresholding (A, r, c) end if
set count 5 number of black pixels in B end for
set c 5 c + 1 end for
end while set s 5 median of mindistances

You might also like