## 2 Problem Statement  
In our situation, we were using an I-MON-512 Interrogation unit [24]. We assumed a fiber Bragg grating (FBG) with a length \(L\) ranging from 0.5 to 3.5 mm, a period \(\Lambda\) varying from 531.111 to 531.472 \(\upmu\)m, and an induced refractive index \(n\) ranging from 0.5\(\cdot\)10\({}^{-4}\) to 1.5\(\cdot\)10\({}^{-4}\), which was subjected to a specific physical effect (stretching/compression, temperature, etc.) causing a shift of the FBG central wavelength. With such parameters, the FBG central wavelength \(\lambda_{\text{B}}\) ranged from 1549.5 to 1550.5 nm, and the full width at half maximum of the spectrum ranged from 0.229 to 1.458 nm. The broadband radiation from a superluminescent diode was directed to the FBG via a fiber optic circulator, and the I-MON-512 spectrum analyzer received the reflection spectrum. The left and right boundaries of the controlled spectral range were \(\lambda_{\text{min}}=1510\) nm and \(\lambda_{\text{max}}=1595\) nm, respectively; the number of points in the spectrum was \(N=510\); and the discretization interval was \(\Delta\lambda=(\lambda_{\text{max}}-\lambda_{\text{min}})/N\approx 0.167\) nm. Without knowing the true FBG central wavelength, the data collected from the I-MON-512 cannot be used as input data for the neural network model. So instead, we used a mathematical model based on the homogeneous layers method [39] and transfer matrices [40] to obtain the FBG spectra with pre-defined central wavelengths. Initially, the FBG reflection spectrum was formed based on a mathematical model using the mathematical apparatus of transfer matrices [40] or the homogeneous layers method [39]. Then, the discretization of the modeled spectrum was performed with an interval equal to that of the spectrum analyzer. The resulting data array was essentially a discrete spectrum similar to that obtained via the interrogation device, and at the same time, the exact value of its central wavelength was known. Thus, the mathematical modeling apparatus enabled precise comparisons between the discrete spectrum and the corresponding central wavelength. These were the datasets used to train the neural network. The position of the FBG spectrum was studied in a controlled wavelength range \(\lambda_{\text{B}}\pm\Delta/2\), at \(\Delta=3\) nm, which determined, taking into account the spectrum analyzer's resolution, the dimension of the neural network input data \(M=\text{int}(\Delta/\Delta\lambda)+1\). Within the scope of the problem just described, this range included 19 spectrum values, determining 19 input values of the neural network. The spectra of the same FBG for two different positions (red and blue lines) are schematically shown in Figure 1. The solid line shows the true FBG spectra (as if they were obtained with any arbitrarily small discretization interval), and the dots show the values of the spectra obtained discretely. Figure 1 uses the following designations: \(S^{r}\) and \(S^{b}\) are spectra at two positions; \(\lambda_{i}\) is the wavelength, \(\lambda_{L}\) is the wavelength of the left, and \(\lambda_{L+M-1}\) is the right boundary of the controlled part of the spectrum; \(\Delta\lambda\) is the discretization interval; and \(\mathbf{D}\) is the relative shift vector of the spectrum (\(S^{b}\) vs. \(S^{r}\)), which is the same for all spectrum points. To bring the mathematical model of the spectrum as close as possible to the actual physical spectrum, the model incorporated the noise component and the minimum threshold of the light response. The amplitude of the noise component \(\alpha_{\text{N}}\) was assumed to be less than 0.2% of the maximum amplitude, and the minimum value in the FBG spectrum was assumed to be less than 20% of the maximum amplitude.