Skip to content
module

EfficientNet

27 members
lucid.models.vision.efficientnet

EfficientNet family — Tan & Le, 2019.

Image Classification
Paper

Tan, Mingxing, and Quoc V. Le. "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks." Proceedings of the 36th International Conference on Machine Learning, PMLR 97, 2019, pp. 6105–6114.

Overview

EfficientNet is built on the empirical observation that the three axes used to scale a ConvNet — depth dd (number of layers), width ww (number of channels per layer), and input resolution rr — are not independent. Scaling any one of them in isolation gives rapidly diminishing returns, but scaling all three together along a carefully chosen ratio gives a much better accuracy/FLOPs frontier.

The paper formalises this as compound scaling: a single user-facing scalar ϕ\phi controls all three axes through

d=αϕ,w=βϕ,r=γϕ,d = \alpha^\phi, \quad w = \beta^\phi, \quad r = \gamma^\phi,

subject to the FLOPs-balance constraint α⋅β2⋅γ2≈2\alpha \cdot \beta^2 \cdot \gamma^2 \approx 2. The constants α,β,γ\alpha, \beta, \gamma are found once by a small grid search on the baseline network (giving roughly α=1.2,β=1.1,γ=1.15\alpha = 1.2, \beta = 1.1, \gamma = 1.15); from then on, a single ϕ\phi indexes the whole family. Successive integer values produce the standard B0 → B7 variants, each requiring approximately 2ϕ2^\phi more FLOPs than B0.

The baseline B0 itself is not manually designed. It is the output of a multi-objective neural-architecture search that optimises accuracy and FLOPs jointly. Each block is an inverted-residual MBConv (MobileNet-v2 style) augmented with a squeeze-and-excitation module, and the network uses the swish activation throughout. Stochastic depth with linearly increasing drop rate (the drop_connect_rate field) acts as a strong regulariser as depth grows, which is what allows B6/B7 to keep gaining accuracy where naively-deepened baselines would overfit or fail to train.

Classes

Functions

fnefficientnet_b0→ EfficientNet

EfficientNet-B0 feature-extracting backbone (compound coefficient ϕ=0\phi = 0).

fnefficientnet_b0_cls→ EfficientNetForImageClassification

EfficientNet-B0 image classifier (backbone + GAP + linear head).

fnefficientnet_b1→ EfficientNet

EfficientNet-B1 feature-extracting backbone (compound coefficient ϕ=0.5\phi = 0.5).

fnefficientnet_b1_cls→ EfficientNetForImageClassification

EfficientNet-B1 image classifier (backbone + GAP + linear head).

fnefficientnet_b2→ EfficientNet

EfficientNet-B2 feature-extracting backbone (compound coefficient ϕ=1\phi = 1).

fnefficientnet_b2_cls→ EfficientNetForImageClassification

EfficientNet-B2 image classifier (backbone + GAP + linear head).

fnefficientnet_b3→ EfficientNet

EfficientNet-B3 feature-extracting backbone (compound coefficient ϕ=2\phi = 2).

fnefficientnet_b3_cls→ EfficientNetForImageClassification

EfficientNet-B3 image classifier (backbone + GAP + linear head).

fnefficientnet_b4→ EfficientNet

EfficientNet-B4 feature-extracting backbone (compound coefficient ϕ=3\phi = 3).

fnefficientnet_b4_cls→ EfficientNetForImageClassification

EfficientNet-B4 image classifier (backbone + GAP + linear head).

fnefficientnet_b5→ EfficientNet

EfficientNet-B5 feature-extracting backbone (compound coefficient ϕ=4\phi = 4).

fnefficientnet_b5_cls→ EfficientNetForImageClassification

EfficientNet-B5 image classifier (backbone + GAP + linear head).

fnefficientnet_b6→ EfficientNet

EfficientNet-B6 feature-extracting backbone (compound coefficient ϕ=5\phi = 5).

fnefficientnet_b6_cls→ EfficientNetForImageClassification

EfficientNet-B6 image classifier (backbone + GAP + linear head).

fnefficientnet_b7→ EfficientNet

EfficientNet-B7 feature-extracting backbone (compound coefficient ϕ=6\phi = 6).

fnefficientnet_b7_cls→ EfficientNetForImageClassification

EfficientNet-B7 image classifier (backbone + GAP + linear head).

Weights