Fuzzy Inference and Sequence Model-Based Collision Risk Prediction System for Stand-On Vessel

Although the International Regulations for Preventing Collision at Sea (COLREGs) provide guidelines for determining the encounter relations between vessels and assessing collision risk, most collision accidents occur in crossing situations. Accordingly, prior studies have investigated methods to identify the relation between the give-way and stand-on vessels in crossing situations to allow the stand-on vessel to make the optimal collision-avoidance decision. However, these studies were hindered by several limitations. For example, the collision risk at the current time (t) was evaluated as an input variable obtained at the current time (t), and collision-avoidance decisions were made based on the evaluated collision risk. To address these limitations, a collision risk prediction system was developed for stand-on vessels using a fuzzy inference system based on near-collision (FIS-NC) and a sequence model to facilitate quicker collision avoidance decision making. This was achieved by predicting the future time point (t + i) collision risk index (CRI) of the stand-on vessel at the current time point (t) when the own-ship is determined to be the stand-on vessel in different encounter relations. According to the performance verification results, navigators who use the developed system to predict the CRI are expected to avoid collisions with greater clearance distance and time.


Introduction
According to data compiled by the Korea Maritime Safety Tribunal [1] on vessel accidents by accident type in South Korea over the past five years (2017-2021), the most common accident type was engine damage, followed by collision, safety accidents, grounding, fire and explosion, capsizing, sinking, and contact. Vessel collision accidents are of particular concern because they not only result in structural damage to the hull but also cause loss of life and property, as well as marine pollution. The main cause of collision accidents is operational negligence, such as non-compliance with general navigational principles, laws, and regulations, which accounts for approximately 95% of all accidents. Hence, to prevent these accidents, complying with the International Regulations for Preventing Collisions at Sea (COLREGs) [2] is essential. These regulations describe the appropriate collision-avoidance actions at optimal positions and times based on the analysis of a wide variety of collected data.
According to the navigation rules in COLREGs Part B, the collision-avoidance actions between vessels, shown in Figure A1, are performed considering Rules 5,7,8,[13][14][15][16][17] [3]. In particular, the collision risks are assessed, and encounter relations are determined according to the following rules, as shown in Figure A1: "Rule 7": Perform collision risk assessment using radar plotting or equivalent systematic observation and compass bearing of an approaching vessel.
"Rules 13-15": Determine whether it is a head-on situation, overtaking, or a crossing situation between the own-ship (OS) and target ship (TS).
The remainder of this paper is separated into different sections. Section 2 presents the theoretical background of this study. Section 3 outlines the system development process and describes the development of the collision risk prediction system for stand-on vessels in detail. Section 4 examines the performance evaluations based on a case study of the developed system, in addition to a detailed discussion of the results. Finally, Section 5 presents the main conclusions of the study.

Determining Encounter Relations and Required Avoidance Actions
The required avoidance actions in COLREGs rules 13-15 [2], i.e., (a) a head-on situation, (b) overtaking, and (c) a crossing situation, are schematized in Figure 1. In the headon situation, the OS and TS have equal responsibilities for avoiding each other. In the overtaking situation, a vessel is deemed to be overtaking when approaching another vessel from a direction more than 22.5 • abaft of its beam, and the overtaking vessel is not relieved of its duty to keep clear of the overtaken vessel until completely past and clear. In the crossing situation, the vessel that has the other vessel on its starboard side (i.e., the give-way vessel) must avoid the course of the other vessel and, unless circumstances permit, avoid crossing ahead of it (i.e., the stand-on vessel).  2 is a diagram for determining the encounter relation and the required avoidance actions between the OS and TS using the visibility range of navigation lights. Based on the course φ o of the OS, the position area of the TS is determined as the relative bearing α r , and the encounter angle φ e , where the course of the OS, φ o , meets that of the TS, φ t , in the determined area is calculated, thereby determining the encounter relation and the avoidance actions required by the OS. The circled areas indicate the TS; the OS determines the encounter relation in the circle based on φ e , and the OS's avoidance actions differ depending on the encounter relation. These are classified here as head-on, crossing (giveway), crossing (quarter lee give-way), crossing (stand-on), crossing (quarter lee stand-on), overtaking, being overtaken, and safe.
Here, α r and φ e between the OS and TS are geometrically related, as shown in Figure 3. Further, φ e is calculated using Equation (1); if it is a negative number, then 360 • is added.

