# 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)
Replacing Equations (12) and (13) into Equation (11), the minimization problem is uniquely expressed in terms of \(\alpha_{i},\mathbf{x}_{i}\) and \(t_{i}\):  
\[\min_{\alpha_{i}}\left[\frac{1}{2}\left(\sum_{i=1}^{N}\alpha_{i}t_{i}\mathbf{ x}_{i}\right)^{\top}\left(\sum_{i=1}^{N}\alpha_{i}t_{i}\mathbf{x}_{i}\right)- \sum_{i=1}^{N}\alpha_{i}t_{i}\left(\sum_{j=1}^{N}\alpha_{j}t_{j}\mathbf{x}_{i} \right)^{\top}\mathbf{x}_{i}-b\sum_{i=1}^{N}\alpha_{i}t_{i}+\sum_{i=1}^{N} \alpha_{i}\right]. \tag{14}\]  
After some simple manipulations, Equation (14) is now expressed as:  
\[\min_{\alpha_{i}}\left[\sum_{i=1}^{N}\alpha_{i}-\frac{1}{2}\sum_{i=1}^{N}\sum _{j=1}^{N}\alpha_{i}\alpha_{j}t_{i}t_{j}\mathbf{x}_{i}^{\top}\mathbf{x}_{j}\right] \tag{15}\]  
As it can be clearly seen, the optimization problem depends only on the dot product of pairs of training data. However, frequently the data are not linearly separable. Therefore, the margin constraint cannot be satisfied for any \(\omega\) and \(b\). One possible solution is to allow some data points to violate the margin constraints (soft margin), but it is needed to assign them a cost. In this case, a penalty parameter \(C\) (box constraint) has to be considered to control the maximum penalty imposed on margin-violating  
\[\omega^{\top}\mathbf{x}_{\text{red}}^{\text{sv}}+b =1,\]0 (**a**) There are two classes (blue and red), which are separated by three hyperplanes (in this case lines) out of many possible; (**b**) optimal hyperplane that maximizes the margin between classes. observations, as well as slack variables \(\varepsilon_{i}\) that controls the width of the margin. For the case of a linear kernel, dealing with a nonlinearly separable case can be generalized as:  
\[\min_{\omega,b,\varepsilon_{i}}\left[\frac{1}{2}\|\omega\|^{2}+C\sum_{i=1}^{N} \varepsilon_{i}\right]\quad\text{subject to}\quad\left\{ \begin{array}{l}h( \mathbf{x}_{i})t_{i}\geq 1-\varepsilon_{i},\;i=1,\ldots,N;\\ \varepsilon_{i}\geq 0,i=1,\ldots,N.\end{array} \right. \tag{16}\]  
The constrained minimization problem in Equation (16) can be rewritten, using Lagrange multipliers, as:  
\[\min_{\alpha_{i}}\left[\sum_{i=1}^{N}\alpha_{i}-\frac{1}{2}\sum_{i=1}^{N}\sum _{j=1}^{N}\alpha_{i}\alpha_{j}t_{i}t_{j}\mathbf{x}_{i}^{\top}\mathbf{x}_{j} \right]\quad\text{subject to}\quad\left\{ \begin{array}{l}\sum_{i=1}^{N} \alpha_{i}t_{i}=0;\\ 0\leq\alpha_{i}\leq C,\;i=1,\ldots,N.\end{array} \right. \tag{17}\]  
In many cases, even with a soft margin, the space is not linearly separable. In these cases, a transformation \(\phi\) is used to transform the original training data to another space. As it was mentioned before, the optimization depends only in dot products. Therefore, the transformation \(\phi\) is not needed. Instead, only the dot product  
\[K(\mathbf{x}_{i},\mathbf{x}_{j})=\phi(\mathbf{x}_{i})\phi(\mathbf{x}_{j})\]  
is needed, renamed as the kernel function. In this work, we will used two kernel functions, quadratic kernel \(K_{\text{q}}\) and Gaussian kernel \(K_{\text{G}}\), defined as:  
\[K_{\text{q}}(\mathbf{x}_{i},\mathbf{x}_{j}) =\left(1+\frac{1}{\gamma^{2}}\mathbf{x}_{i}^{\top}\mathbf{x}_{j} \right),\] \[K_{\text{G}}(\mathbf{x}_{i},\mathbf{x}_{j}) =\exp\left(-\frac{\|\mathbf{x}_{i}-\mathbf{x}_{j}\|^{2}}{\gamma ^{2}}\right),\]  
where \(\gamma\) is the so-called kernel scale.