# Ship Detention Situation Prediction via Optimized Analytic Hierarchy Process and Naïve Bayes Model

Authors: Junjie Fu; Xinqiang Chen; Shubo Wu; Chaojian Shi; Jiansen Zhao; Jiangfeng Xian
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

Ship detention serves as an obligatory but efficient manner in port state control (PSC) inspection, and accurate ship detention prediction provides early warning information for maritime traffic participants. Previous studies mainly focused on exploiting the relationship between ship factors (i.e., ship age and ship type) and PSC inspection reports. Less attention was paid to identify and predict the correlation between ship fatal deficiency and ship detention event. To address the issue, we propose a novel framework to identify crucial ship deficiency types with an optimized analytic hierarchy process (AHP) model. Then, the Naïve Bayes model is introduced to predict the ship detention probability considering weights of the identified crucial ship deficiency types. Finally, we evaluate our proposed model performance on the empirical PSC inspection dataset. The research findings can help PSC officials easily determine main ship deficiencies, and thus, less time cost is required for implementing the PSC inspection procedure. In that manner, the PSC officials can quickly make ship detention decision and thus enhance maritime traffic safety.


---

## Body

## 1. Introduction

Port state control (PSC) inspection aims at identifying various potential maritime traffic safety risks, and thus, the ships with fatal deficiencies are detained to avoid potential maritime traffic accidents [1, 2]. With the help of professional judgement, the PSC officials make ship detention decisions considering various observed ship technical deficiencies. Shipping company is forced to completely correct the deficiencies for the detained ship, which are identified in the PSC inspection reports. Both the PSC officials and shipping company hope to accurately determine ship deficiency, and thus, further measurements will be taken to improve maritime traffic safety and efficiency [3–5].Though the PSC regime may vary in different countries, the PSC inspection regimes share the following points [6, 7]: (1) PSC officials inspect ships at lower risk with a larger time interval (i.e., fatal deficiency to be found from the ships with lower probability), and vice versa; (2) the PSC inspection procedure focuses on various factors (e.g., deficiency types, flag state, ship classification society, and shipowner), which may impose a potential but significant threat to maritime traffic safety [8, 9]. The ship detention decision is made after thoroughly inspecting the ship, which considers the weights of various observed deficiency factors. The empirical PSC inspection practice indicates that exploiting the close relationship between crucial deficiencies and ship detention can provide guidelines for quickly making ship detention decision. Our study aims to efficiently and accurately exploit the relationship, which can help maritime traffic participants (e.g., PSC officials and shipping owners) predict ship detention probability in real-world applications.Many researchers focused on identifying the key factors, which impose important influences on ship detention decision [10–15]. More specifically, they attempted to exploit the correlation between the critical factors (i.e., ship age, ship type, and number of deficiencies) and ship detention rate from large-scale PSC inspection data, which were then used to estimate navigation risk level, probability of maritime incident, and ship detention rate. Hänninen and Kujala proposed two alternative Bayesian network algorithms as model construction, which indicated that ship type, number of deficiencies, and PSC inspection mechanism are the most important factors involving ship detention, maritime accident, etc. [16]. Yang et al. proposed a data-driven Bayesian network-based approach to analyze risk factors (e.g., number of deficiency types, inspection type, recognized organization, and ship age) influencing PSC inspection results and predict the ship detention probability under different situations using bulk carrier dataset [4]. After that, Yang et al. introduced company performance factor into the Bayesian network model to generate the comprehensive detention rate function and then established the game model between the port authorities and ship owners [17]. Fan et al. established a Bayesian network model to investigate the factor impacts on ship navigation risk level and ship detention under different ship type dataset [18]. Şanlıer analyzed the observed deficiencies of ships from detention records and found the main factors (ship age, ship type, flag state, etc.) [19]. Xiao et al. applied a decision tree to conduct multifactor decision-making analysis and proposed a binary logistic regression to analyze detention decision under new inspection regime (NIR), and the results indicated that the ship age is the most important factor resulting in ship detention [20]. Similar results are obtained in [21–26].A few studies tried to analyze the intrinsic correlation between ship deficiency and ship detention and established prediction mechanism of ship detention probability, which provide the basis for decision-maker of PSC inspection for the purpose of preventing maritime traffic incident. Knapp et al. proposed a logistic regression model to identify deficiency and ship factors influenced the inspection results and explore the differences in ship detention [27]. Chen et al. proposed a grey rational analysis model with improved entropy weight to identify key factors (i.e., deficiencies) from ship detention cases and put forward suggestions and countermeasures to reduce ship detention rate [28]. Knapp and Chen only considered deficiencies (the number of deficiencies is not large) as key factors of PSC inspection results and determined the influence degree of factors. But they failed to propose a prediction mechanism that can accurately predict ship detention situation. In sum, previous research studies mainly focused on exploring the correlation between ship factors and ship detention and established the ship detention rate prediction mechanism.We tried to exploit intrinsic ship deficiency correlations by analyzing ship detention cases from PSC inspection data [29]. But it is important to predict ship detention incident for the purpose of enhancing maritime traffic safety and efficiency. To that aim, we proposed a novel framework to identify crucial ship deficiency types with an optimized AHP model and Naïve Bayes model, which was further employed to measure the occurrence probability of ship detention incident.Our contributions can be summarized as follows: (1) we analyzed the weakness of the current PSC inspection methods in the real-world applications from the perspective of quantitative measurements; (2) to address the issue, we proposed a hybrid framework with Naïve Bayes model and an optimized AHP model to transform the empirical PSC knowledge into common rules (with the help of historical ship detention cases); (3) we verified the proposed framework performance via the empirical PSC inspection data, which were implemented in both qualitative and quantitative manners. The remainder of the paper is organized as follows. Section2 introduces optimized AHP, Naïve Bayes model, and performance metrics in detail. Section 3 describes the data source and discusses the deficiency selection results and prediction results. Section 4 briefly concludes this study and provides potential future research directions.


## 2. Methodology

In this study, an optimized AHP method is proposed to implement the target of selecting thirty deficiencies, and two types of Naïve Bayes model are further employed to accomplish the prediction of ship detention situation based on selection deficiencies dataset at different ship types. The workflow for the proposed framework is shown in Figure1.Figure 1
Workflow for the proposed framework.


### 2.1. Optimized Analytic Hierarchy Process

The analytic hierarchy process (AHP) is a popular model in tackling multiobjective decision-making task, which is implemented with matrix operations and fuzzy quantification of qualitative indicators to determine the weight of elements. AHP has been widely used in the field of decision-making [30, 31], risk assessment [32, 33], etc. The AHP model selects crucial deficiency subcategories which are explained in detail as follows.


#### 2.1.1. Establishment of Hierarchical Structure

