## 5 Feasibility Study Through System Simulations
### Simulation Process
#### 5.6.3 Execution Flow of the Model Training Function
The reference center position coordinates of the sub-tiles are returned in the data structure \(vSubTilesCenterPosit\) by the functions \(FFixedTiles()\) and \(FMovingTiles()\). In the pattern-matching methods 2-SingFingIn-AggPosOut and 4-MultFingIn-ClassOut, the ground truth reference position is the center of the tile. This is consistent with the final position estimate in these methods calculated from the aggregated sub-tile position estimates using Equations (2) and (3) in method two and from the mapping from the tile-class labels to the center positions of the fixed tiles using Equations (4) and (5) in method four. * In step 9, the Cumulative Density Function (CDF) of the error distances resulting from the MTV dataset is calculated. This step is part of the iterative process of generalizing the model for moving tiles (introduced in Section 5.5). The goal is to select the model that generalizes best for moving tiles by selecting the model that minimizes the 95 th percentile of the CDF of the error distances for all of the moving tiles in the MTV dataset among the model training iterations initiated with different random weights. In the first iteration of the loop started in step 5, the value of the error distance at the 95 th reference percentile, \(P_{R}\), of the CDF is retained as the minimum error, and the error distances and model weights for this iteration are temporarily stored and kept as the best model in step 10. From the second iteration onward, the error distance at the 95 th reference percentile is compared against the minimum error obtained in a previous iteration. If the error distance at this percentile is smaller than the minimum error obtained in a previous iteration, this value is retained as the minimum, and the error distances and model weights for the current iteration are temporarily stored and kept as the best model in step 10. The training process is repeated again, with different random initial weights, repeating the process from step 5 until the number of iterations \(N_{I}\) (given in Table 9) is completed. The number of iterations is checked with the condition of step 11. For convenience, in step 10, the error distances obtained from the testing dataset of moving tiles, MTT, are also temporarily stored. The process described above is indicated by the label _Mechanism 3_. * Finally, in step 12, the model weights that produced the smallest error distance at the given CDF percentile are kept as the best and final weights for the model. The best weights are used to calculate the error distances in the testing dataset of moving tiles, MTT. Actually, for convenience, the estimation of the positions and calculation of the error distances for the MTT dataset are carried out in steps 7 and 8, and the best results, along with the corresponding weights, are temporarily stored in step 10. In addition, the error distances resulting from the MTT dataset using the best weights are permanently stored in step 12 to perform later comparisons among the other pattern-matching methods and among different tile arrangements (introduced in Section 5.9). The details of the settings for each pattern-matching method are detailed in Section 5.8, and the results obtained are presented in the next section. Figure 15: Block diagram of the execution flow of the model training function \(FModelTraining()\). Numbers inside circles represent the execution steps, these are explained in the main text.