# Damage Diagnosis for Offshore Wind Turbine Foundations Based on the Fractal Dimension
## 3 Damage Diagnose Strategy
### Normalization and Classification Tools
#### 3.3.2 Support Vector Machines (SVM)  
SVM is a supervised machine learning algorithm that is used for classification purposes and it has been applied to a large variety of applications [39]. SVM are based on the simple idea of finding the hyperplane (or the decision boundary) that best divides the data into two classes. Figure 4a shows the illustration of three separating hyperplanes out of many possible. The goal is to choose a hyperplane with the widest margin to separate both classes, see Figure 4b. In this context, the margin is defined as the smallest distance between any of the samples and the hyperplane. The data points closest to the separating hyperplane are called the support vectors. These points will determine how wide the margin is. Let us consider a two-classes example, a training data set \(\mathbf{x}_{1},\ldots,\mathbf{x}_{N},\ N\in\mathbb{N}\) with corresponding binary target values \(\{t_{1},\ldots,t_{N}\}\subset\{-1,1\}\), where one class is labeled as _red_ (corresponding to a positive target value 1) and the other one as _blue_ (corresponding to a negative target value \(-1\)). Commonly, the hyperplane is expressed in the following form:  
\[h(\mathbf{x})=\omega^{\top}\mathbf{x}+b\]  
where \(\omega\) is the weight vector and \(b\) is the bias term. The canonical hyperplane is used in this paper, among all the possible descriptions. The canonical hyperplane satisfies:  
\[\omega^{\top}\mathbf{x}_{\text{red}}^{\text{sv}}+b =1,\] \[\omega^{\top}\mathbf{x}_{\text{blue}}^{\text{sv}}+b =-1,\]  
where \(\mathbf{x}_{\text{red}}^{\text{sv}}\) and \(\mathbf{x}_{\text{blue}}^{\text{sv}}\) represent the so-called support vectors (the closest samples with respect to the hyperplane) on the red and blue classes, respectively. The distance \(\delta\) from the support vectors to the hyperplane is given by:  
\[\delta\left(\mathbf{x}_{\text{\{red,blue\}}}^{\text{sv}},h\right)=\frac{ \left|\omega^{\top}\mathbf{x}_{\text{\{red,blue\}}}^{\text{sv}}+b\right|}{ \left\|\omega\right\|}=\frac{1}{\left\|\omega\right\|}.\]  
Since the margin is twice the distance from the support vectors to the hyperplane, the margin will be \(\frac{2}{\left\|\omega\right\|}\). As it has been said, the goal is to maximize the margin \(\frac{2}{\left\|\omega\right\|}\), which is equivalent to minimizing the inverse function \(\frac{\left\|\omega\right\|}{2}\). This is also equivalent to minimizing  
\[\min_{\omega,b}\frac{1}{2}\left\|\omega\right\|^{2}\qquad\text{ subject to}\qquad h(\mathbf{x}_{i})t_{i}\geq 1,\ i=1,\ldots,N.\]In order to find the extreme values of a function with multiple constraints, one possible approach is to use the Lagrange multipliers. With this approach, the previous minimization problem is re-expressed as:  
\[\min_{\omega,b,\alpha_{i}}\mathcal{L}(\omega,b;\alpha_{i})=\min_{\omega,b,\alpha _{i}}\frac{1}{2}\|\omega\|^{2}-\sum_{i=1}^{N}\alpha_{i}\left[(\omega^{\top} \mathbf{x}_{i}+b)t_{i}-1\right] \tag{11}\]  
where \(\alpha_{i},\ i=1,\ldots,N\) are the Lagrange multipliers. To find the extreme values, the partial derivatives with respect to \(\omega\) and \(b\) are computed and equated to zero:  
\[\frac{\partial\mathcal{L}(\omega,b;\alpha_{i})}{\partial\omega} =\omega-\sum_{i=1}^{N}\alpha_{i}t_{i}\mathbf{x}_{i}=0\Rightarrow \omega=\sum_{i=1}^{N}\alpha_{i}t_{i}\mathbf{x}_{i} \tag{12}\] \[\frac{\partial\mathcal{L}(\omega,b;\alpha_{i})}{\partial b} =-\sum_{i=1}^{N}\alpha_{i}t_{i}=0 \tag{13}\]  
Equation (12) shows that the weight vector \(\omega\) is a linear combination of the training data set.