Git Product home page Git Product logo

cuiziteng / iccv_maet Goto Github PK

View Code? Open in Web Editor NEW
136.0 1.0 13.0 3.01 MB

🌕 [ICCV 2021] Multitask AET with Orthogonal Tangent Regularity for Dark Object Detection. A self-supervised learning way for low-light image object detection.

License: Apache License 2.0

Python 99.83% Shell 0.13% Dockerfile 0.04%
low-light-image low-light-image-enhancement low-light-vision object-detection pytorch low-light-enhance self-supervised-learning deep-learning iccv2021

iccv_maet's Introduction

(ICCV 2021) Multitask AET with Orthogonal Tangent Regularity for Dark Object Detection (paper) (supp) (zhihu中文解读)

Abstract

Dark environment becomes a challenge for computer vision algorithms owing to insufficient photons and undesirable noise. To enhance object detection in a dark environment, we propose a novel multitask auto encod- ing transformation (MAET) model which is able to explore the intrinsic pattern behind illumination translation. In a self-supervision manner, the MAET learns the intrinsic visual structure by encoding and decoding the realistic illumination-degrading transformation considering the physical noise model and image signal processing (ISP). Based on this representation, we achieve the object detection task by decoding the bounding box coordinates and classes. To avoid the over-entanglement of two tasks, our MAET disentangles the object and degrad- ing features by imposing an orthogonal tangent regularity. This forms a parametric manifold along which multi-task predictions can be geometrically formulated by maximizing the orthogonality between the tangents along the outputs of respective tasks. Our framework can be implemented based on the mainstream object detection ar- chitecture and directly trained end-to-end using normal target detection datasets, such as VOC and COCO. We have achieved the state-of-the-art performance using synthetic and real-world datasets.

When Human Vision Meets Machine Vision (compare with enhancement methods):

Physics-based low-light degrading transformation (unprocess -- degradation -- ISP):

Enviroment

