Object Recognition with M a n y Local Features by Scott Helmer B.Sc. University of Toronto, 2002 A THESIS S U B M I T T E D IN P A R T I A L F U L F I L L M E N T O F THE REQUIREMENTS FOR T H E D E G R E E OF M a s t e r of Science in T H E F A C U L T Y O F G R A D U A T E STUDIES (Department of Computer Science) We accept this thesis as conforming to the required standard T h e University of British September 2004 © Scott Helmer, 2004 C o l u m b i a FACULTY OF GRADUATE STUDIES THE UNIVERSITY OF BRITISH C O L U M B I A Library Authorization 3 In p r e s e n t i n g this thesis in partial fulfillment of t h e r e q u i r e m e n t s for an a d v a n c e d d e g r e e at t h e University of British C o l u m b i a , I a g r e e t h a t t h e Library shall m a k e it freely available for r e f e r e n c e a n d study. I further a g r e e that p e r m i s s i o n for e x t e n s i v e c o p y i n g of this thesis for scholarly p u r p o s e s m a y b e g r a n t e d by t h e h e a d of m y d e p a r t m e n t or by his or her r e p r e s e n t a t i v e s . It is u n d e r s t o o d t h a t c o p y i n g or publication of this thesis for financial g a i n shall not b e a l l o w e d w i t h o u t m y written p e r m i s s i o n . N a m e of A u t h o r (please print) Date ( d d / m m / y y y y ) Title of T h e s i s : D e 9 r e e : NV*k/~ r>(~ $s<r2ej*c$ Year: Department ( T h e University of British C oiluirib lumbia V a n c o u v e r , BC Canada grad.ubc.ca/forms/?formlD=THS page 1 of 1 last updated: 20-Jul-04 Abstract There has been a great deal of attention focused on part-based approaches to object classification in recent research in computer vision, and some approaches have achieved a surprising amount of success. However, learning models with a large number of parts has been a particular challenge. One of the most successful approaches is that of Fergus et al. [5] who have developed a generative model for recognition that achieves excellent results on a variety of datasets. The learning method that they present to learn the parameters for the model, however, requires an exponential amount of time to train as the number of parts increase. The primary contribution of this thesis is the extension of their generative model, and the development of a learning algorithm that can learn a large number of parts in a reasonable amount of time. In particular, we have developed an incremental learning algorithm where the • model.is initialized intelligently with a small number of parts, and parts are added to the model one at a time. By taking such an approach we are able to learn models with a large number of parts in nearly a linear amount of time in the number of parts. The approach is validated on a number of datasets, including cars, motorbikes, and faces, and demonstrates excellent recognition results along with large models learned in a reasonable amount of time. • • ' ' . - ii Contents Abstract ii Contents iii List of Figures v List of Tables vi Acknowledgements vii 1 Introduction 1 2 Part-Based Approaches to Object Recognition 5 2.1 2.2 2.3 2.4 3 Local versus global approaches Parts 2.2.1 Representation of an image Recognizing an object class with parts 2.3.1 Probabilistic approaches to recognition The constellation model 2.4.1 Matching features to parts Model 3.1 Background model 3.1.1 Background scale 3.1.2 Background location 3.1.3 Background appearance 3.2 Foreground model 3.2.1 Part appearance 3.2.2 Part location 3.2.3 Part scale 3.2.4 Part statistics 3.3 Approximating object center and scale 3.4 Probability on sets iii 5 6 7 9 9 11 11 . 13 16 17 17 17 18 19 19 20 20 20 22 4 Learning 4.1 Parameter estimation by Expectation Maximization 4.1.1 Expectation 4.1.2 Maximization 4.1.3 Appearance updates 4.1.4 Location updates 4.1.5 Scale updates 4.1.6 Part weight updates 4.2 Incremental learning 4.3 Intelligent initialization for models and parts 4.3.1 Image matching 4.3.2 Initializing a small model and a sample set 24 25 27 28 29 29 31 31 32 34 34 37 5 Model Computation 5.1 False matches and enforcing geometry 5.2 Search space techniques 5.2.1 Trimming the search space 5.3 Search space techniques for E M 39 39 40 43 44 6 Experiments 6.1 Feature detectors and descriptors 6.2 Experimental setup •• • 6.2.1 Datasets ".' 6.3 Computation time required to learn object models 6.4 Results 6.4.1 Comparison to previous methods . 6.4.2 Incremental learning 47 47 48 49 50 50 51 52 6.4.3 7 Learned models 54 Conclusion and Future Work 63 Bibliography 66 iv List o f Figures 1.1 Example of a set of a part-based approach to object recognition . . . 2.1 2.2 2.3 Modelling an object by appearance versus by the underlying 3D structure 6 Representation of an image using local features 8 A n example of a matching h 10 3.1 3.2 A n example of an object generating an image in a part-based approach The graphical model for the random variables h, A , X , S, c, and Bh 14 16 4.1 Example of image matching 35 5.1 Searching through a hypothesis space H to find matchings h that contribute to p(A, X , S) Pseudo algorithm for approximating p(A, X , S) . Techniques to reuse information from E M in order to compute p(A, X , S) efficiently in learning 5.2 5.3 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 Example of a SIFT feature descriptor These R O C curves demonstrate that as the number of parts increase the R O C curve improves Graph of R O C equal rate versus number of parts in the model . . . . Examples of images that are easily recognized and those that are not A 10 part model for motorbikes A 10 part model for cars viewed from the rear A 10 part model for cars viewed from the side The locations for the parts in a 25 part model for faces The appearance for parts in 25 part model for faces 2 41 42 45 48 53 54 55 58 59 60 61 62 List o f Tables 6.1 R O C equal error results comparing our results to that of Fergus et al. vi 52 Acknowledgements First and foremost I'd like to thank my supervisor Prof. David Lowe for his patience, kindness, and for his many insights that allowed me to complete this thesis. Thanks also goes out to my co-supervisor Prof. Nando de Freitas for guidance and for teaching me that the math and the ideas behind the math go hand in hand. Many thanks also goes out to the Orphanage, where my generous house mates fed me when I was working frantically, and also provided me with much needed cheer. Long live the Lord of Catan, who ever he or she may be. I'd also like to thank my family, who have provided me with support through this whole process. • - . SCOTT HELMER The University of British Columbia October 2004 vii Chapter 1 Introduction Of all the tasks that humans perform with intelligence, visual object recognition seems to be one of the most effortless, done mostly without conscious thought. Yet to solve this problem consciously is far from effortless. The primary source of the difficulty that underlies solving the problem of object recognition is the notion of similarity. To see this, note that an object class can be defined by its functionality, such as chairs, or by its shape, such as cylinders, or by its intrinsic nature, such as mammals. As a result, the possible features that are relevant in object recognition are many, and vary in importance for each class. In many cases, even defining an object class explicitly in terms of necessary and sufficient characteristics is nearly impossible. Even more important is that many of the primary characteristics of an object class are not manifested visually, at least not directly. For example, an image of a dog is also an image of a living thing, yet the class of living things displays no regular visual characteristics. However, if we first judged the image as containing a dog, we could also infer that it is also contains a living thing. As a result, solving the object recognition problem requires significant machinery that is unrelated to visual phenomena. A great deal of success has been achieved in recognizing specific objects [8], such as a particular teddy bear, rather than an object class, such as teddy bears. The reason for this is that recognizing an object class is arguably a more difficult task in computer vision, and this is because there is variation in the appearance and shape across an object class, whereas this is not the case for single objects. Moreover, some success has been achieved in recognizing an object class visually with specific object classes. Examples of such success are face recognition [18] and digit recognition [10]. However, the approaches developed for these object classes generally don't extend to general object classes because they make restrictive assumptions, require vast amounts of training time, or utilize visual features that are only useful in classification for a few object classes. Applications such as image labelling on the Internet and robot navigation require a vision system that can recognize a wide variety of object classes, while remaining computationally tractable. The concern of this thesis is the 1 2 development of an approach that can recognize general object classes, such as cars, faces, and motorbikes, and generally from canonical views. Image features are matched to model parts Matching is evaluated according to model to produce a measure used for recognition Figure 1.1: A n example of finding an optimal matching from features in the image to parts in the model. There can be more that one matching that contributes to the final decision as to whether the image contains an instance of the object class. The primary job of a vision system designed to recognize an object class from a 2D image is to determine what visual characteristics distinguish the object class from others. Such visual characteristics could be the colour, shape, or texture of the object 3 or parts of the object. However, the appearance of an image containing the object is dependent upon the what angle the object is viewed at, the distance the object is from the camera, its location and illumination, and other occluding objects. Yet whether an object is in a particular class is independent of all of these variables. Any successful vision system designed to recognize objects from 2D images must also be at least partially invariant to these variables. As a result we have taken a part-based approach, where we model the object as a collection of parts. By doing this, if the object is occluded, the occlusion only affects the occluded parts, and the object can still be recognized based on the parts that are not occluded. Moreover, translation and scale invariance become computationally tractable, as outlined later. A general part-based approach to object recognition extracts a set of features from an image, determines a matching of these features to parts in the model, sometimes multiple matchings, and produces a score that indicates how likely it is that the image contains an instance of the object class. See Figure 1.1 for an example. Our approach in particular evaluates a matching based both upon the spatial arrangement of the parts, the scale of these parts, and the appearance. A motivation for taking a part-based approach is that many object classes have characteristics that manifest themselves as distinct visual parts. A face for example is composed of eyes, a nose, and a mouth, and each of these are local in the sense that their appearance is captured in a region that is smaller than the whole object. Thus, modelling an object class by its parts can decompose the problem into recognizing pieces of the object, each of which will contain less variability than the variability of object as a whole, which makes it significantly easier to model. The approach presented in the thesis is an extension of the constellation model presented in Fergus et al.[5], with a number of novel extensions and explorations. The object class is modelled using a generative model, with distributions over the appearance, location and scale of parts. The measure of how likely an image is to contain an object is the sum of the likelihood of seeing the features of the image over all possible matchings of features to parts of the model. The difficulty with this model is that the number of matchings is exponential in the number of parts of the model, which makes evaluation and learning difficult. The Fergus et al.approach learns the parameters for the probability model simply by using Expectation Maximization (EM). In E M it is required that the probability is evaluated for all non-zero matchings, and with a random initialization almost all possible matchings must therefore be evaluated. By doing this they are restricted to models with less than 7 parts for reasons of efficiency. The primary contribution of this thesis is the development of a tractable approach 4 to learning models with more than a few parts. This is done by intelligently initializing a model with a small number of parts, and then adding parts incrementally to the model and updating parameters using E M after each addition. One of the primary advantages of such an approach is that not all possible matchings need to be reevaluated when adding a new part. From previous iterations we know the non-zero matchings for the previous parts, so the search space is greatly reduced. Another contribution is a new approach to scale and translation invariance that results in more a accurate geometric model on parts, which accelerates learning and improves recognition results. To achieve the scale and translation invariance, the location and scale of image features are first transformed into a model coordinate space before'being evaluated by the model. The particular transformation chosen results in the features being transformed to the most likely model coordinates given the model parameters. In the remainder of this thesis we will first describe a variety of related work and background related to object recognition. This will be followed by the description of the probabilistic model, in Chapter 3, and how the parameters are learned, in Chapter 4. Chapter 5 will describe a variety of techniques that are used to make the approach tractable. The approach is then validated with a set of experiments on a variety of object classes, including motorbikes, faces, and cars. The final chapter will then discuss some short falls of the approach and future work. Note A portion of material presented in the introduction and succeeding chapters appeared in the Generative-Model Based Vision Workshop 2004, Helmer et al. [7] Chapter 2 Part-Based Approaches t o Object Recognition The computer vision literature is rich with approaches to solving the object recognition problem, and approaches can be divided along many different lines. A complete overview of the field however is beyond the scope of this thesis. As a result, we outline the approaches that deal with the issues that were relevant in the design of the system outlined later in the thesis. The bulk of this chapter discusses part-based approaches to object recognition, and in Section 2.2.1 onwards some notation is introduced that is used throughout the thesis. 2.1 Local versus global approaches Two distinctive methodologies exist to solving the object recognition problem: global and local approaches. Global approaches extract features of the object that are generally properties of the object as a whole, such as colour histograms [15] or texture and shape [12] [16] . Local approaches, on the other hand, divide the object into smaller regions, and these are then used to recognize the object [13] [17] [14] [8] [5]. It should be noted however that it is not necessary that a vision system for object recognition take a strictly local or strictly global approach. In fact, certain object classes are devoid of any clear notion of parts, such as lakes or walls, whereas some object classes are little more than the sum of their parts, at least visually. Much of the current research in object recognition is devoted to part based approaches because of several of its natural advantages. One of the primary advantages is that the background and occluding objects can be more easily discarded by simply looking only at the features on the object. In global approaches, however, difficult segmentation, or other restrictive assumptions, such as a uniform background, must be made so that the background and occluding objects do not influence the classification of the foreground. Another advantage is modelling the appearance of an object 5 2.2. 6 Parts class as a whole is a more complex task than modelling a subset of its parts. 2.2 Parts Using a part based approach first requires asking the question, how should a part be represented? Early research using a part-based approach by Biederman et al. focused on modelling the 3D structure of an object class, and inferring the 3D structure of an object from an image in order to do classification [2]. In Biederman's work, he theorizes that objects can be modelled using geons, or geometric ions, which are small 3D structures such as cylinders, cubes, etc. A n object class in this case is a collection of geons with some sort of geometric relations and determining whether an object is present reduces to inferring the geons present, their geometric relations, and determining if this coincides with the object class model. A prior definition of parts such as geons may seem attractive, but determining their presence is difficult since it involves inferring 3D structure from a 2D signal. A n alternative approach uses an appearance based approach Where a part is modelled only as the 2D signal it presents in an image. In this way inferring the 3D structure can be avoided entirely. In an appearance based representation a part is modelled upon the pixel values of image patch directly, or on some transformation performed on the pixel values, such as P C A . 222222200 222222220 224444444 224444444 224444444 024444444 004444444 Figure 2.1: Representing and modelling parts based directly on its 2D appearance is an easier task then having to infer 3D structure. Many current approaches to object recognition take an appearance based ap- 2.2. 7 Parts proach, but there is still the question of how to obtain parts that can be used for recognition. There are a variety of supervised approaches, Burl et al. [3] for example, where humans hand label parts on an image dataset. By taking such an approach, the question can be avoided, but labelling is time consuming, and it is desirable to be able to learn a model of an object class with as little supervision as possible. Another approach is to learn the parts from a dataset of images containing the object class in an unsupervised manner. However, any region of an image can serve as a possible part, and searching through regions at every location and at multiples sizes in all images in the dataset is prohibitively expensive. Shimon Ullman et al. [17] take this approach to part selection, incrementally selecting features that reduce the entropy of classification. However, as mentioned, searching over all locations and multiple scales is computationally expensive. 2.2.1 Representation of an image One way to overcome this problem is to select interesting regions in the image, encode these local regions, and then to use only these to learn parts and for recognition. The motivation behind such an approach is that an image of an object class is generally distinguished by regions that contain texture rather than those that do not. Thus, by representing an image as a selection of features, we reduce the search space to interesting regions. Moreover, many of these local feature approaches can help with dealing with invariance to scale, translation, and rotation. Additional discussion concerning feature detectors and descriptors can be found in Section 6.1 of the Experiments chapter, where we outline the particular feature detector and descriptor we used in our experiments. A n input image i is represented as a set of N features T\ which are extracted as a preprocessing step. For notational convenience we drop the reference to the image i in some sections of the thesis. Each feature / G T is composed of a d dimensional appearance vector A / , which describes a local region of scale S / , centred at location vector X / which is the 2 dimensional tuple (Xf i,Xf ). The scale and location are described relative to image pixel coordinates. See Figure 2.2 for an illustration. t t2 2.2. Parts 8 Figure 2.2: A feature / is describe by an image location X / = ( X / , X / ) , a scale S and an appearance vector A / , which is some description based upon the pixel values within the circular region. t l ) 2 9 2.3. Recognizing an object class with parts 2.3 Recognizing an object class with parts When an image is given to an object recognition system, the system outputs a score that is then used to determine whether the object is present. Exactly how this score is produced and what it means varies widely across part-based approaches. In general, part based approaches are concerned with finding a matching, or matchings, that matches features to parts in the model, and the score is based upon this matching. We define a matching as h, where h(p) = f means that a feature / of the image matches part p. If a part is occluded or not present then h(p) = 0. A n example can be found in Figure 2.3. Most part-based approaches to recognition have a model over the appearance of an object class' parts and a model over the geometric relationship between the parts. One approach to recognition by Schmid et al. [14], uses the the model over the appearance to determine a possible matching h, then uses the geometric model to refine and score this matching. To find an initial matching they use a nearest neighbour approach, based upon the Mahalanobis distance, to extract matches from features to parts. Moreover, their geometric model encodes for each part the angles between neighbouring parts, and in this manner they can achieve scale invariance in their geometric model. After finding the initial matching, the matches that don't agree with the geometric model are removed from the matching.. The final score is then the number of matches remaining in the matching. Although this is conceptually an effective approach, the uncertainty of the matches is not represented, and it does not represent the relationship between false matches and model size. 2.3.1 Probabilistic approaches to recognition Most recent approaches take a probabilistic approach to object recognition instead of basing the measure on the number of matches. Given the object class C that we seek to recognize, the most obvious measure as to whether an object class is present in an image is the probability that the object class is in the image. That is, p(C\T) (2.1) Pope et al. [13] propose an approach to recognize objects using p(C\!F) by first finding a good matching h, and a transformation, t, that transforms image feature coordinates into model coordinate space. They then estimate ^ ( C l J ) based up this single matching and transformation. Object classes are represented as containing 7 10 2.3. Recognizing an object class with parts Features of the Image Parts of the Model •Background (0) Figure 2.3: A n example of a matching h. Note that h does not have to be the true matching. For each of the features that are matched to a point it is implied that the remaining features are matched to the background parts of various types with with a Gaussian distribution over the part locations in model coordinate space. In their approach, p(C\!F) is approximated as p{C\T) « (2.2) p{FM,t\C) p(A|h,t,g)p(X|h,t)p(h,t|C) P(C) p(JP|h,t)p(h,t) (2-3) (2.4) where they assume that part locations and appearance are independent given the transformations t and matching h, and that p(h,t\C) and p(h, t) are uniform. In their matching procedure they iteratively add a match of a feature to a part such that the match, along with the updated transformation t, improves the probability of the match the most. The difficulty with this approach is that it is designed for recognition of a single object, and it is unclear how to learn parts effectively for a general object class. A n alternate approach is to learn the density p(T\C), the probability of seeing these features given that the object is present. In an approach by Weber et al. [19] they model p(F\C), and use the likelihood ratio 2.4- The constellation model 11 Whc) to compute a measure for whether the object is in the image. This ratio compares the likelihood of seeing this set of features given that the object class is present against the likelihood of seeing the features if the object class was not present. The main advantage of using the ratio R for recognition is that the parameters 9 for p(.F|C) can be learned using E M , which requires little supervision. R 2.4 = ( 2 5 ) The constellation model One of the most successful approaches to general object recognition is that of Fergus et al.[5]. The approach they present is an extension of the constellation model that was developed by Burl et al. [3] and extended by Weber et al. [19]. Although they attain good results on a variety of datasets, it takes an enormous amount of time to learn and is limited to just 6 or 7 parts to keep learning tractable. Since the approach presented in this thesis builds on the constellation model, it is useful to introduce some of the details. 2.4.1 Matching features to parts Suppose an image contains features T, and the model contains P parts with parameters 6, there still is the problem of matching features to parts. Most previous approaches first match features to parts based solely on appearance and then later remove false matches by utilizing the learned geometric relations between parts. The approach taken by Fergus et ai, on the other hand, is to evaluate the value of a matching h jointly based upon the appearance and location. Now, they propose that if they had the matching h then p{F\h) = = p(A,X,S|h) (2.6) p(A|h)p(X|h)p(S|h) (2.7) They assume that the appearance, scale, and the location of a part are independent of each other when the matching h is given. In general, h is unknown, so they integrate it out of the joint p(A, X , S, h) to obtain p(A, X , S). That is, they define 12 2.4- The constellation model p(A,X,S) - £ p ( A | h ) p ( X | h ) p ( S | h ) p ( h ) hew (-) 2 8 where the hypothesis space TC contains all possible matchings of parts to features. The distributions p(A|h), p(X|h), and p(S|h) are all Gaussian distributions with distinct parameters for each part. However, they evaluate X and S in model coordinate space rather than image coordinate space. To achieve this scale and translation invariance, they use parts p that are matched to a feature / as a landmark point, and translate and scale the other features locations to model coordinate space by using the parameters of part p. This poses a difficulty because which feature is chosen dictates where the other features are transformed to in model coordinate space and their is no clear way to chose the landmark point. One thing to note in Equation 2.7 is that \H\ G 0 ( | F | ) , so evaluating p(A, X , S) exactly is intractable for models with more than 6 or 7 parts. If the model is accurate than A * can be used to approximate p(A- X , S). However, the manner in which they learn the parameters for the model is intractable for models with more than 7 parts. The reason for this will be discussed more fully in Section 4.1.1. One of the primary contributions of this thesis is the introduction of a learning scheme that remains tractable even for models with a large number of parts. P Chapter 3 Model The approach we take to the object recognition problem is to learn a distribution p(F\C), and use the likelihood ratio R — p(F\C) / p(F\->C) to recognize an object. Given a scene with an instance of the object class, a 2D image is generated by the foreground object, and by the background scene. This naturally leads to the choice of modelling p(^"|C) as a generative model, where the features T are generated by the parts of the object and the background. The model presented in this chapter builds upon the constellation model of Fergus et ai; the similarities and differences will be noted as they are presented. If a part p generates a particular feature / , then h(p) = / , so h is the matching from parts to features. If a feature / is not assigned to a part then it is assigned to the background, the set of background features for a particular matching h is denoted as Bh . In addition, if the object is in the image, then it will occur at some location and scale, denoted c = {X ,S }. Naturally X G TZ such that X does not exceed the dimensions of the image, and S £ TZ such that it does not exceed the maximum dimension of the image. The joint space to which c belongs is referred to as C. So, for each of the parts that generated a feature in the image, the feature will occur at some location and scale relative to c, and with some appearance. A n example of how the model is generative is illustrated in Figure 3.1. For notational convenience, we refer top(^-"|C) as the density p(A, X , S|0) where in most instances 9 is dropped. The background density p{!F\-<C) is sometimes referred to as p ( A , X , S|h©) where b.0 is the matching that matches all features in the image to the background. Let the probability of seeing the features of an image, given that we have a matching h, and the object's centre and scale, c, and model parameters 9, be 2 C C c c c p(A, X , S|h, c) = p(A|h)p(X|h, c)p(S|h, c) (3.1) That is, if we know c and h, then the appearance, location, and scale of the features are all independent. This assumption is similar to that of Fergus et al, with the exception that Fergus et al. don't introduce the parameter c. Although the indepen13 14 \ — i — | OS? A JOB \ MB • Features in model coordinates 2 Features in image coordinates . . . . A ... x ' 3 Figure 3.1: When an object class is in an image, its constituent parts that are present generate features, where each feature / has an appearance Af, a location and scale in model coordinate space Yf and £». The object then generates a center and scale of the object in image coordinate space c = {X , S }. As a result, the image location of feature / is X / = ^ ~ ^ and the scale is Sj = g£ c Y/ Xc c c 15 dence assumption makes modelling easier, it is easy to conjure up examples where the appearance, scale or location of a part are not independent. One clear example of this is that of a truck, where the location of a truck door is dependent upon the size of the wheel. Modelling these dependencies, however, is more difficult, and it is not clear that these dependecies are crucial in object classification. Although we have assumed independence between A , X , and S when h and c are given, it is not generally the case that these variables are known in object classification. In order to overcome this we can integrate h and c out of the joint distribution p(A, X , S, h, c|C) to determine p(A, X , S). So, p(A,X,S) = E / P(A,X,S,h,c)cic hen ^ CGC = Y.I hen P(A,X S|h,c)p(h)p(c)dc (3.2) > J c e C = £p(A|h)p(h) / hen p(X|h c)p(S|h c)p(c)dc I l J c € C is the probability of seeing this set of features given that the object is in the image. However, the integral over C is not analytically tractable with most distributions, so we instead use a point mass estimate to approximate the integral. p(A, X , S) « V p(A|h)p(h)max p(X, S, c|h) ' * ceC hen (3.3) The intuition behind this approximation is that we find the best transformation of feature locations and scales into model coordinate space, and approximate p ( X , S|h) based solely on this best transformation, rather than all possible transformations. This is accurate in the normal case when there is one transformation that dominates all others. This approximation will be discussed in detail in Section 3.3. Moreover, as with the Fergus et al. approach \H\ = 0(\T\ ), so evaluating the sum in Equation 3.3 is expensive. Tractable approximations to compute p(A, X , S) are presented in Chapter 5. The-remainder of this chapter descibes the foreground and background model. . ' P 3.1. Background model 16 © x, Figure 3.2:'The graphical model for the random variables h, A , X , S, c, and Bh 3.1 Background model Any given scene is composed of a number of objects, which belong to different object classes, and it is these scene elements, under illumination, that generate a 2D image. In a generative model approach, the primary concern is modelling of the foreground. However, in order to come up with the likelihood ratio, R, it is necessary to have some model of p ( J | - ' C ) — p(A, X , Sjho), so that there is some measure as to how likely it is to see the features T in general. We assume that if a feature is generated by the background, then it is independent of other features, and that the appearance, location, and scale are also independent of one another. So, p ( A , X , S|h ) becomes r 0 p(A, X , S|h ) = J ] p ( A | h ) p ( X | h ) p ( S | h ) 0 / 0 / 0 / 0 (3.4) where h is the matching where all features are matched to the background. Moreover, when the object is in the image it is usually the case that not all of the features in T are generated by that object. As a result, it is necessary that the distribution p(A, X , S) also models those features that are part of the background. 0 3.1. Background model 3.1.1 17 Background scale In general, a feature generated by the background could be any size. However, for most feature detectors that operate at multiple scales, the probability of a random feature / having scale of S/ is proportional to . The reason for this is that feature detectors generally construct an image pyramid, where the image at each level Sf is a Gaussian blur with o — Sf of the original image. This is then resampled according to Sf, resulting in an image ~^ the size of the original image. As a result, the number of features detected at a particular scale is ^ the original image size. If the largest scale at which a feature can be detected for an image is a, then •p(S \f eB) f = (3.5) This background distribution on scale differs from that of Fergus et al. who represents the background distribution simply as a uniform distribution. The motivation for the change is that feature detections are not usually generated uniformly across scales. 3.1.2 Background location In general it can be expected that a feature from the background can be found uniformly throughout the image, so in this case the location is modelled as p(X \feB) f = ±. (3.6) where 7 is the area of the image. This distribution is in accordance with the that chosen by Fergus et al. 3.1.3 Background appearance The appearance of the average feature returned by the feature detector is highly dependent upon both the detector and descriptor. As a result the appearance is modelled with a kernel density estimator with a Gaussian kernel. In the thesis, we primarily work with Gaussian distributions where the coovariance matrix is restricted to be diagonal. If a d dimensional random variable X is distributed according to a Gaussian distribution with mean n and standard deviation tr, ie. that X ~ A/"(/x, (tr) ), the probability of X is described as 2 3.2. Foreground model 18 ^^=wr^r{p-^) G (37) The probability of the appearance given that it was generated by the background is p { A < l f B ) = \BackGround\ " (3 8) where BackGround are a set of features that are extracted from a set of background images, and where <xj is chosen experimentally by cross validation. This distribution differs from the model presented by Fergus et al, which uses a single Gaussian for all features. The motive for this change is that for high dimensional features, a single Gaussian does not provide an adequate model for the appearance of features generated by the background. This issue is a complicated one, and constructing a better model for the background distribution of appearances is left for future research. b 3.2 Foreground model As mentioned previously, given a matching h and c we assume that appearance, location, and scale of the features are independent. We also assume that given h and c that all the attributes for each part are independent. In this sense, given that an object is part of a particular class, and its center c is known, then which parts are generated, where these parts are generated, and their appearance are all independent of each other. Clearly a lot of information is lost by this independence assumption. A face model that assumes such independence would probably consider a woman's face with a beard as likely as a man's face with a beard. However, in terms of object classification, these examples are pathological in the sense that real data rarely presents cases where the dependence needs to be modelled in order to do correct classification. In cases where modelling this dependence is necessary, the object class can be split into subclasses. One possible way to do this is during learning, detect when there are large segments of the training data that are not being recognized by the current model. A t this point the algorithm could then learn a seperate model for this segment of the training data, thereby automatically creating a model for different subclasses. Development of a technique to do this is left for future research. 3.2. Foreground model 3.2.1 19 Part appearance If a part p is present in an image as feature / , then we assume that the appearance of the part A ~ M(^ , ( t r ^ ) ) . That is that, pp 2 f p(A \h(p) f = / ) = G(A \np , PP (3.9) (<T; ) ) PP f 2 We assume that each dimension of the appearance is independent. There is no reason to believe that the dimension of each part is independent, but estimating a full covariance is prohibitely expensive. Given a matching h, we evaluate the appearance of a feature / according to the density for part p only if h(p) = f, and if / is assigned to no part then it is evaluated according the background distribution, p(Af\f £ Bh)- So, for the entire set of appearances A , p(A|h) = J] W , ( f l ) I I p ( A / | / e B ) /|h( )=/ /|/eSh P 3.2.2 (3.10) Part location If a feature / is generated by a part p, then we assume that in model coordinate space that the location of the part Y / ~ J\f(ii ° , (<r ° ) ). The ith element of a ° is referred to as cr °f. The problem is that since X / is in image coordinate space, it must be transformed into model coordinate space. If we are given the object center and scale c, then l c l c 2 l c l Yf = S Xy + X c (Yf - X c ) = which implies that X ~ Af ( ^ ^ , ; p(X |h(p)=7,c) = G / (3.11) c (3.12) ( ^ ) ) - As a result 2 X WT-Xc) ; la loc (3.13) However, if / is part of the background, f € Bh, then we evaluate its location according to a background distribution. The resulting probability of seeing the locations X is therefore 20 3.3. Approximating object center and scale p(X|h,c) = II I G X II / p|h(p)=/ 3.2.3 p(X,|/eB) (3.14) /l/eflh Part scale If h(p) = / , then the scale of part p in model coordinate space, is generated according to a Gaussian with, with mean p ^ and standard deviation o-p . Since the scales S are given in image coordinates, they are transformed into model coordinates, s ale Cale tf = ScS (3.15) f ..scale —.scale This implies that S ~ J V ( \ - , ( \ - ) ) If / is part of the background, / e Sh, then we evaluate its location according to a background distribution. As a result, 2 f ..scale p(S|h,c)= J] GlSf V , Plh(p)=/ 3.2.4 / jScale\' f . Hf" II P(S/l/e'B> (3-16) \ Part statistics We model the distribution p(h) as n ^=w\ p 1 1 p|h(p)^0 P W n v-vp) (- ) 3 i? p|h(p)=0 where w is the probability that the part is present. A more complicated model is utilized in Fergus et ai, but as the number of parts increase, the number of parameters increases quadratically, which poses a problem for our approach. Implementing a more complicated model is left for further research. p 3.3 Approximating object center and scale Integrating c out of the joint p ( A , X , S, h, c), as mentioned previously, is not analytically tractable. Instead, we make the approximation 21 3.3. Approximating object center and scale p(A,X,S|h) « maxp(X,S,c|h) (3.18) That is, we replace the integral with a point mass estimate at the maximum, since when X and S are fixed then p(X,S,c|h) is a peaked distribution. In essence, this means that we are primarily concerned with the measurement of p(X, S, c|h) at the location where the parts are most likely to be centered, given the matching h. By making such an assumption we can find the c that maximizes p(X, S,c|h), and use this to transform X and S in to model coordinate space. To find the maximum, notice that ' opt (3.19) (3.20) ( I I P( /I/ X 6 W S / I / e BJ) (3.21) The second term in 3.20 is independent of c, and as a result is a constant when X and S are fixed. Thefirstterm, which we will denote with the function V(c|h, X , S) is the term that must be maximized. Taking a closer look at this function reveals that the value c which maximizes log(V) also maximize V and thus p(X, S,c|h). To determine c we maximize opt opt 22 3.4- Probability on sets (3.22) log(V) (3.23) + + log(S ) (3.24) + log(S ) (3.25) c c + log(S ) + constant (3.26) c The most straightforward way to find the set of parameters c that minimizes log(V) is to take the derivative and set it to Oand solve for the parameters. There is a closed form solution, where the solution requires solving a quadratic equation in S , but the actual solution is omitted for brevity. opt c 3.4 Probability on sets The technical details addressed in this section deal with defining probabilities on sets with a variable size, and can be skipped without loss of continuity. In the model proposed by Fergus et ai, the number of features extracted from an image, k, are fixed apriori to some number, usually less than 20. That is, despite the fact that a highly textured image could contain 500 features, the image is represented by only a small subset of these features. The difficulty that this poses is that if a face appears in a very cluttered scene, then it's possible that very few of the features chosen to represent the image actually fall on the face. To overcome such difficulty, we do not fix the number of features k that represent an image. The number of features is entirely dependent upon the feature detector. However, if k varies per image, there are a number of technical details that need to be addressed. First, p^lC), as defined above is not a probability since 23 3.4- Probability on sets V f If p(A,X,S)dAdSdX = oo (3.27) That is, if we sum over all feature sets of all possible sizes, the distribution does not sum to 1, but to oo. However, this can be easily over come if we define p{F,k\C)=p(F\C)p(k) (3.28) and if we define p(k) to be uniform over [0, M], where M in this case is some large number. If we implicitly redefine p{T\C) to be p{T', k\C), then p(.F|C) is once again a proper probability. In practice p(k) can be ignored in both learning and recognition. The reason is that p(k) is a constant and thus cancels out in the likelihood ratio R and does not affect parameter estimation in learning. Chapter 4 Learning If we are given a training set D for which every image in the dataset contains an instance of the object class, we would like to learn a set of 6 for the posterior distribution p(A,X,S\d). This chapter presents a method to learn these parameters quickly. The general learning algorithm is as follows 1. Extract a set of candidate parts J from the dataset 2. Initialize a small model from these candidate parts 3. For parts p — k + 1 to P (a) Maximize the parameters for the parts 1 to p using E M (b) For each potential part j G J that has not been used i. Determine the increase in the likelihood, Kj, of the data if part j is part of the model ii. Select the part j with maximum Kj and add it to the model The rest of the chapter is devoted to explaining each of these steps. The first section describes the maximum likelihood framework and the E M algorithm, and discusses why learning all P parts jointly from a random initialization is intractable. Section 4.2 describes incremental learning, its motivation and its pitfalls. The final section describes how to initialize a small model and how to select a set of candidate parts from the dataset. Readers familar with E M can skip section 4.1. 24 25 4-1. Parameter estimation by Expectation Maximization 4.1 Parameter estimation by Expectation Maximization Given a set of training data D, we'd like to determine the posterior distribution p(A,X, S|£>), which we usually denote p ( A , X , S|D), using the information in D. Ideally, we'd like to determine p(A,X,S\D) = fp(A,X,S,9\D) Je (4.1) = fp(A,X,S\9)p(9\D) Je (4.2) However, this is computationally intractable for the model outlined, so instead we approximate the posterior where the integral is estimated by a point mass, p(A X,S)«p(A,X,S|0) (4.3) > that is, we use a single set of parameters to evaluate p(A, X , S). Within the machine learning community, there are a variety of approaches to chose this set of parameters, and one of the most common methodologies is to select the set of parameters 9 that maximizes the likelihood of the data p(D\9). In this case, 9ML argmax p(D\9) (4.4) o ' ' One of the pitfalls of using 9ML is that the parameters may overfit to the data. That is, the parameters may also fit not only to object class present in the images, but also to the noise or background in the data. This entails that 9 may not generalize well for the object classification problem. Another methodology for selecting a set of model parameters is to select the maximum a posteriori ( M A P ) parameters 9 : = ML MAP OMAP = = = argmax p(9\D) e p{D\9)p(9) argmax^ ^ e P{D) argmax p(D\9)p(9) e ; (4.5) , 4.6 N (4.7) This set of parameters are the most likely given the data and the prior, where p(9) is a prior over the parameters. It is this prior that can be used to prevent the overfitting 4-1- Parameter estimation by Expectation Maximization 26 that can plague learning the maximum likelihood parameters 9 ML- The prior basically acts as a constraint over the set of parameters. For the model we are learning we found it was only necessary to impose a prior on the parameters cr . The specification of the prior is stated in Section 4 . 1 . 4 . So we seek to find the set of parameters 9 that maximizes loc (4.8) C(6\D) = p(D\0)p{d) which is referred to as the penalized likelihood. The first thing to note is that C(9\D) is a function with many local maxima for the particular model we are interested in. As a result, any numerical technique that seeks to find the set parameters to maximize C(9\D) will settle on a set of parameters that is but a local maxima of C(9\D). One of the standard techniques to learn the parameters 0 AP is the E M algorithm [ 4 ] , which iteratively improves the parameters until a local maximum is achieved. To explain E M a few facts must first be noted. One is that maximizing C(9\D) is equivalent to maximizing l(9\D) = logC{9\D) because of the monotonicity of the logarithmic function. In addition, M l(9\D) = £log$>(.F,h|0)+logp(0) i hen = E l o s E ^ ^ ) § S ^ + i hen i hen = ^ H\ 1 \ (4.9) l o g ^ ) ( - ) 4 10 ' ' ) k(0\D) (4.12) where Equation 4 . 1 1 holds true by the Jensen inequality only if q sums to 1 . So, if we fix the values of the function q, then for all 9,1{9\D) > l (9\D). Also note that if we fix q to p{h\!Fi,9), then it is easy to see in Equation 4 . 1 1 that l {9\D) = 1{9\D). b b Now, on the t iteration of E M we have parameters 9 . E M first fixes q to p ( h | . F j , (9*), so that lb(9 \D) — l(9 \D), and this is referred to as the Expectation step. On the Maximization step the parameters 9' are found that maximizes l (9\D) are found, so now it is the case that l {9'\D) > h^D). However, since /b(c9*|£>) = l^D), it is the case that 1{9'\D) > i(c9*|D). In other words, by increasing the .lower bound l th l t t b b b 27 4-1- Parameter estimation by Expectation Maximization we also increase I. At this point the parameters of the model are updated to 9 = 9'', and the process is repeated. In this way the algorithm updates the parameters in such a way that it is guaranteed that l(9 \D) > Z(^*|D). The algorithm is as follows t+l t+1 E M Algorithm For t = 1 to T 1. Calculate p(h\F\ 9 ) (E step) f 2. Calculate parameters 9 (M step) t+1 4.1.1 that maximize 1{9\D) Expectation On the expectation step of the algorithm p(h\T , 9*) needs to be calculated for all i and h. By applying Bayes rule % (4.13) p(.T|h,fl«)p(h) (4.14) p(A,X,S|h)p(h) .E fc6W (4.15) P(A,X,S|h)p(h) The standard method to compute the normalization term Z = ^2 p{A., X , S|h)p(h) is to first compute p(A, X , S|h)p(h) for all h G H. If the model parameters 9 are at all accurate, then for most h G Ti the value p(A,X,S|h) w 0, at least in terms of how much it contributes to Z. As a result Z can be approximated and p(h|^ , 0*) need only be calculated for a small subset of Ti.. The problem is that if the parts are initialized randomly then techniques such as A * cannot reduce the magnitude of the problem greatly. The reason for this is that there needs to be a large number of matchings h for which p(h\T, 9 ) is nonzero, otherwise E M will never be able to converge onto a satisfactory solution. The primary contribution of this thesis is the development a method to overcome this very problem. If the parts of the model are initialized intelligently with a small number of parts, then learning an accurate distribution for a small number of parts is easy. By hen l r l 28 4-1. Parameter estimation by Expectation Maximization adding parts incrementally we avoid the combinatorial explosion because the number of matchings where p(A, X , S|h) actually needs to be evaluated for the Expectation step is minimized. Techniques that are used to calculate Z efficiently are discussed in Chapter 5. 4.1.2 Maximization In the maximization step of E M we need to determine 9' that maximizes l {9\D) when q is fixed. The lower bound l can be re-expressed as b b Q(0\D) l (6\D) = b logp(c9) + ^ ^ c 2 ( h | ^ ) l o g p ( ^ , h | t 9 ) i + (4.16) hen 1 J]^g(h|^)logc7(h|^) (4.17) » hen 1 It is easy to see that maximizing l is equivalent to maximizing Q[9\D) since the term H is only dependent upon the data D and not the model parameters. Q(9\D) can be rewritten as b Q(9\D) = l o g p ^ + ^ ^ ^ h l ^ O o g ^ l h . ^ + logKhlc?)) (4.18) i hen = logp(0) + E E 9 ( h | ^ ) ( l o g p ( A | h ) + logpCX'lh) + logp(§ |h) + logp(h)) i i i hen In order to find the set of parameters that maximizes Q, we take the derivative with respect to the parameters, set this to 0, and solve for the parameters. Since each of the distributions are Gaussian, except for p(h), it turns out that the parameter updates for the means are basically weighted averages of the data, and that the variances are the weighted average of the variance of the data. The weights are the probability that each feature is a manifestation of a part. In order to describe the parameter updates a few terms need to be introduced. Let H be the set of hypotheses where for every h e W there exists / G J* such that h(p) = / . In other words W is the set of hypotheses that have some part that matches p. p p 4-1. Parameter estimation by Expectation 4.1.3 29 Maximization Appearance updates For part p, if we wish to obtain the parameters fip of Q with respect to /j,p PP then we first take the derivative PP (4.19) (4.20) Now if we set this to zero we can obtain the maximum since Q is a convex function. 0 « r where Z (D) = operation. = E E ' i W - A " * ) ) ^ - E (- ) 4 21 E ^hen* QO^lF )- For the variances (o~p ) we can perform a similar 1 P rfo- PP A ^E PP ^."PP ~*~ ^ ( h l ^ ) 2 (^PPU (4-23) Setting this to 0 we get 4.1.4 Location updates For a particular matching h we fix Ch before determining the parameters that maximize Q. That is, we are going to set Y / h = S X / + X , where Y / . h is the projection of X / into model coordinate space with matching h. Now if we note that p(Yf,h\h(p) = /) = p(X.f\h(p) = f, Ch), then we can replace the probabilities over X in Q to probabilities over Y . Now if we want to maximize Q with respect to /x' , then we take the derivative f C h C h oc 4-1. Parameter estimation by Expectation Maximization dn ° l d[i v d Y.i Ehewt 9(h|.P) l o g p ( Y c 30 (4.25) loc dn h ( p ) ) h |h) (4.26) l oc p EE9( l^)W° - h(P),h) h = C y (4.27) Which results in the parameter update if we set the above to 0, < = E ^ZT* E ( 4 2 8 ) Now, if we want to maximize Q with respect to a °° we first have to describe the prior that we have placed on a ° . One pitfall to adding parts to the model incrementally is that in some cases there is a bias such that the parts learned earlier will have a smaller variance than parts learned later. If a new part is added to the model, the most likely centre, c , according to the model will be determined primarily by the parts that have a small variance. As a result, new parts added to the model will have less influence on where the c should be, and so their location will be noisier. l l c opt opt In order to combat this bias we introduce an inverse Gamma prior on the a in order to prevent variances from becoming too small. This prior has the form that l oc p p(a) oc (a)- e~^ (4.29) p We will first derive the parameter updates and then explain the intuition behind the choices for the parameters of 7 , and ft. dQ dcr E iE * <?( l^) l o g p ( Y h h e W h{p))h |h) + logp(cr^) (4.30) da ° l oc l p ioc a i h€H - • c / ( < T / 0 C ) 3 l p Setting this to 0 and solving for the parameter we get ioc a ( o ./ o c ) a 31 4-1. Parameter estimation by Expectation Maximization =2^2. { < T p ) Z p ( £ ) ) + ( p 432 ) In essence, the choice of 7 is prior belief of what the variance on the location of a part should be, and (3 is the strength of that belief. These parameters essentially add a set of (3 pseudo-data that are 7 in squared distance from the mean /J, ° . The particular choices of these parameters were set by experimentation. 1 4.1.5 C Scale updates Similar to the location updates, wefixCh for h before parameter updates. So, we set £/,h = c S / . S h dQ dEiEh *?(h|^)logp(S |h) do-scale d(J° 4 e W J2i J2h£Hi d l o gP(£h(p),hl ) h (4.34) (JO-scale = (4.33) cale E E ? ^ ) ( ( W b - 0 ( - ) 4 35 i h€Hj, Setting this to 0 and solving we get « r = E For the variances {at )' cale 1 ) * 4.1.6 " { h ] zmT h ( 4 ' 3 6 ) we can do the same, arriving at the parameter updates scale a E sr sr g( i =2^2^— h JFI )(^h( ),h P zjD) fj> ) s cale p 2 ( 4 3 7 ) Part weight updates If we seek to determine the parameters w for p(h) take the derivative of Q with respect to w . p p 4-2. Incremental learning dQ dw 32 ^EiEh Hg( l^)logP(h) dw _ h ( 6 p p E mn E » + h€?i|/i(p)=0 " mn E hGK|/i(p)#0 p 4 3 g ) . (4 39) p Setting this to 0 results in the parameter updates g(h|.P) «v = E 4.2 E ^ ( ^ ) Incremental learning Learning a model with random initialization with all P parts is generally not tractable for models with a large number of parts. The primary innovation in this thesis is the development of an incremental scheme to adding parts to the model to make learning models with a large number of parts tractable. Now if we have an accurate model with p — 1 parts, then if we add a new part, it is assumed that the parts we have learned so far will remain roughly the same. For example, if we have a model for motorbikes with parts that correspond to the front and back wheel, then adding a new part is unlikely to change the first 2 parts significantly enough that they no longer correspond to the front and back wheel. With this insight, learning a model with 3 parts, given the model with 2 parts, basically reduces to learning the parameters for the new part. The combinatorics of E M is reduced primarily because when we add a new part p we already have a good indication of which features match the first p — 1 parts. As a result, we know which h G Ti. are irrelevant, which is generally a vast majority. Moreover, we also have a good estimate for the object's centre and scale, c , which is the average object centre over all matchings c = J > ( h | A , X , S ) c (4.41) h hen To add a new part to the model we have a set of potential parts J, and for each j G J we have an estimate for the appearance distribution, that is we have mean ixf and a variance <T" for the potential part. The following algorithm describes how we add a new part to the model. To set n and fi ° we find the image that j v pp s cale p l c 33 4-2. Incremental learning originated from and use the image center c from that image to find an approximate location and scale in model space for the part j. We set <J ° to be the average variance of parts thus far, and we set cr to be the scale of the part in model coordinate since we found that this generally varies with the scale of the part. 1 C s cale p Adding a new part 1. For each j £ J (a) Initialize a part p • Set appearance mean to fj,p — /x" and variance to a°^ = a PP pp p apv • Find the image that the sample came from, determine the expected object centre, c, and set fi = S X / + X . Set the <r ° to be the average variance of the parts learned thus far. l oc p • Using c, set fx cale p = SS c l e and set a s cale f c s p = S S/. C 2. Determine the increase in the likelihood of the data with this part. That is calculate Kj = p(D\9) with this part included as part of the model. 3. Initialize the new part of the model to be the part that produced the maximum likelihood Kj Initially we only have a small number of parts in the model, and as a result the model will only be able to recognize only a fraction of the dataset. For example, if we have a model with 3 parts, for many images in the dataset these parts may note be present, or the feature detector may not have produced a feature at these parts. However, as we add new parts to the model, more and more images in the dataset will be recognized by the model. By adding a new part that produces the maximum likelihood, we usually add that part that occurs in the most images in the data set. The bias that this creates is that if the dataset is divided into distinct subsets, then it is possible that this method may learn only one subset. Dealing with this issue will be left for future work. 34 4-3. Intelligent initialization for models and parts 4.3 Intelligent initialization for models and parts In order to be able to learn the model incrementally we need a small model to start with, and we also need a set of potential parts that can be added to the model. The parts of the small model and the set of potential parts are all selected using image matching in the dataset. In image matching we match the features in one image to the features in another image based upon appearance, and remove those that don't agree geometrically. If there are enough features still left, we assume the match is correct, and we retain the features involved in that matching. The small model is chosen to be from the image that had the highest number of matches to other images in the dataset. The parts that are selected from this image are those features that were involved in the most matches to other images. To select the sample set of parts, we simply take those features that are involved in a high number of matches. A n example of this can be found in Figure 4.1 4.3.1 Image matching If two images contain the same object class, then it may be the case that they have features in common. In the image matching algorithm presented, the intent is to find those features in one image that match to the features in the other image. We obviously want to maximize the number of matches, but we also want to minimize the number of false matches since these will introduce additional noise into the initializations. In order to achieve this end we first match features in terms of appearance, and then find the subset of matches that agree geometrically. To better explain the procedures some additional notation must be introduced. For images i and image j, we denote a m(f ) = f to be a match from /* G to P G where m(f) = p if (A - Ap) < (A - A ) for all g e&. We denote Q as the set of features from image % in a match. We say that the match agrees geometrically if the best least squares linear transformation has an error less than ^)\Q\. The best least square linear transformation is the set of parameters (a, s) that minimizes the error l j 2 fi 2 fi g (4.42) In essence it means that we find the best linear transformation of feature locations from image i to the image coordinate system of j , and then measure the error by 4-3. Intelligent initialization for models and parts 35 Figure 4.1: Each pair of images represents the final image matching, after geometric constraints have removed false matches. We want features that occur frequently in the dataset both for potential parts and for initializing a small model. In this case, those features connected by the solid lines would be good potential parts, where as those with the dotted lines occur infrequently. 36 4-3. Intelligent initialization for models and parts squared distance from each feature to its match in the image coordinate system of j. For notational convenience we denote this error as Eg = minEg(a, s). In addition we denote M f as the set of features from other images that are judged to be a match to / G J- . This is not used directly in the image matching, but is used later for initializing the model and initializing the set of potential parts. it 1 To determine an image matching between i and j 1. Find the closest matches in appearance for each feature in /* G T to a feature in p G TK That is find m(f) l 2. Initialize Q opt = 0 3. For N iterations (a) Randomly select a set of 3 features in F , denote the set as Q l (b) While Eg > (ie. add the best features to Q until the geometric error is too great) i. For each feature f \ let Qp = Q U f and determine Eg l ii. Select that feature f that has minimum Eg and add it to Q, that is g = g u /* l i (c) lf\g t\<\g\ then let g op opt = Q 4. If \Qopt\ > k then for each /* G g opU M itfi =M U m(/ ) i itfi 5. If \G \ > k return g , otherwise there is no matching. opt opt The parameter ip is set by hand, and is meant to represent how far away on avera a feature f G g can be from m{f ) in the best linear transformation to the image coordinate space of j. In practise we set it tp to be about 0.1 times the minimum dimension of the image, assuming that the object takes up about 1/3 to 2/3 of the image. Clearly it is also possible that the matching found is a false match, and the fewer number of features in g t, the more likely it is that we have a false match. This is where the parameter k comes in, for it determines when there is a matching. In the experiments we set k = 4, which was determined experimentally to prevent most l l op 37 4-3. Intelligent initialization for models and parts false matchings between images from affecting the initialization of the potential parts or initializing the small model. For values of k < 4 we found there were many more image matchings where the matching was incorrect. 4.3.2 Initializing a small model and a sample set To initialize the sample set J we match all images to each other and extract those features that were involved in the most matches to other images. By this we mean that we use those features that had a high number of both geometric and appearance matches to features in other images. Once we have these features we find the average appearance of these features across the other features they matched, and use these to initialize both /j,p and cr - for a potential part p. The motivation behind choosing these features is that these features are probably the most common and are likely to be part of a good model anyway. PP < vpp To initialize a small model with 5, we first find that image % that matched the most other images in the dataset. At this point we select the top 5 features from that image that were involved in the most matches to other images. These features are then used to initialize a small model. Similar to initializing potential parts for J we also find the average appearance of these features, across the other features they matched in other images, and use this to initialize both the appearance /j,p and 0-app The reason that we choose one image and use the features only from that image is that it allows us to initialize both the appearance ^ ,a £ , and the location fi ° , and scale [i for a part p. Otherwise we would not have a coordinate system to initialize the parameters for location and scale. % PP p s cale p < )p l c 38 4-3. Intelligent initialization for models and parts Initializing a small model and a sample set J • •' 1. For each image % (or a subset) (a) Initialize M p = 0 for every feature f G Jl 1 it (b) For every other image j (or subset) determine Q cedure described above opt by the matching pro- 2. Find the r\ features that are involved in the most matches and put in set J 3. For each of f G J, where i is the image / comes from l • Set \J? y i M . • —\M^~\—' = PP • bet a t n e average appearance of features in M p i - fi 4. Select that image i that matched the most other images 5. For 5 top features f G . F that are involved in the highest number of matches, l (a) Set /j, ^ a 1 = —\M '\—> p I F (b) bet Set <r (bj o~ -app E / 6 fi ^ . ^.! / i ( A r |M ^ ^ n e a v e r a g e appearance of features in Mjji, f ) 2 (c) Set nfc = X / i = V> (d) Set (e) Set n T = S s le f (f) Set o)? fi u = S fi 6. Return these top features as the parts for a small model Chapter 5 Model Computation In general, calculating p(A, X , S) exactly is intractable for a large number of parts as mentioned previously. There are, however, a variety of techniques that can be utilized to approximate p(A, X , S). In general, if we have an accurate model of an object class then we expect that there is only one true matching h, and one true center c for the object in an image. As a result, there will generally be very few matchings that contribute to p(A, X , S). In practice this is also the case, and usually there is only one matching h that contributes significantly to p(A, X , S). So, the task in object classification is to find these few matchings. In this chapter, we outline a few techniques to find the most likely matchings. 5.1 False matches and enforcing geometry The density p(X, S|h) « max p(X, S, c|h) as defined earlier is unconstrained. Howc ever, if we impose one constraint on this probability then computation is much more tractable. The constraint is that if p(X ,S |h(p) = / ) < p ( X , S | h ) / / / / 0 (5.1) for some / and p, then we set p(A, X , S|h) = 0. What this means is that if / is not at all where part p should be according to the object model, then we discard the matching. The reason for making this restriction is two-fold. The first is that it can help reduce the amount of computation to approximate p(A, X , S) significantly. The second is that for high dimensional appearance vectors Af, the distribution for p(A/|h) can range over a much larger range of numbers than p(X, S|h), and as a result P(A|h) has a much greater influence on p(A, X , S|h) than p(X, S|h). One way to avoid false matches due to this is to enforce the constraint that for each feature / matched to a part, the feature's location should agree at least in some degree to where the part should be according to the object model. For example, consider a 39 40 5.2. Search space techniques theoretical object model for cars, which has two parts that correspond to the wheels of the car. If an image with two wheels in random locations is given to the system, this constraint would prevent a false match. The problem with imposing such a constraint is that p(X.f, S/|h) is no longer a probability distribution. In practice, however, this constraint rarely affects the end evaluation since p(A, X , S) relies primarily upon only a few matchings, and these generally satisfy this constraint. It should be mentioned however, that this constraint would have a significant effect upon learning if the parts of the model were initialized randomly. The reason for this is that if the model is not'at all accurate, then many of the matchings that do in fact contribute to p(A, X , S) have no influence in the parameter updates because of this additional constraint. However, in the learning scheme presented, it is never the case that a part is initialized randomly, so the above approximation is reasonable. 5.2 Search space techniques Given a set of features J , we can represent the hypothesis space Ti as a tree, where each level is a part, and nodes on level p represent a match from a feature to part p. Given this tree we can do a depth first search through the tree to determine p(A, X , S), trimming branches that are unlikely to contribute to p ( A , X , S) and exploring those that are likely to contribute to this probability. Figure 5.1 illustrates the search space and the trimming techniques. One basic trimming technique is to not explore further down a branch in instances when p ( X / , S/|h(p) = / ) < p ( X / , S/lh©), which is trimming based upon geometry. Another basic trimming technique, based upon appearance, is to not explore further down a branch in instances when 7 p(h(p) = /)p(A/|h(p) = / ) < p ( A X / ( 7 > S / | / e B)p(h(p) = 0) (5.2) In both of these cases it is always better that the feature / be assigned to the background, that is h(p) = 0. This will be explained in Section 5.2.1. The technique presented in Figure 5.2 to approximate p ( A , X , S), computes p(A, X , S|h) for the top matchings h, neglecting many matches that would not contribute to p(A, X , S). In practice, computing the above approximation p(A, X , S) grows roughly linearly with the number of parts in the model. For example, for a model with 5 parts it takes much less than a second, but with a model with 25 parts, it takes between 2 and 10 seconds. There are additional techniques that can be utilized to find only the optimal matching h in much less than a second for even models with large parts. opt 5.2. Search space techniques 41 Figure 5.1: This diagram illustrates an example of the search space and the trimming techniques with a face model. A matching at a particular node is defined by the path from the root to the node, where the root assigns all parts to the background, and each node assigns a part to feature, (g) are cuts that have been made because of geometry, and X are cuts that have been made because of appearance. 42 5.2. Search space techniques Approximating p(A, X , S) 1. Let h be the matching where h (p) = 0 for all parts p r r 2. SumAll = 0 3. For every / € T (a) SumAll — SumAll + computeChild(h , 1, / ) r 4. p(A, X , S) « SumAll Function computeChild(h,p, f) 1. Let Sumh' = 0, h ' = h, and set h'(p) — f 2. If p(h'(p) ± Q)p{A \U{p) = f) < p(A ,X ,S \f (Trimming based upon appearance) f f f f 3. If p(Xf, Sf\b!) < p(Xf, S/|hg) return 0 4. If p < P then 6 B)p(h(p) = 0) return 0 (Trimming based upon geometry) (Descending down child) • For every / ' 6 Bw, the features matched to the background in h ' — Sum^i = Sumh/ + computeChildih!,p 5. return p(A, X, S|h')p(h') + + 1, /') Sum w Figure 5.2: Pseudo algorithm for approximating p(A,X, S) 43 5.2. Search space techniques In practice, approximating p(A, X , S) « p(h )p(A, X , S | / i ) is accurate enough to obtain the same recognition results as using the full technique described above. In learning, however, we need p(A, X , S) to be as accurate as possible since E M requires p ( h | A , X , S) for multiple h for parameter updates, so such additional techniques are of little use. In Section 5.3 we discuss how to reuse the search tree from previous iterations of E M to reduce computation. opt 5.2.1 opt Trimming the search space If we have a node n at level p, we know the matching h specified at this node. If p ( X , S|h ) < p ( X , S|h.0), we know that for each matching h further down the tree that it is always the case that p ( X ( ) , Sh( )|h ) < p(Xy, S/|h0) for some p. So, according to our constraint outlined in Section 5.1, all matchings that stem from this node do not contribute to p(A, X , S) and thus the subtree does not need to be explored. To see this, note that when p ( X , S|h ) < p ( X , S|ri0), there must be at least one part p, where h (p) = / , such that p ( X / , S / | h „ ) < p(X/,S/|h.0). For the matching h,j, where K is the set of features assigned to parts, the C h that determines where X x and Sx are transformed into model coordinate space is the best transformation for these features, that is n n h p p n n n n p(Xx;,Sx;|h ) n « p(Xx:,S |h ,c ) (5.3) > p(X ,S |h ,c)Vc (5.4) x x; JC n o p i i For each matching h below node n, it is the case that the matchings for the features in JC are the same as in h . As a result, p(Xjc, Sjc|h ) > p ( X ^ , S^|h), and so it is the case that there exists a feature / £ /C such that p ( X / , S/|h) < p ( X / , S/|hg). n n Another technique to trim the subtree at a node n is to evaluate the appearance of the feature / given that it is matched to a part p and compare it to the likelihood of the appearance given that the feature is generated by the background. If it is a lot more likely that the feature is generated by the background than by the part, then we do not need to explore the subtree below the node. In particular if p(h(p) = /)p(A |h(p) = / ) < p(A , X / , S,\f E £)p(h(p) = 0) / f (5.5) then the subtree can in practice be safely be removed. The reason for this is that for any h where h(p) = / , p ( X / , S / | h ) < 1, since we are using Gaussians and the 44 5.3. Search space techniques for EM variances are never small enough to produce probabilities greater than 1, and as a result p(h(p) = f) (A \h(p) P f = /) op(h(p) = / ) p ( A X , S | h ( p ) = /) / ) / / < p ( A X S \f / > < / s t G B)p(h(p) = 0) p(A X S |/6B)p(h(p)=0)(5.6) /l /) / This basically means that it is better that the feature be matched to the background in all matchings h where h(p) = / . . ' . ,. ' 5.3 Search space techniques for EM In computing the parameters 9 for the model, we repeatedly search through the hypothesis space Ti for matches that contribute to p(A, X , S ) . If we have p — 1 parts in the model, then if we run E M on the parameters then E M will converge to some local maximum after some number of iterations. A t this point there is very little change in the parameters, so the matchings that are found to contribute to p(A, X , S) on each iteration will essentially be the same. Moreover, when we add a new part p to the model, we don't expect that the matchings for parts p — 1 to change a great deal. Given this, we can utilize information from previous iterations of E M in order to reduce the search space. Let 4> j be a boolean variable, where 4> j — TRUE indicates that there still remains a matching h where h(p) = / and p(A, X , S|h) contributes to p(A, X , S). cf>pj = FALSE indicates that / definitely does not match p. We can use this in the approximating technique in Section 5.2 by checking that <f) j — TRUE in computeChild(h,p, f) and returning 0 immediately if it's false. From previous iterations, we have determined p(A, X , S|h) for a set of matches h G W that contributed to p(A, X , S). Let * = J2 \hew & h ( ) = / P ( ) K > X , S|h), that is, the total contribution of matching / to p to p ( A , X , S). Now, if the contribution of matching p to / is sufficiently small then it's unlikely that this match is ever going to contribute to p(A, X , S). In particular if v p p h P i / p J p(A,X,S) h <A A P (5.7) then we set 4> j = FALSE, that is that in future iterations we do not need to evaluate an matches h where h(p) = / . This check can be performed at the end of every iteration. p 5.3. Search space techniques for EM O 45 M a t c h i n g s where h ( l ) = f d o n ' t contribute to p ( A , X , S ) t M a t c h i n g s where h(2)=f d o n ' t contribute to p ( A , X , S ) 2 H y p o t h e s i s Tree after i+1 iterations o f E M Figure 5.3: This diagram illustrates how we use information from a previous iteration of E M to trim the search space in order to approximate p(A, X , S) 46 5.3. Search space techniques for EM The question is, how do we set A? W i t h small models there really is no need to utilize previous iterations to reduce computation. However, for models with more than 10 parts, even the approximation scheme in the previous Section 5.2.1 is costly to compute for some model classes, like motorbikes. The key insight to setting A is that p(A, X , S) is roughly proportional to the number of matches in the optimal match h for an image. If there are a high number of matches in h , then it is assumed that the matches from parts to features are correct, and that for any additional parts added to the model, these parts will continue to be matched to the same features in the dominant matching. Clearly we want to reduce computation as much as possible, but we don't want to prematurely exclude possible matches of parts to features since the parameters for parts change on every iteration. So, we set A to be the average error of optimal matches that contain 4 matches. The intuition is that if the optimal matching h has 6 matches, then matchings h with only two matches are unlikely to ever contribute to p(A, X , S) since we already have a very good matching of parts to features in h . In practice it was found that this setting produced the same results as learning without making any use of previous iterations to reduce the search space, except that we could learn large models of 25 parts in 25 minutes instead of 2 or 3 hours. opt o p t opt opt Chapter 6 Experiments In order to validate the learning method and the models learned, a variety of experiments have been conducted on 4 different datasets. The first few sections of the chapter describe some parameter choices and the datasets,' while later sections describe actual results. 6.1 Feature detectors and descriptors Up until this point we have not restricted the model to any particular type of feature detector or descriptor. At this point we ask, what regions of the image are interesting? There are a huge variety of interest point detectors in the computer vision literature, some examples being [6] [11] [9]. However, there are a number of properties that are required for robust general object classification that narrows the number of choices. The first is that the feature detector should be scale and rotation invariant, that is, the same region will be chosen as a feature if the image is scaled or rotated. The particular feature detector we chose for our experiments is that of Lowe [9] , where interest points in this case are located at peaks in the difference of Gaussian function convolved with the image in scale space. In other words, they are located in regions and at scales where there are large gradients in all directions when compared to neighbouring scales and locations. By selecting such regions we are guaranteed to select highly textured regions of the image. Aside from determining which regions of the image are interesting, there is also the question of how to represent this region. As a first step the region should be blurred and resampled according to the scale so that all feature descriptors are of the same size. The simplest approach from this point would be to simply use the resampled region, but this usually produces a very high dimensional vector. The particular approach that Fergus et al. take is to first apply P C A , and represent the region as the first 10-15 principle components. There have also been a number of feature representations that have been developed by the computer vision community that are invariant to rotation, scale, and brightness 47 48 6.2. Experimental setup Image gradients Keypoint descriptor Figure 6.1: Example of a feature descriptor when the image region is divided into 2x2 patches, with the histogram of image gradients in each patch having K = 8 bins. changes, and are less sensitive to changes in 3D viewpoint and noise. The particular approach adopted in this thesis is to use the approach developed by Lowe [9] in order to determine feature vectors A / . In this approach an image region is first blurred and resampled at the appropriate scale and then transformed into a patch of gradients. From here, the region is divided into mxm patches. Each patch is then described as a histogram of image gradients, with K bins. See Figure 6.1 for an example. The advantages of such a representation are that it is invariant to brightness changes, scale, and somewhat invariant to affine distortions. There is the option of making the feature rotationally invariant, but we have dropped this extension for simplicity. We have chosen to divide the image into a 3x3 patch, m = 3, and to have 4 gradient bins per patch, K = 4. This results in feature vectors A / that are 36 dimensional. We have experimented with other parameter choices but these choices tended to produce good results in a reasonable amount of time. 6.2 Experimental setup Each dataset was split into a test dataset and a training dataset. The training dataset was used in learning an object model and the test dataset was reserved for testing the model. Preprocessing for each of the datasets consisted primarily of extracting features, where an image usually had anywhere from 50 features to 700 features detected. This is very much in contrast to the method proposed by Fergus et ai, where the the maximum number of features was 20. Despite this difference, training 6.2. Experimental setup 49 our models were an order of magnitude faster. For each object class model, a set J of 100 potential parts, and a small initial model with 4 parts are extracted from the training data. Following this preprocessing step, the iterative learning procedure is then used to add parts to the model until the model contains P parts. 6.2.1 Datasets There are 4 different datasets from Fergus et al. on which the method presented in the thesis is validated: frontal views of faces, side views of cars, rear views of cars, and side views of motorbikes. The face dataset contains 440 views of faces, mostly of the same scale, similar lighting conditions, and varying backgrounds. The dataset only consists of 27 distinct individuals. In learning a model on this dataset, the dataset was randomly split into 300 training images, and 140 test images. This split was sometimes done numerous times to obtain averages. The motorbike dataset contains 826 images of side views of motor bikes, with varying scale, similar lighting conditions, and varying backgrounds, although most were against a light-coloured background. The test sets consisted of 200 images while the training sets consisted of the remaining 626 images The rear view car dataset contains 1155 images of rear views of cars, with varying scale, varying lighting conditions, and varying backgrounds, although all were taken on roads. The test sets consisted of 200 images and the training sets consisted of the remaining 955 images. The main side view car dataset contains 540 images of various cars viewed from side. The scale of the cars were identical, but the background varied. The test sets consisted of 140 images and the training sets consisted of the remaining 400 images. However, for comparison with results presented in Fergus et al. there is also an additional test set that contains test images of cars, sometimes more than one. The task with this dataset is to locate the object class, not only classify the image as a car. There are also two background datasets. The first contains 900 images of various sizes of various scenes. The second set contains 1155 images of various sizes of road scenes without the presences of a car. This is used for recognition results related to the dataset with cars viewed from the rear. In both cases, these datasets were used to compute the false positive rate, which is the percentage of the time that the object 6.3. Computation time required to learn object models 50 recognition system classified a background image as being part of the object class. 6.3 Computation time required to learn object models One of primary contributions of this thesis is a method to learn a part based model with a large number of parts quickly. In Fergus et al., models of 6 or 7 parts take 24 to 36 hours to train, and the time to learn the parameters for this method is generally exponential in the number of parts P, so larger models are not feasible. W i t h the learning procedure described in this thesis, the amount of computation time to learn an object model is roughly linear in the number of parts. The learning is composed of two stages, a preprocessing step that initializes a small model and a set J of potential parts, and the incremental learning that adds these parts to the model. It generally takes about 10 minutes for the preprocessing step, but it is not optimized, so this compute time can be reduced. In general it takes about 1 to 3 minutes to add a new part to the model and run E M till convergence on the parameters. Learning an object model of 25 parts usually takes 30 minutes or less. 6.4 Results There are a variety of measures that can be utilized to measure how effective an object model is as an object classifier. Given that we have learned parameters for p(A, X , S|#), we can use the ratio R = p(A, X , S|#)/p(A, X , Sjh©) to recognize an image. If R > u>, where u> is some threshold, then we classify the image as having the object class. If R < u> then the image does not contain an instance of the object class. One of the most useful measures for evaluating an object recognition system is the Receiver-Operator curve (ROC), which measures how the true positive rate TP^ varies with the false positive rate FP when u is varied. A true positive is when an image containing the object is identified as containing the object class. A false positive, on the other hand, is when an image is identified as containing the object class when it does not. The true positive rate is defined as W TP„ = Number of true positives Number of images containing the object class whereas the false positive rate is defined as (6.1) 51 6.4- Results Number of false positives . Number of images not containing the object class It it fairly common to compare different object classifications systems by utilizing the R O C equal error rate, which is defined to be TP^ = 1 — FP^ which is determined by varying the threshold u. This measurement is meant to convey the tradeoff between classifying images containing the object class correctly and falsely classifying images that do not contain the image class as containing the image class. w 6.4.1 Comparison to previous methods Our comparisons are restricted to comparing our results to the results presented by Fergus et al, since few approaches achieve the same amount of success on the datasets we use to validate our approach. The results that they present are primarily R O C equal error rates, with the exception of the dataset of cars viewed from the side. With the dataset of cars viewed from the side, they utilize a recall-precision curve (RPC), which is similar to the R O C curve. The task, however, is not to classify an image but to locate the object class in the image. So, in order to utilize our model to accomplish this we output all distinct matchings h and the associated object centers c where p(A, X , S|h) > u. A true positive is defined to be the case when c occurs within some r from an instance of the object class, and a false positive is when c does not occur within r of an instance of an object class. Recall^ is similar to the true positive rate, opt ^ „ Number of true positives Recall^ = —— -fNumber of instances of the object class (6.3) The precision is defined to be _ . . Precision w — Number of true positives Number of false positives + true positives (6 4) So, given this experimental setup the result reported for the dataset of cars viewed from the side is recall-precision equal error, which is the value of Recall^ when Recall^ — 1 — Precision^. More information on this type of experiment can be found in [1] By the results in Table 6.1, it is unclear whether the approach proposed in this thesis is any better at object recognition than the one presented by Fergus et al. However, this could very be well an artifact of the datasets. For the datasets in 52 6.4- Results Dataset Motorbikes Faces Cars (Side) Cars (Rear) Ours 90.2 (20 part model) 94.7 (9 part model) 90.5 (6 part model) 96.2 (20 part model) Fergus et al. 92.5 (6 part model) 96.4 (6 part model) 88.5 (6 part model) 90.3 (6 part model) Table 6.1: R O C equal error results comparing our results to that of Fergus et al. question, it turns out that most of the object classes can be recognized with just a few parts. For example, we found that a two part model with the two eyes was able to produce an R O C equal error rate of 0.8. As a result, learning models with more parts does not dramatically improve recognition results. This issue will be further discussed in the next section. 6.4.2 Incremental learning The main contribution of this thesis is an approach to learning a part-based object recognition that is able to learn a large number of parts in a reasonable amount of time. To test the effectiveness of the learning approach, we trained models of varying sizes for each object class to determine the improvement or lack of improvement in object recognition results. The R O C curves in Figure 6.2 demonstrate that learning models with more object parts definitely improves results, although the improvement in some cases is not large. These R O C curves are the average obtained over 10 different splits of the dataset into testing set and training set. Perhaps an easier way to assess how much having larger models improves recognition results is to look at the equal error rate for models of various sizes. In Figure 6.3 we present the average R O C equal error rate for models of various sizes. The first thing to note is that for all of the data sets the recognition results tend to peak at some point and performance tends to degrade or plateau as additional parts are added to the model. The explanation for this is somewhat complicated but enlightening. A n inspection of the datasets reveals that there is a portion of the each dataset that is quite different in character from the average image in the dataset. For example, in the face dataset, about 5 to 10 percent of the images contain an image of a face taken under lighting conditions that differ considerably from the rest of the dataset (see Figure 6.4). These faces appear much darker, and as a result there is very little contrast, which results in fewer feature detections on the face. In addition, the appearance of these features 53 6.4- Results are significantly different than features in similar regions on the face in the average image in the dataset. Now, in our initializing procedure, we select a sample set J of potential parts, where a feature can act as a potential part if it is involved in lots of image matches. As a result few potential parts would come from these images, and as a result the learning method would have a bias and thus neglect this segment of the dataset, A similar analysis can be applied to the motorbike dataset. In this case a majority of the motorbikes are against a light background. As a result, many of the parts the learning algorithm learned were on the outside of the motorbike, so they included the lighter blackground. However, for a small portion of the dataset the background is quite dark, and as a result these images are hard to recognize using Motorbikes Faces — ^ .f\. 0.8 .. f. 1 / tr CD > 0.6 V 0.8 rr / g 0.6 '55 o O Q- 0.4 o- 0 . 4 CD CD 0.2 — 0.2 0.4 5 part m o d e l 10 part m o d e l 2 0 part m o d e l 0.6 5 part m o d e l 10 part m o d e l 2 0 part m o d e l 0.2 0.8 0.2 False Positive Rate CD > '55 o Cu 0.8 C a r s (rear view) 0.8 B 0.8 « tr 0.6 CD > '55 o CL 0.4 CD 3 — I 0.6 1 JJ tsL—-tr 0.4 False Positive Rate C a r s (side) 03 — 0.6 0.4 CD — — — 0.2 0 0.2 0.4 5 part m o d e l 8 part m o d e l 1 5 part m o d e l 0.6 F a l s e Positive R a t e 0.8 H 5 part m o d e l 10 part m o d e l 2 0 part m o d e l 0.2 0 0.2 0.4 0.6 0.8 False Positive Rate Figure 6.2: These R O C curves demonstrate that as the number of parts increase the R O C curve improves. 6.4- Results 54 Figure 6.3: This figure outlines how the R O C equal error rate improves as more parts are added to the model. Note that for each model the curve seems to plateau, indicating that results don't improve with larger models. This is somewhat due to the nature of the datasets. these parts. Moreover, since these images are only a small portion of the dataset, very few parts in the potential part set J would come from these images. As a result, few parts would ever be added to the motor bike model that could help in modelling these darker images. 6.4.3 Learned models In Figures 6.5,6.7,6.6, 6.9, 6.8 are visualizations of the models that were learned by the approach outlined in this thesis. In each figure, the model is split into two parts, 6.4- Results 55 Figure 6.4: The first are images that are not recognized, where as the second column are easily recognized. The features in the optimal match are highlighted. Notice how in the first column the images are substantially different in character from those in the other column, indicating why they may be difficult to recognize. 56 6.4- Results the appearance model and the location of the parts model. In the appearance section, for each part, is the blurred image of the top four features from the dataset that match the part based solely on appearance. The blurring is proportional to the scale of the feature, which is performed on the original image patch before encoding the feature descriptor A / . The 5th image patch is an example of a feature without the blurring. This is meant to illustrate which part of the object it comes from if it is not clear from the blurred image patches. Also with each part is the weight w for the part p, which is roughly the proportion of the dataset that this part appeared in in the training data. Also included is the AppVar which is E <7> the sum of the standard deviations over all dimensions of the appearance for the part p. This is meant to illustrate how wide the variance is for the appearance of each part. In the locations section is displayed various ellipses, where the centre of each ellipse corresponds to part p's location in model coordinate space. The x and y radius are 2a ° . Each ellipse is connected to a line that points to some image patch, which is an example of that feature from the dataset. The scale of the feature is represented by the scale of the image patch. As can be seen in the figures, some interesting properties are picked up by the model. Of particular interest is the model of motorbikes, which are primarily described by the rounded curves in a particular geometric configuration, so it appears that it is modelling the wheels primarily. With the motorbikes it was generally the case that most of the parts were concentrated on the front wheel, even for large models. A partial explanation for this is that in the initialization procedure, the initial small model tended to be composed of parts from the front wheel. As a result, when we trying to add new parts to the model, there is a bias towards parts being somewhat close to the parts already in the model. The reason for this is that if a majority of matches in h in an image are in one particular area, then these tend to dictate where the center c is. As a result, the location for any potential part that is far from the parts in the model thus far will appear to be more noisey, and so the increase in the likelihood when this part is added to the model will be less than it would have been if it were closer to the other parts already in the image. As a result, parts that are closer to the parts already learned for the model are preferred by the incremental learning procedure. Another interesting thing to note is that many of the parts that were learned for these models were on the edge of the object in the image. This means that it is picking up the shape of the object, however, this relies on the background being a p t l c opt 6.4- Results 57 particular type. For example, the cars viewed from the rear tended to be against a light grey background, usually a road scene, so the parts that included part of the background will not be detected in instances where a car is on a very dark or very light background. However, this is not a problem of the approach, but of the dataset. Clearly if the dataset has a regularity, then an unsupervised approach to learning parts will pick up on this. In order to deal with this problem, datasets should include objects against a great variety of background scenes so that parts that are learned do not rely on the fact that the object class is against the same type of background as in the training data. 58 6.4- Results Part 1: w = 0.52 AppVar=1206 ^/rPart 2: w = 0.32 AppVar=889 ^^jjpjj| ^piRlj ^^(P Cr Part 6: w = 0.43 AppVar=1023 Part 7: w = 0.72 AppVar=l 195 Part 3: w = 0.55 AppVar=l 139 4^ ^ ^^ Part 4: w = 0.42 AppVar=l 156 Part 8: w = 0.43 AppVar=1044 Part 9: w = 0.55 AppVar=l 124 Part 5: w = 0.46 AppVar=l 101 Part 10: w = 0.31 AppVar=871 Figure 6.5: A 10 part model for motorbikes 6.4- Results 59 Part 1: w = 0.61 AppVar=913 Part 6: w = 0.44 AppVar=325 Part 7: w = 0.69 AppVar=1251 Part 1 Figure 6.6: A 1 0 part model for cars viewed from the rear Part 1: w = 0.67 ^Sm, 0 0 Part 2: w = 0.70 €% O AppVar=867 j&k 0 9 AppVar=966 O f Part 4: w = 0.60 ^^^flHkk. 0 Part 6: w = 0.66 .JJS J * * W Part 7: w = 0.43 AppVar=1065 *SSfci AppVar=909 Part 8: w = 0.41 AppVar=1046 Part 9: w = 0.66 AppVar=1057 1 ^ Part 3: w = 0.59 AppVar= 1240 | H | E§| J | H H ^ J||p jj^g^ AppVar=1050 ^j^SSSfc dtj J L - Part 5: w = 0.66 AppVar=1065 ^Hk Part 10: w = 0.48 ^PHW^ AppVar= 114 V M n ^ ^ ^ ^ ^ Figure 6.7: A 10 part model for cars viewed from the side Figure 6.8: The locations for the parts in a 25 part model for faces • ••• ••• Part 1: w = 0.86 AppVar=733 Part 2: w = 0.42 AppVar=639 t < f * Part 3: w = 0.83 AppVar=738 Part 3:r Part 4: w = 0.66 AppVar=1059 Part 5: w = 0.62 AppVar= Part 6: w = 0.62 AppVar=802 • AppVar=912 Part 14: w = 0.53 App Part 15: w = 0.48 App ^Br Part 4: • Q Part 13: w = 0.55 € r • Part 7: w = 0.48 AppVar=706 Part 8: w = 0.69 AppVar=943 Part 9: w = 0.15 AppVar=1013 Part 10: w = 0.43 AppVar=697 Part 22: w = 0.47 AppVar=842 Part 11: w = 0.75 AppVar=l 119 Part 23: w = 0.51 AppVar=958 Part 12: w = 0.65 AppVar=976 - 0 •••• Part 24: w = 0.48 AppVar=924 Part 25: w = 0.31 AppVar=600 Figure 6.9: The appearance for parts in 25 part model for faces 6 Z L • • • Chapter 7 Conclusion and Future W o r k There has been a great deal of attention focused on part-based approaches to object classification in recent research in computer vision, and some approaches have achieved a surprising amount of success. However, learning models with a large number of parts has been a particular challenge. One of the most successful approaches is that of Fergus et al, who have developed a generative model for recognition that achieves excellent results on a variety of datasets, including cars, motorbikes, cats, faces, and air planes. The learning method that they present to learn the parameters for the model, however, requires an exponential amount of time to train as the number of parts increase. They cite a 6 part model takes about 24 hours to train. The reason for this is that in the learning algorithm they have to evaluate nearly all possible matchings in the initial stages, and the number of matchings increases exponentially with the number of parts in the model. The primary contribution of this thesis is the extension of their generative model, and the development of a learning algorithm that can learn a large number of parts in a reasonable amount of time. In particular, we have developed an incremental learning algorithm where the model is initialized intelligently with a small number of parts, and parts are added to the model one at a time. B y initializing the parameters of a small model, we don't need to evaluate a great number of matchings in order to update the parameters for the model. Moreover, by adding parts one at a time we can utilize information from previous iterations, so the number of matchings that need to be evaluated to update the parameters can be greatly reduced. The end result, as demonstrated in Chapter 6, is that we are able to learn models with a large number of parts, over 25, in much less than an hour. Moreover, there is no reason to suggest that larger models cannot be learned. The recognition results, however, do not directly indicate that results improve a great deal with models with more parts. However, with the datasets on which we evaluated our approach, it turns out that a majority of the dataset can be recognized with only a few parts, and that the remaining are extremely difficult to recognize due to properties in these images that weren't present in a majority of the dataset. 63 64 As a result, recognition results, like the R O C equal error rate are not necessarily a good indicator of the power of our method. In future we.would like to evaluate our approach on more natural datasets, since this is more likely to reveal the advantage of having models with a large number of parts. The learning method presented, however, has a number of pitfalls and interesting extensions that we would like to address in future work. The first is the improvement of the procedure for initialization of a small model and for the initialization of a sample set. One improvement is to remove the bias towards selecting parts that are close together in an object, for both the small model and for the sample set of potential parts. The effect of this bias can be see in the model for motorbikes where a majority of the parts learned were near the front wheel. Another interesting improvement would be to be able to automatically split an object class into distinct subclasses in the cases where the subclasses are sufficiently distinct. For example, the class of vehicles is composed of motorbikes, cars, trains, but these classes do not share a large number of parts that would manifest themselves visually. It should be possible for the learning algorithm to detect if there is some segment of the dataset that it currently does not recognize and then try to create a separate object model for this segment. In addition, when we select a new part to add to the dataset, we select it from the set of potential parts that was obtained before learning, and we select it so that it maximizes the likelihood of the data the most. The problem with this is that the learning algorithm will build a richer model primarily for the segment of the training data that it already recognizes very well. There is no constraint that learning algorithm has to be able to recognize the training data evenly. As a result, a common result is that the model learned can recognize a majority of the dataset very well, but cannot recognize a few images of the dataset at all. A n interesting extension would be to impose a constraint, or bias the selection of a new part, so that the model can recognize each of the images in the dataset evenly. One approach to do this would be to instead select a potential part from the segment of training data that is not recognized well. It should be noted, however, that the learning method presented in this thesis is not restricted to the model presented. In general, a part-based approach has to learn the parts of the model, and learning models with a large number of parts will be difficult regardless of the model. The key insight provided by this thesis is that it is not necessary to learn all the parts at once. In fact, by beginning with a smaller model and building a more complex model slowly it is possible to arrive at a good 65 model while avoiding the computational cost that is associated with learning all of the parts at once. Bibliography [1] S. Agarwal and D. Roth. Learning a sparse representation for object detection. In European Conference on Computer Vision, pages 113-1130, 2002. [2] I. Biederman. Human image understanding: Recent research and theory. Computer Vision, Graphics, and Image Understanding, 32:29-73, 1985. [3] M . C. Burl and P. Perona. Recognition of planar object classes. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, 1996. [4] A . Dempster, N . Laird, and D. Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society, 39(B): 1-38, 1976. [5] R. Fergus, P. Perona, and A. Zisserman. Object class recognition by unsupervised scale-invariant learning. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, 2003. [6] C. Harris and M . Stevens. A combined corner and edge detector. In Fourth Alvey Vision Conference, pages 147-151, 1988. i • [7] S. Helmer and D . G . Lowe. Object recognition with many local features. In Generative-Model Based Vision (held in conjunction with Proc. IEEE Conf. Computer Vision and Pattern Recognition), 2004. [8] D. G . Lowe. Object recognition from local scale-invariant features. In International Conference on Computer Vision, pages 1150-1157, 1999. [9] D. G . Lowe. Distinctive image features from scale-invariant keypoints. International Journal of Computer Vision, 60(2):91-110, 2004. [10] G . Mayraz and G . E. Hinton. Recognizing hand-written digits using hierarchical products of experts. In Adv. in Neural Information Processessing Systems, pages 953-959, 2000. [11] K . Mikolajczyk and C. Schmid. A n affine invariant interest point detector. In European Conference on Computer Vision, pages 128-142, 2002. 66 67 Bibliography [12] H . Murase and S. K . Nayar. Visual learning and recognition of 3d objects from appearance. International Journal of Computer Vision, 14(l):5-24, 1995. [13] A . R. Pope and D. G . Lowe. Probabilistic models of appearance for 3-d object recognition. International Journal of Computer Vision, 40(2):149-167, 2000. [14] C. Schmid and R. Mohr. Local greyvalue invariants for image retrieval. In IEEE Trans, on Pattern Analysis and Machine Learning, pages 530-534, 1997. ^ > - • [15] M . J. Swain and D. H . Ballard. Color'indexing. International Journal of Computer Vision, 7 ( l ) : l l - 3 2 , 2004. [16] M . A . Turk and A . P. Pentland. Face recognition using eigenfaces. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pages 586-591, 1991. [17] S. Ullman and E. Sali. Object classification using a fragment-based representation. In T. Poggio S.W. Lee, H . H . Bulthoff, editor, First IEEE International Biologically Motivated Computer Vision Workshop (BMCV), pages 73-87. Springer, 2000. [18] P. Viola and M . Jones. Rapid object detection using a boosted cascade of simple features. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, 2001. [19] M . Weber, M . Welling, and P. Perona. Unsupervised learning of models for recognition. In European Conference on Computer Vision, pages 18-32, 2000.
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- Object recognition with many local features
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
Object recognition with many local features Helmer, Scott 2004-12-31
pdf
Page Metadata
Item Metadata
Title | Object recognition with many local features |
Creator |
Helmer, Scott |
Date | 2004 |
Date Issued | 2009-11-24T21:45:57Z |
Description | There has been a great deal of attention focused on part-based approaches to object classification in recent research in computer vision, and some approaches have achieved a surprising amount of success. However, learning models with a large number of parts has been a particular challenge. One of the most successful approaches is that of Fergus et al. [5] who have developed a generative model for recognition that achieves excellent results on a variety of datasets. The learning method that they present to learn the parameters for the model, however, requires an exponential amount of time to train as the number of parts increase. The primary contribution of this thesis is the extension of their generative model, and the development of a learning algorithm that can learn a large number of parts in a reasonable amount of time. In particular, we have developed an incremental learning algorithm where the model is initialized intelligently with a small number of parts, and parts are added to the model one at a time. By taking such an approach we are able to learn models with a large number of parts in nearly a linear amount of time in the number of parts. The approach is validated on a number of datasets, including cars, motorbikes, and faces, and demonstrates excellent recognition results along with large models learned in a reasonable amount of time. |
Extent | 8197989 bytes |
Genre |
Thesis/Dissertation |
Type |
Text |
File Format | application/pdf |
Language | eng |
Collection |
Retrospective Theses and Dissertations, 1919-2007 |
Series | UBC Retrospective Theses Digitization Project |
Date Available | 2009-11-24 |
Provider | Vancouver : University of British Columbia Library |
Rights | For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use. |
DOI | 10.14288/1.0051737 |
URI | http://hdl.handle.net/2429/15695 |
Degree |
Master of Science - MSc |
Program |
Computer Science |
Affiliation |
Science, Faculty of Computer Science, Department of |
Degree Grantor | University of British Columbia |
Graduation Date | 2004-11 |
Campus |
UBCV |
Scholarly Level | Graduate |
Aggregated Source Repository | DSpace |
Download
- Media
- [if-you-see-this-DO-NOT-CLICK]
- ubc_2004-0484.pdf [ 7.82MB ]
- Metadata
- JSON: 1.0051737.json
- JSON-LD: 1.0051737+ld.json
- RDF/XML (Pretty): 1.0051737.xml
- RDF/JSON: 1.0051737+rdf.json
- Turtle: 1.0051737+rdf-turtle.txt
- N-Triples: 1.0051737+rdf-ntriples.txt
- Original Record: 1.0051737 +original-record.json
- Full Text
- 1.0051737.txt
- Citation
- 1.0051737.ris
Full Text
Cite
Citation Scheme:
Usage Statistics
Country | Views | Downloads |
---|---|---|
China | 17 | 5 |
United States | 10 | 0 |
Russia | 6 | 0 |
Canada | 6 | 0 |
Germany | 5 | 0 |
India | 2 | 0 |
Brazil | 1 | 0 |
Japan | 1 | 0 |
City | Views | Downloads |
---|---|---|
Shenzhen | 17 | 5 |
Saint Petersburg | 6 | 0 |
Winnipeg | 6 | 0 |
Ashburn | 6 | 0 |
Unknown | 4 | 0 |
Mannheim | 3 | 0 |
Fort Worth | 2 | 0 |
University Park | 1 | 0 |
Mumbai | 1 | 0 |
Redwood City | 1 | 0 |
Tokyo | 1 | 0 |
{[{ mDataHeader[type] }]} | {[{ month[type] }]} | {[{ tData[type] }]} |
Share
Embed
Customize your widget with the following options, then copy and paste the code below into the HTML
of your page to embed this item in your website.
<div id="ubcOpenCollectionsWidgetDisplay">
<script id="ubcOpenCollectionsWidget"
src="{[{embed.src}]}"
data-item="{[{embed.item}]}"
data-collection="{[{embed.collection}]}"
data-metadata="{[{embed.showMetadata}]}"
data-width="{[{embed.width}]}"
async >
</script>
</div>
Our image viewer uses the IIIF 2.0 standard.
To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0051737/manifest