Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

handle complex normalization with clipping #8

Closed
Tracked by #7
rbavery opened this issue Feb 13, 2024 · 2 comments
Closed
Tracked by #7

handle complex normalization with clipping #8

rbavery opened this issue Feb 13, 2024 · 2 comments

Comments

@rbavery
Copy link

rbavery commented Feb 13, 2024

SATLAS, a project that produces pretrained models that generate featuremaps, finetuned task specific models, and a dataset, provides normalization steps that #2 doesn't capture: https://github.com/allenai/satlas/blob/main/Normalization.md#sentinel-2-images Different steps are applied for different bands.

TCI (this is three channels, RGB; divide by 255)
B05, B06, B07, B08, B11, B12 (divide by 8160, clip to 0-1)

I think b05-b12 have the extra clipping step because of more sever outliers.

The normalization step is like max norm per band, but instead of max for bands B05-B12, they use a different arbitrary value and then clip to the expected 0-1 range after division. While max norm would produce an equivalent range, the input distribution would be skewed.

So I think we need to represent this kind of normalization. Maybe we can make a new norm_type called "clip_norm" and specify "divide_value"= 8160 and "clip_range"=(0,1).

also, this type of normalization is only applied to some bands. so maybe we need to specify norm_type per band in a list rather than as a scalar for the entire model input.

@fmariv
Copy link

fmariv commented Mar 12, 2024

Right now, and as I see in the PR, this has been solved as norm_with_clip and then indicate the values ​​by which to make the clip for each band in norm_with_clip_values. Looks good to me, as it allows to use different values ​​for different bands and reading the description in the README it is well understood. Important is the part about each value is used to divide each band before clipping values ​​between 0 and 1., otherwise could be confusing.

@fmigneault
Copy link
Collaborator

Fixed by #2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants