Is there Julia library for AI Image Denoising?

Actually, my question is like in the title. I am wondering if there is Julia library that makes Artificial Intelligence Image Denoising possible.

First, consider the fact that there is no such thing as “AI image denoising”. Second, do you have a specific method in mind? Have you tried searching the web before asking here?

Check:

Take a look at the JuliaImages Github organization. There are various packages for image processing, some of which can be used for image denoising.

And if you are talking about neural-net-based methods, take a look at the neural-net libraries such as Flux.jl, Knet.jl etc.

Also, you asked the question in the Visualization subdomain on Discourse, which is not a good fit for discussions about image denoising.

First, consider the fact that there is no such thing as “AI image denoising”.

Definitely not an expert, however, if I am recalling correctly, I have been reading several times about C++ thing called AI Image Denoising or very similar.

Have you tried searching the web before asking here?

Absolutely, of course! In ecosia.org and google.com. I found GitHub - twMisc/Image-denoising-Julia: Using Julia to accomplish image deonising using the Julia programming Language, however, as far as I know it is not AI supported.

Second, do you have a specific method in mind?

No, I do not. My question was very general, if there is any Julia package / library that enables AI supported image denoising (done in an easy way - I am not looking to write any - I was hoping that maybe there already is a package that does something like: input image => julia magic with ai supported denoising => output image).

Take a look at the JuliaImages Github organization. There are various packages for image processing, some of which can be used for image denoising.

Thank you. I have been using some of JuliaImages packages before, however briefly, so I do not know them all in detail. Could you point me to any specific one?

And if you are talking about neural-net-based methods, take a look at the neural-net libraries such as Flux.jl, Knet.jl etc.

Thank you. Could you point me to any specific one directly related to my question?

Also, you asked the question in the Visualization subdomain on Discourse, which is not a good fit for discussions about image denoising.

What would be the most appropriate subdomain? The description of this particular subdomain includes “Discussion of visualization in Julia, including graphics, images, plotting, etc.” I have been taking into consideration also Machine Learning subdomain, however, frankly, decided to post to this one as among all of the listed subdomains (Statistics / Numerics / GPU / Biology, Health, and Medicine / Data / Visualization / Geo / Optimization (Mathematical) / Machine Learning / Modelling & Simulations / Signal Processing / Web Stack / Astro/Space / Finance and Economics / Julia at Scale / Probabilistic programming / Maker / Quantum / Chemistry / High Energy Physics) this one is directly listing graphics and images. And what is your position with regard to those facts if I may ask? :slight_smile:

P.S. And by the way, HI, I have been watching some of your very interesting videos on topics related to geo statistics and reading some of your posts with particular interest on topics related to using Julia on HPC clusters.

1 Like

I suggest asking in the beginners in Julia subdomain, or in a more general domain.

Maybe it is an issue of language. In English, this sentence is not saying that this subdomain is for anything related to images. It is saying that it is about visualization of images.

Glad the videos are interesting and that previous posts on Discourse are helpful.

Thanks. Appreciate the time you took to provide the answer.

I haven’t seen such in Julia, but I would like the 2022 state-of-the-art (SOTA) implemented in Julia (it’s one page of code, page 29 in the paper, for “Algorithm 1”, I didn’t see any number 2…):

The code seemed simple enough, but it does much more than denoicing, also e.g. deraining, which I didn’t know was a thing… All at the same time.

[EDIT: NAFNet, see at the bottom, from 10 April 2022, seemingly also claims SOTA on deblurring, and is very intriguing for technical reasons " Nonlinear Activation", and computational efficiency. Previous EDIT: It seems Restormer from 2021 is still SOTA for denoising, but even with MAXIM 5th, the competition at the top is very close. DND Benchmark (Image Denoising) | Papers With Code I believe the latter may be better at denoising when combined with other tasks, but would still like to see both implemented or wrapped in Julia.]

It’s Python (or well JAX) code, and it could also just be wrapped from Julia (assuming you have all of it), but I thought it might still be a fun project to port, since seemingly simple… Does anyone see any hindrance in porting such JAX/Python code, to what Flux?

