"Convolution" is actually very simple

I believe that many times, when we see the "convolution", always forced to look ignorant state, not only because it is more difficult to understand the original meaning of the concept, but also because it plays out in the vagaries of different applications the role of people also often confused. But in fact, these applications are essentially the same thing, to understand the origin of convolution, you can learn by analogy. In fact, I personally convolution understanding, very long time in a state of half-comprehended, as some tricky points of the Fourier transform, not just mistakes in the application, without understanding. But if you really want to do a good job of learning things, I think the real theoretical basis of learning before, the essence of the concept must be clear. Therefore, this article is for students to engineering, science and other fields interested and finishing, popular content simple, easy to understand.

What is the convolution

Convolution, most of the time we are in various engineering fields, signal fields have seen common nouns, such as system

Easy to understand, is that

* = Input Output System

While it might seem just a complex mathematical formula, but it has important physical significance, because such systems are ubiquitous in nature, a computing system output the best way is to use convolution. More generally, we have many other application areas:

Statistics , the moving average is a weighted convolution.

Probability theory , the two statistically independent variables X and Y and the probability density function is the convolution of the probability density function of X and Y.

Acoustics , the echo sound source can be reflected with a reflection effect of the various functions represented by convolution.

Electronic Engineering and Signal Processing , any linear system can be output by the input signal and the system function (impulse response of the system) convolve obtained.

Physics , any of a linear system (in line with the principle of superposition) are present convolution.

Computer science , the convolutional neural network (CNN) is a deep learning algorithms, in recent years, is widely used in pattern recognition, image processing and other fields.

These six areas, convolution played a crucial role. In the face of complex cases, as a powerful approach, a convolution gives a simple but effective output. For the field of machine learning, especially in deep learning, most notably CNN convolutional neural network (Convolutional Neural Network, CNN), has achieved very good results in the actual image field, beginning a sweep of various algorithms will appear.

 

 

那么,到底什么是卷积呢?
  
  

 

First, give us a Nutshell famous on to explain violence on convolution:

For example, your boss ordered you to work, you have to go downstairs to play pool, and later discovered by the boss, he was very angry, slapped you a slap in the face (note that this is the input signal, pulse), so your face will gradually (cheap cheap land) to drum up a package, your face is a system, and bulging package is a response to slap your face, well, so that the signal system and set up a corresponding sense of connection.

The following assumptions also need to ensure rigorous argument: Suppose your face is linear time-invariant systems, that is, whenever the boss hit you a slap, playing in the same position your face (which seems to require your face enough smooth, if you say you are long a lot of acne, and even the entire nerve conduction can not be everywhere continuous everywhere, and that too difficult, I have nothing to say ha ha), your face will always be in the same time interval a drum up to the same height as the package, and it is assumed that the packet size in the drum as the system output. Well, then, you can enter the following core content - convoluted! 

If you have to go to play pool every day, then every day your boss every fan a slap in the face, but when you slap the boss fight, you 5 minutes to swelling, so a long time, you will even adapt to this life ...... If one day, the boss is intolerable, at intervals of 0.5 seconds uninterrupted fan start your process, so the question becomes, for the first time you drum up fan pack has not swelling, second slap came , your face pack could drum up twice as high, the boss continue to fan your pulse constantly in your face action, the effect is constantly superimposed, so that these effects can be summed, the result is the height of the package on your face a time-varying function of (Note understanding);

if the boss Zaihen that, with increasing frequency, so that you identify unclear interval, then, summed it becomes calculus. It can be understood, a fixed moment in this process, the extent of the muster pack on your face and what about it? And before each fight you all about! But the contribution of the times is not the same, the sooner slap fight, the smaller the contribution, so this means that the output of a time before many times after input multiplied by the superposition of the respective output attenuation coefficient form of a point and then outputs points at different times together, form a function which is the function after convolution, the convolution is a function of the size of your face pack over time.

I had a few minutes to pack your swelling, but if continuous play, has disappeared for hours not swollen, is not it a smooth process it? Reflected in the formula of the University of Cambridge, f (a) is of a slap in the face, g (xa) is the first level of a slap role in x time, take it and then superimposed on the ok


by the popularization of our example from basic We understand the concept of convolution, then the more restrictive definition of what is it?

Mathematically speaking, just a convolution operation, many have not studied for signal processing, automatic control of a variety of professional students who can not understand the terminology. We then continued:

 

本质上卷积是将二元函数 U(x,y) = f(x)g(y) 卷成一元函数 V(t) ,俗称降维打击。
  
  

 

 

 

How volume?

Considering the functions f and g to be equal status, or the variables x and y should be equal status, it is a desirable way along the line x + y = t rolled:

V(t) = \int_{x+y=t} U(x,y) \,\mathrm{d}x

Rolled what is the use?

It can be used for multi-digit multiplication, for example:

\begin{align}42 \times137 &= (2\times10^0+4\times10^1)(7\times10^0+3\times10^1+1\times10^2) \\&= (2\times7)\times10^0 + (2\times3+4\times7)\times10^1+(2\times1+4\times3)\times10^2 + (4\times1)\times10^3 \\&= 14 + 340+1400+4000 \\&= 5754\end{align}

Sequence (14,34,14,4) Note that the right side of the second equal sign of each coefficient in brackets constituted, in fact, the sequence (2,4) and (7,3,1) convolution

When the multiplier is not doing so it seemed a bit boring, but very long to calculate the product of two numbers long, then this treatment can come in handy, because you can use a Fast Fourier Transform (FFT) to obtain convolution , faster than in the example of a hard ride.

 

Here there is a less stringent understand:
(\sum_{n=1}^{\infty}{a_nx^n})(\sum_{n=1}^{\infty}{b_nx^n})=\sum_{n=1}^{\infty}(\sum_{k=1}^{n}a_kb_{n-k})x^n
x^nis the "base", a_nis the expansion coefficient in this group. On the basis expansion coefficients of the two polynomial product of two polynomials is the convolution coefficients are each deployed on the substrate.
x^nCorresponding to different frequencies \ Exp (ikt), which corresponds to the Fourier transform coefficients. Nature is equal to the product of the Fourier transform of the convolution of the Fourier transform.

 

Convolution kernel (involving derivation process can be skipped):

First, we have such a concept : the inner product integration, the three projection is actually a meaning from a certain point of view .

Defines a set of vectors \alpha=(\alpha_{1},\alpha_{2},...,\alpha_{n}), the other set of vectors \ Beta = (\ {1} beta_, \ beta_ {2}, ..., \ n} {beta_), the inner product can be expressed as:

\alpha \beta = \alpha_{1} \beta_{1}+\alpha_{2} \beta_{2}+...+\alpha_{n} \beta_{n}=\sum_{i=1}^{n}{\alpha_{i} \beta_{i}}

This is the inner product that is also accumulating (points). It is to be understood that the concept of a projection vector as a set of projection on a base vector b, coordinates (\alpha_{1},\alpha_{2},...,\alpha_{n}), and a point at which the projected three-axis coordinates in the 3D Euclidean space is a reason.

 

In this way, take a look at what to do in the Fourier transform:

F(\omega)=\int_{-\infty }^{+\infty} f(t)e^{-j\omega t}dt

Reintroducing a perfect formula, Euler's formula:

e^{ix}=cosx+isinx

