Learning Compact Neural Networks Using Ordinary Differential Equations as Activation Functions

MohamadAli Torkamani, Phillip Wallis, Shiv Shankar, Amirmohammad RooshenasarXiv 2019

Abstract

Most deep neural networks use simple, fixed activation functions, such as sigmoids or rectified linear units, regardless of domain or network structure. We introduce differential equation units (DEUs), an improvement to modern neural networks, which enables each neuron to learn a particular nonlinear activation function from a family of solutions to an ordinary differential equation. Specifically, each neuron may change its functional form during training based on the behavior of the other parts of the network. We show that using neurons with DEU activation functions results in a more compact network capable of achieving comparable, if not superior, performance when is compared to much larger networks.

Introduction

Modern Deep Neural Networks (DNNs) are notoriously resource-intensive, requiring significant memory and computational power. This poses a major hurdle for deploying state-of-the-art models on edge devices like mobile phones or wearables. While architectures like MobileNet attempt to address this through structural pruning or specialized layers, they often trade off accuracy for efficiency.

A primary bottleneck in current designs is the reliance on fixed activation functions (e.g., ReLU or Sigmoid). Because every neuron in a layer is constrained to the same simple mathematical transformation, the network requires a higher volume of neurons to approximate complex functions. This paper proposes a paradigm shift: what if each neuron could learn the specific non-linear transformation it needs to optimize its contribution to the network?

Methodology: Differential Equation Units (DEUs)

The core innovation presented is the Differential Equation Unit (DEU). Instead of a static function, the activation of a neuron is defined as the solution to a second-order, linear ordinary differential equation (ODE):

$$ay''(t) + by'(t) + cy(t) = u(t)$$

Learnable Parameters and Training

Each neuron learns five additional parameters: three coefficients ($a, b, c$) defining the ODE's behavior and two initial conditions ($c_1, c_2$). The function $u(t)$ is set to the Heaviside step function, acting as a regulatory signal. Depending on the learned parameters, a DEU can naturally "morph" into various shapes, including approximations of ReLU, sigmoids, oscillatory patterns, or exponential decays.

To ensure stability during training—as ODE solutions can theoretically diverge—the authors utilized batch normalization and separate learning rates for DEU parameters versus standard weights. Symbolic computation (Maple) was used to derive closed-form solutions and their derivatives for efficient backpropagation.

Experimental Results

The authors evaluated DEUs across standard image classification benchmarks: MNIST, Fashion-MNIST, and CIFAR-10.

Efficiency on MNIST and Fashion-MNIST

Results indicate that DEUs allow for significant parameter reduction without sacrificing performance. For instance, a CNN using DEUs with only 21k parameters achieved the same 99.2% accuracy on MNIST as a standard CNN-ReLU with 30k parameters.

Table 1: Performance and size comparison on MNIST and Fashion-MNIST datasets.

Performance on CIFAR-10 and "Stunted" Architectures

When applied to more complex architectures like ResNet-18, DEUs consistently outperformed standard activation functions. Notably, DEUs achieved 92.5% accuracy on CIFAR-10, surpassing ReLU (91.25%), PReLU (92.1%), and Swish (91.9%).

One of the most striking findings involves "stunted" models—architectures with significantly reduced depth. A Stunted ResNet-18 using DEUs reached 90.7% accuracy, significantly outperforming the same model using ReLU (89.3%), suggesting that DEUs are highly effective at maximizing the performance of compact architectures.

Table 2: Accuracy comparison on CIFAR-10 across different architectures and activation functions.

Discussion and Conclusion

DEUs provide a mechanism for higher information density by allowing different neurons to utilize different functional forms. This variety allows a small network to mimic the capacity of a much larger one. The authors also identified "singularity subspaces" where the solution type shifts (e.g., from oscillatory to quadratic), and their algorithm is designed to navigate these transitions to find the optimal fit.

However, challenges remain. While DEUs reduce parameter counts, calculating closed-form ODE solutions is more computationally expensive than simple operations like ReLU. Future work will need to focus on native, highly optimized implementations in frameworks like PyTorch or TensorFlow to reduce inference latency and manage hyperparameter sensitivity.

Summary updated

BibTeX
@misc{torkamani2019learning,
  author = {MohamadAli Torkamani and Phillip Wallis and Shiv Shankar and Amirmohammad Rooshenas},
  title = {{Learning Compact Neural Networks Using Ordinary Differential Equations as Activation Functions}},
  year = {2019},
  eprint = {1905.07685},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.07685},
}
Figure