Skip to main content

VGG: Very Deep Convolutional Networks for Large-Scale Image Recognition

Explore VGG’s 3×3 stacks, exact VGG-16/VGG-19 shapes and parameter counts, then separate architecture effects from scale, crop and ensemble evaluation in the original study.

TL;DR

  • VGG studies depth through repeated small convolutions: 3×3 stacks expand theoretical receptive fields and introduce additional nonlinearities.
  • VGG-16 and VGG-19 use regular five-block layouts, but their original fully connected classifier makes them large models. Structural simplicity does not imply low memory use or latency.
  • Training scale, test scale and view aggregation are separate choices. A single-network dense evaluation is not a single center crop, and the 6.8% top-5 test result uses an ensemble.
  • The executable reference verifies shapes, receptive fields and parameter counts. Accuracy figures remain cited experiments whose full evaluation protocols must accompany comparisons.

Studying depth with a regular small-filter design

VGG asks a focused architectural question: how much does increasing convolutional depth help when the design repeatedly uses small filters? Instead of adding a different kind of module at every stage, Karen Simonyan and Andrew Zisserman build a family of networks around stride-one 3×3 convolutions, ReLU nonlinearities and occasional 2×2 max-pooling.

The simple pattern makes depth easier to study and makes intermediate features easy to reuse. It does not make the resulting networks small. VGG-16 contains about 138 million parameters, largely because of its original fully connected classifier. Understanding both facts is essential: VGG is structurally regular and computationally substantial.

This review follows arXiv:1409.1556v6, revised April 10, 2015 and labeled as an ICLR 2015 conference paper. The first preprint appeared in September 2014, and the models underpinned the team’s ILSVRC-2014 entry. These are different dates describing the preprint, challenge and publication, rather than competing publication claims. The date above is this write-up’s date.

All interactive values below are analytical architecture calculations. The reference does not load weights, classify images, train a model or measure hardware performance. Accuracy figures are cited paper results with their evaluation protocols.

Why stack small convolutions?

One stride-one 3×3 convolution reads a 3×3 input neighborhood. Add another without intervening pooling and the theoretical support expands to 5×5. Add a third and it reaches 7×7. Each layer enlarges the support by two pixels because its neighboring feature positions already summarize overlapping input neighborhoods. §2.3

Build a large receptive field from small filters

Stack stride-one 3×3 convolutions without pooling. Each adds two pixels to the theoretical receptive-field width. Compare kernel weights with one wide convolution at equal channel width.

3
64

Same aligned 9×9 input grid in every panel. Teal is theoretical support; amber marks its shared center.

After 1 layer

3×3 input support

After 2 layers

5×5 input support

After 3 layers

7×7 input support

Receptive field: 7×7. Stack: 110,592 kernel weights; one 7×7 layer: 200,704. Stack/wide ratio: 0.551.

Analytical kernel-weight counts, excluding biases. Equal receptive fields do not make the functions identical: stacked ReLUs introduce nonlinearities. These counts are not measured speedups or activation-memory estimates.

At a fixed channel width C, three 3×3 layers use 27C² kernel weights. One 7×7 layer uses 49C². Biases are excluded from that comparison. The wide layer therefore has roughly 81% more kernel weights than the three-layer stack under these assumptions. If intermediate channel widths change, the simple comparison must change too.

The stack also inserts additional ReLU nonlinearities. It is consequently not just a cheaper way to express an unrestricted linear 7×7 filter. Without nonlinearities, successive convolutions can be composed into a larger linear kernel with structural constraints. With ReLUs between them, the computation can depend on which intermediate features activate. The paper attributes value both to increasing depth and to retaining spatial context at those intermediate steps.

A theoretical receptive field is the set of input locations that could influence a unit. It does not say that all locations contribute equally, that a trained model uses the whole area meaningfully, or that the area is entirely inside the image near boundaries. Nor does a lower parameter count prove lower latency. Kernel dispatch, intermediate tensors, convolution algorithms, memory traffic and the target hardware affect runtime separately.

The exact VGG-16 and VGG-19 layouts

