Abstract
Although deep networks have recently emerged as the model of choice for many computer vision problems, in order to yield good results they often require time-consuming architecture search. To combat the complexity of design choices, prior work has adopted the principle of modularized design which consists in defining the network in terms of a composition of topologically identical or similar building blocks (a.k.a. modules). This reduces architecture search to the problem of determining the number of modules to compose and how to connect such modules. Again, for reasons of design complexity and training cost, previous approaches have relied on simple rules of connectivity, e.g., connecting each module to only the immediately preceding module or perhaps to all of the previous ones. Such simple connectivity rules are unlikely to yield the optimal architecture for the given problem. In this work we remove these predefined choices and propose an algorithm to learn the connections between modules in the network. Instead of being chosen a priori by the human designer, the connectivity is learned simultaneously with the weights of the network by optimizing the loss function of the end task using a modified version of gradient descent. We demonstrate our connectivity learning method on the problem of multi-class image classification using two popular architectures: ResNet and ResNeXt. Experiments on four different datasets show that connectivity learning using our approach yields consistently higher accuracy compared to relying on traditional predefined rules of connectivity. Furthermore, in certain settings it leads to significant savings in number of parameters.
Introduction
Designing deep neural network architectures is notoriously difficult and time-consuming. To manage this complexity, researchers shifted toward modular design—stacking identical building blocks like residual modules (ResNet) or multi-branch blocks (ResNeXt). However, even with modules, the "wiring" between them remains largely hand-coded. Most networks follow simple, rigid rules: connect each module only to the one before it, or connect it to all previous modules (DenseNet). These human-defined rules are unlikely to be optimal for every specific dataset or task. MaskConnect addresses this "connectivity bottleneck" by proposing a way for the network to learn its own internal wiring during training.
Methods
The authors introduce MaskConnect, an algorithm that jointly optimizes network weights and module connectivity.
Masked Architecture
Every module $j$ in the network is assigned a binary mask vector $m_j$. This mask acts as a set of "switches" that determine which outputs from previous modules ($1$ to $j-1$) are summed together to form the input for module $j$.
Learning Connectivity via Gradient Descent
Since binary switches are not differentiable, the authors use a trick inspired by BinaryConnect. They maintain real-valued masks during training, stochastically binarize them for the forward and backward passes, and then update the real-valued versions using standard backpropagation.
Constraints and Pruning
To prevent the network from becoming overly dense, a hyperparameter $K$ limits each module to exactly $K$ active input connections (the "Fan-in" constraint). A byproduct of this method is automated pruning: if the optimization sets all outgoing masks for a specific module to zero, that module is "dead" and can be removed after training, reducing the model's memory footprint and inference time without hurting accuracy.
Experiments and Results
The authors evaluated MaskConnect on four standard image categorization benchmarks: CIFAR-10, CIFAR-100, ImageNet (ILSVRC 2012), and Mini-ImageNet.
- Accuracy Gains: On CIFAR-100, a ResNet-38 equipped with MaskConnect achieved 70.40% accuracy, compared to 68.54% for the standard sequential version. On ImageNet, MaskConnect provided a 1.94% top-1 accuracy boost over a standard ResNet-50.
- Efficiency: For ResNeXt architectures, MaskConnect achieved accuracy comparable to the "full" model while using 40% fewer parameters (20.5M vs 34.4M) by pruning unused branches.
- Robustness: Learned connectivity consistently outperformed "random" connectivity, proving that gradient descent finds meaningful topological structures rather than just benefiting from random noise.
Discussion and Conclusion
MaskConnect treats connectivity as a learnable parameter just like a convolutional filter. Visualizations show emergent sparsity, where the network discovers that not every layer needs to talk to every other layer. Interestingly, learned ResNeXt models prefer more active parallel branches in deeper layers, suggesting that "width" or "cardinality" is more critical for high-level feature abstraction.
While MaskConnect adds some training overhead (13-39% increase in time), it offers a path toward automated architecture discovery. Future work could explore parametric aggregation—learning how to blend inputs rather than just switching them—and moving beyond fixed modular backbones to full architecture discovery.
Summary updated