Algorithms

Feature extraction & (pre-trained) backbones

Several models will use a pre-trained model to extract feature maps from its internal submodules – the backbone.

All the pre-trained backbones come from the package PyTorch Image Models (timm) and are wrapped by the class FeatureExtractor.

For an introduction to timm, please check the Getting Started with PyTorch Image Models (timm): A Practitioner’s Guide, in particular the introduction about models and the section about feature extraction.

More information at the section “Multi-scale Feature Maps (Feature Pyramid)” in timm’s docummentation about feature extraction.

Tip

  • Papers With Code has an interface to easily browse models available in timm: https://paperswithcode.com/lib/timm

  • You can also find them with the python package function timm.list_models(“resnet*”, pretrained=True)

The backbone can be set in the config file, two examples below.

Warning

Anomalib < v.0.4.0

model:
  name: cflow
  backbone: wide_resnet50_2
  pre_trained: true

Warning

Anomalib > v.0.4.0 Beta - Subject to Change

model:
  class_path: anomalib.models.Cflow
  init_args:
    backbone: wide_resnet50_2
    pre_trained: true