VyntriVyntri
API Reference

vyntri.backbones

Backbone registry, automatic selection, and candidate control.

vyntri.backbones

Backbone Registry

BackboneFeaturesParamsInput SizeDescription
mobilenet_v3_small (default)5762.5M224Fast, lightweight, good for edge
resnet1851211.7M224Good balance of speed and accuracy
resnet50204825.6M224Higher capacity, slower extraction
efficientnet_b012805.3M224Efficient architecture, strong accuracy
convnext_tiny76828.6M224ConvNeXt architecture, competitive performance

Registry validated at construction. An invalid backbone name produces a clear error listing all supported names.

Automatic Backbone Selection

When backbone="auto", Vyntri scores candidates with LogME on frozen features, validates the top-k candidates with the analytic pipeline, and selects the best performer. Requires validation data.

from vyntri import Vyntri
from vyntri.data import split

s = split("./my_dataset", train=0.7, test=0.2, seed=42)

model = Vyntri(backbone="auto")
model.fit(train=s.train, val=s.val)

# View selection results
sel = model.metadata_["selection"]
print(f"Selected: {sel['selected']}")
print(f"Scores: {sel['scores']}")

Candidate Control

Control which backbones are evaluated during auto-selection. Only the specified candidates are benchmarked — excluded backbones are never initialized or evaluated.

model = Vyntri(
    backbone="auto",
    candidates=[
        "mobilenet_v3_small",
        "resnet18",
        "efficientnet_b0",
    ],
)
model.fit(train=s.train, val=s.val)

Rules:

  • candidates is only valid when backbone="auto" — combining candidates with an explicit backbone raises an error
  • Invalid candidate names are rejected with a clear error message
  • Duplicate candidates are rejected
  • If no candidates are provided, all supported backbones are evaluated
  • Selection is deterministic: same candidates + same data + same seed = same result