Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2027, Vol. 61 Issue (1): 165-176    DOI: 10.3785/j.issn.1008-973X.2027.01.016
Computer Technology     
Similarity-based self-supervised representation learning method for time series classification
Han Zhang()
School of Data Science and Artificial Intelligence, Dongbei University of Finance and Economics, Dalian 116025, China
Download: HTML     PDF(1102KB) HTML
Export: BibTeX | EndNote (RIS)      

Abstract  

A similarity-vector-based self-supervised representation learning method, Sim2Vec, was proposed to address the challenges of acquiring high-quality feature representations and the strong dependency on labeled data in time series classification tasks. The method eliminated the reliance on artificial data augmentation strategies in self-supervised approaches. Instead, it employed the intrinsic similarity of time series in both the time and frequency domains as training signals, guiding the model to learn structure-preserving feature representations. A sequence-invariant gated self-attention mechanism was designed to enhance the model’s ability to focus on key structural features while effectively suppressing irrelevant noise interference. Experimental results demonstrated that Sim2Vec significantly outperformed multiple mainstream self-supervised learning models in classification performance and robustness under unsupervised pre-training conditions on 9 real-world time series datasets (including the Epilepsy dataset). In low-labeled-data scenarios, the method maintained the accuracy comparable to fully supervised approaches, demonstrating promising application prospects.



Key words: time series classification      self-supervised learning      similarity measurement      representation learning      attention mechanism     
Received: 13 June 2025      Published: 25 November 2026
CLC:  TP 183  
Cite this article:

Han Zhang. Similarity-based self-supervised representation learning method for time series classification. Journal of ZheJiang University (Engineering Science), 2027, 61(1): 165-176.

URL:

https://www.zjujournals.com/eng/10.3785/j.issn.1008-973X.2027.01.016     OR     https://www.zjujournals.com/eng/Y2027/V61/I1/165


基于相似性自监督表示学习的时间序列分类方法

针对时间序列分类任务中高质量特征表示获取困难及对标注数据依赖性强的问题,提出基于相似性向量自监督表示学习方法Sim2Vec. 该方法突破自监督方法对人工数据增强策略的依赖,将时间序列在时域与频域的内在相似性作为训练信号,引导模型学习保持结构一致性的特征表示. 设计顺序不变的门控自注意力机制,增强模型对关键结构特征的关注能力,有效抑制无关噪声干扰. 实验结果表明,在包括Epilepsy数据集的9个真实世界时间序列数据集中,Sim2Vec在无监督预训练条件下的分类性能与鲁棒性显著优于多种主流自监督学习模型. 在低标注数据场景下,该方法可以保持与全监督方法相当的准确率,展现出广阔的实际应用前景.


