Introducing neural restore module – raw denoise, denoise, and upscale

Base on @anry work and following all your feedbacks I made a video to present this new addition for the one that will embrace Darktable 5.6 soon.

7 Likes

I’m glad that the actual module is called “neural restore” and not “AI restore” or “AI denoise” and that the word AI is not used at all (although it is used in the preferences…)

3 Likes

I was playing around with Neural Restore on 5.5.0+1650~g51474ffb59 when I noticed a halo appearing around high contrast areas in shadows. I own a Nikon Z6iii, but that raw files does not load in DT (HE compressed), so the closest is the Z6ii i think.

As further test I downloaded the ISO100 -6EV from the Nikon Z6ii (24mp) from DPReview. You have to increase EV to +6

I don’t know how to comment on this other than a note to self to ensure exposure is OK and iso always as low as possible and maybe, just maybe use RR instead of NR for now if needed
(but I expect others have more intelligent things to say on this)

BTW, I know this is an extreme case, for normal well exposed images at iso 100-800 I don’t even bother with denoising.

https://www.dpreview.com/reviews/image-comparison/download-image?s3Key=1223cd29147e420fb27c49a59c271673.nef

Here’s the original +6EV exposure

Here’s the NR raw denoise @ 50% with a small halo appearing

Here’s the NR raw denoise @ 100% with a halo appearing and loss of fine detail (as expected)

As comparison, the raw refinery version at default setting
(which has its own problems with some color artefacts that can be taken care of with the chromatic abberations module)

The raw denoise mode has a really hard time with this noisy image - the area around the lights on the ground has strong artefacts:

Yes, this is a known limitation which was already reported and discussed in this topic. There’s not fast fix to that rather than incremental model improvement.

If there is anything we can contribute? I’m just learning the limitations. I’m fully aware that magic bullets do not exists

In muy laptop (Asus AMD Ryzen 5, 6 years old. Windows 11) neural restore does not seem to be working in DT 5.6.0. For instance with raw denoise I get some error message about GPU, then it tries to use CPU and DT just crashes after a while. No issues with the nightly build versión that I tested.

What error message?

I’m having issues with the Neural Restore module in DT5.6.0 on a MacBook Air M3

When clicking ‘generate preview’ in the ‘raw denoise’ tab, darktables memory consumtion ramps up gradually to 34GB until the entire system gets stuck:

When clicking ‘generate preview’ in the ‘denoise’ tab, I get an error overlay in the picture grid:

I have downloaded all the required models. Setting the acceleration to ‘auto’ or Apple CoreML makes no difference.

Do I need to set up something else?

That looks like an old development model. Were you testing the 5.5.0 dev nightly builds?

Anyway, I would recommend deleting AI cache folders, deleting and redownloading models again.

I would translate as

AI raw denoise: error in the interference with GPU; trying with CPU

Actually my error message is in spanish: “Reducción de ruido en archivos en bruto por IA: error en la interferencia con la GPU; se recurre a la CPU”

Yes, I have tested the nightly builds and downloaded the models in the 5.5.0dev nightly version.

Deleting and downloading the models again in DT5.6.0 solved the issue.
However, I deleted the entire ./cache/darktable folder before installing DT5.6.0 and after I have downloaded the models again, the ./cache/darktable/ai_downloads folder is empty, so they seem to live somewhere else.

1 Like

Update. I deleted, re-installed the model and choose Windows DirectML acceleration and it works right now

1 Like

Andrii has written a nice blog post for us:

16 Likes

Another excellent contribution from @anry, thank you so much!

4 Likes

The AI object mask tool is amazing, I will definetly use it a lot. Thank you @anry for bringing that feature to darktable!

1 Like

EDIT 4:
Solved. It was the demosaic method. Raw denoise looks way better though. Now I still wish I could get my 5700XT to work lol.
EDIT 3:
Okay I think I see where it’s going wrong. It has to do with my preset/pipeline. Because when I reset the history, it will denoise.

EDIT 2:
Hmm this did fix the raw denoise, but not the other one. I also still can’t get my 5700XT to work. Tried installing rocm and ONNX (Linux).

EDIT 1:
Deleted the models inside darktable. Then removed darktable’s cache files. Downloaded/installed the models in darktable again. Solved it.

Hmm my AI denoising stopped working on my Macbook Air (M1) since 5.6 I guess. I’m on the nightly build.
It’s creating the .tiff but it looks like it doesn’t run the denoising at all. RAW denoise hangs darktable and I have to force quit (this is not a new problem for me though, already had that).

I’ve been using darktable 5.6 for a bit more than a week now, and started a few experiments with denoise as well (all models freshly installed). I tried it on maybe 4-5 images so far, and one thing I noticed that every time, denoise results in a noticable colour-shift in the denoised image. I’ve already tried a few different settings (with and without “preserve wide-gamut”, profile “image settings” and “sRGB”), but that made no change. I also seem to remember that this issue has been mentioned before, but unfortunately cannot seem to find that discussion again… Pointers are most welcome, as the denoising as such would be quite helpful. If needed, I’ll gladly prepare some example images, too.

It could happen. Couple reasons for that. First is that noise itself may bring some color. Removing it may result in some color shift compared to original image. The second possible reason could be related to the model which basically rebuilds the image.

So small color shifts could happen, however I never saw a dramatic shift.

2 Likes

With regard to the first option: so far, the colour shift seems even more evident when comparing a version of the image that was denoised with ordinary profiled noise removal vs. one where I used neural restore, so I think this may be of lesser influence here. I’ll try to find the time to prepare some examples over the next couple of days!

1 Like