Code Monkey home page Code Monkey logo

u-shape_transformer_for_underwater_image_enhancement's Introduction

U-shape Transformer

arXiv issues forks stars license

This repository is the official PyTorch implementation of U-shape Transformer for Underwater Image Enhancement. (arxiv, Dataset(lsui), video demo, visual results). U-shape Transformer achieves state-of-the-art performance in underwater image enhancement task.


🚀 🚀 🚀 News:

  • 2021/11/25 We released our pretrained model, You can download the pretrain models in BaiduYun with the password tdg9 or in Google Drive.

  • 2021/11/24 We released the official code of U-shape Transformer

  • 2021/11/23 We released LSUI dataset, We released a large-scale underwater image (LSUI) dataset, which involves richer underwater scenes (lighting conditions, water types and target categories) and better visual quality reference images than the existing ones. You can download it from [here](lsui) or GoogleDrive.

    avatar


The light absorption and scattering of underwater impurities lead to poor underwater imaging quality. The existing data-driven based underwater image enhancement (UIE) techniques suffer from the lack of a large-scale dataset containing various underwater scenes and high-fidelity reference images. Besides, the inconsistent attenuation in different color channels and space areas is not fully considered for boosted enhancement. In this work, we constructed a large-scale underwater image (LSUI) dataset , and reported an U-shape Transformer network where the transformer model is for the first time introduced to the UIE task. The U-shape Transformer is integrated with a channel-wise multi-scale feature fusion transformer (CMSFFT) module and a spatial-wise global feature modeling transformer (SGFMT) module, which reinforce the network's attention to the color channels and space areas with more serious attenuation. Meanwhile, in order to further improve the contrast and saturation, a novel loss function combining RGB, LAB and LCH color spaces is designed following the human vision principle. The extensive experiments on available datasets validate the state-of-the-art performance of the reported technique with more than 2dB superiority.

Contents

  1. Training
  2. Testing
  3. Results
  4. Citation
  5. License and Acknowledgement

Training

If you need to train our U-shape transformer from scratch, you need to download our dataset from BaiduYun(password is lsui) or GoogleDrive, and then randomly select 3879 picture pairs as the training set to replace the data folder, and the remaining 400 as the test set to replace the test folder. The dataset divided by the author can be downloaded from BaiduYun(password is lsui).

Then, run the train.ipynb file with Jupiter notebook, and the trained model weight file will be automatically saved in saved_ Models folder. As described in the paper, we recommend you use L2 loss for the first 600 epochs and L1 loss for the last 200 epochs.

Environmental requirements:

  • Python 3.7 or a newer version

  • Pytorch 1.7 0r a newer version

  • CUDA 10.1 or a newer version

  • OpenCV 4.5.3 or a newer version

  • Jupyter Notebook

Or you can install from the requirements.txt using

pip install -r requirements.txt

Testing

For your convenience, we provide some example datasets (~20Mb) in ./test. You can download the pretrain models in BaiduYun with the password tdg9 or in Google Drive.

After downloading, extract the pretrained model into the project folder and replace the ./saved_models folder, and then run test.ipynb. The code will use the pretrained model to automatically process all the images in the ./test/input folder and output the results to the ./test/output folder. In addition, the output result will automatically calculate the PSNR value with the reference image.

Dataset

The LSUI is a large-scale underwater image (LSUI) dataset, which involves richer underwater scenes (lighting conditions, water types and target categories) and better visual quality reference images than the existing ones. You can download it from BaiduYun(password is lsui) or GoogleDrive. If you want to use the LSUI dataset, please cite our [paper]

Results

We achieved state-of-the-art performance on underwater image enhancement task. Detailed results can be found in the paper or our project page

Full-Reference Evaluation (click me)

Non-reference Evaluation

Citation

@ARTICLE{10129222,
  author={Peng, Lintao and Zhu, Chunli and Bian, Liheng},
  journal={IEEE Transactions on Image Processing}, 
  title={U-Shape Transformer for Underwater Image Enhancement}, 
  year={2023},
  volume={32},
  number={},
  pages={3066-3079},
  doi={10.1109/TIP.2023.3276332}}

License and Acknowledgement

This project is released under the MIT license. The codes are designed based on pix2pix. We also refer to codes in UCTransNet and TransBTS. Please also follow their licenses. Thanks for their awesome works.

u-shape_transformer_for_underwater_image_enhancement's People

Contributors

lintaopeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

u-shape_transformer_for_underwater_image_enhancement's Issues

Dataset

Hello!
Is it possible for you to share the dataset to be used only for academic purposes?
Cheers

How to enhance 1920 x 1080 size image

Hi, I am a newbie, can I output in 1920*1080 images with the weights you provided?
I tried to split the images into 256 x 256 size squares and enhanced it. Then combined them back to output image
combined_image
It looks like this and my input image looks like this
6

数据集数量问题

你好,LSUI的数据集是更新过吗,看有些论文写着是5004张。请问可以提供5004张的数据集吗?

训练时候的问题

请问网络训练总共需要多长时间,因为在transformer模块会涉及图像拼接,会不会出现棋盘效应呢?

LSUI dataset download

I would like to explore the LSUI dataset, but I cannot figure out a way to download it. Please let me know the steps for downloading it.

测试结果

请问为什么我按照您的要求来操作测试的结果差距还挺大,psnr能测试高点但是我的SSIM测试的结果却很低

about UIQM and UCIQE

您好,我使用您的计算UIQM和UCIQE的代码在UIEB无参照的60张图片上进行了计算,即您的论文 TABLE IV 中的第一行,但是计算的结果和论文的结果差异巨大,请问是我有什么参数或者细节弄错了吗?计算的代码是您项目中的 .ipynb_checkpoints/test_无参考-checkpoint.ipynb

UIEB数据集划分

您好,我看到您在论文中报告了UIEB相关指标,这个数据集没有官方的训练集和测试集的划分,我像请问您是如何划分的数据集呢?在您论文中,其他算法的结果是您自己在您划分的数据集上跑了一下,还是怎么得到的呢?

数据集

您好,感谢您和您团队的贡献。能否将您训练和测试使用的数据集发我一份呢?我的邮箱是:[email protected].
祝:科研进步,身体健康。

Training Strategy.

Why is it suggested to train the first 600 epochs with L2 and the last 200 with L1?

UCIQE和UIQM的实现代码

这真是一个非常棒的工作!对水下图像的增强效果很好。请问可以提供一下UCIQE和UIQM的实现代码吗?如果可以,学生感激不尽

LSUI数据集分享

你的LSUI数据集下载连接中只有raw和GT,能否上传完整的数据(包括传输图和语义分割图)呢

数据集下载

您好,请问 LSUI 数据集下载的百度网盘提取码是什么。我已经发送邮件了,但还未收到回复

Conflict Between modules

I Tried installing scikit-image still facing no module

ModuleNotFoundError Traceback (most recent call last)
Cell In[15], line 16
14 from net.Ushape_Trans import *
15 #from dataset import prepare_data, Dataset
---> 16 from net.utils import *
17 import cv2
18 import matplotlib.pyplot as plt
3 import torch.nn as nn
4 import numpy as np
----> 5 from skimage.measure.simple_metrics import compare_psnr
6 from torchvision import models
9 def weights_init_kaiming(m):

ModuleNotFoundError: No module named 'skimage.measure.simple_metrics'

训练集

请问您划分的训练和测试的真实数据在哪里呢

数据库

请问您发布的数据库来自多个已有的数据集,是否还能将UIEB,EUVP作为测试集呢?

pre-trained model

can you provide the pre-trained model by Train-U and test dataset including Test-L504 and Test-U90?

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.