Automatic Progressive Resizing for fastai Via fastxtend

The latest release of fastxtend brings automatic Progressive Resizing to fastai. My ProgressiveResize callback for fastai was inspired by MosaicML’s Progressive Resizing callback for Composer, which in turn was inspired by manual Progressive Resizing from the fastai course.

Progressive Resizing decreases model training time by training on smaller images then gradually increasing to the full image size. This allows training on more samples for the same compute budget, often leading to higher performance then training on full sized images.

To use, pip install fastxtend and add ProgressiveResize to the list of callbacks for Learner or

from import *
from import *

learn = Learner(..., cbs=ProgressiveResize())

In this example from the fastxtend docs, a ResNet50 is trained for 20 & 25 epochs on Imagenette at an image size of 224 pixels on a SageMaker Studio Lab Tesla T4 instance.

Mode Epochs Time (Mins) Accuracy
Full Size 20 14.3 86.2%
Progressive Resizing 20 11.5 85.8%
Progressive Resizing 25 13.9 87.8%

ProgressiveResize yields significant training time savings compared to training at full size at the expense of decreased performance. At a similar compute budget of roughly 14 minutes progressive resizing results with 87.8% accuracy compared to 86.2% accuracy with full sized training.

For more information, check out the fastxtend documentation for Progressive Resizing.