Improvement of Fiber Bragg Grating Wavelength Demodulation System by Cascading Generative Adversarial Network and Dense Neural Network

: A high-performance, low-cost demodulation system is essential for ﬁber-optic sensor-based measurement applications. This paper presents a demodulation system for FBG sensors based on a long-period ﬁber grating (LPG) driven by artiﬁcial intelligence techniques. The LPG is applied as an edge ﬁlter to convert the spectrum drift of the FBG sensor into transmitted intensity variation, which is subsequently fed to the proposed sensor demodulation network to provide high-precision wavelength interrogation. The sensor demodulation network consists of a generative adversarial network (GAN) for data augmentation and a dense neural network (DNN) for wavelength interrogation, the former addresses the drawback that traditional machine learning models rely on a large-scale dataset for satisfactory performance, while the latter is used to model the relationship between transmitted intensity and wavelength for demodulation. Experiments demonstrate that the proposed system has excellent performance and can achieve wavelength interrogation precision of ±3 pm. In addition, the effectiveness of the GAN is demonstrated. With a wide demodulation range, high performance, and low cost, the system can provide a new platform for ﬁber-optic sensor-based measurement applications.


Introduction
Fiber Bragg gratings (FBGs) are essential candidates for sensing different parameters (e.g., temperature, strain, refractive index, etc.) due to their unique properties.Numerous research works have shown that they can be used as nonelectrical sensors in biomedical measurements and structural health monitoring (SHM) [1][2][3].Before obtaining information about external perturbations, the center wavelength of the FBG sensor used needs to be effectively interrogated, as its center wavelength can send shifts due to changes in external physical quantities.
Any central wavelength shift by the FBG is presented through spectral encoding.Therefore, an interrogation technique is needed to decode the spectral changes.Edge filter demodulation is more suitable for wavelength interrogation systems for FBG sensors due to its rapidity and cost effectiveness compared to interferometric demodulation [4,5], CCD spectroscopy [6], and scanning demodulation [7].It converts the sensing signal into an optical power using the linear filtering characteristics of the filter and achieves wavelength interrogation by measuring the change in optical power.Many literature sources in these areas use Fabry-Perot (FP) filters, wavelength division multiplexers (WDM) or coarse WDM (CWDM) [8,9], FBG filters (FBGFs), and highly birefringent fiber ring mirrors as edge filters.For example, Chen et al. [10] used a symmetric F-P interferometric cavity to demodulate the central wavelength shift of FBGs, which broadened the dynamic demodulation range.Davis et al. [8] achieved a low-loss all-fiber system by demodulating FBGs using the reflective spectral ramp of a wavelength-division multiplexer.However, these methods are subject to certain limitations, such as the tedious demodulation process due to the uncertainty of the interferometric spectrum of the F-P interference filter and the existence of a large flat region in the spectrum of the WDM/CWDM that severely limits the demodulation range.
Long-period fiber gratings (LPGs) are widely used in all-fiber FBG demodulation systems due to their low insertion loss, wide bandwidth, and low cost.Zhang et al. [11] used LPGs to demodulate small wavelength shifts.They cascaded LPG as filters in FBGs multiplexing to provide a low-cost demodulation system for FBG sensors.Pachava et al. [12] built an FBG demodulation system based on LPG and photodiodes that can be used for level, specific gravity, and static and dynamic measurement applications.Zou et al. [13] developed an FBG demodulation system based on a cascaded long-period fiber grating (CLPG) technique for simultaneous demodulation of two wavelength-matched FBG sensors, and the proposed system can be used in dynamic strain measurements.Zhou et al. [14] used a long-period grating-based FBG demodulation system to monitor seismic waves, providing a highly sensitive, high-speed detection system that can be used for seismic exploration.Yet, attempts to improve the precision of these demodulation systems often rely on cascading more LPG or providing higher-specification equipment, which is contrary to the expectation of low cost and low complexity.
With the rapid development of artificial intelligence (AI) in recent years, intelligent photonics has attracted the attention of more and more researchers [15][16][17][18][19][20][21][22][23][24][25][26].For example, AI techniques are applied to unique optical fiber design [24], optical imaging [16], and fiber optic sensor demodulation systems [18].AI algorithms, especially machine learning (ML), have also been introduced in LPG-based FBG interrogation systems.For example, Sun et al. [27,28] used two LPG combined with artificial neural networks (ANNs) to simultaneously measure temperature and curvature and an LPG-ANN-based design to sense many different parameters, such as strain, etc. Barino et al. [29] completed FBGarray-based LPG sensor interrogation using an ANN.Even though these neural-networkbased LPG-based FBG interrogation methods provide superior performance compared to traditional solutions, the need to provide a large amount of a prior data for model training means that the experimenter needs to spend a lot of effort to acquire experimental data, which makes them less cost effective.For this, Chen et al. [25] used an interpolationbased data augmentation method to improve the demodulation precision of fiber optic sensors.Sridevi et al. [30] proposed using an auto-encoder (AE) model to generate largescale datasets to enhance neural network's performance.However, the data distributions generated by these methods may deviate significantly from the original data distribution, making it difficult to obtain positive results when the data set is sufficiently small.This paper cascades a generative adversarial network (GAN) and a dense neural network (DNN) to solve the above problems to propose a high-precision, low-complexity, and highly cost-effective LPG-based FBG interrogation system.The system uses LPG to filter the FBG reflected light and convert the sensing signals from FBG sensors to optical power signals.These optical power signals are fed to the GAN to accomplish nonintrusive data augmentation.Then, these data are fed into the DNN to establish the relationship between the optical power and the central wavelength to achieve wavelength demodulation.Experiments show that the proposed system can obtain a powerful generalization performance based on small-scale raw datasets with excellent wavelength interrogation of ±3 pm.In addition, the effectiveness of GAN and the superiority of the proposed demodulation algorithm over traditional machine learning algorithms are demonstrated.

