Exercise Session 10 – Image Categorization

Slides:



Advertisements
Similar presentations
COMPUTER AIDED DIAGNOSIS: CLASSIFICATION Prof. Yasser Mostafa Kadah –
Advertisements

Aggregating local image descriptors into compact codes
Unsupervised Learning Clustering K-Means. Recall: Key Components of Intelligent Agents Representation Language: Graph, Bayes Nets, Linear functions Inference.
Multi-layer Orthogonal Codebook for Image Classification Presented by Xia Li.
1 Part 1: Classical Image Classification Methods Kai Yu Dept. of Media Analytics NEC Laboratories America Andrew Ng Computer Science Dept. Stanford University.
Lecture 3 Nonparametric density estimation and classification
Activity Recognition Aneeq Zia. Agenda What is activity recognition Typical methods used for action recognition “Evaluation of local spatio-temporal features.
Chapter 4: Linear Models for Classification
CS4670 / 5670: Computer Vision Bag-of-words models Noah Snavely Object
Bag-of-features models. Origin 1: Texture recognition Texture is characterized by the repetition of basic elements or textons For stochastic textures,
Bag-of-features models Many slides adapted from Fei-Fei Li, Rob Fergus, and Antonio Torralba.
Beyond bags of features: Part-based models Many slides adapted from Fei-Fei Li, Rob Fergus, and Antonio Torralba.
Probabilistic inference
Bayes Rule How is this rule derived? Using Bayes rule for probabilistic inference: –P(Cause | Evidence): diagnostic probability –P(Evidence | Cause): causal.
1 Image Recognition - I. Global appearance patterns Slides by K. Grauman, B. Leibe.
Lecture 28: Bag-of-words models
Beyond bags of features: Adding spatial information Many slides adapted from Fei-Fei Li, Rob Fergus, and Antonio Torralba.
Bag-of-features models
5/30/2006EE 148, Spring Visual Categorization with Bags of Keypoints Gabriella Csurka Christopher R. Dance Lixin Fan Jutta Willamowski Cedric Bray.
Visual Recognition Tutorial
Pattern Recognition. Introduction. Definitions.. Recognition process. Recognition process relates input signal to the stored concepts about the object.
Multiple Object Class Detection with a Generative Model K. Mikolajczyk, B. Leibe and B. Schiele Carolina Galleguillos.
Jeff Howbert Introduction to Machine Learning Winter Classification Bayesian Classifiers.
Crash Course on Machine Learning
Review: Intro to recognition Recognition tasks Machine learning approach: training, testing, generalization Example classifiers Nearest neighbor Linear.
Bag-of-features models. Origin 1: Texture recognition Texture is characterized by the repetition of basic elements or textons For stochastic textures,
Binary Variables (1) Coin flipping: heads=1, tails=0 Bernoulli Distribution.
Bag-of-Words based Image Classification Joost van de Weijer.
Project 2 SIFT Matching by Hierarchical K-means Quantization
Methods in Medical Image Analysis Statistics of Pattern Recognition: Classification and Clustering Some content provided by Milos Hauskrecht, University.
Step 3: Classification Learn a decision rule (classifier) assigning bag-of-features representations of images to different classes Decision boundary Zebra.
CSE 185 Introduction to Computer Vision Pattern Recognition.
Rainbow Tool Kit Matt Perry Global Information Systems Spring 2003.
Processing of large document collections Part 2 (Text categorization) Helena Ahonen-Myka Spring 2006.
Bayesian Networks. Male brain wiring Female brain wiring.
Watch, Listen and Learn Sonal Gupta, Joohyun Kim, Kristen Grauman and Raymond Mooney -Pratiksha Shah.
Text Classification, Active/Interactive learning.
Nonparametric Part Transfer for Fine-grained Recognition Presenter Byungju Kim.
Naive Bayes Classifier
Bag-of-features models. Origin 1: Texture recognition Texture is characterized by the repetition of basic elements or textons For stochastic textures,
Svetlana Lazebnik, Cordelia Schmid, Jean Ponce
Classification Techniques: Bayesian Classification
1 Pattern Recognition Pattern recognition is: 1. A research area in which patterns in data are found, recognized, discovered, …whatever. 2. A catchall.
Chapter 4: Pattern Recognition. Classification is a process that assigns a label to an object according to some representation of the object’s properties.
ECE 5984: Introduction to Machine Learning Dhruv Batra Virginia Tech Topics: –Unsupervised Learning: Kmeans, GMM, EM Readings: Barber
Visual Categorization With Bags of Keypoints Original Authors: G. Csurka, C.R. Dance, L. Fan, J. Willamowski, C. Bray ECCV Workshop on Statistical Learning.
Artificial Intelligence 8. Supervised and unsupervised learning Japan Advanced Institute of Science and Technology (JAIST) Yoshimasa Tsuruoka.
Jakob Verbeek December 11, 2009
Lecture 2: Statistical learning primer for biologists
Lecture 08 27/12/2011 Shai Avidan הבהרה: החומר המחייב הוא החומר הנלמד בכיתה ולא זה המופיע / לא מופיע במצגת.
KNN & Naïve Bayes Hongning Wang Today’s lecture Instance-based classifiers – k nearest neighbors – Non-parametric learning algorithm Model-based.
Chapter 13 (Prototype Methods and Nearest-Neighbors )
WEEK4 RESEARCH Amari Lewis Aidean Sharghi. PREPARING THE DATASET  Cars – 83 samples  3 images for each sample when x=0  7 images for each sample when.
CS654: Digital Image Analysis
Lecture 5: Statistical Methods for Classification CAP 5415: Computer Vision Fall 2006.
Debrup Chakraborty Non Parametric Methods Pattern Recognition and Machine Learning.
BAYESIAN LEARNING. 2 Bayesian Classifiers Bayesian classifiers are statistical classifiers, and are based on Bayes theorem They can calculate the probability.
KNN & Naïve Bayes Hongning Wang
Gaussian Mixture Model classification of Multi-Color Fluorescence In Situ Hybridization (M-FISH) Images Amin Fazel 2006 Department of Computer Science.
Does one size really fit all? Evaluating classifiers in a Bag-of-Visual-Words classification Christian Hentschel, Harald Sack Hasso Plattner Institute.
Another Example: Circle Detection
CH 5: Multivariate Methods
By Suren Manvelyan, Crocodile (nile crocodile?) By Suren Manvelyan,
Classification Techniques: Bayesian Classification
Lecture 26: Faces and probabilities
CS 1674: Intro to Computer Vision Scene Recognition
Michal Rosen-Zvi University of California, Irvine
Nonparametric density estimation and classification
Multivariate Methods Berlin Chen
Multivariate Methods Berlin Chen, 2005 References:
Presentation transcript:

