Optical Frequency Domain Reflectometry Based on Multilayer Perceptron

We proposed an optical frequency domain reflectometry based on a multilayer perceptron. A classification multilayer perceptron was applied to train and grasp the fingerprint features of Rayleigh scattering spectrum in the optical fiber. The training set was constructed by moving the reference spectrum and adding the supplementary spectrum. Strain measurement was employed to verify the feasibility of the method. Compared with the traditional cross-correlation algorithm, the multilayer perceptron achieves a larger measurement range, better measurement accuracy, and is less time-consuming. To our knowledge, this is the first time that machine learning has been introduced into an optical frequency domain reflectometry system. Such thoughts and results would bring new knowledge and optimization to the optical frequency domain reflectometer system.


Introduction
Since Wc Eickhoff et al. proposed the optical frequency domain reflectometry (OFDR) sensing system in 1981 [1], due to its advantage of high spatial resolution, it is now widely used in distributed measurement fields such as temperature measurement [2][3][4][5], strain measured [6][7][8][9], and shape sensing [10][11][12][13][14][15]. The cross-correlation algorithm (CCA) is a common data processing algorithm for OFDR systems, which calculates the wavelength shift value by comparing spectrum fingerprint peaks between the reference signal and the measured signal. However, the fingerprint peaks in the spectrum of the reference and the measured signal are not identical. Compared with the reference signal, the spectrum of the measured signal will have random multiple peaks and pseudopeaks affecting the precision of the CCA. Therefore, it is necessary to propose a new method to solve this problem of CCA.
Machine learning could learn signal features and regularity from large amounts of data and process them. In the field of distributed optical fiber sensing, several machine learning methods have been applied to improve the sensing performance in Brillouin optical time domain analysis (BOTDA) [16][17][18], Brillouin optical time domain reflectometer (BOTDR) [19][20][21], and phase-sensitive optical time domain reflectometer (Φ-OTDR) [22][23][24][25]. Yang G. et al. proposed a convolutional neural network (CNN) model that consists of a one-dimensional denoising convolutional self-encoder and a one-dimensional residual attention network module; this model could extract both temperature and strain in a BOTDA system with better noise immunity and robustness under the conditions of wider