Principle of LPG-Based FBG Demodulation
An FBG is a reflective optical filter that reflects only one wavelength and consists of a periodic alternating structure embedded in a small fiber length with an enhanced refractive index.This produces an in-line Bragg reflector that reflects a singular wavelength given by the reference [3].
where λ B is the Bragg wavelength reflected by FBG, n e f f is the effective refractive index (RI) of the fiber core, and Λ denote the grating spacing.The value of Λ and the effective RI change when the FBG is subjected to strain, thus changing λ B .LPG is a transmission grating with loss peaks at specific wavelengths in the transmission spectrum.The falling and rising edges of the LPG spectrum can be used to interrogate the FBG, i.e., the wavelength drift, which is converted to the peak power shift of the FBG.When some perturbation (e.g., strain) is applied, the peak of the FBG is shifted, and accordingly, the output of the photodetector is changed.The power detected by the photodetector can be estimated as Equation (2) [31].
where P in is the input power and R s (λ) and T s (λ) are the reflection and transmission spectra of FBG and LPG, respectively.The central wavelength of the FBG sensor caused by external perturbations leads to a shift in the FBG reflection spectrum hair at the edge of the LPG spectrum, which results in a change in the detector power.

Optical System
The proposed FBG demodulation system as shown in Figure 1.The laser in the C + L band emitted by the ASE light source (BBS, 1528-1603 nm) passes through the annulus into the FBG sensor to be measured.The light reflected by it is delivered to the LPG used for demodulation.In this case, the overlapping area between the reflected spectrum of the FBG sensor and the spectrum of the LPG sensor is considered the transmitted intensity.According to the edge filtering method, the change in transmitted intensity due to the change in the central wavelength of the FBG sensor caused by external perturbations is the key to dynamically interrogating the central wavelength of the FBG sensor.The transmitted intensity is captured by the optical power meter and fed back to the sensor demodulation neural network, which completes the absolute interrogation of the central wavelength of the FBG sensor in the case of horizontal stretching.

Sensor Demodulation Neural Network
In the demodulation system shown in Figure 1, a sensor demodulation neural network was used to accurately model the complex nonlinear relationship between the transmitted intensity and the central wavelength of the FBG sensor.The network consists of two neural networks: a generative adversarial network (GAN) and a dense neural network (DNN).It is worth noting that the GAN were not in effect when the system was applied, as they were used for data augmentation.Subsequently, we will describe them in detail.

Generative Adversarial Network (GAN):
A prerequisite for machine learning algorithms to achieve acceptable results in modeling various types of nonlinear relationships is the availability of large-scale datasets, which are time consuming and laborious to collect.We proposed using GAN to perform offline, noninvasive augmentation of the original dataset before DNN training.GAN, first presented by Goodfellow et al. [32], is an adversarial model widely used in image generation.The overall structure of our proposed GAN for data augmentation is shown in Figure 2a.The GAN consists of a generator (G) and a discriminator (D), two independent networks; their specific structures are shown in Figure 2b.The G receives a random noise and generates a vector similar to the input data.This generated vector is then dimensionally superimposed with the actual data vector from the optical system and sent to the discriminator for training.The D is used to determine the authenticity of the data it receives, where "Real" means that the data distribution is close to the actual data.In contrast, "Fake" means that the data generated by the G deviate from the actual data distribution.During training, G tries to deceive D, while D tries not to be fooled by the G.The performance of both models can be improved after alternate optimization training, and the ultimate goal of training a GAN is to obtain a generative model with optimal performance, from which the data generated can be infinitely close to the actual distribution.Explicitly, the training of the GAN is a "min-max" game that gradually converges through the optimization of a loss function that is designed for G and D. Theoretically, the smaller the loss, the higher the model's performance.Specifically, the loss function is defined as Equation (3).
where Z is the random noise that is fed into the G, G and D is the generator and discriminator.

