evaluate_class_gmm — Evaluate a feature vector by a Gaussian Mixture Model.
evaluate_class_gmm computes three different probability values for a feature vector Features with the Gaussian Mixture Model (GMM) GMMHandle.
The a-posteriori probability of class i for the sample Features is computed as
n_comp ---- \ p(i|x) = / P(j) p(x|j) ---- j=1
and returned for each class in ClassProb. The formulas for the calculation of the center density function p(x|j) are described with create_class_gmm.
The probability density of the feature vector is computed as a sum of the posterior class probabilities
n_classes ---- \ p(x) = / Pr(i) p(i|x) ---- i=1
and is returned in Density. Here, Pr(i) are the prior classes probabilities as computed by train_class_gmm. Density can be used for novelty detection, i.e., to reject feature vectors that do not belong to any of the trained classes. However, since Density depends on the scaling of the feature vectors and since Density is a probability density, and consequently does not need to lie between 0 and 1, the novelty detection can typically be performed more easily with KSigmaProb (see below).
A k-sigma error ellipsoid is defined as a locus of points for which
( x - m )^T C^(-1) ( x - m ) = k^2
In the one dimensional case this is the interval [mu-k*sigma, mu+k*sigma]. For any 1D Gaussian distribution, it is true that approximately 65% of the occurrences of the random variable are within this range for k=1, approximately 95% for k=2, approximately 99% for k=3, etc. Hence, the probability that a Gaussian distribution will generate a random variable outside this range is approximately 35%, 5%, and 1%, respectively. This probability is called k-sigma probability and is denoted by P[k]. P[k] can be computed numerically for univariate as well as for multivariate Gaussian distributions, where it should be noted that for the same values of k, P^(N)[k] > P^(N+1)[k] (here N and (N+1) denote dimensions). For Gaussian mixture models the k-sigma probability is computed as:
n_comp ---- \ P_gmm[x] = / P(j)P_j[k_j], ---- j=1 where k_j^2 = ( x - m_j )^T C_j^(-1) ( x - m_j )
They then are weighted with the class priors, normalized, and returned for each class in KSigmaProb, such that
Pr(i) KSigmaProb[i] = ------ * P_gmm[x] Pr_max
KSigmaProb can be used for novelty detection. Typically, feature vectors having values below 0.0001 should be rejected. The parameter RejectionThreshold in classify_image_class_gmm is based on the KSigmaProb values of the features.
Before calling evaluate_class_gmm, the GMM must be trained with train_class_gmm.
The position of the maximum value of ClassProb is usually interpreted as the class of the feature vector and the corresponding value as the probability of the class. In this case, classify_class_gmm should be used instead of evaluate_class_gmm, because classify_class_gmm directly returns the class and corresponding probability.
A-posteriori probability of the classes.
Probability density of the feature vector.
Normalized k-sigma-probability for the feature vector.
If the parameters are valid, the operator evaluate_class_gmm returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.
Christopher M. Bishop: “Neural Networks for Pattern Recognition”;
Oxford University Press, Oxford; 1995.
Mario A.T. Figueiredo: “Unsupervised Learning of Finite Mixture Models”; IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 24, No. 3; March 2002.