Elamur Research

MatConvNet - Convolutional Neural Networks for MATLAB

Paper · 2014 · Andrea Vedaldi and Karel Lenc

Summary

A convolutional neural network can be described as a sequence of fairly simple operations, yet making that sequence useful for research requires substantial engineering. The operations must run efficiently, support learning, and remain accessible when a researcher wants to change the architecture. MatConvNet addresses that combination of needs. It implements convolutional neural networks in MATLAB while exposing their individual operations as ordinary functions. The contribution is an environment in which researchers can inspect, combine, and extend computational components without rebuilding the machinery needed for large-scale training.

The paper’s central design decision is to give users direct access to the blocks beneath a complete network. Convolution, pooling, activation functions, normalization, and losses each have a forward computation and a corresponding backward computation for learning. SimpleNN connects these blocks in a chain, while DagNN supports branching structures represented as directed acyclic graphs. These wrappers provide convenience, but the underlying functions remain available independently. Much of the paper explains the mathematical contract that makes this arrangement work: what each block computes, how its derivatives behave, and how array shapes and spatial coordinates change across a network.

The implementation combines MATLAB interfaces with optimized C++ and CUDA components. Computation can move between a CPU and an NVIDIA GPU through MATLAB’s array types, and the toolbox can use CuDNN for additional efficiency. On ImageNet ILSVRC training, the authors report roughly 264 images/s for AlexNet with CuDNN. Their comparison with a published Caffe measurement suggests that the MATLAB interface need not impose a prohibitive speed penalty, although the hardware differs. For VGG-VD-16, distributing work across several GPUs raises throughput from 20 images/s to 45 images/s, with communication overhead remaining a stated concern. An additional training example finds that batch normalization reaches convergence in about one third of the epochs needed by the dropout configuration.

These results support a practical claim about research infrastructure: accessible components and substantial computational capacity can coexist. They do not establish a new image-recognition architecture or a general accuracy advantage over competing software. The paper is most valuable as a detailed account of how to organize a neural-network system around explicit operations, efficient projected derivatives, reusable network wrappers, and carefully specified spatial geometry. Its examples, pretrained networks, and documentation also make the same design useful for teaching and for applying existing image representations to other tasks.

Interesting ideas

Expose the computational pieces. MatConvNet makes individual operations available through a direct interface instead of requiring every experiment to begin inside a complete network abstraction. This works because researchers can reuse an optimized component while changing the surrounding computation. A new architecture does not necessarily require a new implementation of convolution, and a new training algorithm does not necessarily require a new network wrapper. The same principle applies to scientific software whenever users need both a convenient default pipeline and access to the operations from which that pipeline is assembled.

Make derivatives part of the component contract. Each trainable block provides a backward operation alongside its forward operation. The backward operation receives the influence arriving from later computation and returns the corresponding influence on its own inputs and parameters. This makes learning compositional: a network wrapper can coordinate the calculation without knowing the internal mathematics of every block. The reusable lesson is to define the information a component must exchange with its neighbors. Once that contract is clear, specialized implementations can change without forcing changes throughout the system.

Keep simple and general interfaces together. SimpleNN handles a chain of operations, whereas DagNN handles more complicated graphs. The paper does not force every small experiment through the most general machinery. It also does not restrict all experiments to the simpler structure. This is useful wherever a general framework brings overhead or conceptual complexity that basic cases do not need. A straightforward interface can remain easy to inspect, while a separate abstraction supports branching, shared parameters, and multiple inputs or outputs when the task requires them.

Describe geometry as explicitly as values. The paper tracks array dimensions, sampling strides, offsets, and receptive fields. These properties explain which input region can affect a particular output and whether operations from different implementations will align. That information is useful beyond image classification, especially when several processing paths must be combined or a representation must be mapped back to its input. Two components can have familiar names and still disagree about boundary handling. Recording their geometry makes such disagreements visible before they become unexplained output differences.

Treat numerical stability as an implementation requirement. The mathematical expression for an operation is not always the best way to evaluate it on a computer. MatConvNet subtracts the largest score when calculating softmax and combines softmax with logarithmic loss in a dedicated operation. These choices preserve the intended calculation while avoiding avoidable numerical problems. The broader idea applies wherever exponentials, probabilities, normalization, and logarithms meet: the interface should preserve the useful mathematical abstraction, while its implementation accounts for the finite range of machine arithmetic.

Measure the complete working system. The speed experiments describe data preprocessing, storage, image loading, batch subdivision, software versions, and hardware. These conditions matter because training throughput depends on the path from stored data to parameter updates, not simply on the speed of a convolution kernel. This is a useful experimental habit for GPU and parallel computing. An isolated operation can be fast while the application waits for data or communication. Reporting the surrounding conditions makes a performance result interpretable and helps identify which part of a system deserves further work.

Deep dive: MatConvNet - Convolutional Neural Networks for MATLAB

MatConvNet explained: how simple MATLAB building blocks support convolutional networks, efficient training, and flexible research. · about 36 minutes to read

How Mova uses it

For Mova, a small transparent language system implemented in Rust, the strongest connection is architectural. MatConvNet demonstrates how a system can expose its basic operations clearly while retaining a convenient way to assemble them into larger computations. That principle could guide the organization of Mova’s internal components. Each operation could have an explicit input, output, and description of its role, allowing a reader or developer to follow a result through the system.

This is a possible use of the paper’s design ideas, rather than evidence that Mova already incorporates MatConvNet or its numerical machinery. The paper concerns image-oriented neural computation in MATLAB; it does not describe Mova, Rust integration, or language-processing experiments. A concrete application therefore needs to distinguish the general software lesson from the particular operations implemented by the toolbox. Convolution and image pooling are central to MatConvNet’s subject, but they are not automatically requirements for a transparent language system.

