**1. Introduction**

Fiber bragg grating sensors are widely used for distributed temperature and strain sensing [1–3]. The performance of FBG-based sensors significantly depends on the accuracy of the peak detection algorithms that provide the possibility of converting a registered signal into temperature/strain values. Commonly, an array of FBGs is sparsely inscribed on a stretch of fiber in spatial and spectral domains to avoid mutual interference between neighboring FBGs. In this case, the peaks positions and their shapes are relatively simple to distinguish and plenty of algorithms may be applied for processing [4–6].

However, there is always a trade-off between peak detection accuracy and the number of FBG sensors in the sensing channel. The limited capacity of a sensing channel results in the limited length and spatial resolution of an FBG sensor. Increasing the number of sensing channels limits the sensor interrogation rate and increases the cost of a final device.

At the same time, FBG sensors with high spatial resolution are attractive for various applications including damage processes monitoring [7], healthcare [8], and heat localization [9]. The spatial resolution of a fiber optical sensor may be raised by implementation of chirped FBGs [10] or the implementation more advanced interrogation technique [11].

Software solutions are mainly focused on the coupling of the reflectance spectra of several FBG sensors into one sensing channel and processing the resulting signal for peaks discrimination [12,13]. Today, the scientific community is paying significant attention

**Citation:** Kokhanovskiy, A.; Shabalov, N.; Dostovalov, A.; Wolf, A.Highly Dense FBG Temperature Sensor Assisted with Deep Learning Algorithms. *Sensors* **2021**, *21*, 6188. https://doi.org/10.3390/s21186188

Academic Editor: Jing Tian

Received: 16 July 2021 Accepted: 13 September 2021 Published: 15 September 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

to machine-learning (ML) algorithms, which have already shown good performance at various fundamental levels and practical applications [14,15]. Particularly, data-driven algorithms are capable of operating with large-scale high-dimensional data and finding hidden intrinsic features and dependencies. There have already been successive attempts to apply ML algorithms for interpretation the of overlapped reflectance spectra from sparse FBG sensors including: extreme learning machines [12], least squares support vector regression [16], convolutional neural networks [17], particle swarm optimization algorithms, long short-term memory algorithms [18] and others [19,20].

However, in most of the presented works, the performances of the algorithms were demonstrated on the model spectra of FBGs, where various additional spectrum distortions associated, for example, with mutual interference between neighboring FBGs, are not considered. Additionally, FBG arrays with a small number of gratings (up to 4 FBGs) were used in experiments, while a real network of sensors can contain more than 50 individual sensing points, for which the presented algorithms will have a significant root mean square error and a significantly longer signal processing time (~s), which makes it difficult to use these algorithms for real-time measurement applications. The possibility of interrogating a sensors network containing 60 FBGs was recently demonstrated [20], but in this case spectral bandwidth was divided into 30 independent regions without crosstalk containing only two paired FBGs with spectral overlap. Each FBG has a bandwidth of ≈0.25 nm to ensure the absence of crosstalk between adjacent regions (1–3 nm), so a length of FBG was ~5 mm, which limits the spatial resolution of measurements. In the case of short FBGs (<1 mm) used for high spatial resolution measurements, the spectral width is much higher (~1.5 nm) and for this reason the spectra will significantly affect each other and therefore these algorithms will give a large error.

Here, we investigate alternative method to process experimental reflection spectra of a highly dense FBG temperature sensor. Fifty closely inscribed FBGs allowed us to increase the length and spatial resolution of the temperature sensor interrogated by using a single optical channel of interrogator. To fabricate the sensor, we used the femtosecond pointby-point inscription technique, allowing high-precision FBG positioning and wavelength resonance specification. For adequate interpretation of a complex reflection signal we do not solve the peak detection problem, but apply deep learning algorithms in order to match the whole reflectance spectrum of the dense FBG sensor with temperature distribution. We also propose an experimental setup based on optical interrogator and Peltier cells for training procedures of deep learning algorithms. By applying the developed algorithms, we show that the capacity of the optical channel of the interrogator can be increased without significant loss of accuracy in the FBG peak detection.

#### **2. Experimental Setup**

In the following experiments we used two different types of FBG-based temperature sensors inscribed in Fibercore SM1500(9/125)P polyimide-coated fiber by using femtosecond IR laser pulses [21]. The first one was a highly dense sensor composed of 50 uniform FBGs equidistantly arranged along 50 mm fiber segment. Each of the gratings had a length of 0.95 mm and was separated from the neighboring by 0.05 mm, as shown in Figure 1. The resonant wavelengths of the FBGs in the array were chosen to uniformly fill the spectral range of the used 8-channels HBM FS22-SI interrogator (1500–1600 nm). The interrogator operated in optical spectrum analyzer mode providing 1 Spectrum per second refresh rate, 20,001 points per spectrum, and 5 pm resolution. The second type of FBG array was an array containing only intermediate elements of a highly dense array, as shown in Figure 1. Due to the decrease in the FBG density, the reflection spectra the array possess a less noisy shape, making it possible to use such a sensor as a reference when processing the data of a highly dense sensor.

