From Post-Hoc to Ante-Hoc: Consistently Explainable Semi-Supervised Time Series Classification

Viet-Hung Tran, Zichi Zhang, Ngoc Phu Doan, Xuan Hoang Nguyen, Phi Hung Nguyen, Yimeng An, Peixin Li, Huynh Thi Khanh Chi, Hans Vandierendonck, Ira Assent, Son Thai MaiNeurIPS 2026

TL;DR

Deep neural networks excel at classifying messy time-series data like heartbeats and industrial vibrations—even when labeled data is scarce—but they remain stubbornly opaque black boxes. Inspired by how the human brain filters out background noise, this paper introduces Sensory Gating, a four-stage framework that distills post-hoc explanations into a built-in, fast, and verifiable input filter. The result is an explainable model that throws away 55–80% of the raw data at test time while matching the accuracy of its black-box teacher.

What Problem Does This Paper Address?

In high-stakes domains like clinical ECG monitoring or industrial fault diagnosis, labeling sequential data requires expensive human experts. Semi-supervised time series classification (SS-TSC) solves this by learning from vast oceans of unlabeled data alongside a tiny handful of labels. However, existing SS-TSC models optimize purely for accuracy, leaving practitioners with black-box predictions that fail emerging regulatory standards (like the EU AI Act) and clinical trust requirements.

Meanwhile, Explainable AI (XAI) for time series has only explored the fully supervised setting and suffers from a classic Catch-22:

  • Post-hoc methods analyze a model after training to highlight important time steps. They work on any architecture, but much like human introspection, there is no guarantee the model actually relied on those highlighted features during inference.
  • Ante-hoc methods bake interpretability directly into the neural architecture so explanations emerge naturally during a forward pass, sacrificing architectural flexibility.

This paper bridges both worlds—bringing verifiable, architecture-agnostic explainability to the label-scarce semi-supervised regime.

Methods

Drawing inspiration from the brain's thalamus—which filters out irrelevant sensory stimuli before they reach the cortex—the authors propose Sensory Gating, a four-stage pipeline that turns post-hoc attributions into a verified ante-hoc filter:

Overview of the four-stage Sensory Gating pipeline
  1. Base Classifier Training (F-JEPA): A standard backbone (here, a Temporal Convolutional Network) is trained using cross-entropy on scarce labeled data alongside a novel self-supervised auxiliary objective called Forecasting-JEPA (F-JEPA) on all data. F-JEPA splits each sequence into past (context) and future (target) windows, training the encoder to predict pooled future representations via cosine distance without requiring token-based Transformer architectures.
  2. Attribution & Greedy Mask Selection: Using the frozen base model, a standard post-hoc method (TIMING) scores every time-channel point. A greedy algorithm then incrementally unmasks the top 5% chunks of features—replacing masked points with the training-set mean—until the model recovers both its original predicted class and confidence.
  3. Sensory Gate Training: Computing post-hoc attributions at deployment is slow. Instead, a lightweight convolutional "Sensory Gate" is trained via simple Binary Cross-Entropy (BCE) to predict those offline greedy masks in a single forward pass. Threshold calibration on a validation set binarizes the mask cleanly—completely avoiding finicky sparsity penalties, Gumbel-Softmax tricks, or straight-through estimators.
  4. Knowledge Distillation (KD) Verification: Simply slapping a hard mask onto a frozen classifier degrades accuracy. Instead, the base classifier is cloned into a "student" and fine-tuned on the gated (masked) inputs across all labeled and unlabeled data to match the ungated "teacher's" output distribution. Teacher-student agreement serves as built-in proof that the kept features are genuinely sufficient.

Datasets

The authors evaluate their pipeline across nine real-world benchmarks (no new datasets are introduced):

  • UCR/UEA Multivariate Archive: CricketX, Heartbeat, InsectWingbeatSound, NATOPS, and UWaveGestureLibraryAll.
  • SemiTime Benchmark: MFPT and XJTU (industrial fault diagnosis), plus EpilepticSeizure (medical EEG).
  • MIT-BIH Arrhythmia (MIT-ECG): An electrocardiogram dataset featuring cardiologist-annotated ground-truth saliency regions, allowing direct testing against human diagnostic reasoning.

Key Insights and Ideas

  • Explanation difficulty varies per sample: Standard XAI benchmarks force a uniform masking budget (e.g., "keep top 20%") across every test case. Greedy selection reveals that crisp, obvious signals need very few data points, while borderline samples require much denser context—making mask sparsity itself a useful diagnostic signal for prediction reliability.
  • Amortizing masks acts as a denoiser: Training the lightweight gate via BCE doesn't just speed up inference; its soft outputs actually outperform the raw post-hoc attributions it learned from (higher AUPRC on MIT-BIH), smoothing out noisy attribution artifacts.
  • Adaptation is non-negotiable: Dropping 60–80% of the input shocks a frozen model (Stage 3 drops 12–18 macro-F1 points on MIT-BIH). Knowledge distillation over unlabeled data (Stage 4) is the glue that restores full performance.

Key Results

Tested across label ratios from 10% to 100%, Sensory Gating delivers strong predictive utility alongside compact explanations:

  • Strong Semi-Supervised Base: Stage 1 (F-JEPA) matches or beats state-of-the-art SS-TSC method f-VAT on 7 out of 8 datasets.
  • High Sparsity, Minimal Accuracy Loss: Across the 8 general datasets, Stage 4 retains only 20–45% of input features while recovering accuracy to within 1–2 percentage points of the full-input baseline (even matching or exceeding it on Heartbeat, MFPT, XJTU, and UWaveGestureLibraryAll).
  • Clinical Alignment: On MIT-BIH (at 40% labels), the gate compresses kept features from 43.4% (greedy stage) down to 15.4%, recovering macro-F1 from 0.86 (Stage 3) to 0.95 (Stage 4, vs. 0.97 ungated) while matching or beating raw TIMING attributions on recall (AUR) and ROC-AUC.

Limitations and Future Work

  • Multi-stage Training Overhead: The authors candidly note that the four-stage pipeline is complex and computationally expensive during training—though deployment inference is fast, deterministic, and lightweight.
  • Over-selection vs. Human Plausibility: On MIT-BIH, the gate achieves high recall (AUR) but lower precision (AUP) against cardiologist annotations. Because the gate optimizes for sufficiency, imperfections in the underlying post-hoc attribution method propagate forward, and the neural network legitimately relies on contextual features outside human-annotated regions. Future directions are not explicitly discussed in the main text.

Summary updated

Abstract

Semi-Supervised Time Series Classification (SS-TSC) with Deep Neural Networks (DNNs) achieves strong accuracy by leveraging unlabeled data, yet the resulting models remain black boxes that offer no insight into which features drive each prediction. Existing post-hoc explanation methods for TSC can identify important features but provide no guarantee that the model genuinely relies on them, while ante-hoc approaches impose architectural constraints that limit flexibility in existing model usage. Neither setting explores the semi-supervised regime, where limited labels can affect explainability. We propose **Sensory Gating**, the first SS-TSC framework that simultaneously bridges post-hoc attribution and ante-hoc explanation through a four-stage pipeline: (i) a base classifier is trained with our proposed Forecasting Joint-Embedding Predictive Architecture (F-JEPA) auxiliary objective; (ii) post-hoc attribution maps are converted into per-instance binary masks via greedy selection of sufficient features; (iii) a lightweight **Sensory Gate** amortizes these masks through Binary Cross Entropy (BCE) supervision with data-driven threshold calibration; and (iv) a knowledge distillation stage provides an explainable SS-TSC student model that operates on gated (masked) input, while consistently reproducing the predictions of the original black-box teacher (F-JEPA). We validate our framework on eight datasets across four label ratios with five seeds per configuration. F-JEPA achieves better performance than recent state-of-the-art (SOTA) semi-supervised TSC methods, while the sensory gate reduces the fraction of features the classifier requires to 20--45\% with competitive accuracy. On MIT-BIH, where ground-truth saliency annotations are available, the gate's selected features align with domain-relevant regions while classification performance remains competitive with the ungated baseline at 10--20\% retention ratio.
BibTeX
@inproceedings{tran2026from,
  author = {Viet-Hung Tran and Zichi Zhang and Ngoc Phu Doan and Xuan Hoang Nguyen and Phi Hung Nguyen and Yimeng An and Peixin Li and Huynh Thi Khanh Chi and Hans Vandierendonck and Ira Assent and Son Thai Mai},
  title = {{From Post-Hoc to Ante-Hoc: Consistently Explainable Semi-Supervised Time Series Classification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=GMZeOQcKOW},
}
Figure