wekeo / ai4EM_MOOC

Other
41 stars 42 forks source link

3B_tile-based_classification_with_EuroSAT_data: Classification failed #2

Open AmschlAl opened 2 years ago

AmschlAl commented 2 years ago

Hi, I am using the code from "[3B_tile-based_classification_with_EuroSAT_data]" in an own jupyter notebook to classify a sentinel scene. I've used your Sentinel-Data "S2A_MSIL1C_20210331T100021_N0300_R122_T33TTG_20210331T113321.SAFE/" as input data (and for me as reference to check if its working) and trained a model based on EuroSAT benchmark (all 13 bands) with the script "3B_tile-based_classification_with_EuroSAT_data_training.ipynb".

The same code, but a different result. Classification_Italy

Something went wrong with the classification and I cannot figure it out why. There is a difference by loading the data (e. g. 3B_tile-based_classification_with_EuroSAT_data_training.ipynb) with the function glob.glob(). In your case the folder/files load alphabetically. In my case it is kind of random, so I sorted folder_for_training manually. The result changed, but it is still different.

Any idea what is going wrong?

Edit: I have changed some parameters by training the model. For now this is the best result: 220223_V2

220223_V2_curve

The learn curves look fine. The model detects land use areas in a good way, but the classes are missmatched.

When I use your pretrained model "keras_sentinel2_classification_trained_model_e50_9190.h5" everything looks fine. 9190 So the mistake happens somewhere by training the model.

Is it possible to call the parameters of your pretrained model? Not only the architecture (model.summary()), also the parameters of e.g. learning rate, epochs, batch size, ....?

cfortunylombra commented 2 years ago

Hi @AmschlAl, Thank you for pointing this out. Since you are not using the WEkEO JupyterHub, I think that you will solve the issue by changing the following code from:

for j in range(0,len_data_for_training_tmp):

to:

for j in range(0,len(data_for_training_tmp)):

(I hope your RAM memory is at least 16 GB). If this does not solve the issue, please let me know and we will try to cope with it in a different way. Greetings, Carlos P.S.: Sorry for the late reply, I just saw this issue open.