TRLS: A Time Series Representation Learning Framework via Spectrogram for Medical Signal Processing

Luyuan Xie, Cong Li, Xin Zhang, Shengfang Zhai, Yuejian Fang, Qingni Shen, Zhonghai Wu · DOI

Abstract

Representation learning for medical time series data, such as ECG and EEG, is often hindered by noise, sparse annotations, and the difficulty of defining negative samples for contrastive learning. This paper introduces TRLS (Time series Representation Learning via Spectrogram), a self-supervised framework that transforms raw signals into the time-frequency domain. By utilizing a specialized Time-Frequency Recurrent Neural Network (TFRNN) and an asymmetric training strategy that eliminates the need for negative samples, TRLS achieves state-of-the-art performance across multiple medical datasets. Notably, the framework demonstrates exceptional robustness to noise and high efficiency in semi-supervised settings.

Introduction

Deep learning has revolutionized medical signal processing, yet extracting meaningful features from unlabeled, high-dimensional time series remains a significant hurdle. Current self-supervised learning (SSL) methods typically rely on contrastive learning, which requires the construction of "negative samples"—pairs of data points assumed to be different. In medical contexts, this assumption is often fragile; two distinct signal segments may represent the same underlying clinical condition, leading to "sampling bias" that degrades model performance.

Furthermore, standard encoders like Temporal Convolutional Networks (TCNs) often struggle to capture the complex, multi-scale frequency nuances inherent in physiological signals. TRLS addresses these challenges by shifting the representation space from the raw time domain to the time-frequency domain via spectrograms, providing a more stable and distinctive input for feature extraction.

Methodology

Spectrogram Transformation

Instead of processing raw waveforms, TRLS applies the Short-Time Fourier Transform (STFT) to generate 2D spectrograms. This transformation preserves temporal progression while explicitly aggregating frequency information. By treating the signal as an image-like representation, the model can leverage advanced augmentation techniques—such as ColorJitter and Gaussian Blur—which have proven more effective than traditional time-domain jittering for medical data.

The TFRNN Encoder

The core of the TRLS architecture is the Time-Frequency RNN (TFRNN). Unlike standard encoders, the TFRNN processes the spectrogram through two distinct paths:

  1. Temporal Path: Extracts features along the time axis to capture sequential dynamics.
  2. Frequency Path: Transposes the data to extract features along the frequency axis, capturing spectral characteristics.

These features are then integrated using pyramid pooling, allowing the model to capture multi-scale patterns essential for identifying complex medical events.

Learning Without Negatives

TRLS adopts an asymmetric training architecture inspired by Bootstrap Your Own Latent (BYOL). The framework consists of an "online" network and a "target" network. The model is trained to predict the representation of one augmented view of a signal from another view of the same signal. This approach completely bypasses the need for negative samples, eliminating the risk of confusing the model with clinically similar but technically distinct samples.

Experimental Results

Performance Benchmarks

The framework was evaluated on four diverse datasets: UCI HAR (activity recognition), Epileptic Seizure Recognition (EEG), Sleep-EDF (sleep staging), and ECG Waveform (atrial fibrillation). TRLS consistently outperformed existing state-of-the-art models like TS2Vec and TS-TCC. On the ECG Waveform dataset, TRLS achieved a significant accuracy boost, outperforming the nearest competitor by over 10%.

Semi-Supervised and Robustness Analysis

TRLS demonstrated remarkable efficiency in data-scarce environments. When fine-tuned with only 10% of labeled data, the model achieved performance levels comparable to fully supervised models trained on 100% of the data.

Additionally, the model showed superior resilience to environmental interference. In stress tests involving extreme Signal-to-Noise Ratios (SNR as low as 0.01), TRLS maintained an accuracy of over 81%, whereas traditional time-domain models experienced significant performance degradation. This suggests that the spectrogram-based approach effectively filters out transient noise that typically plagues raw signal processing.

Discussion and Conclusion

TRLS represents a shift toward more robust medical AI by prioritizing the time-frequency domain and moving away from the complexities of negative sample construction. The use of the TFRNN encoder allows for a more nuanced understanding of physiological signals, making it particularly suitable for long-duration monitoring like ECG and EEG.

Future work will focus on optimizing the computational overhead associated with dual-path RNNs and automating the selection of STFT window sizes. Expanding the framework to include multi-channel signals like EMG will further test the universality of the TFRNN architecture in clinical settings.

Summary updated

BibTeX
@inproceedings{xie2024trls,
  author = {Luyuan Xie and Cong Li and Xin Zhang and Shengfang Zhai and Yuejian Fang and Qingni Shen and Zhonghai Wu},
  title = {{TRLS: A Time Series Representation Learning Framework via Spectrogram for Medical Signal Processing}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10445812},
}
Figure