---
title: 'Evo-TFS: Evolutionary Time Series Oversampling'
url: https://www.emergentmind.com/topics/evo-tfs
type: topic
---

# Evo-TFS: Evolutionary Time Series Oversampling

Evo-TFS is an evolutionary oversampling approach tailored for imbalanced time series classification. It utilizes strongly typed genetic programming (STGP) to generate synthetic minority sequences that are simultaneously close to real data in both time and frequency domains. By integrating time-domain (dynamic time warping) and frequency-domain (discrete Fourier transform) characteristics into its fitness function, Evo-TFS addresses key shortcomings of traditional interpolative oversamplers, producing diverse and structurally realistic sequences that improve downstream classification performance [2601.01150].

## 1. Background and Motivation

Imbalanced time series classification problems arise when one or more classes—the "minority"—are underrepresented in a labeled dataset $D = \{ (x_1, y_1), \ldots, (x_n, y_n) \}$, where $x_i \in \mathbb{R}^T$ and $y_i \in C = \{1,\dots, M\}$. For a class $j$, the imbalance ratio is defined as $IR_j = \max_{k} N_k / N_j$, where $N_j$ is the count of class $j$ samples. High $IR$ values ($IR \gg 1$) bias standard classifiers toward the majority class and hinder the recognition of minorities, which are often of greater practical interest.

Traditional oversampling methods such as SMOTE and its variants interpolate linearly in the feature space. While fast, these methods disregard intrinsic temporal order and rhythms, resulting in synthetic series that fail to preserve salient autocorrelations and frequency content. Even time-aware approaches like T-SMOTE, which constrain interpolation to the time domain, do not systematically enforce spectral realism; they typically miss preserving dominant frequencies or phase relationships in the data. 

## 2. Evo-TFS Algorithmic Structure

Evo-TFS adopts strongly typed genetic programming to "grow" synthetic time series directly. Each individual in the evolving population is a tree-structured function composed of:

- **Terminals**: Subseries $S \in \mathbb{R}^L$, extracted from original data via a length-$L$ sliding window (all $S$ collected into a pool $\mathcal{S}$), and random floating-point constants sampled from $[-1,1]$.
- **Functions**: Protected element-wise arithmetic ($+$, $-$, $\times$, $\div$ with $x \div 0 \to 1$), and the "Connect" operator, which concatenates three length-$L$ arrays into a length-$3L$ sequence.
- **Tree layers**: Input $\to$ Smelt (arithmetic) $\to$ Connect $\to$ full output sequence.

The GP process follows:

```python
Procedure GP_Generate(x*, S, pop_size, G, p_c, p_m, α, σ):
  # x*: target minority sequence
  # S: terminal pool (subseries + constants)
  P ← InitializePopulation(pop_size, max_depth=10, terminals=S, functions={+,-,*,/,Connect})
  For gen in 1..G:
    EvaluateFitness(P, x*, α, σ)
    E ← SelectElites(P, E=2)
    P_new ← E
    While |P_new| < pop_size:
      p₁ ← TournamentSelect(P, k=3)
      p₂ ← TournamentSelect(P, k=3)
      if rand()<p_c:
        (c₁, c₂) ← TypePreservingCrossover(p₁,p₂)
      else:
        (c₁,c₂) ← (Clone(p₁), Clone(p₂))
      if rand()<p_m: c₁ ← TypeConstrainedMutation(c₁, max_depth=10)
      if rand()<p_m: c₂ ← TypeConstrainedMutation(c₂, max_depth=10)
      P_new += {c₁, c₂}
    P ← P_new
  end for
  return TopK(P, k_out)
EndProcedure
```

Operators include ramped half-and-half initialization, k-tournament selection ($k = 3$), subtree crossover (rate $p_c$), type-constrained mutation (rate $p_m$), and elitism ($E = 2$).

## 3. Fitness Evaluation

Each candidate synthetic sequence $\hat{y} \in \mathbb{R}^T$ is evaluated against target minority sample $x^*$. Fitness is a convex combination of time-domain and frequency-domain similarity measures:

- **Dynamic Time Warping (DTW) Distance**

  For $x = \{v_1, \ldots, v_T\}$ and $\hat{y} = \{\hat{y}_1, \ldots, \hat{y}_T\}$:

  $$
  D(i,j) = |v_i - \hat{y}_j|, \quad
  C(i,j) = D(i,j) + \min \{C(i-1, j), C(i, j-1), C(i-1, j-1)\}
  $$
  with $C(1,1) = D(1,1)$, and $D_{DTW}(x, \hat{y}) = C(T, T)$.

- **DFT (Discrete Fourier Transform) Distance**

  $$
  X[k] = \sum_{n=0}^{T-1} x(n)e^{-j2\pi kn/T}, \quad \hat{Y}[k] = \sum_{n=0}^{T-1} \hat{y}(n) e^{-j2\pi kn/T}
  $$

  The DFT distance:

  $$
  D_{DFT}(x, \hat{y}) = \sqrt{ \sum_{k=0}^{T-1} (|X[k]| - |\hat{Y}[k]|)^2 + \sum_{k=0}^{T-1} (\arg(X[k]) - \arg(\hat{Y}[k]))^2 }
  $$

