Running deep models for medical image analysis at the point of care is challenging with standard architectures: convolutional neural networks (CNNs) are often too heavy for edge devices, while Vision Transformers (ViTs) require massive training datasets to compensate for missing inductive biases. This study investigates how far the dual-token distillation used to train data-efficient ViTs can be pushed when applied across architectures, from a CNN-based teacher into a lightweight ViT student. LiteMed-ViT is introduced as a dual-token ViT featuring a convolutional stem and a class-balanced distillation objective; at 0.234M parameters, LiteMed-ViT carries 47.8x fewer parameters than its ResNet18 teacher at a memory footprint of just 0.89 MB. Evaluated against three compact CNN baselines on three MedMNIST subsets of varying modality and class balance, LiteMed-ViT attains higher accuracy than all three baselines on BloodMNIST (95.05%) and two on PathMNIST (89.15%). Under MedMNIST-C corruptions, it is at least as robust as every compact CNN across all subsets, outperforming them on BloodMNIST and PathMNIST without declining in relative standing as severity increases. Particular attention is devoted to identifying the exact conditions where performance plateaus. On DermaMNIST, LiteMed-ViT's balanced accuracy remains up to 1.9 points below the strongest compact CNNs and does not benefit from higher input resolutions up to 224 pixels, where ResNet18 gains 12.6 points. Stronger teachers do not yield a more accurate student, and overconfident ones lower its DermaMNIST balanced accuracy unless calibrated.
Figures & tables
Model
Params
MACs
CPU
GPU
BloodMNIST
DermaMNIST
PathMNIST
(M)
(M)
(ms)
(ms)
Acc
bAcc
Acc
bAcc
Acc
bAcc
ResNet18
11.181
34.41
6.73
2.38
96.29 ± 0.15 ↑
96.16 ± 0.22 ↑
76.95 ± 2.29 ↑
59.86 ± 2.16 ↑
90.63 ± 0.32 ↑
88.12 ± 0.60 ↑
MobileNetV3-Small
1.526
2.23
7.79
5.58
91.68 ± 0.61 ↓
90.66 ± 0.70 ↓
74.11 ± 0.56
56.62 ± 3.24
84.61 ± 0.38 ↓
80.77 ± 0.60 ↓
SqueezeNet 1.1
0.727
2.59
1.81
1.97
93.91 ± 0.63 ↓
93.36 ± 0.86 ↓
75.62 ± 0.70 ↑
55.60 ± 1.45
88.39 ± 0.62
85.20 ± 0.64
ShuffleNet V2 0.5 ×
0.350
0.84
10.45
7.45
92.96 ± 0.56 ↓
92.22 ± 0.45 ↓
75.45 ± 0.81 ↑
57.67 ± 0.90 ↑
86.65 ± 0.39 ↓
83.30 ± 0.64 ↓
LiteMed-ViT
0.234
11.64
7.23
4.42
95.05 ± 0.55
94.48 ± 0.59
74.26 ± 0.53
55.73 ± 1.98
89.15 ± 0.93
85.56 ± 1.00
TABLE I: Efficiency and test performance, mean ± 95% confidence interval over four seeds: accuracy (Acc) under the standard and balanced accuracy (bAcc) under the balanced decision rule for every model (Section III-D ); latency at batch size one on a four-core CPU and a T4 GPU. ↑ / ↓ : higher/lower than LiteMed-ViT under the pre-set rule; unmarked: comparable. Bold: best compact model. ResNet18, the teacher, is shown for reference.
Standard
Balanced
Class
Supp.
Recall
Precision
Recall
F1
Dermatofibroma
23
0.000
0.152
0.293
0.200
Vascular lesion
29
0.638
0.401
0.819
0.533
Actinic keratosis
66
0.356
0.325
0.640
0.431
Basal cell carcinoma
103
0.447
0.481
0.447
0.461
Benign keratosis
220
0.283
0.462
0.340
0.389
TABLE II: Per-class DermaMNIST test results of LiteMed-ViT (mean of four seeds): the same trained models under the standard and balanced rules.The last row gives the total support and the means of the metrics; mean recall is the balanced accuracy.
BloodMNIST
DermaMNIST
PathMNIST
Model
s1
s3
s5
mCA
s1
s3
s5
mCA
s1
s3
s5
mCA
Mean
ResNet18
89.59
69.72
58.81
72.47 ↓
75.83
72.71
68.39
72.35
85.79
80.44
70.15
79.11 ↑
74.64
MobileNetV3-Small
81.50
64.00
54.88
66.00 ↓
72.92
69.78
64.48
69.18 ↓
80.92
74.66
62.83
73.25 ↓
69.48
SqueezeNet 1.1
87.08
71.49
59.78
72.78 ↓
74.82
71.45
65.28
70.75
81.63
76.64
66.69
75.27 ↓
72.93
ShuffleNet V2 0.5 ×
83.88
62.61
55.07
66.30 ↓
74.13
70.94
65.35
70.28 ↓
81.72
76.78
66.59
75.34 ↓
70.64
LiteMed-ViT
91.35
72.95
63.01
75.59
73.81
72.50
69.08
71.70
84.84
79.49
68.38
77.99
75.09
TABLE III: Accuracy (%) under MedMNIST-C corruptions at severities 1, 3 and 5, and mean corrupted accuracy (mCA) over all corruptions and severities; mean of four seeds, standard decision rule. ↑ / ↓ : mCA higher/lower than LiteMed-ViT’s under the pre-set rule. Bold: best compact model. Mean: mCA averaged over the three subsets.
BloodMNIST
DermaMNIST
PathMNIST
Teacher
T
S
S b
T
S
S b
T
S
S b
ResNet18
96.4
93.7 ± 0.2
92.8 ± 0.6
77.0
72.7 ± 1.6
51.9 ± 3.0
87.9
85.4 ± 1.1
80.6 ± 0.8
ResNet50
96.6
93.6 ± 0.2
92.6 ± 0.5
79.8
71.7 ± 2.0
42.6 ± 5.7 ↓
89.5
85.8 ± 0.9
80.7 ± 1.1
DenseNet-121
96.8
93.9 ± 0.4
93.1 ± 0.4
79.4
71.9 ± 2.0
46.3 ± 4.9 ↓
89.1
85.5 ± 1.1
80.5 ± 1.3
Ens. R18+R50
97.1
93.7 ± 0.3
92.9 ± 0.3
80.4
71.9 ± 2.5
47.0 ± 5.4
90.1
85.6 ± 1.0
80.7 ± 1.0
TABLE IV: Teacher study (shorter protocol, Section III-D ): accuracy (%) of each teacher (T, one run) and of the LiteMed-ViT student distilled from it (S), standard rule, and the student’s balanced accuracy (S b ), balanced rule; students are mean ± 95% CI over four seeds. ↑ / ↓ : higher/lower than the ResNet18-taught student under the pre-set rule; unmarked: comparable.
School of Information Technology Monash University Malaysia · Faculty of Innovation Engineering Macau University of Science and Technology · Department of Bioelectronics Faculty of Biomedical Engineering Shenzhen University of Advanced Technology +1