Answers.Body: <p>In the context mentioned, images live in an n-dimensional space and the manifold is embedded in this space. Because we are in Euclidean space, the Euclidean distance will always be the shortest path between any two points.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-14T01:16:49.847Z
Answers.LastActivityDate: 2023-10-14T01:16:49.847Z
Answers.UserDisplayName: Harsh
Answers.Body: <p>Imagine your images are embedded in a space that is a <em>circle</em>. Now, to simplify, we put an extra condition in which each <em>embedding</em> (i.e., an image represented somehow in 2 dimensions) must lie on the circumference of the circle. Then you want to measure the distance between two embeddings, i.e., two distinct points on the space: say <span class="math-container">$u$</span> and <span class="math-container">$v$</span>, as in the picture below.</p>
  <p><a href="https://i.sstatic.net/4jOxC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4jOxC.png" alt="enter image description here" /></a></p>
  <ul>
  <li>The Euclidean distance measures the space between the two points as the length of a line that crosses the inside of the circle.</li>
  <li>Instead, the geodesic distance is defined as the shortest line or path (let's say) that connects the two points by travelling <em>only</em> on the surface (circumference) of the manifold, the circle in this case. Meaning that you can't travel in the inside of that space.</li>
  </ul>
  <p>According to our assumptions, we can say that the Euclidean distance is always <em>smaller</em> than the Geodesic, for whatever pair of points <span class="math-container">$(u,v)\in C$</span> we pick: this may also include dissimilar images, as you mentioned.</p>
  <p>The point is that, in the Euclidean space the notion of similar images is ill formed in the sense that a low distance not necessarily means that the images are semantically close: this is especially true in pixel space, and may still work in practice if the embeddings are designed to be semantically sound in the Euclidean space. The book chapter is trying to say that, for such applications, the use of a distance metric that is able to &quot;reason&quot; on the manifold (i.e., a lower dimensional object embedded in a higher dimensional space), therefore accounting for its shape and curvature, should be a better way to discriminate between semantically similar and dissimilar images. In practice, the Euclidean distance may consider similar two images that have a blue sky but completely different content, while the Geodesic may be more consistent.</p>
  <p>(Another problem with the Geodesic is how we compute that. I think that when the manifold's shape is unknown, as often is in ML/DL, the Geodesic is hard to compute or approximate at least, while the Euclidean distance is always cheap.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-14T22:05:15.757Z
Answers.LastActivityDate: 2023-10-14T22:05:15.757Z
Answers.UserDisplayName: Luca Anzalone
Body: <p>This is from a ML book:</p>
  <p>&quot;Principal component analysis, which we discussed in section 6.3, works
  when the data lies in a linear subspace. However, this may not hold in
  many applications. Take, for example, face recognition where a face is
  represented as a two-dimensional, say 100 × 100 image. In this case,
  each face is a point in 10, 000 dimensions. Now let us say that we take
  a series of pictures as a person slowly rotates his or her head from right
  to left. The sequence of face images we capture follows a trajectory in
  the 10, 000-dimensional space, and this is not linear. Now consider the
  faces of many people. The trajectories of all their faces as they rotate
  their faces define a manifold in the 10, 000-dimensional space, and this
  is what we want to model. The similarity between two faces cannot simply
  be written in terms of the sum of the pixel differences, and hence
  Euclidean distance is not a good metric. It may even be the case that images
  of two different people with the same pose have smaller Euclidean
  distance between them than the images of two different poses of the
  same person. This is not what we want. What should count is the distance
  along the manifold, which is called the geodesic distance.&quot;</p>
  <p>Based on this explanation, I have the following question.</p>
  <p>Is geodesic distance between two similar photos less than the Euclidean distance between them? If so, why?</p>
  
Tags: <machine-learning><computer-vision><feature-extraction>
Title: Is geodesic distance between two similar photos less than the Euclidean distance between them? If so, why?
UserDisplayName: DSPinfinity
ThreadText: # Is geodesic distance between two similar photos less than the Euclidean distance between them? If so, why?
  
  (Asked by: username_0 on 2023-10-13)
  
  This is from a ML book:
  
  "Principal component analysis, which we discussed in section 6.3, works
  when the data lies in a linear subspace. However, this may not hold in
  many applications. Take, for example, face recognition where a face is
  represented as a two-dimensional, say 100 × 100 image. In this case,
  each face is a point in 10, 000 dimensions. Now let us say that we take
  a series of pictures as a person slowly rotates his or her head from right
  to left. The sequence of face images we capture follows a trajectory in
  the 10, 000-dimensional space, and this is not linear. Now consider the
  faces of many people. The trajectories of all their faces as they rotate
  their faces define a manifold in the 10, 000-dimensional space, and this
  is what we want to model. The similarity between two faces cannot simply
  be written in terms of the sum of the pixel differences, and hence
  Euclidean distance is not a good metric. It may even be the case that images
  of two different people with the same pose have smaller Euclidean
  distance between them than the images of two different poses of the
  same person. This is not what we want. What should count is the distance
  along the manifold, which is called the geodesic distance."
  
  Based on this explanation, I have the following question.
  
  Is geodesic distance between two similar photos less than the Euclidean distance between them? If so, why?
  
  **Tags:** machine-learning, computer-vision, feature-extraction
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2023-10-14. Score: 2 | Accepted answer
  
  Imagine your images are embedded in a space that is a *circle*. Now, to simplify, we put an extra condition in which each *embedding* (i.e., an image represented somehow in 2 dimensions) must lie on the circumference of the circle. Then you want to measure the distance between two embeddings, i.e., two distinct points on the space: say $u$ and $v$, as in the picture below.
  
  [![enter image description here](https://i.sstatic.net/4jOxC.png)](https://i.sstatic.net/4jOxC.png)
  
  * The Euclidean distance measures the space between the two points as the length of a line that crosses the inside of the circle.
  * Instead, the geodesic distance is defined as the shortest line or path (let's say) that connects the two points by travelling *only* on the surface (circumference) of the manifold, the circle in this case. Meaning that you can't travel in the inside of that space.
  
  According to our assumptions, we can say that the Euclidean distance is always *smaller* than the Geodesic, for whatever pair of points $(u,v)\in C$ we pick: this may also include dissimilar images, as you mentioned.
  
  The point is that, in the Euclidean space the notion of similar images is ill formed in the sense that a low distance not necessarily means that the images are semantically close: this is especially true in pixel space, and may still work in practice if the embeddings are designed to be semantically sound in the Euclidean space. The book chapter is trying to say that, for such applications, the use of a distance metric that is able to "reason" on the manifold (i.e., a lower dimensional object embedded in a higher dimensional space), therefore accounting for its shape and curvature, should be a better way to discriminate between semantically similar and dissimilar images. In practice, the Euclidean distance may consider similar two images that have a blue sky but completely different content, while the Geodesic may be more consistent.
  
  (Another problem with the Geodesic is how we compute that. I think that when the manifold's shape is unknown, as often is in ML/DL, the Geodesic is hard to compute or approximate at least, while the Euclidean distance is always cheap.)
  
  
  ---
  
  ### Answer by username_1 on 2023-10-14. Score: -1
  
  In the context mentioned, images live in an n-dimensional space and the manifold is embedded in this space. Because we are in Euclidean space, the Euclidean distance will always be the shortest path between any two points.
  
  
  ---
  
  