Code Monkey home page Code Monkey logo

mcfly's Introduction

GitHub Workflow Status Coverage PyPI DOI Binder

The goal of mcfly is to ease the use of deep learning technology for time series classification and regression. The advantage of deep learning is that it can handle raw data directly, without the need to compute signal features. Deep learning does not require expert domain knowledge about the data, and has been shown to be competitive with conventional machine learning techniques. As an example, you can apply mcfly on accelerometer data for activity classification, as shown in the tutorial.

If you use mcfly in your research, please cite the following software paper:

D. van Kuppevelt, C. Meijer, F. Huber, A. van der Ploeg, S. Georgievska, V.T. van Hees. Mcfly: Automated deep learning on time series. SoftwareX, Volume 12, 2020. doi: 10.1016/j.softx.2020.100548

Installation

Prerequisites:

  • Python 3.7, 3.8, 3.9 or 3.10
  • pip
  • Tensorflow 2

Installing all dependencies in separate conda environment:

conda env create -f environment.yml

# activate this new environment
source activate mcfly

To install the package, run in the project directory:

pip install mcfly

Visualization

We build a tool to visualize the configuration and performance of the models. The tool can be found on http://nlesc.github.io/mcfly/. To run the model visualization on your own computer, cd to the html directory and start up a python web server:

python -m http.server 8888 &

Navigate to http://localhost:8888/ in your browser to open the visualization. For a more elaborate description of the visualization see user manual.

User documentation

User and code documentation.

Contributing

You are welcome to contribute to the code via pull requests. Please have a look at the NLeSC guide for guidelines about software development.

We use numpy-style docstrings for code documentation.

Licensing

Source code and data of mcfly are licensed under the Apache License, version 2.0.

mcfly's People

Contributors

abelsiqueira avatar atzeus avatar bsolino avatar cwmeijer avatar egpbos avatar fdiblen avatar florian-huber avatar github-actions[bot] avatar jhidding avatar jspaaks avatar lyashevska avatar maltelueken avatar mkuzak avatar vincentvanhees avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mcfly's Issues

Investigate data shape

Investigate what ideal shape of data input should be for Keras in the context of time series

implement per channel CNN

Implement per channel CNN in normal CNN architecture, without LSTM. Add this to architecture generation functions.

Prep data London

Prepare dataset London: data format + take subset of two easy to recognize classes + standardize window length, e.g. 10 minutes

Collection of research ideas

I am listing some research ideas we could look into after there is a first prototype. These may need to be split into seperate issues but for now it may be easier to group them:

  1. Is processing a multi-channel with nbcol = 1 the same as splitting up the data and processing them in separated sequences and the connecting the branches in a fully connected final layer? The code will be less compact in the latter case, but what is the impact on classification performance?
  2. Should dropout be applied in between convolutional layers and/or in between LSTM layers? What do other do and what is the impact on the performance?
  3. L2 regularisation is not mentioned in the article by Ordonez, is L2 regularization the unmentioned standard for CNN?
  4. What is the impact of return_sequence = True versus False in the LSTM layer?
  5. How many dense layers do we need to have equal classification performance as one LSTM layer? 6. How many convolutional layers do we need to have equal classification performance as three convolutional and three LSTM layers?

Build first classifier

Build first classifier in Keras, locally (no DAS5): programming + training + evaluating using as a refernece: published UCR results or use shallow classifier if possible

Create compiled model objects

Create architecture specific for one datasets (UCR) and stored the model objects

Input:

  • Data
  • Non-data dependent hyper-parameters: Number of nodes in layer, learning rate, convolution size,...

Output:

  • Compile model object

hidden state tranference

Find out how to transfer the final hidden state for some sample on to the first hidden state for the next sample. This was done in Plotz (see literature on onedrive).

Brainstorm about architure

Brainstorm about architure (the engine of the tool), e.g.: did we implement all essential functionlaties?

Investigate whether the multi-channel CNN idea of Y Zhengh 2014 improves CNN classification

Y Zhengh proposed in 2014 that splitting multi-variate time series into univariate signals and processing them seperately as distinct branches of the DL architecture is better than processing them as a multi-variate CNN... I am not sure whether this makes sense, but it should be something we can easily test in Keras.

The article is on the onedrive, link: https://nlesc-my.sharepoint.com/personal/v_vanhees_esciencecenter_nl/_layouts/15/guestaccess.aspx?guestaccesstoken=cKHpfUmasCukMxT9YMnoLKvwtQiFlFYdJclcl%2buhcYM%3d&docid=17139ecaca7d5428ea3d184e04a4e59f5

find out why learning stops sometimes

Sometimes learning stops with a completely stable accuracy and loss on val and test set. Find out why the process is stuck.

  • Find cases when this is happening and save them so they can be replicated
  • Find out why it is stuck in the current state (0 gradient?)
  • Find out how the process got to the current state (vanishing or exploding gradient? inappropriate learning rate?)

document data format

for now this will be some kind of numpy array. Document somewhere what the exact format is
includes:
data
labels
labels to class name mapping

comment in this item the location where this is documented
also file format

batch normalization

In the CNN model, each convolution should be followed by a batch normalization layer before the activation layer. Look up details about batch normalization in for instance the dense layers.

  • Model generation function updated
  • Write test or think of good reason why not
  • Manually test if anything can be trained now
    Bonus points:
  • Compare performance of old CNN code with BN version. Did BN version at least improve a bit?

Implement kNN

Implement kNN
and add a function in optimal model search where kNN is applied to compjare with the best deep learning model,

Implement DTW

Implement DTW and integrate it into the optimal model finding.

Data normalization

We should not assume that incoming data is normalized. The user should not be responsible for that as it requires a bit of expert knowledge to know normalization is important and how it should be done. An easy way to handle and automate this is to start each model with a batch normalization layer.

Done after:

  • Add normalization to the module (as a layer or otherwise)
  • Write tests
  • Add something to the documentation about this

Sketch architure of a minimal deliverable

For example, classify a fixed length numeric time series into classes. No visualisation at this stage, but clear report on loss, accuracy and hyper-parameter optimization.
End product: Document with written description of the deliverable, where possible clarified with diagrams/tables and add to gitbook

Visualization of learning processes

SVG or similar that shows all learning curves together based on json output of training process. Models can be filtered with checkboxes for example.

Wrap-up code

Wrap up code as a Python module and github documentation as a starting point for generic functionality

Save data about training process

Don't return as json or similar the histories of all training processes. Write them to disk during or between training processes.

Framework for trying out variety of Keras architectures (python)

Input:

  • List with compiled model objects (predefined architectures and hyperparameters in keras)
  • data, start with UCR data

Output:

  • Performance per model object (bv accuracy, plots, sklearn, ....)
  • Trained weights per model object that can be used for unseen data classification

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.