EfficientNets图像分类网络


主要内容来自:https://github.com/lukemelas/EfficientNet-PyTorch

EfficientNets是图像分类模型的一个系列,这些模型可实现最先进的准确性,但比以前的模型小且快一个数量级。 我们基于AutoML和Compound Scaling开发EfficientNets。 特别是,我们首先使用AutoML Mobile框架来开发一个称为EfficientNet-B0的移动大小的基准网络。 然后,我们使用复合缩放方法来放大此基线以获得EfficientNet-B1至B7。

以往提出的模型放缩的几个维度:网络深度、网络宽度、图像分辨率,以往的网络结构多是放大其中的一个维度以达到更高的准确率,比如 ResNet-18 到 ResNet-152 是通过增加网络深度的方法来提高准确率。作者认为这三个维度之间是互相影响的并探索出了三者之间最好的组合(调参是个技术活),在此基础上提出了最新的网络 EfficientNet,该网络的表现如下:(具有强大的屠榜能力)

图1 EfficientNets在ImageNet上实现了最先进的精度,而且效率提高了一个数量级。

在高精度状态下,我们的EfficientNet-B7在具有66M参数和37B FLOPS的ImageNet上达到了最先进的top-1:84.4% ,top-5:97.1%精度,在CPU推断上小8.4倍,快6.1倍 比以前最好的Gpipe

在中等精度状态下,与ResNet-152相比,我们的EfficientNet-B1比ResNet-152小7.6倍,在CPU推理上快5.7倍,并且ImageNet精度相似。

与广泛使用的ResNet-50相比,在类似的FLOPS约束下,我们的EfficientNet-B4将top-1的准确性从ResNet-50的76.3%提高到82.6%(+ 6.3%)。

EfficientNet PyTorch是EfficientNet的PyTorch重新实现。 它与原始的TensorFlow实现一致,因此很容易从TensorFlow检查点加载权重。 同时,我们旨在使我们的PyTorch实现尽可能简单,灵活和可扩展。

pytorch版本使用方式:

1
pip install efficientnet_pytorch

或者源码安装:

1
2
3
git clone https://github.com/lukemelas/EfficientNet-PyTorch
cd EfficientNet-Pytorch
pip install -e
1
2
3
4
git clone https://github.com/lukemelas/EfficientNet-PyTorch
cd EfficientNet-Pytorch
pip install -e
pip install efficientnet_pytorch

两种使用方法:

1
2
3
4
5
6
7
#Load an EfficientNet:
from efficientnet_pytorch import EfficientNet
model = EfficientNet.from_name('efficientnet-b0')

#Load a pretrained EfficientNet:
from efficientnet_pytorch import EfficientNet
model = EfficientNet.from_pretrained('efficientnet-b0')

有关的预训练模型:https://github.com/lukemelas/EfficientNet-PyTorch/releases

adv-efficientnet-b0-b64d5a18.pth 20.4 MB

adv-efficientnet-b1-0f3ce85a.pth 30.1 MB

adv-efficientnet-b2-6e9d97e5.pth 35.1 MB

adv-efficientnet-b3-cdd7c0f4.pth 47.1 MB

adv-efficientnet-b4-44fb3a87.pth 74.4 MB

adv-efficientnet-b5-86493f6b.pth 117 MB

adv-efficientnet-b6-ac80338e.pth 165 MB

adv-efficientnet-b7-4652b6dd.pth 255 MB

adv-efficientnet-b8-22a8fe65.pth 335 MB

efficientnet-b0-355c32eb.pth 20.4 MB

efficientnet-b1-f1951068.pth 30.1 MB

efficientnet-b2-8bb594d6.pth 35.1 MB

efficientnet-b3-5fb5a3c3.pth 47.1 MB

efficientnet-b4-6ed6700e.pth 74.4 MB

efficientnet-b5-b6417697.pth 117 MB

efficientnet-b6-c76e70fd.pth 165 MB

efficientnet-b7-dcc49843.pth 254 MB

Source code (zip)

Source code (tar.gz)