# Location Based Indoor and Outdoor Lightweight Activity Recognition System
## 3 Outdoor Activity Recognition System
### POI Identification Mechanism
#### 3.1.2 Second Iteration
When these clusters have a variability of less than 0.5 and the standard deviation of the distances is greater than 1.8, these clusters are considered as 'good'. On the contrary, they are considered 'bad' when the standard deviation of the distances is less than 0.1 (regardless of the variability). For all other cases, the cluster is considered as 'good'. * For those clusters that have more than two inputs and outputs, only the clusters that have no time jumps are considered 'good'. * The clusters are considered as 'bad' for all other cases. Once the stratification of the clusters has been performed, the labels assigned by DBSCAN are updated. Consecutive numerical labels (starting from the last detected cluster) are assigned to all points that have not been assigned to a cluster by DBSCAN. If several points have the same coordinates, they are considered part of the same cluster (this cluster is a'static jump'). A single GPS point that is not part of another cluster because it is a transition within the route will form a single point cluster. Then, the clusters are analyzed to verify if they are'static jumps' (all points of the cluster have the same coordinates). Finally, a map of relationships between the different clusters is generated based on the inputs/outputs between the clusters. This information is especially relevant to try to detect the multi-clustering error described above. **Clustering. ** The points of the route are iteratively processed and we check if they are the starting point of a cluster based on the following algorithm (see Figure 6). In this algorithm, it is considered that a multi-cluster can have a maximum of 5 levels. * Level 1: The cluster analysis starts from level 1, so the label of the first point to check is considered the initial label of this level. Then, we get the next point and check if it belongs to the first level (it has a label that belongs to level 1). If not, it would go to level 2 (the label of this new point will be the initial label of level 2). * Level 2: The next point of the route is taken and its label is checked. If it is a label belonging to level 1, it is returned to level 1. As we consider that all the points until now are part of the same cluster, we add the labels of level 2 as valid levels for level 1. If the label is not part of level 1, we check if it belongs to the labels of level 2, in that case, we consider that the point still belongs to level 2. Otherwise, we check if the label is part of 'good' labeled cluster, since a good cluster cannot belong to a multi-cluster, the process is considered completed and the actual cluster is considered with only those points belonging to level 1. If the cluster is not labeled as 'good', it would go to level 3 (the label of the new point being the initial label of level 3). * Level 3: Again, we get the next point of the route and its label is checked. If it is a label belonging to level 1, it is returned to this level and the labels of levels 2 and 3 are added to level 1. On the contrary, if it is a label of level 2, it is returned to this level and the labels of level 3 are added to level 2. Otherwise, a preliminary check is made before moving to level 4. The centroids of the three levels are calculated and it is checked if any of them form an angle less than 45\({}^{\circ}\), or level 3 has been labeled as a bad cluster, or it is a static point, in which case it is moved to level 4 (the label of the new point being the initial label of level 4). If the condition is not fulfilled, the process is finished and only the points belonging to level 1 would be part of the actual cluster. * Level 4: As in the other levels, the label of the next point on the route is checked. If it is a level 1 label, it is returned to this level and the labels of levels 2, 3, and 4 are added to level 1. If it is a level 2 label, it is returned to this level and the labels of levels 3 and 4 are added to it.