Coder Social home page Coder Social logo

siie's Introduction

Sensor-Independent Illumination Estimation for DNN Models

Mahmoud Afifi1 and Michael S. Brown1,2

1York University    2Samsung AI Center (SAIC) - Toronto

Project page

BMVC_main

Prerequisite

  1. Matlab 2018b or higher (recommended)
  2. Deep Learning Toolbox for Matlab 2018b or higher

The original experiments were done using Matlab 2018b. The provided code for Matlab 2019b or higher gives almost the same results.

Quick start

Matlab View Sensor-Independent Illuminant Estimation Using Deep Learning on File Exchange

Run install_.m, then run demo.m to test our trained models. In demo.m, you should select the version of Matlab by changing the value of Matlab_ver. The supported versions are: Matlab 2018b, Matlab 2019a, or higher.

You can change the model_name and image_name variables to choose between our trained models and to change input image filename, respectively. You can test any of our trained models located in models directory. Each model was trained using different camera sensors, as discussed in our paper. Each model is named based on the validation set used during the training (for example, the model trained_model_wo_CUBE+_CanonEOS550D.mat was trained using all raw-RGB linear images from NUS and Gehler-Shi datasets without including any example from the CanonEOS550D camera in Cube/Cube+ datasets).

The input image file must contain the image raw-RGB values after applying the black/saturation level normalization. This is very important since all trained networks expect to get uint16 input images after applying the black/saturation level normalization.

FAQ

Can I use it to correct sRGB-rendered JPEG images?

No. Our method works with linear raw-RGB images, not camera-rendered images. To corret your sRGB-rendered images, you can check When Color Constancy Goes Wrong: Correcting Improperly White-Balanced Images, CVPR'19 for white balancing sRGB-rendered images (an online demo is provided).

Can I test images captured by camera sensors different than the camera sensors used for training (i.e., NUS, Gehler-Shi, and Cube/Cube+ datasets)?

Yes. Our work is proposed to reduce the differences between camera sensor responses (that is why mostly all of learning-based illuminant estimation models are sensor-dependent and cannot generalize well for new camera sensors -- see On Finding Gray Pixels, CVPR'19 for interesting experiments that highlight this point). Our method, however, targets to work independently from the camera sensor. Read our paper for more details.

How to report results of the trained models using a new set of raw-RGB images?

First, be sure that all testing images are in the raw-RGB linear space and the black level/saturation normalization is correctly applied. The input images should be stored as uint16 PNG files after the normalization. Then, you can use any of our trained models for testing. You can report results of one model or the best, mean, and worst results obtained by all models. An example code to evaluate testing image set is provided in evaluate_images.m for Matlab. You can also use all trained models and report the averaged illuminant vectors for evaluation (i.e., ensemble model).

Why does the demo show faint colors compared to what is shown in the paper?

In the given demo, we show raw-RGB images after white balancing and scaling it up by a constant factor to aid visualization. In the paper, we used the full camera pipeline in A Software Platform for Manipulating the Camera Imaging Pipeline, ECCV'16 to render images to the sRGB space with our estimated illuminant vector.

How to integrate the RGB-uv histogram block into my network?

For Matlab 2018b and 2019a, please check examples given in RGBuvHistBlock/add_RGB_uv_hist.m. If you will use the RGB-uv histogram block for sRGB-rendered images (e.g., JPEG images), you may need to tune the initalization of the scale and fall-off parameters for better results with sRGB images, as the current intalization was used for linear raw-RGB images. To tune these parameters, you can change the initalization of the scale parameter C in scaleLayer.m (line 39) and the fall-off factor sigma in ExponentialKernelLayer.m (line 43). The files scaleLayer.m and ExponentialKernelLayer.m are located in RGBuvHistBlock directory. For debugging, please use the predict function in histOutLayer.m. For Matlab 2019b or higher (recommended), please check the RGBuvHistBlock.m code located in the RGBuvHistBlock directory to tune the scale/fall-off parameters.

Publication

If you use this code, please cite our paper:

Mahmoud Afifi and Michael S. Brown, Sensor Independent Illumination Estimation for DNN Models, British Machine Vision Conference (BMVC), 2019.

@inproceedings{afifi2019SIIE,
  title={Sensor-Independent Illumination Estimation for DNN Models},
  author={Afifi, Mahmoud and Brown, Michael S},
  booktitle={British Machine Vision Conference (BMVC)},
  pages={},
  year={2019}
}

Related Research Projects

Commercial Use

This software is provided for research purposes only. A license must be obtained for any commercial application.

siie's People

Contributors

mahmoudnafifi avatar

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.