Introduction
Standard deep learning models for image classification typically treat each image in a training mini-batch as an independent sample. This approach ignores potential structural relationships between images that could provide valuable contextual information. This paper introduces Mini-batch Graph Neural Networks (MBGNNs), a novel architectural framework that explicitly models similarities within a mini-batch to enhance feature learning and robustness.
The MBGNN Architecture
The core innovation is the "Graph Layer," which can be integrated into existing backbones like ResNet. The process involves three main stages:
- Feature Encoding: Images are first processed by a standard backbone (e.g., ResNet-50) to extract initial feature vectors.
- Dynamic Graph Construction: For each mini-batch, the model computes pairwise cosine similarities and constructs a graph where nodes (images) are connected to their $k$-nearest neighbors.
- Information Aggregation: A GNN layer performs convolutions over this batch-specific graph, updating each image's features by pooling information from its neighbors.
The authors explore various strategies to combine original features with aggregated neighbor features, such as concatenation, weighted summation, and a "Drop Features" regularization technique. Additionally, an attention-based variant (Attn-MBGNN) allows the model to learn the importance of different neighbors dynamically during the pooling step.
Theoretical Robustness and Regularization
A key contribution of this work is the theoretical justification for the observed robustness. The authors prove a $1/(k+1)$ Robustness Rule: by aggregating features across $k$ neighbors, the impact of a perturbation on any single image is reduced by a factor of $1/(k+1)$.
This architectural design provides implicit regularization. Unlike contrastive learning, which requires complex auxiliary loss functions to force embeddings to be similar, MBGNNs make embeddings similar by design through the aggregation process. This simplifies the training pipeline while achieving similar goals of feature clustering.
Experimental Results
The MBGNN framework was evaluated on CIFAR-10, CIFAR-100, and MIT 67 datasets. The results consistently demonstrate that MBGNNs outperform standard ResNet baselines in both clean accuracy and robustness to noise. For instance, on the MIT 67 scene dataset, accuracy improved from 64.48% to 65.87%.
Beyond standard classification, the models showed significant resilience against pixel-wise Gaussian noise, blurring, and black-box adversarial attacks like SimBA. Furthermore, when applied to GANs (as MC-MBGNN), the method effectively mitigated mode collapse, leading to faster convergence and more diverse image generation compared to traditional mini-batch discrimination.
Conclusion and Future Directions
MBGNNs offer a simple yet powerful way to leverage intra-batch relationships in computer vision. While the approach introduces some computational overhead and sensitivity to batch size, its benefits in robustness and accuracy make it a compelling addition to standard pipelines. Future research will focus on scaling these methods to larger datasets like ImageNet and exploring their utility in tasks beyond classification, such as image segmentation or relationship modeling.
Summary updated