Awesome backbones for image classification

January 17, 2025 · View on GitHub

BILIBILI

GitHub forks GitHub stars

写在前面

  • 若训练效果不佳,首先需要调整学习率和Batch size,这俩超参很大程度上影响收敛。其次,从关闭图像增强手段(尤其小数据集)开始,有的图像增强方法会污染数据,如

  如何去除增强?如efficientnetv2-b0配置文件中train_pipeline可更改为如下

train_pipeline = [
    dict(type='LoadImageFromFile'),
    dict(
        type='RandomResizedCrop',
        size=192,
        efficientnet_style=True,
        interpolation='bicubic'),
    dict(type='Normalize', **img_norm_cfg),
    dict(type='ImageToTensor', keys=['img']),
    dict(type='ToTensor', keys=['gt_label']),
    dict(type='Collect', keys=['img', 'gt_label'])
]

  若你的数据集提前已经将shape更改为网络要求的尺寸,那么Resize操作也可以去除。

更新日志

2025.01.17

  • 支持转ONNX#136 @PurpleSky-NS
  • 类别激活图相关脚本#114 @jackyjinjing

2024.09.06

  • 修复高频反馈的评估时结果浮动大的问题

2023.12.02

  • 新增Issue中多人提及的输出Train AccVal loss

    • metrics_outputs.csv保存每周期train_loss, train_acc, train_precision, train_recall, train_f1-score, val_loss, val_acc, val_precision, val_recall, val_f1-score方便各位绘图
    • 终端由原先仅输出Val相关metrics升级为Train与Val都输出

2023.08.05

  • 新增TinyViT(预训练权重不匹配)、DeiT3EdgeNeXtRevVisionTransformer

2023.03.07

  • 新增MobileViTDaViTRepLKNetBEiTEVAMixMIMEfficientNetV2

测试环境

  • Pytorch 1.7.1+
  • Python 3.6+

资料

数据集视频教程人工智能技术探讨群
花卉数据集 提取码:0zat点我跳转1群:78174903
3群:584723646

快速开始

python tools/single_test.py datas/cat-dog.png models/mobilenet/mobilenet_v3_small.py --classes-map datas/imageNet1kAnnotation.txt

教程

模型

预训练权重

