VGG16Backbone<T>

Models & Types · AiDotNet.ComputerVision.Detection.Backbones

VGG-16 (configuration D, no batch normalization) as a feature-pyramid backbone, cut the way EAST cuts it.

Inheritance: NeuralNetworkBase<T> → VGG16Backbone<T>

Implements: IDetectionBackbone<T>

How It Works

Thirteen 3x3 convolutions with ReLU in five blocks (64, 128, 256, 512, 512 channels), each block followed by 2x2 max pooling (Simonyan and Zisserman 2015). EAST (Zhou et al. 2017, §3.2) extracts “feature maps after pooling-2 to pooling-5”, returned here finest first at strides 4, 8, 16 and 32.

Parameter names follow torchvision’s vgg16().features, so LoadTorchWeights reads ImageNet weights, and InitializeLikeReference is torchvision’s initialization (Kaiming normal with fan-out, zero biases).

Constructors

Constructor Summary
VGG16Backbone(VGG16BackboneOptions options) Creates the backbone, initialized as torchvision initializes VGG.

Properties

Property Summary
IReadOnlyList<int> OutputChannels { get; } Channels of each returned feature map (pool2 to pool5), finest first.
IReadOnlyList<int> Strides { get; } Stride of each returned feature map, finest first.
bool IsFrozen { get; set; } Whether the backbone’s weights are frozen.
string Name { get; } The backbone name.

Methods

Method Summary
IFullModel<T, Tensor<T>, Tensor<T>> WithParameters(Vector<T> parameters)
IReadOnlyList<Tensor<T>> GetFeatureMaps(Tensor<T> input)
List<Tensor<T>> ExtractFeatures(Tensor<T> input)
ModelMetadata<T> GetModelMetadata()
ValueTuple<int, int> GetExpectedInputSize() EAST’s training crop (512x512, §3.5).
void Freeze() Freezes the backbone.
void InitializeLikeReference(Random random) torchvision’s VGG initialization: kaiming_normal_(mode="fan_out", nonlinearity="relu"), zero bias.
void LoadTorchWeights(Func<string, int[], double[]> read) Loads torchvision vgg16 weights straight from source into the layers.
void ReadParameters(BinaryReader reader)
void Unfreeze() Unfreezes the backbone.
void WriteParameters(BinaryWriter writer)