The separation between computational blocks and wrappers is especially relevant. Mova could expose a small set of readable transformations and then offer a higher-level interface that combines them. A simple path could serve ordinary processing, while a more general graph could support operations that reuse an intermediate result or combine several inputs. The value would be inspectability: a higher-level interface would not prevent someone from examining the computation underneath it. Whether Mova needs a general graph should follow from its actual processing requirements.

MatConvNet’s treatment of metadata suggests another concrete possibility. Its pretrained networks carry information about expected image preprocessing, because the parameters alone do not define a valid application. A corresponding language-system design could keep the assumptions required by each component close to that component. In Mova, this might mean documenting what form of text an operation accepts and what interpretation its output carries. These are proposed design practices, not implemented features established by the paper.

If Mova were to include learned numerical components, the forward-and-backward contract would offer a way to keep their behavior explicit. A component could state both what it computes and how a training signal passes through it. If Mova does not need such learning, the same paper still offers a useful boundary: the machinery for optimization can remain separate from the machinery for ordinary evaluation. The contribution worth carrying over is the disciplined decomposition of a system, rather than the assumption that a language system should adopt the full architecture of a vision toolbox.

The problem and its context

Simple operations, demanding execution

The authors begin from a change in computer vision. Following the ImageNet work they cite by Krizhevsky and colleagues, convolutional networks had become influential enough to displace many earlier image representations. The authors place their own VLFeat work on the earlier side of that transition. Their problem is therefore practical as well as mathematical: researchers who had used established vision tools needed a workable environment for experimenting with the newer representations.

A convolutional network is assembled from operations such as filtering and rectification. At the level of an equation, an individual operation may be easy to describe. At the level of a useful implementation, the requirements are more demanding. Networks can contain many parameters, and training can require processing millions of images. A system that executes the right equations but does so too slowly is of limited use for this kind of research.

The paper treats efficient execution as a condition for experimentation. Researchers need enough computational capacity to test meaningful architectures and datasets, but they also need enough flexibility to change the computation. These requirements can pull software design in different directions. A tightly specialized implementation may be fast but difficult to extend. A convenient high-level implementation may be easy to modify but spend too much time on overhead or inefficient numerical routines.

MatConvNet tries to address both needs through a separation of responsibilities. MATLAB provides the environment in which users inspect arrays, combine operations, and write experimental code. Optimized numerical components provide the expensive calculations. Some new blocks can also be written directly in MATLAB while using its GPU support. The intended benefit is a shorter path from an idea to an experiment without abandoning the ability to train substantial networks.

Why another toolbox?

The authors acknowledge an existing collection of deep-learning software. They mention CudaConvNet and Torch, as well as Theano and Caffe, and recognize that other packages already have active contributors and established users. The motivation for MatConvNet is consequently not an absence of alternatives. It is a particular preference about how research software should interact with its user.

MATLAB matters in that argument because the authors describe it as a widely used research environment in computer vision and other fields. Deep integration allows a neural-network operation to appear as another function acting on familiar arrays. Users can combine that operation with their existing processing and analysis code. The paper’s claim is about reducing friction inside that environment.

This is also why direct access to low-level functions receives so much attention. The authors want users to be able to assemble a network themselves, replace part of its computation, or write a different optimizer. A complete training example is helpful, but it should not become the only path through the software. The implementation of a wrapper can itself become an example of how to compose the underlying blocks.

The paper distinguishes this user-facing dependence on MATLAB from the organization of the implementation. It outlines a division between the C++ and CUDA core and the MATLAB code, identifying execution beyond MATLAB as a possible direction for future development. That possibility remains prospective in the account. The toolbox presented to users relies on MATLAB.

A bridge between research, application, and teaching

The same design serves several kinds of work. A researcher can change an architecture. An application developer can load an existing network and use its predictions or intermediate features. A student can examine the sequence of operations and connect the mathematics to array computations. These uses share components even though their immediate goals differ.

The included examples cover both smaller datasets and ImageNet-scale training. The paper names MNIST and CIFAR examples separately from its larger ImageNet experiment. Pretrained networks provide another entry point: a user can apply a substantial image representation before attempting to reproduce its training process. That lowers the amount of surrounding work needed to investigate a downstream application.

The educational argument rests partly on visibility. If a wrapper is short enough to inspect and each block has a documented mathematical definition, the abstraction does not have to hide the calculation. The paper develops this point through its extended explanation of back-propagation, array geometry, and individual blocks. The technical material is part of the usability argument, because an accessible system also needs an understandable contract.

The authors do not present a controlled study of researcher productivity or teaching outcomes. Their evidence for usability consists of the interface design, installation procedure, examples, and mathematical documentation. That is meaningful evidence about what the software exposes, but it should be kept separate from a measured claim about how quickly different users learn or produce research.

The method, step by step

Begin with a computation made of blocks

A neural network maps an input to an output through a composition of simpler functions. In an image classifier, the input can be an image and the output can contain scores or probabilities for image categories. The intermediate values are representations computed by successive layers.

g = f_L ∘ … ∘ f_1

Here, g is the complete network, f_l is the function implemented by layer l, and L identifies the final layer. The composition symbol means that the output of an earlier function becomes the input of the next one. This expression describes the chain structure handled by SimpleNN.

Each layer can also depend on parameters that learning will adjust.

x_l = f_l(x_(l−1); w_l)

The tensor x_l is the output of layer l, x_(l−1) is its input, and w_l contains its parameters. The semicolon separates data from parameters in the notation. For convolution, those parameters include filter coefficients and, when used, biases.

The important software decision is that a block remains a callable component. A wrapper coordinates the components, but the block does not depend on being embedded in that particular wrapper. This makes it possible to reuse the same convolution implementation in a standard classifier, a different network structure, or an experimental learning procedure.

From explicit blocks to a trained network

The steps in order.

From explicit blocks to a trained networkStep 1: Prepare inputs and required metadata1. Prepare inputs and required metadataStep 2: Assemble computational blocks2. Assemble computational blocksStep 3: Evaluate the network forward3. Evaluate the network forwardStep 4: Compare predictions with target labels4. Compare predictions with target labelsStep 5: Propagate projected derivatives backward5. Propagate projected derivatives backwardStep 6: Update trainable parameters6. Update trainable parameters

