Bibliography

  1. Edward Marczewski, Hugo Steinhaus. (Jaccard Distance and Index). On a certain distance of sets and the corresponding distance of functions. Colloquium Mathematicum (1958). Volume: 6, Issue: 1, page 319-327.
  2. Marczewski, Edward (1907–1976), Steinhaus, Hugo (1887–1972). O odległości systematycznej biotopów. Zastosowania Matematyki T.4 (1958-1959).
  3. Sven Kosub. A note on the triangle inequality for the Jaccard distance. rXiv:1612.02696.
  4. Jeroen Bertels, Tom Eelbode, Maxim Berman, Dirk Vandermeulen, Frederik Maes, Raf Bisschops, Matthew Blaschko. Optimizing the Dice Score and Jaccard Index for Medical Image Segmentation: Theory & Practice. rXiv:1911.01685.

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.”

  1. F. Milletari, N. Navab, and S.-A. Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. rXiv:1606.04797 (2016).
  2. Tomas Sakinis, Fausto Milletari, Holger Roth, Panagiotis Korfiatis, Petro Kostandy, Kenneth Philbrick, Zeynettin Akkus, Ziyue Xu, Daguang Xu, Bradley J. Erickson. Interactive segmentation of medical images through fully convolutional neural networks. rXiv:1903.08205 (2019).

MathJax:

  1. TeX Commands available in MathJax.

Similarities: Dice Score and Jaccard Index

\[ \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 \]

Dissimilarity: Jaccard Distance (Loss, Bliskość/Odległość Masek)

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} \]

Properties of distance metrics

\[ \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} \]

Data Tensors

c(underweight, overweight) %<-% rraysplot2::uo_768x384x1

Chudzi

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

Grubi

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

Subcutaneous Adipose Tissue

Grubi pacjenci – porównanie masek A i B

Chudzi pacjenci – porównanie masek A i B

Visceral Adipose Tissue

Grubi pacjenci

Chudzi pacjenci