banikr:

Does that anyhow compromise the training process?


The training epoch will be ~5x longer, but that’s just loosing some time.
If you want, it skews the meaning of the training loss (which you could collect per class and then apply a weighted mean if you want to compare to the validation loss). Other than that it seems to me that rebalancing the training data is a relatively straightforward path to dealing with imbalanced classification. For me, it seams to be more reliable to get good results than loss weighting.
Best regards
Thomas