{"id":13499125,"url":"https://github.com/xxradon/IGCV3-pytorch","last_synced_at":"2025-03-29T04:30:30.281Z","repository":{"id":98716992,"uuid":"138134059","full_name":"xxradon/IGCV3-pytorch","owner":"xxradon","description":"IGCV3 reimplement by pytorch","archived":false,"fork":false,"pushed_at":"2018-06-21T07:25:22.000Z","size":581,"stargazers_count":19,"open_issues_count":4,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-31T17:39:15.513Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xxradon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-06-21T07:19:00.000Z","updated_at":"2022-04-25T10:27:38.000Z","dependencies_parsed_at":"2023-05-24T22:13:41.327Z","dependency_job_id":null,"html_url":"https://github.com/xxradon/IGCV3-pytorch","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/xxradon%2FIGCV3-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxradon%2FIGCV3-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxradon%2FIGCV3-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxradon%2FIGCV3-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xxradon","download_url":"https://codeload.github.com/xxradon/IGCV3-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140565,"owners_count":20729797,"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":[],"created_at":"2024-07-31T22:00:29.433Z","updated_at":"2025-03-29T04:30:29.999Z","avatar_url":"https://github.com/xxradon.png","language":"Python","funding_links":[],"categories":["Papers\u0026Codes","DLA"],"sub_categories":["IGCV3"],"readme":"# MobileNet-V2 and IGCV3\nAn implementation of `Google MobileNet-V2` and `IGCV3` introduced in PyTorch. \nLink to the original paper: [Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation](https://arxiv.org/abs/1801.04381),IGCV3: Interleaved Low-Rank Group Convolutions for Efficient Deep Neural Networks. Ke Sun, Mingjie Li, Dong Liu, and Jingdong Wang. \narXiv preprint [arXIV:1806.00178](https://arxiv.org/pdf/1806.00178.pdf) (2017)\n\nThis implementation was made to be an example of a common deep learning software architecture. It's simple and designed to be very modular. All of the components needed for training and visualization are added.\n\n# Only tested on  Cifar10 and Cifar100!!!!\n\n## Usage\nThis project uses Python 3 and PyTorch 0.3.1\n\n### Main Dependencies\n ```\n pytorch 0.3.1\n numpy \n tqdm \n easydict\n matplotlib \n tensorboardX \n ```\n\nInstall dependencies:\n```bash\npip install -r requirements.txt\n```\n\n### Train and Test\n1. Prepare your data, then create a dataloader class such as `cifar10data.py` and `cifar100data.py`.\n2. Create a .json config file for your experiments. Use the given .json config files as a reference.\n\n### Run\n```\npython main.py config/\u003cyour-config-json-file\u003e.json\n```\n\n### Experiments\nDue to the lack of computational power. I trained on CIFAR-10 dataset as an example to prove correctness, and was able to achieve test top1-accuracy of 90.9%.\n\n\n#### Tensorboard Visualization\nTensorboard is integrated with the project using `tensorboardX` library which proved to be very useful as there is no official visualization library in pytorch.\n\nYou can start it using:\n```bash\ntensorboard --logdir experimenets/\u003cconfig-name\u003e/summaries\n```\n\nThese are the learning curves for the CIFAR-10 experiment.\n\n# IGCV3:Interleaved Low-Rank Group Convolutions for Efficient Deep Neural Networks.\nThe codes are based on https://github.com/liangfu/mxnet-mobilenet-v2.\n\u003e  IGCV3: Interleaved Low-Rank Group Convolutions for Efficient Deep Neural Networks. Ke Sun, Mingjie Li, Dong Liu, and Jingdong Wang. \narXiv preprint [arXIV:1806.00178](https://arxiv.org/pdf/1806.00178.pdf) (2017)\n\n## Prior Works\n\n### Interleaved Group Convolutions ([IGCV1](https://arxiv.org/pdf/1707.02725.pdf))\nInterleaved Group Convolutions use a pair of two successive interleaved group convolutions: primary group convolution and secondary group convolution. The two group convolutions are complementary.\n\n![IGC](figures/igc_ori.png)\n\u003e  Illustrating the interleaved group convolution, with L = 2 primary partitions and M = 3 secondary partitions. The convolution for each primary partition in primary group convolution is spatial. The convolution for each secondary partition in secondary group convolution is point-wise (1 × 1).\n\nYou can find its code [here](https://github.com/hellozting/InterleavedGroupConvolutions)!\n\n### Interleaved Structured Sparse Convolution ([IGCV2](https://arxiv.org/pdf/1804.06202.pdf))\nIGCV2 extends IGCV1 by decomposing the convolution matrix in to more structured sparse matrices, which uses a depth-wise convoultion (3 × 3) to replace the primary group convoution in IGC and uses a series of point-wise group convolutions (1 × 1).\n\n\n## Interleaved Low-Rank Group Convolutions (IGCV3)\nWe proposes Interleaved Low-Rank Group Convolutions, named IGCV3, extend IGCV2 by using low-rank group convolutions to replace group convoutions in IGCV2. It consists of a channel-wise spatial convolution, a low-rank group convolution with \u003ca href=\"https://www.codecogs.com/eqnedit.php?latex=G_{2}\" target=\"_blank\"\u003e\u003cimg src=\"https://latex.codecogs.com/gif.latex?G_{1}\" title=\"G_{1}\" /\u003e\u003c/a\u003e groups that reduces the width and a low-rank group convolution with \u003ca href=\"https://www.codecogs.com/eqnedit.php?latex=G_{2}\" target=\"_blank\"\u003e\u003cimg src=\"https://latex.codecogs.com/gif.latex?G_{2}\" title=\"G_{2}\" /\u003e\u003c/a\u003e groups which expands the widths back.\n\n![IGCV3](figures/super_branch_2.PNG)\n\u003e  Illustrating the interleaved branches in IGCV3 block. The first group convolution is a group 1 × 1 convolution with \u003ca href=\"https://www.codecogs.com/eqnedit.php?latex=G_{2}\" target=\"_blank\"\u003e\u003cimg src=\"https://latex.codecogs.com/gif.latex?G_{1}\" title=\"G_{1}\" /\u003e\u003c/a\u003e=2 groups. The second is a channel-wise spatial convolution. The third is a group 1 × 1 convolution with \u003ca href=\"https://www.codecogs.com/eqnedit.php?latex=G_{2}\" target=\"_blank\"\u003e\u003cimg src=\"https://latex.codecogs.com/gif.latex?G_{2}\" title=\"G_{2}\" /\u003e\u003c/a\u003e=2 groups.\n\n## Results\n### CIFAR Experiments\nWe compare our IGCV3 network with other Mobile Networks on CIFAR datasets which illustrated our model' advantages on small dataset.\n#### Comparison with Other Mobile Networks\nClassification accuracy comparisons of MobileNetV2 and IGCV3 on CIFAR datasets. \"Network s×\" means reducing the number of parameter in \"Network 1.0×\" by s times.\n\u003ctable \u003e \n\u003ctr\u003e \u003cth width=250\u003e\u003c/th\u003e\u003cth\u003e#Params (M)\u003c/th\u003e \u003cth\u003eCIFAR-10\u003c/th\u003e \u003cth\u003e CIFAR100 \u003c/th\u003e \u003c/tr\u003e \n\u003ctr\u003e \u003cth\u003eMobileNetV2（our impl.）  \u003c/th\u003e\u003cth\u003e 2.3\u003c/th\u003e\u003cth\u003e94.56\u003c/th\u003e \u003cth\u003e77.09\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eIGCV3-D 0.5×  \u003c/th\u003e\u003cth\u003e 1.2\u003c/th\u003e\u003cth\u003e94.73\u003c/th\u003e \u003cth\u003e77.29\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eIGCV3-D 0.7× \u003c/th\u003e\u003cth\u003e 1.7\u003c/th\u003e\u003cth\u003e94.92\u003c/th\u003e \u003cth\u003e77.83\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eIGCV3-D 1.0× \u003c/th\u003e\u003cth\u003e 2.4\u003c/th\u003e\u003cth\u003e94.96\u003c/th\u003e \u003cth\u003e77.95\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eIGCV3-D 1.0×(my pytorch impl) \u003c/th\u003e\u003cth\u003e 2.4\u003c/th\u003e\u003cth\u003e94.70\u003c/th\u003e \u003cth\u003e75.96\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eMobileNetV2（my pytorch impl）  \u003c/th\u003e\u003cth\u003e 2.3\u003c/th\u003e\u003cth\u003e94.01\u003c/th\u003e \u003cth\u003e--\u003c/th\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n#### Comparison with IGCV2\n\u003ctable \u003e \n\u003ctr\u003e \u003cth width=100\u003e\u003c/th\u003e\u003cth\u003e#Params (M)\u003c/th\u003e \u003cth\u003eCIFAR-10\u003c/th\u003e \u003cth\u003e CIFAR100 \u003c/th\u003e \u003c/tr\u003e \n\u003ctr\u003e \u003cth\u003eIGCV2 \u003c/th\u003e\u003cth\u003e 2.4\u003c/th\u003e\u003cth\u003e94.76\u003c/th\u003e \u003cth\u003e77.45\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eIGCV3-D \u003c/th\u003e\u003cth\u003e 2.4\u003c/th\u003e\u003cth\u003e94.96\u003c/th\u003e \u003cth\u003e77.95\u003c/th\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n### ImageNet Experiments\nComparison with MobileNetV2 on ImageNet.\n#### Before Retrain\n\u003ctable \u003e \n\u003ctr\u003e \u003cth width=100\u003e\u003c/th\u003e\u003cth\u003e#Params (M)\u003c/th\u003e \u003cth\u003eTop-1\u003c/th\u003e \u003cth\u003eTop-5\u003c/th\u003e \u003c/tr\u003e \n\u003ctr\u003e \u003cth\u003eMobileNetV2 \u003c/th\u003e\u003cth\u003e 3.4\u003c/th\u003e\u003cth\u003e70.0\u003c/th\u003e \u003cth\u003e89.0\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eIGCV3-D \u003c/th\u003e\u003cth\u003e 3.5\u003c/th\u003e\u003cth\u003e70.6\u003c/th\u003e \u003cth\u003e89.7\u003c/th\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n#### After Retrain\n\u003ctable \u003e \n\u003ctr\u003e \u003cth width=100\u003e\u003c/th\u003e\u003cth\u003e#Params (M)\u003c/th\u003e \u003cth\u003eTop-1\u003c/th\u003e \u003cth\u003eTop-5\u003c/th\u003e \u003c/tr\u003e \n \u003ctr\u003e \u003cth\u003eMobileNetV2 \u003c/th\u003e\u003cth\u003e 3.4\u003c/th\u003e\u003cth\u003e71.4\u003c/th\u003e \u003cth\u003e90.1\u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e \u003cth\u003eIGCV3-D \u003c/th\u003e \u003cth\u003e 3.5\u003c/th\u003e \u003cth\u003e72.2\u003c/th\u003e \u003cth\u003e90.5\u003c/th\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n\n\n# The code is maily from [IGCV3](https://github.com/homles11/IGCV3) and [MobilenetV2](https://github.com/MG2033/MobileNet-V2).Thanks for their contribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxradon%2FIGCV3-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxxradon%2FIGCV3-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxradon%2FIGCV3-pytorch/lists"}