Input Parameters
D CPA is the minimum distance at which the OS passes the TS when maintaining its current course and speed in an encounter. T CPA is the time taken to reach D CPA , the point at which the two vessels are the closest. D CPA and T CPA are obtained from geometric calculations, as shown in Figure 4 [3,23]. Here, (x o , y o ), φ o , and V o represent the position, course, and speed of the OS, and (x t , y t ), φ t , and V t indicate the position, course, and speed of the TS; α r is the relative bearing of the TS with respect to the OS. The relative movement parameters, D CPA , and T CPA are mathematically expressed using Equations (2)- (6).
where D r is the relative distance between the OS and TS, V r is the relative speed, φ r is the relative course, and α t is the true bearing of the TS. Here, the variance of compass degree (VCD) can be calculated using Equation (7).
2.2.2. CRI Inference Based on IF-THEN Rule D CPA , T CPA , VCD, and D r are set to the antecedent parameter values x 1 , x 2 , x 3 , and x 4 , and CRI is set to the consequent parameter value R C . The membership function for each fuzzy set is determined using Equation (8) The antecedent parameters x 1 , x 2 , x 3 , and x 4 are expressed as µ (D (CPA) ) , µ (T (CPA) ) , µ (VCD) , and µ (D r ) , and the consequent parameter R i c is the function f i (x 1 , x 2 , x 3 , x 4 ); f i (x 1 , x 2 , x 3 , x 4 ) is a polynomial expressed in Equation (9). If k i,0 , k i,1 , k i,2 , k i,3 , and k i,4 are the consequent argument set of rule i, and x 1 , x 2 , x 3 , and x 4 are 0, then f i has only the k i,0 term.
Therefore, there are a total of 256 rules in the fuzzy inference system based on nearcollision (FIS-NC) that comprise combinations of the membership functions, as shown in Table 1 [23]. Given that FIS-NC has a total of 256 rules, the function f i (x 1 , x 2 , x 3 , x 4 ) can be expressed as Equation (10).
The final output expresses all 256 consequent argument sets as a single unit, which is obtained using the weighted average f , as shown in Equation (11).
The calculated CRI ranges from 0.00 to 1.00; if the time point for collision avoidance of the give-way vessel is at least 0.01 or that of the stand-on vessel is at least 0.33, then a collision-avoidance action is taken.

Sequence Model
If it is assumed that the give-way vessel does not perform adequate clearing action early in a crossing situation, then the stand-on vessel's CRI gradually increases as all of the input parameters approach 0 over time. In this sequence data, since the past data influence present data, it is necessary to consider both sets of data for future prediction. A recurrent neural network (RNN) is a representative model that can be applied to sequence data to create a prediction model [31,32]. A backpropagation algorithm is used for training general RNNs. However, when error information is backpropagated to a point in the past, the gradient generally vanishes quickly. The usual approaches for mitigating this phenomenon include LSTM [33,34], Bi-LSTM [35][36][37], and GRU [38].

LSTM
In Figure 5, x t represents the input to the hidden node at time t, and h t indicates the node output at time t. The input gate i t plays a role in determining how much of the processing result of input information, x t , is represented in the memory cell, c t . The output value i t of the input gate is calculated using Equation (12) based on the input x t and its weight U i , the output h t−1 of the previous time point and its weight W i , and the bias term b i . Here, σ is the sigmoid function. The forget gate f t determines the ratio of the previous state value c t−1 of the memory cell that should be maintained at the current time point t. The value of the forget gate is calculated using Equation (13) based on input x t and its weight U f , the output h t−1 of the previous time point and its weight W f , and the bias term b f .
The value c t stored in the memory cell at time t is calculated using Equation (14); a t is the newly determined state value that is calculated using the LSTM model at time t.
where • indicates the product of the corresponding position elements of two vectors. According to the second equation, the value c t of the memory cell is determined by considering the ratio, f t , of the previous state value, c t−1 , and the ratio i t of the new state value a t . The output gate o t plays a role in adjusting the output of the value stored in memory cell c t . Here, U o , W o , and V o are the weights of the input, previous output, and previous state value, respectively, and b o is the bias term.
Output h t at time point t is calculated by multiplying the output gate values o t and tanh(c t ) for each element, as shown in Equation (16).

