LayerMerge: Neural Network Depth Compression through Layer Pruning and Merging

Jinuk Kim, Marwa El Halabi, Mingi Ji, Hyun Oh Song
6/18/2024
cs.LGcs.CV

Official code: snu-mllab/LayerMerge (32 stars, MIT, last commit 2026-04-13).

Abstract

Recent works show that reducing the number of layers in a convolutional neural network can enhance efficiency while maintaining the performance of the network. Existing depth compression methods remove redundant non-linear activation functions and merge the consecutive convolution layers into a single layer. However, these methods suffer from a critical drawback; the kernel size of the merged layers becomes larger, significantly undermining the latency reduction gained from reducing the depth of the network. We show that this problem can be addressed by jointly pruning convolution layers and activation functions. To this end, we propose LayerMerge, a novel depth compression method that selects which activation layers and convolution layers to remove, to achieve a desired inference speed-up while minimizing performance loss. Since the corresponding selection problem involves an exponential search space, we formulate a novel surrogate optimization problem and efficiently solve it via dynamic programming. Empirical results demonstrate that our method consistently outperforms existing depth compression and layer pruning methods on various network architectures, both on image classification and generation tasks. We release the code at https://github.com/snu-mllab/LayerMerge.

View on arXivView PDF

Code Implementations(1)

MIT

Official PyTorch implementation of "LayerMerge: Neural Network Depth Compression through Layer Pruning and Merging" (ICML 2024)

321C, C++May 31, 20246 months agoMIT
efficient-deep-learningefficient-inferenceneural-network-compressionneural-network-pruning

Similar Papers

Cite this paper

@article{kim2024layermerge,
  title  = {LayerMerge: Neural Network Depth Compression through Layer Pruning and Merging},
  author = {Jinuk Kim and Marwa El Halabi and Mingi Ji and Hyun Oh Song},
  year   = {2024},
  eprint = {2406.12837},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.12837v3},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.12837.svg)](https://codeofpaper.com/paper/2406.12837)

Discussion