Skip to content

The paper "Triple-shapelet Networks for Time Series Classification"

Notifications You must be signed in to change notification settings

qianlima-lab/TSN

Repository files navigation

TSN

The paper "Triple-shapelet Networks for Time Series Classification" accepted by 2019 IEEE International Conference on Data Mining (ICDM).

Code

The code for Triple-shapelet Networks model.

Dependencies

  • Keras 2.0 and above
  • tensorflow 1.0 and above

Usage

This repository contains a demo of ECGFiveDays in the UCR dataset. The ECGFiveDays dataset is located in UCR_TS_Archive_2015/ECGFiveDays/. You can run the command

python triple_shapelet_network_demo.py

to test the model.

Classification Result

Here is the full result of TSN on 85 UCR time series classification datasets. The results of the deep learning methods are taken from [1], and the results of the other methods are from [2].

Dataset DDDTW DTDC BOSS TSF TSBF LPS EE COTE MLP FCN ResNet Encoder TSN
Adiac 0.701 0.701 0.765 0.731 0.770 0.770 0.665 0.790 0.397 0.844 0.829 0.484 0.798
ArrowHead 0.789 0.720 0.834 0.726 0.754 0.783 0.811 0.811 0.778 0.843 0.845 0.804 0.869
Beef 0.667 0.667 0.800 0.767 0.567 0.600 0.633 0.867 0.720 0.697 0.753 0.643 0.900
BeetleFly 0.650 0.650 0.900 0.750 0.800 0.800 0.750 0.800 0.870 0.860 0.850 0.745 0.900
BirdChicken 0.850 0.800 0.950 0.800 0.900 1.000 0.800 0.900 0.775 0.955 0.885 0.665 0.800
Car 0.800 0.783 0.833 0.767 0.783 0.850 0.833 0.900 0.767 0.905 0.925 0.758 0.917
CBF 0.997 0.980 0.998 0.994 0.988 0.999 0.998 0.996 0.872 0.994 0.995 0.947 0.989
Chlorine 0.708 0.713 0.661 0.720 0.692 0.608 0.656 0.727 0.802 0.814 0.844 0.573 0.868
CinCECGtorso 0.725 0.852 0.887 0.983 0.712 0.736 0.942 0.995 0.840 0.824 0.826 0.911 0.975
Coffee 1.000 1.000 1.000 0.964 1.000 1.000 1.000 1.000 0.996 1.000 1.000 0.979 1.000
Computers 0.716 0.716 0.756 0.720 0.756 0.680 0.708 0.740 0.563 0.822 0.815 0.574 0.624
CricketX 0.754 0.754 0.736 0.664 0.705 0.697 0.813 0.808 0.591 0.792 0.791 0.694 0.721
CricketY 0.777 0.774 0.754 0.672 0.736 0.767 0.805 0.826 0.600 0.787 0.803 0.675 0.723
CricketZ 0.774 0.774 0.746 0.672 0.715 0.754 0.782 0.815 0.617 0.811 0.812 0.692 0.723
Diatom 0.967 0.915 0.931 0.931 0.899 0.905 0.944 0.928 0.910 0.313 0.301 0.913 0.990
DistPhxAgeGp 0.705 0.662 0.748 0.748 0.712 0.669 0.691 0.748 0.657 0.710 0.717 0.737 0.835
DistPhxCorr 0.732 0.725 0.728 0.772 0.783 0.721 0.728 0.761 0.726 0.760 0.771 0.741 0.810
DistPhxTW 0.612 0.576 0.676 0.669 0.676 0.568 0.647 0.698 0.617 0.690 0.665 0.688 0.785
Earthquakes 0.705 0.705 0.748 0.748 0.748 0.640 0.741 0.748 0.717 0.727 0.712 0.748 0.820
ECG200 0.830 0.840 0.870 0.870 0.840 0.860 0.880 0.880 0.916 0.889 0.874 0.923 0.900
ECG5000 0.924 0.924 0.941 0.939 0.940 0.917 0.939 0.946 0.929 0.940 0.934 0.940 0.948
ECGFiveDays 0.769 0.822 1.000 0.956 0.877 0.879 0.820 0.999 0.970 0.987 0.975 0.982 1.000
ElectricDevices 0.592 0.594 0.799 0.693 0.703 0.681 0.663 0.713 0.592 0.702 0.729 0.674 0.625
FaceAll 0.902 0.899 0.782 0.751 0.744 0.767 0.849 0.918 0.793 0.945 0.839 0.793 0.811
FaceFour 0.830 0.818 1.000 0.932 1.000 0.943 0.909 0.898 0.840 0.928 0.955 0.815 0.955
FacesUCR 0.904 0.908 0.957 0.883 0.867 0.926 0.945 0.942 0.833 0.946 0.955 0.874 0.940
FiftyWords 0.754 0.754 0.705 0.741 0.758 0.818 0.820 0.798 0.684 0.627 0.740 0.723 0.690
Fish 0.943 0.926 0.989 0.794 0.834 0.943 0.966 0.983 0.848 0.958 0.979 0.866 0.943
FordA 0.723 0.765 0.930 0.815 0.850 0.873 0.738 0.957 0.730 0.904 0.920 0.923 0.933
FordB 0.667 0.653 0.711 0.688 0.599 0.711 0.662 0.804 0.603 0.878 0.913 0.890 0.918
GunPoint 0.980 0.987 1.000 0.973 0.987 0.993 0.993 1.000 0.927 1.000 0.991 0.936 0.967
Ham 0.476 0.552 0.667 0.743 0.762 0.562 0.571 0.648 0.691 0.718 0.757 0.727 0.781
HandOutlines 0.868 0.865 0.903 0.919 0.854 0.881 0.889 0.919 0.918 0.806 0.911 0.899 0.831
Haptics 0.399 0.399 0.461 0.445 0.490 0.432 0.393 0.523 0.433 0.480 0.519 0.427 0.438
Herring/Otoliths 0.547 0.547 0.547 0.609 0.641 0.578 0.578 0.625 0.528 0.608 0.619 0.586 0.688
InlineSkate 0.562 0.509 0.516 0.376 0.385 0.500 0.460 0.495 0.337 0.339 0.373 0.292 0.340
InsWngSnd 0.355 0.473 0.523 0.633 0.625 0.551 0.595 0.653 0.607 0.393 0.507 0.633 0.624
ItalyPower 0.950 0.951 0.909 0.960 0.883 0.923 0.962 0.961 0.954 0.961 0.963 0.965 0.969
LrgKitApp 0.795 0.795 0.765 0.571 0.528 0.717 0.811 0.845 0.473 0.902 0.900 0.619 0.707
Lightning2 0.869 0.869 0.836 0.803 0.738 0.820 0.885 0.869 0.670 0.739 0.770 0.692 0.787
Lightning7 0.671 0.658 0.685 0.753 0.726 0.740 0.767 0.808 0.630 0.827 0.845 0.625 0.767
Mallat 0.949 0.927 0.938 0.919 0.960 0.908 0.940 0.954 0.918 0.967 0.972 0.876 0.940
Meat 0.933 0.933 0.900 0.933 0.933 0.883 0.933 0.917 0.897 0.853 0.968 0.742 0.933
MedicalImages 0.737 0.745 0.718 0.755 0.705 0.746 0.742 0.758 0.721 0.779 0.770 0.734 0.722
MidPhxAgeGp 0.539 0.500 0.545 0.578 0.578 0.487 0.558 0.636 0.531 0.553 0.569 0.579 0.798
MidPhxCorr 0.732 0.742 0.780 0.828 0.814 0.773 0.784 0.804 0.770 0.801 0.809 0.761 0.778
MidPhxTW 0.487 0.500 0.545 0.565 0.597 0.526 0.513 0.571 0.534 0.512 0.484 0.592 0.637
MoteStrain 0.833 0.768 0.879 0.869 0.903 0.922 0.883 0.937 0.858 0.937 0.928 0.840 0.908
NonInvThor1 0.806 0.841 0.838 0.876 0.842 0.812 0.846 0.931 0.916 0.956 0.945 0.916 0.877
NonInvThor2 0.893 0.890 0.901 0.910 0.862 0.841 0.913 0.946 0.917 0.953 0.946 0.932 0.902
OliveOil 0.833 0.867 0.867 0.867 0.833 0.867 0.867 0.900 0.667 0.723 0.830 0.400 0.900
OSULeaf 0.880 0.884 0.955 0.583 0.760 0.740 0.806 0.967 0.557 0.977 0.979 0.576 0.711
PhalCorr 0.739 0.761 0.772 0.803 0.830 0.756 0.773 0.770 0.735 0.820 0.839 0.767 0.823
Phoneme 0.269 0.268 0.265 0.212 0.276 0.237 0.305 0.349 0.096 0.325 0.334 0.172 0.216
Plane 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 0.978 1.000 1.000 0.976 1.000
ProxPhxAgeGp 0.800 0.795 0.834 0.849 0.849 0.795 0.805 0.854 0.856 0.831 0.853 0.844 0.859
ProxPhxCorr 0.794 0.794 0.849 0.828 0.873 0.842 0.808 0.869 0.733 0.903 0.921 0.791 0.880
ProxPhxTW 0.766 0.771 0.800 0.815 0.810 0.732 0.766 0.780 0.767 0.767 0.780 0.812 0.815
RefDev 0.445 0.445 0.499 0.589 0.472 0.459 0.437 0.547 0.379 0.508 0.525 0.488 0.445
ScreenType 0.429 0.437 0.464 0.456 0.509 0.416 0.445 0.547 0.403 0.625 0.622 0.383 0.459
ShapeletSim 0.611 0.600 1.000 0.478 0.961 0.867 0.817 0.961 0.503 0.724 0.779 0.530 0.872
ShapesAll 0.850 0.838 0.908 0.792 0.185 0.873 0.867 0.892 0.771 0.895 0.921 0.758 0.812
SmlKitApp 0.640 0.648 0.725 0.811 0.672 0.712 0.696 0.776 0.371 0.783 0.786 0.596 0.709
SonyAIBOSurf1 0.742 0.710 0.632 0.787 0.795 0.774 0.704 0.845 0.672 0.960 0.958 0.743 0.857
SonyAIBOSurf2 0.892 0.892 0.859 0.810 0.778 0.872 0.878 0.952 0.834 0.979 0.978 0.839 0.909
StarlightCurves 0.962 0.962 0.978 0.969 0.977 0.963 0.926 0.980 0.949 0.961 0.972 0.957 0.947
Strawberry 0.954 0.957 0.976 0.965 0.954 0.962 0.946 0.951 0.961 0.972 0.981 0.946 0.977
SwedishLeaf 0.901 0.896 0.922 0.914 0.915 0.920 0.915 0.955 0.851 0.969 0.956 0.930 0.915
Symbols 0.953 0.963 0.967 0.915 0.946 0.963 0.960 0.964 0.832 0.955 0.906 0.821 0.949
SyntheticControl 0.993 0.997 0.967 0.987 0.993 0.980 0.990 1.000 0.976 0.985 0.998 0.996 0.997
ToeSegmentation1 0.807 0.807 0.939 0.741 0.781 0.877 0.829 0.974 0.583 0.961 0.963 0.659 0.921
ToeSegmentation2 0.746 0.715 0.962 0.815 0.800 0.869 0.892 0.915 0.745 0.880 0.906 0.795 0.877
Trace 1.000 0.990 1.000 0.990 0.980 0.980 0.990 1.000 0.807 1.000 1.000 0.960 1.000
TwoLeadECG 0.978 0.985 0.981 0.759 0.866 0.948 0.971 0.993 0.762 1.000 1.000 0.863 0.972
TwoPatterns 1.000 1.000 0.993 0.991 0.976 0.982 1.000 1.000 0.946 0.871 1.000 1.000 0.962
UWaveGestX 0.779 0.775 0.762 0.804 0.831 0.829 0.805 0.822 0.767 0.754 0.780 0.786 0.798
UWaveGestY 0.716 0.698 0.685 0.727 0.736 0.761 0.726 0.759 0.698 0.639 0.670 0.696 0.706
UWaveGestZ 0.696 0.679 0.695 0.743 0.772 0.768 0.724 0.750 0.697 0.726 0.750 0.711 0.698
UWaveGestAll 0.935 0.938 0.939 0.957 0.926 0.966 0.968 0.964 0.955 0.817 0.860 0.954 0.952
Wafer 0.980 0.993 0.995 0.996 0.995 0.997 0.997 1.000 0.996 0.997 0.999 0.996 0.999
Wine 0.574 0.611 0.741 0.630 0.611 0.630 0.574 0.648 0.565 0.587 0.744 0.500 0.870
WordSynonyms 0.730 0.730 0.638 0.647 0.688 0.755 0.779 0.757 0.598 0.564 0.622 0.613 0.658
Worms 0.584 0.649 0.558 0.610 0.688 0.701 0.662 0.623 0.457 0.765 0.791 0.571 0.591
WormsTwoClass 0.649 0.623 0.831 0.623 0.753 0.753 0.688 0.805 0.601 0.726 0.747 0.639 0.696
Yoga 0.856 0.856 0.918 0.859 0.819 0.869 0.879 0.877 0.855 0.839 0.870 0.820 0.843
best 5 3 15 5 5 5 8 19 0 17 15 1 24
AVG rank 8.676 8.800 6.082 7.259 7.329 7.635 6.835 3.529 10.312 5.641 4.465 8.994 5.441

Reference

[1] Fawaz H I, Forestier G, Weber J, et al. Deep learning for time series classification: a review[J]. Data Mining and Knowledge Discovery, 2019, 33(4): 917-963.
[2] Bagnall A, Lines J, Bostrom A, et al. The great time series classification bake off: a review and experimental evaluation of recent algorithmic advances[J]. Data Mining and Knowledge Discovery, 2017, 31(3): 606-660.

About

The paper "Triple-shapelet Networks for Time Series Classification"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages