# A Framework for the Detection of Search and Rescue Patterns Using Shapelet Classification
## 3 Proposed Methodology  
The detection of SAR maneuvers in AIS data can easily be considered as a time-series classification task. In this case, the position of the vessel at consecutive timestamps and/or other navigation features, such as speed, bearing or bearing change are the input to a time-series classifier, that distinguishes between a normal trajectory and a SAR trajectory. The main pre-requisite of any classification task is the existence of a training dataset, that will be used to create the appropriate model that will later be used for the classification of an unknown instance to a class. The main problem concerning the classification of vessel trajectories, either to SAR maneuver types, or to normal or outlying patters, is the lack of labeled trajectory instances that can be used for the training and validation of a classifier. In order to tackle this problem, in this work, we developed a trajectory generator, which is employed in the first step of the training process, as depicted in Figure 2. The details of the trajectory generator are explained in Section 3.1. The second step of the training process comprises some data pre-processing tasks, that are necessary for formatting the data to the format required by GENDIS. The AIS data comprises latitude  
Figure 2: The workflow of the model creation process. and longitude information as well as course over ground and bearing at different timestamps, which are not always at equal distances. Additionally, it contains a lot of redundant information in the form of consecutive positions in which the vessel have the same speed, bearing and so forth. So, it is necessary to pre-process trajectories in order to keep only the useful information, correct any missing or wrong values, or even calculate more features (such as bearing change). Another problem that has to be handled at this step, is the complexity of the GENDIS shapelet transformation, which makes it impossible to train using very long time series without enough hardware resources. A vessel's trajectory can have several thousand samples and a meaningful and fully recognizable pattern can be observed to trajectories with hundreds of samples. So several techniques are used and a certain original scale down technique is introduced, which even if it's not optimal, produced undoubtedly good results. The details of this preprocessing process are explained in Section 3.3. The third step, comprises the shapelet extraction using the Genetic extractor and is strongly connected to the last step, that trains a Logistic Regression classifier using the trajectories transformed into the shapelet feature space. The output of this process comprises two models: (i) the time-series transformer, which has been fitted to the training data and can take any time-series and map it to the shapelet feature space, (ii) the Logistic Regression classifier that can take any time-series represented in the shapelet feature space and assign it a class label. The details of this step are given in Section 3.2. More than one time-series transformers (shapelet models) can be trained, using different features of the labeled trajectories (e.g., speed, bearing, bearing change, etc.) so that they can map a trajectory to vectors in the respective shapelet feature spaces. The concatenated vectors can then be used as input to the trained classification model in order to improve the classifier performance, through the introduction of more shapelet features. The whole process is depicted in Figure 3. The shaded boxes represent the models trained in this process (both the shapelet transformation models and the classifier). Dashed arrows represent the use of the trained models for the transformation of time-series to vectors in the shapelet space and for the classification of unknown shapelet vectors respectively (pointed by thick arrows that connect the model to the transformation or classification action).