python 3.7
pytorch 1.6.0
mmcv 1.1.5 (for example CUDA10.1 and torch 1.6.0: pip install mmcv-full==1.1.5 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html, detail see: https://github.com/open-mmlab/mmcv)
matplotlib opencv-python Pillow tqdm scipy

Pre-trained Model

dataset model size logs
MAET-COCO (ours) 80 class (google drive) (baiduyun, passwd:1234) 489.10 MB -
MAET-EXDark (ours) (77.7) 20 class (google drive) (baiduyun, passwd:1234) 470.26 MB google drive
EXDark (76.8) 20 class (google drive) (baiduyun, passwd:1234) 470.26 MB -
EXDark (MBLLEN) (76.3) 20 class (google drive) (baiduyun, passwd:1234) 470.26 MB -
EXDark (Kind) (76.3) 20 class (google drive) (baiduyun, passwd:1234) 470.26 MB -
EXDark (Zero-DCE) (76.9) 20 class (google drive) (baiduyun, passwd:1234) 470.26 MB -
MAET-UG2-DarkFace (ours) (56.2) 1 class (google drive) (baiduyun, passwd:1234) 469.81 MB -

Pre-process

Step-1:

For MS COCO Dataset (Use for Pre-train): Download COCO 2017 dataset.

For EXDark Dataset (Use for Fine-tune and Evaluation): Download EXDark (include EXDark enhancement by MBLLEN, Zero-DCE, KIND) in VOC format from google drive or baiduyun, passwd:1234. The EXDark dataset should be look like:

EXDark
│      
│
└───JPEGImages
│   │───IMGS (original low light)
│   │───IMGS_Kind (imgs enhancement by [Kind, mm2019])
│   │───IMGS_ZeroDCE (imgs enhancement by [ZeroDCE, cvpr 2020])
│   │───IMGS_MEBBLN (imgs enhancement by [MEBBLN, bmvc 2018])
│───Annotations   
│───main
│───label

For UG2-DarkFace Dataset (Use for Fine-tune and Evaluation): Download UG2 in VOC format from google drive or baiduyun, passwd:1234. The UG2-DarkFace dataset should be look like:

UG2
│      
└───main
│───xml  
│───label
│───imgs

Step-2: Cd in "your_project_path", and do set-up process (see mmdetection if you want find details):

git clone [email protected]:cuiziteng/ICCV_MAET.git
cd "your project path"
pip install -r requirements/build.txt
pip install -v -e .  # or "python setup.py develop"

Step-3: Change the data place line1 and line2 to your own COCO and EXDark path, and line3 to your own UG2-DarkFace path.

Testing

Testing MAET-YOLOV3 on (low-light) COCO dataset

python tools/test.py configs/MAET_yolo/maet_yolo_coco_ort.py [COCO model path] --eval bbox --show-dir [save dir]

Testing MAET-YOLOV3 on EXDark dataset

python tools/test.py configs/MAET_yolo/maet_yolo_exdark.py  [EXDark model path] --eval mAP --show-dir [save dir]

Testing MAET-YOLOV3 on UG2-DarkFace dataset

python tools/test.py configs/MAET_yolo/maet_yolo_ug2.py [UG2-DarkFace model path] --eval mAP --show-dir [save dir]

Comparative Experiment
Testing YOLOV3 on EXDark dataset enhancement by MEBBLN/ Kind/ Zero-DCE

python tools/test.py configs/MAET_yolo/yolo_mbllen.py (yolo_kind.py, yolo_zero_dce.py)  [MEBBLN/ Kind/ Zero-DCE model] --eval mAP --show-dir [save dir]

Training

Setp-1: Pre-train MAET-COCO model (273 epochs on 4 GPUs): (if use other GPU number, please reset learining rate), or direct download our pre-train COCO model (google drive) (baiduyun, passwd:1234).

CUDA_VISIBLE_DEVICES=0,1,2,3 PORT=[port number] bash ./tools/dist_train_maet.sh configs/MAET_yolo/maet_yolo_coco_ort.py 4

Setp-2 (EXDark): Fine-tune on EXDark datastet (25epoch on 1 GPU):

python tools/train.py configs/MAET_yolo/maet_yolo_exdark.py --gpu-ids [gpu id] --load-from [COCO model path]

Setp-2 (UG2-DarkFace): Fine-tune on UG2-DarkFace datastet (20epoch on 1 GPU):

python tools/train.py configs/MAET_yolo/maet_yolo_ug2.py --gpu-ids [gpu id] --load-from [COCO model path]

Comparative Experiment
Fine-tune EXDark dataset enhancement by MEBBLN/ Kind/ Zero-DCE (25epoch on 1 GPU) on well-trained normal COCO model (608x608) for fairness

python tools/train.py configs/MAET_yolo/yolo_mbllen.py (yolo_kind.py, yolo_zero_dce.py) --gpu-ids [gpu id]

Baselines on EXDark dataset (renew), the baseline detector is YOLO-V3:

Baselines on EXDark dataset (renew) on YOLO-V3 object detector:

class Bicycle Boat Bottle Bus Car Cat Chair Cup Dog Motorbike People Table Total
Baseline 79.8 75.3 78.1 92.3 83.0 68.0 69.0 79.0 78.0 77.3 81.5 55.5 76.4
KIND (MM 2019) 80.1 77.7 77.2 93.8 83.9 66.9 68.7 77.4 79.3 75.3 80.9 53.8 76.3
MBLLEN (BMVC 2018) 82.0 77.3 76.5 91.3 84.0 67.6 69.1 77.6 80.4 75.6 81.9 58.6 76.8
Zero-DCE (CVPR 2020) 84.1 77.6 78.3 93.1 83.7 70.3 69.8 77.6 77.4 76.3 81.0 53.6 76.9
MAET (ICCV 2021) 83.1 78.5 75.6 92.9 83.1 73.4 71.3 79.0 79.8 77.2 81.1 57.0 77.7
DENet (ACCV 2022) 80.4 79.7 77.9 91.2 82.7 72.8 69.9 80.1 77.2 76.7 82.0 57.2 77.3
IAT-YOLO (BMVC 2022) 79.8 76.9 78.6 92.5 83.8 73.6 72.4 78.6 79.0 79.0 81.1 57.7 77.8

Citation

If our work help to your research, please cite our paper, thx.

@InProceedings{Cui_2021_ICCV,
    author    = {Cui, Ziteng and Qi, Guo-Jun and Gu, Lin and You, Shaodi and Zhang, Zenghui and Harada, Tatsuya},
    title     = {Multitask AET With Orthogonal Tangent Regularity for Dark Object Detection},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2021},
    pages     = {2553-2562}
}

