JTF2000 commited on
Commit
fe36803
·
verified ·
1 Parent(s): 3641263

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +190 -0
README.md ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+
5
+ # TIC-FM
6
+
7
+ **TIC-FM** is a time series classification foundation model that replaces the conventional classifier-fitting pipeline with **in-context inference**. At deployment, TIC-FM treats the labeled training split as context and predicts labels for the query/test split without fitting a new classifier or updating model parameters.
8
+
9
+
10
+ [Paper](https://arxiv.org/abs/2602.00620) · [Code](https://github.com/fangjuntao/TIC-FM) · [ICML FMSD 2026 workshop paper](https://openreview.net/forum?id=HVvARHEA9M)
11
+
12
+ ## Model description
13
+
14
+ TIC-FM contains three main components:
15
+
16
+ 1. A ViT-based time series encoder that converts each series into an instance embedding using raw values, first-order differences, and patch-level statistics.
17
+ 2. A lightweight projection adapter that maps time series embeddings into the token space of the in-context classifier.
18
+ 3. A latent-memory, split-masked Transformer that conditions each query on labeled context examples while preventing information flow among query examples.
19
+
20
+ The released checkpoint supports parallel context–query inference and cyclic label-permutation ensembling. Its main configuration is summarized below.
21
+
22
+ | Component | Configuration |
23
+ | --- | --- |
24
+ | Input length | 512 |
25
+ | Time series embedding dimension | 512 |
26
+ | Time series encoder | 6 Transformer layers |
27
+ | Projection adapter | 512 → 1024 → 512 |
28
+ | In-context Transformer | 12 blocks, 4 attention heads |
29
+ | Latent memory | 32 latent tokens; 2 write and 2 read layers |
30
+ | Direct class capacity | Up to 10 classes |
31
+
32
+ Tasks with more than 10 classes are handled by the hierarchical class-extension procedure implemented in the evaluation pipeline.
33
+
34
+ ## Repository files
35
+
36
+ | File | Description |
37
+ | --- | --- |
38
+ | `TSEncoder_orion_icl_full.pt` | TIC-FM model checkpoint |
39
+ | `TSEncoder_orion_icl_model_hparams.json` | Architecture and checkpoint configuration |
40
+
41
+ This repository contains model weights and configuration only. Model definitions, data loading, preprocessing, and evaluation scripts are provided in the [official code repository](https://github.com/fangjuntao/TIC-FM).
42
+
43
+ ## Quick start
44
+
45
+ ### 1. Set up the code
46
+
47
+ ```bash
48
+ git clone https://github.com/fangjuntao/TIC-FM.git
49
+ cd TIC-FM
50
+
51
+ conda env create -f environment.yml
52
+ conda activate TICFS
53
+
54
+ pip install -U huggingface_hub
55
+ ```
56
+
57
+ ### 2. Download the checkpoint
58
+
59
+ ```bash
60
+ hf download Jwpqkh/TIC-FM \
61
+ TSEncoder_orion_icl_full.pt \
62
+ TSEncoder_orion_icl_model_hparams.json \
63
+ --local-dir checkpoints
64
+ ```
65
+
66
+ The same files can be downloaded in Python:
67
+
68
+ ```python
69
+ from huggingface_hub import hf_hub_download
70
+
71
+ checkpoint_path = hf_hub_download(
72
+ repo_id="Jwpqkh/TIC-FM",
73
+ filename="TSEncoder_orion_icl_full.pt",
74
+ )
75
+ hparams_path = hf_hub_download(
76
+ repo_id="Jwpqkh/TIC-FM",
77
+ filename="TSEncoder_orion_icl_model_hparams.json",
78
+ )
79
+
80
+ print(checkpoint_path)
81
+ print(hparams_path)
82
+ ```
83
+
84
+ ### 3. Evaluate on UCR
85
+
86
+ Download the UCR archive and run the evaluation script from the project root:
87
+
88
+ ```bash
89
+ python scripts/eval_TSEncoder_orion_icl_classifier_ucr_full.py \
90
+ --suite ucr \
91
+ --mode classifier_v2 \
92
+ --ucr_path /path/to/UCRdata/ \
93
+ --full_ckpt checkpoints/TSEncoder_orion_icl_full.pt \
94
+ --model_hparams_json checkpoints/TSEncoder_orion_icl_model_hparams.json
95
+ ```
96
+
97
+ To evaluate a single dataset:
98
+
99
+ ```bash
100
+ python scripts/eval_TSEncoder_orion_icl_classifier_ucr_full.py \
101
+ --suite ucr \
102
+ --dataset ECG200 \
103
+ --mode classifier_v2 \
104
+ --ucr_path /path/to/UCRdata/ \
105
+ --full_ckpt checkpoints/TSEncoder_orion_icl_full.pt \
106
+ --model_hparams_json checkpoints/TSEncoder_orion_icl_model_hparams.json
107
+ ```
108
+
109
+ Useful arguments include `--support_size`, `--query_batch_size`, and `--softmax_temperature`. See the code repository for the complete evaluation interface.
110
+
111
+ ## Training data and procedure
112
+
113
+ TIC-FM is trained in three stages:
114
+
115
+ 1. The time series encoder is pretrained for 100 epochs with a contrastive objective on 100,000 synthetic time series generated by CauKer.
116
+ 2. The in-context classifier is pretrained on synthetic classification tasks sampled from a structural causal model prior.
117
+ 3. The encoder and in-context classifier are frozen, and only the projection adapter is trained for five epochs on the training splits of the UCR archive.
118
+
119
+ No UCR test split is used for checkpoint training. Therefore, this released checkpoint corresponds to the main **TIC-FM** model rather than the fully synthetic **TIC-FM (Syn.)** variant.
120
+
121
+ ## Evaluation
122
+
123
+ The model is evaluated on all 128 datasets in the UCR archive using the official train/test splits. The official training split is supplied as labeled context, and the test split is treated as unlabeled queries. TIC-FM performs inference without fitting a dataset-specific classifier.
124
+
125
+ | Model | Target-specific classifier fitting | Average accuracy | Mean rank |
126
+ | --- | ---: | ---: | ---: |
127
+ | TIC-FM | No | 80.01% | 3.59 |
128
+
129
+ These results are taken from version 2 of the accompanying arXiv paper. Refer to the paper for baselines, per-dataset results, low-label protocols, statistical analysis, and complete experimental settings.
130
+
131
+ ## Benchmark Results
132
+
133
+ TIC-FM is evaluated in the [TSC-FM time series classification foundation model benchmark](https://tsc-fm.dmirlab.com/). See its [model configurations and benchmark results](https://tsc-fm.dmirlab.com/methods/tic-fm), compare matching settings on the [time series classification leaderboard](https://tsc-fm.dmirlab.com/leaderboard), and consult the [Standard and few-shot evaluation protocol](https://tsc-fm.dmirlab.com/evaluation).
134
+
135
+
136
+
137
+ ## Intended use
138
+
139
+ TIC-FM is intended for:
140
+
141
+ - Research on training-free and in-context time series classification.
142
+ - Evaluation on univariate classification datasets with labeled context examples.
143
+ - Reproduction and extension of the experiments reported in the accompanying papers.
144
+
145
+ ## Limitations
146
+
147
+ - The released checkpoint is primarily evaluated on the univariate UCR archive; performance on other domains, multichannel datasets, irregularly sampled data, or distribution shifts is not guaranteed.
148
+ - Predictions depend on the quality and class coverage of the labeled context set. Query classes absent from the context cannot be inferred reliably.
149
+ - Inputs are processed at a fixed length of 512 by the provided evaluation pipeline; alternative preprocessing may change performance.
150
+ - The checkpoint uses custom PyTorch modules and is not directly compatible with `transformers.pipeline`.
151
+ - The model is a research artifact and should be independently validated before use in high-stakes applications.
152
+
153
+ ## Citation
154
+
155
+ If you use this checkpoint, please cite the following papers.
156
+
157
+ ```bibtex
158
+ @article{fang2026rethinking,
159
+ title = {Rethinking Zero-Shot Time Series Classification:
160
+ From Task-specific Classifiers to In-Context Inference},
161
+ author = {Fang, Juntao and Xie, Shifeng and Nie, Shengbin and
162
+ Ling, Yuhui and Liu, Yuming and Li, Zijian and Zhang, Keli and
163
+ Pan, Lujia and Palpanas, Themis and Cai, Ruichu},
164
+ journal = {arXiv preprint arXiv:2602.00620},
165
+ year = {2026}
166
+ }
167
+
168
+ @inproceedings{fang2026beyond,
169
+ title = {Beyond Task-Specific Classifiers:
170
+ In-Context Inference for Time Series Classification
171
+ Foundation Models},
172
+ author = {Fang, Juntao and Xie, Shifeng and Nie, Shengbin and
173
+ Ling, Yuhui and Liu, Yuming and Li, Zijian and Zhang, Keli and
174
+ Pan, Lujia and Palpanas, Themis and Cai, Ruichu},
175
+ booktitle = {2nd ICML Workshop on Foundation Models for Structured Data},
176
+ year = {2026},
177
+ url = {https://openreview.net/forum?id=HVvARHEA9M}
178
+ }
179
+ ```
180
+
181
+
182
+
183
+ ## License
184
+
185
+ The TIC-FM model checkpoint is released under the MIT License. Third-party
186
+ components remain subject to their respective licenses.
187
+
188
+ ## Contact
189
+
190
+ For questions or issues, please open an issue in the [official code repository](https://github.com/fangjuntao/TIC-FM/issues).