CoolFace
Modelpublic

KieDani/SegformerPlusPlus

sourceHugging Facegpl-3.0updated 1y agoView on Hugging Face
1likes
Model Card

SegFormer++

Paper: Segformer++: Efficient Token-Merging Strategies for High-Resolution Semantic Segmentation

[image]

[image]

Abstract

Utilizing transformer architectures for semantic segmentation of high-resolution images is hindered by the attention's quadratic computational complexity in the number of tokens. A solution to this challenge involves decreasing the number of tokens through token merging, which has exhibited remarkable enhancements in inference speed, training efficiency, and memory utilization for image classification tasks. In this paper, we explore various token merging strategies within the framework of the SegFormer architecture and perform experiments on multiple semantic segmentation and human pose estimation datasets. Notably, without model re-training, we, for example, achieve an inference acceleration of 61% on the Cityscapes dataset while maintaining the mIoU performance. Consequently, this paper facilitates the deployment of transformer-based architectures on resource-constrained devices and in real-time applications.

Update: It is now possible to load the model via torch.hub. See here.

Update: It is now possible to run the model without OpenMMLab dependencies, enabling users to utilize the SegFormerPlusPlus architecture without installing the full OpenMMLab framework.

Results and Models

Memory refers to the VRAM requirements during the training process.

Inference on Cityscapes (MiT-B5)

The weights of the Segformer (Original) model were used to get the inference results.

MethodmIoUSpeed-Updownload
Segformer (Original)82.39-model
Segformer++<sub>HQ</sub> (ours)82.311.61model
Segformer++<sub>fast</sub> (ours)82.041.94model
Segformer++<sub>2x2</sub> (ours)81.961.90model
Segformer (Downsampling)77.316.51model

Training on Cityscapes (MiT-B5)

MethodmIoUSpeed-UpMemory (GB)download
Segformer (Original)82.39-48.3model
Segformer++<sub>HQ</sub> (ours)82.191.4034.0model
Segformer++<sub>fast</sub> (ours)81.771.5530.5model
Segformer++<sub>2x2</sub> (ours)82.381.6331.1model
Segformer (Downsampling)79.242.9510.0model

Training on ADE20K (640x640) (MiT-B5)

MethodmIoUSpeed-UpMemory (GB)download
Segformer (Original)49.72-33.7model
Segformer++<sub>HQ</sub> (ours)49.771.1529.2model
Segformer++<sub>fast</sub> (ours)49.101.2028.0model
Segformer++<sub>2x2</sub> (ours)49.351.2627.2model
Segformer (Downsampling)46.711.8912.4model

Training on JBD

MethodPCK@0.1PCK@0.05Speed-UpMemory (GB)download
Segformer (Original)95.2090.65-40.0model
Segformer++<sub>HQ</sub> (ours)95.1890.511.1936.0model
Segformer++<sub>fast</sub> (ours)94.5889.871.2534.6model
Segformer++<sub>2x2</sub> (ours)95.1790.161.2733.4model

Training on MS COCO

MethodPCK@0.1PCK@0.05Speed-UpMemory (GB)download
Segformer (Original)95.1687.61-13.5model
Segformer++<sub>HQ</sub> (ours)94.9787.350.9713.1model
Segformer++<sub>fast</sub> (ours)95.0287.370.9912.9model
Segformer++<sub>2x2</sub> (ours)94.9887.361.2412.3model

Usage

Easy usage:

  • —Use the SegFormer++ easily via TorchHub
  • —Use the SegFormer++ directly

Explanation of the different token merging strategies:

  • —Token Merging Settings

Legacy Variants (e.g. as part of mmseg or mmpose) can be found on GitHub: https://github.com/KieDani/SegformerPlusPlus

Citation

bibtex
@article{kienzle2024segformer++,
  title={Segformer++: Efficient Token-Merging Strategies for High-Resolution Semantic Segmentation},
  author={Kienzle, Daniel and Kantonis, Marco and Sch{\"o}n, Robin and Lienhart, Rainer},
  journal={IEEE International Conference on Multimedia Information Processing and Retrieval (MIPR)},
  year={2024}
}