All families

PiT

8 models, image classification. Fewest parameters first.

PiT, the Pooling-based Vision Transformer, borrows one habit from convolutional networks that the original ViT ignored: shrinking the spatial size while widening the channels as depth grows. The authors first checked the premise on ResNet-50 and found that the ResNet-style schedule beats a flat ViT-style one in model capability, generalization and final performance. They then built the same idea into ViT and showed that a transformer gains from it too.

Read more

The pooling layer reshapes the spatial tokens into a 3D tensor, reduces the spatial size and raises the channel count with a depth-wise convolution, and flattens them again for the next transformer block. The class token, which has no spatial position, is passed through an extra fully connected layer so its width keeps pace with the spatial tokens. Two such pooling layers give every PiT three spatial scales. To start with more tokens than ViT, the patch embedding keeps a 16 pixel patch but strides by 8.

An attention analysis shows what pooling does inside: PiT spreads attention wider in shallow layers and concentrates it in deep ones. At each size the PiT has fewer FLOPs and faster throughput than the ViT of the same name, and still scores higher on ImageNet. The paper defines four scales: tiny, extra small, small and base. The distilled members follow the DeiT recipe, adding a distillation token and learning from a RegNetY-16GF teacher. Pooling also buys robustness: on an occlusion test that blanks out the centre of each image, PiT drops about 5% where ResNet-50 drops about 15%.

AI-written summary; not reviewed by a person. Corrections welcome.

Paper: Rethinking Spatial Dimensions of Vision Transformers

Filter and sort these in the model list