[Paper Review] TanhExp: A Smooth Activation Function with High Convergence Speed for Lightweight Neural Networks
This paper proposes TanhExp, a smooth, non-piecewise activation function defined as $ f(x) = x \tanh(e^x) $, which enhances convergence speed and accuracy in lightweight neural networks without adding parameters. It achieves faster training and superior performance over ReLU, Mish, and Swish on MNIST, Fashion-MNIST, CIFAR-10, and CIFAR-100, with up to 6.5% higher test accuracy than Mish on LeNet for CIFAR-100.
Lightweight or mobile neural networks used for real-time computer vision tasks contain fewer parameters than normal networks, which lead to a constrained performance. In this work, we proposed a novel activation function named Tanh Exponential Activation Function (TanhExp) which can improve the performance for these networks on image classification task significantly. The definition of TanhExp is f(x) = xtanh(e^x). We demonstrate the simplicity, efficiency, and robustness of TanhExp on various datasets and network models and TanhExp outperforms its counterparts in both convergence speed and accuracy. Its behaviour also remains stable even with noise added and dataset altered. We show that without increasing the size of the network, the capacity of lightweight neural networks can be enhanced by TanhExp with only a few training epochs and no extra parameters added.
Motivation & Objective
- To address the performance limitations of lightweight neural networks due to constrained model size and training time.
- To overcome the drawbacks of ReLU, such as non-zero mean activation and the dying ReLU problem, in mobile and real-time vision applications.
- To design a simple, efficient, and robust activation function that improves convergence speed and accuracy without increasing model complexity.
- To demonstrate that TanhExp enhances network capacity with no extra parameters, enabling faster convergence and better generalization on small datasets.
Proposed method
- Propose a novel activation function, TanhExp, defined as $ f(x) = x \cdot \tanh(e^x) $, combining smoothness and approximate linearity.
- Ensure the function is continuous and differentiable everywhere, with negative values to center activation means near zero, accelerating learning.
- Leverage the exponential in the hyperbolic tangent to create a smooth transition that avoids hard truncation, mitigating the dying ReLU problem.
- Design the function to be computationally efficient, requiring only slightly more computation than ReLU and comparable to Swish, while outperforming more complex functions like Mish.
- Implement TanhExp in various lightweight architectures (e.g., LeNet, ResNet-20, ResNet-32) across multiple datasets with fixed hyperparameters.
- Evaluate performance using standard metrics: test accuracy, convergence speed, robustness to noise, and computation time.
Experimental results
Research questions
- RQ1Can a smooth, non-piecewise activation function improve convergence speed and accuracy in lightweight neural networks without increasing model size or parameters?
- RQ2How does TanhExp compare to ReLU, Mish, and Swish in terms of training speed, final accuracy, and robustness under data perturbations?
- RQ3Does TanhExp maintain high performance across diverse datasets, including MNIST, Fashion-MNIST, CIFAR-10, and CIFAR-100, especially in shallow and small architectures?
- RQ4Is TanhExp computationally efficient enough to be practical for real-time mobile and embedded vision systems?
- RQ5Can TanhExp enhance the representational capacity of lightweight networks by improving gradient flow and activation mean centering?
Key findings
- On MNIST with a 15-layer network, TanhExp achieved 89.86% test accuracy after just one training epoch, significantly outperforming Swish (40.30%) and Mish (65.68%).
- On CIFAR-100, TanhExp achieved 5% higher test accuracy than ReLU, 6.5% higher than Mish, and 4.7% higher than Swish on LeNet.
- TanhExp demonstrated faster convergence than all baselines, requiring fewer training epochs to reach comparable or better accuracy.
- The function maintained stable performance under noise and dataset shifts, showing strong robustness.
- Computationally, TanhExp was approximately twice as fast as Mish and comparable to Swish, with significantly lower total training time than ReLU due to faster convergence.
- TanhExp achieved better accuracy-speed trade-off than all compared activation functions, including ReLU, due to faster convergence and lower computation per step.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.