Skip to main content
QUICK REVIEW

[Paper Review] An Equivalence of Fully Connected Layer and Convolutional Layer

Wei Ma, Jun Lu|arXiv (Cornell University)|Dec 4, 2017
Neural Networks and ApplicationsComputer Science1 references48 citations
TL;DR

This paper demonstrates that fully connected (FC) and convolutional (CONV) layers are mathematically equivalent when expressed as matrix multiplications, enabling CONV layers to be reformulated as FC layers for analysis. The key result shows that equivalent networks—using FC or CONV layers—achieve nearly identical training and validation loss, with a Frobenius norm difference of 2.12e-7 between learned weights, confirming their functional equivalence under specific conditions.

ABSTRACT

This article demonstrates that convolutional operation can be converted to matrix multiplication, which has the same calculation way with fully connected layer. The article is helpful for the beginners of the neural network to understand how fully connected layer and the convolutional layer work in the backend. To be concise and to make the article more readable, we only consider the linear case. It can be extended to the non-linear case easily through plugging in a non-linear encapsulation to the values like this $σ(x)$ denoted as $x^{\prime}$.

Motivation & Objective

  • To establish a formal equivalence between fully connected and convolutional layers in deep neural networks.
  • To enable the analysis of convolutional layers using established methods from fully connected networks, such as uncertainty quantification and network morphism.
  • To demonstrate that CONV operations can be efficiently reformulated as matrix multiplications, simplifying theoretical understanding and implementation.
  • To validate the equivalence through empirical training of equivalent FC and CONV networks on MNIST, showing identical optimization dynamics.
  • To provide a foundation for transferring techniques from fully connected networks to convolutional architectures via weight equivalence.

Proposed method

  • Reformulate the 2D convolutional operation as a matrix multiplication by reshaping input feature maps and filters into matrices.
  • Use standard matrix multiplication to compute the output of a convolutional layer, treating each kernel application as a linear transformation.
  • Apply the same weight initialization and optimization (SGD and Adam) to both FC and CONV networks to ensure fair comparison.
  • Reshape the input data of shape (1000, 28, 28, 1) into (1000, 169, 16) to match the FC layer input dimension, preserving the equivalence.
  • Compute the Frobenius norm of the difference between learned weights in equivalent CONV and FC layers to quantify their similarity.
  • Compare the outputs of the first layer in both networks using a test set of 1000 images to validate functional equivalence.

Experimental results

Research questions

  • RQ1Can a convolutional layer be mathematically reformulated as a fully connected layer using matrix multiplication?
  • RQ2To what extent do equivalent FC and CONV networks exhibit identical training dynamics and loss curves?
  • RQ3How similar are the learned weights between equivalent FC and CONV layers in terms of Frobenius norm?
  • RQ4Does the equivalence hold under different optimization algorithms, such as SGD and Adam?
  • RQ5Can techniques developed for fully connected networks be directly applied to convolutional networks via this equivalence?

Key findings

  • The convolutional operation can be exactly represented as a matrix multiplication, proving that FC and CONV layers are mathematically equivalent under specific reshaping.
  • Training a fully connected network and a convolutional network with equivalent architecture and initialization yields nearly identical training and validation loss curves under SGD optimization.
  • The Frobenius norm of the difference between the learned weights of the equivalent CONV and FC layers is 2.12e-7, indicating near-perfect weight correspondence.
  • The output feature maps of the first layer in both networks differ by only 1.85e-6 in Frobenius norm, confirming functional equivalence.
  • Under Adam optimization, the loss curves diverge slightly, and the weight difference increases to a Frobenius norm of 0.0742, suggesting adaptive learning rates affect convergence symmetry.
  • The equivalence holds even when input data is reshaped into a 3D tensor (1000, 169, 16), confirming that the transformation preserves the computational equivalence.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.