Bi-LSTM
Bi-RNN is a model in which the output at time point t is affected by not only the input and hidden layer values at a previous time but also the input and hidden layer values at a later time. Figure 6 shows the architecture of a Bi-RNN, in which the output is obtained from two hidden layer nodes. The connected lines from left to right indicate that the past has an influence. In contrast, the connected lines from right to left indicate that the future influences the present. Here, Bi-LSTM uses an LSTM model for each hidden layer of the former. If we define the weight matrix between the input and forward layers as U → , the weight matrix between the forward layers as W → , and the bias term vector of the forward layer as b → , then the forward layer value → h t at time t can be calculated using Equation (17).

Algorithm 1: Algorithm for execution of LSTM
If we define the weight matrix between the input and backward layers as U ← , the weight matrix between the backward layers as W ← , and the bias term vector of the backward layer as b ← , then the backward layer value h t at time t can be calculated as in Equation (18).
The output layer value y t at time t is calculated as shown in Equation (19) by combining the forward layer value → h t and backward layer value h t . V → is the weight matrix between the forward and output layers, V ← is the weight matrix between the backward and output layers, b o is the bias term, and f is the activation function.
Like LSTM in RNN, the GRU model is proposed to solve the vanishing gradient problem, and its internal operation is simpler than that of the LSTM. Figure 7 shows the architecture of the GRU model. While LSTM has three gates, GRU has only two gates: reset and update. The reset gate r decides how to combine input x t and existing stored content h t−1 . The reset gate performs computations according to Equation (20). Equation (21) can be used to calculate a new internal state value ∼ h t by combining input x t and the existing stored content h t−1 according to the reset gate value r t .
The update gate z determines the ratio that represents the existing stored value h t−1 and newly calculated value h t . The value of the update gate z t is calculated using h t−1 and input x t according to Equation (22).
The internal state value, h t , is calculated by combining the existing stored content h t−1 and newly calculated internal state value h t according to the updated gate value obtained from Equation (23).
The internal state value, h t , is the output value without modification. Therefore, in the GRU model, the internal state value and output data have the same dimensions.

System Development Process
As shown in Figure 8, the development process of the stand-on vessel collision risk prediction system is divided into data collection and system development. In data collection, sectors I, V, and VI in the encounter relation determination diagram of Figure 2 are established using α r , and in the determined sectors, φ e is used to judge whether the vessel is a stand-on vessel. Second, if the vessel is judged to be a stand-on vessel, then according to the guide on collision avoidance rules [30], the input parameters D CPA , T CPA , VCD, and D r are calculated from 5 nautical miles (nm), the boundary point where the give-way vessel and stand-on vessel lose freedom of movement, to the point where both vessels collide. Third, the calculated parameters are input to FIS-NC to infer the CRI. Fourth, the CRIs from 0.01 (time point for collision avoidance of the give-way vessel) to 0.33 (time point for collision avoidance of the stand-on vessel) that are inferred based on the FIS-NC and input parameters used for this inference are collected. During system development, the collected input parameters and CRIs from 0.01 to 0.33 are designated as the input and target data of the sequence data, respectively. Additionally, after the values are input to LSTM, Bi-LSTM, and GRU and learned to develop a stand-on vessel collision risk prediction system for each case, their performances are compared.

Simulation Scenario
After configuring the scenarios shown in Table 2, data were collected via simulation using MATLAB. First, we set the speed of both vessels to 15 kn, the highest speed limit in Korean ports [39]. Second, the automatic identification system (AIS) dynamic information was updated according to the required changes in the vessel's speed and course to prevent a collision between the vessels. Since the reporting period was 4 s when the speed was set to 15 kn, the AIS period was set to 4 s [40]. Third, the D r was calculated considering the relative speed of both vessels and an AIS period of 4 s, according to the guide on collision-avoidance rules [30], from 5 nm, the boundary point where the give-way and stand-on vessels lose freedom of movement, until collision. Finally, in sectors I, V, and VI, the OS's heading was set to 000 degrees as the reference, and the TS's heading was set as 11.25 • to allow the OS to become the stand-on vessel for the circles in sectors I, V, and VI. Here, the α r of the TS for each OS reference was set to 360 • in sector I, 270 • in sector V, and 320.625 • in sector VI.

Collected Data
Based on the simulation results for each scenario, the input parameters D CPA , T CPA , VCD, and D r and the CRIs that were inferred by applying the parameters in FIS-NC were collected from sectors I and VI (1680 data) and sector V (2520 data). Table 3 shows the averages of the D CPA , T CPA , VCD, D r , and CRI data collected from sectors I, V, and VI from CRI 0.01 (the time point for collision avoidance of the give-way vessel) to 0.33 (the time point for collision avoidance of the stand-on vessel). These values represent the characteristics of the sequence model for learning data according to the flow of time. As a result, 40, 39, and 40 data values were acquired in sectors I, V, and VI, respectively.

