Yes exactly, you will compute the “dice loss” for every channel “C”.
The final loss could then be calculated as the weighted sum of all the “dice loss”.
Something like :



where c = 2 for your case and wi is the weight you want to give at class i and Dc is like your diceloss that you linked but slightly modificated to handle one hot etc