# Edge Computing Approach for Vessel Monitoring System
## 3 Proposed Approach
### Clustering Geographic Position  
Several approaches were applied to determine the geographic clustering position of fishing points, such as: K-means, density-based cluster, and DBScan. The output is the identification of the usual fishing zones for each vessel. If newly collected data identifies the vessel as being outside these zones, data is sent and possible alerts can be generated. K-means [23] is a cluster unsupervised learning algorithm that divides the partition of n geographic measurements into K clusters, in which each observation belongs to the cluster with the nearest mean. This approach divides the space into K zones. K-means [23] is one of the simplest algorithms that solve the well-known clustering problem, with low CPU and memory usage. The main issue with its implementation is the definition of K, which is not easy to define among a diversity of fishing vessels. The K centroids are stored at the vessel, so that it is possible to compare the collected data with a distance to this centroid. If a set of new alerts is identified in a short-range period (configurable parameter), the K-means algorithm is performed with K + 1, because it is very likely that this is a new fishing zone. Figure 7: Vessel 2 GPS points. Density-based cluster: Density-based clustering algorithms [24] is another implemented approach that complements the previous with the need of computer CPU and memory. This algorithm finds clusters based on the estimation of the density of data points in a region. This approach has the advantage of finding fishing zones without a previous definition of the number of clusters (K). Based on the GPS collected data, the algorithm clusters are dense regions in the data space, separated by regions of lower object density (noise) [25]. The conceptual approach of density-based clustering is that for each instance of a cluster, the neighborhood of a given radius (Eps) must contain at least a minimum number of instances (Min Pts). This approach allows for the identification of newly collected data out of this cluster (with a radius to the group centroid bigger than the other group elements to this centroid). DBScan: DBScan is a density-based spatial clustering for data with noise [26]. It is a density-based clustering algorithm, because it works based on data density distribution points. After some testing during 2018, and based on Table 1, it was decided that the DBScan is the best approach for this case. Between the K-means algorithm and the density-based cluster algorithms, it was decided that the density-based cluster was of great advantage to identify the probability of the new GPS point belonging to a cluster in the probabilistic cluster distribution. Consequently, the user can define what the best configuration is for his case. The clusters themselves are equal between K-means and density-based cluster, as density-based cluster uses K-means to define the centroid--it only differs by adding a layer to define the area of density per cluster. To decide the number of clusters, the elbow method [27] was used for the within-cluster sum of squares, as can be seen in Figure 8. Sum of squared error by number of clusters. The within means the distance the vectors in each cluster are from their respected centroid. The goal is to get this number as small as possible. One approach to handle such objective is to run the K-means clustering multiple times, raising the number of the clusters each time. Then it is possible to compare the within each time, stopping when the rate of improvement drops off. The better case corresponds to find a low within while still keeping the number of clusters low. The elbow method is visual. The idea is to start with K = 2, and keep increasing it in each step by one unit, calculating the clusters and the cost that comes with the training. At some value for K the cost drops dramatically, and after that, it reaches a plateau when you further increase it--this is the K value we want.