# Collision Avoidance Behavior Mining Model Considering Encounter Scenarios
## 2 Methodology
### Ship Collision Avoidance Behavior Recognition
#### 2.2.2 Curvature-Based Ship Collision Avoidance Behavior Recognition
Considering that the ship's navigation process is disturbed by external conditions that cause fluctuations in the heading or the ship's position and that the AIS data transmission process is also prone to data errors, the turning factor \(\Delta k\) is set to verify the authenticity of the turning point. The assignment standard of the turning factor \(\Delta k\) is as follows: if the absolute value of curvature at the center of the window is \(\geq\)\(C_{L}\), \(\Delta k\) is increased by 1; if there is a value but the absolute value of curvature at the center of the next window is \(\leq\)\(C_{L}\), then \(\Delta k\) is set to 0. This is shown in Equation (11):  
\[\Delta k=\left\{ \begin{array}{l}\Delta k+1,|C(t_{i})|\geq C_{L}\\ 0,|C(t_{i-1})|\geq C_{L},|C(t_{i})|<C_{L}\end{array} \right.\ \ (i>1) \tag{11}\]  
In actual ship navigation, due to the ship's motion and operational characteristics, the ship's turning trajectory is often a continuous asymptotic process. Therefore, in the window sliding process, if the curvature of the window at the moment \(t_{i}\) is less than \(C_{L}\) the curvature of the previous moment \(t_{i-1}\) is greater than or equal to \(C_{L}\), and \(\Delta k_{i}\) is equal to 0 and \(\Delta k_{i-1}\) is greater than or equal to 6, this means that the ship has already accomplished  
Figure 5: Schematic diagram of the sliding window algorithm. at least 6 steering maneuvers in the same direction and is entering the stage of straight sailing. The \(\Delta k_{i-1}\)th moment point before the current moment is taken as the steering point of the ship. The parameter constraints when the steering point is determined are as in Equation (12):  
\[\left\{ \begin{array}{l}\Delta k_{i}=0\\ \Delta k_{i-1}\geq 6\\ |C(t_{i})|=C_{L}\\ |C(t_{i-1})|\geq C_{L}\\ \end{array} \right. \tag{12}\]  
By traversing the ship's trajectory within the window and calculating the curvature of discrete trajectory points while recording the turning factor, the algorithm can avoid distortions in ship trajectories caused by wind, waves, currents, and data transmission issues, thus identifying the ship's turning points. The ship's turning point recognition process is shown in Figure 6. In this figure, the circle represents the center of the ship, the motion illustrated corresponds to the motion measured or observed from this central point, and the arrow represents the course of the ship. After identifying the turning point of the ship, it is necessary to judge whether the turning action of the ship is an active collision avoidance action, i.e., whether there is course recovery behavior. Course recovery behavior in the ship's trajectory change is manifested as follows: the ship will keep the turning heading straight for a certain distance after taking avoidance action, and, when the collision risk is eliminated, the ship's trajectory will include a turning action in the opposite direction of the initial turning point to return to its original course. In this paper, we set the recovering factor \(R\). The assignment standard of \(R\) is as follows: when the curvature of the center point of the window is positive, \(R_{i}=+1\); when the curvature of the center point of the window is negative, \(R_{i}=-1\). We take the curvature of the turning direction to the left as positive and the curvature of the turning direction to the right as negative. When the ship's turning behavior is recognized for the second time according to the fixed window rule, the \(R_{i}\) value of the resumption turning point is recorded, and if the \(R_{i}\) values of the two times add up to 0, it means that the ship carries out a turning action opposite to the first one and resumes its course, and this turning action is a collision avoidance action, as shown in Figure 7.  
Figure 6: Window sliding to recognize the ship’s turning point.