Efficient ResNets: Residual Network Design

Aditya Thakur, Harish Chauhan, Nikunj Gupta · DOI

Abstract

ResNets (or Residual Networks) are one of the most commonly used models for image classification tasks. In this project, we design and train a modified ResNet model for CIFAR-10 image classification. In particular, we aimed at maximizing the test accuracy on the CIFAR-10 benchmark while keeping the size of our ResNet model under the specified fixed budget of 5 million trainable parameters. Model size, typically measured as the number of trainable parameters, is important when models need to be stored on devices with limited storage capacity (e.g. IoT/edge devices). In this article, we present our residual network design which has less than 5 million parameters. We show that our ResNet achieves a test accuracy of 96.04% on CIFAR-10 which is much higher than ResNet18 (which has greater than 11 million trainable parameters) when equipped with a number of training strategies and suitable ResNet hyperparameters.

Introduction

In the world of deep learning, the "bigger is better" trend has led to massive models that require significant computational power and storage. However, real-world applications—such as IoT devices, robotics, and augmented reality—often operate on "edge" hardware with strict memory and energy constraints.

This research addresses the challenge of parameter efficiency: how can we design a neural network that maintains high-tier performance while staying under a strict budget of 5 million trainable parameters? We specifically target the ResNet-18 architecture, which typically uses over 11 million parameters, to determine if architectural refinement and optimized training can yield superior results with less than half the footprint.

Methodology

Our approach optimized the entire pipeline across two main fronts: architectural refinement and advanced training strategies.

1. Architectural Refinement

  • Layer Reconfiguration: Instead of the standard 4-layer ResNet-18 setup, we moved to a 3-layer architecture with a specific distribution of residual blocks [4, 4, 3] and channel counts [64, 128, 256].
  • Squeeze-and-Excitation (SE) Blocks: We integrated SE blocks to perform "channel-wise feature recalibration," allowing the network to weight certain channels more heavily based on image context.
  • Hyperparameter Tuning: Extensive ablation studies were conducted to find the optimal number of blocks and channel counts to maximize accuracy within the parameter budget.
Impact of block count (N) on test accuracy, showing N=4 as the optimal configuration.
Test accuracy across different base channel counts, demonstrating that 64 channels provide the best performance.

2. Advanced Training Strategies

  • Lookahead Optimizer: We utilized the Lookahead optimizer on top of SGD. Lookahead maintains "slow weights" and "fast weights," helping the model escape local minima and converge more effectively.
  • Gradient Clipping: To ensure stable parameter updates and prevent exploding gradients, we capped the gradient norm at 0.1.
  • Learning Rate Scheduling: We employed CosineAnnealingLR, which cyclically adjusts the learning rate to help the model find the optimal global minimum.
  • Data Augmentation: Standard techniques including random cropping (32x32 with 4-pixel padding) and horizontal flipping were applied to the CIFAR-10 dataset.

Results and Discussion

The "Efficient ResNet" was evaluated against a baseline ResNet-18 on the CIFAR-10 dataset. By cutting the parameter count by 58%, we managed to increase accuracy by roughly 6%.

Metric ResNet-18 (Baseline) Efficient ResNet (This Paper)
Total Parameters ~11.17 Million ~4.70 Million
Test Accuracy ~90% 96.04%
Layers 4 3

Key Insights

  • Efficiency > Depth: A well-optimized 3-layer network can outperform a 4-layer network. Reducing layer depth freed up the parameter budget for sophisticated components like SE blocks.
  • Optimization Power: A significant portion of the performance gain (from ~89% to ~96%) came from training strategies, highlighting that how a model is trained is as critical as its architecture.
  • Lookahead for Stability: While ADAM is popular, SGD with Lookahead provided superior final convergence, suggesting that "slow weights" act as a valuable regularizer for this task.

Conclusion

This study demonstrates that high-tier performance on CIFAR-10 is achievable under a strict 5-million parameter budget. While the results are promising, future work should explore how this 3-layer configuration scales to higher-resolution datasets like ImageNet and benchmark actual inference latency on edge hardware.

Summary updated

BibTeX
@misc{thakur2023efficient,
  author = {Aditya Thakur and Harish Chauhan and Nikunj Gupta},
  title = {{Efficient ResNets: Residual Network Design}},
  year = {2023},
  eprint = {2306.12100},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.12100},
}
Figure