Training stage: training samples containing labelled positive and negative input data to the SVM. This input data can consist of distance to border vectors, binary images, Zernike moments, and more. Each input data is represented by vector with label , l is the number of samples. The decision boundary should classify all points correctly, thus . The decision boundary can be found by solving the following constrained optimization problem: . The Lagrangian of this optimization problem is: . The optimization problem can be rewritten in terms of by setting the derivative of the Lagrangian to zero: This quadratic programming problem is solver when: with are support vectors. This is for a linear separable problem, for more details about the non-linear problem see Appendix .
Testing stage: the resulting classifier is applied to unlabeled images to decide whether they belong to the positive or the negative category. The label of is simply obtained by computing: with the indices of the s support vectors. Classify