Enhancing Deep Learning Models for Image Classification using Hybrid Activation Functions

Zhiqiang Zhang, Xiaoming Li, Yihe Yang, Zhiyong ShiResearch Square 2023

Abstract

In the era of big data, efficient data processing has become a crucial issue for scientific development. Image classification, as one of the core tasks in the field of computer vision, holds great significance for achieving automated and intelligent applications. Nonlinear activation functions play a crucial role in neural networks, as they can introduce nonlinear properties and improve the representation and learning ability of the model. This paper investigates the performance of three nonlinear activation functions—the cosine linear unit (CosLU), derivative exponential linear unit (DELU), and rectified linear unit with nonnegative slope (ReLUN)—proposed by E. Pishchik in 2023. Using the CIFAR-10 and CIFAR-100 datasets, we evaluated these functions across five progressively deepening ResNet models. Our results indicate that while CosLU outperforms the standard ReLU on simpler tasks, the effectiveness of these hybrid functions diminishes as dataset complexity increases, often leading to overfitting.

Introduction

The Rectified Linear Unit (ReLU) has long been the standard activation function in deep learning due to its computational efficiency and effectiveness in mitigating vanishing gradient problems. However, ReLU is not without its drawbacks, including the "dying ReLU" problem and its lack of smoothness. Recent research has shifted toward "trainable" activation functions that incorporate learnable parameters, allowing the network to adapt the activation shape during training. This study evaluates three such functions—CosLU, DELU, and ReLUN—to determine their impact on image classification performance across varying network depths and dataset complexities.

Methodology

The researchers integrated three specific activation functions into five different versions of the ResNet architecture (ResNet-8, 14, 20, 26, and 32):

  1. CosLU (Cosine Linear Unit): An enhancement of the SinLU function, it combines a linear term with a periodic cosine term, weighted by a sigmoid. It uses two trainable parameters ($\alpha$ and $\beta$) to control the amplitude and frequency of the cosine wave.
  2. DELU (Derivative Exponential Linear Unit): A hybrid function that uses the Sigmoid Linear Unit (SiLU) for negative inputs and a complex exponential term for positive inputs, featuring a trainable slope parameter ($n$).
  3. ReLUN: A trainable variant of ReLU6. It caps the output at a maximum value ($n$), but unlike ReLU6 (which is fixed at 6), $n$ is a parameter the model learns.
Visualizations of the proposed hybrid activation functions: (a) CosLU, (b) DELU, and (c) ReLUN.

Experimental Setup

The study utilized two classic computer vision benchmarks to evaluate the performance of these functions against a standard ReLU baseline:

  • CIFAR-10: 60,000 images across 10 categories (e.g., planes, cars, birds). This served as the baseline complexity test.
  • CIFAR-100: 60,000 images across 100 categories. This provided a more rigorous stress test to see if the activation functions could handle higher inter-class complexity.

Results and Discussion

On the CIFAR-10 dataset, CosLU consistently outperformed ReLU. For instance, on ResNet-26, CosLU achieved a test accuracy of 91.1%, edging out ReLU’s 90.7%. The authors suggest that the periodic nature of the cosine function might allow the model to capture more nuanced non-linear features that a simple "on/off" switch like ReLU misses.

Variations in activation function behavior as trainable parameters are optimized, showing different slopes and ranges.

However, a striking "complexity wall" was observed on the CIFAR-100 dataset. The effectiveness of these hybrid functions dropped significantly, often leading to severe overfitting. Researchers noted a massive gap between training and testing accuracy for CosLU and DELU, which often hit 99% training accuracy but failed on test data. ReLUN showed some resilience on the deepest model (ResNet-32), achieving 65.4% test accuracy.

Furthermore, the study identified a trend where trainable activation functions tend to show better performance gains as the model size increases. This suggests that larger models have the capacity to better utilize the flexibility provided by trainable activation parameters.

Conclusion and Future Work

While trainable activation functions offer flexibility, they also increase the risk of overfitting on complex datasets. DELU, in particular, struggled with stability as networks grew deeper. Future directions suggested by this work include developing better regularization techniques specifically for trainable activation functions and testing these functions on even larger architectures like Transformers or larger-scale datasets like ImageNet to see if the scaling trend holds true.

Summary updated

BibTeX
@inproceedings{zhang2023enhancing,
  author = {Zhiqiang Zhang and Xiaoming Li and Yihe Yang and Zhiyong Shi},
  title = {{Enhancing Deep Learning Models for Image Classification using Hybrid Activation Functions}},
  booktitle = {Research Square},
  year = {2023},
  doi = {10.21203/rs.3.rs-3574353/v1},
}
Figure