Background/Objectives: Squamous cell carcinoma (SCC), a prevalent form of skin cancer, presents diagnostic challenges, particularly in resource-limited settings with a low-quality imaging infrastructure. The accurate classification of SCC margins is essential to guide effective surgical interventions and reduce recurrence rates. This study proposes a vision transformer (ViT)-based model to improve SCC margin classification by addressing the limitations of convolutional neural networks (CNNs) in analyzing low-quality histopathological images. Methods: This study introduced a transfer learning approach using a ViT architecture customized with additional flattening, batch normalization, and dense layers to enhance its capability for SCC margin classification. A performance evaluation was conducted using machine learning metrics averaged over five-fold cross-validation and comparisons were made with the leading CNN models. Ablation studies have explored the effects of architectural configuration on model performance. Results: The ViT-based model achieved superior SCC margin classification with 0.928 ± 0.027 accuracy and 0.927 ± 0.028 AUC, surpassing the highest performing CNN model, InceptionV3 (accuracy: 0.86 ± 0.049; AUC: 0.837 ± 0.029), demonstrating robustness of ViT over CNN for low-quality histopathological images. Ablation studies have reinforced the importance of tailored architectural configurations for enhancing diagnostic performance. Conclusions: This study underscores the transformative potential of ViTs in histopathological analysis, especially in resource-limited settings. By enhancing diagnostic accuracy and reducing dependence on high-quality imaging and specialized expertise, it presents a scalable solution for global cancer diagnostics. Future research should prioritize optimizing ViTs for such environments and broadening their clinical applications.
Background/Objective: The global spread of Monkeypox (Mpox) has highlighted the urgent need for rapid, accurate diagnostic tools. Traditional methods like polymerase chain reaction (PCR) are resource-intensive, while skin image-based detection offers a promising alternative. This study evaluates the effectiveness of vision transformers (ViTs) for automated Mpox detection. Methods: By fine-tuning a pre-trained ViT model on an Mpox lesion image dataset, a robust ViT-based transfer learning (TL) model was created. Performance was assessed relative to convolutional neural network (CNN)-based TL models and ViT models trained from scratch across key metrics: accuracy, precision, recall, F1-score, and area under the receiver operating characteristic curve (AUC). Furthermore, a transferability measure was utilized to assess the effectiveness of feature transfer to Mpox images. Results: The results show that the ViT model outperformed a CNN, achieving an AUC of 0.948 and an accuracy of 0.942 with a p-value of less than 0.05 across all metrics, highlighting its potential for accurate and scalable Mpox detection. Moreover, the ViT models yielded a better hypothesis margin-based transferability measure, highlighting its effectiveness in transferring useful learning weights to Mpox images. Gradient-weighted Class Activation Mapping (Grad-CAM) visualizations also confirmed that the ViT model attends to clinically relevant features, supporting its interpretability and reliability for diagnostic use. Conclusions: The results from this study suggest that ViT offers superior accuracy, making it a valuable tool for Mpox early detection in field settings, especially where conventional diagnostics are limited. This approach could support faster outbreak response and improved resource allocation in public health systems.