**4. Classification**

SVM classifiers discriminants the hyperplanes to reach optimal classification. The hyperplanes should be adjusted to maximize the margin of classification boundaries. The distance from the nearest training points is measured using a non-linear kernel to map the problem from the feature space into the linear space [11]. Radial Basis

*Pain Identification in Electroencephalography Signal Using Fuzzy Inference System DOI: http://dx.doi.org/10.5772/intechopen.103753*

Function (RBF) kernel is proposed in this paper and the Lagrangian optimization of the kernel is performed using an ANFIS structure. This proposed method leads to adjustable soft-decision classification because of the conceptual nature of the pain for patients.

## **4.1 SVM with RBF kernel**

Training of the SVM is a quadratic optimization problem on the hyperplanes that are defined as:

$$\mathcal{Y}\_i\left(w\Phi\left(\mathbf{x}\_i,\mathbf{y}\_j\right) + b\right) \ge \mathbf{1} - \xi\_i, \ \xi\_i \ge 0, \ i = 1, \ldots, l, \ j = 1, \ldots, m \tag{6}$$

that *xi* is the feature vector, *b* is the bias, *w* is the weight vector, ξ*<sup>i</sup>* is class separation factor, Φ *xi*, *yj* is the RBF mapping kernel, *<sup>l</sup>* is the number of training vectors, *j* is the number of output vectors, and *yj* is the desired output vector. The

**Figure 1.** *Block diagram of RBF-SVM classification system.*

weight parameter should be optimized to maximize the margin between the hyperplane and the neighboring points in the feature space. This is a compromise between the maximization of margin and the number of misclassified points. Optimization of Eq. (6) results to optimum weight *w*.

**Figure 1** shows the RBF kernel SVM classification system. The kernel parameters could be selected by optimizing the upper bound of the generalization error based on the training data. The support vector fractions and the relation between the number of support vectors and all the training samples define an upper bound on the error estimate. The resulting decision function can only change when support vectors are excluded. A low fraction of support vectors could be used as a criterion for the parameter selection.

### **4.2 Adjustable ANFIS optimization**

An ANFIS is used with for optimization of the SVM classification kernels. The optimization process would be less reliant on expert knowledge compared to the conventional fuzzy systems using this adaptive method. The result of the learning algorithm for this architecture is to adjust all the parameters of the kernel to adjust the hyperplanes for optimized output. Since the initial parameters are not fixed, the search space becomes larger, and the convergence of the training becomes slower. The training method is using a combining of the least squares and the gradient descent method is used to train the network. The hybrid algorithm is composed of forward and backward pass. The least squares method on the forward pass is used to optimize the consequent parameters with the fixed premise parameters. The backward pass is using the gradient descent method afterward to optimize the consequent parameters and to adjust the premise parameters corresponding to the fuzzy sets in the input domain. The output of the ANFIS network is achieved by defuzzification of the consequent parameters in the forward pass. The output error is used to adjust the premise parameters using a standard back propagation algorithm.