If you also interest in low-light image enhancement & exposure correction, please refer to our BMVC2022 project Illumination adaptive transformer.

The code is largely borrow from mmdetection and unprocess, Thx to their wonderful works~
MMdetection: mmdetection (v2.7.0)
Unprocessing Images for Learned Raw Denoising: unprocess

iccv_maet's People

Contributors

cuiziteng 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

iccv_maet's Issues

Pre-trained Model for UG2+ DARK FACE

Hi, thanks a lot for your excellent work! Could you please release the pre-trained model or training/testing code for UG2+ DARK FACE (Table 4 in your paper)?

关于训练结果

你好,我用你的代码重新训练并在一个新的夜景数据集上微调,去对比利用YOLOV3直接训练夜景图像,两者并无差异,甚至效果低于直接训练,这是否与某些超参数设置有关,该如何处理(样本类别:car,标注正常,数据集5000左右)

code of "Linear Array Network for Low-light Image Enhancement"

Dear teacher, I learned a lot from your paper "Linear Array Network for Low-light Image Enhancement", but I found that the code connection published in your paper has not been published. Could you please publish your working code? The student wants to study. Thank you very much

Download link of pretrained ExDark baseline model

Hello,
Thanks for your work.

I'm trying to download the pre-trained ExDark baseline model, but it doesn't seem to have the GDrive link.
Could you please look into it? Thanks.

dataset model size logs
EXDark (76.8) 20 class ([google drive]) (baiduyun, passwd:1234) 470.26 MB -

AP and mAP calculation details

Thanks for the amazing paper and implementation details.

I am a bit confused about the average precision (AP) and (mAP) calculations for ExDark dataset in the table - 3.
Is it calculated at IoU 0.5 ? or is it the average of all IoU's from 0.5 to 0.95?

Discrepancy among mAP scores on DarkFace validation dataset

Hi,
Thanks for releasing your code and pre-trained models.

I'm observing some inconsistency in the results on the DarkFace validation set. Here are the details -

  1. On running test.py with the pre-trained model, I can get an mAP score of 0.5619
  2. In the paper, the mAP score reported is 0.5580
  3. Running the official DarkFace Evaluation tool, I get an mAP score of 0.4421

For 3) above, here is a snapshot of the run -
maet_run

For 3), I have also followed the recommended evaluation guidelines. For your reference, please find sample gt and outputs files below respectively -
9.txt
9.txt

Would greatly appreciate if you could please help me resolve the discrepancy in the results (and let me know which one should be the official result?)

Regards!

Pre-trained models

Excellent work!
Thanks you for providing the code.

In the pre trained models section, the google drive links for:
MAET-COCO
and
MAET-EXDark (77.7)

Point to the same file.

could you please fix the links for the weights on google drive?

test.py result problem

  1. There is a small problem with data preprocessing
  2. On the Exdark data set, the test result is relatively high, which is far from the paper:
    +-----------+------+------+--------+-------+
    | class | gts | dets | recall | ap |
    +-----------+------+------+--------+-------+
    | Bicycle | 218 | 653 | 0.991 | 0.963 |
    | Boat | 275 | 884 | 0.956 | 0.891 |
    | Bottle | 315 | 1216 | 0.949 | 0.905 |
    | Bus | 138 | 301 | 0.993 | 0.984 |
    | Car | 603 | 1557 | 0.970 | 0.933 |
    | Cat | 175 | 450 | 0.971 | 0.948 |
    | Chair | 440 | 1926 | 0.927 | 0.871 |
    | Cup | 330 | 1029 | 0.967 | 0.938 |
    | Dog | 200 | 458 | 0.990 | 0.967 |
    | Motorbike | 218 | 758 | 0.982 | 0.920 |
    | People | 1459 | 3840 | 0.966 | 0.911 |
    | Table | 299 | 1860 | 0.913 | 0.788 |
    +-----------+------+------+--------+-------+
    | mAP | | | | 0.918 |
    +-----------+------+------+--------+-------+
    {'mAP': 0.9183435440063477}

var and std

Hi! Thank you very much for sharing the great work.

Why you insert variation in the std parameter?

noise = torch.normal(mean=0, std=var)

I read original imprementation of 'unprocessing' and it's different.
This repo seems to estimate noise level smaller than original repo.

