{"id":18365853,"url":"https://github.com/zhanghang1989/torch-encoding-layer","last_synced_at":"2025-06-15T16:09:46.650Z","repository":{"id":91789231,"uuid":"75224199","full_name":"zhanghang1989/Torch-Encoding-Layer","owner":"zhanghang1989","description":"Deep Texture Encoding Network","archived":false,"fork":false,"pushed_at":"2020-12-21T04:01:09.000Z","size":149,"stargazers_count":93,"open_issues_count":3,"forks_count":28,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T16:39:42.804Z","etag":null,"topics":["computer-vision","deep-learning","deep-neural-networks","encoding","texture"],"latest_commit_sha":null,"homepage":"http://zhanghang1989.github.io/DeepEncoding/","language":"Lua","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/zhanghang1989.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}},"created_at":"2016-11-30T20:26:04.000Z","updated_at":"2024-11-02T06:37:21.000Z","dependencies_parsed_at":"2023-04-03T17:47:17.549Z","dependency_job_id":null,"html_url":"https://github.com/zhanghang1989/Torch-Encoding-Layer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zhanghang1989/Torch-Encoding-Layer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FTorch-Encoding-Layer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FTorch-Encoding-Layer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FTorch-Encoding-Layer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FTorch-Encoding-Layer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhanghang1989","download_url":"https://codeload.github.com/zhanghang1989/Torch-Encoding-Layer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhanghang1989%2FTorch-Encoding-Layer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260005993,"owners_count":22944867,"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":["computer-vision","deep-learning","deep-neural-networks","encoding","texture"],"created_at":"2024-11-05T23:14:53.714Z","updated_at":"2025-06-15T16:09:46.624Z","avatar_url":"https://github.com/zhanghang1989.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep Encoding\nCreated by [Hang Zhang](http://hangzh.com/)\n\n### Table of Contents\n0. [Introduction](#introduction)\n0. [Installation](#installation)\n0. [Experiments](#experiments)\n0. [Benchmarks](#benchmarks)\n0. [Acknowldgements](#acknowldgements)\n\n## Introduction\n- **Please checkout our [PyTorch implementation](https://github.com/zhanghang1989/PyTorch-Encoding) (recommended, memory efficient)**. \n\n- This repo is a Torch implementation of Encoding Layer as described in the paper:\n\n**Deep TEN: Texture Encoding Network** [[arXiv]](https://arxiv.org/pdf/1612.02844.pdf)  \n  [Hang Zhang](http://hangzh.com/), [Jia Xue](http://jiaxueweb.com/), [Kristin Dana](http://eceweb1.rutgers.edu/vision/dana.html)\n```\n@article{zhang2016deep,\n  title={Deep TEN: Texture Encoding Network},\n  author={Zhang, Hang and Xue, Jia and Dana, Kristin},\n  journal={arXiv preprint arXiv:1612.02844},\n  year={2016}\n}\n```\n\n\u003cdiv style=\"text-align:center\"\u003e\u003cimg src =\"https://raw.githubusercontent.com/zhanghang1989/Deep-Encoding/master/images/compare3.png\" width=\"500\" /\u003e\u003c/div\u003e\t\n\n Traditional methods such as bag-of-words BoW (left) have a structural similarity to more recent FV-CNN methods (center). Each component is optimized in separate steps. In our approach (right) the entire pipeline is learned in an integrated manner, tuning each component for the task at hand (end-to-end texture/material/pattern recognition).\n\n\n## Installation\nOn Linux\n```bash\nluarocks install https://raw.githubusercontent.com/zhanghang1989/Deep-Encoding/master/deep-encoding-scm-1.rockspec\n```\nOn OSX\n```bash\nCC=clang CXX=clang++ luarocks install https://raw.githubusercontent.com/zhanghang1989/Deep-Encoding/master/deep-encoding-scm-1.rockspec\n```\n## Experiments\n- The Joint Encoding experiment in Sec4.2 will execute by default (tested using 1 Titan X GPU). This achieves *12.89%* percentage error on STL-10 dataset, which is ***49.8%*** relative improvement comparing to pervious state-of-the art *25.67%* of Zhao *et. al. 2015*.:\n  ```bash\n  git clone https://github.com/zhanghang1989/Deep-Encoding\n  cd Deep-Encoding/experiments\n  th main.lua\n  ```\n- Training Deep-TEN on MINC-2500 in Sec4.1 using 4 GPUs. \n\t\n\t0. Please download the pre-trained\n[ResNet-50](https://d2j0dndfm35trm.cloudfront.net/resnet-50.t7) Torch model \nand the [MINC-2500](http://opensurfaces.cs.cornell.edu/static/minc/minc-2500.tar.gz) dataset to ``minc`` folder before executing the program (tested using 4 Titan X GPUs).\n\t```bash\n\tth main.lua -retrain resnet-50.t7 -ft true \\\n\t-netType encoding -nCodes 32 -dataset minc \\\n\t-data minc/ -nClasses 23 -batchSize 64 \\\n\t-nGPU 4 -multisize true\n\t```\n\t\n\t0. To get comparable results using 2 GPUs, you should change the batch size and the corresponding learning rate:\n  ```bash\n\tth main.lua -retrain resnet-50.t7 -ft true \\\n\t-netType encoding -nCodes 32 -dataset minc \\\n\t-data minc/ -nClasses 23 -batchSize 32 \\\n\t-nGPU 2 -multisize true -LR 0.05\\\n\t```\n\t\t\n### Benchmarks\nDataset                      |MINC-2500| FMD | GTOS | KTH |4D-Light\n:----------------------------|:-------:|:---:|:----:|:---:|:------:\nFV-SIFT                      |46.0     |47.0 |65.5  |66.3 |58.4\nFV-CNN(VD)                   |61.8     |75.0 |77.1  |71.0 |70.4\nFV-CNN(VD) \u003csub\u003emulti\u003csub\u003e   |63.1     |74.0 |79.2  |77.8 |76.5 \nFV-CNN(ResNet)\u003csub\u003emulti\u003csub\u003e|69.3     |78.2 |77.1  |78.3 |77.6\nDeep-TEN\\*(**ours**) |**81.3**|80.2\u003csub\u003e±0.9\u003csub\u003e|**84.5\u003csub\u003e±2.9\u003csub\u003e**|**84.5\u003csub\u003e±3.5\u003csub\u003e**|**81.7\u003csub\u003e±1.0\u003csub\u003e**\nState-of-the-Art             |76.0\u003csub\u003e±0.2\u003csub\u003e|**82.4\u003csub\u003e±1.4\u003csub\u003e**| 81.4|81.1\u003csub\u003e±1.5\u003csub\u003e|77.0\u003csub\u003e±1.1\u003csub\u003e\n\n### Acknowldgements\nWe thank Wenhan Zhang from Physics department, Rutgers University for discussions of mathematic models. \nThis work was supported by National Science Foundation award IIS-1421134. \nA GPU used for this research was donated by the NVIDIA Corporation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghang1989%2Ftorch-encoding-layer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhanghang1989%2Ftorch-encoding-layer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhanghang1989%2Ftorch-encoding-layer/lists"}