Abstract
Global pooling, such as max- or sum-pooling, is one of the key ingredients in deep neural networks used for processing images, texts, graphs and other types of structured data. Based on the recent DeepSets architecture proposed by Zaheer et al. (NIPS 2017), we introduce a Set Aggregation Network (SAN) as an alternative global pooling layer. In contrast to typical pooling operators, SAN allows to embed a given set of features to a vector representation of arbitrary size. We show that by adjusting the size of embedding, SAN is capable of preserving the whole information from the input. In experiments, we demonstrate that replacing global pooling layer by SAN leads to the improvement of classification accuracy. Moreover, it is less prone to overfitting and can be used as a regularizer.
The Information Bottleneck in Structured Data
In deep learning, processing structured data—such as images, text, or graphs—typically involves convolutional or recurrent layers that produce a variable number of feature vectors. To interface these features with a standard classifier (a fully connected network), models must "squash" these vectors into a single, fixed-length representation.
The industry standard for this operation is global pooling, which typically takes the maximum or the average of all vectors. However, this creates a significant information bottleneck. For example, if a model generates 1,000 feature vectors of dimension 64, max-pooling them still results in a single 64-dimension vector. Mathematically, this operation cannot guarantee the preservation of all critical information, and as input complexity grows, this bottleneck increasingly limits model performance.
Methods: The Set Aggregation Network (SAN)
The proposed Set Aggregation Network (SAN) adapts the "DeepSets" framework to structured data processing. Instead of a fixed mathematical operation, SAN utilizes a trainable neural network ($\tau$) to process each feature vector individually before summing the results:
$$f(X) = \sum_{i} \tau(x_i)$$
Key technical advantages of SAN include:
- Trainable Parameters: The aggregation process is learned during training, allowing the model to optimize how it summarizes data.
- Flexible Embedding Size: Unlike global pooling, which is restricted to the input feature dimension ($K$), SAN can embed features into a latent representation of any size ($M$).
- Theoretical Guarantee: The authors prove that if $\tau$ is a universal approximator, SAN can learn a unique representation for every input set, theoretically eliminating information loss.
- Spatial Awareness: For image tasks, normalized coordinates are appended to feature vectors before aggregation, ensuring the model retains spatial context.
Experimental Evaluation
The researchers evaluated SAN across three distinct domains:
- CIFAR-10: Standard image classification.
- Fashion MNIST & CIFAR-10 (Varied Resolutions): Testing robustness by rescaling images from 14x14 to 64x64.
- Tox-21: A benchmark for chemical graphs, predicting toxicological properties of molecules.
Key Results and Insights
Experiments consistently showed that SAN outperforms traditional pooling methods across various parameter counts. On the CIFAR-10 dataset, SAN achieved a test accuracy of 0.762, notably higher than max-pooling (0.719) and flattening (0.720).
Beyond raw accuracy, the study revealed several key insights:
- SAN as a Regularizer: SAN proved less prone to overfitting than max-pooling or flattening. The permutation-invariant nature of the sum operation appears to act as a natural regularizer.
- Resolution Independence: SAN is significantly more robust to scale changes. When trained on standard resolutions but tested on upscaled images (e.g., Fashion MNIST at 56x56), SAN maintained an accuracy of 0.4515, while max-pooling performance dropped to 0.3274.
- Graph Processing: In Tox-21 experiments, replacing standard sum-pooling with SAN improved the AUC for 10 out of 12 toxicological tasks, demonstrating its versatility beyond computer vision.
Conclusion
By replacing "dumb" fixed functions with a trainable aggregation layer, SAN effectively breaks the information bottleneck inherent in traditional global pooling. While it introduces a slight computational overhead and a new hyperparameter (the latent representation size $M$), the gains in accuracy, robustness to scale, and resistance to overfitting make it a powerful alternative for processing complex structured data.
Summary updated