## 8 Discussion  
In this section, we present the results of our method for the automatic generation of pododactyl medical reports using CNNs to extract image features and Transformers to interpret and generate the reports. We begin by illustrating the training and validation performance of our model through various graphs. Additionally, we provide examples of generated reports alongside the corresponding medical images, including Grad-CAM visualizations to enhance result interpretability [13; 68]. For this section, we selected the model that showed average results among the 10 folds. We opted for this approach to mitigate sampling biases and ensure a robust representation of the model's generalization. Choosing a model with average performance is crucial as it represents a mean performance across different validation sets, providing a more realistic assessment of the method's capability to handle new data. This not only increases confidence in the replicability of the results, but also offers a balanced view of the model's potential in practical clinical application scenarios. For a deeper understanding of the results, we present the graphs in Figure 10(a),b, which illustrate the model's performance during the training and validation periods. Figure 10(a) shows that the model achieved satisfactory convergence regarding the loss and accuracy metrics on the training and validation sets, with the loss consistently below 1.0 and accuracy above 0.80. At this stage, only the Transformer learned features from the dataset. Figure 8 allows us to see that, in the second training stage, where the convolutional layers of the four CNNs were also allowed to learn along with the continuation of Transformer training,the model could not mitigate overfitting, resulting in an interruption of the training. Despite this behavior, in the second stage, we managed to guide the model to learn the nuances between the X-rays and the reports, controlling the overfitting, as observed in Section 7. To elucidate how the combination of CNNs and Transformers achieved the results presented in this study, we employed the Gradient-weighted Class Activation Mapping (Grad-CAM) technique [69] to visualize the image regions considered important by the CNNs during the process. We then combined the reports generated by the Transformers with the Grad-CAMs, providing additional insights into our methodology. Thus, we created Figures 12 and 13, which display an X-ray of the Polydactylys, the original reports, the reports produced by our methodology, the calculated metrics, and the Grad-CAMs for key words generated by the methodology. Analyzing Figure 12a, we see that the model showed promising performance, with a BLEU-4 score of 0.63, a METEOR score of 0.45, and a ROUGE-L score of 0.73, indicating a strong correspondence with real medical reports. Although the model did not detect an early-stage valgus deformity of the hindfoot/midfoot, it was accurate in describing normal characteristics. The analysis of the Grad-CAMs generated by the four CNNs for each examination image revealed that the model focused on areas of the feet used by specialists to generate reports. Figure 12b shows that the model achieved BLEU-4 scores of 0.60, a METEOR score of 0.53, and a ROUGE-L score of 0.91, indicating a strong correspondence with real medical reports. Both reports mention normal bone texture, intact joint surfaces and spaces, and reduced plantar arch, demonstrating that the model accurately captured normal clinical features. Although the scores suggest high agreement, there is variation in wording due to the diverse origin of the dataset. The analysis of the Grad-CAMs reveals that the model focuses on specific areas of the feet, indicating that it searches for specific findings. Figure 11: Graphs illustrating the model’s performance during training and validation. (**a**) Convergence of loss and accuracy metrics, with only the Transformer learning dataset characteristics.