Code Monkey home page Code Monkey logo

mhnet's Introduction

Mixed Hierarchy Network for Image Restoration

paper


Abstract: Image restoration is a long-standing low-level vision problem, e.g., deblurring and deraining. In the process of image restoration, it is necessary to consider not only the spatial details and contextual information of restoration to ensure the quality but also the system complexity. Although many methods have been able to guarantee the quality of image restoration, the system complexity of the state-of-the-art (SOTA) methods is increasing as well. Motivated by this, we present a mixed hierarchy network that can balance these competing goals. Our main proposal is a mixed hierarchy architecture, that progressively recovers contextual information and spatial details from degraded images while we use simple blocks to reduce system complexity. Specifically, our model first learns the contextual information at the lower hierarchy using encoder-decoder architectures, and then at the higher hierarchy operates on full-resolution to retain spatial detail information. Incorporating information exchange between different hierarchies is a crucial aspect of our mixed hierarchy architecture. To achieve this, we design an adaptive feature fusion mechanism that selectively aggregates spatially-precise details and rich contextual information. In addition, we propose a selective multi-head attention mechanism with linear time complexity as the middle block of the encoder-decoder to adaptively retain the most crucial attention scores. What's more, we use the nonlinear activation free block as our base block to reduce the system complexity. The resulting tightly interlinked hierarchy architecture, named as MHNet, delivers strong performance gains on several image restoration tasks, including image deraining, and deblurring.

Network Architecture

Overall Framework of MHNet

(a) Encoder-decoder subnetwork. (b) Selective multi-head attention mechanism (SMAM) (c) The architecture of nonlinear activation free block (NAFBlock). (d) Simplified Channel Attention (SCA).

(a) The architecture of nonlinear activation free block groups (NAFG). Each NAFG further contains multiple nonlinear activation free blocks (NAFBlocks). (b) Adaptive feature fusion mechanism (AFFM) between an encoder-decoder subnetwork and FRSNet.

Our code will be released after the paper is published

Installation

The model is built in PyTorch 1.1.0 and tested on Ubuntu 16.04 environment (Python3.7, CUDA9.0, cuDNN7.5).

For installing, follow these intructions

conda create -n pytorch1 python=3.7
conda activate pytorch1
conda install pytorch=1.1 torchvision=0.3 cudatoolkit=9.0 -c pytorch
pip install matplotlib scikit-image opencv-python yacs joblib natsort h5py tqdm

Install warmup scheduler

cd pytorch-gradual-warmup-lr; python setup.py install; cd ..

Training and Evaluation

Training and Testing codes for deblurring and deraining are provided in their respective directories.

Citations

If our code helps your research or work, please consider citing our paper. The following is a BibTeX reference:

@article{gao2023mixed,
  title={Mixed Hierarchy Network for Image Restoration},
  author={Gao, Hu and Dang, Depeng},
  journal={arXiv preprint arXiv:2302.09554},
  year={2023}
}


Contact

Should you have any question, please contact [email protected]

mhnet's People

Contributors

tombs98 avatar

Stargazers

Jeff Carpenter avatar  avatar Ayan Ahmad avatar WBC-ML avatar  avatar Akif avatar  avatar Xiaoqi_ avatar  avatar bigzhang avatar LxDamon avatar wenwen avatar  avatar wangli avatar  avatar Aletheia Cheng avatar  avatar  avatar  avatar seaman avatar  avatar musicrainie avatar  avatar  avatar  avatar Zhifeng avatar  avatar Ioannis Tsampras avatar  avatar

Watchers

 avatar  avatar

Forkers

venonary

mhnet's Issues

about train

File "I:\yh\code\MHNet-main\Derain\train.py", line 31, in
from MHNet import MHNet
ModuleNotFoundError: No module named 'MHNet'

请问这个问题怎么解决

train problem

when I was training your code, I found the loss value became the nan. And the PSNR value also became the nan. Moreover, the best model didn't change after the 10 epoch.
Could you provide the completed train code or help me to solve this problem? Thank you sincerely!

Loss function during training

Hello,

I hope you’re doing well. I have a question regarding the training process described in your article. I followed the instructions and started training the model, but I noticed that the loss function initially becomes negative instead of positive. I’m not sure if this is expected or if there might be an error in my implementation.

I have carefully reviewed the documentation and double-checked my code, but I haven’t been able to find a solution. Could you please help me understand if a negative loss value at the beginning of the training process is correct or not?

Thank you so much for your time and expertise.

training time

Your work has been incredibly helpful to me, and I am very grateful. I was wondering if you could provide some information on the expected training time and required computing resources for the model. I would greatly appreciate it!

Loss function

Your article has been especially helpful to me,However, it seems that CharbonnierLoss and EdgeLoss that you defined in loss.py are not reflected in train.py.
We look forward to hearing from you soon~~

模型的输出

您好,我对您的模型很感兴趣,在使用时有个疑问,MHN的输出是return [stage2_img + x3_img, x_s1],使用这个输出和使用单个的输出相比,是会有一些优势吗

pre-trained model

Hello, thank you for your interesting work. Can you publish the pre-trained model for testing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.