Answers.Body: <p>Consider these two sets <span class="math-container">$A = \{1, 2, 3, 4 \}$</span> and <span class="math-container">$B = \{0, 2, 3, 5, 6 \}$</span>. Their union <span class="math-container">$A \cup B = \{0, 1, 2, 3, 4, 5, 6\}$</span>. So, <span class="math-container">$|A \cup B| = 7$</span>. The order of these numbers in <span class="math-container">$A \cup B$</span> does not matter, but you don't have any repeated number.</p>
  <p>If you do <span class="math-container">$|A| + |B|$</span>, you're effectively counting the number of elements in <span class="math-container">$A \cap B$</span> twice (in the example above, it would be like doing <span class="math-container">$4 + 5 = 9$</span>, while in reality <span class="math-container">$|A \cup B| = 7$</span>), so you subtract <span class="math-container">$|A \cap B|$</span> from <span class="math-container">$|A| + |B|$</span>, i.e. <span class="math-container">$|A \cup B| = |A| + |B| - |A \cap B|$</span>, where <span class="math-container">$|X|$</span> is the size of the set <span class="math-container">$X$</span>.</p>
  <p>See also <a href="https://en.wikipedia.org/wiki/Jaccard_index" rel="nofollow noreferrer">the related Wikipedia article</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-03T09:30:28.257Z
Answers.LastActivityDate: 2022-03-03T09:30:28.257Z
Answers.UserDisplayName: nbro
Body: <p>When calculating the Intersection Over Union the following explanation is widely used.</p>
  <p><a href="https://i.sstatic.net/ZZI6P.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZZI6P.png" alt="enter image description here" /></a></p>
  <p>(Source: <a href="https://www.researchgate.net/publication/343194514_A_Survey_on_Performance_Metrics_for_Object-Detection_Algorithms" rel="nofollow noreferrer">A Survey on Performance Metrics for Object-Detection Algorithms</a>, by Padilla et al. 2020)</p>
  <p>The image and name suggest that the denominator (the area of union) is the area of both boxes combined, <code>box a + box b</code>, when in reality it's not a union but rather a symmetric difference, <code>box a + box b - intersection of box a and box b</code>.</p>
  <p>Why is it called &quot;area of union&quot; and not &quot;area of symmetric difference&quot;?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-03-03T09:05:55.477Z
Comments.Text: The question aims at the denominator which is called area of union even though its not really a union when considering the union definition from the set theory.
Comments.UserDisplayName: Skid
Tags: <machine-learning><terminology><object-detection><bounding-box><jaccard-similarity>
Title: Why is it called "area of union" when calculating the Intersection over Union?
UserDisplayName: Skid
ThreadText: # Why is it called "area of union" when calculating the Intersection over Union?
  
  (Asked by: username_0 on 2022-03-03)
  
  When calculating the Intersection Over Union the following explanation is widely used.
  
  [![enter image description here](https://i.sstatic.net/ZZI6P.png)](https://i.sstatic.net/ZZI6P.png)
  
  (Source: [A Survey on Performance Metrics for Object-Detection Algorithms](https://www.researchgate.net/publication/343194514_A_Survey_on_Performance_Metrics_for_Object-Detection_Algorithms), by Padilla et al. 2020)
  
  The image and name suggest that the denominator (the area of union) is the area of both boxes combined, `box a + box b`, when in reality it's not a union but rather a symmetric difference, `box a + box b - intersection of box a and box b`.
  
  Why is it called "area of union" and not "area of symmetric difference"?
  
  **Tags:** machine-learning, terminology, object-detection, bounding-box, jaccard-similarity
  
  > **Comments:**
  > **username_0**: The question aims at the denominator which is called area of union even though its not really a union when considering the union definition from the set theory.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-03-03. Score: 1 | Accepted answer
  
  Consider these two sets $A = \{1, 2, 3, 4 \}$ and $B = \{0, 2, 3, 5, 6 \}$. Their union $A \cup B = \{0, 1, 2, 3, 4, 5, 6\}$. So, $|A \cup B| = 7$. The order of these numbers in $A \cup B$ does not matter, but you don't have any repeated number.
  
  If you do $|A| + |B|$, you're effectively counting the number of elements in $A \cap B$ twice (in the example above, it would be like doing $4 + 5 = 9$, while in reality $|A \cup B| = 7$), so you subtract $|A \cap B|$ from $|A| + |B|$, i.e. $|A \cup B| = |A| + |B| - |A \cap B|$, where $|X|$ is the size of the set $X$.
  
  See also [the related Wikipedia article](https://en.wikipedia.org/wiki/Jaccard_index).
  
  
  ---
  
  