Giter VIP home page Giter VIP logo

vdsr-reduction_with-keras's Introduction

VDSR-reduction_with-Keras

This is an implementation of "Deep Convolutional Neural Network on iOS Mobile Devices",Chun-Fu (Richard) Chen ,on the topic of VDSR(Very Deep Super Resolution).

The original model and part of my code is copied from "caffe-vdsr" , which is an implementation of "Accurate Image Super-Resolution Using Very Deep Convolutional Networks"

The reference: [1] Jiwon Kim, Jung Kwon Lee and Kyoung Mu Lee, "Accurate Image Super-Resolution Using Very Deep Convolutional Networks", Proc. of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016

##Instruction In order to implement a convolutional computation on mobile device, we need to prune the weights of the model to make the inference process faster,and at the same time,not losing the performance.

This method is trying to eliminate some kernels which are not important, and then fine-tune the model.

Dependency

Train(fine-tune)

Test

Usgae

###Data The data I used was preprocessd by Matlab,because I found that the "rgb2ycbcr" and "imresize" functions cannot be reproduced by any Python packages.

So you just need to place these data under the "Matlab_mat" directory.

  1. training data & aug training data : here and here

  2. training labels & aug training labels : here and here

  3. validation data & aug validationdata : here and here

  4. validation label & aug validation labels : here and here

Train(fine-tune)

  1. $ python3 VDSR_fine_tune.py

TEST

Have preprocessed low-resolution lena.png to im_y.mat (in kill_kernel directory)

  1. $ python3 TEST.py

  2. There will be an output "python_im_h_y.mat" , put it in your matlab directory

  3. open Matlab

  4. run Demo_PSNR_finetune.m you will see the PSNR

  5. You can run Demo_SR_Conv.m from the author's github to see the PSNR of original VDSR version. I list the answer in my PSNR_ans.txt

Result

###Eliminate 15% kenels (actually eliminate 29.8% parameters)

  • The Official PSNR: 36.635908 dB

  • My fine-tune model PSNR : 36.207958 dB

  • No fine-tune PSNR: 32.353143 dB

  • Just bicubic :32.723209 dB

###Eliminate 18% kenels (actually eliminate 34.9% parameters)

  • The Official PSNR: 36.635908 dB

  • My fine-tune model PSNR :36.093349 dB

  • No fine-tune PSNR: 32.345002 dB

  • Just bicubic :32.723209 dB

###Eliminate 20% kenels (actually eliminate 38.1% parameters)

  • The Official PSNR: 36.635908 dB

  • My fine-tune model PSNR :36.065349 dB

  • No fine-tune PSNR: 32.317988 dB

  • Just bicubic :32.723209 dB

Discover

You can see the matlab_vs_python to see the comparison of lots of functions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.