The hierarchical structure of AHP consists of three hierarchies which are target hierarchy, criterion hierarchy, and project hierarchy (as shown in Figure2). We aim to select deficiency subcategories, which play the most important role leading to ship detention. The parent ship deficiency category and deficiency subcategory (except the other deficiencies) can be set as criterion hierarchy and project hierarchy, respectively. In criterion hierarchy, the number with two digits is the code of parent deficiency category and the number with five digits is the code of deficiency subcategory in project hierarchy.Figure 2
Hierarchical structure for the AHP model.


#### 2.1.2. Constructing Judgement Matrix

Constructing judgement matrix is the key procedure of the AHP model, and the process is entrusting a number to every element by comparing the influence of factors at the same hierarchy and previous hierarchy. The judgement matrix can be expressed as follows:(1)A=a1a1a2a1a1a2a2a2⋯ana1⋯ana2⋮⋮a1ana2an⋱⋮⋯anan,where ai,i=1,2,⋯,n;1≤ai≤9 is the assigned number. Note that the smaller the value, the greater the influence of this factor. Parameter A is a reciprocal judgement matrix. Generally speaking, the number of factors at the same hierarchy and previous hierarchy is equal to or smaller than 9, and the comparing process is affected by human subjective factors. It may cause difficulty in determining ship deficiency level due to superfluous factors and excessive perceptual factors. To this end, we quantify the parameter ai and then generate the judgement matrix A based on the probability of deficiency from the experimental dataset. The formula for calculating the probability of element is presented as follows:(2)fid=NidTd,where fd represents the probability of element, Nid is the number of times deficiency appears in the PSC inspection dataset, and Td represents the number of PSC inspected ships. The pseudocode for the proposed quantification method is shown in Algorithm 1.Algorithm 1: Quantification method for calculating the judgement matrix.
Input: PSC inspection datasetOutput: judgement matrix An is the number of elements at the same hierarchy and previous hierarchy.Ij,j=1,⋯9, represents the rank of intervals from large to small.Calculate the probability of elements (deficiencies) using equation (2).Rank elements from large to small based on fd.ifn<8do:Entrust ai value from 1 to 9 based on human judgement considering fd.else ifn=8 or n=9do:ai=1:n based on the rank of elementselse ifn>9do:Divide range minfd,maxfd into 9 intervals on average.iffid∈Ijdo:ai=j.end ifend ifCalculate the judgement matrix using equation (1).


#### 2.1.3. Weight Calculation

The weight calculation procedure is to obtain the judgement matrix, where the eigenvectorW (corresponding to the maximum eigenvalue λmax) is the weight. It indicates the importance of this hierarchy of elements to the previous hierarchy of element. The expression for weight calculation can be shown as follows:(3)AW=λmaxW,where W=w1,w2,⋯,wn represents the weight of criterion hierarchy for target hierarchy, W=wi1,wi2,⋯,wim is the weight of project hierarchy for element i in criterion hierarchy. For the final element selection, the combined weight Cj demands to calculate, which represents the importance of project hierarchy elements for target hierarchy, and the calculation formula can be expressed as follows:(4)Cj=∑i=1nwi⋅wij.


#### 2.1.4. Consistency Check

The performance of the model needs to be verified after model establishment, and consistency check is required for the AHP model. The consistency index (CI) and consistency ratio (CR) are used to verify whether the judgement matrix meets consistency criterion. The formulas of CI and CR are shown as follows:(5)CI=λmax−nn−1,(6)CR=CIRI,when CR<0.10, the consistency of the judgement matrix is acceptable; otherwise, the judgement matrix should be modified appropriately. RI represents the mean random consistency index, and the value can be generated by randomly constructing 10000 sample matrices: construct the positive reciprocal matrix by randomly extracting numbers from 1 to 9 and its reciprocal, obtain the average value of maximum eigenvalue λmax′  , and define(7)RI=λmax′−NN−1,where N means the order of the matrix. The python code for calculating different orders of RI is available at https://github.com/shubowu/RI-of-AHP, and the result of different orders of RI is shown in Table 1. However, for the target of selecting thirty deficiency categories based on the combined weight, the random consistency check for combined weight should be verified as follows:(8)CRT=∑i=1nCIiwi∑i=1nRIiwi.Table 1
The result of different orders of RI.
N6891012141719253235686998RI1.22411.38101.42321.46071.51031.54781.58211.59851.63211.65341.66061.69491.69521.7056


### 2.2. Naïve Bayes Model

Naïve Bayes is a classification method based on Bayes’ theorem and feature condition assumptions and it is widely used in different applications such as data prediction [34, 35], classification [36, 37], and data mining [38, 39]. Naïve Bayes model assumes that all attributes are independent of each other. More specifically, each attribute independently affects the classification results.


#### 2.2.1. Bayesian Inference

For a given training dataset,X=x1,x2,⋯,xs represents attributes and contains s-dimensional features (i.e., thirty deficiency subcategories), Y=c1,c2,⋯,ck is the collection of class tags and contains k categories (i.e., detention result). The expression for Bayes’ theorem can be represented as follows:(9)Pyx=Pxy⋅PyPX,where PX=∑i=1sPxicPc, in which Pc is the prior probability and can be calculated based on the dataset. For the attribute conditional independence assumption of Naïve Bayes, conditional probability Pxy can be transformed as equation (10). And then, we substitute equation (9) into equation (10), and thus, equation (11) is obtained. The Naïve Bayes model is expressed in equation (12):(10)Pxy=Px1,x2,⋯,xsc∏i=1sPxic,(11)Pcx=Pc∏i=1sPxic∑kPc∏i=1sPxic,(12)fx=argmaxc∈YPc∏i=1sPxic.


#### 2.2.2. Estimation ofPy and Pxiy

The training process of the Naïve Bayes model is to estimate a priori probabilityPy and condition probability Pxiy for each category based on the given training dataset. Considering the characteristic of independent identical distribution of sample data, the estimation of a priori probability Py can be expressed as follows:(13)Py=DyDt,where Dy means the number of samples of category y in the given training dataset and Dt is the number of training data samples. The discrete attribute is assigned with discrete values, which are 0 and 1, respectively. Moreover, the value 0 indicates that the deficiency does not exist in the ship (or PSC officer does not observe such deficiency during the inspection procedure). The value 1 indicates that the deficiency is found in the ship by the PSC officer. The estimation of condition probability Pxi|y can be represented as follows:(14)Pxiy=Dy,xiDy,where Dy,xi is the number of values in xi of ith attribute in the collection Dy. However, the information carried by other attributes may be lost by attributes that are not present in the training dataset due to insufficient data. To this end, Laplacian correction is utilized to smooth a priori probability and condition probability during the estimation process and the correction formulas are shown as follows:(15)Py=Dy+1Dt+M,(16)Pxi∣y=Dy,xi+1Dy+Mi,where M is the number of categories in the training dataset and Mi represents the number of values of the ith attribute.


