Multi-class classification with BPMs

A Bayes Point Machine (BPM) is a linear classifier that can be used for multi-class classification.  Image classifier is an example application of Bayes Point Machine for binary classification.
In a multi-class setting for classification, every class has an associated weight vector with a standard VectorGaussian priors. The label for a data point is defined by the arg-max of its score under each class. Score is defined as the inner product between the  features of the data point and the weight vector plus some added noise. The factor graph corresponding to Bayes Point machine is shown in the figure below

Infer.NET provides an example Visual Studio solution for various flavours of Bayes Point machine for use as multi-class classifiers. This solution can be found in the Samples\C#\BayesPointMachine folder. Infer.NET does not have a built-in Arg-max factor, so we mimic this factor by constraining that the score corresponding to the assigned class should be pairwise greater than score under any other class. Another approach (not part of the current example) is to use a SoftMax factor (in this case, the noise terms should not be used as the SoftMax has an inbuilt smearing effect).

There are some practical considerations when using the BPM example implementation:

  1. Make sure that you normalize your data so that it is typically in the range -1 to 1 or 0 to 1. If you have very disparate scaling across your inputs, the default weight priors will not be realistic
  2. Add a constant input to your data - i.e. add a feature that is always equal to 1. This will allow the BPM to learn a bias weight for each class.
See Infer.NET implementation descriptions for: Bayes Point machine | Bayes Point Machine Shared | Sparse Bayes Point Machine
©2009-2013 Microsoft Corporation. All rights reserved.  Terms of Use | Trademarks | Privacy Statement