KA-Conv: Kolmogorov-Arnold Convolutional Networks with Various Basis Functions

May 15, 2024 ยท View on GitHub

Overview

The KA-Conv repository offers implementations of Kolmogorov-Arnold Convolutional Networks (KA-Conv) with different basis functions. This project aims to extend and refine the ConvKAN framework by integrating various activation functions and providing comparative performance metrics.

Installation

Use Pypi package

pip install kaconv
pip install -r requirements.txt

Build from source

git clone https://github.com/XiangboGaoBarry/KA-Conv.git
python -m build
pip install -r requirements.txt

Comparative Results

The following table presents the comparative results of different KA-Conv implementations using various activation functions. Key metrics include accuracy, parameter count, and throughput.

We compare the our results with

Alt text Alt text

Conv LayerActivation / Basis FunctionsHidden LayersAccuracy (%)Parameters (B)Throughput (image/s)
nn.Conv2dnn.relu[32,32]65.7513,162221224
convkan (with efficientKANLinear)Bspline[32,32]68.5569,33251873
convkan (with FastKANLinear)RBF[32,32]69.868,50867265
ka-conv (ours)BSpline[32,32]68.1365,0768260
ka-conv small (ours)BSpline[8,32]61.8927,1807988
ka-conv tiny (ours)BSpline[8,16]60.0614,1568126
ka-conv (ours)Chebyshev[32,32]63.0965,07694824
ka-conv small (ours)Chebyshev[8,32]59.3327,18092144
ka-conv tiny (ours)Chebyshev[8,16]56.7914,156113881
ka-conv (ours)Fourier[32,32]50.565,07686398
ka-conv small (ours)Fourier[8,32]49.3827,18084884
ka-conv tiny (ours)Fourier[8,16]45.4814,156104428
ka-conv (ours)Poly[32,32]62.9365,07698335
ka-conv small (ours)Poly[8,32]58.1727,18097254
ka-conv tiny (ours)Poly[8,16]57.4814,156127420
ka-conv (ours)RBF[32,32]69.5865,076100182
ka-conv small (ours)RBF[8,32]65.8127,180103170
ka-conv tiny (ours)RBF[8,16]61.9514,156126534

Result Analysis

Performance

Currently, with the same hidden layer setups, KA-Conv with RBF and BSpline activations outperform the original nn.Conv2d. However, KA-Conv also adds extra complexity, leading to more parameters and lower throughput. When reducing the number of parameters of the model to the same level as that of the model implemented with nn.Conv2d, the performance of the model implemented with KA-Conv is lower.

Efficiency

KA-Conv has lower throughput than nn.Conv despite that our implementation has +93% acceleration over other implementations.

Upcoming Release

We are comparing the performance of the model on larger datasets and larger models, such as ResNet on ImageNet. The results will be released soon.

Acknowledgements

This model is built upon FastKAN. We extend our gratitude to the creators of the original KAN for their pioneering work in this field.