Discriminative model

From HandWiki

Discriminative models, also referred to as conditional models, are a class of logistical models used for classification or regression. They distinguish decision boundaries through observed data, such as pass/fail, win/lose, alive/dead or healthy/sick. Typical discriminative models include logistic regression (LR), conditional random fields (CRFs) (specified over an undirected graph), decision trees, and many others. Typical generative model approaches include naive Bayes classifiers, Gaussian mixture models, variational autoencoders, generative adversarial networks and others.

Definition

Unlike generative modelling, which studies the joint probability [math]\displaystyle{ P(x,y) }[/math], discriminative modeling studies the [math]\displaystyle{ P(y|x) }[/math] or maps the given unobserved variable (target) [math]\displaystyle{ x }[/math] to a class label [math]\displaystyle{ y }[/math] dependent on the observed variables (training samples). For example, in object recognition, [math]\displaystyle{ x }[/math] is likely to be a vector of raw pixels (or features extracted from the raw pixels of the image). Within a probabilistic framework, this is done by modeling the conditional probability distribution [math]\displaystyle{ P(y|x) }[/math], which can be used for predicting [math]\displaystyle{ y }[/math] from [math]\displaystyle{ x }[/math]. Note that there is still distinction between the conditional model and the discriminative model, though more often they are simply categorised as discriminative model.

Pure discriminative model vs. conditional model

A conditional model models the conditional probability distribution, while the traditional discriminative model aims to optimize on mapping the input around the most similar trained samples.[1]

Typical discriminative modelling approaches

The following approach is based on the assumption that it is given the training data-set [math]\displaystyle{ D=\{(x_i;y_i)|i\leq N\in \mathbb{Z}\} }[/math], where [math]\displaystyle{ y_i }[/math]is the corresponding output for the input [math]\displaystyle{ x_i }[/math].[2]

Linear classifier

We intend to use the function [math]\displaystyle{ f(x) }[/math]to simulate the behavior of what we observed from the training data-set by the linear classifier method. Using the joint feature vector [math]\displaystyle{ \phi(x,y) }[/math], the decision function is defined as:

[math]\displaystyle{ f(x;w)=\arg \max_y w^T \phi(x,y) }[/math]

According to Memisevic's interpretation,[2] [math]\displaystyle{ w^T \phi(x,y) }[/math], which is also [math]\displaystyle{ c(x,y;w) }[/math], computes a score which measures the compatibility of the input [math]\displaystyle{ x }[/math] with the potential output [math]\displaystyle{ y }[/math]. Then the [math]\displaystyle{ \arg \max }[/math] determines the class with the highest score.

Logistic regression (LR)

Since the 0-1 loss function is a commonly used one in the decision theory, the conditional probability distribution [math]\displaystyle{ P(y|x;w) }[/math], where [math]\displaystyle{ w }[/math] is a parameter vector for optimizing the training data, could be reconsidered as following for the logistics regression model:

[math]\displaystyle{ P(y|x;w)= \frac{1}{Z(x;w)} \exp(w^T\phi(x,y)) }[/math], with
[math]\displaystyle{ Z(x;w)= \textstyle \sum_{y} \displaystyle\exp(w^T\phi(x,y)) }[/math]

The equation above represents logistic regression. Notice that a major distinction between models is their way of introducing posterior probability. Posterior probability is inferred from the parametric model. We then can maximize the parameter by following equation:

[math]\displaystyle{ L(w)=\textstyle \sum_{i} \displaystyle \log p(y^i|x^i;w) }[/math]

It could also be replaced by the log-loss equation below:

[math]\displaystyle{ l^{\log} (x^i, y^i,c(x^i;w)) = -\log p(y^i|x^i;w) = \log Z(x^i;w)-w^T\phi(x^i,y^i) }[/math]

Since the log-loss is differentiable, a gradient-based method can be used to optimize the model. A global optimum is guaranteed because the objective function is convex. The gradient of log likelihood is represented by:

[math]\displaystyle{ \frac{\partial L(w)}{\partial w} = \textstyle \sum_{i} \displaystyle \phi(x^i,y^i) - E_{p(y|x^i;w)} \phi(x^i,y) }[/math]

where [math]\displaystyle{ E_{p(y|x^i;w)} }[/math]is the expectation of [math]\displaystyle{ p(y|x^i;w) }[/math].

The above method will provide efficient computation for the relative small number of classification.

Contrast with generative model

Contrast in approaches

Let's say we are given the [math]\displaystyle{ m }[/math] class labels (classification) and [math]\displaystyle{ n }[/math] feature variables, [math]\displaystyle{ Y:\{y_1, y_2,\ldots,y_m\}, X:\{x_1,x_2,\ldots,x_n \} }[/math], as the training samples.

A generative model takes the joint probability [math]\displaystyle{ P(x,y) }[/math], where [math]\displaystyle{ x }[/math] is the input and [math]\displaystyle{ y }[/math] is the label, and predicts the most possible known label [math]\displaystyle{ \widetilde{y}\in Y }[/math] for the unknown variable [math]\displaystyle{ \widetilde{x} }[/math] using Bayes' theorem.[3]

Discriminative models, as opposed to generative models, do not allow one to generate samples from the joint distribution of observed and target variables. However, for tasks such as classification and regression that do not require the joint distribution, discriminative models can yield superior performance (in part because they have fewer variables to compute).[4][5][3] On the other hand, generative models are typically more flexible than discriminative models in expressing dependencies in complex learning tasks. In addition, most discriminative models are inherently supervised and cannot easily support unsupervised learning. Application-specific details ultimately dictate the suitability of selecting a discriminative versus generative model.

Discriminative models and generative models also differ in introducing the posterior possibility.[6] To maintain the least expected loss, the minimization of result's misclassification should be acquired. In the discriminative model, the posterior probabilities, [math]\displaystyle{ P(y|x) }[/math], is inferred from a parametric model, where the parameters come from the training data. Points of estimation of the parameters are obtained from the maximization of likelihood or distribution computation over the parameters. On the other hand, considering that the generative models focus on the joint probability, the class posterior possibility [math]\displaystyle{ P(k) }[/math] is considered in Bayes' theorem, which is

[math]\displaystyle{ P(y|x) = \frac{p(x|y)p(y)}{\textstyle \sum_{i}p(x|i)p(i) \displaystyle}=\frac{p(x|y)p(y)}{p(x)} }[/math].[6]

Advantages and disadvantages in application

In the repeated experiments, logistic regression and naive Bayes are applied here for different models on binary classification task, discriminative learning results in lower asymptotic errors, while generative one results in higher asymptotic errors faster.[3] However, in Ulusoy and Bishop's joint work, Comparison of Generative and Discriminative Techniques for Object Detection and Classification, they state that the above statement is true only when the model is the appropriate one for data (i.e.the data distribution is correctly modeled by the generative model).

Advantages

Significant advantages of using discriminative modeling are:

  • Higher accuracy, which mostly leads to better learning result.
  • Allows simplification of the input and provides a direct approach to [math]\displaystyle{ P(y|x) }[/math]
  • Saves calculation resource
  • Generates lower asymptotic errors

Compared with the advantages of using generative modeling:

  • Takes all data into consideration, which could result in slower processing as a disadvantage
  • Requires fewer training samples
  • A flexible framework that could easily cooperate with other needs of the application

Disadvantages

  • Training method usually requires multiple numerical optimization techniques[1]
  • Similarly by the definition, the discriminative model will need the combination of multiple subtasks for solving a complex real-world problem[2]

Optimizations in applications

Since both advantages and disadvantages present on the two way of modeling, combining both approaches will be a good modeling in practice. For example, in Marras' article A Joint Discriminative Generative Model for Deformable Model Construction and Classification,[7] he and his coauthors apply the combination of two modelings on face classification of the models, and receive a higher accuracy than the traditional approach.

Similarly, Kelm[8] also proposed the combination of two modelings for pixel classification in his article Combining Generative and Discriminative Methods for Pixel Classification with Multi-Conditional Learning.

During the process of extracting the discriminative features prior to the clustering, Principal component analysis (PCA), though commonly used, is not a necessarily discriminative approach. In contrast, LDA is a discriminative one.[9] Linear discriminant analysis (LDA), provides an efficient way of eliminating the disadvantage we list above. As we know, the discriminative model needs a combination of multiple subtasks before classification, and LDA provides appropriate solution towards this problem by reducing dimension.

Types

Examples of discriminative models include:

See also

References

  1. 1.0 1.1 Ballesteros, Miguel. "Discriminative Models". http://demo.clab.cs.cmu.edu/fa2015-11711/images/e/e5/DiscriminativeModels.pdf. [yes|permanent dead link|dead link}}]
  2. 2.0 2.1 2.2 Memisevic, Roland (December 21, 2006). "An introduction to structured discriminative learning". http://www.cs.toronto.edu/~rfm/pubs/sdl.ps. 
  3. 3.0 3.1 3.2 Ng, Andrew Y.; Jordan, Michael I. (2001). On Discriminative vs. Generative classifiers: A comparison of logistic regression and naive Bayes. http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.19.9829. 
  4. Singla, Parag; Domingos, Pedro (2005). "Discriminative Training of Markov Logic Networks". Proceedings of the 20th National Conference on Artificial Intelligence - Volume 2. AAAI'05 (Pittsburgh, Pennsylvania: AAAI Press): 868–873. ISBN 978-1577352365. http://dl.acm.org/citation.cfm?id=1619410.1619472. 
  5. J. Lafferty, A. McCallum, and F. Pereira. Conditional Random Fields: Probabilistic Models for Segmenting and Labeling Sequence Data. In ICML, 2001.
  6. 6.0 6.1 Ulusoy, Ilkay (May 2016). "Comparison of Generative and Discriminative Techniques for Object Detection and Classification". https://www.microsoft.com/en-us/research/wp-content/uploads/2016/05/Bishop-Sicily-05.pdf. 
  7. Marras, Ioannis (2017). "A Joint Discriminative Generative Model for Deformable Model Construction and Classification". https://ibug.doc.ic.ac.uk/media/uploads/documents/pid4666647.pdf. 
  8. Kelm, B. Michael. "Combining Generative and Discriminative Methods for Pixel Classification with Multi-Conditional Learning". http://www.professeurs.polymtl.ca/christopher.pal/icpr06/icpr06_combining.pdf. 
  9. Wang, Zhangyang (2015). "A Joint Optimization Framework of Sparse Coding and Discriminative Clustering". https://www.ijcai.org/Proceedings/15/Papers/552.pdf.