关键词: 时间序列分类,  自监督学习,  相似性度量,  表示学习,  注意力机制 
Fig.1 Overall framework of the Sim2Vec time series classification method based on similarity-based self-supervised representation learning
Fig.2 Schematic diagram of gated permutation-invariant self-attention mechanism
数据集$ {N}_{\text{tr}} $$ {N}_{\text{te}} $$ {N}_{\text{sub}} $$ L $$ C $$ {N}_{\text{cls}} $
WISDM2134 61414 421294036
PAMAP251 19211 59091005218
USC-HAD46 899932714100612
Sleep25 612891020300015
Skoda22 58756461506411
Opportunity15 0112374410011318
WISDM11 9605207134036
Epilepsy9200230050017812
UCI-HAR735229473012896
Table 1 Details of experimental datasets
模块卷积核大小C
通道卷积1$ 1\times 3 $16
空间卷积1$ C\times 1 $16
通道卷积2$ 1\times 3 $32
空间卷积2$ C\times 1 $32
Table 2 Configurations of time-domain and frequency-domain encoders
数据集fs/HzLNFFTM
WISDM2208012864
PAMAP2100256256128
USC-HAD100256256128
Sleep100256256128
Skoda98256256128
Opportunity3012812864
WISDM208012864
Epilepsy174256256128
UCI-HAR5012812864
Table 3 Configurations of fast Fourier transform processing parameters
数据集A/%
Sim2VecSeries2VecTS2VecTS-TCCTNCMCLTF-CTST
WISDM269.83$ \pm $0.2164.70$ \pm $0.3462.50$ \pm $0.4964.36$ \pm $1.0263.75$ \pm $0.9663.84$ \pm $0.9863.35$ \pm $2.0561.75$ \pm $1.34
PAMAP286.45$ \pm $0.2981.99$ \pm 0.41 $77.33$ \pm $0.5262.33$ \pm $1.2367.25$ \pm $1.9661.93$ \pm $1.7440.32$ \pm $1.7452.80$ \pm $1.15
USC-HAD60.17$ \pm $0.8756.12$ \pm $1.3447.28$ \pm $4.1753.89$ \pm $3.4351.19$ \pm $2.0550.45$ \pm $3.6048.51$ \pm $2.8346.57$ \pm $5.29
Sleep85.91$ \pm $1.3580.62$ \pm $3.5977.38$ \pm $4.7480.59$ \pm $1.8275.71$ \pm $4.9374.82$ \pm $4.1673.82$ \pm $6.6374.93$ \pm $5.68
Skoda99.37 ± 0.0498.65$ \pm $0.1198.09$ \pm $0.4496.39$ \pm $0.5295.39$ \pm $0.2794.04$ \pm $0.5396.40$ \pm $0.6786.95$ \pm $1.41
Opportunity86.32 ± 0.0486.56$ \pm $0.4285.00$ \pm $1.5682.90$ \pm $1.6883.81$ \pm $4.7382.54$ \pm $0.8583.06$ \pm $1.2582.81$ \pm $4.61
WISDM86.20 ± 0.2281.17$ \pm $0.2780.23$ \pm $2.3176.16$ \pm $2.3973.16$ \pm $5.4774.06$ \pm $2.1272.08$ \pm $3.0062.88$ \pm $6.54
Epilepsy98.95$ \pm $0.0297.61$ \pm $0.0397.52$ \pm $0.1896.83$ \pm $0.1295.83$ \pm $0.1596.91$ \pm $0.1396.73$ \pm $0.3382.61$ \pm $0.24
UCI-HAR95.40 ± 0.0994.77$ \pm $0.1393.76$ \pm $1.1789.21$ \pm $0.2490.21$ \pm $0.2788.46$ \pm $2.8481.09$ \pm $1.4686.21$ \pm $2.31
Average85.4082.4779.9078.0777.3776.3372.8170.83
Rank1.002.004.004.335.005.786.447.44
Table 4 Accuracy comparison results of self-supervised models
数据集模型DinterDintraMAEFLOPs/109GPU/109ttrain/(s?epoch?1)
EpilepsySim2Vec0.312.680.108.71.842
Series2Vec0.381.850.138.21.938
TS2Vec0.391.720.149.12.141
TS-TCC0.431.630.1610.42.252
TNC0.611.420.1812.33.054
MCL0.491.580.179.82.548
TF-C0.451.610.2411.22.747
TST0.721.300.4114.63.562
UCI-HARSim2Vec0.372.420.148.81.844
Series2Vec0.432.020.188.32.040
TS2Vec0.461.980.199.22.242
TS-TCC0.501.790.2110.32.351
TNC0.591.600.2512.13.053
MCL0.541.710.229.92.649
TF-C0.511.680.2811.32.848
TST0.801.410.4314.73.663
WISDMSim2Vec0.392.310.168.91.945
Series2Vec0.441.920.208.42.041
TS2Vec0.461.870.229.32.343
TS-TCC0.491.740.2410.52.452
TNC0.561.630.2612.23.155
MCL0.521.700.259.92.650
TF-C0.501.680.2911.42.849
TST0.821.380.4614.83.664
OpportunitySim2Vec0.412.270.189.01.946
Series2Vec0.461.880.218.52.042
TS2Vec0.481.820.239.32.344
TS-TCC0.501.730.2510.42.452
TNC0.581.610.2712.33.256
MCL0.541.680.269.82.751
TF-C0.521.650.3011.42.850
TST0.841.360.4714.93.765
Table 5 Comprehensive comparison results of models on representative datasets
Fig.3 Comparison of classification accuracy between linear probing models and supervised learning methods under different numbers of labeled samples
模型A/%Aavg/%
WISDM2PAMAP2USC-HADSleepSkodaOpportunityWISDMEpilepsyUCI-HAR
随机初始化65.9175.1056.2682.2099.1689.3484.6998.1796.0682.99
Sim2Vec69.0078.8057.5083.5099.4090.0087.0098.4096.6084.58
提升/百分点3.093.701.241.300.240.662.310.230.541.59
Table 6 Classification accuracy comparison results between random initialization and pretraining
模块A/%Aavg/%
WISDM2PAMAP2USC-HADSleepSkodaOpportunityWISDMEpilepsyUCI-HAR
去除注意力机制59.8370.6436.8461.2193.2582.9774.4091.0090.0373.37
去除频域分支60.8378.6438.8470.2196.2585.9779.7097.0092.6077.78
去除时域分支63.1671.8845.8263.3698.4286.4580.5496.6593.6477.76
Sim2Vec65.5082.7057.0081.5098.7087.0081.8097.7095.0083.15
Table 7 Comparison results of ablation experiments
损失函数Aavg/%损失函数Aavg/%
LSim(Sim2Vec)83.15LSim+Lcons83.30
Lcons(TS–TCC)78.07LSim+LSP84.15
LSP(TST)70.83LSim+LSP+Lcons84.25
Table 8 Analysis of complementarity among similarity-preserving and auxiliary losses
[1]   Mohammadi Foumani N, Miller L, Tan C W, et al. Deep learning for time series classification and extrinsic regression: a current survey. ACM Computing Surveys, 2024, 56 (9): 1- 45.
doi: 10.1145/3649447
[2]   Rajkomar A, Oren E, Chen K, et al. Scalable and accurate deep learning for electronic health records [PP/OL]. V3. arXiv (2018-05-11)[2026-06-13]. https://doi.org/10.48550/arXiv.1801.07860.
[3]   Bagnall A, Dau H A, Lines J, et al. The UEA multivariate time series classification archive, 2018 [PP/OL]. arXiv (2018-10-31)[2025-06-13]. https://doi.org/10.48550/arXiv.1811.00075.
[4]   Yue Z, Wang Y, Duan J, et al. TS2Vec: towards universal representation of time series. Proceedings of the AAAI Conference on Artificial Intelligence, 2022, 36 (8): 8980- 8987.
doi: 10.1609/aaai.v36i8.20881
[5]   Yang L, Hong S. Unsupervised time-series representation learning with iterative bilinear temporal-spectral fusion [C]// Proceedings of the 39th International Conference on Machine Learning. Baltimore: PMLR, 2022, 162: 25038–25054.
[6]   Goyal P, Caron M, Lefaudeux B, et al. Self-supervised pretraining of visual features in the wild [PP/OL]. V2. arXiv (2021-03-05)[2025-06-13]. https://doi.org/10.48550/arXiv.2103.01988.
[7]   van den Oord A, Li Y, Vinyals O. Representation learning with contrastive predictive coding [PP/OL]. V2. arXiv (2019-01-22)[2025-06-13]. https://doi.org/10.48550/arXiv.1807.03748.
[8]   Chen T, Kornblith S, Norouzi M, et al. A simple framework for contrastive learning of visual representations [C]// Proceedings of the 37th International Conference on Machine Learning. [S. 1. ]: PMLR, 2020, 119: 1597–1607.
[9]   He K, Fan H, Wu Y, et al. Momentum contrast for unsupervised visual representation learning [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 9726–9735.
[10]   Franceschi J Y, Dieuleveut A, Jaggi M. Unsupervised scalable representation learning for multivariate time series [C]// Advances in Neural Information Processing Systems. [S. 1. ]: Curran Associates, Inc. , 2019, 32: 4650–4661.
[11]   Tonekaboni S, Eytan D, Goldenberg A. Unsupervised representation learning for time series with temporal neighborhood coding [PP/OL]. arXiv (2021-06-01)[2025-06-13]. https://doi.org/10.48550/arXiv.2106.00750.
[12]   Eldele E, Ragab M, Chen Z, et al. Time-series representation learning via temporal and contextual contrasting [PP/OL]. arXiv (2021-06-26)[2025-06-13]. https://doi.org/10.48550/arXiv.2106.14112.
[13]   Wickstrøm K, Kampffmeyer M, Mikalsen K Ø, et al. Mixing up contrastive learning: self-supervised representation learning for time series. Pattern Recognition Letters, 2022, 155, 54- 61.
doi: 10.1016/j.patrec.2022.02.007
[14]   Foumani N M, Tan C W, Webb G I, et al. Series2vec: similarity-based self-supervised representation learning for time series classification. Data Mining and Knowledge Discovery, 2024, 38 (4): 2520- 2544.
doi: 10.1007/s10618-024-01043-w
[15]   Zhang X, Zhao Z, Tsiligkaridis T, et al. Self-supervised contrastive pre-training for time series via time-frequency consistency [C]// Proceedings of the Advances in Neural Information Processing Systems. New Orleans: NeurIPS, 2022: 3988–4003.
[16]   Devlin J, Chang M W, Lee K, et al. BERT: pre-training of deep bidirectional transformers for language understanding [C]// North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Minneapolis: ACL, 2019: 4171–4186.
[17]   Kostas D, Aroca-Ouellette S, Rudzicz F. BENDR: using transformers and a contrastive self-supervised learning task to learn from massive amounts of EEG data. Frontiers in Human Neuroscience, 2021, 15, 653659.
doi: 10.3389/fnhum.2021.653659
[18]   Mohammadi Foumani N, MacKellar G, Ghane S, et al. EEG2Rep: enhancing self-supervised EEG representation through informative masked inputs [C]// Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. Barcelona: ACM, 2024: 5544–5555.
[19]   Zerveas G, Jayaraman S, Patel D, et al. A transformer-based framework for multivariate time series representation learning [C]// Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. [S. l. ]: ACM, 2021: 2114–2124.
[20]   Fawaz H I. Deep learning for time series classification [PP/OL]. arXiv (2020-10-01)[2025-06-13]. https://doi.org/10.48550/arXiv.2010.00567.
[21]   Tan C W, Bergmeir C, Petitjean F, et al. Time series extrinsic regression: predicting numeric values from time series data. Data Mining and Knowledge Discovery, 2021, 35 (3): 1032- 1060.
doi: 10.1007/s10618-021-00745-9
[22]   Sakoe H, Chiba S. A dynamic-programming approach to continuous speech recognition [C]// Proceedings of the 20th International Congress of Acoustics. Budapest: [s. n. ], 1971: 65−68.
[23]   Petitjean F, Ketterlin A, Gançarski P. A global averaging method for dynamic time warping, with applications to clustering. Pattern Recognition, 2011, 44 (3): 678- 693.
doi: 10.1016/j.patcog.2010.09.013
[24]   Cuturi M, Blondel M. Soft-DTW: a differentiable loss function for time-series [C]// Proceedings of the International Conference on Machine Learning. [S. 1. ]: PMLR, 2017: 894–903.
[25]   Mohammadi Foumani S N, Tan C, Salehi M. Disjoint-CNN for multivariate time series classification [C]// Proceedings of the International Conference on Data Mining Workshops. Auckland: IEEE, 2021: 760–769.
[26]   Foumani N M, Tan C W, Webb G I, et al. Improving position encoding of transformers for multivariate time series classification. Data Mining and Knowledge Discovery, 2024, 38 (1): 22- 48.
doi: 10.1007/s10618-023-00948-2
[27]   Cooley J W, Lewis P A W, Welch P D. The fast Fourier transform and its applications. IEEE Transactions on Education, 1969, 12 (1): 27- 34.
doi: 10.1109/te.1969.4320436
[28]   Agrawal R, Faloutsos C, Swami A N. Efficient similarity search in sequence databases [C]// Proceedings of the 4th International Conference on Foundations of Data Organization and Algorithms. Berlin: Springer, 1993: 69–84.
[29]   Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need [C]//Proceedings of the Advances in Neural Information Processing Systems. Red Hook: Curran Associates Inc., , 2017, 30: 5998–6008.
[30]   Huber P J. Robust estimation of a location parameter. The Annals of Mathematical Statistics, 1964, 35 (1): 73- 101.
doi: 10.1214/aoms/1177703732
[31]   Andrzejak R G, Lehnertz K, Mormann F, et al. Indications of nonlinear deterministic and finite-dimensional structures in time series of brain electrical activity: dependence on recording region and brain state. Physical Review E, 2001, 64 (6): 061907.
doi: 10.1103/physreve.64.061907
[32]   Goldberger A L, Amaral L A, Glass L, et al. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation, 2000, 101 (23): E215- E220.
doi: 10.1161/01.cir.101.23.e215
[33]   Anguita D, Ghio A, Oneto L, et al. A public domain dataset for human activity recognition using smartphones [C]// Proceedings of the 21th European Symposium on Artificial Neural Networks. Bruges: [s. n. ], 2013: 3–4.
[1] Ruigui Shi,Fei Dong,Xiaoyun Xia,Dengcong Mu,Di Zhang,Kunpeng Ge. Low-light image object detection based on image enhancement and multi-attention mechanisms[J]. Journal of ZheJiang University (Engineering Science), 2027, 61(1): 120-130, 141.
[2] Heng YANG,Shaohan WANG,Qing DONG,Keyuan ZHAO,Mingliang YANG. Object pose estimation based on attention enhancement cross-modal multilayer fusion network[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1872-1880.
[3] Jiuyuan HUO,Hao JIANG,Chen CHANG. Text detection of highway traffic sign based on improved EAST[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1881-1889.
[4] Hongwei LI,Jianyang DING,Zhilei CHAI. Data-efficient lightweight model for real-time semantic segmentation[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1934-1941.
[5] Li SONG,Yuanyu WAN,Mingli SONG. Graph convolutional reinforcement learning via hybrid dilated attention mechanism[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1980-1990.
[6] Yaru HAO,Yuangao AI,Peng ZHANG,Wei WU. Semi-supervised multi-view similarity and discriminative representation joint learning[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1991-1997.
[7] Minghua ZHAO,Yuxuan LYU,Jiahao LYU,Yifei CHEN,Cheng SHI,Jing HU. Video anomaly detection based on multi-scale appearance and motion fusion[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(8): 1730-1738.
[8] Huixia LIU,Rongjing WANG,Yuxuan GAO,Meng CAO,Suying SHENG,Youpeng MA. Adaptive neural network-based deadlock-free vehicle scheduling algorithm for unsignalized intersections[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(8): 1832-1840.
[9] Kaiwei XU,Hafiz KHIZER BIN TALIB,Yanlong CAO,Yuanping XU,Zhijie XU,Jingchun SONG. Lightweight micro-expression recognition based on optical flow and convolutional vision Transformer[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(7): 1381-1391.
[10] Yanchun YANG,Jialong LI. Multi-path collaboration-based and spatial-spectral prior-based hyperspectral and multispectral image fusion[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(7): 1427-1437.
[11] Naizhou ZHANG,Yunchao ZHAO,Wei CAO,Xiaojian ZHANG. Image captioning generation based on multiple-view cross-modal feature fusion[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(6): 1205-1212.
[12] Yunhong LI,Qiqi ZHANG,Jinni CHEN,Weichong CHEN,Xueping SU,Chengming LIANG. Text-to-image generation algorithm based on generative adversarial network and coordinate attention mechanism[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(6): 1213-1220.
[13] Guoyan LI,Wei YU,Yupeng MEI,Minghui ZHANG,Xinqiang WANG. Building extraction from remote sensing images with global-local feature fusion[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(5): 1100-1108.
[14] Gang WAN,Xiaobo WANG,Gang SHI,Dezhen YE,Sisi ZHU,Fan SI. Underwater image enhancement algorithm based on feature refinement and attention-augmented reconstruction[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(4): 800-811.
[15] Yaolian SONG,Chi PENG,Jingmin TANG,Xuanzhi ZHAO,Guicai YU. Small object detection algorithm for optical remote sensing images based on fusion attention mechanism[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(4): 763-771.