#### 2.2.3. Performance Metrics

The detention prediction process using the Naïve Bayes model can be regarded as binary classification, and three evaluation metrics including accuracyAcc, precision P, and recall R are adopted to evaluate the model prediction performance. The statistical indicators of Acc, P, and R are shown as follows:(17)Acc=1d∑i=1dIIfxi=yi,(18)P=TPTP+FP,(19)R=TPTP+FN,where d is the number of validation datasets, II⋅ is the indicator function, yi and fxi are the actual value of the element and its estimator, TP=∑i=1dIIfxi=1,yi=1 is true positive, FP=∑i=1dIIfxi=0,yi=0 is false positive, FN=∑i=1dIIfxi=1,yi=0 is false negative, and TN=∑i=1dIIfxi=0,yi=0 is true negative and TP+FP+FN+TN=d. For comprehensively considering the performance of precision and recall and evaluating the performance of models, many times t=50 of experiment were implemented and macroscopic harmonic mean MacF and microscopic harmonic mean MicF are utilized to substitute for precision and recall to evaluate the model prediction performance, respectively. The formulas can be expressed as follows:(20)MacF=1+β2×MacP×MacRβ2×MacP+MacR,(21)MicF=1+β2×MicP×MicRβ2×MicP+MicR,where parameter β>0 measures the relative importance of recall to precision, and β=1.2 was set in this study. MacP, MacR, MicP, and MicR can be calculated using the following equations:(22)MacP=1t∑i=1tPi,MacR=1t∑i=1tRi,(23)MicP=∑i=1tTPi∑i=1tTPi+FPi,MicR=∑i=1tTPi∑i=1tTPi+FNi.


## 2.1. Optimized Analytic Hierarchy Process

The analytic hierarchy process (AHP) is a popular model in tackling multiobjective decision-making task, which is implemented with matrix operations and fuzzy quantification of qualitative indicators to determine the weight of elements. AHP has been widely used in the field of decision-making [30, 31], risk assessment [32, 33], etc. The AHP model selects crucial deficiency subcategories which are explained in detail as follows.


### 2.1.1. Establishment of Hierarchical Structure

The hierarchical structure of AHP consists of three hierarchies which are target hierarchy, criterion hierarchy, and project hierarchy (as shown in Figure2). We aim to select deficiency subcategories, which play the most important role leading to ship detention. The parent ship deficiency category and deficiency subcategory (except the other deficiencies) can be set as criterion hierarchy and project hierarchy, respectively. In criterion hierarchy, the number with two digits is the code of parent deficiency category and the number with five digits is the code of deficiency subcategory in project hierarchy.Figure 2
Hierarchical structure for the AHP model.


### 2.1.2. Constructing Judgement Matrix

Constructing judgement matrix is the key procedure of the AHP model, and the process is entrusting a number to every element by comparing the influence of factors at the same hierarchy and previous hierarchy. The judgement matrix can be expressed as follows:(1)A=a1a1a2a1a1a2a2a2⋯ana1⋯ana2⋮⋮a1ana2an⋱⋮⋯anan,where ai,i=1,2,⋯,n;1≤ai≤9 is the assigned number. Note that the smaller the value, the greater the influence of this factor. Parameter A is a reciprocal judgement matrix. Generally speaking, the number of factors at the same hierarchy and previous hierarchy is equal to or smaller than 9, and the comparing process is affected by human subjective factors. It may cause difficulty in determining ship deficiency level due to superfluous factors and excessive perceptual factors. To this end, we quantify the parameter ai and then generate the judgement matrix A based on the probability of deficiency from the experimental dataset. The formula for calculating the probability of element is presented as follows:(2)fid=NidTd,where fd represents the probability of element, Nid is the number of times deficiency appears in the PSC inspection dataset, and Td represents the number of PSC inspected ships. The pseudocode for the proposed quantification method is shown in Algorithm 1.Algorithm 1: Quantification method for calculating the judgement matrix.
Input: PSC inspection datasetOutput: judgement matrix An is the number of elements at the same hierarchy and previous hierarchy.Ij,j=1,⋯9, represents the rank of intervals from large to small.Calculate the probability of elements (deficiencies) using equation (2).Rank elements from large to small based on fd.ifn<8do:Entrust ai value from 1 to 9 based on human judgement considering fd.else ifn=8 or n=9do:ai=1:n based on the rank of elementselse ifn>9do:Divide range minfd,maxfd into 9 intervals on average.iffid∈Ijdo:ai=j.end ifend ifCalculate the judgement matrix using equation (1).


### 2.1.3. Weight Calculation

The weight calculation procedure is to obtain the judgement matrix, where the eigenvectorW (corresponding to the maximum eigenvalue λmax) is the weight. It indicates the importance of this hierarchy of elements to the previous hierarchy of element. The expression for weight calculation can be shown as follows:(3)AW=λmaxW,where W=w1,w2,⋯,wn represents the weight of criterion hierarchy for target hierarchy, W=wi1,wi2,⋯,wim is the weight of project hierarchy for element i in criterion hierarchy. For the final element selection, the combined weight Cj demands to calculate, which represents the importance of project hierarchy elements for target hierarchy, and the calculation formula can be expressed as follows:(4)Cj=∑i=1nwi⋅wij.


### 2.1.4. Consistency Check

The performance of the model needs to be verified after model establishment, and consistency check is required for the AHP model. The consistency index (CI) and consistency ratio (CR) are used to verify whether the judgement matrix meets consistency criterion. The formulas of CI and CR are shown as follows:(5)CI=λmax−nn−1,(6)CR=CIRI,when CR<0.10, the consistency of the judgement matrix is acceptable; otherwise, the judgement matrix should be modified appropriately. RI represents the mean random consistency index, and the value can be generated by randomly constructing 10000 sample matrices: construct the positive reciprocal matrix by randomly extracting numbers from 1 to 9 and its reciprocal, obtain the average value of maximum eigenvalue λmax′  , and define(7)RI=λmax′−NN−1,where N means the order of the matrix. The python code for calculating different orders of RI is available at https://github.com/shubowu/RI-of-AHP, and the result of different orders of RI is shown in Table 1. However, for the target of selecting thirty deficiency categories based on the combined weight, the random consistency check for combined weight should be verified as follows:(8)CRT=∑i=1nCIiwi∑i=1nRIiwi.Table 1
The result of different orders of RI.
N6891012141719253235686998RI1.22411.38101.42321.46071.51031.54781.58211.59851.63211.65341.66061.69491.69521.7056


## 2.1.1. Establishment of Hierarchical Structure

