## 4 Implementation
### Training and Validation  
In the evaluation of the performance of our multi-input CNN model in classifying skin lesions, we carefully structured the training and validation process using a split of the dataset in a 7:2:1 ratio. This distribution allowed us to train the model on 70% of the data, validate its performance on 20%, and test it on the remaining 10%. Table 3 shows the number of images per classes for the training, validation, and test set. Each trial consisted of 50 epochs, providing a balanced compromise between sufficient training to reach convergence and computational efficiency. The long training duration per trial ensured that each model had ample opportunity to learn from the rich dataset, adapt to the nuances of the medical images, and stabilize its performance over time. Figure 5 shows the comprehensive training and validation results. The models' performance was continuously monitored through metrics like accuracy, F1 score, precision, and recall, calculated after each epoch during validation. Figure 4 shows the training and validation results for four alternative CNN models with MLP, and the ResNet-152-based multi-input CNN model achieved the highest training and validation accuracy with 99.016 and 98.9, respectively. The lowest training and validation losses were also found for ResNet-152 at 0.065 and 0.004. Table 4 shows the detailed results for the CNN models. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Class Name** & **Training** & **Validation** & **Test** \\ \hline Melanoma & 3160 & 877 & 400 \\ Melancocytic Nevus & 8728 & 2525 & 1305 \\ Basal Cell Carcinoma & 2343 & 617 & 357 \\ Actinic Keratosis & 610 & 184 & 70 \\ Benign Keratosis & 1793 & 547 & 258 \\ Dermatofibroma & 171 & 48 & 20 \\ Vascular Lesion & 171 & 62 & 20 \\ Squamous Cell & 449 & 119 & 60 \\ Carcinoma & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Number of images per class for training, validation, and test set. As we used PCA for the tabular dataset, we compared the impact of PCA on the test results. The Table 5 displays the performance metrics of our model with and without the implementation of Principal Component Analysis (PCA). Using PCA with three components improved the model's accuracy, recall, precision, and F1 score, highlighting PCA's effectiveness in enhancing the model's overall diagnostic capabilities. The results of our classification model are presented in Figure 6 using a confusion matrix, which quantitatively illustrates the model's performance across various skin lesion types. The matrix in Figure 6 showcases a high degree of accuracy for the majority of the classes, with perfect classification observed for melanoma, melanocytic nevus, basal cell carcinoma, and benign keratosis, where no misclassifications occurred. However, the model struggled with the accurate classification of vascular lesions, as evident from the misclassifications into dermatofibroma and squamous cell carcinoma. This highlights specific \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Model Name**} & **Training Accuracy** & **Training Loss** & **Validation Accuracy** & **Validation Loss** \\ \hline ResNet-50 & 98.017 & 0.12 & 96.123 & 0.09 \\ MobileNet-v2 & 96.3 & 0.051 & 95.36 & 0.045 \\ EfficientNet-v2 & 93.97 & 0.175 & 92.45 & 0.126 \\ ResNet-152 & 99.016 & 0.065 & 98.9 & 0.004 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Detailed results for the CNN models. Figure 5: Training accuracy, training loss, validation accuracy, and validation loss in four alternative CNN models combined with MLP as the multi-input model. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model Configuration** & **Accuracy** & **Recall** & **Precision** & **F1 Score** \\ \hline With PCA (3 Components) & 98.7\% & 99.19\% & 98.76\% & 98.91\% \\ Without PCA & 97.5\% & 98.0\% & 97.8\% & 97.9\% \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparative performance of the model with and without PCA on test set. areas where further model refinement and training data enhancement could be beneficial.