名称权重名称权重名称权重
LeNet5NoneAlexNetNoneVGGVGG-11
VGG-13
VGG-16
VGG-19
VGG-11-BN
VGG-13-BN
VGG-16-BN
VGG-19-BN
ResNetResNet-18
ResNet-34
ResNet-50
ResNet-101
ResNet-152
ResNetV1CResNetV1C-50
ResNetV1C-101
ResNetV1C-152
ResNetV1DResNetV1D-50
ResNetV1D-101
ResNetV1D-152
ResNeXtResNeXt-50
ResNeXt-101
ResNeXt-152
SEResNetSEResNet-50
SEResNet-101
SEResNeXtNone
RegNetRegNetX-400MF
RegNetX-800MF
RegNetX-1.6GF
RegNetX-3.2GF
RegNetX-4.0GF
RegNetX-6.4GF
RegNetX-8.0GF
RegNetX-12GF
MobileNetV2MobileNetV2MobileNetV3MobileNetV3-Small
MobileNetV3-Large
ShuffleNetV1ShuffleNetV1ShuffleNetV2ShuffleNetV2EfficientNetEfficientNet-B0
EfficientNet-B1
EfficientNet-B2
EfficientNet-B3
EfficientNet-B4
EfficientNet-B5
EfficientNet-B6
EfficientNet-B7
EfficientNet-B8
RepVGGRepVGG-A0
RepVGG-A1
RepVGG-A2
RepVGG-B0
RepVGG-B1
RepVGG-A1
RepVGG-B1g2
RepVGG-B1g4
RepVGG-B2
RepVGG-B2g4
RepVGG-B2g4
RepVGG-B3
RepVGG-B3g4
RepVGG-D2se
Res2NetRes2Net-50-14w-8s
Res2Net-50-26w-8s
Res2Net-101-26w-4s
ConvNeXtConvNeXt-Tiny
ConvNeXt-Small
ConvNeXt-Base
ConvNeXt-Large
ConvNeXt-XLarge
HRNetHRNet-W18
HRNet-W30
HRNet-W32
HRNet-W40
HRNet-W44
HRNet-W48
HRNet-W64
ConvMixerConvMixer-768/32
ConvMixer-1024/20
ConvMixer-1536/20
CSPNetCSPDarkNet50
CSPResNet50
CSPResNeXt50
Swin Transformertiny-224
small-224
base-224
large-224
base-384
large-384
Vision Transformervit_base_p16_224
vit_base_p32_224
vit_large_p16_224
vit_base_p16_384
vit_base_p32_384
vit_large_p16_384
Transformer in TransformerTNT-small
MLP Mixerbase_p16
large_p16
DeitDeiT-tiny
DeiT-tiny distilled
DeiT-small
DeiT-small distilled
DeiT-base
DeiT-base distilled
DeiT-base 384px
DeiT-base distilled 384px
ConformerConformer-tiny-p16
Conformer-small-p32
Conformer-small-p16
Conformer-base-p16
T2T-ViTT2T-ViT_t-14
T2T-ViT_t-19
T2T-ViT_t-24
TwinsPCPVT-small
PCPVT-base
PCPVT-large
SVT-small
SVT-base
SVT-large
PoolFormerPoolFormer-S12
PoolFormer-S24
PoolFormer-S36
PoolFormer-M36
PoolFormer-M48
DenseNetDenseNet121
DenseNet161
DenseNet169
DenseNet201
Visual Attention Network(VAN)VAN-Tiny
VAN-Small
VAN-Base
VAN-Large
Wide-ResNetWRN-50
WRN-101
HorNetHorNet-Tiny
HorNet-Tiny-GF
HorNet-Small
HorNet-Small-GF
HorNet-Base
HorNet-Base-GF
HorNet-Large
HorNet-Large-GF
HorNet-Large-GF384
EfficientFormerefficientformer-l1
efficientformer-l3
efficientformer-l7
Swin Transformer v2tiny-256 window 8
tiny-256 window 16
small-256 window 8
small-256 window 16
base-256 window 8
base-256 window 16
large-256 window 16
large-384 window 24
MViTv2MViTv2-Tiny
MViTv2-Small
MViTv2-Base
MViTv2-Large
MobileVitMobileViT-XXSmall
MobileViT-XSmall
MobileViT-Small
DaViTDaViT-T
DaViT-S
DaViT-B
RepLKNetRepLKNet-31B-224
RepLKNet-31B-384
RepLKNet-31L-384
RepLKNet-XL
BEiTBEiT-baseEVAEVA-G-p14-224
EVA-G-p14-336
EVA-G-p14-560
EVA-G-p16-224
EVA-L-p14-224
EVA-L-p14-196
EVA-L-p14-336
MixMIMmixmim-baseEfficientNetV2EfficientNetV2-b0
EfficientNetV2-b1
EfficientNetV2-b2
EfficientNetV2-b3
EfficientNetV2-s
EfficientNetV2-m
EfficientNetV2-l
EfficientNetV2-xl
DeiT3deit3_small_p16
deit3_small_p16_384
deit3_base_p16
deit3_base_p16_384
deit3_medium_p16
deit3_large_p16
deit3_large_p16_384
deit3_huge_p16
EdgeNeXtedgenext-base
edgenext-small
edgenext-X-small
edgenext-XX-small
RevVisionTransformerrevvit-small
revvit-base

我维护的其他项目

参考

@repo{2020mmclassification,
    title={OpenMMLab's Image Classification Toolbox and Benchmark},
    author={MMClassification Contributors},
    howpublished = {\url{https://github.com/open-mmlab/mmclassification}},
    year={2020}
}