Nikita Misiura's DeepSNR module is a very powerful Deep-Learning based tool for denoising color images. However, it is currently only trained to run on color images, and does not work well on RGB-converted monochrome images.
The example below was converted from grayscale to RGB (left image). When you run DeepSNR on such a mono image, the algorithm will produce lot of artefacts (speckle noise, looks a bit like fake stars) and the denoise effect is not very strong.
I figured this undesired effect was due to autocorrelation between the 3 channels of an RGB converted image. My script injects random noise in 2 channel copies to reduce autocorrelation, and then runs DeepSNR on the synthetic image. The extra noise results in a small loss of high-frequency detail, but it greatly improves the performance of DeepSNR on grayscale data without dedicated training of the network on monochrome images.
The strength parameter determines the amplitude of the injected noise. You may need to increase or decrease the default setting for optimal result, it is recommended to test a couple settings. NOTE: DO NOT run the script on a preview. It will crash and close your image. Testing strength settings goes very quickly if you first make a copy of the target image, then crop to 512x512 pixels.
The images of Messier 94 below show a comparison between the typical native DeepSNR performance on a real RGB image, and the script performance on a grayscale image derived from the same dataset.
The native DeepSNR result is extremely well denoised. Running the script with strength = 1 leaves visible artefacting, however sharpness is almost unaffected. Script strength 10 has much smoother noise reduction (much closer to the native DeepSNR result) at the cost of reduced sharpness in the galaxy core. With a proper mask, both images could be combined for the optimal denoise and sharpness.
This was my first time programming in JavaScript. I followed Roberto Sartori's video for the basics. Any suggestions for code improvement are very welcome! I hope this script is useful. If you test it on your own data, please share the results here.
Official page for DeepSNR process module: https://www.deepsnrastro.com/
The example below was converted from grayscale to RGB (left image). When you run DeepSNR on such a mono image, the algorithm will produce lot of artefacts (speckle noise, looks a bit like fake stars) and the denoise effect is not very strong.
I figured this undesired effect was due to autocorrelation between the 3 channels of an RGB converted image. My script injects random noise in 2 channel copies to reduce autocorrelation, and then runs DeepSNR on the synthetic image. The extra noise results in a small loss of high-frequency detail, but it greatly improves the performance of DeepSNR on grayscale data without dedicated training of the network on monochrome images.
The strength parameter determines the amplitude of the injected noise. You may need to increase or decrease the default setting for optimal result, it is recommended to test a couple settings. NOTE: DO NOT run the script on a preview. It will crash and close your image. Testing strength settings goes very quickly if you first make a copy of the target image, then crop to 512x512 pixels.
The images of Messier 94 below show a comparison between the typical native DeepSNR performance on a real RGB image, and the script performance on a grayscale image derived from the same dataset.
- Top left: starting RGB image (Messier 94)
- Top right: red channel after applying native DeepSNR module on the RGB data
- Bottom left: Extracted red channel from RGB, script applied with strength = 1
- Bottom right: Extracted red channel from RGB, script applied with strength = 10
The native DeepSNR result is extremely well denoised. Running the script with strength = 1 leaves visible artefacting, however sharpness is almost unaffected. Script strength 10 has much smoother noise reduction (much closer to the native DeepSNR result) at the cost of reduced sharpness in the galaxy core. With a proper mask, both images could be combined for the optimal denoise and sharpness.
This was my first time programming in JavaScript. I followed Roberto Sartori's video for the basics. Any suggestions for code improvement are very welcome! I hope this script is useful. If you test it on your own data, please share the results here.
Official page for DeepSNR process module: https://www.deepsnrastro.com/
Attachments
Last edited: