Abstract
In order to improve the accuracy of rail crack identification, a new method based on path graph feature and support vector machine is proposed. This method uses graph signal processing and graph theory to transform the magnetic flux leakage signal of rail crack, calculates the “time domain” and “frequency domain” statistics of the path graph signal, and effectively identifies rail cracks with different defect parameters by SVM classifier. The measured data verify the effectiveness of this method, which shows that the method of identifying rail cracks by using path graph features has higher accuracy and stability. The innovation of this method is that it draws on the idea of transform domain features to extract the graph domain features that can best represent the MFL signal. Compared with the 31 features used by the traditional method, this method only needs 22 features to achieve better recognition results and has shorter training time. For the recognition rate of 18 kinds of cracks, the average recognition rate of this method is more than 83.51%, and the highest recognition rate is 95.34%. Therefore, this study provides a new way for magnetic leakage analysis and treatment of rail crack detection, has important practical value, and provides beneficial enlightenment for further research in related fields.
Introduction
As rail surface cracks are the initial stage defects that induce railhead transverse damage and railhead detachment, it is important to detect and identify rail surface cracks for the safe operation of high-speed railways.
Magnetic Flux Leakage (MFL) testing is widely used in rail crack detection due to its simple procedure and good sensitivity. Based on the detected MFL, it can infer parameters of the defects on the surface and near the surface of ferromagnetic materials. 1 The detection signal device is often used to identify rail cracks during the MFL testing. To make the testing more accurate, a good design of the device and signal processing are both crucial.
Most studies of rail crack detection rely on traditional MFL signal features, including time domain, frequency domain, and time-frequency domain analyses.2–4 However, such approaches are not satisfactory due to channel signal coupling, and the relationship between MFL signals and defect parameters are non-uniform mapping. Thus, new features are needed to further analyze rail crack signals.
Research suggests that there is a structural correspondence between the time-domain signals and the path graph signals: the sampling points of time-domain signals correspond to the vertices of the path graph signals; and the amplitudes of time-domain signals correspond to the graph signal. 5 Inspired by this, Gao et al. 6 established a structural correspondence between path graph signals and rolling bearing vibration signals. They extracted graph domain features to check the bearing failure and this method has a good performance. Based on the strategies proposed in Tian et al. 5 and Gao et al., 6 MFL signals of rail cracks, which are also time-domain signals, can be converted into path graph signals. By extracting features of path, cracks on a railway track can be detected. Araliya Mosleh’s team 7 has developed an unsupervised method for early damage detection, which involves acquiring data from sensors and utilizing the continuous wavelet transform (CWT) model for feature extraction. This approach incorporates data fusion and feature classification to enhance the sensitivity of wheel defects. Araliya Mosleh’s team 8 also proposed an unsupervised method to identify railway wheel flattening, based on the acceleration assessment on the track when traffic loads pass, and through machine learning methods and unsupervised feature classification to achieve automatic recognition of different severity of damage, while studying the impact of the number of sensors on system performance.
Theory of path graph
The idea behind the method of graph feature extraction is to covert time-domain MFL signals into a path graph signal model and use graph theory to extract signal features (also known as the spectral graph theory). Wang et al., Yang et al., and Sathappan et al. give in-depth explanations of the ideas behind graph signal processing. 9 The concepts used by this study will be briefly described below.
Structure of path graph signals
A graph is represented by a set of vertices vi (V) and a set of edges ej (E): G = (V, E). For a graph with n vertices and m edges, V = {v1, v2, …, vn} and E = {e1, e2, …, em}. A path graph is a simple graph structure that connects adjacent vertices with edges to provide visual information. In accordance with the definition, the path graph P10, which consists of 10 vertices, is shown in Figure 1.

