CoMViT: An Efficient Vision Backbone for Supervised Classification in Medical Imaging
Aon Safdar, Mohamed Saadeldin
TL;DR
Vision Transformers often struggle with small medical datasets and limited compute. CoMViT introduces a compact ViT backbone with a convolutional tokenizer, diagonal masking, learnable temperature, and learnable sequence pooling, achieving strong accuracy with substantially fewer parameters. Evaluated on 12 MedMNIST 2D datasets, it matches or surpasses larger CNNs and ViTs while using only a fraction of the parameters and FLOPs, and Grad-CAM analyses show interpretable localization. This work demonstrates that principled architectural redesign emphasizing locality and efficient pooling can deliver robust, deployable ViTs for low-resource medical imaging tasks.
Abstract
Vision Transformers (ViTs) have demonstrated strong potential in medical imaging; however, their high computational demands and tendency to overfit on small datasets limit their applicability in real-world clinical scenarios. In this paper, we present CoMViT, a compact and generalizable Vision Transformer architecture optimized for resource-constrained medical image analysis. CoMViT integrates a convolutional tokenizer, diagonal masking, dynamic temperature scaling, and pooling-based sequence aggregation to improve performance and generalization. Through systematic architectural optimization, CoMViT achieves robust performance across twelve MedMNIST datasets while maintaining a lightweight design with only ~4.5M parameters. It matches or outperforms deeper CNN and ViT variants, offering up to 5-20x parameter reduction without sacrificing accuracy. Qualitative Grad-CAM analyses show that CoMViT consistently attends to clinically relevant regions despite its compact size. These results highlight the potential of principled ViT redesign for developing efficient and interpretable models in low-resource medical imaging settings.
