/CF-4-TSC

Hand-Crafted Convolutional Filters 4 Time Series

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Deep Learning For Time Series Classification Using New Hand-Crafted Convolution Filters

This is the code of our paper "Deep Learning For Time Series Classification Using New Hand-Crafted Convolution Filters" accepted as a regular paper at 2022 IEEE Internation Conference on Big Data.
This work was done by Ali Ismail-Fawaz, Maxime Devanne, Jonathan Weber and Germain Forestier.

A web page of our paper can be found here.

Summary of proposed custom filters

summary

Architectures:

Architecture 1: Custom Only Fully Convolutional Network (CO-FCN)

Architecture 2: Hybrid Fully Convolutional Network (H-FCN)

Architecture 3: Hybrid Inception (H-Inception) and Hybrid InceptionTime (H-InceptionTime)

Note: H-InceptionTime is an ensemble of five H-Inception models, such as in H. Ismail Fawaz et al.

Usage of code

DOCKER IMAGE

Now you can use docker image to run the code instead of using pip or conda environments.

To build the image run the following

docker build -t IMAGE_NAME .

To build and run the container with mounted directories for the data and the code, run the following:

docker run --gpus all -it --name CONTAINER_NAME -v "$(pwd):/cf4tsc-code" -v "/path/to/ucr/on/your/pc:/ucr_archive" IMAGE_NAME bash

This will open a shell where you can execute the code.

CODE EXECUTION

In order to run an experiment on a dataset of the UCR Archive with a specific classifier of three proposed above, simply run the main.py file.
This file takes as arguments the following:

--dataset : The dataset to be used, by default "Coffee" is used<br>
--classifier : The classifier to be used, choices = ['CO-FCN', 'H-FCN', 'H-Inception'], by default 'H-Inception' is used
--runs : The number of experiments to be done, by default five are done
--output-directory : The output directory, by default the output is saved into 'results/'

Adaptation of code

The change that should be done is the directory in which the datasets are stored.
The variable to be changed is in this line folder_path.

Results

CO-FCN -- see results csv on the 128 datasets of the UCR Archive

H-FCN -- see results csv on the 128 datasets of the UCR Archive

H-Inception -- see results csv on the 128 datasets of the UCR Archive

Critical Difference Diagram, using the code of H. Ismail Fawaz et al.

Matrix 1v1 Comparison

Requirements

For a conda environment see requirement file

For a pip environment see requirement file

Reference

If you use this code, please cite our paper:

@inproceedings{ismail-fawaz2022hccf,
  author = {Ismail-Fawaz, Ali and Devanne, Maxime and Weber, Jonathan and Forestier, Germain},
  title = {Deep Learning For Time Series Classification Using New Hand-Crafted Convolution Filters},
  booktitle = {2022 IEEE International Conference on Big Data (IEEE BigData 2022)},
  city = {Osaka},
  country = {Japan},
  pages = {972-981},
  url = {doi.org/10.1109/BigData55660.2022.10020496},
  year = {2022},
  organization = {IEEE}
}