## 2 Materials and Methods
### The Proposed Method
#### 2.2.2 DAB-minimize Contrasting Learning  
The DAB-minimize contrasting module algorithm, presented in Algorithm 1, comprises two submodules: DABa-TC and DABa-CC. These modules aim to perceive and minimize the data augmentation bias (DAB) by optimizing the prediction performance and vector similarity with the assistance of the raw features stream (RFS). The loss functions are designed for both the min and max options. ```
Input:\(\{z_{n}^{t}\}_{n=1}^{N}\), \(\{z_{n}^{s}\}_{n=1}^{N}\), \(\{z_{n}^{u}\}_{n=1}^{N}\), \(K\) define: \(\mathcal{F}_{trans}\): the transformer encoder \(\mathcal{T}_{k}\): a set of linear layers \(\mathcal{T}_{k}\): a non-linear projection head \(T\): the time steps of each time series representation \(B\): the batch size \(dis(y^{\prime},y)\): the difference between prediction output \(y^{\prime}\) and ground truth \(y\) \(\text{sim}_{c}(\text{u},\text{v})\): the cosine similarity between \(u\) and \(v\) \(\text{sim}_{d}(\text{u},\text{v})\): the dot similarity between \(u\) and \(v\) Initialize: randomly select: \(t\) from \(1\) to \((T-K)\) \(Z_{n,t}^{t}=\{z_{n,t^{i}}^{t},i\leq t\}\), \(Z_{n,t}^{s}=\{z_{n,t^{i}}^{s},i\leq t\}\) for all \(t\in\{1,...N\}\)do \(c_{n,t}^{t}=P_{trans}(Z_{n,t}^{t})\), \(c_{n,t}^{s}=\mathcal{F}_{trans}(Z_{n,t}^{s})\), \(c_{n,t}^{u}=\mathcal{F}_{trans}(Z_{n,t}^{u})\) \(p_{n}^{t}=Projector(c_{n,t}^{t})\), \(p_{n}^{u}=Projector(c_{n,t}^{u})\), \(p_{n}^{u}=Projector(c_{n,t}^{u})\) for \(1\leq k\leq K\)do \(\alpha_{n,k}^{t}=\mathcal{T}_{k}(c_{n,t}^{t})\), \(\alpha_{n,k}^{s}=\mathcal{T}_{k}(c_{n,t}^{s})\) min\(dis(\alpha_{n,k}^{t},z_{n,t+k}^{u})+dis(\alpha_{n,k}^{t},z_{n,t+k}^{s})\), min\(dis(\alpha_{n,k}^{s},z_{n,t+k}^{u})+dis(\alpha_{n,k}^{s},z_{n,t+k}^{t})\) max\(\sum_{m\
eq n}(dis(\alpha_{n,k}^{s},z_{m}^{u})+dis(\alpha_{n,k}^{u},z_{m}^{u}))\) endfor \(\text{max}\sum_{m\
eq n}(jn_{n}^{t},p_{n}^{s}),sim(p_{n}^{t},p_{n}^{u}),sim(p_{ n}^{s},p_{n}^{u})\) min\(\sum_{m\
eq n}(sim_{c}(p_{n}^{t},p_{m}^{u})+sim_{c}(p_{n}^{s},p_{m}^{u}))\) endfor
```  
**Algorithm 1** DAB-aware Contrasting module algorithm. #### 2.2.2 DAB-minimize Contrasting Learning  
The DAB-minimize contrasting module algorithm, presented in Algorithm 1, comprises two submodules: DABa-TC and DABa-CC. These modules aim to perceive and minimize the data augmentation bias (DAB) by optimizing the prediction performance and vector similarity with the assistance of the raw features stream (RFS). The loss functions are designed for both the min and max options. ``` Input:\(\{z_{n}^{t}\}_{n=1}^{N}\), \(\{z_{n}^{s}\}_{n=1}^{N}\), \(\{z_{n}^{u}\}_{n=1}^{N}\), \(K\) define: \(\mathcal{F}_{trans}\): the transformer encoder \(\mathcal{T}_{k}\): a set of linear layers \(\mathcal{T}_{k}\): a non-linear projection head \(T\): the time steps of each time series representation \(B\): the batch size \(dis(y^{\prime}



\[L_{TC}^{t}=\frac{-1}{K}\sum_{k=1}^{K}log\frac{exp(\mathcal{T}_{k}(c_{t}^{t})^{T}z_{ t+k}^{s}+\mathcal{T}_{k}(c_{t}^{t})^{T}z_{t+k}^{u})}{\sum_{n}exp(\mathcal{T}_{k}(c_{t}^{t} )^{T}z_{n}^{s}+\mathcal{T}_{k}(c_{t}^{t})^{T}z_{n}^{u})} \tag{2}\]

DAB-Aware Contextual Contrasting

As shown in the Figure 2. To generate contextual information, a non-linear projection head [13] is applied to the temporal representations \(c_{t}^{t}\), contextual representations \(c_{t}^{s}\), and raw representations \(c_{t}^{u}\), resulting in projected representations \(p_{t}=Proj(c_{t})\in\mathbf{R}^{\frac{u}{u}}\). Figure 3 illustrates the formation of positive and negative pairs. Positive pairs consist of the representations obtained from the same sample, but are transformed using temporal and scale augmentation. Negative pairs, on the other hand, are formed by taking the representations transformed from different samples. In the TIA module, \(2N\) augmented samples are generated from \(N\) time series samples. Traditionally, contrastive learning methods only utilize the \(2N\) augmented samples for encoding, resulting in one positive pair and \(2(N-1)\) negative pairs for each sample.