The hierarchical structure of AHP consists of three hierarchies which are target hierarchy, criterion hierarchy, and project hierarchy (as shown in Figure2). We aim to select deficiency subcategories, which play the most important role leading to ship detention. The parent ship deficiency category and deficiency subcategory (except the other deficiencies) can be set as criterion hierarchy and project hierarchy, respectively. In criterion hierarchy, the number with two digits is the code of parent deficiency category and the number with five digits is the code of deficiency subcategory in project hierarchy.Figure 2
Hierarchical structure for the AHP model.


## 2.1.2. Constructing Judgement Matrix

Constructing judgement matrix is the key procedure of the AHP model, and the process is entrusting a number to every element by comparing the influence of factors at the same hierarchy and previous hierarchy. The judgement matrix can be expressed as follows:(1)A=a1a1a2a1a1a2a2a2⋯ana1⋯ana2⋮⋮a1ana2an⋱⋮⋯anan,where ai,i=1,2,⋯,n;1≤ai≤9 is the assigned number. Note that the smaller the value, the greater the influence of this factor. Parameter A is a reciprocal judgement matrix. Generally speaking, the number of factors at the same hierarchy and previous hierarchy is equal to or smaller than 9, and the comparing process is affected by human subjective factors. It may cause difficulty in determining ship deficiency level due to superfluous factors and excessive perceptual factors. To this end, we quantify the parameter ai and then generate the judgement matrix A based on the probability of deficiency from the experimental dataset. The formula for calculating the probability of element is presented as follows:(2)fid=NidTd,where fd represents the probability of element, Nid is the number of times deficiency appears in the PSC inspection dataset, and Td represents the number of PSC inspected ships. The pseudocode for the proposed quantification method is shown in Algorithm 1.Algorithm 1: Quantification method for calculating the judgement matrix.
Input: PSC inspection datasetOutput: judgement matrix An is the number of elements at the same hierarchy and previous hierarchy.Ij,j=1,⋯9, represents the rank of intervals from large to small.Calculate the probability of elements (deficiencies) using equation (2).Rank elements from large to small based on fd.ifn<8do:Entrust ai value from 1 to 9 based on human judgement considering fd.else ifn=8 or n=9do:ai=1:n based on the rank of elementselse ifn>9do:Divide range minfd,maxfd into 9 intervals on average.iffid∈Ijdo:ai=j.end ifend ifCalculate the judgement matrix using equation (1).


## 2.1.3. Weight Calculation

The weight calculation procedure is to obtain the judgement matrix, where the eigenvectorW (corresponding to the maximum eigenvalue λmax) is the weight. It indicates the importance of this hierarchy of elements to the previous hierarchy of element. The expression for weight calculation can be shown as follows:(3)AW=λmaxW,where W=w1,w2,⋯,wn represents the weight of criterion hierarchy for target hierarchy, W=wi1,wi2,⋯,wim is the weight of project hierarchy for element i in criterion hierarchy. For the final element selection, the combined weight Cj demands to calculate, which represents the importance of project hierarchy elements for target hierarchy, and the calculation formula can be expressed as follows:(4)Cj=∑i=1nwi⋅wij.


## 2.1.4. Consistency Check

The performance of the model needs to be verified after model establishment, and consistency check is required for the AHP model. The consistency index (CI) and consistency ratio (CR) are used to verify whether the judgement matrix meets consistency criterion. The formulas of CI and CR are shown as follows:(5)CI=λmax−nn−1,(6)CR=CIRI,when CR<0.10, the consistency of the judgement matrix is acceptable; otherwise, the judgement matrix should be modified appropriately. RI represents the mean random consistency index, and the value can be generated by randomly constructing 10000 sample matrices: construct the positive reciprocal matrix by randomly extracting numbers from 1 to 9 and its reciprocal, obtain the average value of maximum eigenvalue λmax′  , and define(7)RI=λmax′−NN−1,where N means the order of the matrix. The python code for calculating different orders of RI is available at https://github.com/shubowu/RI-of-AHP, and the result of different orders of RI is shown in Table 1. However, for the target of selecting thirty deficiency categories based on the combined weight, the random consistency check for combined weight should be verified as follows:(8)CRT=∑i=1nCIiwi∑i=1nRIiwi.Table 1
The result of different orders of RI.
N6891012141719253235686998RI1.22411.38101.42321.46071.51031.54781.58211.59851.63211.65341.66061.69491.69521.7056


## 2.2. Naïve Bayes Model

Naïve Bayes is a classification method based on Bayes’ theorem and feature condition assumptions and it is widely used in different applications such as data prediction [34, 35], classification [36, 37], and data mining [38, 39]. Naïve Bayes model assumes that all attributes are independent of each other. More specifically, each attribute independently affects the classification results.


### 2.2.1. Bayesian Inference

For a given training dataset,X=x1,x2,⋯,xs represents attributes and contains s-dimensional features (i.e., thirty deficiency subcategories), Y=c1,c2,⋯,ck is the collection of class tags and contains k categories (i.e., detention result). The expression for Bayes’ theorem can be represented as follows:(9)Pyx=Pxy⋅PyPX,where PX=∑i=1sPxicPc, in which Pc is the prior probability and can be calculated based on the dataset. For the attribute conditional independence assumption of Naïve Bayes, conditional probability Pxy can be transformed as equation (10). And then, we substitute equation (9) into equation (10), and thus, equation (11) is obtained. The Naïve Bayes model is expressed in equation (12):(10)Pxy=Px1,x2,⋯,xsc∏i=1sPxic,(11)Pcx=Pc∏i=1sPxic∑kPc∏i=1sPxic,(12)fx=argmaxc∈YPc∏i=1sPxic.


### 2.2.2. Estimation ofPy and Pxiy

The training process of the Naïve Bayes model is to estimate a priori probabilityPy and condition probability Pxiy for each category based on the given training dataset. Considering the characteristic of independent identical distribution of sample data, the estimation of a priori probability Py can be expressed as follows:(13)Py=DyDt,where Dy means the number of samples of category y in the given training dataset and Dt is the number of training data samples. The discrete attribute is assigned with discrete values, which are 0 and 1, respectively. Moreover, the value 0 indicates that the deficiency does not exist in the ship (or PSC officer does not observe such deficiency during the inspection procedure). The value 1 indicates that the deficiency is found in the ship by the PSC officer. The estimation of condition probability Pxi|y can be represented as follows:(14)Pxiy=Dy,xiDy,where Dy,xi is the number of values in xi of ith attribute in the collection Dy. However, the information carried by other attributes may be lost by attributes that are not present in the training dataset due to insufficient data. To this end, Laplacian correction is utilized to smooth a priori probability and condition probability during the estimation process and the correction formulas are shown as follows:(15)Py=Dy+1Dt+M,(16)Pxi∣y=Dy,xi+1Dy+Mi,where M is the number of categories in the training dataset and Mi represents the number of values of the ith attribute.


### 2.2.3. Performance Metrics