System Development
D CPA , T CPA , VCD, and D r , which are the input data obtained via data collection, and the CRI, which is the output data, were input to LSTM, Bi-LSTM, and GRU for learning. To predict the CRI for a certain time step in the future, the target data were determined using data that were moved twice at each time step of the input data, as shown in Figure 9. Among all vessels, the ship with the slowest reaction time is the tanker. Therefore, the difference in time was applied using a tanker. In the ship handling simulator shown in Figure 10, the laden 330,000-tonnage tanker ship experienced a kick phenomenon from its original course. The time point of this incidence was taken as the reaction time, which was measured at 8 s via the ship handling simulator in Figure 10.  To compare the systems developed using LSTM, Bi-LSTM, and GRU, each neural network was configured with the same conditions (hidden nodes of identical layers, number of learning epochs, gradient threshold, and initial learning rate). Adaptive moment estimation (ADMA), a method for learning weights while adjusting the learning rate for each weight, was utilized during learning. The root-mean-squared error (RMSE) was used as the selection criterion for each prediction system. RMSE is a measure of prediction error and was used to show the difference between the CRI (R c i ) predicted using the test data of the explanatory variable in the system trained with the training data and the CRI (R c i ) contained in the test data of the response variable. It can be calculated as shown in Equation (24). Figures 11-13 show the learning results of sectors I, V, and VI for the test data predicted using LSTM, Bi-LSTM, and GRU. According to the results, the sequence model with RMSE values that were closest to 0 in all sectors was Bi-LSTM.

System Application
The collision risk prediction system for stand-on vessels that was developed based on Bi-LSTM can be implemented using the following Algorithm 2. Initially, when the CRI is less than 0.01, the OS maintains its original course and speed. However, when the CRI is 0.01 or greater, the OS determines whether the TS is located in sectors I, V, or VI depending on α r . In each sector, φ e is then used to determine whether the OS is a stand-on vessel; if so, then the collision-avoidance time point of the stand-on vessel, CRI = 0.33, is predicted using the developed system. Algorithm 2: Algorithm for developed system application Input: α r , φ e , encounter relation E r , D CPA , T CPA , VCD, D r output: CRI 1 Initialize CRI < 0.01 ← keep course and speed 2 while CRI >= 0.01 do 3 if TS is in "sector I, V, and VI" decided with α r 4 if (φ e > 247.5) and (348.75 > φ e ) or (φ e > 180) and (348.75 > φ e ) or (φ e > 247.5) and (348.75 > φ e ) then 5 decide E r ← crossing situation (stand-on, quarterlee stand-on) of OS 6 predict CRI 0.33 ← the time point for collision avoidance of stand-on vessel 7 else 8 decide E r ← head-on situation or overtaking or Safe of OS 9 end 10 end 11 end

Case Study
According to the Korea Maritime Safety Tribunal decision [1], on 14 December 2011 at approximately 06:24 at 34 • 33 17" N, 128 • 01 49" E, PACIFIC CARRIER (stand-on vessel), which was carrying 133,104 t of coal to Samcheonpo Port, collided with HYUNDAI CONFIDENCE (give-way vessel), which was carrying 3133 twenty-foot equivalent units (TEUs) of containers from Gwangyang Port to Busan Port. The two vessels encountered a crossing situation wherein HYUNDAI CONFIDENCE was unable to avoid PACIFIC CARRIER, and the two vessels collided, as shown in Figure 14. Consequently, PACIFIC CARRIER experienced a puncture in the hull approximately 20 m long and 10 m high at the center of the left side, severe damage to cargo holds 4, 5, and 6, and approximately 70 cm of flooding in the engine room. HYUNDAI CONFIDENCE experienced severe damage to the bow and cargo hold 1. In this study, we determined whether it was possible to perform a collision-avoidance action with sufficient space and time clearance by applying the developed system to PACIFIC CARRIER and determining the encounter relation between the give-way and stand-on vessels in a crossing situation.  Table 4 shows the trajectory data of both vessels based on the AIS information. The trajectory data were interpolated in 30 s increments and simulated using MATLAB, as shown in Figure 15. The trajectory numbers were set to simultaneously identify the movements of both vessels. Based on the analysis of trajectories from the AIS information of both vessels, trajectory number 1 had a D r of 6.4 nm and a relative speed of 27 kn and showed no encounter relation. Given trajectory number 2, however, with a D r of 5.5 nm and a relative speed of 21.2 kn, based on PACIFIC CARRIER (stand-on vessel), the encounter relation in sector VI of Figure 15 was initiated, and neither vessel took appropriate collision-avoidance actions, which led to the collision accident. To evaluate performance, FIS-NC and the developed system were applied to PACIFIC CARRIER (stand-on vessel), and the results are shown in Figure 16 and Table 5. For FIS-NC and the developed system, in trajectory number 3, the CRI gradually increased according to the input variable from 0.01 and higher (time point for collision avoidance of the give-way vessel). In trajectory number 4, however, the developed system gave a greater D r and T CPA clearance of 0.297 nm and 1 min, respectively, compared to FIS-NC at CRI = 0.33 and higher (time point for collision avoidance of the stand-on vessel) and recommended a collision-avoidance action for PACIFIC CARRIER (stand-on vessel).

