{"id":28988718,"url":"https://github.com/eidoslab/wignet","last_synced_at":"2025-10-18T05:02:17.693Z","repository":{"id":259460657,"uuid":"865528026","full_name":"EIDOSLAB/WiGNet","owner":"EIDOSLAB","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T14:07:32.000Z","size":1158,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-24T22:06:41.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EIDOSLAB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-09-30T17:18:17.000Z","updated_at":"2025-06-19T02:40:00.000Z","dependencies_parsed_at":"2024-10-25T23:04:35.577Z","dependency_job_id":null,"html_url":"https://github.com/EIDOSLAB/WiGNet","commit_stats":null,"previous_names":["eidoslab/wignet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EIDOSLAB/WiGNet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIDOSLAB%2FWiGNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIDOSLAB%2FWiGNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIDOSLAB%2FWiGNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIDOSLAB%2FWiGNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EIDOSLAB","download_url":"https://codeload.github.com/EIDOSLAB/WiGNet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EIDOSLAB%2FWiGNet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273539293,"owners_count":25123499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"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":[],"created_at":"2025-06-24T22:06:39.066Z","updated_at":"2025-10-18T05:02:12.658Z","avatar_url":"https://github.com/EIDOSLAB.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WiGNet: Windowed Vision Graph Neural Network\n\nPytorch implementation of the paper \"**WiGNet: Windowed Vision Graph Neural Network**\", published at WACV 2025. This repository is based on [VisionGNN](https://github.com/jichengyuan/Vision_GNN).\n\n[ArXiv](https://arxiv.org/abs/2410.00807)\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"imgs/teaser_wignet.png\" alt=\"teaser\" width=\"400\"/\u003e\n\u003c/div\u003e\n\n## Abstract\nIn recent years, Graph Neural Networks (GNNs) have demonstrated strong adaptability to various real-world challenges, with architectures such as Vision GNN (ViG) achieving state-of-the-art performance in several computer vision tasks. However, their practical applicability is hindered by the computational complexity of constructing the graph, which scales quadratically with the image size. In this paper, we introduce a novel Windowed vision Graph neural Network (WiGNet) model for efficient image processing. WiGNet explores a different strategy from previous works by partitioning the image into windows and constructing a graph within each window. Therefore, our model uses graph convolutions instead of the typical 2D convolution or self-attention mechanism. WiGNet effectively manages computational and memory complexity for large image sizes. We evaluate our method in the ImageNet-1k benchmark dataset and test the adaptability of WiGNet using the CelebA-HQ dataset as a downstream task with higher-resolution images. In both of these scenarios, our method achieves competitive results compared to previous vision GNNs while keeping memory and computational complexity at bay. WiGNet offers a promising solution toward the deployment of vision GNNs in real-world applications.\n\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"imgs/complexity.png\" alt=\"complexity\" width=\"1000\"/\u003e\n\u003c/div\u003e\n\n\n## Usage\n\nDownload our pretrained model from [here](https://drive.google.com/file/d/11bDJaiYxCIwG2OxapIJSkQZys38wDI4S/view?usp=sharing).\n\n### Environment\n- conda env create -f env_wignet.yml\n- conda activate wignet\n\n### ImageNet Classification\n\n\n- Evaluation\n```\npython train.py --model wignn_ti_256_gelu \\\n--img-size 256 \\\n--knn 9 \\\n--use-shift 1 \\\n--adapt-knn 1 \\\n--data /path/to/imagenet \\\n-b 128 \\\n--resume  /path/to/checkpoint.pth.tar \\\n--evaluate \n```\n\n- Training WiGNet-Ti on 8 GPUs\n```\npython -m torch.distributed.launch \\\n--nproc_per_node=8 train.py \\\n--model wignn_ti_256_gelu \\\n--img-size 256 \\\n--knn 9 \\\n--use-shift 1 \\\n--adapt-knn 1 \\\n--use-reduce-ratios 0 \\\n--data /path/to/imagenet \\  \n--sched cosine \\\n--epochs 300 \\\n--opt adamw -j 8 \\\n--warmup-lr 1e-6 \\\n--mixup .8 \\\n--cutmix 1.0 \\\n--model-ema \\\n--model-ema-decay 0.99996 \\\n--aa rand-m9-mstd0.5-inc1 \\\n--color-jitter 0.4 \\\n--warmup-epochs 20 \\\n--opt-eps 1e-8 \\\n--remode pixel \\\n--reprob 0.25 \\\n--amp \\\n--lr 2e-3 \\\n--weight-decay .05 \\\n--drop 0 \\\n--drop-path .1 \\\n-b 128 \\\n--output /path/to/save \n```\n\n\n\n### Complexity Evaluation\n\n**Memory \u0026 MACs**\n- WiGNet\n```\npython -m model.wignn\n```\n\n- ViG\n```\npython -m model.pyramid_vig\n```\n\n- GreedyViG\n```\npython -m model.greedyvig\n```\n\n- MobileViG\n```\npython -m model.mobilevig\n```\n\n\n\n\n### Transfer Learning\n- WiGNet\n```\npython train_trasnfer_learning.py \n--model-type wignn_ti_256_gelu \\\n--use-shift 1 \\\n--adapt-knn 1 \\\n--batch-size 64  \\\n--checkpoint /path/to/checkpoint.pth.tar \\\n--crop-size 512 \\\n--dataset CelebA \\\n--epochs 30 \\\n--freeze 1 \\\n--loss cross_entropy \\\n--lr 0.001 \\\n--lr-scheduler constant  \\\n--opt adam \\\n--root /path/to/save/dataset \\\n--save-dir /path/to/save/outputs_tl_high_res/ \\\n--seed 1 \n```\n\nFor ViG include `--num-gpu 8`\n\n## Results\n\n### ImageNet-1k\n\u003cdiv\u003e\n\u003cimg src=\"imgs/tab_inet.png\" alt=\"inet\" width=600\"/\u003e\n\u003c/div\u003e\n\n### CelebaHq\n\u003cdiv\u003e\n\u003cimg src=\"imgs/res_celebahq.png\" alt=\"celebahq\" width=\"600\"/\u003e\n\u003c/div\u003e\n\n\n# Citation\nIf you use our code, please cite\n\n```\n    @inproceedings{spadaro2024wignet,\n      title={{W}i{GN}et: {W}indowed {V}ision {G}raph {N}eural {N}etwork},\n      author={Spadaro, Gabriele and Grangetto, Marco and Fiandrotti, Attilio and Tartaglione, Enzo and Giraldo, Jhony H},\n      booktitle = {Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},\n      year={2025}\n    }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidoslab%2Fwignet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feidoslab%2Fwignet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feidoslab%2Fwignet/lists"}