The detention prediction process using the Naïve Bayes model can be regarded as binary classification, and three evaluation metrics including accuracyAcc, precision P, and recall R are adopted to evaluate the model prediction performance. The statistical indicators of Acc, P, and R are shown as follows:(17)Acc=1d∑i=1dIIfxi=yi,(18)P=TPTP+FP,(19)R=TPTP+FN,where d is the number of validation datasets, II⋅ is the indicator function, yi and fxi are the actual value of the element and its estimator, TP=∑i=1dIIfxi=1,yi=1 is true positive, FP=∑i=1dIIfxi=0,yi=0 is false positive, FN=∑i=1dIIfxi=1,yi=0 is false negative, and TN=∑i=1dIIfxi=0,yi=0 is true negative and TP+FP+FN+TN=d. For comprehensively considering the performance of precision and recall and evaluating the performance of models, many times t=50 of experiment were implemented and macroscopic harmonic mean MacF and microscopic harmonic mean MicF are utilized to substitute for precision and recall to evaluate the model prediction performance, respectively. The formulas can be expressed as follows:(20)MacF=1+β2×MacP×MacRβ2×MacP+MacR,(21)MicF=1+β2×MicP×MicRβ2×MicP+MicR,where parameter β>0 measures the relative importance of recall to precision, and β=1.2 was set in this study. MacP, MacR, MicP, and MicR can be calculated using the following equations:(22)MacP=1t∑i=1tPi,MacR=1t∑i=1tRi,(23)MicP=∑i=1tTPi∑i=1tTPi+FPi,MicR=∑i=1tTPi∑i=1tTPi+FNi.


## 2.2.1. Bayesian Inference

For a given training dataset,X=x1,x2,⋯,xs represents attributes and contains s-dimensional features (i.e., thirty deficiency subcategories), Y=c1,c2,⋯,ck is the collection of class tags and contains k categories (i.e., detention result). The expression for Bayes’ theorem can be represented as follows:(9)Pyx=Pxy⋅PyPX,where PX=∑i=1sPxicPc, in which Pc is the prior probability and can be calculated based on the dataset. For the attribute conditional independence assumption of Naïve Bayes, conditional probability Pxy can be transformed as equation (10). And then, we substitute equation (9) into equation (10), and thus, equation (11) is obtained. The Naïve Bayes model is expressed in equation (12):(10)Pxy=Px1,x2,⋯,xsc∏i=1sPxic,(11)Pcx=Pc∏i=1sPxic∑kPc∏i=1sPxic,(12)fx=argmaxc∈YPc∏i=1sPxic.


## 2.2.2. Estimation ofPy and Pxiy

The training process of the Naïve Bayes model is to estimate a priori probabilityPy and condition probability Pxiy for each category based on the given training dataset. Considering the characteristic of independent identical distribution of sample data, the estimation of a priori probability Py can be expressed as follows:(13)Py=DyDt,where Dy means the number of samples of category y in the given training dataset and Dt is the number of training data samples. The discrete attribute is assigned with discrete values, which are 0 and 1, respectively. Moreover, the value 0 indicates that the deficiency does not exist in the ship (or PSC officer does not observe such deficiency during the inspection procedure). The value 1 indicates that the deficiency is found in the ship by the PSC officer. The estimation of condition probability Pxi|y can be represented as follows:(14)Pxiy=Dy,xiDy,where Dy,xi is the number of values in xi of ith attribute in the collection Dy. However, the information carried by other attributes may be lost by attributes that are not present in the training dataset due to insufficient data. To this end, Laplacian correction is utilized to smooth a priori probability and condition probability during the estimation process and the correction formulas are shown as follows:(15)Py=Dy+1Dt+M,(16)Pxi∣y=Dy,xi+1Dy+Mi,where M is the number of categories in the training dataset and Mi represents the number of values of the ith attribute.


## 2.2.3. Performance Metrics

The detention prediction process using the Naïve Bayes model can be regarded as binary classification, and three evaluation metrics including accuracyAcc, precision P, and recall R are adopted to evaluate the model prediction performance. The statistical indicators of Acc, P, and R are shown as follows:(17)Acc=1d∑i=1dIIfxi=yi,(18)P=TPTP+FP,(19)R=TPTP+FN,where d is the number of validation datasets, II⋅ is the indicator function, yi and fxi are the actual value of the element and its estimator, TP=∑i=1dIIfxi=1,yi=1 is true positive, FP=∑i=1dIIfxi=0,yi=0 is false positive, FN=∑i=1dIIfxi=1,yi=0 is false negative, and TN=∑i=1dIIfxi=0,yi=0 is true negative and TP+FP+FN+TN=d. For comprehensively considering the performance of precision and recall and evaluating the performance of models, many times t=50 of experiment were implemented and macroscopic harmonic mean MacF and microscopic harmonic mean MicF are utilized to substitute for precision and recall to evaluate the model prediction performance, respectively. The formulas can be expressed as follows:(20)MacF=1+β2×MacP×MacRβ2×MacP+MacR,(21)MicF=1+β2×MicP×MicRβ2×MicP+MicR,where parameter β>0 measures the relative importance of recall to precision, and β=1.2 was set in this study. MacP, MacR, MicP, and MicR can be calculated using the following equations:(22)MacP=1t∑i=1tPi,MacR=1t∑i=1tRi,(23)MicP=∑i=1tTPi∑i=1tTPi+FPi,MicR=∑i=1tTPi∑i=1tTPi+FNi.


## 3. Experiments

In this section, we aim to predict the detention situation based on the deficiency of ships in the PSC inspection process. Since there are many ship deficiency subcategories (i.e., 568 types of deficiency subcategories in the raw PSC inspection data), it is possible to obtain unsatisfied prediction accuracy due to trivial deficiency interference. To address the issue, we employed an optimized AHP model to select crucial deficiency subcategories, which are supposed to play important roles in making detention decisions of ships. For the purpose of model performance evaluation, multinomial Naïve Bayes (MNB) and Bernoulli Naïve Bayes (BNB) are adopted to predict the detention situation based on the selection deficiency subcategories.


### 3.1. Dataset

We collected PSC data samples from the empirical Asia-Pacific PSC inspection data within five years (i.e., from January 2014 to December 2018). We have collected 10322 PSC inspection samples, and each data sample includes both fundamental ship information and ship deficiency types. More specifically, the fundamental ship information contains ship name, ship type, flag, detention state, number of deficiencies, etc. We have collected 568 types of ship deficiencies, and each ship deficiency is denoted as 0 or 1. More specifically, the ship deficiency is observed in the PSC inspection sample when the attribute value is assigned to 1, and vice versa.


### 3.2. Deficiency Subcategory Selection Analysis