Dense Neural Network (DNN):
The architecture of DNN is shown in Figure 2c.The DNN responsible for the central wavelength interrogation in the sensor demodulation neural network was used to receive data generated from the optical system and the GAN for training, modeling the nonlinear relationship between intensity (I)-central wavelength (λ), which can be expressed as λ = DNN(I).The error back-propagation mechanism is used in the training process, which is divided into three main steps: forward propagation, back-propagation, and stochastic gradient descent.Each sample is first passed into the DNN to calculate the final output error.This step estimates how much error each neuron in the previously hidden layer contributed to the output, and continues to calculate how much error the last layer contributes until it reaches the input layer.Finally, a stochastic gradient descent algorithm is applied in each hidden layer to optimize the parameters of that layer.The ultimate goal of using the error back-propagation mechanism is to minimize the loss function.Explicitly, the loss function of DNN can be established as Equation (4).
where m is the total number of training datasets, λ i and λi represents the actual value and prediction value of the FBG central wavelength, respectively.

Random noise vector
Generator Network (G)

Experimental Setup
We completed the experiments using the system shown in Figure 1.The FBG sensor was fixed as a stress sensor on a motorized translation table driven by a stepper motor that stretched the sensor in different steps to apply horizontal stress.The experiments were conducted at a constant room temperature of 26 • C. The initial state of the FBG sensor used is shown in Figure 3a.During the stretching process, the motorized translation table stretched the FBG sensor fixed on it once every three seconds.The stretching process can be divided into two stages, and the ranges and stretching lengths of the two processes are shown in the Table 1.In the first stage, the motorized translation table worked at a progression of 5 µm per stretch.In the second stage, the motorized translation table worked at an advance of 10 µm per stretch, allowing data diversity to improve the generalization performance of the subsequent training model.The drift of the FBG reflection spectra during the whole stretching process is shown in Figure 3b.The reflection spectrum of the LPG sensor used as a linear filter is shown in Figure 3c.The change in the transmitted intensity of the LPG was due to the change in the FBG reflection spectrum caused by the stress application, and the value was recorded by an optical power meter.The optical spectrum analyzer (YOKOGAWA, OSA AQ6370D) recorded the actual spectral change of the FBG sensor while the FBG sensor was stretched to serve as a reference value.The real spectra and transmitted intensity were recorded point to point to construct the dataset.The dataset generated from the above information was first fed into the GAN for training to perform data augmentation.Before training the GAN, these data were divided into the training, test, and validation dataset after being randomly disrupted in the ratio of 80%, 10%, and 10%, with no overlapping part.During the training of the GAN, RMSprop and Adam were selected as the optimizers for the G and D, respectively, and the initial learning rates (LR) of G and D were preset to 0.001.A learning rate decay strategy was adopted to prevent them from overfitting, which can be formulated as Equation (5).
where the LR and LR denotes the learning rate after decay and before decay, respectively, α is the factor of decaying that is a constant, and N represents the total number of model iterations.In addition, the strategy of alternate training of G and D was adopted, i.e., G was trained once every five times of D training to ensure that G could generate data distributions closer to the ground truth.
After that, the data generated by the GAN were fed into the DNN for training along with the data generated by the optical system.The dataset was randomly disrupted between 80% and 20%, divided into training and validation datasets.Furthermore, the test dataset was collected and built by collecting data from additional continuous stretching experiments with no overlap between them.During the training of the DNN, Adam was employed as the optimizer, and the initial learning rate was preset to 0.0001.In addition, the training was performed using an early stopping strategy, i.e., once the loss did not decrease after 10 iterations, the training was stopped immediately, and the model was saved to prevent model overfitting.All models in this work were built on the Pytorch, and all algorithms were run on the Intel Core i7-9750H CPU (2.6GHz) and Geforce RTX2080 GPU (8GB).

