Abstract
This post explores a novel neural network architecture where the deep layers are structured in 3D space. Unlike traditional dense layers that treat neurones as flat vectors, this design arranges neurones as volumetric grids, while maintaining full inter-layer connectivity. This 3D abstraction allows new ways of thinking about data representation, weight organisation, and potential applications in volumetric learning such as medical imaging or point cloud analysis.
1. Introduction
Most deep learning architectures treat neurones as abstract units in flat, unstructured vectors. However, real-world data—like CT scans, volumetric imagery, or 3D scenes—often has spatial structure that gets lost in fully connected layers.
In this paper, I propose a conceptual and practical framework where each deep layer is modelled as a 3D grid of neurones, and layers are fully connected. This combines the advantages of traditional dense layers with the spatial intuition of 3D models.
2. Concept
3D Neurone Representation
Each neurone is placed in a 3D grid, addressed by coordinates (x, y, z)
.
Full Connectivity in 3D
Every neurone in one layer is connected to every neurone in the next layer, just like in dense layers—but preserving their spatial identity.
Why 3D?
- Encodes spatial relationships within layers.
- Compatible with volumetric data (e.g. medical, AR/VR).
- Can integrate with 3D conv or attention mechanisms in future work.
3. Architecture Overview
The network consists of:
- Input Layer: Accepts 3D data.
- Hidden Layers: Flattened internally, but logically organised in 3D volumes.
- Output Layer: Application-specific (classification, regression, etc.)
Mathematical Formulation
Given an input volume:
[ V \in \mathbb{R}^{d_x \times d_y \times d_z} ]
We flatten it:
[ \mathbf{v} \in \mathbb{R}^{n}, \quad n = d_x \cdot d_y \cdot d_z ]
Then pass it through a standard fully connected layer:
[ \mathbf{h} = \sigma(W \cdot \mathbf{v} + b) ]
Finally, reshape h
into a new 3D volume for the next layer.
4. Implementation (PyTorch)
import torch
import torch.nn as nn
import numpy as np
class FullyConnected3DNet(nn.Module):
def __init__(self, input_shape, hidden_shape, output_dim):
super().__init__()
input_size = np.prod(input_shape)
hidden_size = np.prod(hidden_shape)
self.flatten = nn.Flatten()
self.fc1 = nn.Linear(input_size, hidden_size)
self.fc2 = nn.Linear(hidden_size, output_dim)
def forward(self, x):
x = self.flatten(x)
x = torch.relu(self.fc1(x))
x = self.fc2(x)
return x
# Example usage:
model = FullyConnected3DNet((4, 4, 4), (8, 4, 4), 10)
sample_input = torch.rand(5, 4, 4, 4)
output = model(sample_input)
print(output.shape) # Output: torch.Size([5, 10])
⸻
- Applications
Some promising domains for this architecture: • Medical Imaging: CT, MRI, PET scans. • 3D Object Recognition: Robotics, AR/VR, autonomous driving. • Climate & Geospatial Modelling: Where data has spatial-temporal 3D structure.
⸻
- Discussion
While the 3D arrangement offers a rich new way to think about fully connected layers, it comes at the cost of parameter explosion. Techniques like sparsity, pruning, or geometric attention may help reduce compute while keeping the benefits of 3D space.
⸻
- Conclusion
This exploration introduces the idea of fully connected deep layers arranged in 3D space. While functionally similar to standard dense layers, the spatial intuition and alignment with 3D data make it a valuable tool in the deep learning toolbox.
⸻
- Future Work • Integrating 3D convolutions with 3D dense layers. • Exploring sparsity and proximity-aware weights. • Visualising 3D activations and decision boundaries. • Applying to real-world volumetric