In this section, the execution of the simulation will be detailed. This involves specifically outlining the model ship’s exact specifications and the method for calculating its trajectory. CDC and the ANFIS will be introduced together with the precise approach to their integration within the study. Furthermore, the validation of the simulation environment and scenarios will be included to ensure the robustness and reliability of the results.
2.1. Configuration of the Scenario
Following the approach of Lee and Furukawa [
3], this study assumes that a collision may occur when two ships are in close proximity within a confined waterway. Accordingly, it is essential to construct scenarios that identify regions where the give-way ship alone cannot prevent a collision due to the proximity of the encounter. To this end, the analysis focuses exclusively on crossing situations in which the crossing angle between the two ships (
) ranges from 2° to 90°, as illustrated in
Figure 1.
In
Figure 1, the horizontal and vertical axes denote the x and y coordinates, respectively. The black and red ellipses represent the own ship (OS) and the target ship (TS), respectively, while the red curved dotted line illustrates the initial trajectory of the TS.
denotes the relative heading angle between the two ships.
The maximum value of
is limited to 90°, as this represents the most critical crossing scenario in a narrow waterway, where the give-way ship may be required to undertake an evasive maneuver involving a 90° heading change to avoid a collision with the stand-on ship, as shown in
Figure 2.
In the scenario presented, the OS is designated as the give-way ship, while the TS serves as the stand-on ship. As illustrated in
Figure 1, only the give-way ship employs rudder control to perform collision avoidance maneuvers. The rudder angle is used to compute the ship’s trajectory, with a maximum angle of 35° applied to simulate emergency maneuvering.
For consistency, both ships are assumed to sail at the same speed and are modeled with identical dimensions. The ship models used in this study are bulk and container ships, which differ in the block coefficient and maneuvering characteristics. Given that container ships typically exhibit superior turning performance compared with bulk ships [
4], the outcomes of this study are expected to differ from those reported previously. Additionally, in this study, the simulation was conducted without applying sea conditions. The ship speeds were set to 12, 14, and 16 kts for bulk carriers, considering their typical navigation speeds, and 16, 18, and 20 kts for container ships. The simulation calculations were performed at 0.1 s intervals.
2.2. Equations of Ship Motion
The distance between the two ships was calculated based on their respective coordinates, which were derived from the equations of ship motion. These equations require mathematical models that account for the hydrodynamic forces acting on the ship. In this study, the Maneuvering Modeling Group (MMG) model was adopted due to its proven accuracy and its capacity to separately consider the hydrodynamic forces generated by the hull, propeller, and rudder [
26]. According to [
27], the MMG model outperforms other maneuvering models, particularly in capturing the dynamic behavior of the propeller and rudder under realistic operating conditions, making it well-suited for course-keeping control.
To simulate the maneuvering motions of the ships, a model ship is required. In this study, bulk and container ship models were employed for both the OS and TS, with their principal particulars summarized in
Table 1.
Figure 3 illustrates both the Earth-fixed and body-fixed coordinate systems. Hydrodynamic forces acting on a ship are more accurately and effectively described within the body-fixed coordinate system [
28]. The equations governing the ship’s motion are expressed as follows:
where
denotes the center of gravity of the ship, while
and
represent the hydrodynamic forces acting along the
and
axes, respectively.
denotes the moment about the vertical axis passing through
. The ship’s velocity
U is decomposed into components
and
along the
and
axes, respectively.
is the heading angle,
is the drift angle, and
is the rudder angle.
The prime symbol (
) indicates nondimensionalized quantities, and the dot above (˙) denotes time differentiation.
, and
represent the mass and
- and
-axis components of the added mass of the ship, respectively.
and
correspond to the nondimensional moment of inertia and added moment of inertia about the vertical axis.
, and
can be formulated as follows:
where
H,
P, and
R denote the contributions from the hull, propeller, and rudder, respectively.
The mathematical formulation of the nondimensional hydrodynamic forces and moment acting on the hull is based on the model proposed by [
27].
where
indicates how the longitudinal force varies with respect to the drift angle
and nondimensional yaw rate
,
represents the hydrodynamic resistance encountered during straight-ahead motion, and
, and
represent linear hydrodynamic derivatives.
The propeller-induced longitudinal force
is given by
where
is the thrust deduction coefficient,
denotes the propeller’s rotational speed (in revolutions per second),
is the propeller diameter,
is the thrust coefficient as a function of the advance coefficient
, and
are empirical constants.
represents the effective wake fraction at the propeller location.
The hydrodynamic forces and moment induced by the rudder can be expressed as follows:
where
denotes the nondimensional rudder normal force,
are the interaction coefficients, and
represent the nondimensional positions of the rudder and the effective point of application of the additional lateral force generated by steering, respectively.
The above equations were employed to compute the trajectory of a model ship by numerically solving the system of differential equations presented in Equation (1).
2.3. CDC
CDC, as proposed by Lee and Furukawa [
3], is a ship CA model that calculates the collision distance at all angles at which two ships may collide. It compares this distance with the actual distance between the ships to assess whether and when a collision is likely to occur.
The accuracy of the model has been validated in previous studies [
3,
4,
5]. The calculation procedure of CDC is as follows.
The black ellipse is the OS, the black dotted ellipse is the virtual OS (VOS), and the red ellipse is the TS in
Figure 4a. In an Earth-fixed coordinate system, the reference point of the OS is denoted by
,
, the reference point of the TS is denoted by
,
, and their headings are denoted by
and
, respectively. The reference point of the VOS is denoted by
,
, and the coordinates of the OS and VOS headings are denoted by
and
as shown in
Figure 4a.
In
Figure 4b, the collision point between the two ships is denoted by
. The CDC is defined as the distance between the two ships at the moment of collision, while AD represents the actual distance between them.
To compute the CDC, the OS is translated to a virtual position without altering its heading, such that it comes into contact with the TS. At this point, the heading direction of the OS becomes tangential to the boundary of the TS, meaning that the extended centerline of the OS is tangential to the TS’s elliptical contour. The ellipse representing the TS is defined by the following equation:
The OS’s extended centerline is defined by:
Applying Equation (7) to Equation (6) leads to the following:
Accordingly,
can be determined.
The following terms are subsequently defined:
Using these terms, the CDC can be computed as follows:
Using the reference positions of the OS and TS, the AD is determined as follows:
In this study, we aimed to conduct a comprehensive collision risk assessment that includes not only simple physical collisions but also almost-collision (AC) and near-collision (NC) situations. The rationale for this is that, in extremely close encounters between ships, the risk of collision is considered to persist even without actual physical contact (e.g., at passing distances of 10–20 m) due to the potential for trajectory changes caused by hydrodynamic interactions and various uncertainties and errors in the prediction and measurement processes.
To this end, we referred to studies on ship-to-ship interactions [
29,
30,
31]. The presented studies provide results from hydrodynamic experiments on ship interactions that can occur when two ships are in close proximity. We considered these results when determining the AC and NC values in this study. Of course, these values have a limitation in that they can vary depending on the size and type of the ship. An AC was defined as a minimum passing distance between two ships within 0.2 L, and an NC was defined as a passing distance within 0.4 L, which were applied in the assessment. While these standard values are not absolute, this study applied these definitions as an initial attempt to improve the evaluation criteria of CDC.
2.4. ANFIS
The Adaptive Neuro-Fuzzy Inference System (ANFIS) is a hybrid intelligent system that combines the learning capabilities of artificial neural networks (ANN) with the intuitive knowledge representation of fuzzy inference systems (FISs) [
32]. First proposed by Jang [
22], the ANFIS demonstrates outstanding performance in modeling and predicting complex non-linear systems and is widely used in various engineering and scientific fields [
33,
34,
35,
36].
The ANFIS is typically based on a first-order Sugeno fuzzy model with two inputs and one output, and it consists of a five-layer feed-forward network structure. Each layer contains nodes that perform a specific function, receiving an input signal, processing it, and passing it through to the next layer.
For instance, consider a system with input variables x and y and an output variable f. We can establish two fuzzy rules as follows:
Here, and are linguistic variables representing the fuzzy sets in the premise part, while and are parameters that form the linear function in the consequent part.
The ANFIS learns the relationship between inputs and outputs based on these rules.
- Layer 1:
Fuzzification Layer
Each node in the first layer takes an input variable and calculates its degree of membership in a specific fuzzy set. Each node in this layer is adaptive, meaning its parameters, known as premise parameters, are adjusted during the learning process.
The output of node
, denoted as
, is calculated as follows:
Here, is the input signal and is the membership function of the fuzzy set .
- Layer 2:
Rule Layer
Each node in the second layer is a fixed node. It calculates the firing strength (
) of a rule by multiplying the membership degrees from the previous layer. This corresponds to the logical AND operation in fuzzy logic, typically using the product T-norm operator.
The output of each node represents how much a specific rule is activated for the current input.
- Layer 3:
Normalization Layer
Each node in the third layer is also a fixed node. It calculates the normalized firing strength,
, by dividing the firing strength of each rule by the sum of all rules’ firing strengths.
The normalized firing strength represents the relative contribution of each rule to the final output.
- Layer 4:
Defuzzification Layer
Each node in the fourth layer is an adaptive node. It computes the output of each rule by multiplying the normalized firing strength
from the previous layer by the rule’s consequent linear function
.
The parameters in this layer, {}, are known as consequent parameters and are learned during the forward pass using the Least Squares Estimation method.
- Layer 5:
Output Layer
The fifth layer consists of a single fixed node that calculates the final output of the ANFIS,
, by summing the outputs of all rules from the fourth layer.
The ANFIS employs a hybrid learning algorithm to efficiently train both premise and consequent parameters. This algorithm consists of two stages: a forward pass and a backward pass.
- Forward Pass:
Consequent Parameter Learning Using Least Squares Estimation
In the forward pass, input data flows through the network to compute the output of each node and, ultimately, the final output. During this pass, the premise parameters are held constant, while the consequent parameters {} are optimized using the Least Squares Estimation (LSE) method.
The final output
can be expressed as a linear combination of the consequent parameters:
For
training data points, this can be represented in matrix form:
where
is the vector of actual output values
.
is a matrix composed of normalized firing strengths and input variables , where is the number of rules and d is the number of inputs. is the vector of unknown consequent parameters .
Therefore, the optimal solution for the consequent parameters,
, can be calculated at once using the pseudo-inverse:
- Backward Pass:
Premise Parameter Learning Using Gradient Descent
In the backward pass, the consequent parameters are held constant. The error between the actual output and the ANFIS model’s output is propagated backward through the network using the Gradient Descent algorithm to adjust the premise parameters.
Defining the error
as the squared error:
The update rule for a premise parameter
(e.g.,
or
from a Gaussian function) is as follows, where
is the learning rate:
The error gradient
is calculated using the chain rule:
By calculating each term, the premise parameters are updated. This process is repeated to minimize the model’s error.
2.5. FIS–CDC Model
To develop the FIS–CDC model, the process was carried out in the following order: data collection, definition of the stepwise CRI, and training using the ANFIS.
- a.
Data collection
In this study, data on the distance between two ships, collision time, and ship speed was utilized. Among these, the inter-ship distance and collision time can be obtained through CDC calculations. Once the simulation begins, CDC is designed to evaluate the distance between the two ships and assess the possibility of collision at 0.1 s intervals, providing the collision time if a collision occurs. Therefore, the values for inter-ship distance and collision time obtained through CDC’s calculations were utilized as data. For ship speeds, the predefined values mentioned in
Section 2.1 were used in this study.
- b.
Definition of the stepwise CRI
According to the four-level FIS-NC framework, the Danger stage (CRI ≥ 0.66) is defined as “Both ships are required to take such action as will best aid avoidance of a collision”, while the Collision stage (CRI = 1.00) is defined as “Both ships have a collision”. Building on these definitions, we calibrated the stage-wise collision risk index (CRI) for the FIS–CDC model. The CDC method calculates the theoretical collision distance for each relative bearing between two ships and compares it with their actual separation, thereby identifying both the timing and severity of the contact. Because the CDC method can pinpoint the exact moment of physical contact, its operative risk spectrum corresponds to the upper end of the FIS-NC scale, spanning from Danger to Collision. Analysis of AIS data for bulk ships and container ships yielded the following CDC thresholds: collision at CRI = 1.00 (remaining distance to the other ship = 0 m); almost-collision for CRI ≥ 0.88 (remaining distance ≤ 50 m); and low collision risk for 0.77 ≤ CRI < 0.88 (remaining distance ≤ 100 m). These boundaries preserve consistency with the FIS-NC scheme while leveraging the CDC’s ability to differentiate fine-grained levels of collision risk.
- c.
System development
The development process of the FIS–CDC model by learning the collected data with the ANFIS proceeded as follows. The collected trajectory data was segregated into bulk-ship and container-ship subsets; then, each subset was independently trained with the ANFIS to construct its corresponding FIS–CDC model.
First, fuzzy rules were extracted from the input–output data set:
where
,
,
, and
are the input variables speed (
), intersection heading angle (
), collision time (
), and remaining distance (
), respectively, and
,
,
, and
are the fuzzy sets of the input variables (i.e., antecedent variables). The CRI is the consequent variable.
Following the Sugeno fuzzy model framework, the consequent function
for each rule is represented as a first-order polynomial in the four input variables. Partitioning each antecedent variable
,
,
, and
into three triangular membership functions, collision (C), almost-collision (AC), and near-collision (NC), generates
fuzzy rules, the full set of which is summarized in
Table 2.
Second, parameter optimization employed a hybrid learning algorithm that combines Least Squares Estimation in the forward pass with Gradient Descent error back-propagation in the backward pass [
14]. During the forward pass, the premise parameters are held fixed while the consequent parameters are determined by the Least Squares method. During the backward pass, the output error is propagated to the input layer and the premise parameters are updated via Gradient Descent. The entire dataset was divided into 60% for training, 20% for validation, and 20% for testing. The validation subset was used to monitor generalization and implement early stopping before overfitting, whereas the test subset provided a fully independent assessment of model performance. Layer-wise operations and the corresponding learning equations are detailed in
Section 2.5. Once parameter optimization was completed, the learning procedure yielded the final Sugeno-type FIS–CDC architecture depicted in
Figure 5,
Figure 6 and
Figure 7.
Using the bulk-ship dataset, ANFIS training produced a collision-risk inference system characterized by triangular membership functions. The resulting membership surfaces and rule partitions are depicted in
Figure 5. Applying the same training procedure to the container-ship dataset generated an analogous model, the details of which are presented in
Figure 6.
Figure 7 depicts the Sugeno-type fuzzy inference system (FIS–CDC) developed in this study. The antecedent layer comprises the four kinematic variables speed, crossing angle, remaining seconds, and remaining distance. Each variable is fuzzified into three triangular membership functions representing the linguistic terms collision, almost-collision, and low, yielding a total of 81 fuzzy rules through full factorial combination.
During inference, the firing strength of each rule is obtained by multiplying the four membership grades associated with the current input. The crisp collision risk index (CRI) is then produced by aggregating these rule outputs with their firing strengths as weights. In other words, the crisp output of the proposed FIS–CDC model is derived by fully aggregating the firing strengths of all 81 rules produced from the three-level partitions of
,
,
, and
. The resulting weighted-average (WA) defuzzification is expressed by the function
in Equation (28).
By combining local linear consequents with WA defuzzification, the system obtains a smooth and computationally efficient CRI surface, making it well-suited for real-time collision-avoidance support aboard bulk ships and container ships.