Give the data an explicit shape

In the convolutional setting, intermediate data have spatial dimensions and feature channels. The paper represents such a value as a tensor whose dimensions distinguish height, width, and channel count.

x_l ∈ ℝ^(H_l × W_l × C_l)

The symbol ℝ denotes real-valued entries. H_l and W_l are the spatial dimensions at layer l, while C_l is the number of feature channels. A spatial position therefore contains a feature vector rather than necessarily a single intensity.

For a color image, the channels can correspond to the input color components. Later in a network, channels hold responses learned through filtering and other operations. This interpretation helps explain why a convolution filter extends across channels as well as across a spatial region.

A further array dimension packs several samples together. The purpose is efficient batch processing: operations can handle multiple images within the same numerical calculation. Most blocks treat those samples independently, but batch normalization is an important exception because its statistics combine information across the batch.

The direct filtering example uses an image with D=3 color channels and a bank containing K=16 filters. Each filter has spatial size 3 × 3 and spans the input channels. Applying the bank produces an output with K channels. These are illustrative dimensions for understanding the interface, not a reported architecture selected through an experiment.

Compute convolution over local neighborhoods

A convolutional block moves a filter over the input and calculates a weighted combination of nearby values. A bank of filters produces several output channels, with each filter defining a different weighted combination. A bias can add a constant associated with an output channel.

The input, filter, and output shapes express this organization.

x ∈ ℝ^(H × W × D), f ∈ ℝ^(H′ × W′ × D × D″), y ∈ ℝ^(H″ × W″ × D″)

The input x has height H, width W, and D channels. The filter bank f has spatial dimensions H′ and W′, spans the D input channels, and produces D″ output channels. The output y has spatial dimensions H″ and W″. Primes distinguish the roles of the dimensions rather than indicating differentiation.

The spatial size of the output depends on more than filter size. Padding extends the effective input support, while stride changes the distance between successive filter placements. MatConvNet permits padding to differ between the top and bottom or between the left and right. Values outside the actual input are treated as zero for convolution.

H″ = 1 + floor((H − H′ + P_h⁻ + P_h⁺) / S_h)

H″ is the output height, H is the input height, and H′ is the filter height. P_h⁻ and P_h⁺ are the padding above and below the input. S_h is the vertical stride. The floor operation takes the greatest integer no larger than its argument. The width follows the corresponding horizontal rule.

This formula encodes a substantive convention: every evaluated filter placement must fit within the padded support. A stride can leave a trailing part of the input unused. The paper’s convolution illustration calls attention to that possibility, which is easy to overlook when thinking only about an ideal sliding window.

MatConvNet treats a fully connected layer as a convolutional special case. When the spatial extent of the output collapses to the required single location, the filter covers the relevant input and computes the corresponding linear transformation. This reduces the conceptual inventory of the toolbox while allowing an implementation specialized for that case.

Filter groups add another variation. Rather than having every filter use all input channels, the operation can partition channels and apply subsets of filters separately. The paper connects this facility to the separate streams in the cited Krizhevsky and Hinton architecture. It also notes that grouped convolution can express sum pooling, although the dedicated pooling routine is considerably faster for that purpose.

Pool and apply nonlinear functions

Pooling summarizes a local spatial region while preserving the distinction between feature channels. Max pooling selects the largest value within the region. Average pooling combines the region through its mean. These operations change the spatial representation without learning a separate filter coefficient for every input contribution.

y = max{x in the pooling region}

Here, y is one pooled output value, and the set contains the input values from the corresponding spatial region within a single channel. The same operation is applied at the other output positions and channels. The maximum depends on the input, so the route followed by its backward signal depends on which entry supplied that maximum.

For average pooling, the operation distributes weight across the values in the region.

y = (1 / (W′H′)) ∑ x

W′ and H′ are the pooling region’s width and height, and the sum covers its input values. The expression describes an interior region. At a boundary, MatConvNet crops the region and adjusts the normalization to the number of available values.

This boundary treatment differs from convolution padding. For max pooling, cropping corresponds to unavailable positions being unable to win the maximum. For average pooling, the denominator reflects the cropped area. Treating every kind of padding as an interchangeable operation would therefore change the calculation.

Activation functions add nonlinear behavior. The rectified linear unit leaves positive inputs in place and maps negative inputs to zero.

y = max{0, x}

The scalar x is an input entry and y is its output. The operation is applied independently to each entry of the tensor. During back-propagation, the positive-input indicator determines whether the arriving derivative passes through.

The sigmoid provides another supported activation.

y = σ(x) = 1 / (1 + e^(−x))

The symbol σ names the sigmoid function, e is the exponential base, and x and y are the scalar input and output. Its backward calculation can reuse the output value through the factor y(1 − y), avoiding the need to reconstruct the full derivative from a larger symbolic expression.

These blocks illustrate the overall interface philosophy. Their mathematical actions are small and explicit, but their efficient execution and derivative support make them useful components in much larger calculations.

Normalize along the intended dimensions

The paper includes several operations called normalization, but they aggregate different sets of values. Understanding those sets matters more than the shared name.

Local response normalization operates at each spatial location across a selected group of feature channels.

y_ijk = x_ijk (κ + α ∑_(t∈G(k)) x_ijt²)^(−β)

The indices i and j identify a spatial location, while k identifies an output channel. G(k) is the group of channels used to normalize channel k. The constants κ, α, and β control the scaling. The summation collects squared responses from the selected channels at the same spatial position.

Spatial normalization instead considers a neighborhood within each channel. It computes local energy from squared values and rescales the input using that energy. The paper explains that the neighborhood-energy computation can be expressed through average pooling, and its derivative can reuse the pooling block’s backward calculation. This is an example of implementing a more elaborate block through already available operations.

