# Algorithm Development for the Non-Destructive Testing of Structural Damage
## 2 Damage Detection Using a Machine Learning Approach  
### Support Vector Machine  
Support vector machine (SVM) is a discriminative classifier which was proposed in 1995 by [PERSON], to analyze data for classification and regression purposes [28]. SVM provides the optimal hyperplane by separating two classes with the maximum margin from the hyperplane. Assume an SVM binary classification with N samples in the data training set \(\left(\mathrm{x}_{1},\mathrm{y}_{1}\right),\ldots,\left(\mathrm{x}_{i}, \mathrm{y}_{i}\right),\ldots,\left(\mathrm{x}_{N},\mathrm{y}_{N}\right)\in \mathrm{R}_{n}\times\left\{\pm 1\right\}\), where \(\mathrm{x}_{i}\) is a feature vector and \(\mathrm{y}_{i}\) is the label of its class. The hyperplane is mathematically defined as the pair (w, b) in the form: \(\mathrm{w^{T}x+b=0}\), where w is a weight vector and b is the bias. The hyperplane should meet the following condition as described in Equation (1), when linearly separating the training data [29]:  
\[\mathrm{y_{i}(w\times x_{i}+b)\geq 1,\ \ \ i=1,\ldots,N} \tag{1}\]  
The distance between the hyperplane and each of the training data \(\mathrm{x_{i}}\) is defined through Equation (2) as [29]:  
\[\mathrm{d_{i}=\frac{w\times x_{i}+b}{\|w\|}} \tag{2}\]  
By considering both Equations (1) and (2), the following result is obtained for all \(\mathrm{x_{i}}\) as [29]:  
\[\mathrm{y_{i}d_{i}\geq\frac{1}{\|w\|}} \tag{3}\]  
where \(\frac{1}{\|w\|}\) is considered as the lower distance bound between the hyperplane and the training data \(\mathrm{x_{i}}\). The maximum margin of the hyperplane is obtained through the minimization of Equation (4):  
\[\mathrm{z=\frac{1}{2}w\times w} \tag{4}\]  
Therefore, the final decision function is given as [30]:  
\[\mathrm{f(x)=sign}\left(\sum_{\alpha_{i}>0}\mathrm{y_{i}\alpha_{i}<x,x_{i}>+b}\right) \tag{5}\]  
where \((\alpha_{1},\ \alpha_{2},\ldots,\alpha_{N})\) represents the non-negative Lagrange multipliers related to the constraints (see Equation (1)). However, most of these \(\alpha\) are usually zero, leading to the small proportion of the training data \(\mathrm{x}\) being considered as vector w. Since these points are considered as the closest points to the hyperplane, they are named the Support Vectors (SV). SVs are the training patterns that fall on the margin boundaries. In general, a small portion of the training sample SVs are used by SVM for the purpose of classification. However, if the SVs consist of the training data beyond the corresponding margins, they are referred to as misclassified data [31; 32; 33]. If the linear separation of data is not feasible, then the hyperplane is pointless. Therefore, N non-negative \((\mathrm{\xi_{i},\ i=1,\ldots,N})\) variables are considered, such that:  
\[\mathrm{y_{i}(w\times x_{i}+b)\geq 1-\mathrm{\xi_{i}}} \tag{6}\]  
This variable, \(\mathrm{\xi_{i}}\), will include a very small quantity of misclassified points, and this will be zero if the Equation (1) condition is met; otherwise the term \(-\mathrm{\xi}\), will be added to Equation (1), and this generates Equation (6). However, the tolerance parameter may also cause the ignorance of some training data in order to make the linear hyperplane. Then, the generalized separation hyperplane is expressed by minimizing Equation (7):  
\[\mathrm{z=\frac{1}{2}w\times w+c\sum_{i=1}^{N}\mathrm{\xi_{i}}} \tag{7}\]  
The expression \(c\sum_{i=1}^{N}\mathrm{\xi_{i}}\) will supervise the number of misclassified points. For smaller values of c, the above solution maximizes the minimum distance of 1/w, and for large values of c, it minimizes the number of misclassified data. It is noted that the use of misclassified data can help to enhance the performance of classifiers.