In this paper, we explore the role of Instance Normalization in low-level vision tasks. Specifically, we present a novel block: Half Instance Normalization Block (HIN Block), to boost the performance of image restoration networks. Based on HIN Block, we design a simple and powerful multi-stage network named HINet, which consists of two subnetworks. With the help of HIN Block, HINet surpasses the state-of-the-art (SOTA) on various image restoration tasks. For image denoising, we exceed it 0.11dB and 0.28 dB in PSNR on SIDD dataset, with only 7.5% and 30% of its multiplier-accumulator operations (MACs), 6.8 times and 2.9 times speedup respectively. For image deblurring, we get comparable performance with 22.5% of its MACs and 3.3 times speedup on REDS and GoPro datasets. For image deraining, we exceed it by 0.3 dB in PSNR on the average result of multiple datasets with 1.4 times speedup. With HINet, we won 1st place on the NTIRE 2021 Image Deblurring Challenge - Track2. JPEG Artifacts, with a PSNR of 29.70.
2022.04.12 Our new work, Simple Baselines for Image Restoration reveals the nonlinear activation functions, e.g. ReLU, GELU, Sigmoid, and etc. are not necessary to achieve SOTA performance. The paper provide a simple baseline, NAFNet: Nonlinear Activation Free Network for Image Restoration tasks, and acheves SOTA performance on Image Denoising and Image Deblurring. The paper and the code are available at https://arxiv.org/abs/2204.04676 / https://github.com/megvii-research/NAFNet respectively.
2021.12.10 Our new work, Revisiting Global Statistics Aggregation for Improving Image Restoration, exceeds the previous SOTA restorers 0.6 dB (GoPro dataset) without re-train the model. It is accomplished by revealing the feature distribution shifts issue from training phase to testing phase. The paper and the code are available at https://arxiv.org/abs/2112.04491 / https://github.com/megvii-research/tlsc respectively.
This implementation based on BasicSR which is a open source toolbox for image/video restoration tasks.
python 3.6.9
pytorch 1.5.1
cuda 10.1
git clone https://github.com/megvii-model/HINet
cd HINet
pip install -r requirements.txt
python setup.py develop --no_cuda_ext
python basicsr/demo.py -opt options/demo/demo.yml
Image denoise, deblur, derain.
prepare data
mkdir ./datasets/SIDD
download the [train]( SIDD-Medium sRGB Dataset in https://www.eecs.yorku.ca/~kamel/sidd/dataset.php) set and unzip it. Then move Data (./SIDD_Medium_Srgb/Data) set to ./datasets/SIDD/ . Download val files (ValidationNoisyBlocksSrgb.mat and ValidationGtBlocksSrgb.mat) in ./datasets/SIDD/ .
it should be like:
./datasets/SIDD/Data
./datasets/SIDD/ValidationNoisyBlocksSrgb.mat
./datasets/SIDD/ValidationGtBlocksSrgb.mat
python scripts/data_preparation/sidd.py
eval
python basicsr/test.py -opt options/test/SIDD/HINet-SIDD-0.5x.yml (HINet-SIDD-1x.yml)
train
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4321 basicsr/train.py -opt options/train/SIDD/HINet.yml(HINet_0.5x.yml) --launcher pytorch
prepare data
mkdir ./datasets/GoPro
download the train set in ./datasets/GoPro/train and test set in ./datasets/GoPro/test (refer to MPRNet)
it should be like:
./datasets/
./datasets/GoPro/
./datasets/GoPro/train/
./datasets/GoPro/train/input/
./datasets/GoPro/train/target/
./datasets/GoPro/test/
./datasets/GoPro/test/input/
./datasets/GoPro/test/target/
python scripts/data_preparation/gopro.py
eval
python basicsr/test.py -opt options/test/GoPro/HINet-GoPro.yml
train
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4321 basicsr/train.py -opt options/train/GoPro/HINet.yml --launcher pytorch
prepare data
mkdir ./datasets/REDS
download the train / val set from train_blur, train_sharp, val_blur, val_sharp to ./datasets/REDS/ and unzip them.
it should be like
./datasets/
./datasets/REDS/
./datasets/REDS/val/
./datasets/REDS/val/val_blur_jpeg/
./datasets/REDS/val/val_sharp/
./datasets/REDS/train/
./datasets/REDS/train/train_blur_jpeg/
./datasets/REDS/train/train_sharp/
python scripts/data_preparation/reds.py
eval
python basicsr/test.py -opt options/test/REDS/HINet-REDS.yml
train
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4321 basicsr/train.py -opt options/train/REDS/HINet.yml --launcher pytorch
prepare data
mkdir ./datasets/Rain13k
it should be like
./datasets/
./datasets/Rain13k/
./datasets/Rain13k/train/
./datasets/Rain13k/train/input/
./datasets/Rain13k/train/target/
./datasets/Rain13k/test/
./datasets/Rain13k/test/Test100/
./datasets/Rain13k/test/Rain100H/
./datasets/Rain13k/test/Rain100L/
./datasets/Rain13k/test/Test2800/
./datasets/Rain13k/test/Test1200/
eval
download pretrained model to ./experiments/pretrained_models/HINet-Rain13k.pth
For Test100:
python basicsr/test.py -opt options/test/Rain13k/HINet-Test100.yml
For Rain100H
python basicsr/test.py -opt options/test/Rain13k/HINet-Rain100H.yml
For Rain100L
python basicsr/test.py -opt options/test/Rain13k/HINet-Rain100L.yml
For Test2800
python basicsr/test.py -opt options/test/Rain13k/HINet-Test2800.yml
For Test1200
python basicsr/test.py -opt options/test/Rain13k/HINet-Test1200.yml
train
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4321 basicsr/train_rain.py -opt options/train/Rain13k/HINet.yml --launcher pytorch
Some of the following results are higher than the original paper as we optimized some hyper-parameters.
This project is under the MIT license, and it is based on BasicSR which is under the Apache 2.0 license.
If HINet helps your research or work, please consider citing HINet.
@InProceedings{Chen_2021_CVPR,
author = {Chen, Liangyu and Lu, Xin and Zhang, Jie and Chu, Xiaojie and Chen, Chengpeng},
title = {HINet: Half Instance Normalization Network for Image Restoration},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
month = {June},
year = {2021},
pages = {182-192}
}
If you have any questions, please contact chenliangyu@megvii.com or luxin@megvii.com .
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。