{"id":18322543,"url":"https://github.com/tencentarc/faig","last_synced_at":"2025-04-05T23:31:06.104Z","repository":{"id":43905889,"uuid":"422044659","full_name":"TencentARC/FAIG","owner":"TencentARC","description":"NeurIPS 2021, Spotlight, Finding Discriminative Filters for Specific Degradations in Blind Super-Resolution","archived":false,"fork":false,"pushed_at":"2022-12-15T07:37:40.000Z","size":3049,"stargazers_count":120,"open_issues_count":0,"forks_count":21,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-21T13:23:22.846Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/TencentARC.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}},"created_at":"2021-10-28T02:54:55.000Z","updated_at":"2025-01-02T08:41:56.000Z","dependencies_parsed_at":"2023-01-29T02:15:56.884Z","dependency_job_id":null,"html_url":"https://github.com/TencentARC/FAIG","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/TencentARC%2FFAIG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FFAIG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FFAIG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentARC%2FFAIG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TencentARC","download_url":"https://codeload.github.com/TencentARC/FAIG/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415783,"owners_count":20935383,"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-11-05T18:25:07.012Z","updated_at":"2025-04-05T23:31:03.437Z","avatar_url":"https://github.com/TencentARC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FAIG (NIPS 2021 Spotlight)\n\nThis paper aims at **investigating the mechanism underlying the unified one-branch blind SR network**.\n\u003cbr\u003e\nWe propose a new diagnostic tool – Filter Attribution method based on Integral Gradient (FAIG) that utilizes paths in the parameter space in attributing network functional alterations to filter changes.\n\n---\n### :book: Finding Discriminative Filters for Specific Degradations in Blind Super-Resolution\n\n\u003e [[Paper](https://openreview.net/pdf?id=az0BBDjDvwD)] \u0026emsp; [Project Page] \u0026emsp; [[Video](https://recorder-v3.slideslive.com/?share=52246\u0026s=fe236495-125a-44d7-9475-0907e5bf4e6e)] \u0026emsp; [B站] \u0026emsp; [[Poster](https://drive.google.com/file/d/1nWxje2HWXAibreJuzp2NM4PnsMUviaHE/view?usp=sharing)] \u0026emsp; [[PPT slides](https://docs.google.com/presentation/d/1DwO8cKCuveIpflzijPpWjyndmZqKLQhI/edit?usp=sharing\u0026ouid=113023682396793851067\u0026rtpof=true\u0026sd=true)]\u003cbr\u003e\n\u003e [Liangbin Xie](https://liangbinxie.github.io/), [Xintao Wang](https://xinntao.github.io/), [Chao Dong](https://scholar.google.com.hk/citations?user=OSDCB0UAAAAJ), [Zhongang Qi](https://scholar.google.com/citations?user=zJvrrusAAAAJ\u0026hl=en), [Ying Shan](https://scholar.google.com/citations?user=4oXBp9UAAAAJ\u0026hl=en) \u003cbr\u003e\n\u003e Tencent ARC Lab; Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/FAIG_teaser.jpg\"\u003e\n\u003c/p\u003e\n\nFor a blurry input (➀) and noisy input (➄), the one-branch SRResNet for blind SR could remove blur (➁) and noise (➅), respectively. When we mask the 1% deblurring filters (discovered by the proposed FAIG), the corresponding network function of deblurring is eliminated (➂) while the function of denoising is maintained (➆). Similar phenomenon happens (➃ and ➇) when we mask the 1% denoising filters in the same network.\n\n---\n\n## :wrench: Dependencies and Installation\n\n- Python \u003e= 3.7 (Recommend to use [Anaconda](https://www.anaconda.com/download/#linux) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html))\n- [PyTorch \u003e= 1.7](https://pytorch.org/)\n- Option: NVIDIA GPU + [CUDA](https://developer.nvidia.com/cuda-downloads)\n- Option: Linux\n\n### Installation\n1. Clone repo\n\n    ```bash\n    git clone https://github.com/xinntao/FAIG.git\n    cd FAIG\n    ```\n\n1. Install dependent packages\n\n    ```bash\n    # Install basicsr - https://github.com/xinntao/BasicSR\n    # We use BasicSR for both training and inference\n    pip install basicsr\n    pip install -r requirements.txt\n    python setup.py develop\n    ```\n\n\n## :european_castle: Model Zoo\n\nFor both *SRCNN_Style network* and *SRResNet network*, we provide baseline model and target model. Download them from the link below and put them to the `experiments` folder.\n- [SRCNN_Style](https://drive.google.com/drive/folders/153mRuXfDheNC0h3KnJsZRg8lB4ICWGZb?usp=sharing)\n- [SRResNet](https://drive.google.com/drive/folders/1AtUzV3ENY4vywZcoMpdvHoxAeI7OK7fQ?usp=sharing)\n\nYou can also find all models here: [[Tencent Cloud 腾讯微云](https://share.weiyun.com/FoclquZP)]\n\n## :zap: Quick Inference\n\nDownload the [neuron-search](https://drive.google.com/drive/folders/1At_f2tzFoGp62Nc2hrmuRU6eOlNpwNL-?usp=sharing) folder that contains the discovered filters (in descending order) by four different methods (FAIG, IG, \u003cimg src=\"https://latex.codecogs.com/svg.latex?|\\theta\u0026space;-\u0026space;\\bar\\theta)|\" title=\"|\\theta - \\bar\\theta)|\" /\u003e and random). Put it to the `results` folder. For each method, we provide the discovered filters for blur and noise degradation, respectively.\n\nBefore inference, please run the script to generate the degraded images.\n```bash\npython scripts/generate_lr.py\n```\n\n**Inference!**\n\nFor *SRCNN_Style* network\n```bash\npython analysis/Tools/srcnn_style/mask_neurons.py\n```\nFor *SRResNet* network\n```bash\npython analysis/Tools/srresnet/mask_neurons.py\n```\nThen you can find the results (saved in `results/Interpret/masking`) of masking discovered specific filters with four proportions(1%, 3%, 5% and 10%) by four methods.\n\u003cbr\u003e\nThe directory structure (*maskdenoiseFilter/Blur2_LRbicx2*) means that the **blurry input image** is inferenced by the model that is **masked deblurring filters** (we hope this model loses deblur function while contains denoise function).\n\nDescription/Usage of all the provided scripts can be found in [analysis.md](analysis.md).\n\n\n## :computer: Training\n\nWe provide the training codes for SRCNN_Style and SRResNet (used in our paper).\n\u003cbr\u003e\nOther simple combination of degradations (scale ratio, different blur type, different noise type) with different levels are also verified. You can try them by yourself~\n\n**Procedures**\n\nTake SRResNet as an example.\n1. Download the dataset: [DIV2K](http://data.vision.ee.ethz.ch/cvl/DIV2K/DIV2K_train_HR.zip)\n2. Crop to sub-images.\n    ```bash\n    python scripts/extract_subimages.py\n    ```\n3. [Optional] Create LMDB files.\n    ```bash\n    python scripts/create_lmdb.py --dataset DIV2K\n    ```\n4. Modify the configuration file `options/train_srresnet_baseline.yml` accordingly.\n5. Training the baseline model.\n\u003e python train.py -opt options/train_srresnet_baseline.yml\n6. After finishing the training of baseline model, training the target model.\n\u003e python train.py -opt options/train_srresnet_target.yml\n\n## :scroll: License and Acknowledgement\n\nFAIG is released under Apache License Version 2.0.\n\n## BibTeX\n\n    @inproceedings{xie2021finding,\n        title={Finding Discriminative Filters for Specific Degradations in Blind Super-Resolution},\n        author={Liangbin Xie and Xintao Wang and Chao Dong and Zhongang Qi and Ying Shan},\n        booktitle={{Advances in Neural Information Processing Systems (NeurIPS)}},\n        volume={34},\n        year={2021},\n    }\n\n## :e-mail: Contact\n\nIf you have any question, please email `lb.xie@siat.ac.cn`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentarc%2Ffaig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftencentarc%2Ffaig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentarc%2Ffaig/lists"}