All evaluated configurations take a 224×224 RGB crop during training. The convolutional layers use stride one; a 3×3 kernel receives padding one so spatial size is preserved. Five max-pooling layers use a 2×2 window and stride two. Width grows through 64, 128, 256, 512 and 512 channels. The fully connected classifier then uses 4096, 4096 and 1000 outputs. §2.1 and Table 1

Follow VGG-16 and VGG-19 through the image

Pick a layer to inspect spatial size, channel width, theoretical receptive field and effective stride. Five max-pools reduce 224×224 to 7×7 before the classifier.

conv1_1 · 3×3 convolution + ReLU, padding 1

Input tensor →

224×224 per plane

3 channels / 512

→ Selected output

224×224 per plane

64 channels / 512

Spatial planes share a 224×224 reference frame. Channel bars share a 512-channel scale; each channel has the labeled spatial size. No batch normalization is included in original D/E.

conv1_1: 224×224×64

Theoretical field 3×3; input-pixel stride 1. Parameters: 1,792.

13 convolutions + 3 fully connected layers = 16 weight layers. Pooling and ReLU are excluded from the name.

Exact architecture arithmetic for original configurations D and E, including biases. Convolutions preserve size with padding one. Receptive field is a theoretical support size, not measured attribution; padded support can extend outside the image.

Configuration D, conventionally called VGG-16, has [2,2,3,3,3] convolutions in its five blocks. That is thirteen convolutional layers plus three fully connected layers, giving sixteen layers with trainable weights. Configuration E, or VGG-19, uses [2,2,4,4,4], giving sixteen convolutions plus three classifier layers. ReLU and pooling operations are present but are not counted in those names.

The five pools reduce the spatial side as 224 → 112 → 56 → 28 → 14 → 7. At the final pool, D has a theoretical receptive field of 212×212 and an effective input stride of 32 pixels. E’s extra convolutions enlarge that theoretical support further. The displayed receptive-field arithmetic accounts for both convolution and pooling; doubling spatial stride changes how much a later kernel expands its input support.

Original VGG does not use batch normalization. A later model named VGG-BN changes that design and its training behavior. The paper evaluates an A-LRN configuration with local response normalization, finds no advantage in its comparison, and omits that normalization in the deeper networks. LRN and batch normalization are different operations; the existence of the former experiment does not imply the latter is part of the original model.

Configuration C is another useful control. It includes some 1×1 convolutions, which add channel transformations and nonlinearities without expanding the receptive field. At the same nominal depth, D performs better than C in the reported study. This helps distinguish “more nonlinear layers” from “more layers that also gather spatial context.” It does not establish that 1×1 convolutions are generally unhelpful in other architectures.

The large classifier is part of the original model

After the fifth pool, a 224×224 input leaves 7×7×512 = 25,088 activations. Connecting them to 4,096 hidden units requires 102,760,448 weights plus 4,096 biases: 102,764,544 parameters in the first classifier layer alone.

The classifier holds most of the weights

The 7×7×512 feature tensor flattens to 25,088 inputs. Inspect how the original three-layer classifier compares with the complete convolutional trunk.

Total: 138,357,544 parameters. Selected group: 74.3%. Float32 weights alone: 527.8 MiB. A simple architecture is not necessarily a small model.

Calculated parameter counts for 1000-class original VGG with biases, without batch normalization. Memory below assumes four bytes per parameter only; training states, activations and workspace are additional.

Including all biases, the reference counts 138,357,544 parameters for D and 143,667,240 for E, consistent with the paper’s rounded 138M and 144M totals. The classifier is identical in the two configurations; their parameter difference comes from the additional convolutional layers. These counts also show why the increase from sixteen to nineteen weight layers is not a proportional increase in total parameter count.

The classifier’s concentration of weights has practical consequences. Float32 storage of VGG-16’s parameters alone is about 528 MiB before gradients, optimizer state, activations or workspaces. This is a storage calculation, not a measured training-memory peak. Replacing the classifier with global average pooling can reduce parameters substantially, but it produces a different architecture and does not reproduce the original paper merely by keeping the convolutional blocks.

Training depth required a defined recipe

