yu4u / noise2noise

An unofficial and partial Keras implementation of "Noise2Noise: Learning Image Restoration without Clean Data"
MIT License
1.08k stars 237 forks source link

Any image can be denoised? #13

Open zjz5250 opened 6 years ago

zjz5250 commented 6 years ago

If i had a image,but i don't know the noise type of it, can it be denoised? and which model should i use

yu4u commented 6 years ago

No. Basically, you should know noise models before training because training data should be created through degrading clean images by the noise models. If you train a model using several types of noise models, you might be able to denoise a noise image even if the noise type of the image is unknown, as long as the noise type is one of the noise types used in training.

zjz5250 commented 6 years ago

think you very much

zjz5250 commented 6 years ago

Another question,how can i know the type of noise i want to deal with? Actually,the method proposed by the paper can not denoise any image,right?

zjz5250 commented 6 years ago

I mean that ,i have lots of images,some of them are not very clear,and i want to denoise them。 but i don‘t know how to deal with it,can you give me a suggestion? thanks a lot!

yu4u commented 6 years ago

The answer is the same as the previous comment. You should deeply check the noisy images, group them into several types, implement the noise models to train a denoising model, and then train a model.

austingg commented 6 years ago

I believe even though you don't know the noise type, you can use the method to denoise if you observer the same scene twice and get two independent noise image.

yu4u commented 6 years ago

I believe even though you don't know the noise type, you can use the method to denoise if you observer the same scene twice and get two independent noise image.

Theoretically yes. But I'm afraid that it is difficult to get two independent noise images in real applications (e.g. "i have lots of images,some of them are not very clear,and i want to denoise them" as @zjz5250 mentioned).

austingg commented 6 years ago

@yu4u how about capture twice, if you have the capture device.

yu4u commented 6 years ago

If there is a capture device, one can create a dataset for training a denoising model dedicated to the device; it's exactly the expected application of the original paper.

MichelleYang2017 commented 6 years ago

I want to know whether there is model trained.If I have a picture,I can load the model and denoise the picture instead of training by myself.

yu4u commented 6 years ago

You can find it in README.

MichelleYang2017 commented 6 years ago

You can find it in README.

I read REANME yesterday. Your code can product some nosied images and denosied images but this is a process you made.But I have a picture which there is gaussian noise in true life,I config the command and download your trained weights but I don't have seen results.

yu4u commented 6 years ago

Please clarify what you did in command line level.

MichelleYang2017 commented 6 years ago

Please clarify what you did in command line level. If I analysis the nosied data's distribution parameters ,when I use your weights to predict a noise images to clean image,is it neccessary to config parameters in command line?

MichelleYang2017 commented 6 years ago

I guess that my images is gray that it doesn't work.If I want to denois images I need to train weights by myself what do you think?

yu4u commented 6 years ago

I can't give meaningful comments without knowing exactly what you did (commands, error logs ...). What do you mean by it doesn't work? Any script finished with error? Results were strange?

Regarding gray images, it is possible to treat gray images as color images with three channels by changing

image = cv2.imread(str(image_path))

to

image = cv2.imread(str(image_path), 1)

miaomiao6 commented 5 years ago

If I use a clean image, then add noise by your "get_noise_model", it works very well. But if I load a noisy image with Gaussian noise, then set --test_noise_model to clean. It doesn't work at all. It means the Gaussian noise is not reduced at all. It looks like this code treats the noisy image as a clean one. I thought several reasons but it still doesn't work. Could you help me check the reason when you are convenient?

yu4u commented 5 years ago

Please describe what is the problem (and what you want to do) and how to reproduce the problem. What did you mean by "doesn't work".

miaomiao6 commented 5 years ago

If input (the test image) is a clean image, then add noise by your "get_noise_model", it works very well. But if input is a noisy image (which is already contaminated with Gaussian noise), so we don't need to add noise by your "get_noise_model" and set "test_noise_model "to" clean". The Gaussian noise of the input noisy image won't be reduced. The output is exactly the same as the input.

yu4u commented 5 years ago

Could you provide the test image and the command line you executed?

miaomiao6 commented 5 years ago

My test image is selected from you test dataset, such as bridge. I found that if the input noisy image (which is already contaminated with Gaussian noise) is a gray one, the noise can not be reduced from you test code (even using image = cv2.imread(str(image_path), 1)) . If the input noisy image is a color one, it works well. You can check for that

yu4u commented 5 years ago

Could you provide the test image that can not be denoised? I could denoise the bridge image with Gaussian noise.

bridge_denoised

kw81634dr commented 5 years ago

Hi! @yu4u as you can see below image I add noise to Set5 images with ImageJ and let one of them as a grayscale image. By using ImageJ (Process > Noise > Add Noise) then (Image > Type > 8-bit). I got saved image as the left one.

Then excute denoise process "test_model.py" with weight "weights.056-66.803-30.57923_gauss_clean.hdf5" and argument "--test_noise_model clean"

Compare to the RGB (without converting to 8-bit) image as below image

It seems it can't deal with already noised Grayscale image, in other words, not only the image but even the "noise" is also gray. Do you have any idea whit this issue? Thanks!