VGGNetwork<T>
Models & Types · AiDotNet.NeuralNetworks
Represents a VGG (Visual Geometry Group) neural network architecture for image classification.
Inheritance: NeuralNetworkBase<T> → DeclaredModelLayoutBase<T> → ImageClassifierModelLayoutBase<T> → VGGNetwork<T>
For Beginners
VGG networks are one of the foundational architectures in deep learning for image recognition. Despite being developed in 2014, they remain popular because:
- They’re simple to understand - just stacked convolutions and pooling
- They serve as excellent baselines for comparing new architectures
- They’re great for transfer learning (using a pre-trained network as a starting point)
- The features they learn are highly transferable to other visual tasks
How It Works
VGG networks are deep convolutional neural networks developed by the Visual Geometry Group at Oxford University. They are characterized by their use of small (3x3) convolution filters stacked in increasing depth, which allows them to learn complex hierarchical features.
Architecture: VGG networks consist of:
- Multiple blocks of 3x3 convolutional layers with ReLU activation
- Max pooling (2x2, stride 2) after each block to reduce spatial dimensions
- Optional batch normalization after each convolution (in _BN variants)
- Three fully connected layers (4096 -> 4096 -> num_classes)
- Dropout regularization in the fully connected layers
Typical Usage:
Constructors
| Constructor | Summary |
|---|---|
VGGNetwork() |
Initializes a new instance of the VGGNetwork class. |
VGGNetwork(NeuralNetworkArchitecture<T> architecture, VGGConfiguration configuration, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer, ILossFunction<T> lossFunction, VGGOptions options) |
Properties
| Property | Summary |
|---|---|
VGGVariant Variant { get; } |
Gets the VGG variant being used. |
bool UsesBatchNormalization { get; } |
Gets whether this network uses batch normalization. |
int NumClasses { get; } |
Gets the number of output classes for classification. |
Methods
| Method | Summary |
|---|---|
ModelMetadata<T> GetModelMetadata() |
Retrieves metadata about the VGG network model. |
Tensor<T> Forward(Tensor<T> input) |
Performs a forward pass through the VGG network with the given input tensor. |
long GetParameterCount() |
Gets the total number of trainable parameters in the network. |