# EfficientNet¶

## 简介¶

EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster than previous models.

EfficientNets are based on AutoML and Compound Scaling. In particular, we first use AutoML MNAS Mobile framework to develop a mobile-size baseline network, named as EfficientNet-B0; Then, we use the compound scaling method to scale up this baseline to obtain EfficientNet-B1 to B7.

## 摘要¶

Click to show the detailed Abstract
Convolutional Neural Networks (ConvNets) are commonly developed at a fixed resource budget, and then scaled up for better accuracy if more resources are available. In this paper, we systematically study model scaling and identify that carefully balancing network depth, width, and resolution can lead to better performance. Based on this observation, we propose a new scaling method that uniformly scales all dimensions of depth/width/resolution using a simple yet highly effective compound coefficient. We demonstrate the effectiveness of this method on scaling up MobileNets and ResNet. To go even further, we use neural architecture search to design a new baseline network and scale it up to obtain a family of models, called EfficientNets, which achieve much better accuracy and efficiency than previous ConvNets. In particular, our EfficientNet-B7 achieves state-of-the-art 84.3% top-1 accuracy on ImageNet, while being 8.4x smaller and 6.1x faster on inference than the best existing ConvNet. Our EfficientNets also transfer well and achieve state-of-the-art accuracy on CIFAR-100 (91.7%), Flowers (98.8%), and 3 other transfer learning datasets, with an order of magnitude fewer parameters.

## 结果和模型¶

### ImageNet-1k¶

In the result table, AA means trained with AutoAugment pre-processing, more details can be found in the paper; AdvProp is a method to train with adversarial examples, more details can be found in the paper; RA means trained with RandAugment pre-processing, more details can be found in the paper; NoisyStudent means trained with extra JFT-300M unlabeled data, more details can be found in the paper; L2-475 means the same L2 architecture with input image size 475.

Note: In MMClassification, we support training with AutoAugment, don’t support AdvProp by now.

Flops(G)

Top-1 (%)

Top-5 (%)

EfficientNet-B0*

5.29

0.42

76.74

93.17

config

model

EfficientNet-B0 (AA)*

5.29

0.42

77.26

93.41

config

model

5.29

0.42

77.53

93.61

config

model

EfficientNet-B0 (RA + NoisyStudent)*

5.29

0.42

77.63

94.00

config

model

EfficientNet-B1*

7.79

0.74

78.68

94.28

config

model

EfficientNet-B1 (AA)*

7.79

0.74

79.20

94.42

config

model

7.79

0.74

79.52

94.43

config

model

EfficientNet-B1 (RA + NoisyStudent)*

7.79

0.74

81.44

95.83

config

model

EfficientNet-B2*

9.11

1.07

79.64

94.80

config

model

EfficientNet-B2 (AA)*

9.11

1.07

80.21

94.96

config

model

9.11

1.07

80.45

95.07

config

model

EfficientNet-B2 (RA + NoisyStudent)*

9.11

1.07

82.47

96.23

config

model

EfficientNet-B3*

12.23

1.07

81.01

95.34

config

model

EfficientNet-B3 (AA)*

12.23

1.07

81.58

95.67

config

model

12.23

1.07

81.81

95.69

config

model

EfficientNet-B3 (RA + NoisyStudent)*

12.23

1.07

84.02

96.89

config

model

EfficientNet-B4*

19.34

1.95

82.57

96.09

config

model

EfficientNet-B4 (AA)*

19.34

1.95

82.95

96.26

config

model

19.34

1.95

83.25

96.44

config

model

EfficientNet-B4 (RA + NoisyStudent)*

19.34

1.95

85.25

97.52

config

model

EfficientNet-B5*

30.39

10.1

83.18

96.47

config

model

EfficientNet-B5 (AA)*

30.39

10.1

83.82

96.76

config

model

30.39

10.1

84.21

96.98

config

model

EfficientNet-B5 (RA + NoisyStudent)*

30.39

10.1

86.08

97.75

config

model

EfficientNet-B6 (AA)*

43.04

20.0

84.05

96.82

config

model

43.04

20.0

84.74

97.14

config

model

EfficientNet-B6 (RA + NoisyStudent)*

43.04

20.0

86.47

97.87

config

model

EfficientNet-B7 (AA)*

66.35

39.3

84.38

96.88

config

model

66.35

39.3

85.14

97.23

config

model

EfficientNet-B7 (RA + NoisyStudent)*

66.35

65.0

86.83

98.08

config

model

87.41

65.0

85.38

97.28

config

model

EfficientNet-L2-475 (RA + NoisyStudent)*

480.30

174.20

88.18

98.55

config

model

EfficientNet-L2 (RA + NoisyStudent)*

480.30

484.98

88.33

98.65

config

model

Models with * are converted from the official repo. The config files of these models are only for inference. We don’t ensure these config files’ training accuracy and welcome you to contribute your reproduction results.

## 使用方式¶

>>> import torch
>>> from mmcls.apis import init_model, inference_model
>>>
>>> predict = inference_model(model, 'demo/demo.JPEG')
>>> print(predict['pred_class'])
sea snake
>>> print(predict['pred_score'])
0.6968820691108704


For more configurable parameters, please refer to the API.

## 引用¶

@inproceedings{tan2019efficientnet,
title={Efficientnet: Rethinking model scaling for convolutional neural networks},
author={Tan, Mingxing and Le, Quoc},
booktitle={International Conference on Machine Learning},
pages={6105--6114},
year={2019},
organization={PMLR}
}