Hello
I am trying to identify forest areas and I have trained a UnetClassifier on 12 band Sentinel imagery (10 bands + 2 derived bands), and when I use ClassifyPixelsUsingDeepLearning most of the time it gives good results but in areas it often comes up blocky. Green circled area below.
If I run the classify again but with a different slightly different "Processing Extent",(in other words move the AOI over but still include the green circle area), I get..
So similar result, just blocks appear in different locations
The underlying landscape looks like this
Other models I have run have done this (below), which initially look good, but then are blocky in the left lower corner
Notes
Does any body have any ideas on what could cause this?
Many thanks
Solved! Go to Solution.
I would recommend you to:
1. Use a bigger padding size such as 100 padding with 400 chip size, or 128 padding with 512 chip size. that will give more context to model and hopefully reduce the blocky effect.
2. Check if your exported training data has such samples, you can drop the chips to ArcGIS pro to check. Is there any reason that type of examples are not getting exported (Due to no data at edge of the features).
Thanks,
Sandeep
Hi Sandeep
I would have thought the 224 would have been ok but 400 and 512 chip does seem to solve the issue. It does add huge amounts of time to the training, but thanks a lot for your help.
Regards
Tim
Sorry, no answers, but would like to ask what the dimensions of the blocky bits are (both in ground units and pixels\cells). What padding are you using in the Classify Pixels tool? Any relation between the measurements and your 64 x 64 tile size by itself or tile size + padding?
If there is some sort of underlying error or problem causing this you may need to provide your model and imagery to Esri for them to replicate\diagnose.
Thanks for your response Tim..
Yes those blocks on the grid you drew are 32 pixels, so half the 64 pixels tiles and here is the python command
with arcpy.EnvManager(scratchWorkspace=r"C:\Users\[removed]\Documents\ArcGIS\Projects\BlockyTest\BlockyTest.gdb", extent="1427104.74870767 5157534.88046057 1430210.46355023 5159991.76908254", cellSize=10, processorType="GPU", workspace=r"C:\Users\[removed]\Documents\ArcGIS\Projects\BlockyTest\BlockyTest.gdb"):
out_classified_raster = arcpy.ia.ClassifyPixelsUsingDeepLearning("12 Composite Bands", r"C:\LandCover\images\LandUse_SI\models\LandUse_SI\LandUse_SI.dlpk", "padding 16;batch_size 4;predict_background True;tile_size 64", "PROCESS_AS_MOSAICKED_IMAGE", None); out_classified_raster.save(r"C:\Users\[removed]\Documents\ArcGIS\Projects\BlockyTest\BlockyTest.gdb\LandUse_SI")
Would love to provide the model for diagnoses.
Thanks again
Tim
@TimG You mentioned that your tile size is 64 * 64. It can be too low for model a model to get enough context. Also How much padding are you using ? I recommend to use a higher tile size with some padding for better results.
@Anonymous User Thanks for your response. I just tried 112 * 112 with padding 28 and I still get block type results
This is the original image
Hi @TimG can you try the same with
1. chip_size of 224 px with 56 padding
2. chip_size of 400 px with 100 padding
Let me know about the results.
Thanks,
Sandeep
Hi @Anonymous User
I haven't managed 400px but did try 224px with 56 padding. Results below. To me it still looks like it is happening.
On a side note....on my journey to create 224px it has subsequently had some other issues, which I have been detailing here
.
I would recommend you to:
1. Use a bigger padding size such as 100 padding with 400 chip size, or 128 padding with 512 chip size. that will give more context to model and hopefully reduce the blocky effect.
2. Check if your exported training data has such samples, you can drop the chips to ArcGIS pro to check. Is there any reason that type of examples are not getting exported (Due to no data at edge of the features).
Thanks,
Sandeep
Hi Sandeep
I would have thought the 224 would have been ok but 400 and 512 chip does seem to solve the issue. It does add huge amounts of time to the training, but thanks a lot for your help.
Regards
Tim