arXiv:2610.24602cs.CVOct 2026

Manuscript Offprint

arXiv:2610.24602

Dynamic self-ensemble on multi-exit residual vision transformer for small-data image classification

Stephen Ekaputra Limantoro, Yan-Kai Wang, Ching-Chun Huang, Hong-Han Shuai, Wen-Huang Cheng, Jungwoo Huh, Sanghoon Lee

ABSTRACT

Vision Transformer (ViT) has garnered increased attention for image classification in recent years. However, ViT is notorious for its data-hungry problem as it achieves high-performance results when only trained on large-size datasets. In this paper, we study how ViT specifically works on small-scale datasets with limited data where the availability of image data is often constrained in practice, especially in fields such as medical imaging. To mitigate the issue, we designed a multi-stage residual ViT, dubbed ReSEViT, with the self-ensemble method to utilize multi-level information from intermediate features. Due to the complex decision boundaries for classifications, relying on a single classifier can lead to prediction errors. Hence, we propose a new learning method for ViT, named self-ensemble learning, which ensembles multi-stage classifiers in a single model. Our self-ensemble comprises a novel approach, Dynamic Learner Selection (DLS), to adaptively select the importance of different stages. ReSEViT incorporates residual token embeddings which is a ResNet-like block to model effective local structures alongside with transformer blocks in each stage. The integration of residual tokens and self-ensemble learning into a multi-stage ViT highlights the reduction in redundancy, prediction error and variance while maintaining an efficient model size for small-scale image datasets.

1. Introduction

Recent advancements in deep learning models, particularly Transformers [53], have significantly impacted various vision tasks i.e., image classification [11, 60, 59], object detection [72], and image processing [4]. Among these, image classification is a fundamental building block that supports the development of more complex applications [42, 18]. ViT [11] introduced the first fully transformer-based model that attains competitive results on large-scale image classification benchmarks. Despite these advances, the performance of ViT is still inferior to that of CNN-based models when trained from scratch on medium-sized datasets, e.g., ImageNet-1K. This disparity arises as the transformers lack the locality inductive biases (local receptive field, translation invariance, and spatial subsampling [31]), which are inherent in CNNs. Consequently, training ViT from scratch with limited data yields suboptimal performance, while its high computational cost further challenges deployment on resource-constrained edge devices, IoT devices, consumer electronics, and wearable medical devices that rely on lightweight models [52, 55, 61, 27, 1, 62, 67].

Several works [70, 16, 12, 34] have introduced strategies for training ViT from scratch on small datasets with either model architecture modifications or self-supervised techniques to solve the data-hungry problem. It takes place when ViT underperforms due to a limited amount of data. A recent work, Compact Convolutional Transformer (CCT) [16], introduced a simple CNN-Transformer hybrid approach that can be well-trained from scratch on small-scale datasets (e.g., CIFAR) by employing convolutional tokenization and a transformer encoder with sequence pooling. This architecture design aims to take advantage of the inductive biases from CNNs and integrate them with a transformer. To further improve the ViT model, one straightforward strategy is to use the existing ensemble methods [2, 17, 26].

∗^{*}Corresponding author

stephenekaputra@gmail.com (S.E. Limantoro); ykwang.ee09@nycu.edu.tw (Y. Wang); chingchun@nycu.edu.tw (C. Huang); hhshuai@nycu.edu.tw (H. Shuai); wenhuang@csie.ntu.edu.tw (W. Cheng); gjwjddn9@yonsei.ac.kr (J. Huh); slee@yonsei.ac.kr (S. Lee)

ORCID(s):

First Author et al.: Preprint submitted to Elsevier

Page 1 of 26

(a) Same Type Ensemble

Figure

(b) Different Type Ensemble

(c) Self-Ensemble Learning (Ours)

  • The probability color represents distinct learned features

C Convolution Token

R Residual Token

T Transformer

⊕ Ensemble

Figure 1: Illustration of traditional ensemble and our self-ensemble learning for our ReSEViT. The traditional ensemble methods integrating multiple models (e.g. (a) two CvTs, (b) ResNet and CvT) separately are computationally heavier and only suggest high-level representation producing high-similar semantic outputs. (c) The prediction of ReSEViT is more accurate as multi-level representation evades the risk of semantic redundancy where the transformer in each stage inherits stronger local inductive biases from the residual token. In addition, both training and testing time could be drastically reduced with the self-ensemble learning.

