Denoising Framework for X-ray Absorption Spectroscopy Data
收藏资源简介:
================================================================================XAS DENOISING BENCHMARK - SUPPLEMENTARY MATERIALS================================================================================ This archive contains the code, datasets, and trained models used in the manuscript "Denoising Framework for X-ray Absorption Spectroscopy Data". IMPORTANT: For the most up-to-date version of the XASDenoise code, please visit:https://github.com/tomasaidukas/XASDenoise AUTHORS:--------Tomas Aidukas† (tomasaiduk@gmail.com)Ilnura Usmanova† (ilnura.usmanova@psi.ch)Benjamín Béjar Haro (benjamin.bejar@psi.ch)Maarten Nachtegaal (maarten.nachtegaal@psi.ch)Adam H. Clark (adam.clark@psi.ch) - corresponding author † Shared first authorship AFFILIATIONS:-------------- Center for Photon Science, Paul Scherrer Institute, Villigen, Switzerland- Swiss Data Science Center, Paul Scherrer Institute, Villigen, Switzerland- Department of Chemistry and Applied Biosciences, ETH Zürich, Zürich, Switzerland ================================================================================REPOSITORY STRUCTURE================================================================================ XASDenoiseManuscriptFiles/├── BenchmarkingData/ Training/test datasets and trained models├── DenoisingCode/XASDenoise/ Python package for XAS denoising└── Scripts/ Training, benchmarking, and visualization scripts ================================================================================OVERVIEW================================================================================ This repository provides: 1. XASDenoise Package: A comprehensive Python library implementing multiple denoising methods for X-ray Absorption Spectroscopy (XAS) data, including traditional filters, Gaussian processes, and deep learning-based autoencoders. 2. Benchmark Datasets: Curated training and test datasets with both uniformly and non-uniformly sampled XAS spectra from diverse materials. 3. Trained Models: Pre-trained autoencoder models for immediate use on XAS data. 4. Reproducible Scripts: Complete workflow for reproducing all results from the manuscript. ================================================================================INSTALLATION================================================================================ REQUIREMENTS:-------------- Python >= 3.10 (tested with Python 3.12.11)- pip package manager SETUP:------1. Create a Python virtual environment: python -m venv xas_denoise_env source xas_denoise_env/bin/activate (On Windows: xas_denoise_env\Scripts\activate) Optionally, you can clone or download the latest code from GitHub: https://github.com/tomasaidukas/XASDenoise 2. Install the XASDenoise package: cd DenoisingCode/XASDenoise/ pip install -e . This will install all required dependencies including NumPy, SciPy, scikit-learn, PyTorch, and visualization libraries. ================================================================================DATASETS================================================================================ The BenchmarkingData/ folder contains HDF5 files with pre-processed XAS spectra(normalized, cropped, etc.). All datasets are split into non-overlapping training and test sets. UNIFORMLY SAMPLED DATA (~5000 points per spectrum):----------------------------------------------------- xas_denoiser_training_database_uniformly_sampled_train.h5 (Training set)- xas_denoiser_training_database_uniformly_sampled_test.h5 (Test set) NON-UNIFORMLY SAMPLED DATA (~500 points per spectrum):-------------------------------------------------------Mimics typical step-scan acquisition with higher density near absorption edges:- xas_denoiser_training_database_nonuniformly_sampled_train.h5 (Training set)- xas_denoiser_training_database_nonuniformly_sampled_test.h5 (Test set) PRE-TRAINED MODELS:-------------------- autoencoder_models/xas_denoiser_model_noise2noise_uniformly_sampled_notnormalized.pth- autoencoder_models/xas_denoiser_model_noise2noise_nonuniformly_sampled_notnormalized.pth ================================================================================REPRODUCING RESULTS================================================================================ Follow these steps to reproduce all results from the manuscript: STEP 1: Train Autoencoder Models (Optional)--------------------------------------------Pre-trained models are provided, but you can retrain them: cd Scripts/ # Train on uniformly sampled data python step1_train_autoencoder_denoiser_uniform_data.py # Train on non-uniformly sampled data python step1_train_autoencoder_denoiser_nonuniform_data.py Training typically takes several hours on a GPU (we used NVIDIA A100). STEP 2: Run Benchmarking-------------------------Apply all denoising methods to test datasets and evaluate performance: # Benchmark on uniformly sampled data python step2_benchmark_denoising_methods_uniform_data.py # Benchmark on non-uniformly sampled data python step2_benchmark_denoising_methods_nonuniform_data.py This generates pickle files containing denoising results and error metrics. STEP 3: Generate Figures-------------------------Create benchmarking figures from the manuscript using the provided Jupyter notebook: step3_plot_benchmarking_results.ipynb ================================================================================DENOISING METHODS IMPLEMENTED================================================================================ The XASDenoise package includes: TRADITIONAL FILTERS:--------------------- Butterworth filter- Gaussian filter- Savitzky-Golay filter- Median filter- Moving average- Wavelet denoising- Total variation denoising ADVANCED METHODS:------------------ Gaussian Process regression- Autoencoder (noise2noise training) DATA WARPING TECHNIQUES:------------------------- k-space warping (EXAFS region)- Smoothness-based warping- Combined XAS + Smoothness warping ================================================================================CITATION================================================================================ If you use this code or data in your research, please cite: Aidukas, T., Usmanova, I., Béjar Haro, B., Nachtegaal, M. & Clark, A. H. (2025). Denoising Framework for X-ray Absorption Spectroscopy Data. Journal of Synchrotron Radiation. In press. BibTeX format: @article{aidukas2025denoising, title={Denoising Framework for X-ray Absorption Spectroscopy Data}, author={Aidukas, Tomas and Usmanova, Ilnura and B{\'e}jar Haro, Benjam{\'i}n and Nachtegaal, Maarten and Clark, Adam H.}, journal={Journal of Synchrotron Radiation}, year={2025}, publisher={International Union of Crystallography}, note={In press}} ================================================================================LICENSE================================================================================ This code is released under the MIT License (see LICENSE file in DenoisingCode/XASDenoise/). ================================================================================CONTACT================================================================================ For questions or issues, please contact: - Tomas Aidukas: tomasaiduk@gmail.com- Ilnura Usmanova: ilnura.usmanova@psi.ch- Adam H. Clark (corresponding author): adam.clark@psi.ch Or open an issue on the GitHub repository:https://github.com/tomasaidukas/XASDenoise/issues ================================================================================ACKNOWLEDGMENTS================================================================================ This work was conducted at the Paul Scherrer Institute in collaboration with the Swiss Data Science Center.
X射线吸收光谱(X-ray Absorption Spectroscopy, XAS)去噪基准数据集——补充材料 本归档包含发表于论文《X射线吸收光谱去噪框架》的代码、数据集与预训练模型。 重要提示:如需获取XASDenoise代码的最新版本,请访问:https://github.com/tomasaidukas/XASDenoise 作者列表: 托马斯·艾杜卡斯†(tomasaiduk@gmail.com) 伊尔努拉·乌斯马诺娃†(ilnura.usmanova@psi.ch) 本哈明·贝哈尔·哈罗(benjamin.bejar@psi.ch) 马滕·纳赫特加尔(maarten.nachtegaal@psi.ch) 亚当·H·克拉克(adam.clark@psi.ch)——通讯作者 † 共同第一作者 附属机构: - 瑞士保罗·谢尔研究所光子科学中心,维利根,瑞士 - 瑞士保罗·谢尔研究所瑞士数据科学中心,维利根,瑞士 - 苏黎世联邦理工学院化学与应用生物科学系,苏黎世,瑞士 ================================================================================仓库结构================================================================================ XASDenoiseManuscriptFiles/ ├── BenchmarkingData/ 训练与测试数据集及预训练模型 ├── DenoisingCode/XASDenoise/ 用于X射线吸收光谱去噪的Python包 └── Scripts/ 训练、基准测试与可视化脚本 ================================================================================概述================================================================================ 本仓库提供以下内容: 1. XASDenoise包:一款功能全面的Python库,实现了多种X射线吸收光谱(XAS)数据去噪方法,包括传统滤波器、高斯过程以及基于深度学习的自动编码器。 2. 基准数据集:经过精选的训练与测试数据集,包含来自不同材料的均匀采样与非均匀采样XAS光谱。 3. 预训练模型:可直接用于XAS数据的预训练自动编码器模型。 4. 可复现脚本:完整的工作流,可复现论文中的所有实验结果。 ================================================================================安装================================================================================ 环境要求: - Python >= 3.10(已在Python 3.12.11上测试) - pip包管理器 安装步骤: 1. 创建Python虚拟环境: python -m venv xas_denoise_env source xas_denoise_env/bin/activate (Windows系统请使用:xas_denoise_envScriptsactivate) 可选:您也可以从GitHub克隆或下载最新代码:https://github.com/tomasaidukas/XASDenoise 2. 安装XASDenoise包: cd DenoisingCode/XASDenoise/ pip install -e . 该命令将安装所有依赖项,包括NumPy、SciPy、scikit-learn、PyTorch以及可视化库。 ================================================================================数据集================================================================================ BenchmarkingData/文件夹包含预处理后的XAS光谱HDF5文件(已归一化、裁剪等)。所有数据集均划分为互不重叠的训练集与测试集。 均匀采样数据(每条光谱约5000个数据点): - xas_denoiser_training_database_uniformly_sampled_train.h5(训练集) - xas_denoiser_training_database_uniformly_sampled_test.h5(测试集) 非均匀采样数据(每条光谱约500个数据点): 模拟典型的步进扫描采集模式,在吸收边附近具有更高的数据密度: - xas_denoiser_training_database_nonuniformly_sampled_train.h5(训练集) - xas_denoiser_training_database_nonuniformly_sampled_test.h5(测试集) 预训练模型: - autoencoder_models/xas_denoiser_model_noise2noise_uniformly_sampled_notnormalized.pth - autoencoder_models/xas_denoiser_model_noise2noise_nonuniformly_sampled_notnormalized.pth ================================================================================复现实验结果================================================================================ 请按照以下步骤复现论文中的所有实验结果: 步骤1:训练自动编码器模型(可选) 已提供预训练模型,但您也可以重新训练: cd Scripts/ # 在均匀采样数据上训练 python step1_train_autoencoder_denoiser_uniform_data.py # 在非均匀采样数据上训练 python step1_train_autoencoder_denoiser_nonuniform_data.py 训练通常在GPU上耗时数小时(我们使用的是NVIDIA A100显卡)。 步骤2:运行基准测试 将所有去噪方法应用于测试数据集并评估性能: # 在均匀采样数据上进行基准测试 python step2_benchmark_denoising_methods_uniform_data.py # 在非均匀采样数据上进行基准测试 python step2_benchmark_denoising_methods_nonuniform_data.py 该脚本将生成包含去噪结果与误差指标的pickle文件。 步骤3:生成图表 使用提供的Jupyter笔记本从基准测试结果中生成论文中的图表: step3_plot_benchmarking_results.ipynb ================================================================================实现的去噪方法================================================================================ XASDenoise包包含以下去噪方法: 传统滤波器: - 巴特沃斯滤波器(Butterworth filter) - 高斯滤波器(Gaussian filter) - 萨维茨基-戈莱滤波器(Savitzky-Golay filter) - 中值滤波器(Median filter) - 移动平均法(Moving average) - 小波去噪(Wavelet denoising) - 总变分去噪(Total variation denoising) 高级方法: - 高斯过程回归(Gaussian Process regression) - 自动编码器(noise2noise训练模式) 数据扭曲技术: - k空间扭曲(EXAFS区域) - 基于平滑度的扭曲 - 结合XAS与平滑度的扭曲 ================================================================================引用================================================================================ 如果您在研究中使用本代码或数据集,请引用以下文献: Aidukas, T., Usmanova, I., Béjar Haro, B., Nachtegaal, M. & Clark, A. H. (2025). Denoising Framework for X-ray Absorption Spectroscopy Data. Journal of Synchrotron Radiation. In press. BibTeX格式: @article{aidukas2025denoising, title={Denoising Framework for X-ray Absorption Spectroscopy Data}, author={Aidukas, Tomas and Usmanova, Ilnura and Béjar Haro, Benjamín and Nachtegaal, Maarten and Clark, Adam H.}, journal={Journal of Synchrotron Radiation}, year={2025}, publisher={International Union of Crystallography}, note={In press} } ================================================================================许可证================================================================================ 本代码采用MIT许可证发布(详见DenoisingCode/XASDenoise/目录下的LICENSE文件)。 ================================================================================联系方式================================================================================ 如有疑问或问题,请联系: - 托马斯·艾杜卡斯:tomasaiduk@gmail.com - 伊尔努拉·乌斯马诺娃:ilnura.usmanova@psi.ch - 亚当·H·克拉克(通讯作者):adam.clark@psi.ch 或在GitHub仓库中提交issue:https://github.com/tomasaidukas/XASDenoise/issues ================================================================================致谢================================================================================ 本工作在瑞士保罗·谢尔研究所开展,并与瑞士数据科学中心合作完成。