Batch normalization crosses a different boundary: it combines spatial positions and samples within a batch, separately for each channel.

μ_k = (1 / (HWT)) ∑_i ∑_j ∑_t x_ijkt

The value μ_k is the mean for channel k. H and W are the spatial dimensions, T is the batch size, and the index t selects a batch member. The indices i and j select positions within that member. The normalization therefore depends on all included positions and samples for the channel.

σ_k² = (1 / (HWT)) ∑_i ∑_j ∑_t (x_ijkt − μ_k)²

The symbol σ_k² denotes the channel variance calculated from the same entries. Each value contributes its squared deviation from μ_k. This coupling is why the block cannot be understood as independently processing each image.

y_ijkt = w_k (x_ijkt − μ_k) / sqrt(σ_k² + ε) + b_k

The output is y_ijkt. The learned multiplier w_k and additive term b_k act separately for each channel. The constant ε appears inside the square root in the denominator. The paper derives parameter and input derivatives while accounting for the dependence of the statistics on the input.

The distinction among these normalization operations has practical consequences. A block that aggregates across channels has different dependencies from one that aggregates across space, and both differ from one that crosses batch members. Their backward calculations must follow those dependencies. A generic label such as normalization is insufficient to specify the behavior.

Turn scores into a training objective

A classifier must compare its output with a target label. MatConvNet implements losses that perform this comparison at spatial positions and then aggregate the contributions into a scalar. Optional weights can change the importance of individual contributions. An ignore label allows designated samples to contribute nothing.

Softmax converts channel scores into normalized values at each spatial location.

y_ijk = e^(x_ijk) / ∑_(t=1)^D e^(x_ijt)

The input score x_ijk belongs to channel k at location i, j. The denominator sums exponentiated scores over D channels. The output y_ijk is the normalized value for that channel. The operation is repeated independently at the other spatial locations.

A direct implementation of these exponentials can encounter numerical trouble. The paper therefore evaluates an equivalent expression after subtracting the largest channel score.

y_ijk = e^(x_ijk − max_d x_ijd) / ∑_(t=1)^D e^(x_ijt − max_d x_ijd)

The index d ranges over channels when locating the maximum. The same maximum is subtracted in every exponent at the location. This shared shift preserves the normalized result while making its evaluation safer.

For a target class c, the logarithmic loss penalizes a low probability assigned to that class.

ℓ(x, c) = −log x_c

The vector x contains class probabilities, x_c is the entry for the correct class, and ℓ is the scalar loss. The expression assumes that the entries have the required probability interpretation. Without competition among scores, increasing every score would fail to express the intended classification task.

MatConvNet combines softmax and logarithmic loss in a dedicated block.

ℓ(x, c) = −x_c + log ∑_(k=1)^C e^(x_k)

Here, x contains unnormalized class scores, C is the class count, and c is the target label. The combined expression produces the softmax logarithmic loss without relying on a potentially unstable sequence of separately evaluated operations.

The toolbox also supports margin-based objectives. A structured multiclass hinge loss compares the target score against the strongest competing score.

ℓ(x, c) = max{0, 1 − x_c + max_(k≠c) x_k}

The inner maximum selects the largest score among classes other than c. The outer maximum prevents a negative loss once the target exceeds the competing score by the specified margin. This differs from a hinge applied only to the target score, because competition is included explicitly.

Attribute prediction requires a different interpretation. Several attributes may be active together, so their labels are not mutually exclusive categories. The paper supports binary losses for this setting, including a logistic objective.

ℓ(x, c) = −log σ(cx)

The scalar x expresses confidence in an attribute, c is its signed target label, and σ is the sigmoid. The product cx makes the penalty depend on whether confidence agrees with the label. The paper separately describes binary error and hinge alternatives.

These choices remain distinct from evaluation metrics. A classification error can report whether the target was selected, but its derivative is zero almost everywhere. A useful training objective must provide the signal required by gradient-based learning. The paper’s loss catalog therefore connects the meaning of the task with the mechanics of optimization.

Learn without storing enormous Jacobians

Back-propagation is the mathematical foundation of the backward interface. A tensor-valued block has many input entries and many output entries. Its full derivative records how every output entry changes with every input entry. After stacking tensors into vectors, this derivative becomes a Jacobian matrix.

J_f = d vec(f(x)) / d vec(x)ᵀ

The operator vec stacks tensor entries into a vector using the ordering described by the paper. J_f is the Jacobian of block f. The superscript ᵀ indicates transposition, so the notation describes derivatives with respect to an input row vector.

The matrix is generally too large to construct. The paper illustrates the issue with spatial dimensions of 32 and channel dimensions of 128, giving roughly 17 × 10^9 Jacobian entries. In single precision, the stated storage requirement is 68 GB. The derivative needed for learning is much more compact than this full intermediate object.

The key is to multiply by the influence arriving from later computation without constructing the entire Jacobian.

vec(p_l)ᵀ = vec(p_(l+1))ᵀ J_(f_(l+1))

The tensor p_(l+1) represents the projected derivative arriving from the later layer. The Jacobian belongs to the next block in the chain. Their product yields p_l, which has the shape of the earlier intermediate value. It can therefore be stored without allocating the full matrix.

The same calculation can be expressed as differentiation of a scalar inner product.

p_l = d⟨p_(l+1), f_(l+1)(x_l; w_(l+1))⟩ / dx_l

The brackets denote an inner product between tensors of matching shape. The block output is paired with the incoming projection p_(l+1), producing a scalar. Differentiating that scalar with respect to x_l gives a tensor with the shape of x_l.

For a parameterized block, the backward operation computes the corresponding derivative with respect to its parameters as well.

dw = d⟨p, f(x; w)⟩ / dw

The input is x, the parameter tensor is w, and p has the shape of the block’s output. The result dw has the shape of w. The notation expresses the quantity required from the block, without requiring the wrapper to inspect its internal implementation.