- **Combined Fitness (with Gaussian RBF)**

  $$
  Q(d) = \exp\left(-\frac{d^2}{2\sigma^2}\right)
  $$
  $$
  \mathrm{Fitness}(x^*, \hat{y}) = \alpha Q(D_{DTW}(x^*,\hat{y})) + (1-\alpha) Q(D_{DFT}(x^*,\hat{y}))
  $$
  Default parameters are $\alpha = 0.5$, $\sigma = 10$.

## 4. Synthetic Sample Generation Workflow

Sample generation is parallelized:

- For $N_g$ required synthetic samples, $N_p$ processes are launched.
  - If $IR > 2$, $N_p$ equals the number of minority samples (one GP process per sample).
  - If $IR < 2$, $N_p = N_g$; the minority samples nearest to their class centroid $\mathbf{X}_c$ (elementwise mean) are targeted.

Each process generates its quota of synthetic sequences by evolving a GP population for $G = 50$ generations using defined rates ($p_c = 0.8$, $p_m = 0.2$). Elitism ($E = 2$) ensures preservation of top individuals per generation. The final outputs across all processes are trimmed to $N_g$ and merged with the original training set. Diversity is fostered by evolutionary operators and multi-start generation.

The implementation uses the DEAP Python library for GP, sliding window subseries extraction, and FFT caching for efficiency. The computational complexity per run is $O(N_p \cdot \mathrm{pop\_size} \cdot G \cdot (T^2 + T \log T))$.

## 5. Experimental Protocol

Evo-TFS was assessed on twelve UCR archive datasets, covering two-class and three-class time series problems (e.g., ShapeletSim, ECG200, Ham, ItalyPowerDemand, ScreenType, Yoga, Computers). Training sets were resampled to yield imbalance ratios $IR \in [2.0, 38.8]$.

Baselines included:
- SMOTE
- ADASYN
- Borderline-SMOTE1/2
- T-SMOTE (time-aware)
- Diffusion-TS (latent diffusion model-based oversampler)

Downstream classifiers consisted of:
- 1D-CNN (three convolutional layers plus fully connected output, acting on raw time series)
- Random Forest trained on frequency-domain features (FFT magnitudes and phases)

Each oversampling method produced a balanced training set. Classifiers were trained and evaluated on fixed test data, with each setup repeated across 30 random seeds. Performance was quantified using F1-score, G-Mean, and AUC. Statistical significance was assessed using Wilcoxon signed-rank tests with Holm–Bonferroni correction at $\alpha=0.05$.

## 6. Empirical Results

**Time-domain classification (1D-CNN, F1 & G-Mean):**
- Evo-TFS attained the highest or second-highest F1-score on 10/12 datasets and G-Mean on 9/12.
- Pairwise win/tie/loss counts over all datasets for F1 and G-Mean, respectively: 49/15/8 and 38/29/5, when compared to all baselines.

**Frequency-domain classification (Random Forest on FFT features):**
- Evo-TFS led on F1 and G-Mean in 6/12 datasets each.
- F1 wins/ties/losses: 34/19/19; G-Mean: 34/28/10.

**Ablation studies:**
- Removing either DTW ($\alpha = 0$) or DFT ($\alpha = 1$) components in the fitness function degraded performance on selected datasets, confirming the complementary role of time- and frequency-domain criteria.

**Sensitivity to $\alpha$:**
- F1/G-Mean variation for $\alpha \in \{0.3, 0.5, 0.7\}$ was less than 1% over four datasets, indicating robustness to the combination weight.

**Data visualization and synthetic sample analysis:**
- t-SNE plots for ScreenType and Yoga datasets revealed that classical interpolative oversamplers (SMOTE/ADASYN) yielded linear modes, while T-SMOTE and Diffusion-TS clustered near originals. Evo-TFS filled boundary regions, yielding more evenly spread minority samples.
- The Uniformity Index $U$ (mean absolute local DTW density difference between classes) was lowest for Evo-TFS across $K \in \{5,10,15\}$.

A plausible implication is that Evo-TFS's construction strategy enhances synthetic sample diversity and class-boundary coverage while retaining temporal and spectral realism.

## 7. Discussion and Implications

Evo-TFS introduces an evolutionary paradigm for time series oversampling, characterized by two main advances: enforcement of both temporal dynamics (via DTW) and spectral characteristics (via DFT) during sequence generation. This dual-domain optimization surpasses the constraints of linear interpolation-based synthetic sample generation, capturing features essential to minority class identification.

The resulting performance gains are evident across both deep learning and classical classifier pipelines, suggesting broad applicability for imbalanced sequence domains. The primary limitation is computational cost, which exceeds that of interpolation approaches. However, due to the independent nature of GP parallelization across target samples, wall-clock time can be mitigated with sufficient computational resources.

Evo-TFS represents a principled, STGP-based framework for imbalanced time series oversampling, with demonstrated superiority to classical and recent methods on established benchmarks [2601.01150].

Source: https://www.emergentmind.com/topics/evo-tfs