Research project · PyTorch · 184 training runs

Fashion-MNIST Analysis

What pretrained backbones, augmentation and seed ensembles actually buy on a small grayscale benchmark, and what they cost in calibration and robustness. Every number is a mean over several random seeds, with confidence intervals and paired tests.

Best test accuracy
95.28%
ViT-Tiny/16, pretrained
Best without pretraining
94.12%
ResNet-18 (custom)
Pretraining gain, ViT
+15.6
points over the same model from scratch
Training runs
184
3–5 seeds per configuration

Main findings

  1. Pretraining is what moves accuracy past about 94%. ImageNet weights improve every backbone on every seed: +1.3 to +3.8 points for CNNs and +15.6 for ViT-Tiny, which collapses to 79.7% from scratch.
  2. Among models trained from scratch, ResNet-18 is clearly best (94.12%), with a confidence interval that does not overlap TinyVGG's. The original single-seed claim that TinyVGG was best does not hold.
  3. Whether random cropping helps depends on model size. Removing it gains +1.5 for MiniCNN and +1.0 for TinyVGG (about 0.1M parameters each), but costs ResNet-18 0.5 points, on every seed.
  4. Seed ensembles add accuracy but can hurt calibration. Averaging five models worsens calibration for every group trained with Mixup/CutMix and improves it for those trained without, reproducing Wen et al. (ICLR 2021).
  5. Clean accuracy hides robustness differences. At near-identical accuracy, ResNet-18 makes 16–17 points fewer errors than TinyVGG under contrast and brightness shifts.

How the models compare

Test accuracy by model

Dots are means over seeds; whiskers are 95% confidence intervals.

90%91%92%93%94%95%96%Test accuracy (95% CI)ViT-Tiny/1695.28%95.28% ViT-Tiny/16 ImageNet-pretrained 95% CI ±0.22 points, n = 3 seeds 5.43M parametersConvNeXt-Tiny95.03% ConvNeXt-Tiny ImageNet-pretrained 95% CI ±0.20 points, n = 3 seeds 27.82M parametersTinyVGG, no crop, 5-seed ensemble94.21% TinyVGG, no crop, 5-seed ensemble Seed ensemble single ensemble of 5 seed models 0.71M parameters in totalResNet-18 (custom)94.12% ResNet-18 (custom) Trained from scratch 95% CI ±0.23 points, n = 5 seeds 11.17M parametersEfficientNet-B0 †93.97% EfficientNet-B0 ImageNet-pretrained 95% CI ±0.52 points, n = 3 seeds 4.02M parameters measured on the pre-fix augmentation pipelineTinyVGG, no crop93.62% TinyVGG, no crop Trained from scratch 95% CI ±0.45 points, n = 5 seeds 0.14M parametersResNet-18 (timm) †93.41% ResNet-18 (timm) ImageNet-pretrained 95% CI ±0.48 points, n = 3 seeds 11.18M parameters measured on the pre-fix augmentation pipelineTinyVGG92.73% TinyVGG Trained from scratch 95% CI ±0.44 points, n = 5 seeds 0.14M parametersMiniCNN, no crop92.36% MiniCNN, no crop Trained from scratch 95% CI ±0.69 points, n = 5 seeds 0.11M parametersMiniCNN90.90% MiniCNN Trained from scratch 95% CI ±0.52 points, n = 5 seeds 0.11M parameters90%92%94%96%Test accuracy (95% CI)ViT-Tiny/1695.28%95.28% ViT-Tiny/16 ImageNet-pretrained 95% CI ±0.22 points, n = 3 seeds 5.43M parametersConvNeXt-Tiny95.03% ConvNeXt-Tiny ImageNet-pretrained 95% CI ±0.20 points, n = 3 seeds 27.82M parametersTinyVGG, no crop, 5-seed ensemble94.21% TinyVGG, no crop, 5-seed ensemble Seed ensemble single ensemble of 5 seed models 0.71M parameters in totalResNet-18 (custom)94.12% ResNet-18 (custom) Trained from scratch 95% CI ±0.23 points, n = 5 seeds 11.17M parametersEfficientNet-B0 †93.97% EfficientNet-B0 ImageNet-pretrained 95% CI ±0.52 points, n = 3 seeds 4.02M parameters measured on the pre-fix augmentation pipelineTinyVGG, no crop93.62% TinyVGG, no crop Trained from scratch 95% CI ±0.45 points, n = 5 seeds 0.14M parametersResNet-18 (timm) †93.41% ResNet-18 (timm) ImageNet-pretrained 95% CI ±0.48 points, n = 3 seeds 11.18M parameters measured on the pre-fix augmentation pipelineTinyVGG92.73% TinyVGG Trained from scratch 95% CI ±0.44 points, n = 5 seeds 0.14M parametersMiniCNN, no crop92.36% MiniCNN, no crop Trained from scratch 95% CI ±0.69 points, n = 5 seeds 0.11M parametersMiniCNN90.90% MiniCNN Trained from scratch 95% CI ±0.52 points, n = 5 seeds 0.11M parameters