The judgement matrices for the target hierarchy and criterion hierarchy were provided to further unveil the AHP modeling results. More specifically, Table2 shows the judgement matrix for the target hierarchy. Table 3 shows the judgement matrix for the criterion hierarchy with cargo operations including equipment deficiency (code ID is 06), and Table 4 represents the judgement matrix for the criterion hierarchy with ISPS deficiency (code ID is 16). The parent ship deficiency types were classified as the basic elements for the criterion hierarchy elements, and the corresponding weights are shown in Table 5. It is noted that the deficiency item of certificate and documentation was assigned with a significantly larger weight (i.e., 0.3215) compared to other ship deficiency types. Such statistics indicated that ship crew without qualified certificates can directly result in ship detention, which is consistent with the real-world PSC inspection experience. Moreover, ships loading with dangerous goods may be detained, and the factor is assigned with weight 0.0357.Table 2
Judgement matrix for the target hierarchy.
Target01020304050607080910111213141516180118789969956987879021/817/819/89/83/49/89/85/83/49/817/817/89/8031/78/718/79/79/76/79/79/75/76/79/78/718/719/7041/817/819/89/83/49/89/85/83/49/817/817/89/7051/98/97/98/9112/3115/92/318/97/98/97/91061/98/97/98/9112/3115/92/318/97/98/97/91071/64/37/64/33/23/213/23/24/313/24/37/64/37/63/2081/98/97/98/9112/3115/92/318/97/98/97/91091/98/97/98/9112/3115/92/318/97/98/97/91101/58/57/58/59/59/56/59/59/516/59/58/57/58/57/59/5111/64/37/64/33/23/213/23/24/313/24/37/64/37/63/2121/98/97/98/9112/3115/92/318/97/98/97/91131/817/819/89/83/49/89/85/83/49/817/817/89/7141/78/718/79/79/76/79/79/75/76/79/78/718/719/7151/817/819/89/83/49/89/85/83/49/817/817/89/7161/78/718/79/79/76/79/79/75/76/79/78/718/719/7181/98/97/98/9112/3115/92/318/97/98/97/91Table 3
Judgement matrix for the criterion hierarchy with cargo operations including equipment deficiency (code ID is 06).
0606101061020610306104061050610606107061080610906101196348275061021/912/33/94/98/92/97/95/9061031/63/213/64/64/32/67/65/6061041/33214/38/32/37/35/3061051/49/43/23/4121/27/45/4061061/89/83/43/81/211/47/85/8061071/29/233/22417/25/2061081/79/76/73/74/78/72/715/7061091/59/56/53/54/58/52/57/51Table 4
Judgement matrix for the criterion hierarchy with ISPS deficiency (code ID is 16).
161610116102161031610416105161061610119/43/27/41/45/4161024/912/37/91/95/9161032/33/217/91/65/6161044/79/76/711/75/716105496715161064/59/56/57/51/51Table 5
Weights of criterion hierarchy from optimized AHP analysis.
Code IDDefective itemW01Certificate and documentation0.321502Structural conditions0.040203Water/weathertight conditions0.045904Emergency systems0.040205Radio communications0.035706Cargo operations including equipment0.035707Fire safety0.053608Alarms0.035709Working and living conditions0.035710Safety of navigation0.064311Lifesaving appliances0.053612Dangerous goods0.035713Propulsion and auxiliary machinery0.040214Pollution prevention0.045915ISM0.040216ISPS0.035718Labor conditions0.0402Table6 shows the results with λmax, CI, RI, CR, and check result of single hierarchy consistency check for each hierarchy. The result of hierarchy consistency check for the overall consistency check is acceptable (combined with the result CRT=0<0.1 of total hierarchy consistency check). From the perspective of CR indicator, the judgement matrices have satisfied consistency check criterion considering that each CR is smaller than 0.1. Additionally, each CR is smaller than 0.1, which confirmed the above analysis. The RI indicator ranges from 1.2241 to 1.7056, which indicated that the mean random consistency varied in a small interval.Table 6
The results of single hierarchy consistency check for each hierarchy.
AλmaxCIRICRCheck resultTarget17.00000.00001.58210.0000Accept0198.00000.00001.70560.0000Accept0232.00000.00001.65340.0000Accept0314.00000.00001.54780.0000Accept0419.00000.00001.59850.0000Accept0517.00000.00001.58210.0000Accept069.00000.00001.42320.0000Accept0725.00000.00001.63210.0000Accept0810.00000.00001.46070.0000Accept0968.00000.00001.69490.0000Accept1035.00000.00001.66060.0000Accept1135.00000.00001.66060.0000Accept129.00000.00001.42320.0000Accept138.00000.00001.38100.0000Accept1468.00000.00001.69490.0000Accept1512.00000.00001.51030.0000Accept166.00000.00001.22410.0000Accept1869.00000.00001.69520.0000AcceptTable7 presents specific ship deficiencies which are supposed to be carefully inspected by PSC officials in practice (i.e., such deficiency can obviously result in ship detention case). It is noted that both seafarers’ employment agreement (code ID is 01220) and endorsement by flag state (code ID is 01214) are assigned with larger weights in the optimized AHP model, which are both 0.0829. More specifically, PSC officer is likely to make a ship detention decision when they observe such deficiencies. The lifebuoy relevant issues are considered as another type of critical ship deficiency which affects ship detention decision. By interviewing with many experienced captains and PSC officer, the determined ship type deficiency and the assigned weights are consistent with the real world, and thus, the results can facilitate the PSC inspection procedure.Table 7
Thirty deficiency subcategories and corresponding weights of optimized AHP results.
Code IDDefective itemC01220Seafarers’ employment agreement (SEA)0.082901214Endorsement by flag state0.082916105Access control to ship0.063515109Maintenance of the ship and equipment0.049213103Gauges, thermometers, etc.0.049208107Machinery controls alarm0.047506101Cargo securing manual0.042012106Instrumentation0.042004103Emergency, lighting, batteries, and switches0.037603102Freeboard marks0.037103108Ventilators, air pipes, casings0.037110111Charts0.036407105Fire doors/openings in fire-resisting divisions0.032207110Fire-fighting, equipment, and appliances0.032211101Lifeboats0.030805110Facilities for reception of marine safety inform0.028502108Electrical installations in general0.026613102Auxiliary engine0.024608103Fire alarm0.023706107Cargo operation0.021012104Dangerous goods code0.021003105Covers (tarpaulins, etc.)0.018610109Lights, shapes, sound signals0.018210116Nautical publications0.018201201Certificates for master and officers0.016615106Shipboard operations0.016413101Propulsion main engine0.016414402Sewage treatment plant0.016316101Security-related defects0.015911117Lifebuoys provision and disposition0.0154


### 3.3. Performance of Ship Detention Prediction

