Conditional/Discriminative Random Fields (CRF)
Conditional/Discriminative Random Fields (CRF)
- a type of probabilistic graphical model
- is a type of discriminative model
- used for capturing/estimating the conditional distribution 𝐏(𝒀=𝒚|𝑿=𝒙) # no need to model the correlation between variables in 𝑿, only focusing on target variables 𝒀. This allows models with highly expressive features without worrying about wrong independencies
- parameterized the same as Gibbs Distribution, but normalized differently
a special case of a Markov Random Field (MRF) where the factor/clique potentials are CONDITIONED on input 𝑿=𝒙
a generalization of Logistic Regression Model to have structured outputs, like chains, trees, or grids
CRF - Formula
formulas 𝜙𝑗(𝒚, 𝒙) = 𝑒𝜃𝑗·𝑓𝑗(𝒚, 𝒙)
𝐏(𝒀=𝒚|𝑿=𝒙) = 𝛱0≤𝑗≤𝑘[ 𝜙𝑗(𝒚, 𝒙) ] / 𝑍(𝒙)
- 𝐏(𝒀=𝒚|𝑿=𝒙) = 𝛱0≤𝑗≤𝑘[ 𝑒𝜃𝑗·𝑓𝑗(𝒚, 𝒙) ] / 𝑍(𝒙)
- 𝐏(𝒀=𝒚|𝑿=𝒙) = 𝑒𝛴0≤𝑗≤𝑘[ 𝜃𝑗·𝑓𝑗(𝒚, 𝒙) ] / 𝑍(𝒙)
where:
- 𝑍(𝑿=𝒙) = 𝛴𝑦1∊𝑌1 ... 𝛴𝑦𝑘∊𝑌𝐾 [ 𝛱0≤𝑗≤𝑘 [ 𝜙𝑗(𝑦1, ..., 𝑦𝐾, 𝒙) ] ]
- 𝑍(𝑿=𝒙) = 𝛴𝑦1∊𝑌1 ... 𝛴𝑦𝐾∊𝑌𝐾 [ 𝛱0≤𝑗≤𝑘[ 𝑒𝜃𝑗·𝑓𝑗(𝑦1, ..., 𝑦𝐾, 𝒙) ] ]
- 𝑍(𝑿=𝒙) = 𝛴𝑦1∊𝑌1 ... 𝛴𝑦𝐾∊𝑌𝐾 [ 𝑒𝛴0≤𝑗≤𝑘[ 𝜃𝑗·𝑓𝑗(𝑦1, ..., 𝑦𝐾, 𝒙) ]]
𝑿 = {𝑋1, ..., 𝑋𝐽} | 𝒀 = {𝑌1 , ..., 𝑌𝐾} | |
Description | source/input/observed variables | target/output/hidden variables |
Example 1 | pixel values and processed features | class for every pixel |
Example 2 | words in a sentence | labels for every word |
(𝒀,𝑿) is a CRF when each of the random variables 𝑌𝑖, conditioned on 𝑿, obeys the Markov Property with respect to the graph. Thus, a CRF is a Random Field globally conditioned on the observation 𝑿. Where the hidden variables 𝒀 are globally conditioned on the observed variables 𝑿
CRF - Graphical Model
CRF - Variants
Generic CRF | ||
---|---|---|
simple CRF where hidden variables are aligned in chains | graph of arbitrary structure as long as it represents the label sequences being modeled | |
|
|
|
CRF - Example Use
conditional-random-field-log-linear-model-example.drawio
CRF - Comparisons
- Conditional Random Field (CRF) vs Markov Random Field (MRF)
- Conditional Random Field (CRF) vs Logistic Regression Model
- Conditional Random Field (CRF) vs Linear Chain CRF
CRF - Resources
, multiple selections available,