polar-computing / SeaIce

9 stars 6 forks source link

Interactive image training #8

Open akpetty opened 7 years ago

akpetty commented 7 years ago

Discussion on getting that interactive training script running and tested. In the meantime perhaps you can upload an example of a manually trained image to use in a supervised random forest classification test (on another image).

@Phil is obviously the main man here. Looks like you've already made some efforts to get this running more consistently?

phil-mcdowall commented 7 years ago

I've updated the interactive tools and create a script to test them out. The test script is train_classifier.py. Run it from command line as "train_classifer.py -i (imagepath)", replacing (imagepath) with the image you want to train on. It should draw the image, segment, then redisplay the image in the interactive selection tool. Left click to label, right click to move to the next label category. Close that window to continue the script and it should display the original image classified. I think setting the backend should be working now but if you could try it out and let me know if it works.

phil-mcdowall commented 7 years ago

Also, unless there's objections I'm going to remove the other tool that iterates through segments for labelling as clicking seems like the much more efficient option.

akpetty commented 7 years ago

Yeah this is working well (even on my Mac!). Great work. I'm going to test the method on the summer IceBridge photos as they become available and will let you know how it goes. I'll look into converting this to a notebook for explanation purposes at some point.

akpetty commented 7 years ago

Ha for the IB images the segmentation took about 20 minutes on my MacPro at work before the interactive window opened. The polygons are tiny, so will look into increasing the segmentation sizes. Does seem to be working though just about!

phil-mcdowall commented 7 years ago

Despite the name quickshift is actually the slowest of the 3 segmentation methods in `skimage.segmentation'. I don't know about the quality of the other 2 methods (the default parameters don't look great for our scenes) but they are much faster. The ouput for all three is the same though so if you want to try out the others (SLIC and Felzenszwalb) you can just switch them out in line 36 of train_classifier.py. Otherwise we could try and implement this on GPU

akpetty commented 7 years ago

Yeah I can ask my student to look into the difference in accuracy of the different segmentation routines and report back. It might also be that changing some of the options when calling quickshift might make it run faster, to force it into a less intense segmentation. I can also work with my student to work on an evaluation script to add the final block in the processing chain, this could be a nice little project.

That paper makes the GPU switch sound pretty convincing. No idea how difficult this is in practice mind..