Schematic diagram of the path graph.
In this graph, vi denotes the i-th vertex of the path graph, with i = 1, 2, …10; and eij represents an edge between the i-th and j-th vertices, where i, j satisfy the conditions i = 1, 2, …10 and j = 1, 2, …10 with i ≠ j.
Based on the path graph model and time-domain MFL signals, it can be inferred that there is a structural correspondence between the two: the sampling points of the time-domain signal correspond to the nodes of the path graph signal, while the function values of the time-domain signals correspond to those of the path graph signals. To extract MFL signal features with graph signal processing, it is necessary to introduce the matrix of the graph structure.
Matrix of graph structure
There are two basic representations of graphs in graph signal processing: the adjacency matrix and the Laplacian matrix. 10 The basic definitions of these two representations are described below.
(1) The adjacency matrix W is a real symmetric matrix. It consists of the weights wij and the vertices of the graph are connected. For a graph with n vertices, the adjacency matrix is an n × n real, symmetric matrix. The weights wij between vertices i and j are calculated according to equation (1):
Where, xi and xj correspond to the signal values of vertices vi and vj, respectively, while θ is a constant width parameter known as the heat kernel width, which is set to be 0.75 in this study.
(2) The Laplacian matrix L considers the adjacency matrix and introduces the degree matrix D. Compared to the adjacency matrix, it represents the structural information of the graph in a more comprehensive way. Therefore, the Laplacian matrix L is widely used in graph signal processing:
Where, D is a sparse matrix, representing the “number” of edges connected to vi with non-zero diagonal elements
Spectral graph theory
The matrix representation describes the graph’s structure, but to extract features from graph signals, it is necessary to analyze the Laplacian matrix L. Spectral graph theory studies the information contained in the matrix (graph) to by analyzing the eigenvalues and eigenvectors of the Laplacian matrix. 11 Therefore, the Laplacian matrix obtained above is subjected to a standard orthogonal decomposition:
In the equation,
Graph Fourier transformation
The Graph Fourier Transformation (GFT), which is a fundamental GSP concept analogous to the classical Fourier Transformation (FT), is a method of analyzing graph signals in graph signal processing.
12
The complex signal can be decomposed into a superposition of “harmonic” signals like FT. In GSP, the complex signal refers to the graph signal and the “harmonic” signal is represented by the Fourier Transformation Basis (FTB). It corresponds to eigenvectors
Similar to the definition of FT, graph signal f’s GFT is obtained by expanding f in the way of the Laplacian matrix eigenvectors (FTB). The difference is that GFT uses a discrete inner product definition. GFT that represents the graph signal by
Indeed, GFT provides “frequency” to the graph signal, and the amplitude of the eigen spectrum and the maximum value of the eigenvectors have a reciprocal relationship. Compared with FT’s frequency domain characteristics, GFT’s eigenspectrum domain characteristics are more prominent. GFT is more suitable for obtaining the signal’s frequency domain information. Therefore, we can identify rail cracks by extracting the graph “frequency domain” features of the MFL signal.
Experiment platform and crack parameters
Experimental platform
MFL testing is an electromagnetic non-destructive testing technique used to detect corrosion and pitting in ferromagnetic materials. If any defects on or near the surface are present, the defects will create a leakage field, thus forming a visible indication that the inspector can detect. 13 This method is particularly effective for detecting cracks on or near the surface of ferromagnetic materials. The data used in this experiment was obtained from a rail-crack MFL testing platform of the laboratory. The platform consists of a high-speed rotating desk, a MFL testing device, a set of hall effect sensors, signal conditioning circuits, data acquisition cards, and a PC. The properties of the sensor, amplifier, and DAQ card are listed in Table 1. An AD620 instrumentation amplifier was used in a bias amplifier circuit. The MFL testing device comprises forward and reverse magnetization devices (the reverse magnetization device magnetizes the rail sample in the opposite direction. In this way, when the sample is magnetized in the forward direction, it will not be affected by the residual magnetization from previous magnetization). Figure 2 shows the experimental platform.
Specifications of the experimental system.

Schematic diagram of MFL testing platform for rail cracks.
To simulate the MFL testing scenario, where the testing device moves along the railway at a certain speed, an electric motor was used to control the rotational speed (between 2 and 55 m/s) of the turntable. A hall effect sensor (model UNG3503) was fixed above the turntable, with its relative velocity and movement opposite to that of the turntable.
The signal acquisition device includes a row of 16 hall effect sensors to capture the cracks’ MFL signals on the turntable. This design is to fully cover the rail surface and obtain as much information about the cracks as possible. This device can simultaneously measure 16 MFL signals for a single rail crack, thereby crack information is both comprehensive and accurate for further analysis and processing.
Parameter description of artificial cracks
Parameters such as width, depth, horizontal angle, and vertical angle are introduced to characterize the naturally formed crack in rail track. These parameters are typically in millimeters, and the crack’s contour lines are irregular. To simulate cracks on rail surface, this experiment created 19 different artificial cracks (with different parameters) on the surface of the turntable. The turntable and the rail were made from the same material. The parameters of the artificial cracks are shown in Table 2.
Crack parameters of different rails.
To have a better understanding of different types of artificial cracks, Figure 3 presents top and side views of cracks for entries listed in Table 1.

Top view and side view of different artificial cracks.
Based on Table 1 and Figure 3, the 19 types of artificial cracks can be classified into five groups. Specifically, Group 1 comprises of type 1–type 4; Group 2 comprises of type 4–type 7; Group 3 comprises of type 8–type 11; Group 4 includes type 12–type 15, and Group 5 comprises type 16–type 19. The first four groups aimed to investigate the effects of a single parameter on MFL. Such parameters include width, depth, horizontal angle, or vertical angle. All other parameters are kept constant. The fifth group, however, was designed to examine the combined effects of two parameters on the MFL signal. The two parameters were the horizontal and vertical angles.
Due to the malfunction of sensors, type 1 crack was drilled through in manufacturing. Therefore, channels associated with Crack No.1 were excluded from data collection. Consequently, the final MFL dataset comprised of 18 types of artificial cracks across nine channels. To have a more visual interpretation of rail cracks, Figure 4 presents a sample MFL signal for type 2 crack on channel 6.

MFL signal for type 2 crack on channel 6.
Methodology and validation of effectiveness
Path graph features and SVM-based steel rail crack identification method
Rail crack identification, which are based on path graph features and support vector machine, involves two stages: training and testing.
Training
Equation (4) was used to build the adjacency matrix W1 of the MFL signal fn, and the graph matrix form L1 of the MFL signal fn was obtained. Subsequently, the signal’s FTB was computed with equation (3), and the MFL signal’s GFT was calculated with equation (5). The equations on left side of Table 2 were used to calculate the “frequency domain” features of MFL.
Equation (4) was used to build the adjacency matrix W2 of the MFL signal fn. The graph matrix L2 of the MFL signal fn was obtained. Next, equation (3) was used to calculate the spectral indicators of the signal, and the results were input into the equations on the right side of Table 2 to derive the “time domain” features of MFL.
The initial feature set F consisted of 22 features extracted from MFL signals, among which, half were “frequency domain” features and the other half were “time domain” features. For accurate description, the extracted features were numbered. The “frequency domain” features of the graph include the first five points of the GFT (F1–F5), mean amplitude (F6), centroid (F7), root-mean-square (F8), standard deviation (F9), skewness (F10), and kurtosis (F11). 14 The “time domain” features of the graph included the first five maximum eigenvalues (F12–F16), the second smallest eigenvalue (F17), Laplacian operator (F18), pseudo-Laplacian energy (F19), Laplacian energy (F20), mean eigenvalue (F21), and standard deviation of eigenvalues (F22). 15 The features above reflect the MFL path graph signal’s amplitude, energy, and waveform index, as well as the spectral-domain signal’s smoothness and energy. They can effectively characterize the signal. The computational methods of F6–F11 and F18–F22 are shown in Table 3.
Following the method, the cracks’ different MFL signal features were input into the SVM, and the classifier was trained.
Graph feature parameters.
Testing
To classify the rail crack’s test samples, their image features were extracted and fed into the pre-trained SVM classifier, following the training steps 1–3.
Flowchart of the proposed method
Figure 5 shows the flowchart of the rail crack identification method based on path graph features and support vector machines. The pre-processing includes signal denoising through adaptive filtering, alignment, and truncation. The collected signal was a long sequence, which contained data of all 18 types of cracks acquired within a certain period of time (for a crack MFL signal, there is a peak value, as shown in Figure 4). To support subsequent signal analysis, the first peak value of the signal was used as the alignment point, and the data from different channels were aligned and truncated based the crack type.

