Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wet/dry sand limit instead of the water/sand limit #177

Open
aritzb16 opened this issue Feb 5, 2021 · 5 comments
Open

Wet/dry sand limit instead of the water/sand limit #177

aritzb16 opened this issue Feb 5, 2021 · 5 comments
Labels
question Further information is requested

Comments

@aritzb16
Copy link

aritzb16 commented Feb 5, 2021

Dear Kilian,

I am a French intern currently working laboratory EPOC/METHYS in Bordeaux. I am working on the French South West coast in order to study the shoreline evolution using your CoastSat Toolkit. As you know, the alogorithm sometimes picks up the wet/dry sand limit instead of the water/sand limit. Therefore, I tried to re-train the algorithm. As you can see in the image below, the algorithm is now able to detect wet sand as sand with the new classifier, however CoastSat still picks up the shoreline at the west/dry sand limit.

Do you any information on how to address this issue ? We are happy to test any hypothesis here.

Thank you in advance for your help,
With best regards,

Auguste
capture_sat_image_66_essai_3

@kvos
Copy link
Owner

kvos commented Feb 6, 2021

hi auguste, I would need to see what is happening with the histogram of MNDWI values, could you rerun this image but with the setting adjust_detection set to True and share a screenshot of that? it may give more insights into why it's going to the wet/dry sand...

@aritzb16
Copy link
Author

aritzb16 commented Feb 8, 2021

Hello Kilian,

Thank you for answering me. I share you new screenshots. The first one is the default location of the threshold. The second one is manual location of the treshold on the limit sand/water/whitewater but as you can see it still does not pick up the real shoreline.

Thank you again for your help.
With best regards,
Auguste
Capture_default
Capture_manual_settings

@kvos
Copy link
Owner

kvos commented Feb 9, 2021

that's really interesting, thanks for sharing. I'm tagging @KatKonst here as she is also working on a similar problem and may have some suggestions as well (also let's merge both issues here for discussion)
Here are a few observations based on that one image:

  • your classifier is doing a great job at picking the sand pixels and is resolving the sand/water interface extremely well (at least on that particular image). I would try to extract the shoreline directly on the classified image, by contouring the pixels that are at the edge of the sand-only binary image (im_classif[:,:,0] in the code) and adjacent to a whitewater or water pixel (respectively im_classif[:,:,1] and im_classif[:,:,2]). You can do this with the skimage.measure.find_contours() function. We have done something along those lines (but not quite) in CoastSat.Islands to extract the polygon containing sandy pixels, you can check the code here (https://github.com/mcuttler/CoastSat.islands).
  • By looking at the MNDWI image it doesn't seem to be any contrast between wet sand and water. I guess this is because the MNDWI uses the SWIR (short-wave infrared) band and at that frequency the absorptivity of water is very high, meaning that both wet sand and water will absorb all the incoming light and won't reflect anything to the satellite. By looking at the water absorption spectrum below, I would suggest to try using the NDWI, which uses NIR instead of SWIR. In the NIR band the absorptivity of water is lower so you may be able to differentiate wet sand from water, although using the NDWI introduces other issues as it becomes harder to differentiate white-water from dry sand.
  • The histogram of MNDWI pixel intensities further emphasises this, you can see from left to right that you have the first blue peak which is your 'water class', followed by the 'whitewater' pixels, then the next purple mode around 0 corresponds to the forest and at the end the 'dry' sand pixels next to the second purple mode which is probably those deforestated patches. The 'wet sand' pixels that you classified seem to be pretty close to the 'water' pixels in that -0.50 zone.

It's a tricky problem, I think contouring the sand pixels it's probably the easiest option but you could also go in another direction at classify the 'wet sand' pixels in a separate class, then look at a set of spectral indices and bands to find which band/index does best at differentiating wet sand from water/whitewater (then you may have two different detection methods, one for high tide and one for low tide). Also note that while Coastsat only downloads the NIR and SWIR1 bands, Sentinel-2 imagery also contains 4 red-edge bands (from 700 to 850nm) as well as SWIR2 (a second longer wavelength SWIR band).

image

@KatKonst
Copy link

KatKonst commented Feb 9, 2021

Hi Auguste/Kilian,

In my mind, there are two interrelated approaches to this problem:

Optical approach: wet sand appears darker because the optical path length in a wet sand matrix is longer so more light is absorbed. The relationship is not linear, and the spectral characteristics are muted. When sand becomes saturated (thin film of water over the surface), the optical path length in water is maximum and absorption in the IR range is very high. So, the spectral signature of saturated sand is very close to that of water in both the NIR and IR, especially at the shorter wavelength end. So the NIR band may work better in this case but you may find it works much worse overall and as Killian points out, this path will probably send you in a more remote sensing direction than coastal science.

Physical approach: you are working on an exposed, meso-macro tidal, dissipative site. Because these sites are relatively flat, they tend to have patches of saturated sand visible at low tide. They also tend to be quit rippy, and often feature complex ridge/runnel systems and low-tide shoreline patters. The former of which also retain water at low tide. It looks to me that this particular image is close to low tide suffering from all the above.

Because of the optical physics involved, low-tide images will often be an issue. You could try manual adjustment A tried solution that makes sense is to set a tide limit and only consider images taken at higher water elevations. Again you have to try things out and balance the importance of more data against better but fewer data.
I hope this helps.

  • Kat

@aritzb16
Copy link
Author

Hello Kat/Kilian,

Thank you both of you for helping me with this issue. I will try the solutions that you suggested to me. I think I will begin the countouring sand pixel option, using the CoastSat.Island model, in order to see if it improves the mapped shoreline. Otherwise, I will set the tide limit for only picking up images at higher water elevation as you suggested to me Kat. Thanks to you, I also know that NIR data could be another solution for mapping the shoreline.

Thank you again, you really help us,
Auguste

@kvos kvos added the question Further information is requested label Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants