{"id":30621028,"url":"https://github.com/pialghosh2233/vgg19kan","last_synced_at":"2026-08-02T22:31:20.340Z","repository":{"id":309704606,"uuid":"1037241540","full_name":"PialGhosh2233/VGG19KAN","owner":"PialGhosh2233","description":"This repository contains the implementation of a hybrid model named VGG19KAN(Kolmogorov-Arnold Network)","archived":false,"fork":false,"pushed_at":"2025-08-13T09:54:07.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-10T01:33:36.209Z","etag":null,"topics":["ai-model","aritificial-intelligence","computer-vision","deep-learning","kolmogorov-arnold-networks","machine-learning","vgg19","vgg19kan"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PialGhosh2233.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-13T09:23:22.000Z","updated_at":"2025-09-09T05:38:21.000Z","dependencies_parsed_at":"2025-08-13T11:41:27.928Z","dependency_job_id":"9ae81a43-fd1e-4c5f-a8b2-bdc0709ccd8c","html_url":"https://github.com/PialGhosh2233/VGG19KAN","commit_stats":null,"previous_names":["pialghosh2233/vgg19kan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PialGhosh2233/VGG19KAN","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PialGhosh2233%2FVGG19KAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PialGhosh2233%2FVGG19KAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PialGhosh2233%2FVGG19KAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PialGhosh2233%2FVGG19KAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PialGhosh2233","download_url":"https://codeload.github.com/PialGhosh2233/VGG19KAN/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PialGhosh2233%2FVGG19KAN/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36210049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-08-02T02:00:06.915Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-model","aritificial-intelligence","computer-vision","deep-learning","kolmogorov-arnold-networks","machine-learning","vgg19","vgg19kan"],"created_at":"2025-08-30T14:24:16.936Z","updated_at":"2026-08-02T22:31:20.319Z","avatar_url":"https://github.com/PialGhosh2233.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VGG19-KAN: Hybrid CNN with Kolmogorov-Arnold Network Layers\n\nThis repository contains a hybrid deep learning model that combines a **pre-trained VGG19** convolutional backbone with **Kolmogorov-Arnold Network (KAN) linear layers** for flexible and powerful representation learning on image classification tasks.\n\nThis implementation is based on the approach proposed in the paper: **“Refining Crop Pest Recognition Performance through Dynamically Adaptable Activation Patterns of Kolmogorov Arnold Networks”** ([IEEE Link](https://ieeexplore.ieee.org/abstract/document/10940339)).\n\n---\n\n## 🚀 Project Overview\n\nThe model leverages:\n\n* **VGG19**: A pre-trained CNN for extracting high-level image features.\n* **KANLinear layers**: Novel fully connected layers inspired by the Kolmogorov-Arnold representation, providing improved non-linear mapping and expressivity.\n* **Data augmentation**: Techniques like random flips, rotations, color jitter, and random erasing for robust training.\n\nThe architecture is designed to replace traditional fully connected layers in standard CNNs with KANLinear layers for enhanced performance.\n\n---\n\n## ⚙️ Requirements\n\nPython 3.x and the following packages:\n\n```bash\ntorch\ntorchvision\nscikit-learn\nmatplotlib\nnumpy\n```\n\nInstall via pip:\n\n```bash\npip install torch torchvision scikit-learn matplotlib numpy\n```\n\n---\n\n## 🖥️ Model Architecture\n\n**VGG19KAN**:\n\n1. **Feature Extractor**: Pre-trained VGG19 convolutional layers\n2. **Adaptive Average Pooling**: Reduce feature maps to fixed size `(7x7)`\n3. **KANLinear Layers**:\n\n   * `kan1`: 25088 → 512\n   * `kan2`: 512 → 1024\n   * `kan3`: 1024 → Output\n\nThe model is trained with **CrossEntropyLoss** and optimized using **AdamW**.\n\n---\n\n## 🔄 Training \u0026 Evaluation\n\nThe training loop includes:\n\n* Training with backpropagation\n* Validation phase for monitoring overfitting\n* Test evaluation with **accuracy, precision, recall, and F1-score**\n\nMetrics are tracked per epoch and can be visualized using `matplotlib`.\n\n```python\ntrain_accuracies, val_accuracies, test_accuracies, train_losses, val_losses, test_losses, test_precisions, test_recalls, test_f1_scores = run(\n    model, criterion, optimizer, train_loader, val_loader, test_loader\n)\n```\n\n---\n\n## 🔧 How to Use\n\n1. Prepare your dataset with **training, validation, and test splits** in folders.\n2. Update dataset paths in the code:\n\n```python\ntrain_dataset = datasets.ImageFolder(root='PATH_TO_TRAIN', transform=train_transform)\nval_dataset = datasets.ImageFolder(root='PATH_TO_VAL', transform=val_transform)\ntest_dataset = datasets.ImageFolder(root='PATH_TO_TEST', transform=test_transform)\n```\n\n3. Run training:\n\n```bash\npython VGG19KAN.ipynb\n```\n\n4. Save the trained model:\n\n```python\ntorch.save(model.state_dict(), \"vgg19_kan.pth\")\n```\n\n---\n\n## 🔬 References\n\n* [VGG19 PyTorch Implementation](https://pytorch.org/vision/stable/models.html)\n* [Efficient-KAN: Kolmogorov-Arnold Network](https://github.com/Blealtan/efficient-kan)\n* [KAN: Kolmogorov-Arnold Networks](https://arxiv.org/abs/2404.19756)\n* [Refining Crop Pest Recognition Performance through Dynamically Adaptable Activation Patterns of Kolmogorov Arnold Networks](https://ieeexplore.ieee.org/abstract/document/10940339)\n\n---\n\n## 📌 Notes\n\n* GPU is recommended for training.\n* KANLinear layers replace standard fully connected layers for better representation learning.\n* Data augmentation improves model robustness and generalization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpialghosh2233%2Fvgg19kan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpialghosh2233%2Fvgg19kan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpialghosh2233%2Fvgg19kan/lists"}