Also, why quantization noise can be bellow?

quan_noise = torch.FloatTensor(img6.size()).uniform_(-1 / (255 * bits), 1 / (255 * bits)).to(

I think quantization noise is related to the value of 2**bits.

Thank you in advance!

您好,想请教您几个问题

大佬好,很受您的这篇文章的启发,有几个问题想要请教您

  1. 在您的论文Table3中有提到,您使用三种方法增强后,YOLO(N)微调后检测结果能够达到65%+,包括MAET能够达到74%,能详细说一下细节吗,比如如何划分的训练/验证?因为我是用yolov5l做的,MEBBLN和ZeroDCE才堪堪达到63左右,如果还好找的话,您能提供一下yolov3的权重文件就最好啦!
  2. 关于环境,您是否能详细说说使用的全部版本信息,包括mmcv,pytorch和cuda,因为注意到您的README中说的mmcv使用的是1.1.5,实际安装后运行MAET时会报错并让我安装2.0.0rc4,如下
    AssertionError: MMCV==1.1.5 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0.
    安装完这个pytorch又报错......所以不知您是否能找到当时使用的版本信息我核对一下~
    感谢,期待您的回复!

mAP on low-light COCO with pre-trained model

Hi,

I am observing that using the official pre-trained COCO checkpoint (epoch_273.pth is MAET_COCO.pth), using test.py, I am getting an mAP (IoU:0.5) of 0.393 which does not match with the number of 0.569 reported in Table 2 of the paper.

Here is my snapshot of the run -
1

Could you please kindly check this and let me know what could be wrong here?

为什么MMDetcetion和Ultralytics训练出来的yolov3表现不一致

作者您好!我最近做实验有些疑问哈,想和您请教一下,不知道你之前有没有遇到这个问题。就是之前我用MMDetection做实验得到的结果和您更新后的结果是基本一致的,但是这两天我用Ultralytics的yolov3进行训练,就是在普通COCO数据集上进行训练然后再ExDark上进行微调,最后只得到下面这样的结果,学习率最后都逐渐缩小到1e-5了,但mAP只有0.559,和之前用MMDetection训练的0.75差距很大,所以很是疑惑,用MMDetection测试的那个VOC的mAP指标应该也是指mAP50-95吧?还是说那个mAP是指mAP50呢?麻烦您啦!

Class Images Instances P R mAP50 mAP50-95
all 1467 4865 0.83 0.786 0.846 0.559

有关实验结果的确认

作者您好!我最近学习了您MAET这篇工作的论文与代码,在实验过程中得到了一些不同的结果:MAET方法得到的结果的确有涨点;但是只在COCO数据集上进行预训练的YOLOv3在ExDark数据集上经过微调后也很容易就得到了不错的结果,也就是YOLO(N)得到了0.744的mAP,相比论文中报告的0.627似乎有一些差异,我仔细check了一下代码,在训练策略、数据处理等各部分是与源代码一致的,只是更换了加载的预训练权重文件。而且基于Kind、ZeroDCE这些方法的最后表现几乎与YOLO(N)没有区别,甚至反而有下降,所以有些不知所措了。

Question on implementation of ort_loss

Hi,

The ort_loss is implemented in MAET_YOLO.py as
截屏2023-03-16 下午10 14 27.
The first term is the cosine simularity between dLoss/dLight_Feature and dLoss/dDark_feature, while the second and third terms seem to equal to zero, which seems to be inconsistent with version in the paper.
截屏2023-03-16 下午10 15 52
Could you help me understand how the ort_loss in the paper is converted into its implementation version?

Fine-tuning on Dark Face

Dear author, thank you so much for the brilliant work!
I tried to reimplement your results on Dark Face following your instructions but got some bad results (an mAP of 0.2 on your val split). Since setting up the fine-tuning step is very simple by only modifying the paths to Dark Face dataset and pretrained model, I am very confused what goes wrong. Could you please share some advice? Thank you.

Run Error

I found "--load-from" is not in the usage of train.py(mmcv-full==1.2.7), Is there any other way besides lowering the version of mmcv? Because my graphics card is not compatible with mmcv<=1.2.7. Thanks!

about ZERO DCE

作者大大,我看你配置文件有zero dce-yolo,但我在配置文件代码里并没有看到有zero dce得相关代码,这部分代码是没有上传吗?

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.