ABO-Med: Accelerated Bilevel Optimization for Few-Shot Medical Image Classification
Authors: Ruoxuan Shi, Sheng Yang, Zhengxing Su, Xiaoyang Hou, Yating Liu
Organizations: School of Mathematics and Statistics, Lanzhou University · Department of Statistics, University of California, Riverside · Department of Oncology, Lanzhou University Second Hospital
In recent years, bilevel optimization has been widely used in a variety of machine learning tasks. However, prior bilevel optimization algorithms generally require the computation of second-order information, which limits their practical scalability. Only recently has a first-order paradigm for bilevel optimization been established, attaining near-optimal theoretical guarantees for solving bilevel optimization problems. In this paper, we propose ABO-Med, a scalable instantiation of this paradigm for few-shot learning, by incorporating it into the model-agnostic meta-learning (MAML) framework and tailoring it to medical image classification. We also introduce Medical Adaptive RandomAugment (MedRAug), a modality-aware augmentation strategy designed for medical images. Theoretically, ABO-Med establishes the optimality of MAML-type meta-learning approaches. Empirically, ABO-Med outperforms prior baselines on several public medical datasets, with gains of 1.99% to 18.76%, while MedRAug further improves the average accuracy by 2.20% to 6.34%. Additional cross-domain experiments, augmentation ablation studies, backbone ablation studies, and training efficiency analysis further validate the effectiveness and efficiency of the proposed method.
Figures & tables
Figure 1: Grad-CAM visualization of the ABO-Med method trained under the 3-way 10-shot setting on Pap-Smear, ISIC2018, and BreakHis40X, using the baseline augmentation strategy. Warmer colors indicate regions that contribute more strongly to the model prediction.
Figure 2: Overall framework of ABO-Med, including task sampling, DataAugment, fully first-order task adaptation, meta-gradient construction, and outer-loop meta-update.
Method
Pap-Smear
ISIC2018
BreakHis40X
1-shot
3-shot
5-shot
7-shot
10-shot
1-shot
3-shot
5-shot
7-shot
10-shot
1-shot
3-shot
5-shot
7-shot
10-shot
MAML
64.59 ± 0.97
76.97 ± 0.76
81.78 ± 0.55
84.96 ± 0.45
87.41 ± 0.39
42.36 ± 0.70
48.09 ± 0.70
48.86 ± 0.65
51.23 ± 0.62
54.90 ± 0.60
37.88 ± 0.66
44.45 ± 0.65
47.31 ± 0.62
47.17 ± 0.57
49.31 ± 0.61
FOMAML
64.60 ± 1.09
78.16 ± 0.77
81.21 ± 0.59
84.11 ± 0.48
85.88 ± 0.43
36.73 ± 0.55
47.64 ± 0.67
51.36 ± 0.65
52.04 ± 0.65
52.73 ± 0.60
38.15 ± 0.71
47.01 ± 0.69
49.64 ± 0.63
55.93 ± 0.67
49.63 ± 0.61
Reptile
55.08 ± 0.88
68.51 ± 0.70
71.32 ± 0.67
71.44 ± 0.64
71.01 ± 0.64
40.77 ± 0.68
46.85 ± 0.68
48.93 ± 0.63
49.02 ± 0.60
47.88 ± 0.57
40.86 ± 0.74
40.86 ± 0.74
46.59 ± 0.68
46.47 ± 0.65
46.50 ± 0.68
ALFA
66.40 ± 1.16
78.33 ± 0.59
82.17 ± 0.46
81.85 ± 0.42
87.56 ± 0.36
42.73 ± 0.75
52.57 ± 0.64
57.12 ± 0.63
56.14 ± 0.64
61.57 ± 0.63
37.09 ± 0.64
52.41 ± 0.66
54.28 ± 0.64
56.16 ± 0.64
60.38 ± 0.57
Tra-MAML
66.40 ± 1.02
81.48 ± 0.64
84.42 ± 0.47
86.71 ± 0.40
87.51 ± 0.37
41.71 ± 0.66
48.67 ± 0.68
55.20 ± 0.66
61.25 ± 0.61
62.84 ± 0.56
38.45 ± 0.67
44.96 ± 0.62
57.76 ± 0.66
62.61 ± 0.67
62.67 ± 0.60
Table 1: Comparison of various methods on the Pap-Smear, ISIC2018, and BreakHis40X datasets across different few-shot settings. Results are reported as mean test accuracy (%) with 95% confidence intervals.
Dataset
Method
Shot
Avg
1
3
5
7
10
Pap-Smear
MAML
0.0711
0.0745
0.0760
0.0773
0.0801
0.0758
FOMAML
0.0674
0.0706
0.0726
0.0732
0.0738
0.0715
Reptile
0.0098
0.0112
0.0112
0.0134
0.0147
0.0121
ALFA
0.0716
0.0820
0.0865
0.0956
0.1010
0.0873
Tra-MAML
0.0597
0.0644
0.0696
0.0717
0.0722
0.0675
Table 2: Comparison of training time (h) per 100 tasks between few-shot learning methods and ABO-Med on the Pap-Smear, ISIC2018, and BreakHis40X datasets.
Method
BreakHis40X → BCHI (Near-Domain)
Pap-Smear → BCHI (Far-Domain)
3-shot
5-shot
10-shot
3-shot
5-shot
10-shot
MAML
53.45 ± 0.66
56.13 ± 0.63
58.27 ± 0.62
47.46 ± 0.75
48.53 ± 0.70
56.18 ± 0.62
FOMAML
57.80 ± 0.76
62.24 ± 0.62
62.89 ± 0.52
46.08 ± 0.78
50.14 ± 0.72
56.31 ± 0.61
Reptile
55.27 ± 0.70
55.69 ± 0.64
56.78 ± 0.62
54.47 ± 0.69
55.08 ± 0.66
56.52 ± 0.58
ALFA
63.67 ± 0.67
65.13 ± 0.58
68.67 ± 0.53
46.03 ± 0.77
45.12 ± 0.73
53.06 ± 0.64
Tra-MAML
54.67 ± 0.68
68.68 ± 0.56
68.62 ± 0.52
52.48 ± 0.70
56.07 ± 0.62
57.46 ± 0.56
Table 3: Cross-domain few-shot classification results on the BCHI dataset under near-domain and far-domain settings. Results are reported as mean test accuracy (%) with 95% confidence intervals.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Hyperparameter
Value
Outer learning rate, η
1
Inner learning rate for z update, α
0.005
Inner learning rate for y update, τ
0.05
Lagrangian multiplier, λ
1
Number of inner iterations, K
30
number of adaptation steps K′
30
Appendix
Table 4: Experimental hyperparameter settings for ABO-Med.
Backbone
Dataset
3-shot
5-shot
10-shot
CNN4 (0.113M)
Pap-Smear
81.51 ± 0.53
86.78 ± 0.65
87.62 ± 0.61
ISIC2018
53.56 ± 0.65
58.28 ± 0.52
63.67 ± 0.64
BreakHis40X
55.37 ± 0.83
69.07 ± 0.79
76.17 ± 0.89
ResNetFeats10 (4.898M)
Pap-Smear
75.57 ± 0.68
80.69 ± 0.55
84.18 ± 0.52
ISIC2018
52.81 ± 0.64
55.59 ± 0.61
61.68 ± 0.63
BreakHis40X
53.46 ± 0.63
65.92 ± 0.57
73.65 ± 0.54
Appendix
Table 5: Ablation study of different feature backbones on the Pap-Smear, ISIC2018, and BreakHis40X datasets. The number of trainable parameters of the feature extractor is reported below each backbone name. Results are presented as mean test accuracy (%) with 95% confidence intervals, and the best results are shown in bold.
Figure 3: Examples of different data augmentation strategies on the Pap-Smear, ISIC2018, and BreakHis datasets.
Operation
Type
Rationale
Identity
Baseline operation
Keeps the original cell image unchanged and avoids unnecessary structural perturbation.
Rotate
Geometric transformation
Simulates cell orientation variation, since cytology images usually have no fixed directional semantics.
Scale
Geometric transformation
Simulates differences in cell size and microscopic magnification.
Brightness
Photometric transformation
Simulates illumination and exposure variation in microscopic imaging.
Contrast
Photometric transformation
Simulates contrast differences caused by staining and imaging conditions.
RGBShift
Color transformation
Applies mild channel-wise color perturbation to simulate staining and color response variation.
Appendix
Table 6: Augmentation operation space for Pap-smear cytology images.
Operation
Type
Rationale
Identity
Baseline operation
Preserves the original dermoscopic image and avoids over-augmentation.
Rotate
Geometric transformation
Simulates lesion orientation variation caused by camera angle or patient positioning.
Translate-X
Geometric transformation
Simulates horizontal lesion position variation within the image.
Translate-Y
Geometric transformation
Simulates vertical lesion position variation while preserving lesion appearance.
Brightness
Photometric transformation
Simulates illumination differences under different imaging conditions.
Contrast
Photometric transformation
Improves robustness to contrast variation between lesion and surrounding skin.
Appendix
Table 7: Augmentation operation space for ISIC dermoscopic images.
Operation
Type
Rationale
Identity
Baseline operation
Keeps the original image unchanged and prevents excessive augmentation.
Rotate
Geometric transformation
Simulates tissue orientation variation caused by slide preparation and scanning.
Translate-X
Geometric transformation
Simulates horizontal position shifts of tissue regions.
Translate-Y
Geometric transformation
Simulates vertical position shifts of tissue regions.
Shear-X
Geometric transformation
Introduces mild horizontal shape variation while preserving tissue morphology.
Shear-Y
Geometric transformation
Introduces mild vertical shape variation while maintaining global tissue structure.
Appendix
Table 8: Augmentation operation space for BreakHis pathological images.
Dataset
Method
1-shot
5-shot
10-shot
Pap-Smear
Baseline
81.51 ± 0.68
86.78 ± 0.65
87.62 ± 0.61
Cutmix
71.37 ± 0.66
74.58 ± 0.65
80.11 ± 0.54
Mixup
70.56 ± 0.62
72.39 ± 0.58
79.46 ± 0.51
Cutout
73.67 ± 0.69
80.47 ± 0.64
82.56 ± 0.62
MedRAug
83.11 ± 0.67
87.42 ± 0.65
90.45 ± 0.58
ISIC2018
Baseline
53.56 ± 0.65
58.28 ± 0.62
63.67 ± 0.64
Appendix
Table 9: Ablation study of baseline data augmentation strategies, Cutmix, Mixup, Cutout, and MedRAug, on the Pap-Smear, ISIC2018, and BreakHis40X datasets. The results are reported as mean test accuracy (%) with their 95% confidence intervals.