# Rail Diagnostics Based on Ultrasonic Guided Waves: An Overview
## 7 Land-Based Systems Implementation-Evolution: Early Rail Defect Detection Capability
### Defect Detection  
The processing steps accomplished in defect detection are summarized in Figure 18. Because of the EOCs-induced variations in the propagation conditions of UGW signals, the simple baseline subtraction is not effective [PERSON] et al. (2018). Some promising results in structural health monitoring of plates and pipes have been obtained by means of two unsupervised machine learning techniques, namely _singular value decomposition_ (SVD) [PERSON] (1996) and _independent component analysis_ (ICA) [PERSON] (1996). These techniques outperform baseline subtraction in the detection of simulated defect signatures superimposed on measured data from a pipe subject to time varying EOCs [PERSON] (1996). Therefore, it makes sense to apply these techniques to rails too. Ideally, if EOCs are perfectly compensated for, the signal obtained from pre-processing can be seen as the additive contribution of two or more distinct components: (a) one resembling the baseline ultrasonic signal containing weld reflections, with a constant weight over the duration of the experiment; (b) other components resembling the ultrasonic signature of the defect, with a weight increasing over time and corresponding to the deterioration of the defect [PERSON] et al. (2018). Data-Driven Defect Detection Techniques  
The pre-processed measurements are stored in the \(\mathbf{m}\times\mathbf{n}\) matrix \(\mathbf{X}\); here, \(\mathbf{m}\) represents the overall number of performed measurements over the monitoring time, whereas \(\mathbf{n}\) is the number of samples acquired in each measurement. The matrix \(\mathbf{X}\) can be factored as  
\[\mathbf{X}=\mathbf{AC}. \tag{10}\]  
The matrix \(\mathbf{C}\) contains the additive components of the acquired signal (baseline and defect signatures) in the distance domain, whereas the matrix \(\mathbf{A}\) is the corresponding weights in the observation interval. The _singular value decomposition_ (SVD) technique can be exploited to evaluate the factorization expressed by Equation (10) [74]. In fact, applying this technique to the real data matrix \(\mathbf{X}\) produces  
\[\mathbf{X}=\mathbf{USV^{T}}, \tag{11}\]  
where \(\mathbf{U}\) and \(\mathbf{V}\) are the left and right _singular vector matrices_, respectively, and \(\mathbf{S}\) is the diagonal _singular value matrix_. The columns of the matrix \(\mathbf{U}\) are related to the slow signal behavior evolution over the monitoring period, while the columns of the matrix \(\mathbf{V}\) are related to the fast signal behavior evolution over the same observation interval. \(\mathbf{S}\) allows for quantifying the amount of information contained in the associated left and right singular vectors. In fact, the main diagonal of \(\mathbf{S}\) collects the singular values, sorted in descending order. The size of the given dataset can be reduced by discarding small singular vectors, since these convey a negligible amount of information. The _independent component analysis_ (ICA) technique is employed to extract the additive components of a multivariable signal and analyze their relative trends. More specifically, this technique allows for decomposing the matrix \(\mathbf{X}\) into a given number of independent components forming the columns of the matrix \(\mathbf{C}\) in Equation (10); such components have minimal statistical correlation. In addition, the matrix \(\mathbf{A}\) contains the weights of the independent components. In our case, the ICA method can be used to separate the contributions of different sources. In fact, we are interested in separating the contribution of the defect signatures from the system background, including the baseline signal and EOC-related variations. To efficiently implement ICA, the iterative FastICA algorithm can be used. This algorithm is fed by a normalized version of the data set \(\mathbf{X}\), and computes the principal values and associated components of the input data by calculating the eigenvalues and eigenvectors, respectively, of the covariance matrix \(\mathbf{XX^{T}}\).