Theory
The OFDR system is a distributed fiber optic sensing system based on backward Rayleigh scattering; the basic principle is based on the coherent detection technology of an optical-frequency-modulated continuous wave. When applying strain to the test fiber, the phase of the measurement light in the test fiber will change, causing the fingerprint peaks in the Rayleigh scattering spectra to shift. CCA calculates wavelength shift by demodulating the distance of the fingerprint peak shift to achieve distributed measurement of strain.
The steps for CCA to calculate wavelength shift are as follows. Firstly, we acquire the reference signal before applying strain and the measurement signal after applying strain in the time domain, and then the two time domain signals are converted to frequency domain signals by using the Fourier transform. In addition, there is a linear relationship between the frequency domain and the distance domain, so the two signals can be converted from the frequency domain to the distance domain by using the fast Fourier transform. Then, the moving window is intercepted at the same position as the two sets of distance domain signals, and the length of the moving window can be freely set according to the sensing requirements. It should be noted that in the OFDR system, the length of the moving window will affect the sensing performance, such as data size and spatial resolution, so it is necessary to set the appropriate window length. For two sets of distance domain signals, a short-time Fourier transform is used for the moving window to obtain the Rayleigh scattering spectra at the window positions. There are fingerprint peaks in the Rayleigh scattering spectra of the reference and measurement signals; the CCA can demodulate the distance between the fingerprint peaks of the two sets of signals and then calculate the wavelength shift at the position of the moving window. Finally, the position of the moving window is changed, and the above steps are repeated to obtain the wavelength shift values at all positions on the test fiber, realizing the distributed strain measurement. Figure 1 shows the wavelength shifts of Rayleigh scattering spectra by using the CCA. We acquired the reference and measurement Rayleigh scattering spectra before and after strain change, respectively. The fingerprint peaks in the spectra move linearly with strain. The CCA is used to calculate moving distance, and hence, the wavelength shift corresponding to the strain is obtained. The wavelength shift can be correctly obtained at a strain of 1500 µε, while error points appear at strains of 2000 and 2250 µε. The Rayleigh scattering spectra move linearly with the strain, and new spectral components are generated in the spectral range, reducing the overlap between the reference and measurement spectra. According to experimental results, error points in the wavelength shifts are found when the overlap coefficient is reduced to around 50%. The generation of new spectral components and a reduction in the overlap would cause multipeaks and pseudopeaks of cross-correlation, and hence, errors are found in the wavelength shift when the strain exceeds an upper limit. In other words, the limitation of the CCA is that the random multipeaks and pseudopeaks make many errors in the strain measurement, and this limitation is especially obvious in the large strain measurement. To overcome the limitation of the CCA, a machine learning method is introduced to grasp the characteristics of the Rayleigh scattering spectrum, making the algorithm work even when the overlap between reference and measurement spectra is largely reduced. We chose an MLP model based on the backpropagation algorithm to process the strain data. MLP is a traditional, fully connected neural network that consists of an input layer, hidden layers, and output layer, in which the number of hidden layers can be set according to research needs. MLP currently plays an important role in dealing with regression and classification problems, and it has been successfully applied to image processing [37], semantic processing [38], and financial analysis [39]. The schematic diagram of MLP used in this manuscript to process OFDR data is shown in Figure 2. We first established an initial MLP with random initial values and then used the training spectra as the training set of the initial neural network to train the network and optimize the network parameters. The principle of the composition of the training spectra will be given in the latter part of this section. The MLP is evaluated by the minimum target training error, maximum number of iterations, minimum performance gradient, and other parameters to determine whether the network is optimized. Finally, the experimentally collected spectra are used as the testing set to evaluate the trained neural network's performance. A critical phase is the construction of the training and testing sets for the machine learning method. In the traditional machine learning method, the training set and testing set often need to collect a large amount of data and divide the data into two parts. The part with a greater quantity is used as the training set to train the network, and the part with less quantity is used as the testing set to test the network. However, if the same approach is taken for training and testing the neural network in an optic fiber sensing To overcome the limitation of the CCA, a machine learning method is introduced to grasp the characteristics of the Rayleigh scattering spectrum, making the algorithm work even when the overlap between reference and measurement spectra is largely reduced. We chose an MLP model based on the backpropagation algorithm to process the strain data. MLP is a traditional, fully connected neural network that consists of an input layer, hidden layers, and output layer, in which the number of hidden layers can be set according to research needs. MLP currently plays an important role in dealing with regression and classification problems, and it has been successfully applied to image processing [37], semantic processing [38], and financial analysis [39]. The schematic diagram of MLP used in this manuscript to process OFDR data is shown in Figure 2. We first established an initial MLP with random initial values and then used the training spectra as the training set of the initial neural network to train the network and optimize the network parameters. The principle of the composition of the training spectra will be given in the latter part of this section. The MLP is evaluated by the minimum target training error, maximum number of iterations, minimum performance gradient, and other parameters to determine whether the network is optimized. Finally, the experimentally collected spectra are used as the testing set to evaluate the trained neural network's performance. To overcome the limitation of the CCA, a machine learning method is introduced to grasp the characteristics of the Rayleigh scattering spectrum, making the algorithm work even when the overlap between reference and measurement spectra is largely reduced. We chose an MLP model based on the backpropagation algorithm to process the strain data. MLP is a traditional, fully connected neural network that consists of an input layer, hidden layers, and output layer, in which the number of hidden layers can be set according to research needs. MLP currently plays an important role in dealing with regression and classification problems, and it has been successfully applied to image processing [37], semantic processing [38], and financial analysis [39]. The schematic diagram of MLP used in this manuscript to process OFDR data is shown in Figure 2. We first established an initial MLP with random initial values and then used the training spectra as the training set of the initial neural network to train the network and optimize the network parameters. The principle of the composition of the training spectra will be given in the latter part of this section. The MLP is evaluated by the minimum target training error, maximum number of iterations, minimum performance gradient, and other parameters to determine whether the network is optimized. Finally, the experimentally collected spectra are used as the testing set to evaluate the trained neural network's performance. A critical phase is the construction of the training and testing sets for the machine learning method. In the traditional machine learning method, the training set and testing set often need to collect a large amount of data and divide the data into two parts. The part with a greater quantity is used as the training set to train the network, and the part with less quantity is used as the testing set to test the network. However, if the same approach is taken for training and testing the neural network in an optic fiber sensing A critical phase is the construction of the training and testing sets for the machine learning method. In the traditional machine learning method, the training set and testing set often need to collect a large amount of data and divide the data into two parts. The part with a greater quantity is used as the training set to train the network, and the part with less quantity is used as the testing set to test the network. However, if the same approach is taken for training and testing the neural network in an optic fiber sensing system, it will undoubtedly consume substantial experimental resources and acquisition time, and the model may not be applicable after changing the measurement environment.
To overcome the problem above, we constructed the training set by moving the reference spectra and adding supplementary spectra. Firstly, the reference spectra of the fiber under test are obtained by experiment. Secondly, the reference spectra are moved with a certain shift, and the shift amount is determined by the strain sensitivity of the FUT. Here, the strain sensitivity is around 1.22 pm/µε. Finally, new spectral components are added to the training spectra to supplement the moving part of the reference spectra. To describe the generation process of training spectra more intuitively, we take the strain of 1000 µε, for example, in Figure 3. The reference spectra are experimentally obtained in a scanning wavelength range of 5.04 nm. The reference spectra are moved 1.22 nm toward the long wavelength direction, and the supplementary spectrum is added in the short-wavelength direction. The blue and yellow denote the part of the reference spectra, after moving the reference spectra, the yellow part is dropped and the red part of the supplementary spectra is added. The supplementary spectrum is generated by the spectrum model of Rayleigh backscattering light [40].
where b(λ) is the value of the supplementary spectrum, z k and c k are positions and reflection coefficients of the scattering centers, and λ is the wavelength.
Sensors 2023, 23, x FOR PEER REVIEW 5 of 13 system, it will undoubtedly consume substantial experimental resources and acquisition time, and the model may not be applicable after changing the measurement environment.
To overcome the problem above, we constructed the training set by moving the reference spectra and adding supplementary spectra. Firstly, the reference spectra of the fiber under test are obtained by experiment. Secondly, the reference spectra are moved with a certain shift, and the shift amount is determined by the strain sensitivity of the FUT. Here, the strain sensitivity is around 1.22 pm/µε. Finally, new spectral components are added to the training spectra to supplement the moving part of the reference spectra. To describe the generation process of training spectra more intuitively, we take the strain of 1000 µε, for example, in Figure 3. The reference spectra are experimentally obtained in a scanning wavelength range of 5.04 nm. The reference spectra are moved 1.22 nm toward the long wavelength direction, and the supplementary spectrum is added in the short-wavelength direction. The blue and yellow denote the part of the reference spectra, after moving the reference spectra, the yellow part is dropped and the red part of the supplementary spectra is added. The supplementary spectrum is generated by the spectrum model of Rayleigh backscattering light [40].
where b(λ) is the value of the supplementary spectrum, zk and ck are positions and reflection coefficients of the scattering centers, and λ is the wavelength. Following is an experimental description of the supplementary spectra constructed by using the spectra model of Rayleigh backscattering light. We take the data of 1000 µε as an example; Figure 4a,b shows the spectra and their distribution obtained by experimental collection. Figure 4c,d shows the training spectra and their distribution, in which the training spectra are composed of the reference spectra and the supplementary spectra. The reference spectra are 0 µε data acquired by the OFDR system. The supplementary spectra are composed of the spectra model of Rayleigh backscattering light based on a theoretical wavelength shift of 1000 µε. Training spectra are obtained by stitching the supplementary spectra and a part of the reference spectra. As can be observed from the figures, the collected and training spectra basically obey the Rayleigh distribution, which is consistent with the theoretical basis of OFDR. At the same time, in this manuscript, we determine whether the training spectra satisfy the fundamentals of the OFDR system by fitting the relationship between the average free spectra range (FSR) and spatial resolution. The average FSR refers to the average distance between adjacent spectral peaks of Following is an experimental description of the supplementary spectra constructed by using the spectra model of Rayleigh backscattering light. We take the data of 1000 µε as an example; Figure 4a,b shows the spectra and their distribution obtained by experimental collection. Figure 4c,d shows the training spectra and their distribution, in which the training spectra are composed of the reference spectra and the supplementary spectra. The reference spectra are 0 µε data acquired by the OFDR system. The supplementary spectra are composed of the spectra model of Rayleigh backscattering light based on a theoretical wavelength shift of 1000 µε. Training spectra are obtained by stitching the supplementary spectra and a part of the reference spectra. As can be observed from the figures, the collected and training spectra basically obey the Rayleigh distribution, which is consistent with the theoretical basis of OFDR. At the same time, in this manuscript, we determine whether the training spectra satisfy the fundamentals of the OFDR system by fitting the relationship between the average free spectra range (FSR) and spatial resolution. The average FSR refers to the average distance between adjacent spectral peaks of Rayleigh scattering spectra, and based on the principle of Michelson interference, the expression of FSR is where λ c is the central wavelength, n is the refractive index of the fiber, z is the interval of adjacent points in the distance domain, and N is the length of the moving window. Spatial resolution is an important performance indicator of the OFDR sensing system, which indicates that the sensing system can resolve the closest distance between two measurement points on the test fiber. It can be expressed as where L is spatial resolution. We change the spatial resolution by changing the moving window length N. When N is increased, the maximum beat frequency at the moving window position increases, the spectral peaks of Rayleigh scattering spectra become denser, and the average distance between spectral peaks becomes smaller. Therefore, the FSR is inversely related to the spatial resolution in the OFDR system. We compared the average FSR of experimental collected spectra and training spectra by using data of 100, 1000, 2000, 2900 µε, and the results are shown in Figure 5. The FSR fitted curves of the experimental collected spectra and the training spectra have basically no difference-the two curves are very close, and both are inversely proportional to the spatial resolution, conforming to the basic principle of OFDR. Combined with the above findings, the training spectra have a strong correlation with the experimental collected spectra, in which the training spectra are composed of supplementary spectra based on the spectra model of Rayleigh backscattering light, so it is feasible to construct supplementary spectra by using the spectra model of Rayleigh backscattering light.
where λc is the central wavelength, n is the refractive index of the fiber, z is the interval of adjacent points in the distance domain, and N is the length of the moving window. Spatial resolution is an important performance indicator of the OFDR sensing system, which indicates that the sensing system can resolve the closest distance between two measurement points on the test fiber. It can be expressed as where L is spatial resolution. We change the spatial resolution by changing the moving window length N. When N is increased, the maximum beat frequency at the moving window position increases, the spectral peaks of Rayleigh scattering spectra become denser, and the average distance between spectral peaks becomes smaller. Therefore, the FSR is inversely related to the spatial resolution in the OFDR system. We compared the average FSR of experimental collected spectra and training spectra by using data of 100,1000,2000,2900 µε, and the results are shown in Figure 5. The FSR fitted curves of the experimental collected spectra and the training spectra have basically no difference-the two curves are very close, and both are inversely proportional to the spatial resolution, conforming to the basic principle of OFDR. Combined with the above findings, the training spectra have a strong correlation with the experimental collected spectra, in which the training spectra are composed of supplementary spectra based on the spectra model of Rayleigh backscattering light, so it is feasible to construct supplementary spectra by using the spectra model of Rayleigh backscattering light.    Figure 6 illustrates the OFDR system in our experiment. The optical light from a tunable laser (Phoenix 1202, Luna) is split into two parts and connected with two interferometers. The auxiliary interferometer (upper branch) is an unbalanced Mach Zehnder interferometer with a 202.2 m delay fiber. The main (lower branch) interferometer is used to collect the Rayleigh scattering signal. A polarization diversity system with two polarization beam splitters is employed to weaken polarization fading. The signals from the auxiliary interferometer and main interferometer are collected by a four-channel data acquisition card. The auxiliary interferometer is designed to measure the instantaneous frequency of the laser and then compensate for the nonlinear sweep effect of the laser. The laser scanning speed is 40 nm/s, and the data acquisition time is 0.126 s, giving a laser sweep range of 5.04 nm. The length of the fiber under test (FUT) is 10 m. The optical fiber at 8.6 and 9.6 m was fixed on two linear translation stages. The strain is introduced by moving one of the linear translation stages, and the strain value is obtained by calculating the relative tensile length. Our dataset of the MLP model includes 17 classes of strains using the OFDR system described above, i. e., 60, 70, 80, 90, 100, 200, 300, 400, 500, 1000, 1500, 2000, 2500, 2600,  Figure 6 illustrates the OFDR system in our experiment. The optical light from a tunable laser (Phoenix 1202, Luna) is split into two parts and connected with two interferometers. The auxiliary interferometer (upper branch) is an unbalanced Mach Zehnder interferometer with a 202.2 m delay fiber. The main (lower branch) interferometer is used to collect the Rayleigh scattering signal. A polarization diversity system with two polarization beam splitters is employed to weaken polarization fading. The signals from the auxiliary interferometer and main interferometer are collected by a four-channel data acquisition card. The auxiliary interferometer is designed to measure the instantaneous frequency of the laser and then compensate for the nonlinear sweep effect of the laser. The laser scanning speed is 40 nm/s, and the data acquisition time is 0.126 s, giving a laser sweep range of 5.04 nm. The length of the fiber under test (FUT) is 10 m. The optical fiber at 8.6 and 9.6 m was fixed on two linear translation stages. The strain is introduced by moving one of the linear translation stages, and the strain value is obtained by calculating the relative tensile length.  Figure 6 illustrates the OFDR system in our experiment. The optical light from a tunable laser (Phoenix 1202, Luna) is split into two parts and connected with two interferometers. The auxiliary interferometer (upper branch) is an unbalanced Mach Zehnder interferometer with a 202.2 m delay fiber. The main (lower branch) interferometer is used to collect the Rayleigh scattering signal. A polarization diversity system with two polarization beam splitters is employed to weaken polarization fading. The signals from the auxiliary interferometer and main interferometer are collected by a four-channel data acquisition card. The auxiliary interferometer is designed to measure the instantaneous frequency of the laser and then compensate for the nonlinear sweep effect of the laser. The laser scanning speed is 40 nm/s, and the data acquisition time is 0.126 s, giving a laser sweep range of 5.04 nm. The length of the fiber under test (FUT) is 10 m. The optical fiber at 8.6 and 9.6 m was fixed on two linear translation stages. The strain is introduced by moving one of the linear translation stages, and the strain value is obtained by calculating the relative tensile length. Our dataset of the MLP model includes 17 classes of strains using the OFDR system described above, i. e., 60, 70, 80, 90, 100, 200, 300, 400, 500, 1000, 1500, 2000, 2500, 2600, Our dataset of the MLP model includes 17 classes of strains using the OFDR system described above, i. e., 60, 70, 80, 90, 100, 200, 300, 400, 500, 1000, 1500, 2000, 2500 2800, and 2900 µε. For a certain strain, 160 training data were generated according to the training spectra generation steps above, and 40 test data were collected experimentally.