Discussion
By applying the Algorithm 2 for the developed system to PACIFIC CARRIER (standon vessel) in a real collision accident, it was not only possible to accurately determine whether the vessel was the stand-on vessel in a changing encounter relation, but a collisionavoidance action was also recommended for PACIFIC CARRIER (stand-on vessel) for CRI values of 0.33 and higher (time point for collision avoidance of the stand-on vessel) assuming that HYUNDAI CONFIDENCE (give-way vessel) did not perform an appropri-ate collision-avoidance action. However, FIS-NC also recommended the same collisionavoidance action for PACIFIC CARRIER (stand-on vessel) from CRI 0.33 and higher (time point for collision avoidance of the stand-on vessel). Because each system infers and predicts different CRIs according to changes in the input variables at the same distance and time, the clearance distance and time for PACIFIC CARRIER (stand-on vessel) to avoid collision were different. To evaluate whether the avoidance actions recommended at the clearance distance and time for the CRIs inferred and predicted using each system were appropriate, the results were analyzed based on a guide for collision avoidance rules [30]. Accordingly, if the give-way vessel does not take appropriate action in the open sea according to Rule 16, the stand-on vessel must take a collision-avoidance action within 6 min at approximately 2 to 3 nm. We compared D r and T CPA of FIS-NC and the developed system when the inferred and predicted CRIs were 0.33 and higher, as shown in Table 6. The developed system recommended collisionavoidance actions that satisfied the distance and time requirements in the guide to collision avoidance rules. Hence, navigators who use the system to predict CRI are expected to be able to safely avoid collisions while securing more clearance distance and time.

Conclusions
In this study, a collision risk prediction system was developed using FIS-NC and a sequence model to enable stand-on vessels to perform safe collision-avoidance actions while securing appropriate clearance distance and time. This was achieved by predicting the future CRI if the OS was determined to be a stand-on vessel in various encounter relations. The development of the collision risk prediction system for stand-on vessels was divided into data collection and system development. In data collection, when the OS was determined to be the stand-on vessel according to the encounter relation judgment guidelines, CRI values from 0.01 (time point for collision avoidance of the give-way vessel) to 0.33 (time point for collision avoidance of the stand-on vessel) that were inferred using FIS-NC and the input parameters D CPA , T CPA , VCD, and D r used for this inference were collected. In system development, the collected input parameters and CRIs from 0.01 to 0.33 were designated as the input data and target data of the sequence data, respectively. Additionally, after the values were input to the sequence models (LSTM, Bi-LSTM, and GRU) and learned to develop a stand-on vessel collision risk prediction system for each case, the optimal system was selected. According to the results, the collision risk prediction system for collision avoidance of stand-on vessels using Bi-LSTM demonstrated superior performance. Among vessels that experienced collision accidents, the developed system using Bi-LSTM was applied to a stand-on vessel to evaluate its performance. In this instance, the system recommended a collision-avoidance action that could be safely performed by the stand-on vessel while also securing more clearance distance and time compared to conventional approaches. However, despite the diverse maritime navigation environments and vessel navigation information encountered during voyages, only the input parameters D CPA , T CPA , VCD, and D r are required for the proposed system. Therefore, in future studies, systems that can predict the optimal CRI by considering additional navigation environmental factors should be investigated.

Data Availability Statement:
The data that support the findings of this study are available from the corresponding author upon reasonable request.

Conflicts of Interest:
The authors declare no conflict of interest. Appendix A Figure A1. Procedure for collision avoidance based on COLREGs ( [3]. 2022, Namgung, H.).