MobileOne¶
The ResNet model is based on the "An Improved One millisecond Mobile Backbone" paper.
Architecture overview¶
This architecture optimizes the model for inference speed at inference time on mobile device.

The key takeaways from the paper are the following:
- reuse the reparametrization concept of RepVGG while adding overparametrization in the block branches.
- each block is composed of two consecutive reparametrizeable blocks (in a similar fashion than RepVGG): a depth-wise convolutional block, a point-wise convolutional block.
Model builders¶
The following model builders can be used to instantiate a MobileOne model, with or
without pre-trained weights. All the model builders internally rely on the
MobileOne base class.
MobileOne
¶
MobileOne(num_blocks: list[int], width_multipliers: list[float], overparam_factor: int = 1, num_classes: int = 10, in_channels: int = 3, act_layer: Module | None = None, norm_layer: Callable[[int], Module] | None = None)
Bases: Sequential
Source code in holocron/models/classification/mobileone.py
reparametrize
¶
Reparametrize the block by fusing convolutions and BN in each branch, then fusing all branches
Source code in holocron/models/classification/mobileone.py
mobileone_s0
¶
mobileone_s0(pretrained: bool = False, checkpoint: Checkpoint | None = None, progress: bool = True, **kwargs: Any) -> MobileOne
MobileOne-S0 from "An Improved One millisecond Mobile Backbone"
| PARAMETER | DESCRIPTION |
|---|---|
pretrained
|
If True, returns a model pre-trained on ImageNet
TYPE:
|
checkpoint
|
If specified, the model's parameters will be set to the checkpoint's values
TYPE:
|
progress
|
If True, displays a progress bar of the download to stderr
TYPE:
|
kwargs
|
keyword args of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MobileOne
|
classification model |
MobileOne_S0_Checkpoint
¶
Bases: Enum
IMAGENETTE
class-attribute
instance-attribute
¶
IMAGENETTE = _checkpoint(arch='mobileone_s0', url='https://github.com/frgfm/Holocron/releases/download/v0.2.1/mobileone_s0_224-9ddd1fe9.pth', acc1=0.8808, acc5=0.9883, sha256='9ddd1fe9d6c0a73d3c4d51d3c967a8a27ff5e545705afc557b4d4ac0f34395cb', size=17708169, num_params=4277991, commit='d4a59999179b42fc0d3058ac6b76cc41f49dd56e', train_args='./imagenette2-320/ --arch mobileone_s0 --batch-size 64 --mixup-alpha 0.2 --amp --device 0 --epochs 100 --lr 1e-3 --label-smoothing 0.1 --random-erase 0.1 --train-crop-size 176 --val-resize-size 232 --opt adamw --weight-decay 5e-2')
Source code in holocron/models/classification/mobileone.py
mobileone_s1
¶
mobileone_s1(pretrained: bool = False, checkpoint: Checkpoint | None = None, progress: bool = True, **kwargs: Any) -> MobileOne
MobileOne-S1 from "An Improved One millisecond Mobile Backbone"
| PARAMETER | DESCRIPTION |
|---|---|
pretrained
|
If True, returns a model pre-trained on ImageNet
TYPE:
|
checkpoint
|
If specified, the model's parameters will be set to the checkpoint's values
TYPE:
|
progress
|
If True, displays a progress bar of the download to stderr
TYPE:
|
kwargs
|
keyword args of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MobileOne
|
classification model |
MobileOne_S1_Checkpoint
¶
Bases: Enum
IMAGENETTE
class-attribute
instance-attribute
¶
IMAGENETTE = _checkpoint(arch='mobileone_s1', url='https://github.com/frgfm/Holocron/releases/download/v0.2.1/mobileone_s1_224-d4ec5433.pth', acc1=0.9126, acc5=0.9918, sha256='d4ec5433cff3d55d562b7a35fc0c95568ff8f4591bf822dd3e699535bdff90eb', size=14594817, num_params=3555188, commit='d4a59999179b42fc0d3058ac6b76cc41f49dd56e', train_args='./imagenette2-320/ --arch mobileone_s1 --batch-size 64 --mixup-alpha 0.2 --amp --device 0 --epochs 100 --lr 1e-3 --label-smoothing 0.1 --random-erase 0.1 --train-crop-size 176 --val-resize-size 232 --opt adamw --weight-decay 5e-2')
Source code in holocron/models/classification/mobileone.py
mobileone_s2
¶
mobileone_s2(pretrained: bool = False, checkpoint: Checkpoint | None = None, progress: bool = True, **kwargs: Any) -> MobileOne
MobileOne-S2 from "An Improved One millisecond Mobile Backbone"
| PARAMETER | DESCRIPTION |
|---|---|
pretrained
|
If True, returns a model pre-trained on ImageNet
TYPE:
|
checkpoint
|
If specified, the model's parameters will be set to the checkpoint's values
TYPE:
|
progress
|
If True, displays a progress bar of the download to stderr
TYPE:
|
kwargs
|
keyword args of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MobileOne
|
classification model |
MobileOne_S2_Checkpoint
¶
Bases: Enum
IMAGENETTE
class-attribute
instance-attribute
¶
IMAGENETTE = _checkpoint(arch='mobileone_s2', url='https://github.com/frgfm/Holocron/releases/download/v0.2.1/mobileone_s2_224-b748859c.pth', acc1=0.9131, acc5=0.9921, sha256='b748859c45a636ea22f0f68a3b7e75e5fb6ffb31178a5a3137931a21b4c41697', size=23866479, num_params=5854324, commit='d4a59999179b42fc0d3058ac6b76cc41f49dd56e', train_args='./imagenette2-320/ --arch mobileone_s2 --batch-size 64 --mixup-alpha 0.2 --amp --device 0 --epochs 100 --lr 1e-3 --label-smoothing 0.1 --random-erase 0.1 --train-crop-size 176 --val-resize-size 232 --opt adamw --weight-decay 5e-2')
Source code in holocron/models/classification/mobileone.py
mobileone_s3
¶
mobileone_s3(pretrained: bool = False, checkpoint: Checkpoint | None = None, progress: bool = True, **kwargs: Any) -> MobileOne
MobileOne-S3 from "An Improved One millisecond Mobile Backbone"
| PARAMETER | DESCRIPTION |
|---|---|
pretrained
|
If True, returns a model pre-trained on ImageNet
TYPE:
|
checkpoint
|
If specified, the model's parameters will be set to the checkpoint's values
TYPE:
|
progress
|
If True, displays a progress bar of the download to stderr
TYPE:
|
kwargs
|
keyword args of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MobileOne
|
classification model |
MobileOne_S3_Checkpoint
¶
Bases: Enum
IMAGENETTE
class-attribute
instance-attribute
¶
IMAGENETTE = _checkpoint(arch='mobileone_s3', url='https://github.com/frgfm/Holocron/releases/download/v0.2.1/mobileone_s3_224-7f357baf.pth', acc1=0.9106, acc5=0.9931, sha256='7f357baf0754136b4a02e7aec4129874db93ee462f43588b77def730db0b2bca', size=33080943, num_params=8140276, commit='d4a59999179b42fc0d3058ac6b76cc41f49dd56e', train_args='./imagenette2-320/ --arch mobileone_s3 --batch-size 64 --mixup-alpha 0.2 --amp --device 0 --epochs 100 --lr 1e-3 --label-smoothing 0.1 --random-erase 0.1 --train-crop-size 176 --val-resize-size 232 --opt adamw --weight-decay 5e-2')