Skip to content

MSD-IRIMAS/CF-4-TSC

Repository files navigation

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}
}

Acknowledgments

This work was supported by the ANR DELEGATION project (grant ANR-21-CE23-0014) of the French Agence Nationale de la Recherche. The authors would like to acknowledge the High Performance Computing Center of the University of Strasbourg for supporting this work by providing scientific support and access to computing resources. Part of the computing resources were funded by the Equipex Equip@Meso project (Programme Investissements d’Avenir) and the CPER Alsacalcul/Big Data. The authors would also like to thank the creators and providers of the UCR Archive.