Simple yet Effective Semi-supervised Knowledge Distillation from Vision-Language Models via Dual-Head Optimization
Organizations: VUNO Inc. · KAIST
Abstract
Semi-supervised learning (SSL) has emerged as a practical solution for addressing data scarcity challenges by leveraging unlabeled data. Recently, vision-language models (VLMs), pre-trained on massive image-text pairs, have demonstrated remarkable zero-/few-shot performance that often surpasses SSL approaches due to their exceptional generalization capabilities. This gap motivates us to question: how can we effectively harness the powerful generalization capabilities of VLMs into task-specific models? Knowledge distillation (KD) offers a natural framework for transferring VLM capabilities, but we identify that it suffers from gradient conflicts between supervised and distillation losses. To address this challenge, we propose Dual-Head Optimization (DHO), which introduces dual prediction heads for each distinct signal. We observe that DHO mitigates gradient conflicts, enabling improved feature learning compared to single-head KD baselines, with practical benefits of minimal computational overhead and test-time hyperparameter tuning without retraining. Extensive experiments across 15 datasets show that DHO consistently outperforms KD baselines, often outperforming teacher models with smaller student models. DHO also achieves new state-of-the-art performance on both in-distribution ImageNet semi-supervised learning and out-of-distribution generalization across ImageNet variants. Code and model checkpoints are publicly available at https://github.com/erjui/DHO/tree/main.
Figures & tables
| ResNet-18 trained from scratch | Self-supervised ResNet-50 | |||||||||||
| Method | 0-shot | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot | 0-shot | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot |
| Single-head KD methods | ||||||||||||
| KD | 51.0 | - | - | - | - | - | 61.0 | - | - | - | - | - |
| CE | - | 0.7 | 1.1 | 1.8 | 3.4 | 8.2 | - | 11.4 | 17.3 | 26.4 | 36.7 | 47.0 |
| CE+KD (feature) | - | 17.1 | 23.5 | 28.0 | 32.2 | 33.8 | - | 23.0 | 32.3 | 41.3 | 48.2 | 54.3 |
| CE+KD (logit) | - | 50.5 | 50.6 | 50.6 | 51.0 | 51.2 | - | 60.4 | 60.8 | 61.2 | 61.6 | 62.3 |
| Method | Architecture | Params | 1% | 10% |
| (M) | (%) | (%) | ||
| Self and Semi-supervised Learning | ||||
| MSN | ViT-B/4 | 86 | 75.7 | 80.2 |
| Semi-ViT | ViT-L/14 | 307 | 77.3 | 83.3 |
| Semi-ViT | ViT-H/14 | 632 | 80.0 | 84.3 |
| CLIP-based Training | ||||
| Model | Params | FLOPs | Throughput |
| (M) | (G) | (im/s) | |
| ResNet-18 | 11.69 | 1.83 | 3525.7 |
| + DHO | 12.20 (+4.4%) | 1.83 (+0.0%) | 3518.6 (-0.20%) |
| ResNet-50 | 25.56 | 4.14 | 1018.4 |
| + DHO | 27.61 (+8.0%) | 4.15 (+0.2%) | 1016.4 (-0.20%) |
| Method | Labeled Data | Teacher Model | Unlabeled Data | Val | V2 | Sketch | R | A | Avg |
| CLIP Zero-shot | |||||||||
| CLIP | - | - | - | 66.7 | 60.8 | 46.2 | 74.0 | 47.8 | 59.1 |
| Linear Evaluation | |||||||||
| Linear Evaluation | 1% | - | - | 72.8 | 64.2 | 47.0 | 74.6 | 48.6 | 61.4 |
| DHO † | 1% | ✓ | - | 73.4 | 65.3 | 48.3 | 75.8 | 49.4 | 62.4 |
| DHO † | 1% | ✓ | ✓ | 74.6 | 66.4 | 49.2 | 76.1 | 49.8 | 63.2 |
| Init ( / ). | Align. | Accuracy (%) |
| ✗ / ✗ | ✗ | 78.3 |
| ✓ / ✗ | ✗ | 78.5 (+0.2) |
| ✓ / ✓ | ✗ | 78.6 (+0.3) |
| ✓ / ✓ | ✓ | 78.7 (+0.4) |
Appendix figures & tables32 assets
Supplementary material from the paper’s appendix.
Appendix
| Few-shot Semi-supervised Settings on ImageNet | |
| Model Configuration | Student Training Details |
| • Student: ResNet18 [ 119 ] from scratch or ResNet50 from DINO [ 50 ] • Input size: 224 224 • Zero-shot Teacher: ResNet50 from CLIP [ 1 ] • Few-shot Teacher: ResNet50 from Tip-Adapter-F [ 5 ] • Teacher input size: 224 224 • labeled data: shots • , , and : • and : , (zero-shot); , (few-shot) | • Epochs: 20 • Optimizer: AdamW ( =0.9, =0.999) • Learning rate: , weight decay: • Batch size: 512 (labeled: 256, unlabeled: 256) • Scheduler: Cosine decay without warmup • Augmentation: Random crops (x0.5-1.0), horizontal flips |
| Few-shot Semi-supervised Settings on 10 Fine-Grained Datasets | |
| Model Configuration | Student Training Details |
| • Student: ResNet18 [ 119 ] or MobileNet [ 51 ] pre-trained on ImageNet under supervision • Input size: 224 224 • Zero-shot Teacher: ResNet50 from CLIP [ 1 ] • Few-shot Teacher: ResNet50 from Tip-Adapter-F [ 5 ] • Teacher input size: 224 224 • labeled data: shots • , , and : • and : determined by validation | • Epochs: 200 • Optimizer: AdamW ( =0.9, =0.999) • Learning rate: , weight decay: • Batch size: 128 (labeled: 64, unlabeled: 64) • Scheduler: Cosine decay without warmup • Augmentation: Random crops (x0.5-1.0), horizontal flips |
| Low-shot Semi-supervised Settings on ImageNet | |
| Full Training | |
| Model Configuration | Training Details |
| • Student: CLIP ViT-B/16 [ 1 ] • Student input size: 224 224 • Zero-shot Teacher: CLIP ViT-L/14 [ 1 ] • Teacher input size: 336 336 • Labeled data: 1% and 10% ImageNet • , , and : • and : and | • Epochs: 32 • Optimizer: AdamW ( =0.9, =0.999) • Learning rate: , weight decay: • Batch size: 512 (labeled: 256, unlabeled: 256) • Scheduler: Cosine warmup decay (5000 steps) • Augmentation: Random crops (x0.5-1.0), horizontal flips |
| Adaptation Methods (Linear Evaluation & Visual Prompt Tuning) | |
| Method Configuration | Training Details |
| • Linear evaluation [ 50 ] • Visual prompt tuning [ 48 ] • Frozen backbone: CLIP ViT-B/16 [ 1 ] • Input size: 224 224 • Zero-shot Teacher: CLIP ViT-L/14 [ 1 ] • Teacher input size: 336 336 • Labeled data: 1% and 10% ImageNet • , , and : • and : and | • Epochs: 20 • Optimizer: AdamW ( =0.9, =0.999) • Learning rate: , weight decay: • Batch size: 512 (labeled: 256, unlabeled: 256) • Scheduler: Cosine warmup decay (5000 steps) • Augmentation: Random crops (x0.5-1.0), horizontal flips |
| Adaptation Methods (Prompt Tuning) | |
| Model | Params (M) | FLOPs (G) | Throughput (im/s) |
| MobileNetV2 | 3.50 | 0.33 | 2978.4 |
| + DHO | 4.79 (+36.5%) | 0.34 (+3.0%) | 2971.2 (-0.24%) |
| ResNet-18 | 11.69 | 1.83 | 3525.7 |
| + DHO | 12.20 (+4.4%) | 1.83 (+0.0%) | 3518.6 (-0.20%) |
| ResNet-50 | 25.56 | 4.14 | 1018.4 |
| + DHO | 27.61 (+8.0%) | 4.15 (+0.2%) | 1016.4 (-0.19%) |
| Student | Teacher | Training Time | Hardware |
| ResNet-18 | ResNet-50 | 6 hours | 4× RTX 4090 |
| ResNet-50 | ResNet-50 | 8 hours | 4× RTX 4090 |
| ViT-B/16 | ViT-L/14 | 28 hours | 8× RTX 4090 |
| ViT-B/16 | ViT-H/14 | 40 hours | 8× RTX 4090 |
| ViT-L/14 | ViT-H/14 | 80 hours | 8× RTX 4090 |
| Method | Labeled | Accuracy (%) | Params (M) | FLOPs (G) | Throughput (im/s) |
| DHO | 1% | 81.6 | 87.22 | 17.58 | 243.35 |
| DHO + ToMe | 1% | 81.4 (–0.2) | 87.22 | 13.12 (–25.4%) | 323.39 (+32.9%) |
| DHO | 10% | 82.8 | 87.22 | 17.58 | 238.11 |
| DHO + ToMe | 10% | 82.5 (–0.3) | 87.22 | 13.12 (–25.4%) | 308.49 (+29.6%) |
| Dataset | # Classes | # Train | # Val | # Test | # Labeled (1-shot) | # Labeled (16-shot) |
| Fine-grained 10 Datasets | ||||||
| Caltech101 [ 30 ] | 100 | 4,128 | 1,649 | 2,465 | 100 (2.42%) | 1,600 (38.76%) |
| OxfordPets [ 31 ] | 37 | 2,944 | 736 | 3,669 | 37 (1.26%) | 592 (20.11%) |
| StanfordCars [ 32 ] | 196 | 6,509 | 1,635 | 8,041 | 196 (3.01%) | 3,136 (48.18%) |
| Flowers102 [ 33 ] | 102 | 4,093 | 1,633 | 2,463 | 102 (2.49%) | 1,632 (39.87%) |
| Food101 [ 34 ] | 101 | 50,500 | 20,200 | 30,300 | 101 (0.20%) | 1,616 (3.20%) |
| Method | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot | 100% |
| CE+KD (logit) | 50.5 | 50.6 | 50.6 | 51.0 | 51.2 | 66.3 |
| DHO | 51.8 | 52.4 | 52.6 | 53.3 | 54.5 | 66.7 |
| Method | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot |
| CE+KD (logit) | 56.2 | 58.9 | 61.7 | 65.8 | 69.8 |
| PCGrad | 56.8 | 60.3 | 62.1 | 67.5 | 71.6 |
| DHO | 60.1 | 63.7 | 70.2 | 75.4 | 79.1 |
| Method | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot |
| DHO | 51.8 | 52.4 | 52.6 | 53.3 | 54.5 |
| DKD | 8.9 | 15.0 | 20.6 | 28.2 | 34.9 |
| DKD+ DHO | 47.1 (+38.2) | 44.3 (+29.3) | 40.9 (+20.3) | 40.2 (+12.0) | 42.4 (+7.5) |
| WKD | 11.0 | 17.0 | 17.0 | 27.7 | 34.6 |
| WKD+ DHO | 53.2 (+42.2) | 53.3 (+36.3) | 53.3 (+36.3) | 54.0 (+26.3) | 54.8 (+20.2) |
| Method | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot |
| DHO | 60.1 | 63.7 | 70.2 | 75.4 | 79.1 |
| DKD | 28.7 | 41.3 | 55.4 | 66.3 | 73.1 |
| DKD+ DHO | 46.2 (+17.5) | 51.2 (+9.9) | 61.8 (+6.4) | 69.8 (+3.5) | 74.9 (+1.8) |
| WKD | 30.0 | 38.2 | 53.3 | 66.1 | 73.6 |
| WKD+ DHO | 59.6 (+29.6) | 64.5 (+26.3) | 71.2 (+17.9) | 75.7 (+9.6) | 79.6 (+6.0) |
| Method | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot |
| SHO ( ) | 55.9 | 59.4 | 62.1 | 67.4 | 71.2 |
| DHO , fixed | 57.5 (+1.6) | 63.5 (+4.1) | 71.6 (+9.5) | 75.3 (+7.9) | 79.2 (+8.0) |
| DHO , validation-searched | 59.1 | 64.3 | 71.7 | 75.2 | 79.2 |
| Method | 0-shot | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot |
| Zero-shot teacher distillation | ||||||
| CE + KD (logit) | – | 55.6 | 58.2 | 61.1 | 64.8 | 68.4 |
| DHO | – | 58.9 | 62.2 | 68.4 | 73.1 | 76.5 |
| Few-shot teacher distillation | ||||||
| CE + KD (logit)-F | – | 59.8 | 63.9 | 68.9 | 72.6 | 76.2 |
| DHO-F | – | 61.1 | 64.7 | 69.5 | 73.6 | 76.9 |
| Method | FixMatch | 0-shot | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot |
| KD | - | 53.9 | - | - | - | - | - |
| CE + KD (logit) | - | - | 55.6 | 58.2 | 61.1 | 64.8 | 68.4 |
| 2-stage | - | - | 53.0 | 53.6 | 58.5 | 63.7 | 68.6 |
| 2-stage | ✓ | - | 53.5 | 54.6 | 59.8 | 66.7 | 70.5 |
| DHO | - | - | 58.9 | 62.2 | 68.4 | 73.1 | 76.5 |
| Zero-shot teacher | - | 58.8 | - | - | - | - | - |
| Method | ImageNet 1% |
| DebiasedPL | 63.9 |
| DebiasedPL + DHO | 65.3 (+1.4) |
| Zero-shot VLM teacher | 60.3 |
| Method | ViT-B/16 | ViT-L/14 | ||
| 1% | 10% | 1% | 10% | |
| DHO | 81.66 | 82.78 | 84.59 | 85.94 |
| DHO +Ent | 81.66 | 82.65 | 84.60 | 85.92 |
| Student Model | Params (M) | Labeled Data | Teacher Model | Val | V2 | Sketch | R | A |
| ViT-B/16 Student | ||||||||
| ViT-B/16 [ 1 ] | 86M | zero-shot | - | 66.7 | 60.8 | 46.2 | 74.0 | 47.0 |
| ViT-B/16 | 86M | 1% | ViT-L/14 | 78.7 | 70.1 | 48.0 | 70.9 | 41.1 |
| ViT-B/16 | 86M | 10% | ViT-L/14 | 80.8 | 71.3 | 47.4 | 71.7 | 41.4 |
| ViT-B/16 | 86M | 1% | ViT-H/14 | 81.6 | 72.6 | 50.6 | 65.5 | 35.6 |
| ViT-B/16 | 86M | 10% | ViT-H/14 | 82.8 | 73.6 | 50.7 | 67.7 | 37.8 |
| Dataset | Seed 1 | Seed 2 | Seed 3 | Mean SD |
| Caltech-101 | 92.54 | 92.54 | 93.51 | |
| DTD | 61.23 | 60.40 | 61.23 | |
| EuroSAT | 88.26 | 89.15 | 90.44 | |
| FGVC Aircraft | 54.16 | 52.78 | 52.93 | |
| Oxford Flowers | 97.48 | 97.24 | 97.85 | |
| Oxford Pets | 88.20 | 88.14 | 88.83 |
| OpenCLIP RN50 | SigLIP ViT-B/16 | |||
| Dataset | CE+KD | DHO | CE+KD | DHO |
| Caltech-101 | 65.92 | 87.79 | 93.83 | 94.16 |
| DTD | 34.46 | 58.63 | 58.39 | 66.37 |
| EuroSAT | 33.49 | 87.37 | 71.64 | 91.73 |
| FGVC Aircraft | 17.22 | 45.87 | 47.76 | 61.45 |
| Oxford Flowers | 69.71 | 96.22 | 94.64 | 98.54 |
| 10 Datasets (Average) | 1 | 11 | 21 | 31 | 41 | 51 | 61 | 71 | 81 | 91 | 101 |
| CE+KD (logit) | 4.974 | 4.664 | 4.638 | 4.608 | 4.601 | 4.598 | 4.595 | 4.595 | 4.594 | 4.595 | 4.595 |
| DHO | 4.672 | 4.435 | 4.413 | 4.391 | 4.390 | 4.390 | 4.390 | 4.393 | 4.393 | 4.394 | 4.395 |
| 10 Datasets (Average) | 111 | 121 | 131 | 141 | 151 | 161 | 171 | 181 | 191 | ||
| CE+KD (logit) | 4.595 | 4.596 | 4.596 | 4.596 | 4.597 | 4.598 | 4.598 | 4.599 | 4.599 | ||
| DHO | 4.396 | 4.396 | 4.398 | 4.399 | 4.400 | 4.400 | 4.400 | 4.401 | 4.401 |
| Layer | SHO | DHO | (DHO SHO) |
| layer1 (early) | |||
| layer2 | |||
| layer3 | |||
| layer4 (deepest) | |||
| classifier head | – | – |
| Dataset | SHO | DHO | (DHO SHO) |
| EuroSAT | |||
| DTD | |||
| FGVC-Aircraft | |||
| Oxford Flowers | |||
| UCF101 | |||
| Stanford Cars |
| ImageNet | Average of 10 tasks | ||||||||||
| Configuration | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot | 1-shot | 2-shot | 4-shot | 8-shot | 16-shot | |
| DHO (base) | 61.7 | 62.2 | 62.6 | 63.8 | 65.1 | 58.9 | 62.2 | 68.4 | 73.1 | 76.5 | |
| DHO +NL-Head-CE | 61.7 | 61.9 | 62.2 | 63.1 | 64.8 | 59.3 | 62.1 | 68.0 | 72.7 | 76.2 | |
| DHO +NL-Head-KD | 62.1 | 62.6 | 62.9 | 64.0 | 65.9 | 58.3 | 62.1 | 67.8 | 72.4 | 76.5 | |
| DHO +NL-Head-CE+KD | 62.0 | 62.3 | 62.6 | 63.8 | 65.4 | 59.1 | 62.2 | 68.6 | 72.4 | 76.5 | |
| Configuration | CE Head | KD Head | Combined |
| DHO (base) | 60.64 | 61.55 | 65.37 |
| DHO +NL-Head-CE | 60.18 | 61.39 | 64.91 |
| DHO +NL-Head-KD | 60.95 | 61.76 | 65.97 |
| DHO +NL-Head-CE+KD | 61.66 | 61.81 | 65.59 |
| CE head | Dropout | CE-head WD | Validation | Test |
| Linear | — | 0.01 | 82.54 | 79.54 |
| MLP (default) | 0.5 | 0.01 | 82.83 | 79.30 |
| MLP | 0.7 | 0.01 | 82.73 | 79.07 |
| MLP | 0.5 | 0.05 | 82.38 | 78.97 |
| MLP | 0.5 | 0.10 | 82.48 | 79.06 |
| MLP | 0.7 | 0.05 | 82.76 | 79.10 |
Knowledge Distillation
Knowledge distillation transfers useful behavior or representations from larger or specialized models into more compact or adaptable learners.
See all 819 papers