When the network ends in a scalar loss, back-propagation starts with a scalar projection of 1. The backward pass then traverses the computation in reverse, using each block’s backward mode. The paper presents this as a memory-efficient application of the chain rule, not as a different derivative from the one defined by the full composition.

Extend the calculation to branching networks

A chain is convenient but does not cover every useful architecture. A directed acyclic graph allows a value to feed several operations, a function to accept several inputs, and parameters to be shared. Evaluation is possible when the functions can be ordered so that each receives inputs already computed.

The graph distinguishes operations from variables. Operations compute values; variable nodes carry those values between operations. Parameters are variables whose values are supplied before evaluation. This representation makes both computation order and reuse explicit.

Back-propagation reverses the direction in which derivative information travels. A complication arises when a forward variable supplies several later operations. Each route contributes to the derivative of that variable, so the backward calculation must add those contributions.

dx_t ← dx_t + d⟨dx_l, f_(π_l)(…)⟩ / dx_t

The variable x_l is produced by the layer indexed by π_l. The tensor dx_l contains its accumulated backward signal. The variable x_t is one of that layer’s inputs, and dx_t is the accumulator for its derivative. The arrow means that the new contribution is added to the existing accumulator.

The ellipsis stands for the layer’s actual input variables. Efficient execution only visits those inputs, rather than every earlier variable in the graph. Variables that are original data inputs or parameters have no producing layer to evaluate backward.

This addition is essential for parameter sharing as well as branching data paths. A parameter used in several places affects the loss through each use. Its total derivative must reflect all those paths. The paper’s reversed-graph interpretation handles this by introducing summation where backward outputs would otherwise conflict.

DagNN supplies the object-oriented wrapper for such structures. Its greater flexibility requires more machinery than SimpleNN, and the authors report some overhead for tiny networks. Both wrappers nonetheless rely on the same basic idea: blocks compute outputs forward and projected derivatives backward.

Implement convolution through matrix operations

The convolution implementation reveals how a simple mathematical interface can conceal a carefully chosen numerical strategy. The paper introduces an operation that extracts each relevant image patch and stores it as a row in a matrix. A filter bank can then be reshaped into another matrix.

Y = φ(x)F

The operator φ extracts patches from x. The matrix F contains reshaped filters, and Y contains the output responses arranged as a matrix. Multiplication evaluates the patch–filter combinations using optimized matrix routines.

This formulation also gives compact expressions for learning the filters.

dz/dF = φ(x)ᵀ (dz/dY)

The scalar z is the network objective, and dz/dY is the derivative arriving at the convolution output. Transposing the patch matrix and multiplying by that derivative yields the filter derivative.

The input derivative requires putting overlapping patch contributions back into the original spatial arrangement.

dz/dx = φ*( (dz/dY)Fᵀ )

The operator φ* maps patch-shaped contributions back to the input and adds contributions that belong to the same input entry. It is the transpose counterpart of patch extraction. The multiplication by Fᵀ first propagates the output derivative through the filters.

The authors explain that patch extraction may initially appear wasteful, but it can be fast when many filters are involved because it enables BLAS and GPU BLAS routines. The interface does not require the user to manage this representation. It exposes convolution while allowing the implementation to exploit an efficient numerical primitive.

Define transpose operations and spatial dependence

Convolution transpose is defined through the transpose of the linear convolution mapping. The name sometimes used for it, deconvolution, can be misleading if interpreted as a guarantee of inversion.

vec(y) = Mᵀ vec(x)

The matrix M represents the convolution mapping in the opposite direction used for this definition. Its transpose Mᵀ defines the operation applied to x. The equation states a transpose relationship; it does not state that lost information is recovered.

The operation supports upsampling and output cropping. Its output height follows the paper’s chosen convention.

H″ = U_h(H − 1) + H′ − C_h⁻ − C_h⁺

H is the input height, H′ is the filter height, U_h is the upsampling factor, and C_h⁻ and C_h⁺ are the output crops. H″ is the selected output height. The paper explains that reversing a downsampled size relation leaves an ambiguity, and it chooses the tighter output extent.

The toolbox also supports spatial resampling through a supplied grid and bilinear interpolation. The same grid transformation applies across feature channels. Derivatives can be calculated with respect to both the image and the grid, allowing the spatial transformation to participate in a larger differentiable computation.

The geometry chapter asks a related structural question: which input positions can influence a given output? For filter-like operations, a receptive field can be described by a stride, an offset, and a size. Composing operations then composes these descriptions.

α_h = α_f α_g

The quantities α_f and α_g are the strides of successive mappings f and g, while α_h is the stride of their composition h. The relationship describes how spacing between output locations maps back through the combined computation.

β_h = α_f(β_g − 1) + β_f

The quantities β_f and β_g are offsets, and β_h is the composed offset. The stride α_f changes how the second operation’s offset is expressed in the earlier coordinate system.

Δ_h = α_f(Δ_g − 1) + Δ_f

The quantities Δ_f and Δ_g are receptive-field sizes, and Δ_h is the composed size. The expression accounts for both the earlier field and the spacing between the earlier fields gathered by the later operation.

The analysis has a defined scope. It assumes dependencies that can be represented through sliding rectangular regions. Data-dependent cropping and more complicated blocks can require runtime information. The geometry is therefore an explicit structural tool, not a universal description of every network the computational interface can express.

Prepare data and connect learning to execution

Training uses stochastic gradient descent in the supplied examples. A batch passes through the network, a loss compares predictions with labels, back-propagation computes parameter derivatives, and the optimizer changes the parameters. The training routine remains example code because the authors regard optimization choices as partly dependent on the task.

The ImageNet workflow includes substantial preparation outside the network. The authors recommend preprocessing images so that resizing need not be repeated during training. They describe converting images to a height of 256 pixels and optionally storing the data in a RAM disk. Their image-reading facility can load batches of JPEG files using separate threads.