† Measured on the pre-fix augmentation pipeline; the two best backbones were re-run after the fix and did not change. The best classical baseline, kNN on PCA features, reaches 85.8%.

Show as table
Test accuracy on the official 10,000-image test set
ModelGroupTest accuracy95% CI (±)SeedsParamsNote
ViT-Tiny/16ImageNet-pretrained95.28%0.2235.43M
ConvNeXt-TinyImageNet-pretrained95.03%0.20327.82M
TinyVGG, no crop, 5-seed ensembleSeed ensemble94.21%–50.71Mone ensemble of 5 members
ResNet-18 (custom)Trained from scratch94.12%0.23511.17M
EfficientNet-B0ImageNet-pretrained93.97%0.5234.02Mpre-fix pipeline
TinyVGG, no cropTrained from scratch93.62%0.4550.14M
ResNet-18 (timm)ImageNet-pretrained93.41%0.48311.18Mpre-fix pipeline
TinyVGGTrained from scratch92.73%0.4450.14M
MiniCNN, no cropTrained from scratch92.36%0.6950.11M
MiniCNNTrained from scratch90.90%0.5250.11M

Random cropping: it depends on model size

The same augmentation that the two small CNNs are better off without is worth half a point to ResNet. Fashion-MNIST items are already centred and size-normalised, so shifted crops mostly add noise for a model with about 0.1M parameters, while a larger one can use them as regularisation.

Accuracy change from removing random crop

Paired by seed against the same model with crop, ordered by parameter count.

−10+1+2Change from removing crop, points (95% CI)crop hurts →← crop helpsMiniCNN0.11M params+1.46+1.46 points MiniCNN 95% CI [+0.95, +1.97] paired t-test p = 0.001 removing crop better on 5 of 5 seedsTinyVGG0.14M params+1.00+1.00 points TinyVGG 95% CI [−0.04, +2.04] paired t-test p = 0.055 removing crop better on 4 of 5 seedsViT-Tiny/16 (pretrained)5.43M params−0.34−0.34 points ViT-Tiny/16 (pretrained) 95% CI [−0.58, −0.10] paired t-test p = 0.027 removing crop better on 0 of 3 seedsResNet-18 (custom)11.17M params−0.50−0.50 points ResNet-18 (custom) 95% CI [−0.92, −0.08] paired t-test p = 0.029 removing crop better on 0 of 5 seedsConvNeXt-Tiny (pretrained)27.82M params−0.06−0.06 points ConvNeXt-Tiny (pretrained) 95% CI [−0.43, +0.30] paired t-test p = 0.532 removing crop better on 1 of 3 seeds−10+1+2Change from removing crop, points (95% CI)crop hurts →← crop helpsMiniCNN0.11M params+1.46+1.46 points MiniCNN 95% CI [+0.95, +1.97] paired t-test p = 0.001 removing crop better on 5 of 5 seedsTinyVGG0.14M params+1.00+1.00 points TinyVGG 95% CI [−0.04, +2.04] paired t-test p = 0.055 removing crop better on 4 of 5 seedsViT-Tiny/16 (pretrained)5.43M params−0.34−0.34 points ViT-Tiny/16 (pretrained) 95% CI [−0.58, −0.10] paired t-test p = 0.027 removing crop better on 0 of 3 seedsResNet-18 (custom)11.17M params−0.50−0.50 points ResNet-18 (custom) 95% CI [−0.92, −0.08] paired t-test p = 0.029 removing crop better on 0 of 5 seedsConvNeXt-Tiny (pretrained)27.82M params−0.06−0.06 points ConvNeXt-Tiny (pretrained) 95% CI [−0.43, +0.30] paired t-test p = 0.532 removing crop better on 1 of 3 seeds
Show as table
Paired by seed against the same model trained with random crop
ModelParamsΔ from removing crop (points)95% CIp (paired t)Seeds better
MiniCNN0.11M+1.46[+0.95, +1.97]0.0015 / 5
TinyVGG0.14M+1.00[−0.04, +2.04]0.0554 / 5
ViT-Tiny/16 (pretrained)5.43M−0.34[−0.58, −0.10]0.0270 / 3
ResNet-18 (custom)11.17M−0.50[−0.92, −0.08]0.0290 / 5
ConvNeXt-Tiny (pretrained)27.82M−0.06[−0.43, +0.30]0.5321 / 3

