When applying Deep Learning (DL) techniques to enhance performance, medical imaging datasets pose a substantial difficulty. One widely accepted method for solving this issue is transfer learning. Pictures from the real world or medical imaging are commonly employed to reinforce the VGG16-based pre-trained network model. The outstanding transfer learning capabilities of pre-trained transformers, such as the Vision Transformer (VT) and Sliding-Window Multi-head Attention Mechanism (SWMHAM), are another reason why they are frequently employed in picture categorization. Following its effectiveness in picture classification, transformers have been trained on medical images. Examples of these transformers are the VT, which has been proposed, and the SWMHAM. It researches to assess the performance of pre-trained image transformers on medical images in light of these developments. In particular, datasets, including baseline models that are conventional CNN models, are used to assess a pre-trained transformer. Our results demonstrate the superiority of transformers in medical imaging through a comprehensive analysis of learned representations and outcomes. Transfer learning from pre-trained transformers yields higher performance when compared to alternative methods.