Classifying With a Score - Conceptual Question #2097
-
I'm trying to classify each pixel in an image with a score. That is, I'm trying to create a raster with pixels containing a percentage score. The application is to calculate the percentage canopy cover of a forest based on imagery, with a low score meaning little canopy cover and high score meaning dense canopy cover. I'm thinking I could create discrete categories for different scores (0-0.1; 0.1-0.2, etc.) and then classify them with the semantic segmentation tools, but I'm wondering if you would recommend an approach that is more continuous. Is this in the realm of possibility for Raster Vision, or should I look elsewhere? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
RV does have some support for regression but it is limited to chip-level regression i.e. predicting a single number for a full chip, rather for each pixel in the chip. In your case, you could subclass the semantic segmentation learner and dataset classes into RasterRegression* classes with some modifications. You would need to modify the loss function from cross-entropy to MSE or MAE, and modify the So it will take some work, but if you do manage to get something working, I'd appreciate a PR! |
Beta Was this translation helpful? Give feedback.
RV does have some support for regression but it is limited to chip-level regression i.e. predicting a single number for a full chip, rather for each pixel in the chip.
In your case, you could subclass the semantic segmentation learner and dataset classes into RasterRegression* classes with some modifications. You would need to modify the loss function from cross-entropy to MSE or MAE, and modify the
train_step
andvalid_step
methods (seeRegressionLearner
), and alsopostprocess_model_output
to not apply softmax. TheGeoDataset
class will have to be modified too.So it will take some work, but if you do manage to get something working, I'd appreciate a PR!