# Retinitis Pigmentosa Classification with Deep Learning and Integrated Gradients Analysis
## 3 Results  
The accuracy for training and validation was monitored for all architectures over the 50 epochs. It was possible to see that for all the models, the accuracy of the training and validation data increased over the epochs. Values close to 90% (VGG19, Inception-v3) and above 90% (ResNet50) were obtained for the average training accuracy. In the validation data, lower values were obtained, with accuracy remaining stable at around 80%. This clearly distinguishes between the two accuracy metrics for both datasets. However, the curves for each of the five folders, in all architectures, are closely aligned (remaining close to 80%), and there are not many differences between the two, showing consistency in the model's performance in different validation sets. The model was trained for 50 epochs, reaching convergence after approximately 30 epochs. Although there was a degree of overfitting in the training, with the training accuracy curve consistently higher than the validation accuracies, this does not detract from the validity of the model's overall performance. The model's generalization ability is still evident, as demonstrated by the strong evaluation metrics obtained for the validation data. After all the 5-fold models had finished training, we pooled the models for the final evaluation on the retained test set. The following metrics were recorded: accuracy, recall, precision, F1-score, AUC, and ROC curve. We also used integrated gradients (IGs) with the model with the best metric values as an explainability tool to analyze correct and incorrect predictions. The metrics obtained for each model in the test dataset can be seen in Table 2.  
The metrics obtained show that no model stood out much more than the others. On the contrary, both models had similar results, judging by the metrics. However, it was the ResNet-50 model that obtained slightly better results in three of the four metrics calculated (accuracy, recall, and F1-score), losing only in precision to the Inception-v3 architecture. It was the ResNet-50 architecture that obtained the best accuracy results, with 56%. The F1-score, which obtained better results in the ResNet-50 architecture, shows a moderate balance between precision and recall but also suggests that some gene classes were more difficult for the model to recover correctly. The VGG19 architecture had the lowest metric values, although with little difference. Despite these differences, both architectures obtained very similar behaviors and results, proving the outcome of the metrics. Table 3 shows, for each model used, the value obtained for each metric for each gene class. The highest values obtained by each model for the respective metrics for each class are highlighted to give a better understanding of the results obtained. Some gene classes obtained maximum values for the metrics, even though these classes were trained with a small amount of training data. On the other hand, some classes were trained with a larger amount of data, but the dog models achieved an accuracy of over 77%. This table also shows the existence of classes that obtained values of 0% for all metrics. With these metric values, these classes were trained with a small amount of data. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Metric** & **Inception-v3** & **ResNet-50** & **VGG19** \\ \hline Accuracy & 0.54 & 0.56 & 0.54 \\ Precision & 0.58 & 0.55 & 0.54 \\ Recall & 0.54 & 0.56 & 0.54 \\ F1-Score & 0.53 & 0.54 & 0.52 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Results of the metrics obtained from the test data.