Giter VIP home page Giter VIP logo

ridl-hex's Introduction

RIDL-Hex (Rotation Invariant Dictionary Learning using Hexagonal sampling)

====== RIDL-Hex is an efficient sparse dictionary learning algorithm for extracting rotation-aware or rotation-invariant features from images. RIDL-Hex benefits from a novel hexagonal sampling grid, a modified rotation-invariant sparse coding (based on Orthogonal Matching Pursuit) and a rotation learning algorithm, based on an exponentiated-gradient algorithm, for updating the dictionary matrix. The dictionary elements in RIDL-Hex are parametrized by their orientation, and a wide range of patterns can be well represented with a small dictionary size. RIDL-Hex achieves faster convergence than other dictionary learning algorithms not using this type of parameterization.

Requirements

This implementation of RIDL-Hex is based on python 2.7 and requires following python packages:

Main dependencies:

  • numpy
  • scipy
  • matplotlib

and limited usage of

  • opencv (in order to load image files)
  • pillow (used in creating a circular mask for square grid)
  • scikit-learn (used in efficient shuffling of the data matrix)

important note

Since calculating norms of columns of a matrix is a feature added in numpy 1.8, you need to have numpy 1.8 or newer. This code is tested on:

  • scipy (0.12.1)
  • numpy (1.10.4)
  • opencv (2.4.5)
  • pillow (2.0.)
  • matplotlib (1.2.0)
  • scikit-learan (0.17)

Examples

  • foveated_sampling.py creates a foveated samples from an image and displays the hexagonal grid structure used in foveated sampling

  • dict_learning_comp_sgd.py compares the convergence of reconstruction error for dictionary learning using stochastic gradient descent for rotation invariant and dictionary matrix with independent elements for different grid structures.

  • dict_learning_comp_rotation_update.py compares the convergence of reconstruction error for dictionary learning using rotation learning for rotation invariant and dictionary matrix with independent elements for different grid strctures.

  • activation_patterns_dict_elements.py learns a rotation invariant dictionary for three images (Lena, Barbara and a Van Gogh painting), and draws the pattern of usage of different orientations of each dictionary element.

ridl-hex's People

Contributors

arashaneh avatar

Watchers

James Cloos 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.