Exercise Session 10 – Image Categorization Computer Vision Exercise Session 10 – Image Categorization

Object Categorization Task Description “Given a small number of training images of a category, recognize a-priori unknown instances of that category and assign the correct category label.” How to recognize ANY car

Object Categorization Two main tasks: Classification Detection Is there a car in the image? Binary answer is enough Where is the car? Need localization e.g. a bounding box

Bag of Visual Words Object Bag of ‘words’

Bag of Visual Words

Bag of Visual Words Summarize entire image based on its distribution (histogram) of word occurrences. Analogous to bag of words representation commonly used for documents. Construct a vocabulary – set of words Image representation

BoW for Image Classification Works pretty well for whole-image classification {face, flowers, building}

BoW for Image Classification positive negative 1. Codebook construction 2. Training Images 3. Testing Codebook construction Feature detection and description Codebook (visual words) Train image classifier Bag of words image representation Image classification Classifier Binary classification

Your Task Implement a BoW image classifier : Feature detection Feature description Codebook construction BoW image representation BoW image classification

Dataset Training set 50 images CAR - back view 50 images NO CAR Testing set 49 images CAR - back view

Feature Extraction Feature detection For object classification, dense sampling offers better coverage. Extract interest points on a grid Feature description Histogram of oriented gradients (HOG) descriptor

Codebook Construction Map high-dimensional descriptors to words by quantizing the feature space Quantize via clustering K-means Let cluster centers be the prototype “visual words”

Codebook Construction Example: each group of patches belongs to the same visual word Ideally: an object part = a visual word

Codebook Construction K-means Initialize K clusters centers randomly Repeat for a number of iterations: Assign each point to the closest cluster center Update the position of each cluster center to the mean of its assigned points

BoW Image Representation Histogram of visual words image BoW image representation visual words

BoW Image Classification Nearest Neighbor Classification Bayesian Classification

Nearest Neighbor Classifier Training: Training images i -> BoW image representation yi with binary label ci Testing: Test image -> BoW image representation x Find training image j with yj closest to x Classifier test image with binary label cj

Bayesian Classifier Probabilistic classification scheme based on Bayes’ theorem Classify a test image based on the posterior probabilities

Bayesian Classifier Test image -> BoW image representation Compute the posterior probabilities Classification rule

Bayesian Classifier In this assignment consider equal priors Notice that the posterior probabilities have the same denominator – normalization factor Classification rule

Bayesian Classifier How to compute the likelihoods? Each BoW image representation is a K-dimensional vector hist = [2 3 0 0 0 . . . 1 0] Number of counts for the 2nd visual word in the codebook Number of counts for the K- th visual word in the codebook

Bayesian Classifier Consider the number of counts for each visual word a random variable with normal distribution Warning: this is a very non-principled approximation as counts(i) is discrete and non-negative! For positive training images estimate: For negative training images estimate:

Bayesian Classifier BoW test image representation= [U1 U2 … UK] Probability of observing Ui counts for the ith visual word in a car image In a !car image

Bayesian Classifier Using independence assumption: Numerical stability – use logarithm Now we have the likelihoods

Hand-in Report should include: Source code Your classification performance Nearest neighbor classifier Bayesian classifier Variation of classification performance with K Your description of the method and discussion of your results Source code Try on your own dataset (for bonus marks!)

By 1pm on Thursday 8th January 2015 corino@vision.ee.ethz.ch Hand-in By 1pm on Thursday 8th January 2015 corino@vision.ee.ethz.ch