However, ensemble methods typically lead to a significant increase in the number of parameters, which is often impractical for real-time applications, especially for large models. For example, CCT-14/7×2 is a single-stage type model requiring 22.36M parameters for the ImageNet dataset [16], which may expand to more than 100M if we ensemble five models with similar sizes in a parallel way. Therefore, we proposed ReSEViT, a residual vision transformer with the self-ensemble method. The self-ensemble method is a novel ensemble method using only one deep learning model for an image classification task. Such a hierarchical structure ensemble strategy has been explored previously on object detection tasks, i.e., FPN [33], but research on image classification has barely been touched.

In our approach, we first design a ViT backbone with a multi-stage structure to enable self-ensemble learning. Specifically, inspired by CvT [60], it adopts a three-stage model consisting of convolutional token embedding and a convoluted transformer block in each stage. In our method, a residual token embedding [19] is adopted to model effective local structures in each stage. Notably, the ResNet block is not a new architecture. However, it is employed to provide an efficient strategy for ViT's data hunger on small image datasets. Similar to the works of [40, 54, 64], parts of the architecture are replaced by existing methods, such as the MobileNet block, shift operation, and pooling layer, to demonstrate the effect on the model for a specific purpose. We hypothesize that the residual token enables our self-ensemble to perform better and more efficiently for small-scale datasets since the local inductive biases for the transformer are denser in each stage. Intuitively, stronger feature representations at each stage lead to a compounding effect in the self-ensemble method resulting in high performance while preserving computational efficiency.

To effectively ensemble the results from different stages, one naïve approach averages the prediction results obtained by classifiers of different stages during inference. However, the performance is degraded since the classifiers of different stages are not of the same importance. To address this issue, we propose a multistage ensemble loss to cultivate the learning in each stage classifier. Specifically, the multistage ensemble loss forces all stage classifiers to learn from the true label, making each stage classifier's outputs meaningful for our self-ensemble method. We then introduce Dynamic Learner Selection (DLS) to adaptively select the best classifiers based on the training performance of each stage classifier. DLS is a simple non-parametric weighting scalar that has no additional computation. We can apply the DLS to both the ensemble inference and the multistage ensemble loss. The goal of DLS is to maximize the utilization of the best stage classifiers and minimize the stage classifiers with inferior performance. Finally, we illustrate our approach compared with the traditional ensemble for an efficient ensemble in Fig. 1. ReSEViT maintains the efficiency of ViT in less data-intensive domains.

The main research contributions of this study are highlighted as follows:

  1. To mitigate the Vision Transformer’s data-hunger on small image datasets, we provide a new perspective by marrying a multi-stage ViT model with self-ensemble learning via a multi-exit architecture, improving data efficiency. While the traditional methods ensemble multiple models, we present a unified model strategy with residual token and self-ensemble learning for local and global information flows.

First Author et al.: Preprint submitted to Elsevier

Page 2 of 26

Table 1 Comparison Types of Vision Transformer

MethodPos. Emb.Token Emb.ProjectionsMulti-StageSmall-ScaleEfficient Training
ViT [11]yesstandardlinearnonono
DeiT [49]yesstandardlinearnonodistillation
CvT [60]noconvolutionconvolutionyesnono
CCT [16]optionalconvolutionlinearnoyesno
NesT [70]yesconvolutionlinearyesyesno
TransXNet [39]yesconvolutionlinearyesnono
ReSEViT (Ours)noresidual conv.convolutionyesyesself-ensemble
  1. To the best of our knowledge, this is the first time self-ensemble learning for a small-data image classification task is proposed. Our ensemble method compresses the training and inference cost by employing the model itself without training additional base models. An efficient DLS method is introduced to dynamically select the best classifiers based on their training performance. Comparison results with other ensemble methods demonstrate the robustness and efficiency of our self-ensemble.

  2. The experimental results show that the proposed ReSEViT is well-motivated for small-scale datasets, including CIFAR, a subset of ImageNet, MedMNIST, and ISIC 2018. Comprehensive studies are conducted to evaluate the effectiveness of ReSEViT across data size, gradient and variance analysis, efficiency, and the importance of residual token with self-ensemble on ReSEViT for small datasets.

References (72)