Flowchart of rail crack identification based on path graph features and SVM.
Experiment to test the validity of the method
The method was applied to classify the rail crack signals in real scenarios. With the penalty factor set as 1.0, different SVM kernel functions were used to classify the feature data set in the experiment, and the classification results were shown in Table 4. The polynomial kernel function with the shortest classification time is selected as the optimal kernel function of SVM classifier. 16
Classification results of different kernel functions.
The D value of penalty factor has a great influence on the classification effect of SVM classifier. The smaller the D value is, the smaller the adjustment of SVM classifier will be, but too small will reduce the classification accuracy. The larger the D-value is, the more data points the classifier will follow, but the larger the D-value is, the overfitting problem will occur, and the selection of the appropriate penalty factor is of great help to the classification effect.
When D value changed from 0.01 to 50, the classification accuracy and classification time of SVM classifier were compared. In the process of D value changing from 0.01 to 50, the classification accuracy first becomes larger and then smaller and then remains unchanged, but the classification time gradually becomes longer. The penalty factor 0.7 with the highest classification accuracy was chosen as the best penalty factor of SVM.
To demonstrate the advantages of the proposed method in rail crack identification, it was compared with the traditional method. According to Deng et al., 17 the traditional method often extracts 31 commonly used features, or “traditional features” (such as time-domain statistical features, waveform indicators, frequency-domain features, and time-frequency domain features) for qualitative and quantitative analyses of MFL signals, as well as classification.
To keep experimental conditions the same, both methods adopted the same training and testing samples. Compare the cross-validation of different values (fold number: 5, 10, 15, 20), and comprehensively consider the accuracy of classification and calculation cost, the experiments used 10-fold cross-validation. 18 The experimental outcomes from the two methods are listed in Table 4. Each row of the table represents the average identification rate for a certain crack type across different channels over five trials. Each column shows the average rate of finding different crack types within a specific channel over five trials. 19
According to Table 3, there is a slight difference in the identification accuracy of the proposed method for the same crack type across different channels (for instance, Crack #2 has the lowest identification rate of 84.29% in Channel #9, but its identification rate increases to the highest 97.14% in Channels #4–6). Nevertheless, all the identification rates are within a reasonable range. Certain signals are less sensitive to defective parameters, because there is coupling for MFL signals in different channels. As for the identification rate of 18 types of cracks, the proposed method achieved an average rate of over 83.51% (shown in bold), with the highest rate to be 95.34%. As the standard deviation between different identification rates is small, this method is effective in identifying various types of cracks.
As compared with the traditional method, the proposed method has higher average identification rates and smaller standard deviations for all the channels. It is more effective and stable in identifying different types of cracks. The analysis above proves the superiority of the proposed approach (Table 5).
The identification rates of 18 crack types across nine channels based on the traditional method (TM) and the proposed method (PM).
Unit: %.
Conclusions
The innovation of this research is that a new method of rail crack identification based on path map features and support vector machine is proposed from the perspective of new features. By transforming the magnetic leakage signal from time domain to graph domain, and extracting the graph domain feature which can best represent the signal, the method is inspired by the idea of transform domain feature. The experimental results show that the proposed method has higher recognition accuracy and better stability. Compared with 31 features used in traditional methods, the proposed method only needs 22 features to achieve better recognition results. This means that the method is not only more competitive, but also requires shorter training times when producing results with higher identification accuracy and greater stability. Therefore, this study provides a new way for magnetic leakage analysis and treatment in rail crack detection, has important practical value, and provides beneficial enlightenment for further research in related fields.
Footnotes
Handling Editor: Dr José Correia
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was partially supported by the China Jiangsu Province’s Industry-University-Research Cooperation Project (BY2022566); the China Jiangsu Province’s Vice General Manager of Science and Technology Project (FZ20220065); the QingLan Project of the Jiangsu Higher Education Institutions; the Jiangsu Graduate student Scientific Research and Innovation Project (KYCX21_0200).
Data availability statement
The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.