Well, traditional methods are not AI or ML, but certainly claimed “AI” solutions are offered:

The algorithm above is ML, a sub-field of AI, and ML/AI may be used in recent denoicing-only algs too, but at least deraining and having all together certainly seems AI to me… Superresolution, at least the good algorithms are also AI/ML, and I only find that missing, having that and the rest in one package would be cool. I suppose the superresolution could be done after (or before) in a separate phase, but I’m not sure if the manipulation of the former would interfere and thus need to be combined.

https://image-upscaler.com/image-denoiser/

See also from Intel:
https://www.openimagedenoise.org

Previous state-of-the-art from 2021 (and there some intriguing [newer] info and not inceptioniai.org in the email address there):
GitHub - swz30/MPRNet: [CVPR 2021] Multi-Stage Progressive Image Restoration. SOTA results for Image deblurring, deraining, and denoising.

Our Related Works
Learning Enriched Features for Fast Image Restoration and Enhancement, TPAMI 2022. Paper | Code
Restormer: Efficient Transformer for High-Resolution Image Restoration, CVPR 2022. Paper | Code
Learning Enriched Features for Real Image Restoration and Enhancement, ECCV 2020. Paper | Code
CycleISP: Real Image Restoration via Improved Data Synthesis, CVPR 2020. Paper | Code

About Restormer

April 4, 2022: Integrated into Huggingface Spaces using Gradio. Try out the web demo:
Image Restoration with Restormer - a Hugging Face Space by swzamir

BasicVSR++ was added to the “19 hours ago” above repo and it’s very cool:

I did not know this was a thing:

NAFSSR outperforms the state-of-the-art methods on the KITTI 2012, KITTI 2015, Middlebury, and Flickr1024 datasets.

it links to NAFNet code repo, which is also claimed SOTA for denoising (and deblurring) in 2022:

NAFNet: Nonlinear Activation Free Network for Image Restoration

Although there have been significant advances in the field of image restoration recently, the system complexity of the state-of-the-art (SOTA) methods is increasing as well, which may hinder the convenient analysis and comparison of methods. In this paper, we propose a simple baseline that exceeds the SOTA methods and is computationally efficient. To further simplify the baseline, we reveal that the nonlinear activation functions, e.g. Sigmoid, ReLU, GELU, Softmax, etc. are not necessary: they could be replaced by multiplication or removed.

3 Likes

Thank you for such detailed reply with specific examples! It was a very interesting reading. I do believe that heaving such algorithms implemented or wrapped in Julia could make the package quickly one of the most popular in the Community.

There’s also:
https://github.com/GPUOpen-LibrariesAndSDKs/RadeonImageFilter
They have: AI Denoiser Filter — AMD Radeon ProRender

I’ve wrapped RadeonProRender which was not that hard, so I assume this could also be wrapped nicely for Julia :wink:

https://github.com/JuliaPackaging/Yggdrasil/blob/master/R/RadeonProRender/build_tarballs.jl
https://github.com/JuliaGraphics/RadeonProRender.jl/blob/master/build/generate-master.jl

One can also clone their repo and immediately ccall into their shared library to try things out quickly!

3 Likes

Thank you for the information!

JuliaImages does not contain anything related to AI, yet. We’ll still in the process of designing a solid ground for generalized image processing tasks and supporting basic operands for it. AI on image processing might be hosted in some not-yet-existed organization with people from FluxML, JuliaImages and more…

If you’re asking for an out-of-box SOTA model to use in Julia, then I don’t see anything like this. Calling python model via PyCall might be the most convinient solution so far.

Thank you for the information. My intention was to double check / confirm my preliminary findings (or a lack of them) in the forum. Sometimes the search does not reveal all existing options or there are persons working on such or similar topic but they do not advertise it. I understand AI assisted image processing is a relatively new field. I think that a package based on such technology directly present in Julia language ecosystem could be very useful for scientific as well as for personal purposes. Some of the examples included in papers and links provided by @Palli are just incredible.

1 Like

