# A Trustworthy Framework for Skin Cancer Detection Using a CNN with a Modified Attention Mechanism
## 4 Results and Discussion
### Results Evaluation with and Without Preprocessing
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**S: No.** & **Class Name** & **Precision** & **Recall** & **F1-Score** \\ \hline
1 & AKiec & 0.92 & 0.98 & 0.95 \\
2 & Bcc & 0.85 & 0.84 & 0.84 \\
3 & Bkl & 0.80 & 0.86 & 0.83 \\
4 & Df & 0.94 & 1.00 & 0.97 \\
5 & Mel & 0.77 & 0.80 & 0.78 \\
6 & Nv & 0.93 & 0.95 & 0.94 \\
7 & Vasc & 0.99 & 1.00 & 0.99 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Proposed skin cancer classification results without preprocessing. proposed model, incorporating the effects of preprocessing through a detailed confusion matrix that indicates the correct and incorrect predicted values for each class. Upon examining Table 4, it becomes apparent that the BCC class exhibited the lowest performance, whereas the Vasc and Df classes demonstrated the highest performance. This pattern underscores the varying degrees of success in classifying distinct categories within the target dataset. When considering the overall test performance of the proposed model, it registered an accuracy of 97.57%. This metric reflects the effectiveness of the model in making correct predictions across all classes, further emphasizing its effectiveness in classification tasks after applying the preprocessing steps. Table 5 presents the results of validating the model performance using the preprocessed dataset. Compared to the results shown in Table 3 without preprocessing, only the recall score of the Akiec class was reduced by 0.01 recall, while all other classes exhibited improved performances. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Class** & **Akiec** & **Bcc** & **Bkl** & **Df** & **Mel** & **Nv** & **Vasc** & **Class-Wise Accuracy** \\ \hline Akiec & **0.97** & 0.01 & 0.00 & 0.00 & 0.00 & 0.01 & 0.01 & 97.00\% \\ Bcc & 0.01 & **0.95** & 0.01 & 0.00 & 0.02 & 0.01 & 0.00 & 95.00\% \\ Bkl & 0.01 & 0.01 & **0.96** & 0.00 & 0.01 & 0.01 & 0.00 & 96.00\% \\ Df & 0.00 & 0.00 & 0.00 & **1.00** & 0.00 & 0.00 & 0.00 & 100\% \\ Mel & 0.00 & 0.00 & 0.02 & 0.00 & **0.97** & 0.01 & 0.00 & 97.00\% \\ Nv & 0.00 & 0.00 & 0.00 & 0.00 & 0.01 & **0.98** & 0.01 & 98.00\% \\ Vasc & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 & 0.00 & **1.00** & 100\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Confusion matrix of the proposed model with preprocessing. Figure 6: Accuracy and loss graphs of the proposed model with preprocessing. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**S: No.** & **Class Name** & **Precision** & **Recall** & **F1-Score** \\ \hline
1 & Akiec & 0.96 & 0.97 & 0.97 \\
2 & Bcc & 0.97 & 0.95 & 0.96 \\
3 & Bkl & 0.95 & 0.96 & 0.95 \\
4 & Df & 0.98 & 1.00 & 0.99 \\
5 & Mel & 0.96 & 0.97 & 0.96 \\
6 & Nv & 0.97 & 0.98 & 0.97 \\
7 & Vasc & 1.00 & 1.00 & 1.00 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Classification results of the proposed skin cancer classification model with preprocessing. To compute the strength of the proposed model and obtain the optimal optimizer, we conducted numerous experiments using different backbone models and optimizers. After a comprehensive experiment on various collections, we concluded that Adam performed better than the others on ResNet. Based on these results, we also used Adam for our proposed model and demonstrated its remarkable performance in skin cancer detection.