# A Framework for the Detection of Search and Rescue Patterns Using Shapelet Classification
## 3 Proposed Methodology
### Pre-Processing of Real Trajectories  
The synthetic trajectory data and so the time-series that are fed to the GENDIS algorithm, comprise only a few values that correspond to the major points in a vessel trajectory that define the pattern. In a real trajectory, the length of the time-series is much bigger and thus it is important to properly pre-process it in order to capture the sub-segment that contains the pattern and extract the shapelets that can assist in its correct classification. For example, the creeping line pattern in the real dataset has been recorded in a trajectory of more than 500 points, whereas the GENDIS algorithm has been trained with time-series of length 25. In order to scale down real data trajectories (or large segments of these trajectories) to the time series of appropriate length without loosing useful information, we propose  
Figure 4: A synthetic expanding square maneuver in the 2-D space (**left**) and the respective shapelet of the vessel bearing (**right**). a scale down algorithm that focuses on the interesting points of the trajectory. More specifically, the algorithm considers as interesting points:  
* those that have a bearing change above a threshold (a predefined parameter). In our experiments, the bearing change threshold is set to 30 degrees, expressing that a point is kept when the difference in bearing from its previous step is larger than this threshold. * those that have a distance from their previous point greater than the half of the mean distance value so far. For this purpose the distance covered between every two consecutive points is calculated and the mean distance is updated every time a new point is examined. With this technique all the points that are spatially close are ignored (especially, when the vessel is stopped). * the points that can be of interest for any of the two previous reasons but have not been recorded right after (or a few recordings after) point already marked as interesting. When a trajectory comprises points in a straight route, without any stops or turns, then there is a chance that it will be scaled down to a time-series with only a few interesting points. In this case, the algorithm tries to fit more points between the selected points, at equal distance, so that the final time series is more representative of real data and adjusts perfectly to the target length. Even in that case, when the final time series does not have the proper length it is rejected from the classification process. In other words, the scale down algorithm, not only acts as a mean to reduce the size of real data trajectories, without losing meaningful information but also as a filter that can separate interesting trajectories from trajectories that have too few or too many values to be predicted as SAR patterns. Other alternatives tried in this work, was the Ramer-Douglas-Peucker trajectory simplification algorithm [PERSON] (1983) and a simple segmentation to smaller trajectories, as well as combinations of the scale-down and simplification techniques. More specifically, we evaluated four different techniques, as depicted in Figure 5. In the \"Scale-down\" technique, the whole time-series of a vessel's trajectory is first extracted and then our proposed method is applied to select only the most representative values (values of high change). In the \"RDP & Scale-down\" strategy, the RDP algorithm is first applied to remove redundant trajectory points and then the scale down technique is applied to further reduce the time series length. In the \"Trajectory segmentation & Scale-down\" technique, the large trajectory is split to subtrajectories of smaller size and then the Scale-down technique is applied. In the \"RDP only\" technique, the RDP algorithm is applied, with a parameter that results in a time-series of the appropriate length, so the scale-down is not necessary. Figure 5: The different strategies of pre-processing real trajectories, the classification and evaluation of results.