Giter VIP home page Giter VIP logo

blurnet's Introduction

Image Blur Detection

A blur detection model trained to detect blurry images. Implemented with pytorch lightning.

Dataset

The model is trained on a blur dataset from kaggle. The dataset consists of 1050 blurred and sharp images, consisting of 3x350 photos (motion-blurred, defocused-blurred, sharp).

CNN Architecture

The CNN model consists of 2x convolutional layers with pooling and dropout following 2x fully connected layers. For the first convolution layer a kernel size of 7x7 followed by a ReLU activation function, max pooling (2x2) and dropout (0.2) was chosen. In the second convolution layer a kernel of size 5x5 and again follow by ReLU, max pooling and dropout was applied. After the convolutions two fully connected layers (1024 units) are connected.

Training the model

The model was designed with the help of pytorch lightning. For data preparation the training set was split into training, validation and test set with an 80/20 train/test and 90/10 validation/test split. For training the EarlyStopping callback of pytorch lightning based on validation loss was used to avoid overfitting of the model. A batch size of 128 was chosen and data augmentation in the train dataloader was performed. As input a cropped image of size 96x96 pixels was chosen, depending on hardware constraints this could be increased. After training for more than 200 epochs the model reached an accuracy of 81.91%.

How to run

Install requirements:

$ pip install -r requirements.txt

Prepare datasets by splitting into train, validation and test set:

$ python prepare_labels.py <path_to_datafolder>

Train model:

$ python train.py

blurnet's People

Contributors

dabauxi avatar

Stargazers

 avatar Laurent Etiemble avatar Udai Arneja avatar Xelawk avatar smileyeee avatar  avatar

Watchers

 avatar Paul Angerer avatar

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.