# A Machine Learning Approach to Determine Oyster Vessel Behavior
## 4 Materials and Methods  
A flow-chart of our approach to develop a machine learning method to determine oyster vessel behavior is shown in Figure 2. In the following sections, we describe the individual steps outlined in the flow-chart. Step 1. Collecting Oyster Trajectory Data from VMS Module: We collected oyster vessel trajectory data from the VMS module installed in all the vessels fishing in Louisiana's public oyster grounds. The VMS module allows for monitoring of vessels activities to ensure compliance with the fishing regulations. These modules were provided free-of-charge to vessels fishing in the public oyster grounds of Louisiana, with the ship's operator only needing to provide minimal maintenance to the module [2]. Figure 1: Overview of the public oyster grounds of Louisiana. Public fishing grounds are outlined in purple. Figure 2: Flowchart of the overall project: from vessel trajectory data-generation to usage of the data in machine learning to predict vessel behavior. Two features were used to determine the behavior of a vessel: instantaneous speed, which is how quickly the vessel is moving and net speed, which is the average speed of the vessel at that time. The VMS module on board, an oyster vessel produces a ping approximately once a minute, giving a vessel ID, a timestamp and a set of coordinates. These data can be utilized to infer information about fishing behavior and effort. Step 2. Path Creation: In our implementation, we designed a rule-based trajectory segmentation technique which depends on the speed of the vessel. Pings with the same vessel ID and timestamps within 20 min of each other are concatenated together into a path. Points outside of the 20-min window are not appended to any previous paths produced by that vessel. Instead, they are used to create a new path, if they contain at least 10 points captured within 20 min of each other. Vessel paths show the movement pattern of a vessel over time and can provide insight into what the vessel was doing at a given point. Figure 3 shows two idealized movement patterns of oyster vessels, consisting of five points each. As shown in Figure 3A, linear movement is associated with vessels that are traveling. Circular movement is associated with vessels that are poling and docked, as shown in Figure 3B. Fishing can occur during either movement pattern, but is more common during circular motion. Step 3. Calculating Speed of Vessel: The speed of vessel at a point helps to determine if the vessel was performing an activity or traveling. Vessel's speed is defined as the distance between two consecutive points in a path, over the difference in seconds between the last point's VMS ping and the first point's VMS ping. The distance between two consecutive points in a path can be determined by using the _harvesting_ formula [14] (see Equations (1) and (2)). The _harvesting_ formula is a method to compute the distance between two points on the surface of a sphere which is given by:  
\[\mathit{hav}(d/r)=\mathit{hav}(\mathit{lat}_{2}-\mathit{lat}_{1})+\cos(\mathit{ lat}_{1})\;\cdot\cos(\mathit{lat}_{2})\;\cdot\mathit{hav}(\mathit{lon}_{2}- \mathit{lon}_{1}) \tag{1}\]  
where, _hav_ indicates _harvesting_ function, which is defined in Equation (2):  
\[\mathit{hav}(\theta)=\sin^{2}(\theta/2)=\frac{1-\cos(\theta)}{2} \tag{2}\]  
In Equation (1), \(d\) is the distance between the two points, \(r\) is the radius of the sphere, \(\mathit{lat}_{1}\) indicates the latitude of the \(i\)-th point and \(\mathit{lon}_{j}\) indicates the longitude of the \(j\)th point. In Equation (2), \(\theta\) indicates an angle. In our application, \(d\) is the distance between two consecutive pings of a VMS module and \(r\) is the radius of the earth, which is approximately 6371 km. Step 4 and 4.1. Filtering of Erroneous Data: Instantaneous speed is calculated using the distance between two consecutive points, it is unlikely that the point for which the speed is calculated will exceed 50 m/s. Thus, points with speeds over 50 m/s are discarded as erroneous data.