The dice score formulation used in our UNet neural network is [see Milletari et al. page 6]: \[ \begin{align} D_M(G,P)& = 2\cdot\frac{\sum_i g_ip_i}{\sum_i (g_i^2 + p_i^2)}&\text{Milletari et al.}\\ D_S(G,P)& = 2\cdot\frac{\sum_i g_ip_i}{\sum_i (g_i + p_i)}&\text{the standard definition} \end{align} \] where sum runs over all voxels, of the (manually segmented) ground truth binary volume \(g_i∈G\) and the predicted binary segmentation volume \(p_i∈P\).
„Using this formulation we do not need to assign weights to samples of different classes to establish the right balance between foreground and background voxels, and we obtain results that we experimentally observed are much better than the ones computed through the same network trained optimising a multinomial logistic loss with sample re-weighting.”
MathJax:
\[ \begin{align} \text{D}_S(A,B)& = \dfrac{2|A \cap B|}{|A| + |B|}&\text{dice score}\\ \text{J}_I(A, B)& = \dfrac{|A \cap B|}{\;|A \cup B|\;}&\text{jaccard index} \end{align} \]
Well known (see Bertels et al.) and important relationship between the jaccard index and the dice coefficient: \[ \begin{align} \text{D}_S& = \frac{2 \text{J}_I}{1 + \text{J}_I}& \text{red – dice score from jaccard index}\\ \text{J}_I& = \frac{\text{D}_S}{2 - \text{D}_S}& \text{blue – jaccard index from dice score} \end{align} \] \[ \text{J}_I < \text{D}_S < 2\text{J}_I \qquad \frac12\text{D}_S < \text{J}_I < \text{D}_S \]
In mathematics, a metric or distance function is a function that defines a distance between each pair of point elements of a set. \[ \begin{align} \text{J}_\delta(A,B)& {\;\buildrel\rm def\over=\;} 1 - \text{J}_I(A,B) =\\ & = \frac{|A \setminus B \cup B \setminus A|}{|A \cup B|} =\\ & = \frac{|A \bigtriangleup B|}{|A \cup B|} \end{align} \]
\[ \begin{align} \text{J}_\delta(A,B) = 0 \iff A = B& \quad\text{identity of indiscernibles}\\ \text{J}_\delta(A,B) = \text{J}_\delta(B,A)& \quad\text{symmetry}\\ \text{J}_\delta(U_1,U_2) \leq \text{J}_\delta(U_1, G) + \text{J}_\delta(U_2,G)& \quad\text{triangle inequality}\\ \left|\,\text{J}_\delta(U_1,G) - \text{J}_\delta(U_2,G)\,\right| \leq \text{J}_\delta(U_1,U_2) \end{align} \]
c(underweight, overweight) %<-% rraysplot2::uo_768x384x1
uA <- underweight$km$mask_tensor
uB <- underweight$mp$mask_tensor
uimg <- underweight$km$image_tensor
jaccard_gt(uA, uB, tab_header = "Underweight Patients")
Underweight Patients | ||||||
---|---|---|---|---|---|---|
Patient ID | Subcutaneous Adipose Tissue | Visceral Adipose Tissue | ||||
Jδ | A ∩ B | A ∪ B | Jδ | A ∩ B | A ∪ B | |
1264707 | 8.66% | 12,157 | 13,309 | 28.73% | 7,928 | 11,124 |
1487001 | 7.48% | 11,973 | 12,941 | 20.50% | 6,786 | 8,536 |
1553452 | 12.51% | 6,841 | 7,819 | 20.95% | 6,233 | 7,885 |
1610908 | 9.41% | 10,151 | 11,206 | 25.79% | 6,563 | 8,844 |
1667188 | 8.85% | 8,484 | 9,308 | 30.41% | 3,354 | 4,820 |
1676769-2015 | 3.71% | 7,920 | 8,225 | 19.42% | 5,898 | 7,319 |
1695380 | 6.16% | 12,003 | 12,791 | 13.80% | 10,789 | 12,516 |
1762668 | 11.69% | 7,383 | 8,360 | 23.76% | 5,980 | 7,844 |
1772290 | 0.86% | 18,484 | 18,645 | 19.78% | 14,646 | 18,257 |
2026715 | 1.73% | 13,557 | 13,796 | 15.27% | 8,809 | 10,396 |
oA <- overweight$km$mask_tensor
oB <- overweight$mp$mask_tensor
oimg <- overweight$km$image_tensor
jaccard_gt(oA, oB, tab_header = "Overweight Patients")
Overweight Patients | ||||||
---|---|---|---|---|---|---|
Patient ID | Subcutaneous Adipose Tissue | Visceral Adipose Tissue | ||||
Jδ | A ∩ B | A ∪ B | Jδ | A ∩ B | A ∪ B | |
1573415-2019 | 6.33% | 40,920 | 43,683 | 14.43% | 20,605 | 24,081 |
158894-2018 | 2.01% | 25,784 | 26,312 | 12.00% | 15,586 | 17,711 |
1678996 | 4.60% | 31,938 | 33,479 | 11.17% | 19,148 | 21,555 |
1842247 | 5.26% | 21,067 | 22,236 | 14.97% | 13,154 | 15,470 |
1866633 | 4.93% | 24,915 | 26,207 | 15.24% | 12,328 | 14,544 |
389728 | 6.22% | 23,811 | 25,389 | 11.82% | 17,253 | 19,566 |
547766 | 2.29% | 63,090 | 64,568 | 14.31% | 23,483 | 27,405 |
626604 | 2.01% | 52,348 | 53,421 | 9.21% | 37,208 | 40,983 |
871006 | 5.04% | 25,819 | 27,190 | 14.94% | 12,033 | 14,147 |
914522 | 5.32% | 18,027 | 19,039 | 14.54% | 8,896 | 10,409 |