Pretrained use has its own input contract. The illustrated network requires a fixed image size, subtraction of an average image, and intensities in the range [0,255]. These expectations are carried in the network’s normalization metadata. Applying the correct parameters to incorrectly prepared inputs would not reproduce the intended computation.

The paper also describes alternatives such as using crops, averaging predictions over several crops, or taking network outputs as general image features. These are capabilities and suggested uses rather than separately quantified experiments in the reported account.

Experiments and results

What the measurements are intended to establish

The experimental emphasis is on whether the implementation can support demanding training workloads at useful speed. The paper also includes a comparison of training behavior under dropout and batch normalization. It does not present a new architecture evaluated against a comprehensive collection of recognition baselines.

The main throughput tests train on ImageNet ILSVRC 2012. The metric is images processed per second by stochastic gradient descent. This is a measure of training throughput under the described setup. It is not prediction accuracy, inference latency, or the time needed to reach a specified validation error.

Testing uses a Dell server equipped with Intel Xeon E5-2667 v2 CPUs running at 3.30 GHz. Each CPU has eight cores, the machine has 256 GB of RAM, and it contains four NVIDIA Titan Black GPUs. The default measurements use a single GPU unless the experiment specifies otherwise.

The software environment is also identified: MatConvNet beta12, CuDNN v2, and MATLAB R2015a. Images are preprocessed to avoid resizing during the MATLAB training loop and placed in a RAM disk. Batch image loading uses the toolbox’s multithreaded JPEG-reading facility. These details define the conditions of the reported throughput.

AlexNet throughput and the Caffe reference

For AlexNet with CuDNN, the authors report roughly 264 images/s. They describe this as about 40% faster than the toolbox’s GPU path based on CuBLAS and more than 10 times the CPU training speed. Those relative statements come from the paper; exact corresponding throughput values are not reported in the prose.

The paper compares the CuDNN result with a published Caffe measurement of 253 images/s. This comparison addresses an obvious concern about MATLAB overhead: the high-level interface does not prevent the reported system from operating in the same throughput range as that reference.

ImageNet AlexNet training throughput under the reported hardware conditions

MatConvNet is close to the cited Caffe throughput, with different GPUs preventing a strictly matched comparison.

ImageNet AlexNet training throughput under the reported hardware conditionsCaffe, CuDNN, Titan: 253Caffe, CuDNN, Titan253MatConvNet, CuDNN, Titan Black (this paper): 264MatConvNet, CuDNN, Titan Black (thispaper)264
The numbers
System or settingimages/s
Caffe, CuDNN, Titan253
MatConvNet, CuDNN, Titan Black (this paper)264

The hardware caveat is central. Caffe’s reported measurement uses a Titan, while MatConvNet uses a Titan Black, which the authors describe as somewhat faster. The result supports a claim of comparable practical throughput. It does not isolate the contribution of the software or establish that MatConvNet would be faster on identical hardware.

The paper also observes that larger networks force smaller stochastic-gradient batches to fit GPU memory. That change can increase the relative effect of overhead. Throughput therefore depends on architecture and batch configuration, not simply on the name of the toolbox or the availability of CuDNN.

Training VGG-VD-16 across GPUs

The multiple-GPU experiment uses VGG-VD-16, described as a very large network. The batch contains 264 images, divided into sub-batches of 22 images so that the work fits GPU memory. Those sub-batches are distributed across the available GPUs on the same machine.

The reported endpoint throughput rises from 20 images/s to 45 images/s as execution moves from the single-GPU setting to the setting using four GPUs.

ImageNet VGG-VD-16 training throughput with shared-machine GPUs

Distributing sub-batches across the GPUs increases throughput while leaving substantial communication overhead.

ImageNet VGG-VD-16 training throughput with shared-machine GPUsSingle GPU: 20Single GPU20Four GPUs (this paper): 45Four GPUs (this paper)45
The numbers
System or settingimages/s
Single GPU20
Four GPUs (this paper)45

This experiment demonstrates that the implementation can distribute a large training workload and gain speed. It also identifies communication as a remaining cost. The authors explicitly name reducing that overhead as a development goal.

The fixed batch and sub-batch description matters. The experiment is not simply a comparison of unrelated training runs with unspecified amounts of work. At the same time, the paper does not provide enough numerical detail in the account to reconstruct the throughput at every intermediate GPU count or separate communication time from computation time.

Dropout and batch normalization

Another example trains an AlexNet-like network on ImageNet ILSVRC and compares dropout with batch normalization. The accompanying analysis follows top-1 and top-5 validation errors. Top-1 concerns the highest-ranked class prediction, while top-5 concerns whether the target appears among the highest-ranked candidates.

The paper reports that the batch-normalization setting converges in about one third of the epochs required by the dropout setting. An epoch is a pass through the training data. This result illustrates that the toolbox can express and train the alternative normalization-based configuration while exposing its effect on optimization progress.

The account does not state exact final validation errors or exact epoch endpoints. The result should therefore remain an approximate statement about convergence in passes through the data. It does not supply a numerical accuracy comparison suitable for another chart, and it does not establish the same relationship in elapsed training time.

The examples on MNIST and CIFAR demonstrate a wider range of supported tasks and scales, but the paper does not attach a comparable numerical results study to them. They serve primarily as working examples. The distinction matters: available training code shows that a workflow is supported, whereas a controlled benchmark establishes a particular measured result.

What the ablations show

The paper does not present a systematic component-removal ablation study; its informative comparisons concern execution backends, GPU distribution, alternative training configurations, and implementation conventions.

Backend comparisons locate an efficiency gain

The AlexNet measurements compare execution with CuDNN against the toolbox’s CuBLAS-based GPU implementation and CPU execution. This analysis addresses where practical speed comes from. The MATLAB interface remains part of the system, while the expensive numerical path changes.

The reported advantage for CuDNN supports the value of using specialized numerical implementations behind an accessible interface. It does not show that the interface itself causes a speed improvement. The design lesson is that usability and numerical specialization can be separated, allowing the former to coexist with the latter.

