## 3 Design of the FBG Demodulation System
### 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 [PERSON] 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). \[Loss_{GAN}=\min_{G}\max_{D}\mathbb{E}_{\mathbf{x}\sim p_{\text{data}}}\left[ \log D(\mathbf{x})\right]+\mathbb{E}_{\mathbf{z}\sim p_{\mathbf{z}}}[\log(1-D( G(\mathbf{z})))], \tag{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 (\(\lambda\)), which can be expressed as \(\lambda=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). \[Loss_{DNN}=\frac{1}{m}\sum_{i=1}^{m}(\lambda_{i}-\hat{\lambda}_{i})^{2}, \tag{4}\]  
Figure 1: The proposed FBG demodulation system.