Pretraining

From scratch versus ImageNet-pretrained

Each row is one backbone; the label is the gain in points.

80%84%88%92%96%Test accuracy (mean of 3 seeds)ViT-Tiny/16+15.6+15.6 points from pretraining ViT-Tiny/16 pretrained 95.25% (±0.61) from scratch 79.65% (±11.44)EfficientNet-B0+3.8+3.8 points from pretraining EfficientNet-B0 pretrained 93.97% (±0.52) from scratch 90.20% (±2.09)ConvNeXt-Tiny+3.2+3.2 points from pretraining ConvNeXt-Tiny pretrained 95.06% (±0.31) from scratch 91.89% (±0.35)ResNet-18 (timm)+1.3+1.3 points from pretraining ResNet-18 (timm) pretrained 93.41% (±0.48) from scratch 92.08% (±0.65)80%84%88%92%96%Test accuracy (mean of 3 seeds)ViT-Tiny/16+15.6+15.6 points from pretraining ViT-Tiny/16 pretrained 95.25% (±0.61) from scratch 79.65% (±11.44)EfficientNet-B0+3.8+3.8 points from pretraining EfficientNet-B0 pretrained 93.97% (±0.52) from scratch 90.20% (±2.09)ConvNeXt-Tiny+3.2+3.2 points from pretraining ConvNeXt-Tiny pretrained 95.06% (±0.31) from scratch 91.89% (±0.35)ResNet-18 (timm)+1.3+1.3 points from pretraining ResNet-18 (timm) pretrained 93.41% (±0.48) from scratch 92.08% (±0.65)
Show as table
Mean of 3 seeds, pre-fix augmentation pipeline (each pair shares it)
BackboneFrom scratchPretrainedΔ (points)Params
ViT-Tiny/1679.65%95.25%+15.65.4M
EfficientNet-B090.20%93.97%+3.84.0M
ConvNeXt-Tiny91.89%95.06%+3.227.8M
ResNet-18 (timm)92.08%93.41%+1.311.2M

Ensembles and calibration

Training with Mixup or CutMix leaves single models slightly underconfident. Averaging several of them compounds this, so the ensemble is worse calibrated than its members. Without Mixup/CutMix, single models are overconfident and averaging corrects them.

Calibration error of single models and their five-seed ensemble

Hollow dot: average single model. Filled dot: ensemble. Lower is better.

