vkristoll / Pansharpening-PRISMA-CNNs

Pansharpening PRISMA images using CNNs
GNU General Public License v3.0
6 stars 1 forks source link

Distortions in Pansharpened PRISMA image #1

Open anakilgore opened 11 months ago

anakilgore commented 11 months ago

I am using your code to pansharpen a PRISMA dataset and am encountering some issues with the output. First of all, there is visible distortion remaining in the 9x9 pixel groups (image included below), second the projection is lost, and third the pixels are 1x1 m instead of 5x5 m. I have two questions, first what are the dimensions of your input data? Second, would it be possible to provide a sample image to test along with the script?

Thank you!

pansharpen_test

vkristoll commented 11 months ago

Dear Ana,

I have included the file “Preparing_input_files.txt” in the github repository (https://github.com/vkristoll/Pansharpening-PRISMA-CNNs). This file includes a link to access a Prisma L1 level image and a detailed description about preparing the input files of the CNN.

In the above repository you can also find the file “PRISMA_L2D_georeference.py” which contains information on georeferencing Prisma L2D level images.

Concerning the distortions, it is noted that in our implementation we used L1 instead of L2D images because of better visual quality. In addition, as stated in our paper (https://ieeexplore.ieee.org/abstract/document/9406795), the CNN method after histogram clipping produced satisfactory spectra but showed higher image distortions than conventional methods (e.g. PCA).

In order to reduce the noise in the output you could experiment with different patch and kernel sizes during training. Another simple solution (especially in bigger patch sizes) is producing different inference outputs by moving the inference image by a few pixels and then creating an average. The logic behind this is the fact that the noise is mostly present in the edges of the patches. You could also consider creating a more complex architecture (e.g adding residual blocks) as proposed in in our follow-up study.

( https://www.sciencedirect.com/science/article/pii/S0025326X22006567 , https://github.com/vkristoll/Fusion-Sentinel2-Worldview )

Best regards, Viktoria Kristollari

On Wed, Nov 22, 2023 at 10:35 PM Ana Kilgore @.***> wrote:

I am using your code to pansharpen a PRISMA dataset and am encountering some issues with the output. First of all, there is visible distortion remaining in the 9x9 pixel groups (image included below), second the projection is lost, and third the pixels are 1x1 m instead of 5x5 m. I have two questions, first what are the dimensions of your input data? Second, would it be possible to provide a sample image to test along with the script?

Thank you!

[image: pansharpen_test] https://user-images.githubusercontent.com/51758386/285034878-365c8b2e-dd51-4fce-8ac4-1193b07dcc8c.png

— Reply to this email directly, view it on GitHub https://github.com/vkristoll/Pansharpening-PRISMA-CNNs/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQ52GLLDA6XL7VYML2EXNLYFZOZFAVCNFSM6AAAAAA7WZVD7OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDOMBXHE3TSOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Viktoria Kristollari Remote Sensing and Machine Learning Expert Ph.D. Candidate in the Lab of Remote Sensing School of Rural, Surveying and Geoinformatics Eng. National Technical University of Athens website:http://users.ntua.gr/vkristoll/

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

vkristoll commented 11 months ago

Dear Viktoria,

Thank you for your advice and the provided data, it is very helpful to see a CNN example using PRISMA. I am working to alter the architecture using the paper you attached and other examples.

I have another question for you if you have time to answer it. Namely, I would also like to inquire about the computational resources you used for this project. Did you use a GPU? I am having trouble replicating your results because of low RAM capacity on a server and am looking into other options.

Best regards,

Ana

She/her/hers Tropical Large Scale Ecology Lab University of Puerto Rico, Rio Piedras

@.***

From: Viktoria Kristollari @.> Date: Monday, November 27, 2023 at 4:05 AM To: vkristoll/Pansharpening-PRISMA-CNNs @.>, ANA C KILGORE @.>, Karathanassi Vassilia @.>, @. @.> Subject: Re: [vkristoll/Pansharpening-PRISMA-CNNs] Distortions in Pansharpened PRISMA image (Issue #1) Dear Ana, I have included the file “Preparing_input_files.txt” in the github repository (https://github.com/vkristoll/Pansharpening-PRISMA-CNNs). This file includes a link to access a Prisma L1 level image and a detailed description about preparing the input files of the CNN. In the above repository you can also find the file “PRISMA_L2D_georeference.py” which contains information on georeferencing Prisma L2D level images. Concerning the distortions, it is noted that in our implementation we used L1 instead of L2D images because of better visual quality. In addition, as stated in our paper (https://ieeexplore.ieee.org/abstract/document/9406795), the CNN method after histogram clipping produced satisfactory spectra but showed higher image distortions than conventional methods (e.g. PCA). In order to reduce the noise in the output you could experiment with different patch and kernel sizes during training. Another simple solution (especially in bigger patch sizes) is producing different inference outputs by moving the inference image by a few pixels and then creating an average. The logic behind this is the fact that the noise is mostly present in the edges of the patches. You could also consider creating a more complex architecture (e.g adding residual blocks) as proposed in in our follow-up study. ( https://www.sciencedirect.com/science/article/pii/S0025326X22006567 , https://github.com/vkristoll/Fusion-Sentinel2-Worldview ) Best regards, Viktoria Kristollari

On Wed, Nov 22, 2023 at 10:35 PM Ana Kilgore @.**@.>> wrote:

I am using your code to pansharpen a PRISMA dataset and am encountering some issues with the output. First of all, there is visible distortion remaining in the 9x9 pixel groups (image included below), second the projection is lost, and third the pixels are 1x1 m instead of 5x5 m. I have two questions, first what are the dimensions of your input data? Second, would it be possible to provide a sample image to test along with the script?

Thank you!

[Image removed by sender. pansharpen_test]https://user-images.githubusercontent.com/51758386/285034878-365c8b2e-dd51-4fce-8ac4-1193b07dcc8c.png

— Reply to this email directly, view it on GitHubhttps://github.com/vkristoll/Pansharpening-PRISMA-CNNs/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APQ52GLLDA6XL7VYML2EXNLYFZOZFAVCNFSM6AAAAAA7WZVD7OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDOMBXHE3TSOA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Viktoria Kristollari Remote Sensing and Machine Learning Expert Ph.D. Candidate in the Lab of Remote Sensing School of Rural, Surveying and Geoinformatics Eng. National Technical University of Athens website:http://users.ntua.gr/vkristoll/

[Image removed by sender.]http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avg.comhttp://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail

vkristoll commented 10 months ago

Dear Ana,

The pansharpening network was implemented by using the NVIDIA 1070 Ti GPU and 32GB of RAM. If your computational resources are limited, the obvious solution is to use networks that are not very deep and small patch sizes. I would also suggest creating a custom generator function that feeds the network with small batches of data. You can find examples of generator functions regarding previous studies in my repositories (links are given below) but there are also plenty of resources online. You could also try using Google Colab.

https://github.com/vkristoll/cloud-masking-CNNs/blob/main/training_patches_generator.py https://github.com/vkristoll/cloud-masking-CNNs/blob/main/CNN_training.py

https://github.com/vkristoll/change-detection-autoencoder/blob/main/training_batch_generator.py https://github.com/vkristoll/change-detection-autoencoder/blob/main/autoencoder_training.py

Best regards, Viktoria

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Dec 7, 2023 at 1:02 AM ANA C KILGORE @.***> wrote:

Dear Viktoria,

Thank you for your advice and the provided data, it is very helpful to see a CNN example using PRISMA. I am working to alter the architecture using the paper you attached and other examples.

I have another question for you if you have time to answer it. Namely, I would also like to inquire about the computational resources you used for this project. Did you use a GPU? I am having trouble replicating your results because of low RAM capacity on a server and am looking into other options.

Best regards,

Ana

She/her/hers

Tropical Large Scale Ecology Lab

University of Puerto Rico, Rio Piedras

@. @.>*

From: Viktoria Kristollari @.> Date: Monday, November 27, 2023 at 4:05 AM To: vkristoll/Pansharpening-PRISMA-CNNs < @.>, ANA C KILGORE @.>, Karathanassi Vassilia < @.>, @. @.> Subject: Re: [vkristoll/Pansharpening-PRISMA-CNNs] Distortions in Pansharpened PRISMA image (Issue #1)

Dear Ana,

I have included the file “Preparing_input_files.txt” in the github repository (https://github.com/vkristoll/Pansharpening-PRISMA-CNNs). This file includes a link to access a Prisma L1 level image and a detailed description about preparing the input files of the CNN.

In the above repository you can also find the file “PRISMA_L2D_georeference.py” which contains information on georeferencing Prisma L2D level images.

Concerning the distortions, it is noted that in our implementation we used L1 instead of L2D images because of better visual quality. In addition, as stated in our paper (https://ieeexplore.ieee.org/abstract/document/9406795), the CNN method after histogram clipping produced satisfactory spectra but showed higher image distortions than conventional methods (e.g. PCA).

In order to reduce the noise in the output you could experiment with different patch and kernel sizes during training. Another simple solution (especially in bigger patch sizes) is producing different inference outputs by moving the inference image by a few pixels and then creating an average. The logic behind this is the fact that the noise is mostly present in the edges of the patches. You could also consider creating a more complex architecture (e.g adding residual blocks) as proposed in in our follow-up study.

( https://www.sciencedirect.com/science/article/pii/S0025326X22006567 , https://github.com/vkristoll/Fusion-Sentinel2-Worldview )

Best regards,

Viktoria Kristollari

On Wed, Nov 22, 2023 at 10:35 PM Ana Kilgore @.***> wrote:

I am using your code to pansharpen a PRISMA dataset and am encountering some issues with the output. First of all, there is visible distortion remaining in the 9x9 pixel groups (image included below), second the projection is lost, and third the pixels are 1x1 m instead of 5x5 m. I have two questions, first what are the dimensions of your input data? Second, would it be possible to provide a sample image to test along with the script?

Thank you!

[image: Image removed by sender. pansharpen_test] https://user-images.githubusercontent.com/51758386/285034878-365c8b2e-dd51-4fce-8ac4-1193b07dcc8c.png

— Reply to this email directly, view it on GitHub https://github.com/vkristoll/Pansharpening-PRISMA-CNNs/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/APQ52GLLDA6XL7VYML2EXNLYFZOZFAVCNFSM6AAAAAA7WZVD7OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDOMBXHE3TSOA . You are receiving this because you are subscribed to this thread.[image: Image removed by sender.]Message ID: @.***>

--

Viktoria Kristollari Remote Sensing and Machine Learning Expert Ph.D. Candidate in the Lab of Remote Sensing School of Rural, Surveying and Geoinformatics Eng. National Technical University of Athens

website:http://users.ntua.gr/vkristoll/

[image: Image removed by sender.] http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail

Virus-free.www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail

-- Viktoria Kristollari Remote Sensing and Machine Learning Expert Ph.D. Candidate in the Lab of Remote Sensing School of Rural, Surveying and Geoinformatics Eng. National Technical University of Athens website:http://users.ntua.gr/vkristoll/