fuzailpalnak / building-footprint-segmentation

Building footprint segmentation from satellite and aerial imagery
https://fuzailpalnak-buildingextraction-appbuilding-extraction-s-ov1rp9.streamlitapp.com/
Apache License 2.0
127 stars 32 forks source link

No detection after training with Massachusetts Buildings Dataset #39

Closed trecuu closed 2 years ago

trecuu commented 2 years ago

Hello,

Im having a problem where I got no detection at all after training with Massachusetts Buildings Dataset.

Just to be sure, I should be using the chk_pth.pt as dict, right?

By the way, does the pretrained weight file should be working like "well"!? All I got is something like this dst :

Thx for your work, and support!

fuzailpalnak commented 2 years ago

The reason for the pre-trained model to not yield results as expected could be that the model was trained on ariel imagery and this looks like a satellite imagery. Both are quite different visually as in ariel the building and its boundaries are evident while in the image you shared its does not as it is probably at zoom 15.

One thing I can suggest you do is to crop the image to a smaller dimension and do a image interpolation to get a image which has a similar resembles to Ariel imagery.

For training using pre-trained for Massachusetts dataset, I would suggest to go with ReFineNetLite, use augmentation and apply regularisation as well. Other thing train with smaller image size

Hope this helps

trecuu commented 2 years ago

Thx for the answer!

But Im still having no progress what so ever... I dont know if the training is running as it should. The odd thing is, the same script and image is detecting way better on anothers friend pc than mine. By the way, I tried with the same image that is used to train, and it detected nothing.

Thx again

fuzailpalnak commented 2 years ago

Can you share the training configurations you are using ?

trecuu commented 2 years ago

Im using Run with defined arguments.ipynb

fuzailpalnak commented 2 years ago

Try out this few tricks and check if it helps 1 - Make use of a lot of spatial Augmentation 2 - make use the augmentation which randomly crops the input during training and does resizing (i will have to check whats it called in albumentation lib) 3 - Apply regularization 4 - you can implement this ( https://github.com/fuzailpalnak/building-footprint-segmentation/blob/e70778a1406a21472593faefc8af3cd85c8ee908/building_segmentation/ml/binary/models/albunet.py ) model if you are using the github code and not the Pip library 5 - try with BCE loss

fuzailpalnak commented 2 years ago

@trecuu I trained a model with DlinkNet which is on this branch and the weights can be downloaded from here Hope this helps.

0_22678945_15

0_22678945_15

trecuu commented 2 years ago

I cant access "this branch" that you linked. Is the link working for you?

Im new at ML, and I picked your REPO as a way to learn. So, Im kinda of lost... Sorry for the inconvenience.

Again, thx for the support you are giving.

fuzailpalnak commented 2 years ago

I have merged all the code to the main branch, so you can pull the latest changes on main. Let me know if require anything else to setup