The CPU comparison establishes the importance of GPU execution for the reported workload. Its scope remains the measured training situation. The paper does not establish that every block, batch size, or small network benefits to the same degree.

GPU distribution exposes communication costs

The VGG-VD-16 experiment changes the amount of GPU hardware used to execute the subdivided batch. The increased throughput shows that the implementation gains from distributing work. The authors’ discussion of communication overhead explains why this gain should not be interpreted as effortless scaling.

This is a useful systems analysis because it identifies a limitation that appears only when components interact. A fast operation on a single device does not determine the performance of training across several devices. Data and parameter-related communication become part of the calculation’s effective cost.

The paper does not provide a decomposition that would assign a precise share of runtime to communication. Its conclusion is consequently qualitative at that level: the overhead is substantial and worth addressing. The endpoint measurements support the existence of a gain without fully explaining every source of inefficiency.

Alternative training blocks change convergence behavior

The dropout and batch-normalization example asks a different question from the throughput tests. It follows validation behavior over passes through the data, rather than measuring how many images the implementation processes per second.

The reported convergence advantage demonstrates that changing a training configuration can alter the amount of optimization progress obtained from a pass through the dataset. It also demonstrates the toolbox’s ability to accommodate the compared operations. The paper does not isolate every associated setting or establish a universal property of either technique.

A careful reader should therefore preserve the distinction between two kinds of speed. Faster execution reduces the cost of processing data. Faster convergence reduces the passes needed to reach a training outcome. The paper offers evidence about both, through different comparisons, without reducing them to a single measurement.

Mathematical comparisons reveal compatibility risks

Some of the most useful controlled reasoning is analytical rather than experimental. The geometry discussion compares MatConvNet’s pooling convention with Caffe’s. MatConvNet uses the filter-style output-size rule based on floor, while the Caffe behavior described by the authors uses a ceiling-based rule with an additional boundary correction.

This comparison shows why matching a layer name is insufficient when transferring a network. The frameworks can disagree about whether a trailing pooling window is included and how boundary support is represented. The paper works through padding choices needed to align the behavior.

Similarly, the distinction between SimpleNN and DagNN exposes a flexibility–overhead tradeoff. DagNN can represent more complex structures, but its additional machinery can make tiny networks slightly slower. The paper reports that tradeoff without quantifying a general wrapper penalty or treating the simplest interface as suitable for every architecture.

Limitations

Limits stated by the authors

The authors explicitly acknowledge communication overhead in multiple-GPU training. Their VGG-VD-16 result shows useful acceleration, but they describe reducing the overhead as unfinished work. The implementation therefore supports distributed execution within the tested machine without claiming that additional GPUs deliver an ideal proportional gain.

Memory capacity also constrains the experiment. Larger architectures require smaller batches or subdivisions that fit the device. The paper notes that reduced batch size can make overhead more visible. Its recommendations for large-scale training include a suitable NVIDIA GPU with at least 6GB of memory, together with sufficient CPU and storage performance. These are operational conditions for the intended workload.

The geometry analysis declares its own limits. It focuses on blocks whose dependencies can be determined from their structure and represented through sliding rectangular receptive fields. Data-dependent cropping can require runtime information. Other operations may be too complicated for the compact geometric description.

Even within the convolution-transpose analysis, rounding prevents the receptive field from always being represented tightly by the chosen form. The authors use a relaxed description in that case. A receptive-field rectangle should therefore be interpreted according to the assumptions of the analysis, rather than as a guarantee that every enclosed position has the same role in every operation.

The wrapper discussion also identifies a cost. DagNN’s generality introduces complexity and can be slightly slower for very small networks. The toolbox gives users alternatives, but choosing between them remains part of using the system appropriately.

Limits visible in the evaluation

The principal performance measurements come from a particular server, GPU family, software stack, and data-loading arrangement. They establish what the tested configuration achieved. They do not establish performance across arbitrary machines, MATLAB releases, or backend versions.

The preprocessing and RAM-disk setup reduce data-path costs that may be more prominent in another environment. A user reading images from slower storage or repeatedly resizing them during training may observe a different bottleneck. This is an inference from the experimental conditions, not an additional result claimed by the authors.

The Caffe comparison is informative but not controlled on identical hardware. The paper itself notes the GPU difference. The comparison cannot separate hardware effects from implementation effects, and it does not establish a general ranking between the packages.

The batch-normalization example reports approximate convergence behavior without exact numerical validation endpoints in the account. That leaves several questions unanswered: the precise final error, the exact stopping point used to judge convergence, and the relationship to elapsed time. The evidence supports the stated comparison in epochs, with those details remaining unspecified.

The paper also does not provide repeated-run variability for the performance results discussed in the prose. Its figures and measurements demonstrate practical capability, but they do not establish a statistical distribution of throughput or convergence across repeated trials.

Limits of the software contribution

MatConvNet implements and organizes existing neural-network operations; the paper does not claim a new general learning rule or a new best recognition architecture. Its mathematical derivations explain the operations and their efficient derivatives. The contribution should be assessed as an implementation and research environment rather than as an accuracy breakthrough.

The usability claims likewise rest on design evidence. Direct functions, readable wrappers, examples, and documentation plausibly make experimentation easier. The paper does not measure that effect through a user study or a controlled comparison of development time.

Pretrained networks expand the range of immediate uses, but availability is different from a benchmark of every application. The paper mentions classification, segmentation, text spotting, and face recognition in describing its resources. It does not supply a unified experimental evaluation across those tasks.

The technical presentation also contains notation and indexing inconsistencies. Some displayed definitions and derivative expressions are not fully consistent with the surrounding explanations. A careful implementation should preserve the intended dimensions, dependencies, and stated mathematical meaning instead of treating every printed index as an independent specification. This is a reader’s caution about the presentation, separate from the authors’ measured runtime results.

