[Paper Review] Tensor Contraction Layers for Parsimonious Deep Nets
This paper introduces the Tensor Contraction Layer (TCL), a novel differentiable neural network layer that applies tensor contractions to activation tensors to reduce dimensionality and model parameters. By exploiting the multi-linear structure of feature maps in convolutional networks, TCLs enable significant model compression—up to 92× parameter reduction—while maintaining or even improving accuracy on CIFAR100 and ImageNet benchmarks.
Tensors offer a natural representation for many kinds of data frequently encountered in machine learning. Images, for example, are naturally represented as third order tensors, where the modes correspond to height, width, and channels. Tensor methods are noted for their ability to discover multi-dimensional dependencies, and tensor decompositions in particular, have been used to produce compact low-rank approximations of data. In this paper, we explore the use of tensor contractions as neural network layers and investigate several ways to apply them to activation tensors. Specifically, we propose the Tensor Contraction Layer (TCL), the first attempt to incorporate tensor contractions as end-to-end trainable neural network layers. Applied to existing networks, TCLs reduce the dimensionality of the activation tensors and thus the number of model parameters. We evaluate the TCL on the task of image recognition, augmenting two popular networks (AlexNet, VGG). The resulting models are trainable end-to-end. Applying the TCL to the task of image recognition, using the CIFAR100 and ImageNet datasets, we evaluate the effect of parameter reduction via tensor contraction on performance. We demonstrate significant model compression without significant impact on the accuracy and, in some cases, improved performance.
Motivation & Objective
- To address the question of how many parameters are truly necessary in deep neural networks by proposing a method to reduce model size without sacrificing performance.
- To explore the use of tensor algebraic operations, specifically tensor contractions, as trainable layers in deep networks to exploit multi-dimensional data structure.
- To evaluate whether replacing fully connected layers with tensor contraction layers can achieve significant parameter reduction while preserving or improving accuracy.
- To demonstrate that tensor contractions can serve as an effective alternative to flattening and fully connected layers in convolutional networks, preserving structural information and enabling faster inference.
- To investigate the feasibility of using TCLs as a plug-in module in existing architectures like AlexNet and VGG for efficient model compression and potential performance gains.
Proposed method
- Proposes the Tensor Contraction Layer (TCL) as an end-to-end trainable layer that applies n-mode tensor contractions to activation tensors using learned projection factors.
- Applies the n-mode product operation: $\mathcal{G} = \mathcal{X} \times_1 \mathbf{U}^{(1)} \times_2 \cdots \times_N \mathbf{U}^{(N)}$, where $\mathcal{X}$ is the input activation tensor and $\mathbf{U}^{(n)}$ are learnable projection matrices.
- Uses tensor unfolding and matrix multiplication to compute the contraction efficiently, enabling backpropagation through the layer.
- Replaces fully connected layers in AlexNet and VGG with TCLs, reducing the number of parameters in the final layers while maintaining the same or improved performance.
- Employs standard training protocols with data parallelism on multiple GPUs to ensure end-to-end training of TCL-equipped networks.
- Applies TCLs directly to the 3D activation tensor from the final convolutional layer (e.g., $\text{batch_size} \times 256 \times 5 \times 5$) instead of flattening it, preserving multi-dimensional structure.
Experimental results
Research questions
- RQ1Can tensor contractions be used as a trainable layer in deep neural networks to reduce model size while maintaining performance?
- RQ2To what extent can TCLs reduce the number of parameters in fully connected layers without degrading accuracy on image recognition tasks?
- RQ3Does preserving the multi-linear structure of activation tensors via tensor contractions lead to improved or stable performance compared to standard flattening and fully connected layers?
- RQ4How effective is the TCL in compressing large-scale models like AlexNet on ImageNet, and does it allow for faster inference with minimal accuracy loss?
- RQ5Can TCLs be used as a replacement for fully connected layers in a plug-and-play manner in existing architectures without architectural redesign?
Key findings
- Applying TCLs to the final convolutional feature maps of AlexNet and VGG on CIFAR100 reduced the number of parameters by up to 92×, with only a 2.5% drop in accuracy when replacing both fully connected layers.
- A size-preserving TCL added before the fully connected layers improved performance slightly while increasing parameters in the fully connected layers negligibly.
- Replacing the first fully connected layer with a TCL reduced parameters significantly and maintained the same Top-1 accuracy as the baseline AlexNet on ImageNet.
- On ImageNet, adding a TCL before the fully connected layers improved performance slightly, even with minimal increase in parameters.
- The TCL achieved significant model compression with minimal accuracy degradation, and in some cases, performance improved due to better representation learning via structured tensor operations.
- The method enables faster inference due to fewer floating-point operations, as the reduced parameter count directly lowers computational cost.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.