NoData Results with Deep Learning

1426
9
08-06-2021 08:29 AM
LorenzSiebrecht
New Contributor II

Hello there!

I am becoming desperate and would appreciate any help:

I want to use "Classify Pixels Using Deep learning" to classify Orthophotos. These Photos are Raster data with 3 bands (RGB), raster format is 8 bit unsigned. I used the Sample Manager to export sample shapes. I exported Training Data for Deep learning in many resolutions- 1x1cm, 5x5 cm and 10x10cm. I trained models for Unet classification with as I think sufficient Training data, some for 10 epochs, some for 5, some for 1, as I have to use my CPU-->long processing time.

Problem is: the result rasters show nearly no classifed pixels- the most are declared noData. I once managed to get an sufficient result from an 5x5 cm Raster, but i can't reproduce this result.

Has anyone seen some similar problem and has a solution or hind? As far as i understand it, my training data are flawless: 3 bands, 8 bit unsigned, they have a spatial reference. I don't think the number of epochs is the reason, as I would expect just wrong results, but no noData results. May I have to give all noData pixels the value 0 or something?

I would really appreciate if somebody could help me!

 

Best regards

Lorenz

0 Kudos
9 Replies
DanPatterson
MVP Esteemed Contributor

Is this a continuation of

NoData Results with "Classify Pixels with Deep lea... - Esri Community

 


... sort of retired...
0 Kudos
DanPatterson
MVP Esteemed Contributor

Also, what version of Pro?  2.8.2 fixes a bug for large data sets

BUG-000141318

The Classify Objects for Deep Learning tool does not complete when using large data.

Release notes for ArcGIS Pro 2.8—ArcGIS Pro | Documentation

 


... sort of retired...
0 Kudos
Tim_McGinnes
Occasional Contributor III

I am not sure what you mean when you say you are exporting the training data at different resolutions. Are you resampling your input image, or modifying the Tile Size? You shouldn't have to resample the input imagery, just export training data using the original resolution.

Apart from any technical problems, the most common cause of getting a NoData raster from Pixel Classification is that the model has not been trained enough.

Have a look at this post where I recently helped out another user with getting Pixel Classification to work: Help with deep learning and pixel classification of Sentinel 2 (don't worry about the Sentinel 2 bit - it is actually using RGB imagery). He was also using the CPU.

The secret to success with pixel classification is:

  • Start out with a small amount of training data first.
  • Train the model until you start getting some results - I really recommend using a notebook for this because you can immediately see the results and then keep training if required. In my experience with UNet, 10 epochs is not nearly enough - the example in the post linked above took 60 epochs and the results were still not great.
  • Get the entire process working end-to-end - through to saving the model and running the Classify Pixels tool to get results.
  • Consider trying out other models at this early stage - ArcGIS supports DeepLab and PSPNet for pixel classification. They may provide better results than UNet for your data.
  • Once you have confirmed everything is working you can start using the full amount of training data in the model.
0 Kudos
LorenzSiebrecht
New Contributor II

Hello Tim,

Thank you very much for your ideas- they are really helpful!

I will test them out right away and will report back if it worked. Seems I still need to get into notebooks after all^^

Thank you ver much!

 

0 Kudos
LorenzSiebrecht
New Contributor II

Hello Tim,

I just read your linked solution and have a question about the part using pre-trained Models:

I the discription it says this is for "fine-Tuning" a model, so i thought this isn't simply resuming the training of the old model but using the model only as some kind of additional training input. Is this wrong and it's really about resuming the training?

Best regards!

0 Kudos
Tim_McGinnes
Occasional Contributor III

It's both - like in the description you could use a model trained to detect cars in your imagery and train it to detect trucks. It should be much easier to train because it is already familiar with your imagery to start with.

Similarly if you just want to train a model more, just use the same training data and keep going.

0 Kudos
LorenzSiebrecht
New Contributor II

Hello Tim,

the resume of the learning works fine! After aprx. 1500 Epochs the model begins to "see" something, I used your linked old post regarding notebooks to construct a simple notebook, it works much better than using the tool, thanks again!

But the model mostly classifies pixels correctly that were part of the Training Data (I exported Training Data from a Raster and now want to classify the whole Raster). So the now classifed pixels are mostly consistent with the Shapes I used for Exporting training data. The rest of the raster is still classified as noData, except some small zones. I am now training the model further to test if the area of correctly classified Data grows.

Is this normal and I just need to further train the model? Or is this already overfitting; But there was no "Tipping point" where the model began to "retreat" to the training shape area, it just began to "spread" from the training shapes.

I wondered if the "Output No Feature Tiles" or the "Blacken Around Feature" Options (which I did not activate) have anything to do with this phenomenon?

 

0 Kudos
SandeepKumar1
Esri Contributor

@LorenzSiebrecht can you share a sample of your training data ?

0 Kudos
LorenzSiebrecht
New Contributor II

The Orthophoto represents the raster I want to classify. I have 4 Orthophotos form different beach transects in the same size, this is one example. The classified Raster is overlaying the Orthophoto in the screenshots; as you can see, there are isolated zones of classified pixels. Between them are still areas of NoData-Classification, which means the underlying orthophoto is visible.

0 Kudos