Continuing from the previous session. It is part2. Click here for the previous link (part1) → https://t.co/CpVUj7CiHo?amp=1 Last time: I tried to build a super-resolution method / SRCNN ① Continued: I tried to build a super-resolution method / SRCNN ③
1.First of all 2. PC environment 3. Code description 4. At the end
Super-resolution is a technology that improves the resolution of low-resolution images and moving images, and SRCNN uses deep learning to measure results with higher accuracy than conventional methods. It is the method that was done. (Second time)
The full code is also posted on GitHub, so please check there. https://github.com/morisumori/srcnn_keras
cpu : intel corei7 8th Gen gpu : NVIDIA GeForce RTX 1080ti os : ubuntu 20.04
As you can see from GitHub, it mainly consists of three codes. ・ Datacreate.py → Data set generation program ・ Model.py → SRCNN program ・ Main.py → Execution program I have created a function with datacreate.py and model.py and executed it with main.py.
__ This time I will explain model.py. __
model.py
import tensorflow as tf
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.layers import Conv2D, Input
def SRCNN():
input_shape = Input((None, None, 1))
conv2d_0 = Conv2D(filters = 64,
kernel_size = (9, 9),
padding = "same",
activation = "relu",
)(input_shape)
conv2d_1 = Conv2D(filters = 32,
kernel_size = (1, 1),
padding = "same",
activation = "relu",
)(conv2d_0)
conv2d_2 = Conv2D(filters = 1,
kernel_size = (5, 5),
padding = "same",
)(conv2d_1)
model = Model(inputs = input_shape, outputs = [conv2d_2])
model.summary()
return model
As expected, it's short.
By the way, when I look at the SRCNN paper, I write that it has such a structure. It has a total of 3 layers. Please read the paper for the details of the model. Link → https://arxiv.org/pdf/1501.00092.pdf
In the code, the number of filters, kernel size, etc. described in the paper are applied as they are, so it seems that copying is fine. I'm building with keras.
I don't really explain about model ...? It's all a Convolution layer. For more information, see keras documentation.
This time I explained the model. The last is the implementation. Last time: I tried to build a super-resolution method / SRCNN ① Continued: I tried to build a super-resolution method / SRCNN ③
If you have any questions or comments, please do not hesitate to contact us!
Recommended Posts