Evaluation Metrics of Demodulation Performance
To evaluate the performance of the proposed demodulation system, MSE (Mean Square Error), MAE (Mean Absolute Error), R 2 , and RMSE (Root Mean Square Error) were chosen as performance evaluation metrics, which can be expressed as Equations ( 6)- (9).
where y i is the center wavelength of the FBG sensor measured by OSA, ŷi denote the FBG center wavelength output by the proposed system, y represent the average of the central wavelength acquired by OSA, and m denotes the number of samples.The smaller the RMSE, and MAE, the lower the model's wavelength interrogation error.R 2 is an evaluation metric of the fitted regression's effect.The closer it is to one, the better the model effect.

Results and Discussion
Before completing the demodulation of the FBG sensor center wavelength, the data generated by the GAN needs to be input to the DNN along with the original data for training.The results of data augmentation using GAN are shown in Figure 4.The data generated using GAN does not affect the original dataset, and the intensity and wavelength distributions in the generated dataset are consistent with those in original dataset, which were 3.5-4.5 nW and 1544-1551 nm, respectively, as shown in Figure 4a,b.In addition, the dataset generated by GAN is highly diverse, and the number of samples is much more significant than in the original dataset.Specifically, the size of the generated dataset is one hundred times larger than that of the original dataset, as shown in Figure 4c,d.
The dataset acquired in the additional continuous stretching experiments was selected as a test dataset for the well-trained model, and the test results are shown in Figure 5.In addition, the wavelength demodulation error distribution using DNN alone and the combination of GAN and DNN are shown in Figure 6.The demodulation error was used to reflect the system's precision, defined as the difference between the wavelength interrogated by the system and the wavelength measured by the OSA.The wavelength interrogation of the FBG sensor using DNN alone has a demodulation error distribution in the range of ±0.03 nm.The demodulation error is within ±0.006 nm when the GAN and DNN were combined, which means that the combination of GAN+DNN can achieve pm-level wavelength interrogation precision.In summary, the superiority of the proposed demodulation system in demodulation performance was demonstrated.The demodulation errors of DNN as well as traditional machine learning algorithms such as support vector regression (SVR), linear regression (LR), and Gaussian regression (GPR), and the errors using GAN for demodulation on top of them are quantified as shown in Table 2.During the training of these algorithms, a training dataset consistent with the training of the proposed neural network algorithm was used.The model with data augmentation using GAN was significantly lower than the original model without GAN in terms of maximum, minimum, and average errors, which implies that our proposed GAN for demodulation data augmentation has a significant advantage in improving the model's interrogation precision.Moreover, the proposed system (GAN + DNN) can achieve wavelength interrogation with precision of at least ±3 pm.The four performance evaluation metrics mentioned in Section 4.2 were utilized to evaluate their performance comprehensively and verify the superiority of the proposed neural network model.In addition, the performance of these traditional machine learning methods combined with the proposed GAN was also calculated to evaluate their effectiveness fully.The statistics of the evaluation metrics are shown in Table 3. DNN performs significantly better than LR, SVR, and GPR when used alone as a sensor demodulation neural network, as reflected by the nearly tenfold difference in RMSE, MSE, MAE, and corresponding metrics of DNN on the test dataset and the machine learning model used as a reference.The R 2 closer to one implies that the generalization performance and fitting effect of DNN are optimal.Moreover, combining the proposed GAN for data augmentation with LR, SVR, GPR, and DNN provides better performance than when used individually.The proposed sensor demodulation neural network (GAN+DNN) achieves optimal results.These doubly confirm the effectiveness of GAN in the proposed demodulation system and the excellent performance of this system.
The wide demodulation range of the proposed system is reflected in the LPG sensor's rising and falling edge range of nearly 56.1 nm.However, we could not measure more offset data in that range due to the specifications and experimental conditions of the FBG sensor used.Second, deploying the well-trained sensor demodulation neural network model on a neural network-enabled development board (e.g., FPGA) can replace the optical spectrum analyzer in actual measurements, which significantly reduces the overall cost and complexity of the system and makes large-scale measurements possible.In addition, the rich scalability of the system allows users to directly consider increasing the size of the neural network model to improve the demodulation precision, but this will be accompanied by more resource utilization.In terms of algorithms, we have compared and analyzed our proposed algorithm with existing algorithms in terms of demodulation metrics and algorithm properties, as shown in Table 4.In terms of interrogation precision, compared to the particle-swarmoptimization-based simulated annealing (PSO-SA) demodulation proposed by Qi et al. [33], variable-step-size & cross-correlation demodulation presented by et al. [34], and cascaded CNN & BPNN demodulation proposed by Chen et al. and Ren et al. [18,35], our proposed models of cascaded GAN and DNN and traditional algorithms of distributed estimation algorithm (EDA) [36] and dynamic calibration algorithm [5] can achieve the same interrogation precision.However, our proposed model significantly outperforms other algorithms regarding algorithmic complexity and data.In terms of algorithmic complexity, the proposed model is based on neural networks, meaning that physical constraints between variables can be ignored to model the complex nonlinear relationship between transmission intensity and central wavelength.In contrast, traditional algorithms must model complex physical relationships between variables on this basis.In terms of data, the optimization calculations of the traditional algorithms [5,33,34,36] and the two mentioned NN-based algorithms [18,35] rely on a large amount of measurement data, which can be unacceptably expensive to collect.In contrast, based on generative adversarial networks, the proposed model achieves excellent performance based on a preliminary small-scale data set, significantly reducing the data collection cost.In addition, the proposed model has significant advantages in generalization performance and scalability due to the customizable design of the scale of the generated data.