From June 2022 (note, not to be confused with Video Super-Resolution Transformer, from June 2021, that it improves upon):

See pictures (there and in the paper) and:

Following commands will download pretrained models and test datasets automatically
[…]
We achieved state-of-the-art performance on video SR, video deblurring and video denoising. Detailed results can be found in the paper.

outperforms the state-of-the-art methods by large margins (up to 2.16dB) on fourteen benchmark datasets

VRT achieves state-of-the-art performance on video restoration, including video super-resolution, deblurring, denoising, frame interpolation and space-time video super-resolution.

reducing the computational complexity to O(T). […]
In contrast, VRT performs well on both short and long sequences.
[…]
4.3. Video Deblurring
[…] It is clear that VRT achieves the best performance, outperforming the second best method ARVo by a remarkable improvement of 1.47dB and 0.0299 in terms of PSNR and SSIM. […]
The runtime is 2.2s per frame on 1280 × 720 blurred videos. Notably, during evaluation, we do not use any pre-processing techniques such as sequence truncation and image alignment […]

4.4. Video Denoising
[…] Even though PaCNet [93] trains different models separately for different noise levels, VRT still improves the PSNR by 0.82∼2.16dB.

4.5. Video Frame Interpolation
To show the generalizability of our framework, we conduct experiments on video frame interpolation. […] RT achieves best or competitive performance on all datasets compared with it competitors, including those using depth maps or optical flows. As for the model size, VRT only has 9.9M parameters, which is much smaller than the recent best model FLAVR (42.4M).

From the same people (previously state-of-the-art since from August 2021, but “JPEG compression artifact reduction” intriguing, and unclear if (their above) video de-noising code handles compressed video, and does something for analogous blocking artefacts):

We conduct experiments on three represen-
tative tasks: image super-resolution (including classical,
lightweight and real-world image super-resolution), image
denoising (including grayscale and color image denoising)
and JPEG compression artifact reduction. Experimental re-
sults demonstrate that SwinIR outperforms state-of-the-art
methods on different tasks by up to 0.14∼0.45dB, while the
total number of parameters can be reduced by up to 67%.

See also (now 3rd on quality, and fastest?):

Fastdvdnet: Towards real-time deep video denoising without flow estimation.

FastDVDnet, shows similar or better performance than other state-of-the-art competitors with significantly lower computing times.

featuring very fast running times—even thousands of times faster than other relevant methods.

Runtime is 0.1 sec. so not too far from real-time, hopefully can be improved, or just wait a short while until hardware makes up for the difference:

Web-demo here (upload photo or use your web camera):

FYI: See awesome pictures for this (then June 2021, and updated this year) seemingly best method (none of the prior art seem better), even adding color to black-and-white faces. It’s not just denoising, also more specific, as for faces (intrigued to know what happens if not fed with faces):

See pictures with link above, but also different versions v1 (from paper), v1.2 and v1.3: https://github.com/TencentARC/GFPGAN/blob/master/Comparisons.md

“degradation model” (eq 10) is “first convolved with Gaussian blur kernel kσ followed by a downsampling operation with a scale factor r. After that, additive white Gaussian noise nδ is added to the image and finally it is compressed by JPEG with quality factor q”

2. Related Work

Image Restoration typically includes super-resolution [13, 48, 60, 49, 74, 68, 22, 50], denoising […]
Face Restoration. Based on general face hallucination [5, 30, 66, 70], two typical face-specific priors: geometry priors and reference priors, are incorporated to further improve the performance […]

4.4. Discussion and Limitations

Training bias. Our method performs well on most dark-
skinned faces and various population groups (Fig. 8), as
our method uses both the pretrained GAN and input image
features for modulation.

DeblurGANv2 is sometimes better on some metric according to the paper above (and sometimes also other methods):

Deblurgan-v2: Deblurring (orders-of-magnitude) faster and better. In ICCV, 2019

DeblurGAN-v2 reaches 10-100 times faster than the nearest competitors, while maintaining close to state-of-the-art results, implying the option of real-time video deblurring.