Git Product home page Git Product logo

channelwise-saab-transform-1's Introduction

Channelwise-Saab-Transform

Feature extraction (Module 1) packages for PixelHop/PixelHop++.

Introduction

This is an implementation by Yijing Yang for the feature extraction part in the paper by Chen et.al. PixelHop++: A Small Successive-Subspace-Learning-Based (SSL-based) Model for Image Classification.

It is modified based on Chengyao Wang's implementation (ObjectOriented / Numpy version), with lower memory cost.

Note that this is not the official implementation.

Installation

This code has been tested with Python 3.7 and 3.8. Other dependent packages include: numpy, scikit-image, numba, scikit-learn, xgboost, tensorflow.keras.

Contents

  • saab.py: Saab transform.

  • cwSaab.py: Channel-wise Saab transform. Use energy threshold TH1 and TH2 to choose intermediate nodes and leaf nodes, respectively. Set 'cw' to 'False' in order to turn off the channel-wise structure.

  • pixelhop.py: Built upon cwSaab.py with additional functions of saving models, loading models, and concatenation operation across Hops.

  • Example of usage can be found at the bottom of each file.

  • main.py: some main structure of PixelHop and PixelHop++. Several TODOs are left blank for students to fill in.

    Note: All the images or data that are fed into these functions should be in the channel last format.

Memory usage

In PixelHop++, for MNIST dataset, using 10000 Training images for CWSaab will take approximately 4GB memory, 60000 Training images for CWSaab will take approximately 11G memory. In PixelHop, using same dataset, using 10000 Training images for Saab will take approximately 7GB memory, 60000 Training images for Saab will take approximately 14G memory. Note that different threshold value will give different memory usage.

channelwise-saab-transform-1's People

Contributors

janpuhou 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.