After the deficiency subcategory selection (i.e., influence factor reduction) with the optimized AHP model, the Naïve Bayes models (i.e., MNB and BNB) and hybrid Naïve Bayes model (i.e., MNB and BNB combined with optimized AHP, respectively) were employed to predict the detention situation of ships by using different ship types (i.e., general cargo/multipurpose ship with 3849 samples and bulk carrier with 2260 samples) data collected from the PSC inspection dataset. Note that 70% of samples were selected randomly as the training dataset, and the remaining 30% were used as the validation dataset. We implement the experiment in fifty times and three performance metrics (i.e.,Acc, MacroF, and MicroF) are adopted to measure the model prediction performance and stability.From the perspective of accuracy (see Figure3), the distribution curves showed ups and downs with poor fluctuation. In general, reasonable prediction results were obtained and the results of a hybrid model combining Naïve Bayes model and optimized AHP showed better than the Naïve Bayes model without deficiency selection scheme. The main reason is that the deficiency selection procedure removed most of the inconsequential deficiency subcategories which will decrease the prediction accuracy. Comparing the prediction performance of two types of Naïve Bayes model, the results of the MNB model are significantly better than those of the BNB model (the mean of accuracy is 0.8946 and 0.8784 in general cargo/multipurpose ship, and 0.9290 and 0.9189 in bulk carrier, respectively).Figure 3
Acc distribution of detention prediction of data from two types of ship. (a)Acc distribution of general cargo/multipurpose ship. (b)Acc distribution of bulk carrier.
(a)(b)It indicated that the distribution tendency of PSC inspection data is more similar to the MNB model and obtains satisfactory training performance. Additionally, we found that the model performance of bulk carrier outperforms that of general cargo/multipurpose ship. As shown in Table8, MacroF and MicroF scores of the hybrid model combining optimized AHP model and MNB model is the largest of all (MacroF and MicroF scores are both 03635 in general cargo/multipurpose ship, and 0.3151and 0.3148 in bulk carrier). It also illustrated that the prediction performance and stability of the hybrid model combining optimized AHP model and MNB model are superior to other models.Table 8
MacroF and MicroF scores in different samples dataset.
General cargo/multipurpose shipBulk carrierMacroFMicroFMacroFMicroFMNB0.16760.16760.07940.0787BNB0.02030.02010.01030.0098Optimized AHP + MNB0.36350.36350.31510.3148Optimized AHP + BNB0.20680.20640.14240.1418


## 3.1. Dataset

We collected PSC data samples from the empirical Asia-Pacific PSC inspection data within five years (i.e., from January 2014 to December 2018). We have collected 10322 PSC inspection samples, and each data sample includes both fundamental ship information and ship deficiency types. More specifically, the fundamental ship information contains ship name, ship type, flag, detention state, number of deficiencies, etc. We have collected 568 types of ship deficiencies, and each ship deficiency is denoted as 0 or 1. More specifically, the ship deficiency is observed in the PSC inspection sample when the attribute value is assigned to 1, and vice versa.


## 3.2. Deficiency Subcategory Selection Analysis

The judgement matrices for the target hierarchy and criterion hierarchy were provided to further unveil the AHP modeling results. More specifically, Table2 shows the judgement matrix for the target hierarchy. Table 3 shows the judgement matrix for the criterion hierarchy with cargo operations including equipment deficiency (code ID is 06), and Table 4 represents the judgement matrix for the criterion hierarchy with ISPS deficiency (code ID is 16). The parent ship deficiency types were classified as the basic elements for the criterion hierarchy elements, and the corresponding weights are shown in Table 5. It is noted that the deficiency item of certificate and documentation was assigned with a significantly larger weight (i.e., 0.3215) compared to other ship deficiency types. Such statistics indicated that ship crew without qualified certificates can directly result in ship detention, which is consistent with the real-world PSC inspection experience. Moreover, ships loading with dangerous goods may be detained, and the factor is assigned with weight 0.0357.Table 2
Judgement matrix for the target hierarchy.
Target01020304050607080910111213141516180118789969956987879021/817/819/89/83/49/89/85/83/49/817/817/89/8031/78/718/79/79/76/79/79/75/76/79/78/718/719/7041/817/819/89/83/49/89/85/83/49/817/817/89/7051/98/97/98/9112/3115/92/318/97/98/97/91061/98/97/98/9112/3115/92/318/97/98/97/91071/64/37/64/33/23/213/23/24/313/24/37/64/37/63/2081/98/97/98/9112/3115/92/318/97/98/97/91091/98/97/98/9112/3115/92/318/97/98/97/91101/58/57/58/59/59/56/59/59/516/59/58/57/58/57/59/5111/64/37/64/33/23/213/23/24/313/24/37/64/37/63/2121/98/97/98/9112/3115/92/318/97/98/97/91131/817/819/89/83/49/89/85/83/49/817/817/89/7141/78/718/79/79/76/79/79/75/76/79/78/718/719/7151/817/819/89/83/49/89/85/83/49/817/817/89/7161/78/718/79/79/76/79/79/75/76/79/78/718/719/7181/98/97/98/9112/3115/92/318/97/98/97/91Table 3
Judgement matrix for the criterion hierarchy with cargo operations including equipment deficiency (code ID is 06).
0606101061020610306104061050610606107061080610906101196348275061021/912/33/94/98/92/97/95/9061031/63/213/64/64/32/67/65/6061041/33214/38/32/37/35/3061051/49/43/23/4121/27/45/4061061/89/83/43/81/211/47/85/8061071/29/233/22417/25/2061081/79/76/73/74/78/72/715/7061091/59/56/53/54/58/52/57/51Table 4
Judgement matrix for the criterion hierarchy with ISPS deficiency (code ID is 16).
161610116102161031610416105161061610119/43/27/41/45/4161024/912/37/91/95/9161032/33/217/91/65/6161044/79/76/711/75/716105496715161064/59/56/57/51/51Table 5
Weights of criterion hierarchy from optimized AHP analysis.
Code IDDefective itemW01Certificate and documentation0.321502Structural conditions0.040203Water/weathertight conditions0.045904Emergency systems0.040205Radio communications0.035706Cargo operations including equipment0.035707Fire safety0.053608Alarms0.035709Working and living conditions0.035710Safety of navigation0.064311Lifesaving appliances0.053612Dangerous goods0.035713Propulsion and auxiliary machinery0.040214Pollution prevention0.045915ISM0.040216ISPS0.035718Labor conditions0.0402Table6 shows the results with λmax, CI, RI, CR, and check result of single hierarchy consistency check for each hierarchy. The result of hierarchy consistency check for the overall consistency check is acceptable (combined with the result CRT=0<0.1 of total hierarchy consistency check). From the perspective of CR indicator, the judgement matrices have satisfied consistency check criterion considering that each CR is smaller than 0.1. Additionally, each CR is smaller than 0.1, which confirmed the above analysis. The RI indicator ranges from 1.2241 to 1.7056, which indicated that the mean random consistency varied in a small interval.Table 6
The results of single hierarchy consistency check for each hierarchy.
AλmaxCIRICRCheck resultTarget17.00000.00001.58210.0000Accept0198.00000.00001.70560.0000Accept0232.00000.00001.65340.0000Accept0314.00000.00001.54780.0000Accept0419.00000.00001.59850.0000Accept0517.00000.00001.58210.0000Accept069.00000.00001.42320.0000Accept0725.00000.00001.63210.0000Accept0810.00000.00001.46070.0000Accept0968.00000.00001.69490.0000Accept1035.00000.00001.66060.0000Accept1135.00000.00001.66060.0000Accept129.00000.00001.42320.0000Accept138.00000.00001.38100.0000Accept1468.00000.00001.69490.0000Accept1512.00000.00001.51030.0000Accept166.00000.00001.22410.0000Accept1869.00000.00001.69520.0000AcceptTable7 presents specific ship deficiencies which are supposed to be carefully inspected by PSC officials in practice (i.e., such deficiency can obviously result in ship detention case). It is noted that both seafarers’ employment agreement (code ID is 01220) and endorsement by flag state (code ID is 01214) are assigned with larger weights in the optimized AHP model, which are both 0.0829. More specifically, PSC officer is likely to make a ship detention decision when they observe such deficiencies. The lifebuoy relevant issues are considered as another type of critical ship deficiency which affects ship detention decision. By interviewing with many experienced captains and PSC officer, the determined ship type deficiency and the assigned weights are consistent with the real world, and thus, the results can facilitate the PSC inspection procedure.Table 7
Thirty deficiency subcategories and corresponding weights of optimized AHP results.
Code IDDefective itemC01220Seafarers’ employment agreement (SEA)0.082901214Endorsement by flag state0.082916105Access control to ship0.063515109Maintenance of the ship and equipment0.049213103Gauges, thermometers, etc.0.049208107Machinery controls alarm0.047506101Cargo securing manual0.042012106Instrumentation0.042004103Emergency, lighting, batteries, and switches0.037603102Freeboard marks0.037103108Ventilators, air pipes, casings0.037110111Charts0.036407105Fire doors/openings in fire-resisting divisions0.032207110Fire-fighting, equipment, and appliances0.032211101Lifeboats0.030805110Facilities for reception of marine safety inform0.028502108Electrical installations in general0.026613102Auxiliary engine0.024608103Fire alarm0.023706107Cargo operation0.021012104Dangerous goods code0.021003105Covers (tarpaulins, etc.)0.018610109Lights, shapes, sound signals0.018210116Nautical publications0.018201201Certificates for master and officers0.016615106Shipboard operations0.016413101Propulsion main engine0.016414402Sewage treatment plant0.016316101Security-related defects0.015911117Lifebuoys provision and disposition0.0154


