Efficient Unsupervised Domain Adaptation Regression for Spatial-Temporal Sensor Fusion
IEEE Internet of Things Journal · arXiv
Official code repository for the paper by Keivan Faghih Niresi, Ismail Nejjar, and Olga Fink, published in IEEE Internet of Things Journal, vol. 12, no. 20, pp. 42559–42572, 2025.
TikUDA is an unsupervised domain adaptation method for regression with spatial-temporal sensor data. It learns from a labeled source domain while adapting to an unlabeled target domain. The method combines supervised regression with feature alignment derived from Tikhonov-regularized Gram matrices.
The alignment objective has two components:
- Angle alignment
- Scale alignment
For the sensor-fusion experiments, the feature extractor consists of a linear encoder, gated recurrent units (GRUs) for temporal modeling, and a graph attention network (GAT) for spatial modeling. A regression head produces the target estimate.
TikUDA/
├── data/
│ ├── R-212.csv # Air-quality measurements from route R-212
│ └── R-69.csv # Air-quality measurements from route R-69
├── losses.py # TikUDA and baseline alignment losses
├── main.py # Training and evaluation entry point
├── model.py # GRU-GAT feature extractor and regression model
├── training_testing.py # Training and inference routines
└── utils.py # Preprocessing, sequence construction, and seeding
Clone the repository and create a Python environment:
git clone https://github.com/EPFL-IMOS/TikUDA.git
cd TikUDA
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall PyTorch and the dependencies used by the code:
python -m pip install torch numpy pandas scikit-learn
python -m pip install torch-geometric torch-spatiotemporalThe model imports torch_geometric and tsl (Torch Spatiotemporal). Consult the PyTorch Geometric installation guide and the Torch Spatiotemporal repository if your PyTorch, CUDA, or operating-system versions require a particular installation procedure. An environment lockfile is not provided, so compatible dependency versions may need to be selected for your system.
The two CSV files in data/ contain air-quality measurements from R-212 and R-69. Their columns include reference ozone and nitrogen-dioxide measurements, low-cost sensor readings, temperature, and humidity.
The public preprocessing code:
- Reads the semicolon-separated CSV files and removes the
datecolumn. - Uses the first remaining column (
ref_o3) as the regression target and the other columns as model inputs. - Applies min-max scaling fitted on the source domain.
- Constructs sequences with a window length of 16 time steps.
The target domain's input sequences are used for unsupervised adaptation; target labels are used for evaluation rather than for optimizing the adaptation loss. To run a different prediction target, such as ref_no2, update the column selection in utils.py accordingly.
For adaptation from R-212 to R-69:
python main.py \
--source_dataset R-212.csv \
--target_dataset R-69.csv \
--device cpu \
--seed 42For the reverse direction, R-69 to R-212:
python main.py \
--source_dataset R-69.csv \
--target_dataset R-212.csv \
--device cpu \
--seed 42The script uses Fast_TikUDA by default and reports RMSE and MAE in normalized and original target units. The default batch size is 64 and the learning rate is 3e-4. Change --device to a valid CUDA device (for example, cuda:0) if GPU execution is available.
Before running the current repository version, check these two lines in the source code:
- In
main.py, the training loop currently readsfor e in range(10). To use the configured number of epochs (150 by default), change it tofor e in range(args.epochs).
If you use TikUDA in your research, please cite:
@article{niresi2025tikuda,
author = {Keivan Faghih Niresi and Ismail Nejjar and Olga Fink},
title = {Efficient Unsupervised Domain Adaptation Regression for Spatial-Temporal Sensor Fusion},
journal = {IEEE Internet of Things Journal},
volume = {12},
number = {20},
pages = {42559--42572},
year = {2025},
doi = {10.1109/JIOT.2025.3597150}
}