This project explores the use of Kolmogorov-Arnold Networks (KANs) as an alternative to Convolutional Neural Networks (CNNs) for classifying brain tumors from MRI images.
KANs use functional approximations via basis functions (like splines) and leverage additive modeling, making them potentially more powerful for datasets where traditional CNNs may overfit or underperform due to limited data.
- Traditional CNNs work well with large datasets but may struggle with small, complex datasets like medical images.
- KANs are better suited for learning fine-grained details and offer flexibility in function approximation.
- Our goal is to evaluate the effectiveness of KANs in detecting brain tumors with limited labeled data.
- Source: Kaggle - Brain Tumor MRI Dataset
- Structure: MRI images of human brains categorized into:
- No Tumor
- Glioma
- Meningioma
- Pituitary Tumor
The images are grayscale and preprocessed to standard size (e.g., 128x128 or 224x224). The dataset is split into training and testing sets.
- Converted images to grayscale and normalized pixel values.
- Resized all images to a uniform dimension.
- Encoded class labels and split the data into training and test sets.
-
CNN (Baseline):
- Used 2–3 convolutional layers followed by max pooling, dense layers.
- Trained using Adam optimizer and categorical cross-entropy loss.
-
KAN Model:
- Implemented using spline interpolation layers.
- Replaces linear transformations with spline-based units.
- Trained with similar hyperparameters for a fair comparison.
- Used techniques from recent KAN literature to structure layers.
- Evaluated both models on:
- Accuracy
- Loss over epochs
- Confusion matrix
- KAN demonstrated superior edge-detection and performance stability on smaller subsets.
├── Matrixx_078_079_095_107_code.ipynb # Jupyter notebook with full training & evaluation
├── Matrixx_078_079_095_107_Paper.pdf # Detailed project report
├── Matrixx_078_079_095_107_PPT.pdf # Project PPT
├── README.md # Project documentation
-
main.py:- CLI-compatible script to preprocess data, train model, and save results.
- Supports switching between CNN and KAN via flags.
-
Matrixx_078_079_095_107_code.ipynb:- Full model training pipeline with code blocks for:
- Data loading
- Visualization
- Model definitions (CNN and KAN)
- Accuracy/loss plots
- Confusion matrix visualization
- Also includes early stopping and validation accuracy tracking.
- Full model training pipeline with code blocks for:
- KAN outperformed CNN in terms of:
- Generalization on small datasets
- Pixel-level boundary detection
- Accuracy scores improved by ~5–10% in some test runs.
- KAN showed more stable learning curves with reduced overfitting.
| Architecture | Accuracy |
|---|---|
| KANC MLP (Small) | 84.82% |
| KKAN (Small) | 88.94% |
| Conv KAN (Small) | 87.34% |
| KKAN (Medium) | 88.48% |
| KANC MLP (Medium) | 87.64% |
| Conv KAN (Medium) | 89.09% |
| KANC MLP (Large) | 84.59% |
- Apply U-KAN for segmentation of tumor boundaries.
- Experiment with hybrid CNN+KAN architectures.
- Evaluate performance on other medical imaging datasets (e.g., CT, X-ray).
- Explore transfer learning using pretrained KAN backbones.
