All Projects → Sibozhu → Motionblur Detection By Cnn

Sibozhu / Motionblur Detection By Cnn

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Motionblur Detection By Cnn

Music recommender
Music recommender using deep learning with Keras and TensorFlow
Stars: ✭ 528 (+319.05%)
Mutual labels:  convolutional-neural-networks, cnn, keras-tensorflow
Deep Learning With Python
Deep learning codes and projects using Python
Stars: ✭ 195 (+54.76%)
Mutual labels:  object-detection, convolutional-neural-networks, cnn
Text Detection Using Yolo Algorithm In Keras Tensorflow
Implemented the YOLO algorithm for scene text detection in keras-tensorflow (No object detection API used) The code can be tweaked to train for a different object detection task using YOLO.
Stars: ✭ 87 (-30.95%)
Mutual labels:  object-detection, keras-tensorflow
Fast Autoaugment
Official Implementation of 'Fast AutoAugment' in PyTorch.
Stars: ✭ 1,297 (+929.37%)
Mutual labels:  convolutional-neural-networks, cnn
Self Driving Car
A End to End CNN Model which predicts the steering wheel angle based on the video/image
Stars: ✭ 106 (-15.87%)
Mutual labels:  cnn, keras-tensorflow
Hyperdensenet
This repository contains the code of HyperDenseNet, a hyper-densely connected CNN to segment medical images in multi-modal image scenarios.
Stars: ✭ 124 (-1.59%)
Mutual labels:  convolutional-neural-networks, cnn
Tf Mobilenet V2
Mobilenet V2(Inverted Residual) Implementation & Trained Weights Using Tensorflow
Stars: ✭ 85 (-32.54%)
Mutual labels:  convolutional-neural-networks, cnn
Har Keras Cnn
Human Activity Recognition (HAR) with 1D Convolutional Neural Network in Python and Keras
Stars: ✭ 97 (-23.02%)
Mutual labels:  convolutional-neural-networks, keras-tensorflow
Cnn Paper2
🎨 🎨 深度学习 卷积神经网络教程 :图像识别,目标检测,语义分割,实例分割,人脸识别,神经风格转换,GAN等🎨🎨 https://dataxujing.github.io/CNN-paper2/
Stars: ✭ 77 (-38.89%)
Mutual labels:  object-detection, cnn
Deepgaze
Computer Vision library for human-computer interaction. It implements Head Pose and Gaze Direction Estimation Using Convolutional Neural Networks, Skin Detection through Backprojection, Motion Detection and Tracking, Saliency Map.
Stars: ✭ 1,552 (+1131.75%)
Mutual labels:  convolutional-neural-networks, cnn
Mobilenet Yolo
MobileNetV2-YoloV3-Nano: 0.5BFlops 3MB HUAWEI P40: 6ms/img, YoloFace-500k:0.1Bflops 420KB🔥🔥🔥
Stars: ✭ 1,566 (+1142.86%)
Mutual labels:  object-detection, cnn
Id Card Detector
💳 Detecting the National Identification Cards with Deep Learning (Faster R-CNN)
Stars: ✭ 114 (-9.52%)
Mutual labels:  object-detection, cnn
Lenet 5
PyTorch implementation of LeNet-5 with live visualization
Stars: ✭ 122 (-3.17%)
Mutual labels:  convolutional-neural-networks, cnn
Automatic Image Captioning
Generating Captions for images using Deep Learning
Stars: ✭ 84 (-33.33%)
Mutual labels:  convolutional-neural-networks, keras-tensorflow
Tensorflow Cifar 10
Cifar-10 CNN implementation using TensorFlow library with 20% error.
Stars: ✭ 85 (-32.54%)
Mutual labels:  convolutional-neural-networks, cnn
Recursive Cnns
Implementation of my paper "Real-time Document Localization in Natural Images by Recursive Application of a CNN."
Stars: ✭ 80 (-36.51%)
Mutual labels:  convolutional-neural-networks, cnn
Pytorch Learners Tutorial
PyTorch tutorial for learners
Stars: ✭ 97 (-23.02%)
Mutual labels:  convolutional-neural-networks, cnn
Deepway
This project is an aid to the blind. Till date there has been no technological advancement in the way the blind navigate. So I have used deep learning particularly convolutional neural networks so that they can navigate through the streets.
Stars: ✭ 118 (-6.35%)
Mutual labels:  convolutional-neural-networks, cnn
Cnn Interpretability
🏥 Visualizing Convolutional Networks for MRI-based Diagnosis of Alzheimer’s Disease
Stars: ✭ 68 (-46.03%)
Mutual labels:  convolutional-neural-networks, cnn
Hand Detection.pytorch
FaceBoxes for hand detection in PyTorch
Stars: ✭ 76 (-39.68%)
Mutual labels:  object-detection, cnn

MotionBlur-detection-by-CNN

To run the cnn model, just enter "cnn.py" and run the code. It might take 
couple hours to run it if you are using personal computers. Usinga server 
or GPU to run this code would significantly lower the running time.

Abstract

