## 3 Research Methodology
### QPSO Process
#### 3.3.1 MLP-ADAM-Based Localization  
An Artificial Neural Network approach [38] is justified by the observation that the variations in each of the six meaningful signals along the research area are strongly non-linear and unpredictable due to their complexity. A commonly used ANN architecture is the simple, fully connected, feedforward MLP network, which utilizes non-linear filtering functions. MLP training is usually performed by the backpropagation technique, which is a momentum-improved gradient-descent reduction process of the regression error. The ultimate goal of any MLP training consists of reducing the error computed between the network output and a preset target in a supervised learning procedure. The available input data is usually split into two subsets, namely the training data and the test data. The network is trained by altering the weight matrixes that characterize the MLParchitecture by using the {input vector--expected target} pairs of the training data alone. The pairs {test output--expected target} are used as a form of quality control for the training in terms of the verification of the network generalization vs. memorization capabilities. In this work, three WiFi signals and three WSN signals were collected from 96 anchor points in a regular array of positions in the research area. All the experimental data were included in the training set, while the test set was created as a list of 20 points randomly selected within the experimental area. The test signals were generated by performing standard bilinear interpolation on the actual measured values in the vertices of the rectangle containing each of the test points. Figure 2 (left) shows a typical layout of the training and testing points within the experimental area. The preprocessing of the input data before feeding them into the MLP involved two steps. First, a relative weighting of the signal intensities was applied based on our previously published results on the same dataset [32]. Specific weights were assigned to each of the six signals. In the second step, the average of each individual signal intensity was subtracted from the weighted values to extract and retain their meaningful spatial variations using the following equation:  
\[S_{j}^{\prime}=S_{j}-\frac{1}{N}{\sum_{i=1}^{N}S_{ji}} \tag{4}\]  
for \(j=1\)-6 and \(N=116\), as the 20 test data were included in Equation (4) for consistency in the training process. The preprocessing of the target data required the transformation of the available spatial coordinates into a discrete representation, following the concept of surface tessellation. The tile sizes and the offset position of the tessellation are the goals of the optimization process of this research. Thus, the transformation from spatial to discrete coordinates is fundamentally dependent on the individual candidate solutions, which are managed by the QPSO algorithm. Nonetheless, the preprocessing of the target followed a standard procedure in which each anchor point is univocally assigned to the tile it lies on geometrically. First, the integer number of tiles \(N_{x}\) and \(N_{y}\) are calculated, respectively, for \(x\) and \(y\) directions:  
\[ \begin{cases}N_{x}=\left[\frac{x_{max}-u}{u}\right]\\ N_{y}=\left[\frac{x_{max}-v}{u}\right]\end{cases}  \tag{5}\]  
Figure 2: (**left**) The layout of the anchor points (blue circles) and test points in random positions (black dots) within the experimental area. (**right**) A tessellation of the research area is shown, with respect to the anchor points. where \(x_{max}\) and \(y_{max}\) are the maximum positional coordinates or any train or test data. The partial square bracket symbol \(\lceil\cdot\rceil\) indicates the rounding up to the next integer, i.e., the number of tiles. The values \(u\) and \(v\)--offset coordinates where the tessellation starts; \(w\), \(h\)--the width and height of the tiles are all passed to the MLP as parameters by the QPSO algorithm.