# Data Analysis, Simulation and Visualization for Environmentally Safe Maritime Data
## 4 Marine Simulation System
### Data Description and Preprocessing  
Figure 3 demonstrates the first phase of the data gathering approach. As one could observe from the above figure, the first operation is about constricting a spatio-temporal big data framework for building simulation processes on top of it. The current design supports the inclusion of a Region of Interest (RoI) that is adjustable is size, with granularity set to a value of about 38 km-1500 km\({}^{2}\) for our area of interest. Different levels of granularity were thoroughly evaluated and in spite of being supported, results have shown that low areas pose significant computational and managerial restrictions to the latter components of the system such as the data mining and the Bayesian network component without gaining significant forecasting outcomes. The second step is the retrieval of static and dynamic ship data. More specifically, the location, the average speed in knots and the cargo, associated in a scale of A to D, with A considered the most hazardous. Additionally, data about sea conditions such as wave height was automatically retrieved by the POSEIDON system of the Hellenic Center of Marine Research (HCRM). These features are used to construct the spatial objects. From such objects, input parameters needed by the simulator will be estimated. Such parameters include the number of ships found within a RoI, the average speed, the number of ships that carry hazardous load and the average distance between ships. As depicted in Figure 3, these parameters are aggregated per time period, from a day to a week and finally to a month. In order to represent data in a spatial dimension, the freely available Spheres library was used. Despite the fact that PostgreSQL provides methods for creating, indexing and querying spatial data, the Spheres library was preferred due to its programming properties and the simplicity in use. The same approach is followed towards retrieval of exogenous conditions such as the sea wave-length. Such data are retrieved by the POSEIDON system, which is linked to our tool via RESTful interconnection. The preprocessing tool's main task is to create a list of aggregated criteria per RoI, such as the number of ships, the average speed within this area, the density of the ships in the area and the sea conditions. The next phase focuses on applying clustering, an unsupervised data mining technique to these regions. Clustering organizes RoIs into groups of similar behavior, aiming at identifying in an unsupervised manner the hazardous and non-hazardous clusters. Various clustering algorithms were examined and evaluated such as K-means, Expectation Maximization and DBSCAN. Upon completion of this unsupervised phase, statistical measures were extracted for each cluster and the danger level was assigned by a domain expert, resulting in a set of six dangers levels. More specifically, as mentioned in the Acknowledgements Section, the domain expert was the Hellenic Ports Association (ELIME), a collaborator of project AMINESS that funded this work. The method for assigning these levels was through survey forms to the members of the ELIME association. The process for allocating the optimal number of clusters is explained in the following section, namely Experimental Results. The exact methodology is depicted in Figure 4.  
The last step of the data gathering approach is to update the internal database with information from the above process. In order to help users evaluate the outcome of this process, a graphical,  
Figure 4: The main characteristics of the clustering subsystem. Figure 3: The data preprocessing process. web interface has been developed. The interaction course is depicted in the two figures below (Figures 5 and 6):  
On the left side of the page, the user can choose the criteria on which simulation will be based on.