AskReference
ProcessIntermediate

How does DiffShape integrate diffusion-based learning and contrastive language-shapelet learning in its architecture?

DiffShape combines two modules: a self-supervised diffusion-based learning module that generates shapelets from subsequences, and a contrastive language-shapelet learning module that aligns the shapelet representations with embeddings of textual descriptions. The diffusion module uses real subsequences as conditioning inputs to guide shapelet generation, while the contrastive module uses label-derived and pseudo-label-derived text to align language and shapelet representations for classification.

DiffShape's architecture integrates a self-supervised diffusion-based learning module and a contrastive language-shapelet learning module. In the diffusion-based module, raw time series are segmented with a fixed-size sliding window, and these subsequences pass through a convolutional layer to produce initial shapelet representations S0. The model then computes cosine similarity between S0 and all raw subsequences to select the most similar real subsequences Sr, which serve as conditioning signals in a one-dimensional U-Net generator g(·). The forward diffusion adds Gaussian noise to S0; the reverse process is made conditional on Sr, yielding generated shapelets Ŝ0 that align with underlying data structure. Only Sr from labeled data are used for conditioning during generation, reducing sampling overhead and improving shapelet quality. In the contrastive module, textual descriptions are generated from ground-truth labels for labeled data and from classifier-derived pseudo-labels for unlabeled data. A fixed pretrained language encoder maps these texts into embeddings r̂l, while a shapelet encoder transforms both S0 and generated Ŝ0 into shapelet representations rs. Contrastive learning minimizes the distance between rs and r̂l, aligning language and shapelet representations, and rs is used for downstream classification. Together, these two modules form the two core components of the DiffShape model, enabling semi-supervised time series classification and interpretable shapelets.

Key points

  • DiffShape has two core modules: diffusion-based shapelet generation and contrastive language-shapelet learning.
  • Sliding-window subsequences are passed through a convolutional layer to create initial shapelets S0.
  • Cosine similarity selects real subsequences Sr most similar to S0; Sr conditions the diffusion reverse process.
  • A U-Net generator g(·) denoises noisy shapelets in a reverse diffusion process, producing generated shapelets Ŝ0.
  • Text descriptions come from ground-truth labels and pseudo-labels, encoded by a fixed pretrained language encoder.
  • A shapelet encoder maps S0 and Ŝ0 to representations rs; contrastive learning aligns rs with language embeddings r̂l.
  • Aligned shapelet representations rs are used for downstream classification.
Source:AI for Time Series_ Volume 1_ Unlocking Patterns with Deep Learning· Diffusion Language-shapelets for Semi-supervised Time-series Classification· p. 143–156

Related questions

Cover of AI for Time Series_ Volume 1_ Unlocking Patterns with Deep Learning

AI for Time Series_ Volume 1_ Unlocking Patterns with Deep Learning

Min Wu;Emadeldeen Eldele;Zhenghua Chen;Shirui Pan;Qingsong Wen;Xiaoli Li;

First edition · CRC Press

View this ebook