Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
PoolFormer: MetaFormer Is Actually What You Need for Vision (CVPR 2022 Oral)
| Date | Stars |
|---|---|
| 2026-07-24 | 1363 |
| 2026-07-25 | 1363 |
| 2026-07-28 | 1363 |
| 2026-07-30 | 1363 |
| 2026-08-06 | 1363 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# PoolFormer: [MetaFormer Is Actually What You Need for Vision](https://arxiv.org/abs/2111.11418) (CVPR 2022 Oral)
<p align="center">
<a href="https://arxiv.org/abs/2111.11418" alt="arXiv">
<img src="https://img.shields.io/badge/arXiv-2111.11418-b31b1b.svg?style=flat" /></a>
<a href="https://huggingface.co/spaces/akhaliq/poolformer" alt="Hugging Face Spaces">
<img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue" /></a>
<a href="https://colab.research.google.com/drive/1n1UK4ihfiySTWTDuusAhm_6CLm1h4bTj?usp=sharing" alt="Colab">
<img src="https://colab.research.google.com/assets/colab-badge.svg" /></a>
</p>
---
:fire: :fire: Our follow-up work "[MetaFormer Baselines for Vision](https://arxiv.org/abs/2210.13452)" (code: [metaformer](https://github.com/sail-sg/metaformer)) introduces more MetaFormer baselines including
+ **IdentityFormer** with token mixer of identity mapping surprisingly achieve >80% accuracy.
+ **RandFormer** achieves >81% accuracy by random token mixing, demonstrating MetaForemr works well with arbitrary token mixers.
+ **ConvFormer** with token mixer of separable convolution significantly outperforms ConvNeXt by large margin.
+ **CAFormer** with token mixers of separable convolutions and vanilla self-attention sets new record on ImageNet-1K.
---
This is a PyTorch implementation of **PoolFormer** proposed by our paper "[MetaFormer Is Actually What You Need for Vision](https://arxiv.org/abs/2111.11418)" (CVPR 2022 Oral).
**Note**: Instead of designing complicated token mixer to achieve SOTA performance, the target of this work is to demonstrate the competence of Transformer models largely stem from the general architecture MetaFormer. Pooling/PoolFormer are just the tools to support our claim.

Figure 1: **MetaFormer and performance of MetaFormer-based models on ImageNet-1K validation set.**
We argue that the competence of Transformer/MLP-like models primarily stem from the general architecture MetaFormer instead of the equipped specific token mixers.
To demonstrate this, we exploit an embarrassingly simple non-parametric operator, pooling, to conduct extremely basic token mixing.
Surprisingly, the resulted model PoolFormer consistently outperforms the DeiT and ResMLP as shown in (b), which well supports that MetaFormer is actually what we need to achieve competitive performance. RSB-ResNet in (b) means the results are from “ResNet Strikes Back” where ResNet is trained with improved training procedure for 300 epochs.
<p align="center">
<img src="https://user-images.githubusercontent.com/49296856/205430159-54bba545-520e-4ab8-8a77-278d90b54ec4.png" alt="PoolFormer"/>
</p>
Figure 2: (a) **The overall framework of PoolFormer.** (b) **The architecture of PoolFormer block.** Compared with Transformer block, it replaces attention with an extremely simple non-parametric operator, pooling, to conduct only basic token mixing.
## Bibtex
```
@inproceedings{yu2022metaformer,
title={Metaformer is actually what you need for vision},
author={Yu, Weihao and Luo, Mi and Zhou, Pan and Si, Chenyang and Zhou, Yichen and Wang, Xinchao and Feng, Jiashi and Yan, Shuicheng},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={10819--10829},
year={2022}
}
```
**Detection and instance segmentation on COCO** configs and trained models are [here](detection/).
**Semantic segmentation on ADE20K** configs and trained models are [here](segmentation/).
The code to visualize Grad-CAM activation maps of PoolFomer, DeiT, ResMLP, ResNet and Swin are [here](misc/cam_image.py).
The code to measure MACs are [here](misc/mac_count_with_fvcore.py).
## Image Classification
### 1. Requirements
torch>=1.7.0; torchvision>=0.8.0; pyyaml; [apex-amp](https://github.com/NVIDIA/apex) (if you want to use fp16); [timm](https://githExcerpt of 8,129 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:89034032c97ac4c1, topic:image-classification, readme:computer vision, readme:semantic segmentation
matched fp:89034032c97ac4c1, topic:pytorch
matched fp:89034032c97ac4c1, topic:transformer