Convolution vs Cross-correlation

Click For Summary

Discussion Overview

The discussion centers on the differences between convolution and cross-correlation, particularly in the context of signal processing and deep learning. Participants explore the conceptual and mathematical distinctions between these two operations, as well as their applications in various fields.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • Some participants describe convolution as superposition, where a mask/filter is applied at every point in the signal, while cross-correlation involves sliding the mask and calculating the inner product area by area.
  • There is a suggestion that convolution is less intuitive due to the requirement of rotating the mask by 180 degrees, whereas cross-correlation does not require this rotation.
  • One participant questions the statement that convolution places the mask everywhere and sums the results, indicating a lack of understanding or disagreement with this characterization.
  • Another participant mentions that in image processing, cross-correlation is used to compare functions and determine their similarity in position, while convolution produces a weighted sum based on the other function's positions.
  • It is noted that if the filter is symmetric, convolution and cross-correlation yield the same result, but their purposes differ: correlation focuses on similarity, while convolution is about processing the input signal.
  • A later reply clarifies that even in correlation, the mask is translated and multiplies the input signal, emphasizing that the primary difference is the orientation of the mask.

Areas of Agreement / Disagreement

Participants express differing views on the conceptual understanding of convolution and cross-correlation, with some agreeing on the mechanics while others challenge or seek clarification on specific points. The discussion remains unresolved regarding the implications of these differences in practical applications.

Contextual Notes

Participants highlight the complexity of the operations and the potential for confusion, particularly regarding the orientation of the mask in convolution versus cross-correlation. There are indications of varying levels of familiarity with the concepts, which may affect the clarity of the discussion.

fog37
Messages
1,566
Reaction score
108
TL;DR
understand the difference between convolution and cross-correlation results
Hello,
Convolution is essentially superposition. Conceptually, a copy of the same mask/filter is essentially placed at every point in the signal (1D, 2D, ect.). Once all these convolution masks are in place, we just compute the sum and get the convolved signal. The integral formula for convolution, which implies rotating by 180 degrees the mask, is less intuitive.

Let's now talk about cross-correlation. In this case, we don't place the mask at EVERY point in the input signal but simply slide the mask around and calculate the inner product with the overlapped area and move on to the next input signal area....The correlation map looks therefore very different from a convolution operation. The integral formula for cross- correlation seems very similar (the mask is not rotated) to the convolution integral but the concept is quite different.

Concetually, convolution places the mask everywhere in the input signal, does the inner product, and sum everything up. Cross-correlation simply perform the inner product area by area...

What actually occurs in deep learning and CNN (convolutional neural networks) is really cross-correlation and not convolution, correct?
 
  • Like
Likes   Reactions: Philip Koeck
Computer science news on Phys.org
fog37 said:
TL;DR Summary: understand the difference between convolution and cross-correlation results

Hello,
Convolution is essentially superposition. Conceptually, a copy of the same mask/filter is essentially placed at every point in the signal (1D, 2D, ect.). Once all these convolution masks are in place, we just compute the sum and get the convolved signal. The integral formula for convolution, which implies rotating by 180 degrees the mask, is less intuitive.

Let's now talk about cross-correlation. In this case, we don't place the mask at EVERY point in the input signal but simply slide the mask around and calculate the inner product with the overlapped area and move on to the next input signal area....The correlation map looks therefore very different from a convolution operation. The integral formula for cross- correlation seems very similar (the mask is not rotated) to the convolution integral but the concept is quite different.

Concetually, convolution places the mask everywhere in the input signal, does the inner product, and sum everything up. Cross-correlation simply perform the inner product area by area...

What actually occurs in deep learning and CNN (convolutional neural networks) is really cross-correlation and not convolution, correct?
I don't know what CNN does, but in image processing CC is used to compare two functions in n dimensions: How similar are they and in what position to each other do they match best?

Convolution is used to produce a weighted sum of copies of the one function placed in positions (and with the respective weights) given by the other function. Obvioulsy this is quite messy unless the first function is limited in extent and the second function is a sum of delta distributions sufficiently far apart to avoid extensive overlap between the copies.
The minus in the argument makes sure the copies of the first function are correctly oriented.

This doesn't sound right to me or at least I don't understand it:
Concetually, convolution places the mask everywhere in the input signal, does the inner product, and sum everything up. Cross-correlation simply perform the inner product area by area...
 
  • Like
Likes   Reactions: fog37
fog37 said:
TL;DR Summary: understand the difference between convolution and cross-correlation results

Hello,
Convolution is essentially superposition. Conceptually, a copy of the same mask/filter is essentially placed at every point in the signal (1D, 2D, ect.). Once all these convolution masks are in place, we just compute the sum and get the convolved signal. The integral formula for convolution, which implies rotating by 180 degrees the mask, is less intuitive.

Let's now talk about cross-correlation. In this case, we don't place the mask at EVERY point in the input signal but simply slide the mask around and calculate the inner product with the overlapped area and move on to the next input signal area....The correlation map looks therefore very different from a convolution operation. The integral formula for cross- correlation seems very similar (the mask is not rotated) to the convolution integral but the concept is quite different.

Concetually, convolution places the mask everywhere in the input signal, does the inner product, and sum everything up. Cross-correlation simply perform the inner product area by area...

What actually occurs in deep learning and CNN (convolutional neural networks) is really cross-correlation and not convolution, correct?
One more thing I should point out since you talk about masks and filters.
The latter are usually symmetrical. In that case it makes no difference whether you convolute or cross-correlate with them.
 
  • Like
Likes   Reactions: fog37
In both convolution and correlation, the filter and the mask are generally smaller in size than the input signal.
True, if the filter is symmetric, convolution and correlation will give the same result.

But correlation is about finding similarity while convolution is more about processing of the input signal by convolution filter (to blur, enhance, etc.). Convolution is when an input passes through a system. The system's output is determined by the convolution filter, also known as the impulse response of the system/filter....

I was not completely correct in the way I described the mechanics of correlation. Even in the case of correlation, the correlation mask is translated around and its entries multiply the input signal. The only difference between correlation and convolution is really the 180 flip of the mask...
 
  • Like
Likes   Reactions: Philip Koeck

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
Replies
21
Views
3K
  • · Replies 43 ·
2
Replies
43
Views
8K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
33
Views
21K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K