{"id":17976652,"url":"https://github.com/iamhankai/versatile-filters","last_synced_at":"2025-03-25T15:31:17.300Z","repository":{"id":87392325,"uuid":"206332415","full_name":"iamhankai/Versatile-Filters","owner":"iamhankai","description":"Pytorch code for paper: Learning Versatile Filters for Efficient Convolutional Neural Networks (NeurIPS 2018)","archived":false,"fork":false,"pushed_at":"2019-09-10T13:11:38.000Z","size":124,"stargazers_count":79,"open_issues_count":0,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-20T13:11:14.807Z","etag":null,"topics":["convolutional-neural-networks","model-compression"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamhankai.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","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":"2019-09-04T13:59:01.000Z","updated_at":"2024-01-04T16:37:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e6cf166-645d-44df-8e6f-7f24b7369453","html_url":"https://github.com/iamhankai/Versatile-Filters","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhankai%2FVersatile-Filters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhankai%2FVersatile-Filters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhankai%2FVersatile-Filters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamhankai%2FVersatile-Filters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamhankai","download_url":"https://codeload.github.com/iamhankai/Versatile-Filters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245489762,"owners_count":20623789,"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","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":["convolutional-neural-networks","model-compression"],"created_at":"2024-10-29T17:24:36.839Z","updated_at":"2025-03-25T15:31:17.295Z","avatar_url":"https://github.com/iamhankai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Versatile Filters\r\n\r\nCode for paper: [Yunhe Wang, et al. Learning Versatile Filters for Efficient Convolutional Neural Networks (NeurIPS 2018)](https://papers.nips.cc/paper/7433-learning-versatile-filters-for-efficient-convolutional-neural-networks)\r\n\r\nThis paper introduces versatile filters to construct efficient convolutional neural network. A series of secondary filters can be derived from a primary filter. These secondary filters all inherit in the primary filter without occupying more storage, but once been unfolded in computation they could significantly enhance the capability of the filter by integrating information extracted from different receptive fields. Besides spatial versatile filters, we additionally investigate versatile filters from the channel perspective. The new techniques are general to upgrade filters in existing CNNs, which are able to achieve comparable accuracy as that of original filters, but require less memory and FLOPs.\r\n\r\n\u003cimg src=\"./fig/versatile.png\" width=\"500\" hegiht=\"180\" align=center /\u003e\u003cimg src=\"./fig/versatile2.png\" width=\"500\" hegiht=\"180\" align=center /\u003e\r\n\r\n\r\n### Files description\r\nPlatform: Pytorch 0.4\r\n\r\n`vcnn.py` is the implementation of Versatile Convolution (an example of VGG-16). The `VConv2d` class can be used to replace the `nn.Conv2d` in any CNN.\r\n\r\n`imagenet-vcnn.py` is the script for training ImageNet on Huawei Cloud DLS.\r\n\r\n### Getting Started\r\nRun `imagenet-vcnn.py` to train and test the model.\r\n\r\n- **Hyper-paprameters** in `VConv2d`:\r\n- `delta`: (c-\\hat{c}) in Eq.(6)\r\n- `g`: g in Eq.(6)\r\n\r\n### Performance\r\n- ImageNet Classification (code in this repo)\r\n\r\n| backbone | method                    | top1 acc (%) | top5 acc (%) |\r\n|--------|---------------------------|----------|----------|\r\n| VGG-16 | spatial versatile filters        | 72.2     | 91.1     |\r\n\r\n- COCO Object Detection using Faster R-CNN\r\n\r\n|Backbone|Memory (MB)|FLOPs (B)|mAP (%)|\r\n|-|-|-|-|\r\n|ResNet50|97.2|4.1|33.1|\r\n|Versatile-v1-ResNet50|75.6|3.2|33.0|\r\n|Versatile-v2-ResNet50|41.7|3.0|31.3|\r\n\r\n### Citation\r\nIf you use these models in your research, please cite:\r\n```\r\n@inproceedings{wang2018learning,\r\n  title={Learning versatile filters for efficient convolutional neural networks},\r\n  author={Wang, Yunhe and Xu, Chang and Chunjing, XU and Xu, Chao and Tao, Dacheng},\r\n  booktitle={Advances in Neural Information Processing Systems},\r\n  pages={1608--1618},\r\n  year={2018}\r\n}\r\n```\r\n\r\n### Contributing\r\nWe appreciate all contributions. If you are planning to contribute back bug-fixes, please do so without any further discussion.\r\n\r\nIf you plan to contribute new features, utility functions or extensions to the core, please first open an issue and discuss the feature with us. Sending a PR without discussion might end up resulting in a rejected PR, because we might be taking the core in a different direction than you might be aware of.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamhankai%2Fversatile-filters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamhankai%2Fversatile-filters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamhankai%2Fversatile-filters/lists"}