Our project aims to detect motion blur from a single, blurry image. We propose
a deep learning approach to predict the probabilistic distribution of motion blur at
the patch level using a Convolutional Neural Network (CNN).

1 Our approach

We approached the problem by slicing 100 images into 30x30 patches, and applied our own motion
blur algorithm to them (with a random rate of 50%). We then labeled the blurry and non-blurry
patches with 0s and 1s (0 for still, 1 for blurry), and loaded the modified images in as our training
data.
1.1 Generating the training data

We generated the training data using images from thePascal Visual Object Classes Challenge 2010 (VOC2010)data set. Our work was done in Python using thePIL,numpy,opency, andoslibraries.

Once we had the original images fromPascal, we had to modify them to fit our needs. We needed to
have 100 images, each partially blurred and with a corresponding matrix indicating which part of the
image is blurred.
We achieved this by:
  1. Making a blurred copy of the original image.
  2. Cutting both images (original and blurry) into 30 × 30 patches.
  3. Creating a 2D List in Python of size 30 × 30 , to represent each image patch We initialize each element to 0 (to represent non-blurry).
  4. Picking half the patches from the list and marking them as 1 (to represent blurry).
  5. Putting the final image together to get a partially-blurred, qualifying image (and its corre- sponding matrix).
  6. Saving the image as "n.jpg" (where n is the serial number of the image), and adding the matrix to a list (to form a 3D ’list of lists’) containing the matrices of all the image.

Image

Image of the original-to-blur process.

Image

Image of the image splitting process.

Image

The final image with its corresponding matrix.

We repeat the above for all 100 images, until we end up with a folder containing partially-blurred images"0.jpg"through"100.jpg", and a 3D list (named"labels") that contains 100 matrices. This lets us access the matrix for image"31.jpg", for example, by querying for"labels[31]".

2 Learning the Convolutional Neural Network (CNN)

Once we had the prepared images,we loaded them into our training set.We ran into a prob- lem loading the images into anumpyarray, where our images were of the form (30,30,3), while theKeras.Conv2Dlayer required input to be of the form (3,30,30). We solved this by using the numpy.swapexes()function to alter the images’ shape in order to fit the convolutional layer.

We then apply the CNN learning model. First, we apply a Convolution2D layer with 7 × 7 filters, followed by aReLUfunction. TheConvlayer’s parameters consiste of a set of learnable filters. Each filter is small spatially, but extends through the depth of the input volume.

During the forward pass, we slide each filter across the width and height of the input volume and compute the dot products between the entries of the filter and the input at any position.ReLUis the rectifier function- an activation function that can be used by neurons, just like any other activation function. A node using the rectifier activation function is called aReLU node.ReLUsets all negative values in the matrix x to 0, and all other values are kept constant. ReLU us computed after the convolution, and thus a nonlinear activation function (liketanhorsigmoid).

After that,we add aMaxPooling2Dlayerwith a pool size of 2 × 2. MaxPooling is a sample- based discretization process. The objective is to down-sample an input representation, reducing its dimensionality and allowing for assumptions to be made about features contained in the binned sub-regions.

We thenadd aDropoutlayerwith dropout rate of 0.2, which makes our learning process faster. Dropout randomly ignoring nodes is useful in CNN models because it prevents interdependencies from emerging between nodes. This allows the network to learn more and form a more robust relationship. We then do the’Conv2D, ReLU, MaxPooling2D, Dropout’circle again. Finally, we add a fully-connected layer withReLU, and thensoftmaxthe result.Softmaxis a classifier at the end of the neural network — a logistic regression to regularize outputs to a value between 0 and 1.

We set our model’s learning rate to be 0. 01. This might generally be too big, but we made this decision for the sake of brevity - it was the fastest way to show a result. We chose a batch size of 126 (because we had large training data). We also choseAdamas our optimizer as it’s the most efficient optimizer for our model.

After training with 100 epochs,we had testing accuracy of 92%, which is a very optimal rate for our model. Our training model is saved in an HDF5 file,"motionblur.h5".

Image

3 Conclusion

In this report, we have proposed a novel CNN-based motion blur detection apporach. We learn an effective CNN for estimating motion blur from local patches. In the future, we are interested in designing a CNN for eastimating motion kernels. We are also interested in design a CNN non-uniform motion deblurring method.

Acknowledgement

This report has been prepared for the Boston University Machine Learning course (CS 542), taken over the Summer 2, 2017 semester by the listed authors. It is intended to be used in compliance of the requirements of the course.

References

[1] Jian Sun, Wenfei Cao, Zongben Xu, Jean Ponce. Learning a convolutional neural network for non-uniform motion blur removal. CVPR 2015 - IEEE Conference on Computer Vision and Pattern Recognition 2015, Jun 2015, Boston, United States. IEEE, 2015,.

[2] “Visual Object Classes Challenge 2010 (VOC2010).” The PASCAL Visual Object Classes Challenge 2010 (VOC2010), PASCAL, 2010, host.robots.ox.ac.uk/pascal/VOC/voc2010/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].