Conclusions
This paper proposes an FBG demodulation system based on LPG sensors to improve the demodulation precision of the center wavelength of FBG sensors by jointly using GAN and DNN.Among them, GAN achieves data augmentation without affecting the original data.It solves the drawback that traditional machine learning methods rely on largescale dataset training to perform well, and it dramatically reduces the data collection cost.DNN is responsible for establishing the complex nonlinear relationship between the LPG fiber's transmitted intensity and the FBG sensor's central wavelength.Thanks to the data augmentation of GAN, DNN can demodulate the FBG sensor with excellent wavelength interrogation performance with a small number of samples.Experiments on a small-scale raw dataset demonstrated that the proposed neural network model possesses excellent performance compared to traditional machine learning algorithms, and its precision can reach the Pm-level of ±3 pm.Additionally, the effectiveness of GAN is also proved.This low-cost, high-performance demodulation system can provide a novel platform for fiberoptic-based measurement applications.

Figure 1 .
Figure1.The proposed FBG demodulation system.The arrows represent the signal flow, and the red dotted box means that this part is not in effect during the actual use of the system.

Figure 2 .
Figure 2. Architecture of the proposed sensor demodulation neural network.(a) Overall architecture of the GAN.The shape of the random noise vector is consistent with the generation.(b) Detailed architecture of the generator network (G) and discriminator network (D).G consists of three Linear Leaky ReLu sequences and one Linear Tanh sequence, and the number of neurons in the linear layer is 128-256-512-1024.D consists of two Linear Leaky ReLu sequences and one Linear Sigmoid sequence, and the number of neurons in the linear layer is 512-256-1, and Leaky ReLu, Tanh, and Sigmoid are the activation functions.(c) Detailed architecture of the DNN consists of an input layer, four hidden layers, and an output layer.The number of neurons in the hidden layers is 64-128-256-512, and the activation function is ReLu-ReLu-ReLu-Tanh.

Figure 3 .
Figure 3. (a) The reflection spectrum of the FBG sensor used has an initial state center wavelength of 1544.8 nm and a 3dB bandwidth of 0.15 nm.(b) Changes in the reflection spectrum of the FBG sensor during stretching.The arrow indicates the direction of stretching, the stretching step in the red linear range (stretching step I) is 5 µm, and the stretching step in the blue linear range (stretching step II) is 10 µm.(c) Diagram of the LPG reflection spectrum as a filter with a central wavelength of 1566.7 nm.The blue dashed range (1538.7-1594.8nm) is the range that can be used for FBG sensor filtering.

Figure 4 .
Figure 4. Data augmentation results of the GAN.(a,b) are the original dataset and the GAN-enhanced dataset, respectively, with the intensity in the LPG spectrum on the x-axis and the central wavelength of the FBG on the y-axis.(c,d) are the original dataset and the GAN-augmented dataset, respectively, with the number of dataset samples on the x-axis and the central wavelength of the FBG sensor on the y-axis.

Figure 5 .
Figure 5. Demodulation results in the test dataset.The solid brown line is the actual central wavelength value of the FBG sensor measured by OSA, and the solid red line and solid blue represent the demodulation results of the proposed system when DNN acts alone and when GAN and DNN act together, respectively.

Figure 6 .
Figure 6.Histogram of wavelength demodulation error distribution.(a) Error distribution of the DNN.(b) Error distribution of the DNN + GAN (our proposal).

Table 1 .
Information about the stretching process of FBG sensors.

Table 2 .
Error statistics for the central wavelength interrogation of different demodulation mode, in which the Linear, RBF, and matern denotes the kernel function of these machine learning algorithms.

Table 4 .
Comparison of the proposed method with traditional algorithms (first four counting from top to bottom) and neural network-based methods (penultimate and penultimate third) regarding FBG sensor interrogation precision.