IDetectionBackbone<T>

Interfaces · AiDotNet.Interfaces

Marker interface for detection backbones. Combines the two contracts a detection model expects from its backbone:

(Layers, GetNamedLayerActivations, UpdateParameters, state-dict serialization).

(GetFeatureMaps, OutputChannels, Strides) consumed by FPN, anchor generators, and DETR-style transformer heads.

Implements: IFeatureMapProvider<T>, INeuralNetworkModel<T>

Known implementations: CSPDarknet<T>, EfficientNet<T>, ResNet<T>, SwinTransformer<T>, VGG16BNBackbone<T>, VGG16Backbone<T>, YOLOv9Backbone<T>, YoloStagedBackboneBase<T>

For Beginners

A detection model needs two things from its “backbone” (the network that processes the image first): the standard ability to train and run like any other neural network, and a special ability to output features at multiple scales for spotting both small and large objects. This interface bundles those two requirements so detection models can ask for “anything that can do both” rather than “specifically a BackboneBase”.

How It Works

Use this interface as the field type in detection consumers (ObjectDetectorBase, TextDetectorBase) instead of the concrete BackboneBase<T> base class. That keeps detection models decoupled from a specific base-class hierarchy and lets any future backbone implementation that satisfies the two underlying contracts plug in without inheriting from BackboneBase.

Methods

Method Summary
List<Tensor<T>> ExtractFeatures(Tensor<T> input) Extracts multi-scale features from an input image tensor.
long GetParameterCount() Returns the total parameter count across the backbone’s internal layers.
void ReadParameters(BinaryReader reader) Reads the backbone’s complete parameter state from a binary reader.
void WriteParameters(BinaryWriter writer) Writes the backbone’s complete parameter state to a binary writer for persistence.