In binary image segmentation, for given a set of images, it's true mask and predicted mask. How do you compute dice score? Should I compute the dice score for each image separately and then find mean across all images? Or compute the dice score for all images at once by flattening tensor? Which is the correct way?
The correct way is to compute the DICE score per image and then find the mean, median and STD across all test images. It is good practice to report all three metrics to provide a clear intuition to the reader.
For more details, please refer to this answer.