VariViT: A Vision Transformer for Variable Image Sizes

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Varma, Aswathi, Shit, Suprosanna, Prabhakar, Chinmay, Scholz, Daniel, Li, Hongwei Bran, Menze, Bjoern, Rueckert, Daniel, Wiestler, Benedikt
Formato: Preprint
Publicado: 2026
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866914331837333504
author Varma, Aswathi
Shit, Suprosanna
Prabhakar, Chinmay
Scholz, Daniel
Li, Hongwei Bran
Menze, Bjoern
Rueckert, Daniel
Wiestler, Benedikt
author_facet Varma, Aswathi
Shit, Suprosanna
Prabhakar, Chinmay
Scholz, Daniel
Li, Hongwei Bran
Menze, Bjoern
Rueckert, Daniel
Wiestler, Benedikt
contents Vision Transformers (ViTs) have emerged as the state-of-the-art architecture in representation learning, leveraging self-attention mechanisms to excel in various tasks. ViTs split images into fixed-size patches, constraining them to a predefined size and necessitating pre-processing steps like resizing, padding, or cropping. This poses challenges in medical imaging, particularly with irregularly shaped structures like tumors. A fixed bounding box crop size produces input images with highly variable foreground-to-background ratios. Resizing medical images can degrade information and introduce artefacts, impacting diagnosis. Hence, tailoring variable-sized crops to regions of interest can enhance feature representation capabilities. Moreover, large images are computationally expensive, and smaller sizes risk information loss, presenting a computation-accuracy tradeoff. We propose VariViT, an improved ViT model crafted to handle variable image sizes while maintaining a consistent patch size. VariViT employs a novel positional embedding resizing scheme for a variable number of patches. We also implement a new batching strategy within VariViT to reduce computational complexity, resulting in faster training and inference times. In our evaluations on two 3D brain MRI datasets, VariViT surpasses vanilla ViTs and ResNet in glioma genotype prediction and brain tumor classification. It achieves F1-scores of 75.5% and 76.3%, respectively, learning more discriminative features. Our proposed batching strategy reduces computation time by up to 30% compared to conventional architectures. These findings underscore the efficacy of VariViT in image representation learning. Our code can be found here: https://github.com/Aswathi-Varma/varivit
format Preprint
id arxiv_https___arxiv_org_abs_2602_14615
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle VariViT: A Vision Transformer for Variable Image Sizes
Varma, Aswathi
Shit, Suprosanna
Prabhakar, Chinmay
Scholz, Daniel
Li, Hongwei Bran
Menze, Bjoern
Rueckert, Daniel
Wiestler, Benedikt
Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
Vision Transformers (ViTs) have emerged as the state-of-the-art architecture in representation learning, leveraging self-attention mechanisms to excel in various tasks. ViTs split images into fixed-size patches, constraining them to a predefined size and necessitating pre-processing steps like resizing, padding, or cropping. This poses challenges in medical imaging, particularly with irregularly shaped structures like tumors. A fixed bounding box crop size produces input images with highly variable foreground-to-background ratios. Resizing medical images can degrade information and introduce artefacts, impacting diagnosis. Hence, tailoring variable-sized crops to regions of interest can enhance feature representation capabilities. Moreover, large images are computationally expensive, and smaller sizes risk information loss, presenting a computation-accuracy tradeoff. We propose VariViT, an improved ViT model crafted to handle variable image sizes while maintaining a consistent patch size. VariViT employs a novel positional embedding resizing scheme for a variable number of patches. We also implement a new batching strategy within VariViT to reduce computational complexity, resulting in faster training and inference times. In our evaluations on two 3D brain MRI datasets, VariViT surpasses vanilla ViTs and ResNet in glioma genotype prediction and brain tumor classification. It achieves F1-scores of 75.5% and 76.3%, respectively, learning more discriminative features. Our proposed batching strategy reduces computation time by up to 30% compared to conventional architectures. These findings underscore the efficacy of VariViT in image representation learning. Our code can be found here: https://github.com/Aswathi-Varma/varivit
title VariViT: A Vision Transformer for Variable Image Sizes
topic Computer Vision and Pattern Recognition
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2602.14615