00.0050.010.0150.020.0250.030.035Expected calibration error (lower is better)TinyVGG, pre-fix pipelineECE 0.0100 → 0.0279 (worse) TinyVGG, pre-fix pipeline trained with Mixup/CutMix accuracy 92.27% → 93.49%TinyVGG, full recipeECE 0.0077 → 0.0208 (worse) TinyVGG, full recipe trained with Mixup/CutMix accuracy 92.62% → 93.52%TinyVGG, no horizontal flipECE 0.0068 → 0.0205 (worse) TinyVGG, no horizontal flip trained with Mixup/CutMix accuracy 92.33% → 93.26%TinyVGG, no rotationECE 0.0077 → 0.0204 (worse) TinyVGG, no rotation trained with Mixup/CutMix accuracy 93.24% → 94.09%TinyVGG, no random cropECE 0.0074 → 0.0165 (worse) TinyVGG, no random crop trained with Mixup/CutMix accuracy 93.62% → 94.21%TinyVGG, no augmentationECE 0.0331 → 0.0091 (better) TinyVGG, no augmentation trained without Mixup/CutMix accuracy 91.69% → 93.47%TinyVGG, no Mixup/CutMixECE 0.0166 → 0.0038 (better) TinyVGG, no Mixup/CutMix trained without Mixup/CutMix accuracy 92.57% → 93.40%00.010.020.03Expected calibration error (lower is better)TinyVGG, pre-fix pipelineECE 0.0100 → 0.0279 (worse) TinyVGG, pre-fix pipeline trained with Mixup/CutMix accuracy 92.27% → 93.49%TinyVGG, full recipeECE 0.0077 → 0.0208 (worse) TinyVGG, full recipe trained with Mixup/CutMix accuracy 92.62% → 93.52%TinyVGG, no horizontal flipECE 0.0068 → 0.0205 (worse) TinyVGG, no horizontal flip trained with Mixup/CutMix accuracy 92.33% → 93.26%TinyVGG, no rotationECE 0.0077 → 0.0204 (worse) TinyVGG, no rotation trained with Mixup/CutMix accuracy 93.24% → 94.09%TinyVGG, no random cropECE 0.0074 → 0.0165 (worse) TinyVGG, no random crop trained with Mixup/CutMix accuracy 93.62% → 94.21%TinyVGG, no augmentationECE 0.0331 → 0.0091 (better) TinyVGG, no augmentation trained without Mixup/CutMix accuracy 91.69% → 93.47%TinyVGG, no Mixup/CutMixECE 0.0166 → 0.0038 (better) TinyVGG, no Mixup/CutMix trained without Mixup/CutMix accuracy 92.57% → 93.40%

With Mixup/CutMix, ECE rises from 0.007–0.010 to 0.016–0.028; without it, ECE falls to 0.004–0.009.

Show as table
Five-seed ensembles, fixed augmentation pipeline
GroupMixup/CutMixMember ECEEnsemble ECEMember acc.Ensemble acc.
TinyVGG, pre-fix pipelineyes0.01000.027992.27%93.49%
TinyVGG, full recipeyes0.00770.020892.62%93.52%
TinyVGG, no horizontal flipyes0.00680.020592.33%93.26%
TinyVGG, no rotationyes0.00770.020493.24%94.09%
TinyVGG, no random cropyes0.00740.016593.62%94.21%
TinyVGG, no augmentationno0.03310.009191.69%93.47%
TinyVGG, no Mixup/CutMixno0.01660.003892.57%93.40%

Methods and corrections

The official training images are split 48,000 / 12,000 into train and validation with a seeded split. The official 10,000 test images are used once per run, on the best-validation checkpoint. Comparisons use paired t-tests across shared seeds. Every run records its git commit, full configuration and per-epoch curves.

Two bugs were found and fixed during the study. The original accuracy metric averaged per-batch accuracies, over-weighting the last partial batch. The augmentation pipeline applied one random crop, flip and rotation to a whole batch and padded with grey instead of black. The fix was measured against an exact reproduction of the old pipeline: it gains ResNet 1.6 points and changes one conclusion, the ResNet versus TinyVGG ranking. Details are in the write-up.

Reproduce

git clone https://github.com/SatvikPraveen/FashionMNIST-Analysis.git
cd FashionMNIST-Analysis
pip install -r requirements.txt
python src/cli/prepare_data.py --output-dir data/processed

python src/cli/sweep.py expand sweeps/baseline_fixed.yaml        # 15 runs
python src/cli/sweep.py run    sweeps/baseline_fixed.yaml --all  # or as a SLURM job array
python src/cli/aggregate.py    runs/baseline_fixed --out results/sweeps/baseline_fixed