Experiment Results and Discussion
Before testing the sensing performance based on MLP, we first determined the network parameters. The training function, activation function, and the number of network layers are optimized in succession. We used classification accuracy as the objective of parameter optimization. We ran the neural network ten times continuously and counted the accuracy. The training function is to modify the global weights and thresholds by minimizing the error, which is applied in the backpropagation process. The activation function is applied to the calculation of weights and thresholds of neurons. Its main role is to complete the nonlinear transformation and normalization of the data. The application of activation functions greatly increases the ability of neural networks to handle nonlinear data and prevents data expansion.
As shown in Figure 7a,b, seven training functions are tested, and traincgf was chosen as the training function of MLP, and its average accuracy is 80.8%. Figure 7c 2700, 2800, and 2900 µε. For a certain strain, 160 training data were generated according to the training spectra generation steps above, and 40 test data were collected experimentally. Before testing the sensing performance based on MLP, we first determined the network parameters. The training function, activation function, and the number of network layers are optimized in succession. We used classification accuracy as the objective of parameter optimization. We ran the neural network ten times continuously and counted the accuracy. The training function is to modify the global weights and thresholds by minimizing the error, which is applied in the backpropagation process. The activation function is applied to the calculation of weights and thresholds of neurons. Its main role is to complete the nonlinear transformation and normalization of the data. The application of activation functions greatly increases the ability of neural networks to handle nonlinear data and prevents data expansion.
As shown in Figure 7a,b, seven training functions are tested, and traincgf was chosen as the training function of MLP, and its average accuracy is 80.8%. Figure 7c We used traincgf as the training function and satlin as the activation function and ran the network ten times consecutively to obtain the effect of different hidden layers of the neural network on the accuracy rate, as shown in Figure 8. Figure 8a shows the accuracy rates after running ten times, and we can observe that the average accuracy of the 5-hidden-layer, 6-hidden-layer, and 7-hidden-layer networks is relatively close. Therefore, we compared the training time of these three networks with different layers, as shown in Figure 8b. Training time is the time used by the MLP model during the training phase. We found that the training time of the 5-hidden-layer network was the shortest. In the final classification model, we set the learning rate to 0.005, the training function to traincgf, the activation function to satlin, the number of hidden layer layers to five, and the loss We used traincgf as the training function and satlin as the activation function and ran the network ten times consecutively to obtain the effect of different hidden layers of the neural network on the accuracy rate, as shown in Figure 8. Figure 8a shows the accuracy rates after running ten times, and we can observe that the average accuracy of the 5-hidden-layer, 6-hidden-layer, and 7-hidden-layer networks is relatively close. Therefore, we compared the training time of these three networks with different layers, as shown in Figure 8b. Training time is the time used by the MLP model during the training phase. We found that the training time of the 5-hidden-layer network was the shortest. In the final classification model, we set the learning rate to 0.005, the training function to traincgf, the activation function to satlin, the number of hidden layer layers to five, and the loss function to mean square error. Figure 9 shows the MLP with the five-hidden-layer network structure. Green circles represent input layer neurons, light yellow circles represent hidden layer neurons, and blue circle represents output layer neuron. The input layer of the MLP is the OFDR spectra with a dimension of 2048. After the input layer, there are five hidden layers, and the number of neurons in each hidden layer is 2000, 1000, 500, 200, and 50, respectively. Once the data are processed by the hidden layer, they are passed to the output layer of the MLP to output the result.
Sensors 2023, 23, x FOR PEER REVIEW 9 of 13 function to mean square error. Figure 9 shows the MLP with the five-hidden-layer network structure. Green circles represent input layer neurons, light yellow circles represent hidden layer neurons, and blue circle represents output layer neuron. The input layer of the MLP is the OFDR spectra with a dimension of 2048. After the input layer, there are five hidden layers, and the number of neurons in each hidden layer is 2000, 1000, 500, 200, and 50, respectively. Once the data are processed by the hidden layer, they are passed to the output layer of the MLP to output the result.
where m is the test time for each strain, yi is the result obtained by the algorithm calculation, and ylabel is the experimental preset value. Figure 10 shows the confusion matrix of the MLP for small strain measurements from 60 to 100 µε and 100 to 500 µε. In the confusion matrix, the color shades represent the amount of data. The smaller the number, the lighter the color, and the larger the number, the darker the color. In the confusion matrix of this paper, the quantity is white when it is 0, gray when it is less, and black when it is more. From the measurement results, the MLP for small strain measurement works perfectly with an accuracy of 100%, and measurement precision can reach 10µε with a small error. Figure 11 shows the results of the MLP and the CCA for large strain measurements from 2500 to 2900 µε. In Figure 11a, we compared the MAE of MLP to CCA. It is found that the MAE of MLP is smaller than that of the CCA. Once the strain exceeds 2600 µε, it is worth pointing out that the CCA totally function to mean square error. Figure 9 shows the MLP with the five-hidden-layer network structure. Green circles represent input layer neurons, light yellow circles represent hidden layer neurons, and blue circle represents output layer neuron. The input layer of the MLP is the OFDR spectra with a dimension of 2048. After the input layer, there are five hidden layers, and the number of neurons in each hidden layer is 2000, 1000, 500, 200, and 50, respectively. Once the data are processed by the hidden layer, they are passed to the output layer of the MLP to output the result.
where m is the test time for each strain, yi is the result obtained by the algorithm calculation, and ylabel is the experimental preset value. Figure 10 shows the confusion matrix of the MLP for small strain measurements from 60 to 100 µε and 100 to 500 µε. In the confusion matrix, the color shades represent the amount of data. The smaller the number, the lighter the color, and the larger the number, the darker the color. In the confusion matrix of this paper, the quantity is white when it is 0, gray when it is less, and black when it is more. From the measurement results, the MLP for small strain measurement works perfectly with an accuracy of 100%, and measurement precision can reach 10µε with a small error. Figure 11 shows the results of the MLP and the CCA for large strain measurements from 2500 to 2900 µε. In Figure 11a, we compared the MAE of MLP to CCA. It is found that the MAE of MLP is smaller than that of the CCA. Once the strain exceeds 2600 µε, it is worth pointing out that the CCA totally We compare the accuracy of the MLP and the CCA by the mean absolute error (MAE), where m is the test time for each strain, y i is the result obtained by the algorithm calculation, and y label is the experimental preset value. Figure 10 shows the confusion matrix of the MLP for small strain measurements from 60 to 100 µε and 100 to 500 µε. In the confusion matrix, the color shades represent the amount of data. The smaller the number, the lighter the color, and the larger the number, the darker the color. In the confusion matrix of this paper, the quantity is white when it is 0, gray when it is less, and black when it is more. From the measurement results, the MLP for small strain measurement works perfectly with an accuracy of 100%, and measurement precision can reach 10µε with a small error. Figure 11 shows the results of the MLP and the CCA for large strain measurements from 2500 to 2900 µε. In Figure 11a, we compared the MAE of MLP to CCA. It is found that the MAE of MLP is smaller than that of the CCA. Once the strain exceeds 2600 µε, it is worth pointing out that the CCA totally failed to determine the strain while the MLP still works well. For the strain from 2500 to 2900 µε, the corresponding wavelength shift is around 3.08 to 3.57 nm, which means that the overlap between the reference and measurement Rayleigh scattering spectrum is only 29% to 39%. The correlation between spectra is severely reduced, which is the reason why the CCA fails. In contrast, MLP can still find recognition features from the remaining spectra, thus obtaining 90% classification accuracy, as shown in the confusion matrix in Figure 11b.
Sensors 2023, 23, x FOR PEER REVIEW 10 of 13 failed to determine the strain while the MLP still works well. For the strain from 2500 to 2900 µε, the corresponding wavelength shift is around 3.08 to 3.57 nm, which means that the overlap between the reference and measurement Rayleigh scattering spectrum is only 29% to 39%. The correlation between spectra is severely reduced, which is the reason why the CCA fails. In contrast, MLP can still find recognition features from the remaining spectra, thus obtaining 90% classification accuracy, as shown in the confusion matrix in Figure  11b.
The algorithm was running on a Windows 10 computer with a 64-bit CPU intel(R) Core (TM) i7-11800H, where the CPU is running at 2.30 GHz. Table 1 compares the running time of the MLP and the CCA. Both methods computed 400 sets of test data, and each method was performed four times. The comparison clearly shows that the CCA costs an average time of 18.8 s, while the MLP method only costs an average time of 0.446 s, saving more than 40 times. Therefore, the MLP demonstrates amazing speed in processing the OFDR data.   failed to determine the strain while the MLP still works well. For the strain from 2500 to 2900 µε, the corresponding wavelength shift is around 3.08 to 3.57 nm, which means that the overlap between the reference and measurement Rayleigh scattering spectrum is only 29% to 39%. The correlation between spectra is severely reduced, which is the reason why the CCA fails. In contrast, MLP can still find recognition features from the remaining spectra, thus obtaining 90% classification accuracy, as shown in the confusion matrix in Figure  11b.
The algorithm was running on a Windows 10 computer with a 64-bit CPU intel(R) Core (TM) i7-11800H, where the CPU is running at 2.30 GHz. Table 1 compares the running time of the MLP and the CCA. Both methods computed 400 sets of test data, and each method was performed four times. The comparison clearly shows that the CCA costs an average time of 18.8 s, while the MLP method only costs an average time of 0.446 s, saving more than 40 times. Therefore, the MLP demonstrates amazing speed in processing the OFDR data.   The algorithm was running on a Windows 10 computer with a 64-bit CPU intel(R) Core (TM) i7-11800H, where the CPU is running at 2.30 GHz. Table 1 compares the running time of the MLP and the CCA. Both methods computed 400 sets of test data, and each method was performed four times. The comparison clearly shows that the CCA costs an average time of 18.8 s, while the MLP method only costs an average time of 0.446 s, saving more than 40 times. Therefore, the MLP demonstrates amazing speed in processing the OFDR data.

Conclusions
In this paper, for the first time, we introduced machine learning into the OFDR system, and the MLP was used to train the fingerprint information of the Rayleigh backscattering spectra in single-mode fiber. The training spectrum was generated by moving the reference spectra and adding supplementary spectra. In total, we generated 17 kinds of training sets with different strains, and each strain contains 160 training sets. The training function, activation function, and the number of network layers were optimized in succession, and a five-hidden-layer MLP was obtained with an average classification accuracy of up to 90%. Compared with traditional CCA, the MLP achieves a larger measurement range, better measurement accuracy, and is less time-consuming.