# Why a Convolution Matrix Is Called a Kernel?

According to Wikipedia:

In image processing, a kernel, convolution matrix, or mask is a small matrix.

I am wondering, why the matrix is called a kernel? Does it has anything to do with kernel concepts in mathematics (e.g., as those mentioned in this post)?

• I don't think there's a strict mathematical connection here. In everyday English, kernel is just the core of a fruit – just as the kernel is the core of a e.g. Gaussian blur filter. – Marcus Müller Sep 7 '17 at 8:11

Since you are referring to convolution operation and a matrix then you are probably dealing with 2D LSI (linear shift invariant) systems that's encountered in image processing etc. For such a system the input output, I/O, relationship is expressed as a convolution sum (or integral) like this:

$$y[n_1,n_2] = \sum_{k_1=-\infty}^{\infty} \sum_{k_2=-\infty}^{\infty} h[k_1,k_2] x[n_1-k_1, n_2-k_2]$$

$$y(t_1,t_2) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} h(\tau_1, \tau_2) x(t_1-\tau_1, t_2-\tau_2)d\tau_1 d\tau_2$$

where the input signal (a sequence or a function) $x$ is mapped into the output signal $y$ by the convolutional transform.

From a mathematical point of view, in general an integral transform can be defined as: $$y(s) = \int \phi(s,t) x(t) dt$$ Where the input function is transformed from $t$ domain into $s$ domain by the transform kernel of $\phi(s,t)$ which is a cross domain function. The simple example in signal processing is the Laplace transform or Fourier transform whose kernels are $\phi(s,t) = e^{-st}$ and $\phi(w,t) = e^{-jwt}$ resepctively.

Similarly a disrete transform $$y[k] = \sum_n \phi[k,n] x[n]$$ has the kernel of $\phi[k,n] = e^{-j \frac{2\pi}{N}kn}$ for DFT (discrete Fourier transform) for example.

In essence the kernel acts on the input and produces the output by modifying it. Therefore the kernel defines the character of the mapping (th transform). Programmatically the operation is such that the kernel remains fixed inside a function, whereas the input and outputs change by every function call utilization. Hence the name kernel. (You can of course create functions which accept kernels as arguments in addition to the input etc.)

The mathematical definition of the convolution operation can be seen to be similar to the transforms considered above with its kernel being the impulse response $h(x_1, x_2)$ (or $h[n_1, n_2]$) of the LSI system. For a discrete-time 2D LSI system whose impulse reponse $h[n_1, n_2]$ has a finite domain of support (FIR) it can be represented as a matrix as well.

Masks, in general, are not convolutional operators. Rather, they operate pixelwise (samplewise) on the image being operated. They are more programming concept than signal processing but somewhat finds applications such as in a window treated as a mask being applied to the input signal or a quantization mask applied on to the DCT coeffcicients for example. Masks find extensive usage for image processing effects. Their operating matrix can also be called as a kernel.

• Thanks for your reply, Fat32. Yes I was refering to convolution matrix in image processing..AFAIK, in the general integral transformation scenarios as you mentioned (FT or LT), what you called a "kernel" is known as an othorgonal basis, that the transformation projects/correlates the original function to the new basis, and there is no need to "flip" the basis, as it would required for kernels in convolution; In vector space, the kernel (of a linear transformation) is its null space, while the transformation is usually represented as a matrix which is called its skeleton... – bruin Sep 8 '17 at 7:38
• a kernel has nothing to do with the base vectors of an orthogonal / orthonormal basis. What you mention is an inner product of a given function with memebers of the basis so as to find the coefficients of decomposition of the signal into its base vectors. A transform in general maps a function into another function by the kernel. Nevertheless the concept of a kernel is a general one and is not bound to any special transform or operator in general. Finally, the Laplace kernel $e^{st}$ does not consitutde an orthogonal basis for example. – Fat32 Sep 8 '17 at 8:30
• Ok, thanks... I guess "A transform in general maps a function into another function by the kernel. Nevertheless the concept of a kernel is a general one and is not bound to any special transform or operator in general" addressed my original question directly. As the kernel concept discussed here is in its very general sense, now I tend to agree with what Marcus commented, that "I don't think there's a strict mathematical connection here". Thanks again. – bruin Sep 8 '17 at 8:53
• Also thanks for pointing out that "Laplace kernel $e^{st}$ does not consitutde an orthogonal basis", which I was not aware of... – bruin Sep 8 '17 at 9:01
• Later today I also took a look of Integral Transform on wikipedia, although I am not able digest most of details at the moment, I am a bit more convinced (or tend to think of) that the term "kernel" in convolution may have some connection with integral transformations in general, as you explained :) – bruin Sep 8 '17 at 14:46