# UBRFC-Net
**Repository Path**: lose_recall/ubrfc-net
## Basic Information
- **Project Name**: UBRFC-Net
- **Description**: Image Dehazing
- **Primary Language**: Python
- **License**: AFL-3.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-10-11
- **Last Updated**: 2023-10-25
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# UBRFC
Recently, the CycleGAN framework have been widely explored in image dehazing and obtained remarkable performance. However, during the training process of the dehazing method designed by CycleGAN, the input to the generator encompasses two distinct data distributions: the data in the dataset and the generated data, which can cause confusion in the learning of generator. Moreover, Squeeze and Excitation (SE) channel attention employs fully connected layers to capture global information but lacks interaction with distant local information, resulting in information loss and dilution. To solve the above problems, in this paper, we propose an Unsupervised Contrastive Bidirectional Reconstruction and Adaptive Fine-Grained Channel Attention Networks for Image Dehazing (UBRFC-Net). Specifically, a Unsupervised Contrastive Bidirectional Reconstruction Model (CBRM) is proposed to establish bidirectional reconstruction and bidirectional contrast constraints for implementing an unsupervised framework that avoids the generator in CycleGAN learning different distributions and improves the reconstruction capability. Furthermore, an Adaptive Fine-Grained Channel Attention (FCA) is developed to achieve fine-grained feature interaction between local and global channel information , enabling adaptive allocation of channel weights. Experimental results on challenging benchmark datasets demonstrate the superiority of our UBRFC-Net over state-of-the-art unsupervised image dehazing methods.
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
Contrastive Bidirectional Reconstruction Framework
Adaptive Fine-Grained Channel Attention
Unsupervised Contrastive Bidirectional Reconstruction and Adaptive Fine-Grained Channel Attention Networks for Image Dehazing
Exploring the documentation for UBRFC-Net »
Check Demo
·
Report Bug
·
Pull Request
## Contents
- [Dependencies](#dependences)
- [Filetree](#filetree)
- [Pretrained Model](#pretrained-weights-and-dataset)
- [Train](#train)
- [Test](#test)
- [Clone the repo](#clone-the-repo)
- [Qualitative Results](#qualitative-results)
- [Results on RESIDE-Outdoor Dehazing Challenge testing images:](#results-on-reside-outdoor-dehazing-challenge-testing-images)
- [Results on NTIRE 2021 NonHomogeneous Dehazing Challenge testing images:](#results-on-ntire-2021-nonhomogeneous-dehazing-challenge-testing-images)
- [Results on Dense Dehazing Challenge testing images:](#results-on-dense-dehazing-challenge-testing-images)
- [Results on Statehaze1k remote sensing Dehazing Challenge testing images:](#results-on-statehaze1k-remote-sensing-dehazing-challenge-testing-images)
- [Copyright](#copyright)
- [Thanks](#thanks)
### Dependences
1. Pytorch 1.8.0
2. Python 3.7.1
3. CUDA 11.7
4. Ubuntu 18.04
### Filetree
```
├─README.md
│
├─UBRFC
│ Attention.py
│ CR.py
│ Dataset.py
│ GAN.py
│ Get_image.py
│ Loss.py
│ Metrics.py
│ Option.py
│ Parameter.py
│ test.py
│ Util.py
│
├─images
│ Attention_00.png
│ Dense_00.png
│ framework_00.png
│ NH_00.png
│ Outdoor_00.png
│
└─LICENSE
```
### Pretrained Weights and Dataset
Download our model weights on Google: https://drive.google.com/drive/folders/1fyTzElUd5JvKthlf_1o4PTcoC0mm9ar-?usp=sharing
Download our test datasets on Google: https://drive.google.com/drive/folders/13Al-It-4srPW7YjS-Iajl54FEtgXNYRC?usp=sharing
### Train
```shell
python train.py --device 0 --train_root train_path --test_root test_path --batch_size 4
such as:
python train.py --device 0 --train_root /home/Datasets/Outdoor/train/ --test_root /home/Datasets/Outdoor/test/ --batch_size 4
```
### Test
```shell
python Get_image.py --device GUP_id --test_root test_path --pre_model_path model_path
such as:
python Get_image.py --device 0 --test_root /home/Dense_hazy/test/ --pre_model_path ./model/best_model.pth
```
### Clone the repo
```sh
git clone https://gitee.com/lose_recall/ubrfc-net.git
```
### Qualitative Results
#### Results on RESIDE-Outdoor Dehazing Challenge testing images
#### Results on NTIRE 2021 NonHomogeneous Dehazing Challenge testing images
#### Results on Dense Dehazing Challenge testing images
#### Results on Statehaze1k remote sensing Dehazing Challenge testing images
### Thanks
- [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet)
- [Img Shields](https://shields.io)
- [Choose an Open Source License](https://choosealicense.com)
- [GitHub Pages](https://pages.github.com)
[contributors-shield]: https://img.shields.io/github/contributors/Lose-Code/UBRFC-Net.svg?style=flat-square
[contributors-url]: https://github.com/Lose-Code/UBRFC-Net/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/Lose-Code/UBRFC-Net.svg?style=flat-square
[forks-url]: https://github.com/Lose-Code/UBRFC-Net/network/members
[stars-shield]: https://img.shields.io/github/stars/Lose-Code/UBRFC-Net.svg?style=flat-square
[stars-url]: https://github.com/Lose-Code/UBRFC-Net/stargazers
[issues-shield]: https://img.shields.io/github/issues/Lose-Code/UBRFC-Net.svg?style=flat-square
[issues-url]: https://img.shields.io/github/issues/Lose-Code/UBRFC-Net.svg
[license-shield]: https://img.shields.io/github/license/Lose-Code/UBRFC-Net.svg?style=flat-square
[license-url]: https://github.com/Lose-Code/UBRFC-Net/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
[linkedin-url]: https://linkedin.com/in/shaojintian