# A Transfer Learning and Optimized CNN Based Maritime Vessel Classification System
## 3 Materials and Methods
### Proposed Method
#### 3.3.3 Ensemble Learning Models  
Following the successful application of the optimized hyper-parameters of the transfer learning (TL) and the fine-tuning to the training of cutting-edge CNN models on the ship classification datasets, the top three CNN models, in terms of performance, are chosen to serve as the base learners for the ensemble models presented in the following subsection. These models are then used to construct the ensemble models. To improve model performance, ensemble learning (EL) can be used. In the EL technique, multiple base learning models are integrated. The new constructed model can boost classification accuracy and, hence, improve performance. Data analytics problems commonly use ensemble learning because integrating several features of variance learners usually performs better than a single one. There are two main EL methods widely used for data analysis. Confidence averaging and concatenation. In confidence averaging EL approach, the classification probability values of base learners are combined to find the class with the highest confidence value [34]. In DL models, softmax layers can output a posterior probability list that contains the classification confidence of each class. The confidence averaging method calculates the average classification probability of base learners for each class, and then returns the class label with the highest average confidence value as the final classification result. The confidence value of each class is calculated using the softmax function [34]:  
\[\mathrm{Softmax}(V)_{i}=\frac{e^{V_{i}}}{\sum_{j=1}^{C}e^{V_{j}}} \tag{2}\]  
where \(V\) is the input vector in Equation (2), \(C\) is classes number in the dataset, and \(e^{V_{i}}\) and \(e^{V_{j}}\) are the standard exponential functions for the input and output vectors, respectively. By applying a confidence averaging method, the predicted class label obtained is denoted by:  
\[\hat{\mathcal{Y}}=\underset{i\in\{1,\dots,c\}}{\mathrm{argmax}}\frac{\sum_{j =1}^{k}p_{j}\big{(}y=i\;|\mathcal{B}_{j}\;,\;x\big{)}}{k} \tag{3}\]  
where \(\mathcal{B}_{j}\) is the \(j\)-th base learner in Equation (3); \(k\) is the number of the selected base CNN learner, and \(k=3\) in the proposed ship classification system; and \(p_{j}\big{(}y=i\;|\mathcal{B}_{j}\;,\;x\big{)}\) indicates the prediction confidence of a class value \(i\) in a data sample \(x\) using \(\mathcal{B}_{j}\). Unlike the conventional voting method that only considers the class labels, confidence averaging enables the ensemble model to detect uncertain classification results and correct the misclassified samples through the use of classification confidence. While the time complexity of the confidence averaging approach itself is merely \(O(NKC)\), where \(N\) is the number of instances, \(K\) is the number of base CNN models, and \(C\) is the number of classes, the computational cost of a whole ensemble model is dependent on the complexity of the base learners. The execution speed of the confidence averaging method is typically quite high due to the fact that \(K\) and \(C\) are typically quite modest. Another ensemble method for DL models is the concatenation [35] method. In a concatenated CNN, the goal is to extract the highest-order features generated from the top dense layer of base CNN models, and then use concatenate operations to integrate all of the features into a new concatenated layer that contains all of the features. This new concatenated layer should contain all of the features. After the concatenated layer comes a drop-out layer, which is used to eliminate superfluous features, and then a softmax layer, which is used to build a new CNN model. The concatenation process has the advantage of integrating different features of the highest order, allowing it to design models that are more efficient than the original one. On the other hand, the new model needs to be retrained on the entire dataset, increasing the time spent on the model training process.