**Figure 1.** Arrangement of FBGs in highly dense and sparse temperature sensors.

Figure 2a shows a fragment of a reflection spectrum of the highly dense FBG temperature sensor and one of the sparse FBG temperature sensors measured by the optical interrogator. The whole reflectance spectrums are depicted in Figure 2b. As can be seen from the spectra, the close spectral arrangemen<sup>t</sup> of the FBGs in a highly dense array leads to mutual interference between adjacent gratings, which consequently increases the noise level of the resonance peaks compared to a sparse FBG array.

**Figure 2.** Reflection spectra of a highly dense and one of the sparse FBG sensors: zoomed (**a**) and full **(b)** spectral ranges.

We used five calibrated sparse temperature sensors and additional channels of the interrogator to calibrate the dense FBG sensor. The general scheme of the experimental setup is depicted in Figure 3.

FBG sensors were glued closely to each other (as shown at Figure 1) on an aluminum plate with attached Peltier cells on the back surface. By controlling the current and polarity of the electrical power supplies, as well as the positions of Peltier cells, we applied different temperature gradients to the plate, some of which are presented on Figure 4. The temperature of the plate varied in the range from 10 to 80 ◦C with spatial gradients in the range from −0.38 ◦C/mm to 0.44 ◦C/mm. The diversity of the temperature gradients was exploited during the training procedure, thus improving the ability of the deep neural network to generalize incoming data and improve the sensitivity of the dense FBG sensor.

**Figure 3.** Principle scheme of the experimental setup.

**Figure 4.** Examples of exploited temperature gradients during training procedure.

#### **3. Architectures of Deep Neural Network**

The task for deep neural networks was to predict the reflectance peak positions of 50 FBGs contained in 5 sparse sensors by the optical reflectance spectrum of the highly dense sensor. We investigated the performances of full-connected and convolutional neural networks, which were built using the TensorFlow software package [22]. A fully connected neural network (FCNN) was selected as the most common and simple architecture. Our FCNN consisted of input, hidden and output layers, as shown in Figure 5. The size of the input layer was 20,001 neurons corresponding to the size of the signal array from the interrogator, the output layer had 50 neurons corresponding to the number of the FBGs of the dense sensor. The size of the hidden layer was optimized in order to reduce computational time and maintain the precision of the algorithm. During the grid search procedure of hyperparameters of FCNN we used Mean Squared Error as a loss function and Adamax optimizer for neuron weights optimization. FCNN with 500 neurons at the hidden layer with sigmoid activation function showed the best performance (Section 4).

We also chose a convolutional neural network (CNN) for the task, because of its potential capability to reveal hidden features related to interference between reflectance patterns of nearby FBGs (Figure 6). The input layer was a two-dimensional array of the reflectance pattern, after which there was a layer with one convolutional filter of size 2 × 2 and Relu activation function. The 2-dimensional convoluted image was then flattened and transferred to two fully connected layers. The size of the last output layer was 50 neurons.

**Figure 5.** Feed forward neural network with three layers. The final architecture had 20,001 neurons at the input layer, 500 neurons at the hidden layer, 50 neurons at the output layer.

**Figure 6.** Convolutional neural network consisted of six layers.

Unlike FCNN, where we have used a 1-dimensional array as an input, we transformed the input signal array into a two-dimensional image. This was undertaken in order to reduce the size of a convolutional filter. Our first attempt was to slice 1-dimensional into 50 windows with centered reflectance peaks of FBGs (Figure 7a). However, this approach leads to greater challenges during signal processing due to the aperiodic arrangemen<sup>t</sup> of the peaks. Instead, we sliced the input signal into 59 parts, since 59 is a prime factor for 20,001 (Figure 7b). Despite the image losing its physical meaning, such an approach is more robust and straightforward.

**Figure 7.** (**a**) 2D reflectance spectrum of FBG sensor with centered reflectance peaks; (**b**) 2D reflectance pattern of FBG obtained by slicing the reflectance spectrum into 59 pieces.

The input data was scaled for both neural networks in following order: first, each sample of a reflectance spectra was shifted by mean value of the intensity, then it was normalized by standard deviation of the intensity. Sample size of training, validation and testing datasets were 2000, 500 and 1000, respectively.