Finally, the broader applications discussed for Mova are design proposals. Nothing in the paper establishes that the toolbox’s MATLAB interface or image-processing operations have been integrated into that Rust system. The portable lesson concerns explicit components, metadata, and traceable computation; any concrete transfer would require its own implementation and evaluation.

What came after

MatConvNet is cited by later work across several areas of learned representation research. Those citations establish a connection to the toolbox, but they do not by themselves specify whether a particular study used its training code, pretrained networks, individual blocks, or general implementation approach. That distinction matters when assessing the legacy of an infrastructure paper. Reuse can be substantial without constituting a new methodological claim about the infrastructure itself.

DeepFool: A Simple and Accurate Method to Fool Deep Neural Networks, from 2016, places the citation in work concerned with making neural networks produce erroneous behavior. Its title identifies a different question from MatConvNet’s: how to fool a trained system rather than how to expose and execute its building blocks. MatConvNet’s account of input derivatives provides a relevant computational connection, because it treats derivatives with respect to data as part of the same backward interface used for parameters. The citation information does not establish the precise components DeepFool used.

Understanding image representations by measuring their equivariance and equivalence, from 2015, connects the toolbox to questions about representation behavior. The title identifies an interest in how image representations relate under transformations and comparison. MatConvNet makes intermediate outputs accessible and gives explicit attention to spatial dependence, both of which are pertinent capabilities for studying representations. The available citation establishes the connection without supplying that later study’s procedures or findings.

Fast ConvNets Using Group-Wise Brain Damage, from 2016, connects MatConvNet to work on faster convolutional computation. This belongs near the questions raised by efficient models and compression, although the title alone does not provide a detailed account of the technique. MatConvNet’s own paper already distinguishes efficient execution from architectural flexibility and supports grouped filters. The later citation should not be taken as proof that its named method is identical to the toolbox’s filter-group mechanism.

VoxCeleb: A Large-Scale Speaker Identification Dataset, from 2017, extends the citation trail into speech and spoken language. Its title identifies a dataset and a speaker-identification task. That is a different application domain from the image-classification examples used to explain MatConvNet. The connection is consistent with the toolbox’s broader aim of making learned representations usable across research problems, but the citation information does not establish an audio-processing pipeline, an architecture, or a result attributable to MatConvNet.

Deep Hashing Network for Unsupervised Domain Adaptation, from 2017, places the toolbox in research on representations that support adaptation between domains. Its title supplies the combination of hashing and unsupervised adaptation, but no experimental detail. MatConvNet’s separation of computational blocks from example-specific optimizers is relevant to this kind of methodological variation: a researcher can retain numerical components while changing the objective and training organization. The exact form of reuse is not established by the citation alone.

Expert Gate: Lifelong Learning with a Network of Experts, from 2016, connects the paper to work framed around lifelong learning and several experts. That direction makes the distinction between a single chain and a more general computational organization particularly relevant. MatConvNet supplies both a simple wrapper and a graph-based wrapper, but the later title does not establish that Expert Gate used DagNN or any particular graph structure from the toolbox.

Taken together, these works show a citation trail spanning robustness, representation analysis, computational efficiency, speech, domain adaptation, and lifelong learning. They support a broad view of MatConvNet’s relevance as research infrastructure. A more specific account of what each later study implemented would require its own technical description; the citation list does not justify inventing those details.

The durable idea connecting these directions is a software boundary. A researcher should be able to rely on efficient, differentiable operations without surrendering access to the computation they form. MatConvNet develops that boundary through direct functions, optional wrappers, explicit mathematical definitions, and measured large-scale execution. Its lasting value in this account lies in making substantial neural computation available as something researchers can inspect and reorganize.

Cite

Cite as Andrea Vedaldi and Karel Lenc. 2014. MatConvNet - Convolutional Neural Networks for MATLAB. arXiv (Cornell University).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.1412.4564 · arXiv 1412.4564

@misc{vedaldi2014matconvnet,
  title = {{MatConvNet - Convolutional Neural Networks for MATLAB}},
  author = {Andrea Vedaldi and Karel Lenc},
  year = {2014},
  doi = {10.48550/arxiv.1412.4564},
  eprint = {1412.4564},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.1412.4564}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/vedaldi-2014-matconvnet-convolutional-neural-networks-matlab/

References

12 references, from the paper's own bibliography.

  1. K. Chatfield, K. Simonyan, A. Vedaldi, and A. Zisserman. Return of the devil in the details: Delving deep into convolutional nets. In Proc. BMVC, 2014. OpenAlex ↗ · Scholar ↗
  2. J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In Proc. CVPR, 2009. OpenAlex ↗ · Scholar ↗
  3. S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. CoRR, 2015. OpenAlex ↗ · Scholar ↗
  4. S. Ioffe and C. Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. ArXiv e-prints, 2015. OpenAlex ↗ · Scholar ↗
  5. Yangqing Jia. Caffe: An open source convolutional architecture for fast feature embedding. http://caffe.berkeleyvision.org/, 2013. OpenAlex ↗ · Scholar ↗
  6. D. B. Kinghorn. Integrals and derivatives for correlated gaussian fuctions using matrix differential calculus. International Journal of Quantum Chemestry, 57:141–155, 1996. OpenAlex ↗ · Scholar ↗
  7. A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Proc. NIPS, 2012. our card
  8. Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. CoRR, abs/1312.4400, 2013. OpenAlex ↗ · Scholar ↗
  9. K. Simonyan, A. Vedaldi, and A. Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. In Proc. ICLR, 2014. our card
  10. K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. 2015. our card
  11. A. Vedaldi and B. Fulkerson. VLFeat – An open and portable library of computer vision algorithms. In Proc. ACM Int. Conf. on Multimedia, 2010. OpenAlex ↗ · Scholar ↗
  12. M. D. Zeiler and R. Fergus. Visualizing and understanding convolutional networks. In Proc. ECCV, 2014. our card