-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDL/NLCD/SSL4EO: allow selection of classes #1392
CDL/NLCD/SSL4EO: allow selection of classes #1392
Conversation
I don't understand this motivation:
Do you mind expanding on your thinking here? |
It isn't for classification, but it is for semantic segmentation. Our CDL benchmarks take 60x longer than our NLCD benchmarks. At the moment, it's basically impossible for us to finish all CDL benchmarks before the deadline. This is what we decided in the last meeting. |
It is identical with 20 and 130 output classes, the last classification layer should not be a large fraction of the computation done in a UNet. |
@yichiac tried training on our cluster and each epoch took 60x longer for CDL than NLCD. @nilsleh tried on his cluster and it was 10x. @calebrob6 if you want to train on your GPUs that's fine, but it's not feasible on our systems. This is what we spent a large portion of the last meeting discussing and this is the decision that we made. We've been trying to figure this out for days and no one has solved it and we're rapidly running out of time to start benchmarking. We have 65 CDL benchmarks to fill in. If each CDL benchmark takes > 24 hrs to complete, we're going to need quite a lot of GPUs... |
That's fine, but I don't think it needs to be baked into the library is what I'm saying. |
Writing transforms is a little painful at the moment but we can think about moving this into a datamodule transform before the next release. |
There are too many CDL classes. #1389 revealed that the top 3 classes cover more area than the bottom 130, and only 17 classes occupy more than 1% of land. We need a way to specify a smaller set of classes in order for benchmarking to be computationally tractable.
This PR introduces a
classes
parameter to all 3 datasets that lets users specify which classes they actually care about. In combination with theclass_weights
andignore_index
parameters ofSemanticSegmentationTask
, this will allow us to weight these remaining classes to fight class imbalance.@nilsleh apologies, but this undoes a lot of your hard work and changes the cmaps to their previous values (albeit without unused classes). I only did NLCD to start, but see what you think of this implementation and we can update CDL and SSL4EO-L Benchmark to match. I also haven't tested any of this so it's very likely there are bugs. We should test both the getitem and plot methods. I also don't know what will happen if the user doesn't include 0 in
classes
.All of the following plots have been validated in QGIS.
NLCD
All classes:
Few classes:
CDL
All classes:
Few classes: