当前位置:网站首页>[CV-Learning] Convolutional Neural Network Preliminary Knowledge
[CV-Learning] Convolutional Neural Network Preliminary Knowledge
2022-08-04 06:06:00 【Xiao Liang has to work hard】
卷积
How convolution works
After this transformation,The image is smoothed.We can call the function used in the transformation卷积核.
卷积核is image processing,给定输入图像,输入图像中一个小区域中像素加权平均后成为输出图像中的每个对应像素,其中权值由一个函数定义,这个函数称为卷积核.
例如:In the above example, the convolution kernel is
[1,1,1;
1,1,1; * 1/9
1,1,1]
卷积定义
The convolution kernel is usually performed180度调整,即公式中HThe corresponding operation performed by the function subscript.但是在实际使用时,Because the model obtained by training is consistent with the model to be predicted,Therefore, it is not necessary to adjust the convolution kernel.
Any translation operation can be implemented using convolution,Smoothing is also possible、
卷积性质
性质 | 公式 |
---|---|
叠加性 | filter(f1+f2)=filter(f1)+filter(f2) |
平移不变性 | filter(shift(f))=shift(filter(f)) |
交换律 | a* b=b* a |
结合律 | (a* b) c=a (b* c) |
分配律 | a* (b* c)=a* b + a* c |
标量 | ka* b=a* kb=k(a* b) |
边界填充
The image after the convolution operation is smaller than the original image,After filling through the border,We can achieve the same image size before and after convolution.
Common filling methods:
1.常数填充(常用0填充)
2.拉伸
3.镜像
高斯卷积核
Disadvantages of averaging kernels:The convolved image will produce some horizontal and vertical bars(振铃).
解决方法:Weights are assigned based on how far the neighborhood pixels are from the center,Use a Gaussian convolution kernel.
Concept and generation steps
Gaussian convolution kernel can effectively suppress noise,实现图像平滑.At the same time through its stacking and decomposition,It can be used to reduce the complexity of convolution calculations.
参数设置
1.方差变化
2.尺寸变化
结论:
1.Large variance or large size convolution kernel has strong smoothing ability.
2.Small variance or small size convolution kernel has weak smoothing ability.
3.经验法则:Set the kernel half-window width to 3 sigma,The final convolutional template size is 2*3 sigma +1.由此可知,The kernel template size should be odd.
例如,标准差sigma为1,模板尺寸为7.
性质
Especially the second and third properties,可以减少运算量,降低时间复杂度.
例如:用尺寸为m * mThe convolution kernel convolution size of n * n的图像,时间复杂度为O(n2m2),If nuclear isolation is used,时间复杂度为O(n2m).
噪声
噪声分类
高斯噪声
Reduce Gaussian noise by using large-size templates or large-variance convolution kernels,But using a large variance in turn smooths out useful information.
中值滤波
Salt and pepper noise and impulse noise are not well removed using Gaussian convolution kernels,So we can use a median filter.
边缘提取
边缘:A point in an image where there is a noticeable and sharp change in brightness.
Why study fringe?
1.Obtain semantic and shape information in the encoded image.
2.Relative to pixel representation,The edge representation appears more compact.
边缘的分类
边缘检测
Edge derivatives
After simplifying the derivation formula,Image derivatives can be obtained using convolution kernels.
The larger the magnitude of the gradient,The more likely it is to be marginal.
噪声的影响
When the image has noise,We need to smooth the image first.Take Gaussian noise as an example,Gaussian convolution kernel processing is required first,After the smooth image is obtained, take the derivative.
The above operation requires two convolutions,速度较慢.According to the properties of the Gaussian convolution kernel,我们可以进行Gaussian first-order partial derivative kernel的求取.
Gaussian first-order partial derivatives
Due to the small computational complexity of obtaining the Gaussian first-order partial derivative template,So it is equivalent to saving the calculation amount of one convolution.
Gaussian first-order partial derivative kernel(模板)
parameter only方差affect it.
To pay attention to details,Need to use small variance;If only rough density contour information is needed,Need to use large variance.
高斯卷积核vsGaussian first-order partial derivative kernel
Because the high-contrast point of the Gaussian first-order partial derivative kernel has a large response value,So the edge can be identified.
Canny边缘检测器
If a side is thick,可以进行非极大值抑制处理.
门限处理(门限:Choose a critical value for the gradient)
双阈值
A high threshold edge is obtained by a high threshold,A low threshold edge is obtained by a low threshold,But low-threshold edges only keep the regions connected to high-threshold edges.
处理步骤
1.Convolve the image with a Gaussian first-order partial derivative kernel.
2.Calculate the gradient magnitude and direction at each point.
3.非极大值抑制
**will be wide“边缘”Thin to a single pixel width.
4.Connections and thresholds(滞后)
**定义两个阈值:高、低
**使用高阈值开始边缘曲线,Continue the edge curve with a low threshold.
纹理表示
纹理分类
Texture representation method based on convolution kernel group
思路:Extract texture bases in images using convolution kernel groups(基元);Utilize primitive statistics to represent textures.
Principles of classification tasks
1.Primitive positions are ignored
2.Pay attention to the texture corresponding to which primitive appears and how often the primitive appears.
卷积核组的设计
1.卷积核类型(边缘、Bars and dots)
2.卷积核尺度(3-6个)
3.卷积核方向(3个)
例:A pixel in the upper left corner of the image can be defined by 48维向量表示,If the third value is large,Primitives that illustrate the existence of a third convolution kernel group.
(Although each pixel is determined by 48维,But only a limited number of dimensions represent the features of the pixel,So the vector is a sparse vector,Compressed storage is possible.)
北京邮电大学–计算机视觉与深度学习–鲁鹏
边栏推荐
猜你喜欢
安装dlib踩坑记录,报错:WARNING: pip is configured with locations that require TLS/SSL
纳米级完全删除MYSQL5.7以及一些吐槽
MySql--存储引擎以及索引
postgresql 事务隔离级别与锁
TensorFlow2 study notes: 5. Common activation functions
【CV-Learning】卷积神经网络预备知识
fill_between in Matplotlib; np.argsort() function
k9s-终端UI工具
【CV-Learning】图像分类
智能合约安全——delegatecall (1)
随机推荐
MySql的concat和group_concat的区别
The pipeline mechanism in sklearn
TensorFlow2 study notes: 8. tf.keras implements linear regression, Income dataset: years of education and income dataset
[Introduction to go language] 12. Pointer
read and study
【深度学习21天学习挑战赛】备忘篇:我们的神经网模型到底长啥样?——model.summary()详解
Learning curve learning_curve function in sklearn
(十四)平衡二叉树
SQL练习 2022/7/4
剑指 Offer 2022/7/5
[Deep Learning 21 Days Learning Challenge] 1. My handwriting was successfully recognized by the model - CNN implements mnist handwritten digit recognition model study notes
The difference between oracle temporary table and pg temporary table
SQl练习 2022/6/29
SQL练习 2022/7/1
(六)递归
RecyclerView的用法
Dictionary feature extraction, text feature extraction.
flink-sql所有表格式format
MySQL最左前缀原则【我看懂了hh】
[Deep Learning 21-Day Learning Challenge] 3. Use a self-made dataset - Convolutional Neural Network (CNN) Weather Recognition