Abstract
Tensors, or multidimensional arrays, are data structures that can naturally represent visual data of multiple dimensions. Inherently able to efficiently capture structured, latent semantic spaces and high-order interactions, tensors have a long history of applications in a wide span of computer vision problems. With the advent of the deep learning paradigm shift in computer vision, tensors have become even more fundamental. Indeed, essential ingredients in modern deep learning architectures, such as convolutions and attention mechanisms, can readily be considered as tensor mappings. In effect, tensor methods are increasingly finding significant applications in deep learning, including the design of memory and compute efficient network architectures, improving robustness to random noise and adversarial attacks, and aiding the theoretical understanding of deep networks. This article provides an in-depth and practical review of tensors and tensor methods in the context of representation learning and deep learning, with a particular focus on visual data analysis and computer vision applications. Concretely, besides fundamental work in tensor-based visual data analysis methods, we focus on recent developments that have brought on a gradual increase in tensor methods, especially in deep learning architectures and their implications in computer vision applications. To further enable the newcomer to grasp such concepts quickly, we provide companion Python notebooks, covering key aspects of this article and implementing them, step-by-step with TensorLy.
Introduction: Beyond Data Containers
While deep learning frameworks typically use "tensors" as simple data containers, this paper explores tensor methods—the rich mathematical toolkit of multilinear algebra—to revolutionize neural network design. By leveraging tensor decompositions, researchers can create models that are significantly more parameter-efficient, robust to noise, and better at preserving the inherent spatial structure of visual data. This approach moves beyond simple flattening, treating data as high-order objects to capture complex interactions.
The Challenge: Preserving Multidimensional Structure
Visual data is inherently multidimensional, comprising height, width, color channels, and often time. Traditional machine learning often forces this data into a "flat" vector format. This process, known as flattening, destroys the topological structure and dependencies between dimensions, leading to the infamous curse of dimensionality.
Furthermore, modern deep neural networks are notoriously over-parameterized, often containing millions or billions of parameters. This leads to massive computational costs, high memory requirements, and a tendency to overfit. Tensor methods act as a "natural language" for visual data, providing a principled way to compress models and regularize their learning by maintaining the multi-way structure of the data throughout the network.
Multilinear Algebra in Deep Learning
The core "workhorses" of this approach are tensor decompositions, which allow for efficient representation of high-order data:
- Canonical-Polyadic (CP) Decomposition: Expresses a high-order tensor as a sum of a minimum number of rank-one tensors, ideal for learning interpretable latent factors.
- Tucker Decomposition: A higher-order generalization of SVD, decomposing a tensor into a small "core" tensor and a set of factor matrices, offering flexibility for subspace learning.
- Tensor-Train (TT) Decomposition: Represents a tensor as a sequence of interconnected third-order cores, effective for extreme compression in very high-dimensional settings.
These techniques are integrated into architectures via specialized layers such as Tensor Contraction Layers (TCL), which reduce dimensionality while preserving structure, and Tensor Regression Layers (TRL), which perform regression directly on tensors. Additionally, Kruskal/Tucker Convolutions re-parameterize standard convolutions into efficient, separable operations derived from these decompositions.
Key Insights and Applications
- Structural Regularization: Tensor decompositions act as a powerful form of "structural regularization." By forcing weights to lie on a low-rank tensor manifold, models generalize better and are less prone to memorizing noise.
- Unifying Architectures: Many "hand-designed" efficient blocks, like the bottleneck layers in ResNet or depthwise separable convolutions in MobileNet, can be mathematically derived as special cases of CP or Tucker-decomposed convolutions.
- Preserving Topology: Unlike flattening, tensor operations like n-mode products allow a network to "see" across different modes (e.g., spatial vs. spectral) simultaneously without losing their distinct identities.
- Robustness to Attacks: Techniques like Tensor Dropout and Defensive Tensorization significantly improve a model's resilience to adversarial attacks and random noise compared to standard training.
Performance and Results
- Extreme Compression: Tensor-Train (TT) re-parameterization can compress fully-connected layers by factors of 10x to 100x or more with negligible loss in accuracy.
- Speedups: Decomposing 2D convolutional kernels into Kruskal or Tucker forms leads to significant computational speedups during inference, making deep models more viable for resource-constrained mobile devices.
- Improved Generalization: Low-rank tensor regression models often outperform their "flattened" counterparts in tasks with limited data, such as medical imaging or hyperspectral analysis, because they effectively mitigate the curse of dimensionality.
Challenges and Future Directions
Despite their promise, several hurdles remain. Determining the optimal rank selection for a decomposition is NP-hard, currently relying on heuristics. Numerical stability is also a concern, as multiple tensor contractions can lead to unstable gradients. Furthermore, there is a lack of auto-tensorization tools to optimally transform arbitrary networks. Finally, while libraries like TensorLy facilitate implementation, most current hardware is optimized for matrix operations, highlighting the need for specialized tensor-core acceleration.
Summary updated