REVIEW 3 major objections 30 references
A multiscale convolutional tokenizer makes transformers work for X-ray fluorescence spectra of pigments under scarce data.
Reviewed by Pith at T0; open to challenge. T0 means a machine referee read the full paper against a public rubric. the ladder, T0–T4 →
T0 review · grok-4.5
2026-07-11 00:32 UTC pith:UGPZBSC5
load-bearing objection Solid modality-aware tokenizer for 1-D XRF that beats standard spectral transformers on identification and is more parameter-efficient on unmixing, but every number sits on synthetic linear mixtures of single-reference spectra. the 3 major comments →
XRFormer: Multiscale Tokenization for XRF Representation Learning
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
Core claim
Multiscale, modality-aware tokenization is an effective and parameter-efficient foundation for transformer-based modeling of XRF spectra: XRFormer consistently outperforms ViT, SpectralFormer (with and without CAF), and a 1D-CNN baseline on pigment identification, and achieves robust abundance estimation on unmixing at half the parameters and one-quarter the tokens of SpectralFormer, with further gains from MSM+PPP pretraining.
What carries the argument
The multiscale convolutional tokenizer: three successive 1D convolutional blocks that enlarge effective receptive field, double channel capacity, and downsample spectral resolution by two, followed by adaptive pooling to a fixed 128-token sequence that a standard transformer encoder then processes globally.
Load-bearing premise
Performance rankings obtained on synthetic mixtures of single-reference spectra plus simple intensity and Poisson noise will transfer to real multi-layer or weathered paint samples.
What would settle it
Train and test the same models on a held-out set of genuine multi-acquisition XRF spectra from layered or aged paint samples; if XRFormer's identification accuracy or unmixing A-RMSE advantage disappears relative to SpectralFormer or the 1D-CNN, the central claim fails.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes XRFormer, a transformer for 1D XRF spectra whose main novelty is a multiscale convolutional tokenizer that progressively downsamples the spectrum while increasing channel capacity, then feeds a short token sequence (N=128) to a standard transformer encoder. Two self-supervised pretraining objectives are studied: Masked Spectral Modeling (MSM) and a physics-informed Peak Presence Prediction (PPP) task based on prominence-constrained local maxima. On synthetic linear mixtures derived from 22 Pigments Checker STANDARD v.5 reference spectra (plus Infraart pretraining), XRFormer outperforms ViT, SpectralFormer (with/without CAF), and a 1D-CNN on multilabel pigment identification; for unmixing it is competitive with SpectralFormer while using fewer tokens and roughly half the parameters (1.5M vs 3.37M). MSM and MSM+PPP give further gains. Code is released.
Significance. XRF pigment analysis in cultural heritage is genuinely data-limited and underexplored for modern sequence models; a modality-aware tokenizer that targets sharp peaks plus broader background is a sensible and transferable idea. The paper is transparent about parameter/token budgets, reports means±std over five runs, compares against relevant spectral transformers, and ships a public repository—strengths that support reproducibility. If the synthetic rankings transfer, the work would offer a practical, parameter-efficient baseline for XRF representation learning. The significance is currently bounded by the exclusive use of linear-mixture surrogates from single-reference spectra, which is the main caveat on how far the empirical claims can be taken.
major comments (3)
- §4.1 and Tables 2–4: Every reported metric is obtained from synthetic linear mixtures of the same 22 single-reference spectra (Dirichlet weights, intensity factor in [0.5,2], Poisson λ=x·10^4). The authors note that elemental contributions combine only “approximately” linearly under typical settings, yet real layered/weathered paint exhibits matrix absorption, secondary fluorescence, and geometry-dependent non-linear peak ratios. Because train/val/test splits are all drawn from this generative process, the AA gains (e.g., 71–77% vs ViT/SpectralFormer) and the efficiency argument (128 tokens / 1.5M vs 512 / 3.37M) may partly reflect match to the synthetic assumptions rather than robustness on physical spectra. This is load-bearing for the central empirical claim. Please either (i) add at least one real multi-acquisition or layered-paint evaluation (even small), or (ii) substantially refra
- §3.3 and §4.5 (PPP): The paper states that PPP “further enhances performance … when tuned with an appropriate peak prominence,” and that higher vs lower prominence trades off identification vs unmixing. No prominence values, selection procedure, or sensitivity curve are reported for the MSM+PPP rows in Tables 2–3. Without this, the PPP contribution is not reproducible and the claim that PPP is a useful physics-informed pretext remains under-supported. Please report the prominence(s) used, how they were chosen (validation grid?), and a brief ablation over a small prominence range for both tasks.
- §3.1 / §4.2 (tokenizer contribution): The multiscale convolutional tokenizer is the primary architectural claim, yet there is no ablation of its design choices (number of stages, downsampling factors, kernel/stack depth that set the effective receptive field, adaptive pooling to N=128, or a single-scale CNN tokenizer control). Tables 2–4 compare full XRFormer to ViT/GSE-style SpectralFormer, so gains could come from any convolutional front-end rather than multiscale structure specifically. A minimal ablation (single-scale vs multiscale; N∈{64,128,256}) would make the central “multiscale tokenization” claim load-bearing rather than suggestive.
Circularity Check
No circularity: empirical architecture comparison on synthetic mixtures with external baselines; no derivation reduces to fitted inputs or self-citation by construction.
full rationale
XRFormer is an empirical ML paper proposing a multiscale convolutional tokenizer + standard transformer encoder, plus optional MSM/PPP pretraining, evaluated via supervised fine-tuning on pigment identification (AA/HA/F1) and unmixing (A-RMSE/R-RMSE/SAM). All claims are comparative performance numbers (Tables 2–4) against independently re-implemented external baselines (ViT, SpectralFormer w/wo CAF, 1D-CNN) under identical capacity settings where possible. Tokenization strategies, loss functions, and the PPP peak-signature construction (local-maxima + prominence on the input spectrum itself) are standard self-supervised or architectural choices; none define a quantity in terms of the reported metric or rename a fit as a prediction. Citations (MViT, SpectralFormer, BERT-style masking, etc.) are to prior external work and are not load-bearing uniqueness theorems. The synthetic linear-mixture protocol (Dirichlet weights, intensity scaling, Poisson noise) is a shared experimental assumption that may limit external validity, but it does not create a circular reduction of any claimed result to its own inputs. The paper is therefore self-contained against its stated benchmarks with zero circular steps.
Axiom & Free-Parameter Ledger
free parameters (5)
- peak prominence threshold for PPP ground-truth
- token sequence length N=128
- masking ratio 15 % and 80/10/10 replacement schedule for MSM
- Dirichlet concentration, intensity range [0.5,2], Poisson rate 10^4 for data augmentation
- learning rates 1e-4 (pretrain) / 5e-5 (finetune), batch size 128, early-stopping patience
axioms (3)
- domain assumption Elemental contributions in XRF combine approximately linearly under typical acquisition settings
- standard math Standard pre-norm transformer blocks with MHSA + FFN are sufficient once multiscale tokens are supplied
- ad hoc to paper Local-maxima detection with a prominence threshold yields a useful binary peak signature for self-supervision
invented entities (2)
-
XRFormer multiscale convolutional tokenizer
no independent evidence
-
Peak Presence Prediction (PPP) pretext
no independent evidence
read the original abstract
X-ray fluorescence (XRF) spectroscopy is a key modality for material analysis in cultural heritage. However, automated learning from XRF spectra remains challenging: XRF spectra are complex one-dimensional signals composed of sharp elemental peaks, broader structures, and background variations that are not taken into account by existing learning-based models. This paper introduces XRFormer, a transformer architecture tailored to XRF spectra through a multiscale convolutional tokenizer that injects locality and multi-resolution inductive biases before global self-attention. The tokenizer progressively reduces spectral resolution while increasing embedding dimensionality, and the resulting token sequence is processed by a standard transformer encoder. We further investigate self-supervised pretraining for XRF representation learning using Masked Spectral modeling (MSM) and a physics-informed Peak Presence Prediction (PPP) objective. Experiments on the Pigments Checker STANDARD v.5 dataset for pigment identification and unmixing show that XRFormer consistently outperforms ViT, SpectralFormer (with and without CAF), and a 1D-CNN baseline for pigment identification. For pigment unmixing, XRFormer achieves robust abundance estimation while maintaining significantly higher parameter efficiency than SpectralFormer, operating at a lower token resolution (128 vs. 512 tokens) and with less than half the number of parameters (1.5M vs. 3.37M). MSM yields consistent gains across both tasks, while PPP further enhances performance for both identification and unmixing when tuned with an appropriate peak prominence. These results highlight multiscale, modality-aware tokenization as an effective and parameter efficient foundation for transformer-based XRF modeling under data-limited conditions. A GitHub repository is provided at https://github.com/sofiane1010/XRFormer.
Figures
Reference graph
Works this paper leans on
-
[1]
Getty Conservation Institute (2020)
Bezur, A.o.: Handheld XRF in cultural heritage: a practical workbook for conser- vators. Getty Conservation Institute (2020)
work page 2020
-
[2]
Machine Learning: Science and Technology6(1), 015058 (2025)
Bombini, A., et al.: Towards virtual painting recolouring using vision transformer on x-ray fluorescence datacubes. Machine Learning: Science and Technology6(1), 015058 (2025)
work page 2025
-
[3]
Powder Diffraction22(2), 130–137 (2007)
Börjesson, J., Mattsson, S.: Medical applications of x-ray fluorescence for trace element research. Powder Diffraction22(2), 130–137 (2007). https://doi.org/10. 1154/1.2737468
work page 2007
-
[4]
In: Euro- pean conference on computer vision
Chen, Y.C., et al.: Uniter: Universal image-text representation learning. In: Euro- pean conference on computer vision. pp. 104–120. Springer (2020)
work page 2020
-
[5]
ACM Journal on Computing and Cultural Heritage16(2), 1–11 (2023)
Cortea,I.M.,etal.:Infra-art:anopenaccessspectrallibraryofart-relatedmaterials as a digital support tool for cultural heritage science. ACM Journal on Computing and Cultural Heritage16(2), 1–11 (2023)
work page 2023
-
[6]
Cultural Heritage Science Open Source: Pigments Checker. https://chsopensource. org/products/pigments-checker/
-
[7]
Devlin, J., et al.: Bert: Pre-training of deep bidirectional transformers for language understanding. In: Proc. of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers). pp. 4171–4186 (2019)
work page 2019
-
[8]
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Dosovitskiy, A., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
work page internal anchor Pith review Pith/arXiv arXiv 2010
- [9]
-
[10]
GraphCodeBERT: Pre-training Code Representations with Data Flow
Guo, D., et al.: Graphcodebert: Pre-training code representations with data flow. arXiv preprint arXiv:2009.08366 (2020)
work page internal anchor Pith review Pith/arXiv arXiv 2009
-
[11]
IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing15, 9266–9277 (2022)
He, W., et al.: Csit: A multiscale vision transformer for hyperspectral image clas- sification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing15, 9266–9277 (2022)
work page 2022
-
[12]
IEEE Transactions on Geoscience and Remote Sensing60, 1–15 (2021)
Hong, D., et al.: Spectralformer: Rethinking hyperspectral image classification with transformers. IEEE Transactions on Geoscience and Remote Sensing60, 1–15 (2021)
work page 2021
-
[13]
IEEE Transactions on Geoscience and Remote Sens- ing60, 1–14 (2022)
Ibanez, D., et al.: Masked auto-encoding spectral–spatial transformer for hyper- spectral image classification. IEEE Transactions on Geoscience and Remote Sens- ing60, 1–14 (2022)
work page 2022
-
[14]
Heritage Science10(1), 1–14 (2022)
Jones, C., et al.: Neural network-based classification of x-ray fluorescence spectra of artists’ pigments: an approach leveraging a synthetic dataset created using the fundamental parameters method. Heritage Science10(1), 1–14 (2022)
work page 2022
-
[15]
Journal of hazardous materials83(1-2), 93–122 (2001)
Kalnicky, D.J., et al.: Field portable xrf analysis of environmental samples. Journal of hazardous materials83(1-2), 93–122 (2001)
work page 2001
-
[16]
Khotimah, W.N., et al.: Mce-st: Classifying crop stress using hyperspectral data with a multiscale conformer encoder and spectral-based tokens. International Jour- nal of Applied Earth Observation and Geoinformation118, 103286 (2023) XRFormer: Multiscale Tokenization for XRF Representation Learning 15
work page 2023
-
[17]
X-Ray Spectrometry50(4), 310–319 (2021)
Kogou, S., et al.: A new approach to the interpretation of xrf spectral imaging data using neural networks. X-Ray Spectrometry50(4), 310–319 (2021)
work page 2021
-
[18]
IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing15, 3891–3903 (2022)
Liu, K., et al.: Mapping coastal wetlands using transformer in transformer deep network on china zy1-02d hyperspectral satellite images. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing15, 3891–3903 (2022)
work page 2022
- [19]
-
[20]
In: 2023 23rd International Conference on Transparent Optical Networks (ICTON)
Moreau, R., et al.: Multi-sensor scanners and machine-learning data processing: a novel instrumentation and data analysis method in heritage science. In: 2023 23rd International Conference on Transparent Optical Networks (ICTON). pp. 1–
work page 2023
-
[21]
Geology, Ecology, and Landscapes 2(2), 148–154 (2018)
Oyedotun, T.D.T.: X-ray fluorescence (xrf) in the investigation of the composition of earth materials: a review and an overview. Geology, Ecology, and Landscapes 2(2), 148–154 (2018)
work page 2018
-
[22]
In: International conference on machine learning
Radford, A., et al.: Learning transferable visual models from natural language su- pervision. In: International conference on machine learning. pp. 8748–8763. PmLR (2021)
work page 2021
-
[23]
NPJ digital medicine 4(1), 86 (2021)
Rasmy, L., et al.: Med-bert: pretrained contextualized embeddings on large-scale structured electronic health records for disease prediction. NPJ digital medicine 4(1), 86 (2021)
work page 2021
-
[24]
Applied Physics A122(1), 17 (2016)
Ravaud, E., et al.: Development of a versatile xrf scanner for the elemental imaging of paintworks. Applied Physics A122(1), 17 (2016)
work page 2016
-
[25]
IEEE Transactions on Geoscience and Remote Sensing60, 1–14 (2022)
Sun, L., et al.: Spectral–spatial feature tokenization transformer for hyperspectral image classification. IEEE Transactions on Geoscience and Remote Sensing60, 1–14 (2022)
work page 2022
-
[26]
LXMERT: Learning Cross-Modality Encoder Representations from Transformers
Tan, H., et al.: Lxmert: Learning cross-modality encoder representations from transformers. arXiv preprint arXiv:1908.07490 (2019)
work page internal anchor Pith review Pith/arXiv arXiv 1908
-
[27]
Advances in neural information processing systems30(2017)
Vaswani, A., et al.: Attention is all you need. Advances in neural information processing systems30(2017)
work page 2017
-
[28]
Xu, B.J., et al.: Can deep learning assist automatic identification of layered pig- ments from xrf data? Journal of Analytical Atomic Spectrometry37(12), 2672– 2682 (2022)
work page 2022
-
[29]
IEEE Transactions on Pattern Analysis and Machine Intelligence45(10), 12113–12132 (2023)
Xu, P., et al.: Multimodal learning with transformers: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence45(10), 12113–12132 (2023)
work page 2023
-
[30]
IEEE Geoscience and Remote Sensing Letters19, 1–5 (2022)
Zhang, J., et al.: Convolution transformer mixer for hyperspectral image classifi- cation. IEEE Geoscience and Remote Sensing Letters19, 1–5 (2022)
work page 2022
discussion (0)
Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.