I am trying to solve a multi label classification problem, but my dataset is heavily imbalanced.My labels look like this

I want to pass weights to my loss function,So my question is How can i calculate weights for my dataset.Any suggestions would be very helpful.Thanks in advance.
Also General advice on multilabel problems would also help.