This repository contains the implementation of "A Topology-Preserving Coreset for Kernel Regression in Scientific Visualization", accepted to PacificVis 2026 TVCG Journal track.
coreset_kr.py implements coreset for kernel regression based on gradient descent optimization for 2D scalar field data. The script constructs and optimizes coresets (compressed representations of large datasets) that preserve the kernel regression behavior of the original data.
The dataset GTOPO-ME is used here as an example. You need to replace it with your dataset.
Run the following commands. Need to run this only once.
cd data/GTOPO-ME/
mkdir VTKfiles
Create a virtual environment and install required dependencies:
# Install required packages
pip install numpy torch vtk pyevtk scikit-learn pandasRequired packages:
numpy: Numerical computationstorch: PyTorch for GPU acceleration and optimizationvtk: VTK for reading/writing visualization datapyevtk: VTK file writing utilitiesscikit-learn: KDTree for neighbor searchpandas: CSV file reading
Note: For GPU support, ensure you have CUDA installed and install the appropriate PyTorch version with CUDA support from pytorch.org.
To optimize coreset for kernel regression using gradient descent, use command
python src/coreset_kr.py <dataName> <sigma> <learning_rate> <run_KR_S> <run_random> <randomSample> <scalarfield>
Parameters:
dataName: Name of the dataset (e.g., 'GTOPO-ME')sigma: Kernel bandwidth parameterlearning_rate: Learning rate for optimizationrun_opt: Boolean flag to run coreset optimizationrun_random: Boolean flag to run GR baselinerun_randomSample: Boolean flag to run RS baselinescalarfield: Name of the scalar field in VTK files (e.g., 'scalar')
python src/coreset_kr.py GTOPO-ME 5 1 True True True scalar
If you found this work useful, please consider citing it as
@article{lyu2026coreset,
title={A Topology-Preserving Coreset for Kernel Regression in Scientific Visualization},
author={Lyu, Weiran and Gorski, Nathaniel and Phillips, Jeff M. and Wang, Bei},
journal={IEEE Transactions on Visualization and Computer Graphics},
year={2026}
}
- The script supports both CPU and GPU execution
- Code comments are still in progress