Abstract
Activation functions are essential in deep learning, and the rectified linear unit (ReLU) is the most widely used activation function to solve the vanishing gradient problem. However, owing to the dying ReLU problem and bias shift effect, deep learning models using ReLU cannot exploit the potential benefits of negative values. Numerous ReLU variants have been proposed to address this issue. In this study, we propose Dynamic Parametric ReLU (DPReLU), which can dynamically control the overall functional shape of ReLU with four learnable parameters. The parameters of DPReLU are determined by training rather than by humans, thereby making the formulation more suitable and flexible for each model and dataset. Furthermore, we propose an appropriate and robust weight initialization method for DPReLU. To evaluate DPReLU and its weight initialization method, we performed two experiments on various image datasets: one using an autoencoder for image generation and the other using the ResNet50 for image classification. The results show that DPReLU and our weight initialization method provide faster convergence and better accuracy than the original ReLU and the previous ReLU variants.
Introduction
In the world of deep learning, the Rectified Linear Unit (ReLU) has been the undisputed king of activation functions for a decade. It’s simple, computationally efficient, and mostly solves the vanishing gradient problem. However, it’s not perfect. Researchers have long grappled with the "dying ReLU" problem (where neurons get stuck at zero) and the "bias shift" effect.
A recent paper titled "DPReLU: Dynamic Parametric Rectified Linear Unit and Its Proper Weight Initialization Method" proposes a more flexible successor that doesn't just fix these issues—it learns how to fix them specifically for your dataset. DPReLU is a highly flexible activation function featuring four learnable parameters ($\alpha, \beta, \text{bias, and threshold}$) that allow the network to "shape" its own activations during training.
The DPReLU Method
While ReLU is effective, it's a "fixed" function: $f(x) = \max(0, x)$. This rigidity leads to two main issues:
- Dying ReLU: If a neuron's weights are updated such that it always receives negative input, it outputs zero, its gradient becomes zero, and it effectively "dies," never contributing to learning again.
- Bias Shift: Because ReLU zero-outputs all negative values, the mean activation of a layer is always positive, shifting the distribution and potentially slowing down training.
The authors introduce DPReLU, defined by the following equation:
$$f(x) = \begin{cases} \beta * (x - \text{threshold}) + \text{bias} & \text{if } x \geq \text{threshold} \\ \alpha * (x - \text{threshold}) + \text{bias} & \text{if } x < \text{threshold} \end{cases}$$
The Four Learnable Parameters:
- Alpha ($\alpha$): Controls the slope for values below the threshold (fixing the "dying" problem).
- Beta ($\beta$): Controls the slope for values above the threshold.
- Bias: Shifts the function along the y-axis (fixing the bias shift).
- Threshold: Shifts the function along the x-axis.
Proper Weight Initialization
The most significant technical contribution is the derivation of a robust weight initialization. The authors show that for a network using DPReLU to maintain stable variance across layers, the weights should be initialized with a variance of:
$$Var[W_l] = \frac{4}{(n_{in} + n_{out}) * (\alpha^2 + \beta^2)}$$
This formula generalizes the famous He initialization (which assumes $\alpha=0$ and $\beta=1$). Using standard Xavier or He initialization with DPReLU often led to poor performance; this custom-derived initialization is the "secret sauce" that allowed the model to exploit the extra parameters effectively.
Experimental Evaluation
The authors evaluated DPReLU across two distinct tasks using five standard image datasets: MNIST, FashionMNIST, CIFAR-10, CIFAR-100, and SVHNcropped. These were tested using a fully connected Autoencoder for image reconstruction and a ResNet50 architecture for image classification.
Key Results
The researchers compared DPReLU against ReLU, PReLU, and FReLU.
- Image Reconstruction: In Autoencoders, DPReLU achieved the lowest Mean Square Error (MSE) and highest Peak Signal-to-Noise Ratio (PSNR) across all datasets.
- Classification Accuracy: On the challenging CIFAR-100 dataset using ResNet50, DPReLU reached 45.00% accuracy, significantly outperforming PReLU (42.12%) and standard ReLU (34.78%).
- Convergence Speed: Across the board, models using DPReLU and the proposed initialization reached higher accuracy levels in fewer epochs compared to their counterparts.
Discussion and Conclusion
DPReLU acts as a "super-set" activation function. By setting specific parameters to 0 or 1, it can become ReLU, Leaky ReLU, PReLU, or FReLU. This allows the model to "decide" which variant it needs for a specific layer. Tracking the parameters during training revealed that different layers in a ResNet50 converge to very different activation shapes. Shallow layers often retain a higher $\alpha$ (more like a linear activation), while deeper layers might evolve closer to a traditional ReLU.
Despite the performance gains, DPReLU is sensitive to the initial values of $\alpha$ and $\beta$. Additionally, adding four parameters per activation layer increases the model's parameter count and memory footprint. In ResNet50 tests, DPReLU increased the time per epoch from 12s (ReLU) to 19s. Future work should explore how DPReLU performs in Natural Language Processing (NLP) and other non-vision domains.
Summary updated