Efficient and Flexible Method for Reducing Moderate-size Deep Neural Networks with Condensation
Tianyi Chen, Zhi-Qin John Xu
TL;DR
The paper addresses the challenge of deploying neural networks in scientific contexts where moderate network size and fast inference are essential. It introduces condensation reduction, a structured method that merges similarly oriented neurons based on cosine similarity to form smaller subnetworks, preserving the original network's functionality. The approach is shown to be universal across fully connected and convolutional architectures, with manual and automatic reduction strategies and embedding-principle justification; it successfully reduces a FC network for combustion simulation from 6.80M to 2.85M parameters (≈41.9% of the original) and a MobileNetV2-based CNN for CIFAR-10 from 2.24M to 0.26M parameters (≈11.5%), while maintaining comparable accuracy after short retraining. This method offers significant practical impact for rapid inference in resource-constrained environments and for accelerating scientific computations by delivering compact, high-fidelity subnetworks.
Abstract
Neural networks have been extensively applied to a variety of tasks, achieving astounding results. Applying neural networks in the scientific field is an important research direction that is gaining increasing attention. In scientific applications, the scale of neural networks is generally moderate-size, mainly to ensure the speed of inference during application. Additionally, comparing neural networks to traditional algorithms in scientific applications is inevitable. These applications often require rapid computations, making the reduction of neural network sizes increasingly important. Existing work has found that the powerful capabilities of neural networks are primarily due to their non-linearity. Theoretical work has discovered that under strong non-linearity, neurons in the same layer tend to behave similarly, a phenomenon known as condensation. Condensation offers an opportunity to reduce the scale of neural networks to a smaller subnetwork with similar performance. In this article, we propose a condensation reduction algorithm to verify the feasibility of this idea in practical problems. Our reduction method can currently be applied to both fully connected networks and convolutional networks, achieving positive results. In complex combustion acceleration tasks, we reduced the size of the neural network to 41.7% of its original scale while maintaining prediction accuracy. In the CIFAR10 image classification task, we reduced the network size to 11.5% of the original scale, still maintaining a satisfactory validation accuracy. Our method can be applied to most trained neural networks, reducing computational pressure and improving inference speed.
