当前位置:网站首页>Image super-resolution using deep convolutional networks(SRCNN)解读与实现
Image super-resolution using deep convolutional networks(SRCNN)解读与实现
2022-07-06 03:18:00 【leon.shadow】
Image super-resolution using deep convolutional networks(SRCNN)
一、总结
网络结构
SRCNN网络结构比较简单,就是一个三层的卷积网络,激活函数选用Relu。
- 第一层卷积:实现对图片特征的提取。(卷积核个数为64,大小为9)
- 第二层卷积:对第一层卷积提取特征的非线性映射。(卷积核个数为32,大小为1[原文])
- 第三层卷积:对映射后的特征进行重建,生成高分辨率的图像.。(卷积核个数为1,大小为5)
评价指标
PSNR(峰值信噪比):PSNR值越大,重建效果越好。
import numpy
import math
def psnr(img1, img2):
mse = numpy.mean( (img1 - img2) ** 2 )
if mse == 0:
return 100
PIXEL_MAX = 255.0
return 20 * math.log10(PIXEL_MAX / math.sqrt(mse))
为什么只训练YCbCr的Y通道?
图像被转化为 YCbCr 色彩空间,尽管该网络只使用亮度通道(Y)。然后,网络的输出合并已插值的 CbCr 通道,输出最终彩色图像。我们选择这一步骤是因为我们感兴趣的不是颜色变化(存储在 CbCr 通道中的信息)而只是其亮度(Y 通道);根本原因在于相较于色差,人类视觉对亮度变化更为敏感。
损失函数
损失函数选用均方误差(MSE)
1×1卷积的作用?
- 实现维度的改变(升维或降维)
- 实现跨通道的交互和信息整合
- 减少计算量
- 可以实现和全连接层等价的效果
二、代码
model.py
from torch import nn
class SRCNN(nn.Module):
def __init__(self, num_channels=1):
super(SRCNN, self).__init__()
self.conv1 = nn.Conv2d(num_channels, 64, kernel_size=9, padding=9 // 2)
self.conv2 = nn.Conv2d(64, 32, kernel_size=5, padding=5 // 2)
self.conv3 = nn.Conv2d(32, num_channels, kernel_size=5, padding=5 // 2)
self.relu = nn.ReLU(inplace=True)
def forward(self, x):
x = self.relu(self.conv1(x))
x = self.relu(self.conv2(x))
x = self.conv3(x)
return x
原文为了避免边界效应没有加padding,而是在计算损失值的时候只计算中心区域的像素点。原文由于没有加padding,原图尺寸经过srcnn的三层卷积,分辨率会变小。
三、实验
对比卷积核大小(filter size)、卷积核数量(filter numbers)对复原效果的影响的实验
结论:卷积核数量越多,即特征向量维数越高,实验效果越好,但是会影响算法速度,故需要综合考虑;另外三层卷积层的卷积核大小越大,实验效果也会略微更好,同样会影响算法速度。
对比网络层数(layer numbers)对复原效果的影响的实验
结论:并非网络越深,效果越好,结果恰恰相反。作者也给出了解释:因为SRCNN没有池化层和全连接层,导致网络对初始参数和学习率非常敏感,结果即网络训练的时候非常难以收敛,即使收敛了也可能停在了坏的局部最小值(bad local minimum)处,并且即使训练了足够的时间,学习到的filter参数的分散度也不够好。
通道对复原效果影响的实验
结论:RGB通道联合训练效果最好;YCbCr通道下,Cb、Cr通道对性能提升基本无帮助,只基于Y通道的训练效果更好。
四、结论
SRCNN提出轻量的端到端网络SRCNN来解决超分问题,的确在当时取得了比传统方法性能更强、速度更快的效果,另外作者将基于SC(稀疏编码)的超分方法理解为卷积神经网络的一种形式,都是非常值得阅读的亮点。
五、论文地址
论文地址:https://arxiv.org/abs/1501.00092
边栏推荐
- Overview of OCR character recognition methods
- 11. Container with the most water
- Inherit day01
- Eight super classic pointer interview questions (3000 words in detail)
- BUUCTF刷题笔记——[极客大挑战 2019]EasySQL 1
- [Li Kou] the second set of the 280 Li Kou weekly match
- 八道超经典指针面试题(三千字详解)
- Exness foreign exchange: the governor of the Bank of Canada said that the interest rate hike would be more moderate, and the United States and Canada fell slightly to maintain range volatility
- The next industry outlet: NFT digital collection, is it an opportunity or a foam?
- js 正则过滤和增加富文本中图片前缀
猜你喜欢
Computer graduation project asp Net fitness management system VS development SQLSERVER database web structure c programming computer web page source code project
Résumé des méthodes de reconnaissance des caractères ocr
Map sorts according to the key value (ascending plus descending)
Codeforces 5 questions par jour (1700 chacune) - jour 6
three.js网页背景动画液态js特效
How to do function test well
MPLS experiment
Performance test method of bank core business system
BUUCTF刷题笔记——[极客大挑战 2019]EasySQL 1
The next industry outlet: NFT digital collection, is it an opportunity or a foam?
随机推荐
The next industry outlet: NFT digital collection, is it an opportunity or a foam?
Era5 reanalysis data download strategy
Custom attribute access__ getattribute__/ Settings__ setattr__/ Delete__ delattr__ method
Résumé des méthodes de reconnaissance des caractères ocr
codeforces每日5題(均1700)-第六天
BUUCTF刷题笔记——[极客大挑战 2019]EasySQL 1
Problems encountered in 2022 work IV
Leetcode problem solving -- 98 Validate binary search tree
Audio-AudioRecord Binder通信机制
Shell 传递参数
深入刨析的指针(题解)
Leetcode problem solving -- 173 Binary search tree iterator
tcpdump: no suitable device found
Data and Introspection__ dict__ Attributes and__ slots__ attribute
How to do function test well
My C language learning record (blue bridge) -- on the pointer
教你用Pytorch搭建一个自己的简单的BP神经网络( 以iris数据集为例 )
2022工作中遇到的问题四
MySQL advanced notes
适合程序员学习的国外网站推荐