当前位置:网站首页>[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.)
北京邮电大学–计算机视觉与深度学习–鲁鹏
边栏推荐
猜你喜欢
(十六)图的基本操作---两种遍历
剑指 Offer 2022/7/3
win云服务器搭建个人博客失败记录(wordpress,wamp)
Kubernetes基本入门-元数据资源(四)
纳米级完全删除MYSQL5.7以及一些吐槽
Lombok的一些使用心得
Introduction of linear regression 01 - API use cases
Jupyter Notebook installed library;ModuleNotFoundError: No module named 'plotly' solution.
【CV-Learning】目标检测&实例分割
CTFshow—Web入门—信息(9-20)
随机推荐
Kubernetes基本入门-概念介绍(一)
Redis持久化方式RDB和AOF详解
Android connects to mysql database using okhttp
Kubernetes基本入门-名称空间资源(三)
flink-sql查询配置与性能优化参数详解
TensorFlow2学习笔记:8、tf.keras实现线性回归,Income数据集:受教育年限与收入数据集
oracle临时表与pg临时表的区别
Matplotlib中的fill_between;np.argsort()函数
剑指 Offer 20226/30
oracle的number与postgresql的numeric对比
多项式回归(PolynomialFeatures)
剑指 Offer 2022/7/3
Linear Regression 02---Boston Housing Price Prediction
剑指 Offer 2022/7/12
thymeleaf中 th:href使用笔记
yolov3 data reading (2)
Upload靶场搭建&&第一二关
【CV-Learning】卷积神经网络预备知识
TensorFlow2 study notes: 5. Common activation functions
sklearn中的pipeline机制