Introduction
Designing Convolutional Neural Networks (CNNs) traditionally requires manual selection of kernel sizes (e.g., 3x3, 5x5, or 7x7) for each layer. While Neural Architecture Search (NAS) can automate this process, it often demands a prohibitively high computational budget. Recent attempts to learn kernel sizes jointly with network weights, such as FlexConv, have struggled with extreme inefficiency. These methods often generate weights for massive, image-sized kernels and then crop them, leading to computational costs that scale quadratically with input image resolution rather than the actual kernel size.
EffConv addresses this challenge by introducing a highly efficient framework for dynamically learning optimal kernel sizes during training. By decoupling size prediction from weight generation, EffConv achieves state-of-the-art accuracy with up to a 136x speedup in training time compared to existing baselines.
Methodology
The EffConv architecture consists of two primary sub-networks that collaborate during the initial stages of training:
- Size Predictor: A GRU-based model that predicts a continuous ("soft") kernel size for each layer. This value is rounded to an integer for the final architecture. To manage model complexity, a penalty loss ($L_{param}$) is included to keep the total parameter count within a user-defined budget.
- Adaptive Weight Predictor (Kernel Predictor): Another GRU-based hypernetwork that generates the actual weights for the CNN's kernels. Unlike previous methods, it adaptively generates weights only up to the spatial dimensions requested by the Size Predictor. This shift ensures that computational complexity depends on the predicted kernel size rather than the input image size.
The Differentiability Trick
A significant challenge in learning discrete kernel sizes is that rounding operations are non-differentiable, which prevents standard backpropagation. EffConv overcomes this by applying an exponential mask to the generated weights. This mask smoothly attenuates the edges of the kernel based on the "soft" size prediction, allowing gradients to flow back to the Size Predictor. Once optimal sizes are determined, the predictors are discarded, and the resulting CNN is trained from scratch.
Experimental Results
The authors evaluated EffConv on standard benchmarks including MNIST, CIFAR-10, STL-10, and ImageNet-32.
Massive Efficiency Gains
On the STL-10 dataset (96x96 images), EffConv-20 trained in approximately 13.2 seconds per epoch. In contrast, the FlexConv baseline required ~1800 seconds per epoch, representing a staggering 136x speedup. Furthermore, EffConv scales effortlessly to deeper networks, such as 56-layer ResNets, whereas previous methods often bottlenecked at 16 layers due to computational overhead.
Accuracy and Scalability
EffConv consistently outperforms baselines in accuracy. On CIFAR-10, an EffConv-44 model achieved 93.35% accuracy, significantly higher than a similarly sized FlexConv model (81.6%). As shown in the performance plots, accuracy improves steadily with both network depth and the allocated parameter budget.
Key Insights
- Optimal Kernel Placement: Contrary to the conventional wisdom of placing larger kernels in deeper layers, EffConv often finds that the largest kernels are most effective in early-to-middle layers.
- Universal Early Layers: Across different parameter budgets, EffConv tends to select identical kernel sizes for the first few layers. This suggests that low-level feature extractors, like edge detectors, have a universal optimal scale regardless of the overall network capacity.
Conclusion
EffConv provides a practical and efficient solution for automated kernel size selection. By utilizing a differentiable masking strategy and an adaptive weight predictor, it eliminates the computational waste of prior kernel-learning methods. Its ability to scale to deep networks and high-resolution images makes it a robust tool for modern CNN architecture design.
Summary updated