tutorial on conditional random fields for sequence...
TRANSCRIPT
![Page 1: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/1.jpg)
Tutorial on Conditional Random Fields
for Sequence Prediction
Ariadna Quattoni
![Page 2: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/2.jpg)
RoadMap
Sequence Prediction Problem
CRFs for Sequence Prediction
Generalizations of CRFs
Hidden Conditional Random Fields (HCRFs)
HCRFs for Object Recognition
![Page 3: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/3.jpg)
RoadMap
Sequence Prediction Problem
CRFs for Sequence Prediction
Generalizations of CRFs
Hidden Conditional Random Fields (HCRFs)
HCRFs for Object Recognition
![Page 4: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/4.jpg)
Sequence Prediction Problem
Example: Part-of-Speech Tagging
He reckons the current account deficit will narrow significantly
[PRP] [VB] [DT] [JJ] [NN] [MD] [VB] [RB] [NN]
![Page 5: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/5.jpg)
Gesture Recognition
[HTF] [HTF] [HTF] [HOF] [HOF] [HOS]
![Page 6: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/6.jpg)
RoadMap
Sequence Prediction Problem
CRFs for Sequence Prediction
Generalizations of CRFs
Hidden Conditional Random Fields (HCRFs)
HCRFs for Object Recognition
![Page 7: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/7.jpg)
Conditional Random Fields: Modelling the Conditional Distribution
Model the Conditional Distribution:
To predict a sequence compute:
Must be able to compute it efficiently.
![Page 8: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/8.jpg)
Conditional Random Fields: Feature Functions
Feature Functions:
![Page 9: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/9.jpg)
Feature Functions
Express some characteristic of the empirical distribution that we wish to hold in the model distribution
![Page 10: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/10.jpg)
Conditional Random Fields:: Distribution
Label sequence modelled as a normalized product of feature functions:
The model is log-linear on the Feature Functions
![Page 11: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/11.jpg)
Parameter Estimation:Maximum Likelihood
(negative) Conditional Log-Likelihood:
IID training samples:
![Page 12: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/12.jpg)
Parameter Estimation: Maximum Likelihood
Maximum Likelihood Estimation
Set optimal parameters to be:
This function is convex, i.e. no local minimums
![Page 13: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/13.jpg)
Parameter Estimation:Optimization
Differentiating the log-likelihood with respect to parameter
Let:
Observed Mean Feature Value
Expected Feature Value Under The Model
![Page 14: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/14.jpg)
Parameter Estimation: Optimization
Generally, it is not possible to find and analytic solution to the previous objective.
Iterative techniques, i.e. gradient based methods.
![Page 15: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/15.jpg)
Maximum Entropy Interpretation
Notice that at the optimal solution of:
Maximizing log-likelihood Finding max-entropy distribution that
satisfies the set of constraints defined by the feature functions
We must have that:
![Page 16: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/16.jpg)
CRF’s Inference
Given a model, i.e. parameter values
Can we compute the following efficiently?
Best Label Sequence
Expected Values
Both can be computed using dynamic programming.
![Page 17: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/17.jpg)
RoadMap
Sequence Prediction Problem
CRFs for Sequence Prediction
Generalizations of CRFs
Hidden Conditional Random Fields (HCRFs)
HCRFs for Object Recognition
![Page 18: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/18.jpg)
Generalization I: CRFs Beyond Sequences
Predicting Trees: Application Constituent Parsing
S
NP VP
PP
NP
D N V P D N
The boy smiled at the girl
![Page 19: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/19.jpg)
Generalization II: Factorized Linear Models
To predict a sequence compute:
Linear Model
Objective: making accurate predictions on unseen data
The parameters of the linear model can be optimized using other loss functions
![Page 20: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/20.jpg)
Generalization II: Factorized Linear Models Structured Hinge Loss
Let be the correct label sequence:
Structured SVM
![Page 21: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/21.jpg)
RoadMap
Sequence Prediction Problem
CRFs for Sequence Prediction
Generalizations of CRFs
Hidden Conditional Random Fields (HCRFs)
HCRFs for Object Recognition
![Page 22: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/22.jpg)
Hidden Conditional Random Fields
This movie greatly appealed to me for many reasons - I loved it
+1 Positive Review
As dumb as history gets
-1 Negative Review
Sentiment Detection
![Page 23: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/23.jpg)
Hidden Conditional Random Fields Object Recognition
+1 Car
A training sample
![Page 24: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/24.jpg)
Hidden Conditional Random Fields
Model the conditional probability:
We introduce hidden variables:
Analogus to the standard CRF we define:
Maps a configuration to the reals.
![Page 25: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/25.jpg)
Hidden Conditional Random Fields Feature Functions
![Page 26: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/26.jpg)
Parameter Estimation
Maximum Likelihood:
Find optimal parameters:
Iterative techniques, i.e. gradient based methods. But now the function is not convex!!!
At test time make prediction:
![Page 27: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/27.jpg)
Parameter Estimation
The derivative of the loss function
is given by:
The derivative can be expressed in terms of components:
that can be calculated using dynamic programming. Similarly the argmax can also be computed efficiently.
![Page 28: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/28.jpg)
RoadMap
Sequence Prediction Problem
CRFs for Sequence Prediction
Generalizations of CRFs
Hidden Conditional Random Fields (HCRFs)
HCRFs for Object Recognition
![Page 29: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/29.jpg)
Application :: Object Recognition
SemiSupervised Part-based Models
![Page 30: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/30.jpg)
Motivation
Use a discriminative model. Spatial dependencies between parts. It is convenient to use an intermediate discrete hidden variable. Potential of learning semantically-meaningful parts. Framework for investigating which part structures emerge.
![Page 31: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/31.jpg)
Graph Structure
![Page 32: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/32.jpg)
is a minimum spanning tree. Weight (i, j)= distance between patches xi and xj
obtained with Lowe’s detector (textured regions) SIFT features (describes the texture of the image region). Patch description also includes relative location.
Feature Functions
![Page 33: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/33.jpg)
Viterbi Configuration
![Page 34: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/34.jpg)
Learning Shape
![Page 35: Tutorial on Conditional Random Fields for Sequence Predictionaquattoni/AllMyPapers/crf_tutorial_talk.pdf · CRFs for Sequence Prediction ... Conditional Random Fields are an instance](https://reader030.vdocuments.us/reader030/viewer/2022040402/5e81cec3be700511e177041a/html5/thumbnails/35.jpg)
Conclusions
Factorized Linear Models generalize linear prediction models to the setting of structure prediction.
Conditional Random Fields are an instance of this framework
In standard linear prediction, finding the argmax and computing gradients is trivial. In structure prediction it involves inference.
Factored representations allow for efficient inference algorithms (most times based on dynamic programming)
Better Algorithms for training HCRFs
Future Work