Konstantinos Panagiotis Alexandridis, Jiankang Deng, Anh Nguyen, Shan Luo
The activation function plays a crucial role in model optimisation, yet the optimal choice remains unclear. For example, the Sigmoid activation is the de-facto activation in balanced classification tasks, however, in imbalanced classification, it proves inappropriate due to bias towards frequent classes. In this work, we delve deeper in this phenomenon by performing a comprehensive statistical analysis in the classification and intermediate layers of both balanced and imbalanced networks and we empirically show that aligning the activation function with the data distribution, enhances the performance in both balanced and imbalanced tasks. To this end, we propose the Adaptive Parametric Activation (APA) function, a novel and versatile activation function that unifies most common activation functions under a single formula. APA can be applied in both intermediate layers and attention layers, significantly outperforming the state-of-the-art on several imbalanced benchmarks such as ImageNet-LT, iNaturalist2018, Places-LT, CIFAR100-LT and LVIS and balanced benchmarks such as ImageNet1K, COCO and V3DET. The code is available at https://github.com/kostas1515/AGLU.
| Task | Dataset | Metric | Value | Model |
|---|---|---|---|---|
| Image Classification | Places-LT | Top-1 Accuracy | 42 | APA (SE-ResNet-50) |
| Image Classification | iNaturalist 2018 | Top-1 Accuracy | 74.8 | APA (SE-ResNet-50) |
| Image Classification | ImageNet-LT | Top-1 Accuracy | 59.1 | APA (SE-ResNext-50) |
| Image Classification | ImageNet-LT | Top-1 Accuracy | 57.9 | APA (SE-ResNet-50) |
| Instance Segmentation | LVIS v1.0 val | mask AP | 30.7 | SE-R101-FPN-MaskRCNN-APA |
| Instance Segmentation | LVIS v1.0 val | mask APr | 23.6 | SE-R101-FPN-MaskRCNN-APA |
| Instance Segmentation | LVIS v1.0 val | mask AP | 29.1 | SE-R50-FPN-MaskRCNN-APA |
| Instance Segmentation | LVIS v1.0 val | mask APr | 21.6 | SE-R50-FPN-MaskRCNN-APA |
| Few-Shot Image Classification | Places-LT | Top-1 Accuracy | 42 | APA (SE-ResNet-50) |
| Few-Shot Image Classification | iNaturalist 2018 | Top-1 Accuracy | 74.8 | APA (SE-ResNet-50) |
| Few-Shot Image Classification | ImageNet-LT | Top-1 Accuracy | 59.1 | APA (SE-ResNext-50) |
| Few-Shot Image Classification | ImageNet-LT | Top-1 Accuracy | 57.9 | APA (SE-ResNet-50) |
| Generalized Few-Shot Classification | Places-LT | Top-1 Accuracy | 42 | APA (SE-ResNet-50) |
| Generalized Few-Shot Classification | iNaturalist 2018 | Top-1 Accuracy | 74.8 | APA (SE-ResNet-50) |
| Generalized Few-Shot Classification | ImageNet-LT | Top-1 Accuracy | 59.1 | APA (SE-ResNext-50) |
| Generalized Few-Shot Classification | ImageNet-LT | Top-1 Accuracy | 57.9 | APA (SE-ResNet-50) |
| Long-tail Learning | Places-LT | Top-1 Accuracy | 42 | APA (SE-ResNet-50) |
| Long-tail Learning | iNaturalist 2018 | Top-1 Accuracy | 74.8 | APA (SE-ResNet-50) |
| Long-tail Learning | ImageNet-LT | Top-1 Accuracy | 59.1 | APA (SE-ResNext-50) |
| Long-tail Learning | ImageNet-LT | Top-1 Accuracy | 57.9 | APA (SE-ResNet-50) |
| Generalized Few-Shot Learning | Places-LT | Top-1 Accuracy | 42 | APA (SE-ResNet-50) |
| Generalized Few-Shot Learning | iNaturalist 2018 | Top-1 Accuracy | 74.8 | APA (SE-ResNet-50) |
| Generalized Few-Shot Learning | ImageNet-LT | Top-1 Accuracy | 59.1 | APA (SE-ResNext-50) |
| Generalized Few-Shot Learning | ImageNet-LT | Top-1 Accuracy | 57.9 | APA (SE-ResNet-50) |