As can be seen from the definition of the Fourier formula is f (t) and e^{-j\omega t}multiplying its integration in the infinite domain, then in fact the f (t) projected e^{-j\omega t}on, if not understood e^{-j\omega t}is converted into two orthogonal trigonometric functions (Euler's formula works here). So this clearer: Fourier the f (t) is projected onto the sine and cosine of two orthogonal spatial relations. This may be more easily seen from the Fourier series decomposition projection relationship expression of the periodic signal.

 

What then read Fourier seems cybernetics in the field of Laplace transforms are doing:

F(s)=\int_{0}^{\infty}f(t)e^{-\sigma t}e^{-j\omega t}dt=\int_{0}^{\infty}f(t)e^{-st}dt

First, the control field is often used inside step signal, unfortunately it does not satisfy Dirichlet third condition, so it Fourier transform immunity, so clever use of a Laplace attenuation factor e ^ {- \ sigma t}will be attenuated before making its Fourier transform . To the region of the negative infinite attenuation factor that may become a factor increment, the Laplace transform is limited to the region of greater than 0, less than 0 for the area expressed by the system like the initial state. From this point of view, Laplace transform equivalent to f(t)e^{-\sigma t}made a unilateral Fourier transform.

 

Then, the above analysis, we can see the Laplace f (t) projected into e^{-st}the space, which is the s-plane. It is more powerful than the Fourier place not only see the imaginary axis \omegacomponent, see Fourier see also the attenuation factor of the real axis \sigmacomponent, which is Fourier impossible. Therefore Laplace on the basis of the Fourier expansion of the signal to the real axis attenuation factor, the attenuation factor \sigmaand the damping system \zeta, the natural angular oscillation frequencies \omega_{n}are closely related, directly affects the settling time of the system t_{s}. Automatic control theory learned students should know the frequency domain section, we get the frequency domain response curve of the system transfer function is directly transformed equation is s = jw. This means that in a live-dimensional Fourier space imaginary axis, Laplace living space in a two-dimensional plane, on a one-dimensional space is expressed in the form w, only needs to be done to reduce the dimension in the s-plane wants to get to.

 

Go back and look at the convolution projection:

f (t) * g (t) = \ int _ {- \ infty} ^ {+ \ infty} f (\ year) g (t- \ years) d \ years

This projection strange, before it projected first g (\ year)made a antisymmetric, then projection. Corresponding to the systematic convolutional expressions derived above:

r (t) * f (t) = \ int _ {- \ infty} ^ {+ \ infty} f (\ year) r (t- \ years) d \ years

Prior equivalent projection, first the input signal r (t) turned over 180 ° on the time axis, and the projection system then f (t). Projective we can well be appreciated, both the vector inner product operation is equivalent to line projector or a projection space of the polyhedron in three-dimensional space on a plane, which is equivalent to one kind of projection operation area of overlap. From this point of view, if the relationship between the input and output of the three systems, then from the perspective of the graphics to understand why a first-order system in the step response is a monotonically increasing output under the curve. Here a graphical interpretation with respect to convolution in a wikipedia, more students want to learn to jump on their own: Convolution

(Many thanks to almost learn to know to help King Nemo)

   

 

Convolution application

图像处理:用一个模板和一幅图像进行卷积,对于图像上的一个点,让模板的原点和该点重合,然后模板上的点和图像上对应的点相乘,然后各点的积相加,就得到该点的卷积值。对图像上的每个点都这样处理。由于多数模板都对称,所以模板不旋转。
卷积是一种积分运算,用来求两个曲线重叠区域面积。可以看作加权求和,可以用来消除噪声、特征增强。 把一个点的像素值用它周围的点的像素值的加权平均代替。

卷积是一种线性运算,图像处理中常见的mask运算都是卷积,广泛应用于图像滤波。 
卷积关系最重要的一种情况,就是在信号与线性系统或数字信号处理中的卷积定理。利用该定理,可以将时间域或空间域中的卷积运算等价为频率域的相乘运算,从而利用FFT等快速算法,实现有效的计算,节省运算代价。

 

 

 

下面是来自sselssbh博客的一个例子,非常形象的解释了卷积在图像领域的作用
  
  

 

有这么一副图像,可以看到,图像上有很多噪点: 
Write pictures described here

高频信号,就好像平地耸立的山峰: 
Write pictures described here

看起来很显眼。

平滑这座山峰的办法之一就是,把山峰刨掉一些土,填到山峰周围去。用数学的话来说,就是把山峰周围的高度平均一下。

平滑后得到: 
Write pictures described here

4.2 计算

卷积可以帮助实现这个平滑算法。

有噪点的原图,可以把它转为一个矩阵: 
Write pictures described here

然后用下面这个平均矩阵(说明下,原图的处理实际上用的是正态分布矩阵,这里为了简单,就用了算术平均矩阵)来平滑图像:

g=⎡⎣⎢⎢191919191919191919⎤⎦⎥⎥

记得刚才说过的算法,把高频信号与周围的数值平均一下就可以平滑山峰。

比如我要平滑a1,1 点,就在矩阵中,取出a1,1点附近的点组成矩阵 f ,和 g 进行卷积计算后,再填回去 
Write pictures described here

要注意一点,为了运用卷积, g 虽然和 f 同维度,但下标有点不一样: 
Write pictures described here

Write pictures described here

写成卷积公式就是:

(f∗g)(1,1)=∑k=02∑h=02f(h,k)g(1−h,1−k)

要求c4,5,一样可以套用上面的卷积公式。

这样相当于实现了 g 这个矩阵在原来图像上的划动(准确来说,下面这幅图把 g 矩阵旋转了180∘ ):

再比如做馒头

楼下早点铺子生意太好了,供不应求,就买了一台机器,不断的生产馒头。 

假设馒头的生产速度是 f(t) ,那么一天后生产出来的馒头总量为: ∫240f(t)dt 

馒头生产出来之后,就会慢慢腐败,假设腐败函数为 g(t) ,比如,10个馒头,24小时会腐败: 10∗g(t) 

想想就知道,第一个小时生产出来的馒头,一天后会经历24小时的腐败,第二个小时生产出来的馒头,一天后会经历23小时的腐败。 如此,我们可以知道,一天后,馒头总共腐败了: ∫240f(t)g(24−t)dt 

文章也发表在我的个人博客中:点击打开链接 ,更多与机器学习,数学相关知乎,欢迎访问~

参考文章:

1. CSDN:最容易理解的对卷积(convolution)的解释http://blog.csdn.net/bitcarmanlee/article/details/54729807

 

2. 知乎:如何通俗易懂的解释卷积?https://www.zhihu.com/question/22298352

3. 卷积为什么叫卷子?https://www.zhihu.com/question/54677157

4. 果壳:关于卷积的一个血腥讲解 https://www.guokr.com/post/342476/

5. 小木虫:https://zh.wikipedia.org/wiki/%E5%8D%B7%E7%A7%AF%E5%AE%9A%E7%90%86 


(Original Address https://blog.csdn.net/qq_39521554/article/details/79083864)

Guess you like

Origin blog.csdn.net/Godsolve/article/details/93736589