r/learnprogramming • u/Just-m_d • 20h ago
Debugging Self Supervised[Vit] vs. Supervised[CNN]Discussion
Hi everyone,
I am working in the Multi-Task ML projects in that i have done many experiments to train the model
Key finding:
CNN based architecture outperform the Vision transformer based architecture
Question:
is the Dataset only be the problem for Vit architecture to underperform the CNN bases architecture?
0
Upvotes
1
u/OneOrZeroGG 19h ago
Short answer: no, the dataset is only one of several possible reasons. Some of the usual suspects:
Inductive bias. CNNs have locality and translation equivariance built in, so they learn good features from less data. A ViT has to learn that from scratch, which is why it usually needs much more data (or a pretrained checkpoint) to catch up. On small or medium datasets a CNN winning is the normal result, not a bug.
Training recipe. ViTs are much more sensitive than CNNs. AdamW, learning rate warmup, a cosine schedule, weight decay, and strong augmentation (RandAugment, mixup, CutMix) matter a lot. If you used the same recipe for both, the CNN probably benefited from it more.
Your comparison changes two things at once. You said Self-Supervised ViT vs Supervised CNN, so it's not just architecture, it's also the training paradigm. A few things to check there:
- Are you evaluating with a linear probe or full fine-tuning? Some SSL methods (MAE for example) look weak under a linear probe and much better after fine-tuning.
- How big was the pretraining set, and how long did you pretrain? SSL ViTs need a lot of both.
- If possible, also run a supervised ViT and an SSL CNN, so you can tell whether the gap comes from the architecture or from the SSL.
Task type. In multi-task setups, dense or localization-heavy tasks often favor CNNs, and ViT patch size/resolution can hurt fine details. Also check how the task losses are weighted, since one task can dominate the shared backbone.
So I'd say the dataset is probably part of it, but I wouldn't conclude that before checking the recipe and the fair-comparison points above. What dataset size, model sizes and tasks are you using? That would help narrow it down.