## 3.3. Performance of Ship Detention Prediction

After the deficiency subcategory selection (i.e., influence factor reduction) with the optimized AHP model, the Naïve Bayes models (i.e., MNB and BNB) and hybrid Naïve Bayes model (i.e., MNB and BNB combined with optimized AHP, respectively) were employed to predict the detention situation of ships by using different ship types (i.e., general cargo/multipurpose ship with 3849 samples and bulk carrier with 2260 samples) data collected from the PSC inspection dataset. Note that 70% of samples were selected randomly as the training dataset, and the remaining 30% were used as the validation dataset. We implement the experiment in fifty times and three performance metrics (i.e.,Acc, MacroF, and MicroF) are adopted to measure the model prediction performance and stability.From the perspective of accuracy (see Figure3), the distribution curves showed ups and downs with poor fluctuation. In general, reasonable prediction results were obtained and the results of a hybrid model combining Naïve Bayes model and optimized AHP showed better than the Naïve Bayes model without deficiency selection scheme. The main reason is that the deficiency selection procedure removed most of the inconsequential deficiency subcategories which will decrease the prediction accuracy. Comparing the prediction performance of two types of Naïve Bayes model, the results of the MNB model are significantly better than those of the BNB model (the mean of accuracy is 0.8946 and 0.8784 in general cargo/multipurpose ship, and 0.9290 and 0.9189 in bulk carrier, respectively).Figure 3
Acc distribution of detention prediction of data from two types of ship. (a)Acc distribution of general cargo/multipurpose ship. (b)Acc distribution of bulk carrier.
(a)(b)It indicated that the distribution tendency of PSC inspection data is more similar to the MNB model and obtains satisfactory training performance. Additionally, we found that the model performance of bulk carrier outperforms that of general cargo/multipurpose ship. As shown in Table8, MacroF and MicroF scores of the hybrid model combining optimized AHP model and MNB model is the largest of all (MacroF and MicroF scores are both 03635 in general cargo/multipurpose ship, and 0.3151and 0.3148 in bulk carrier). It also illustrated that the prediction performance and stability of the hybrid model combining optimized AHP model and MNB model are superior to other models.Table 8
MacroF and MicroF scores in different samples dataset.
General cargo/multipurpose shipBulk carrierMacroFMicroFMacroFMicroFMNB0.16760.16760.07940.0787BNB0.02030.02010.01030.0098Optimized AHP + MNB0.36350.36350.31510.3148Optimized AHP + BNB0.20680.20640.14240.1418


## 4. Conclusion

In this paper, we aimed at predicting the detention situation of ships by combining deficiency selection procedure and Naïve Bayes model using dataset from Asia-Pacific PSC inspection. Considering that trivial ship deficiency imposes an insignificant effect on the ship detention decision, we introduced an optimized AHP model to select thirty deficiency subcategories from 568 types of deficiency categories, which are input as the attributes of Naïve Bayes model. The experimental results provided the following conclusions: (1) the hybrid model combining Naïve Bayes and optimized AHP model can accurately predict ship detention results, which can help shipowners to take timely actions to repair ship deficiency in advance; (2) the MNB model (a type of Naïve Byes model) obtained better ship detention prediction accuracy compared to the counterparts of the BNB model; (3) additional PSC inspection samples can provide more intrinsic relations between ship deficiency and detention events and thus can further improve model prediction performance.Though the proposed hybrid model combining Naïve Bayes model and optimized AHP model obtained satisfied ship detention prediction results, the following researches can be done to expand our work. First, it is found that deficiency categories determined by the proposed AHP model were not perfectly matched with the real world (i.e., slightly different from PSC inspection records). We can develop additional knowledge discovery models to explore more intrinsic ship detention patterns from the ship deficiency. Second, we can establish a correlation network between various ship deficiency types and integrate Bayesian network models to discover ship detention knowledge for the purpose of obtaining higher ship detention prediction accuracy. Third, we can enhance our model performance by introducing a self-adaptive mechanism for the purpose of updating ship deficiency weights. Last but not least, we have tested our model performance by identifying 30 crucial ship deficiency categories. We can further test our model performance under various number of crucial ship deficiency categories.



---

*Source: 8147310-2020-07-07.xml*