MedViT: A Robust Vision Transformer for Generalized Medical Image Classification

Omid Nejati Manzari, Hamid Ahmadabadi, Hossein Kashiani, Shahriar B. Shokouhi, Ahmad Ayatollahi
2/19/2023
563 citations
cs.CV
transformer-attention

Official code: Omid-Nejati/MedViT (254 stars, Python, MIT, PyTorch, last commit 2025-08-28). 1 more implementation below.

Abstract

Convolutional Neural Networks (CNNs) have advanced existing medical systems for automatic disease diagnosis. However, there are still concerns about the reliability of deep medical diagnosis systems against the potential threats of adversarial attacks since inaccurate diagnosis could lead to disastrous consequences in the safety realm.

Show full abstract

In this study, we propose a highly robust yet efficient CNN-Transformer hybrid model which is equipped with the locality of CNNs as well as the global connectivity of vision Transformers. To mitigate the high quadratic complexity of the self-attention mechanism while jointly attending to information in various representation subspaces, we construct our attention mechanism by means of an efficient convolution operation. Moreover, to alleviate the fragility of our Transformer model against adversarial attacks, we attempt to learn smoother decision boundaries. To this end, we augment the shape information of an image in the high-level feature space by permuting the feature mean and variance within mini-batches. With less computational complexity, our proposed hybrid model demonstrates its high robustness and generalization ability compared to the state-of-the-art studies on a large-scale collection of standardized MedMNIST-2D datasets.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
Omid-Nejati/MedViTOfficial254PythonMIT2025-08-28
noaft/MedViTCommunity1PythonMIT2025-04-20
Omid-Nejati/MedViTOfficial100%
PyTorchMIT

MedViT: A Robust Vision Transformer for Generalized Medical Image Classification (Computers in Biology and Medicine 2023)

25440Python, Jupyter NotebookMar 30, 20231 years agoMIT
beginner-friendlyclassificationhybrid-modelimage-classificationmachine-learning+8 more
noaft/MedViTCommunity69%
MIT

MedViT: A Robust Vision Transformer for Generalized Medical Image Classification (Computers in Biology and Medicine 2023)

10Python, Jupyter NotebookApr 8, 20251 years agoMIT

Similar Papers

Cite this paper

@article{manzari2023medvit,
  title  = {MedViT: A Robust Vision Transformer for Generalized Medical Image Classification},
  author = {Omid Nejati Manzari and Hamid Ahmadabadi and Hossein Kashiani and Shahriar B. Shokouhi and Ahmad Ayatollahi},
  year   = {2023},
  eprint = {2302.09462},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.09462v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.09462.svg)](https://codeofpaper.com/paper/2302.09462)

Discussion