The reported training uses mini-batch gradient descent with momentum, batch size 256, momentum 0.9, weight decay 5×10⁻⁴ and dropout 0.5 in the first two fully connected layers. The learning rate begins at 0.01 and is reduced when validation accuracy stops improving. The described run stops after 370,000 iterations, corresponding to 74 epochs. §3.1

Initialization is a material detail. The authors first train shallower configuration A, then initialize selected early convolutional and classifier layers of deeper networks from it, while initializing intermediate layers randomly. The revised paper notes that suitable random initialization can also train the networks without that preliminary stage. A contemporary training recipe may use a different initialization or schedule; that does not invalidate the architectural insight, but it changes what a reproduction should claim.

Images are mean-RGB centered. Training samples a 224×224 crop from a rescaled image, with horizontal flips and color augmentation. The training scale S denotes the shortest side before cropping, not the crop size. Fixed S=256 and S=384 are studied, as is scale jittering over [256,512]. The crop remains 224×224 across these cases, while its fraction of the source image changes.

The paper reports training on a system with four NVIDIA Titan Black GPUs, taking roughly two to three weeks per network depending on the architecture. That historical observation belongs to its implementation and training setup. Our small parameter calculator neither measures nor predicts training time on present hardware. §3.3

A single test scale is not a single center crop

At test time, the original classifier is converted into convolutions: the first fully connected layer becomes a 7×7 convolution and the next two become 1×1 convolutions. The resulting fully convolutional network can run densely over an image larger than the training crop. Its class score map is pooled spatially, and predictions from original and horizontally flipped views are combined. §3.2

A test scale Q is the rescaled image’s shortest side. Running densely at one Q already differs from evaluating a single 224×224 center crop. Multi-scale testing evaluates several Q values and averages posteriors. Multi-crop testing instead samples a collection of crops; the paper considers fifty crops per scale, giving 150 crops over three scales.

Dense and crop evaluations have different boundary conditions. A crop’s outside pixels are replaced by padding, whereas dense evaluation can use neighboring image content. The paper finds complementary gains from combining them. That is additional test-time computation, so a result labeled “one network” can still involve many views. Counting checkpoints alone is not a complete description of its inference protocol.

Read the accuracy evidence with its protocol

The study uses ILSVRC-2012’s thousand-class dataset, with roughly 1.3 million training images, 50,000 validation images and 100,000 held-out test images. Top-1 error asks whether the best prediction is wrong; top-5 error asks whether the correct class is absent from the first five predictions. Most ablations report validation results. §4

For fixed S=256 and single-scale dense testing at Q=256, configuration A reports 29.6% top-1 and 10.4% top-5 validation error, while D reports 27.0% and 8.8%. E reports 27.3% and 9.0% under that same scale setting. The deepest model is therefore not best in every individual row. Scale-jittered training improves both D and E; at one test scale Q=384, E reaches 25.5% top-1 and 8.0% top-5 validation error. Table 3

Using scale-jittered training and three dense test scales, Q=512, D and E each report 24.8% top-1 and 7.5% top-5 validation error. Combining dense and multi-crop evaluation for E produces 24.4% and 7.1% on validation. These are single-network results, but neither is a one-crop measurement. Tables 4–5

The well-known 6.8% top-5 test error belongs to a post-submission ensemble of D and E with combined multi-crop and dense evaluation. The original seven-network ILSVRC submission had 7.3% test error. Table 7 separately reports 7.0% test error for one network with combined multi-crop and dense evaluation. Attributing the 6.8% result to one VGG-16 pass would conflate model fusion, view aggregation and architecture. Tables 6–7

Together these experiments support depth with small spatial filters and show the value of scale handling. They also show why benchmark comparisons must retain training scale, test scale, view aggregation and model count. Architecture is one axis of the result, not its complete specification.

Paper, equations and executable accounting

The annotated implementation connects the original small-filter argument, configuration table and parameter totals to a standard-library reference. The source computes shapes and counts; it contains no pretrained inference and no generated accuracy claims.

1. Expand support with stacked 3×3 filters

Original paper

§2.3: stacks of 3×3 convolutions

Equal channel width, stride one, no intermediate pooling; biases excluded.

Math and tensor shapes

