# Multiclass Skin Cancer Classification Using Ensemble of Fine-Tuned Deep Learning Models
## 6 Development of Individual Models
### Development of Ensemble Models for Skin Cancer Classification  
In this stage, individual models trained using different parameters are combined using different combination rules. The details of different combination rules can be found in [54]. Many empirical studies show that simple combination rules, such as majority voting and weighted majority voting, show remarkably improved performance. These rules are effective for the construction of ensemble decisions based on class labels. Therefore, for the current multiclass classification, majority voting, weighted-majority voting, and weighted averaging rules are applied to combine the decision of individual models. For the weighted averaging ensemble, the same weights are assigned to every single model. The final softmax-based results from all the learners are averaged by \(\frac{\sum_{i}p_{i}}{N}\), where \(N\) is number of learners. For weighted-majority voting weights of each model can be set proportional to the classification accuracy of each learner on the training/test dataset [55]. Therefore, for the weighted majority-based ensemble, weights are empirically estimated for each learner \((W_{ResNet},W_{Inception},W_{DenseNet},W_{InceptionResNet},W_{VGG})\) with respect to their average accuracy on the test dataset. The obtained weights \(W_{k};k=1,\ldots,5\) are normalized so that they add up to 1. This normalization process will not affect the decision of the weighted majoring-based ensemble.  
The ensemble decision map is constructed by stacking the decision values of the individual learners for each image \(Z\) in the test dataset, i.e., \(d^{(i)}_{ResNet}=ResNet(Z^{(i)})\), \(d^{(i)}_{Inception}=Inception(Z^{(i)})\), \(d^{(i)}_{DenseNet}=DenseNet(Z^{(i)})\), \(d^{(i)}_{InceptionResNet}=InceptionResNet(Z^{(i)})\) and \(d^{(i)}_{VGG}=VGG(Z^{(i)})\). The ensemble decision values are obtained for two well-known ensemble methods of majority voting and weighted majority voting. For each image the vote given to the \(j\)th class is computed using indicator function \(\Delta(d^{(i)}_{k},c^{j})\); which matches the predicted value of the \(k\)th individual model with the corresponding class label as in Equation (2).  
\[\Delta(d^{(i)}_{k},c^{j})=\begin{cases}1&ifd^{(i)}_{k}ec^{1}\\ 2&d^{(i)}_{k}ec^{2}\\ 3&d^{(i)}_{k}ec^{3}\\ 4&d^{(i)}_{k}ec^{4}\\ 5&d^{(i)}_{k}ec^{5}\\ 6&d^{(i)}_{k}ec^{6}\\ 7&d^{(i)}_{k}ec^{7}\\ 8&Otherwise\end{cases} \tag{2}\]  
The total votes \(votes_{j}(i)\) received from individual models for \(j\)th class are obtained using majority voting as in Equation (3).  
\[votes_{j}^{(i)}=\sum_{k=1}^{8}\Delta(d^{(i)}_{k},c^{(i)}_{j}),forj=1\,to\,8 \tag{3}\]  
However, with the weighted majority voting rule the votes for \(j\)th class are obtained for the learners \(k=1\) to \(5\) as in Equation (4).  
\[votes_{j}^{\prime\prime(i)}=\sum_{k=1}^{5}\,k\,=d_{k}(i)\,=\,c_{j}(i)\,w_{k} \,,forj=1\,to\,5 \tag{4}\]  
The ensemble decision class values, \(I^{(i)}_{Ens}\,\epsilon\,\dot{M}_{Ens}\) and \(1^{\prime\prime}_{Ens}\,\epsilon\,M^{\prime\prime}_{Ens}\) are obtained using majority voting and weighted majority voting rules as in Equations (5) and (6).  
\[I^{(i)}_{Ens}\,=\,max(votes_{j}^{(i)}) \tag{5}\]  
\[1^{\prime\prime}_{Ens}\,=max(votes_{j}^{\prime\prime(i)}) \tag{6}\]  
The image is assigned to the class that receives the maximum votes.