\begin{aligned}R_n&=1+2n\\ P_{\mathrm{stack}}&=9nC^2\\ P_{\mathrm{wide}}&=(2n+1)^2C^2\end{aligned}

Equal channel width, stride one, no intermediate pooling; biases excluded.

Three small convolutions cover a theoretical 7×7 field with 27C² kernel weights, compared with 49C² for one wide layer. ReLUs between the small filters change the function class. Equal support does not imply identical filters, equal activation memory or a measured latency benefit.

Python implementation

vgg.py · receptive
python
def stack_comparison(depth,channels=64):
    """Equal channels, stride one, no pooling; kernel weights only."""
    return {'receptive':2*depth+1, 'stack':depth*9*channels**2,
            'wide':(2*depth+1)**2*channels**2}

2. Propagate shape, receptive field and effective stride

Original paper

Table 1: configurations A–E

224×224×3 → five blocks → 7×7×512.

Math and tensor shapes

\begin{aligned}R_\ell&=R_{\ell-1}+(k_\ell-1)j_{\ell-1}\\ j_\ell&=s_\ell j_{\ell-1}\end{aligned}

224×224×3 → five blocks → 7×7×512.

Configuration D has [2,2,3,3,3] convolutions per block; E has [2,2,4,4,4]. Every block ends with 2×2 stride-two max-pooling. Convolution uses stride one and padding one. These counts describe original VGG, which contains no batch normalization.

Python implementation

vgg.py · architecture
python
CONFIGS={'D':[2,2,3,3,3], 'E':[2,2,4,4,4]}


def architecture(config='D'):
    side,channels,receptive,jump=224,3,1,1
    layers=[]
    for block,count in enumerate(CONFIGS[config]):
        out=[64,128,256,512,512][block]
        for i in range(count):
            receptive+=2*jump
            layers.append({'name':f'conv{block+1}_{i+1}','side':side,'channels':out,
                           'parameters':9*channels*out+out,'receptive':receptive,'jump':jump})
            channels=out
        receptive+=jump; jump*=2; side//=2
        layers.append({'name':f'pool{block+1}','side':side,'channels':channels,
                       'parameters':0,'receptive':receptive,'jump':jump})
    return layers

3. Account for the original classifier

Original paper

Tables 1–2: classifier and parameter totals

Flatten 25,088 → 4096 → 4096 → 1000 classes.

Math and tensor shapes

\begin{aligned}P_{\mathrm{FC1}}&=25088\cdot4096+4096\\ &=102764544\end{aligned}

Flatten 25,088 → 4096 → 4096 → 1000 classes.

Including biases, VGG-16 has 138,357,544 parameters and VGG-19 has 143,667,240. The first classifier layer alone holds about 103 million. The paper rounds totals to 138M and 144M; replacing this classifier with global averaging creates a different model.

Python implementation

vgg.py · parameters
python
def parameter_count(config='D'):
    conv=sum(layer['parameters'] for layer in architecture(config))
    fc1=7*7*512*4096+4096
    fc2=4096*4096+4096
    fc3=4096*1000+1000
    return {'conv':conv,'fc1':fc1,'fc2':fc2,'fc3':fc3,'total':conv+fc1+fc2+fc3}

Original source excerpts: Karen Simonyan, Andrew Zisserman. arXiv:1409.1556v6, 10 April 2015; ICLR 2015. Cropped and rasterized from the hash-pinned author PDF; colors unchanged. Source page, rectangle and image hashes are recorded in the crop manifest. No open license is asserted where none was verified.

Run python examples/vgg.py for self-checks or add --json for the deterministic architecture trace. Download the reference, requirements and provenance notes. Tests verify both exact parameter totals and independent receptive-field calculations, then compare the Python output with the browser’s JavaScript model.

VGG makes a strong teaching example because its regularity lets an architectural idea remain visible: repeated local transformations can expand context while increasing nonlinear depth. Its original classifier and evaluation protocol keep the tradeoffs visible too. The design is easy to describe, but its weights, activations and multi-view evaluation still require substantial resources. Reading those details alongside the headline accuracy turns a familiar model name into an inspectable experiment.

If you found this paper review helpful, consider sharing it with others.

Mastodon