[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-84110-en":3,"doc-seo-84110-105":29,"detail-sidebar-cat-0-en-105":90},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},84110,1099514067438,"River Wang","https://ap-avatar.wpscdn.com/avatar/100002539ee87300030?x-image-process=image/resize,m_fixed,w_180,h_180&k=1780474512215547542",8,"Research & Report","XRFormer Multiscale Tokenization for XRF Representation Learning","X-ray fluorescence (XRF) spectroscopy is a key modality for material analysis in cultural heritage, yet automated learning from XRF spectra is difficult due to their complex one-dimensional structure: sharp elemental peaks, broader spectral components, and background variations. XRFormer presents a transformer tailored to XRF by using a multiscale convolutional tokenizer that injects locality and multi-resolution inductive biases before global self-attention. It also explores self-supervised pretraining with Masked Spectral Modeling and a physics-informed Peak Presence Prediction objective.","arXiv :2607 .06424v 1 [ cs .CV] 7 Jul 2026  \nXRFormer: Multiscale Tokenization for XRF Representation Learning  \nSofiane Daimellah 1 , Sylvie Le Hégarat-Mascle 1 , and Clotilde Boust2  \n1 Université Paris-Saclay, Gif-sur-Yvette, France  \n2 Centre de Recherche et de Restauration des Musées de France, Paris, France [email1@universite-paris-saclay.fr](email1@universite-paris-saclay.fr) , [email2@culture.gouv.fr](email2@culture.gouv.fr)  \nAbstract. 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 onedimensional 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.  \nWe further investigate self-supervised pretraining for XRF representation learning using Masked Spectral Modeling (MSM) and a physicsinformed 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](https://github.com/sofiane1010/XRFormer).  \nKeywords: Transformers · Tokenization · Self-Supervised Learning · XRF spectroscopy · Cultural Heritage.  \n1 Introduction  \nX-ray fluorescence (XRF) is a non-destructive technique for elemental analysis that measures characteristic X-ray emissions produced under X-ray ex-  \n2 S. Daimellah et al.  \ncitation [1] . Each element emits photons at specific energies, yielding a onedimensional spectrum over energy channels composed of sharp emission peaks superimposed on a continuous background (Figure 1) . XRF is widely used in medical diagnostics [3], environmental analysis [15], and geology and mining [21], and it plays a central role in Cultural Heritage (CH) by enabling non-invasive characterization of artistic materials such as pigments and metals [24] .  \nFig. 1. Typical XRF spectrum showing the energies of fluorescent emission lines (peaks) corresponding to different elements.  \nPigment identification and unmixing are common CH applications of XRF, yet automated analysis remains limited. Most existing studies focus on pigment identification and often rely on expert-driven peak interpretation. Recent learning-based approaches operate directly on raw spectra using one-Dimensional Convolutional Neural Networks (1D-CNNs) [14,28] . While 1D-CNNs effectively capture local patterns such as elemental peaks, they struggle at modeling longrange relationships across the energy axis. Such global dependencies arise from correlated elemental emissions and background effects and are not explicitly captured by locally constrained architectures. Transformers provide a natural mechanism to model these long-range ","cbCaiewE4RvqZ0w2","https://ap.wps.com/l/cbCaiewE4RvqZ0w2","pdf",3989000,1,15,"English","en",105,"# Introduction\n## XRF for cultural heritage and challenges\n## Transformer-based spectral modeling\n## Proposed multiscale convolutional tokenizer\n## Self-supervised pretraining objectives","[{\"question\":\"Why is learning from XRF spectra challenging for automated models?\",\"answer\":\"XRF spectra are complex one-dimensional signals containing sharp elemental peaks, broader structures, and varying backgrounds. Existing learning-based approaches often do not explicitly account for these characteristics.\"},{\"question\":\"What core architectural idea does XRFormer introduce for XRF representation learning?\",\"answer\":\"XRFormer uses a multiscale convolutional tokenizer that progressively reduces spectral resolution while increasing embedding dimensionality. The resulting tokens are fed to a standard transformer encoder to enable global self-attention over multi-resolution representations.\"},{\"question\":\"How does XRFormer use self-supervised learning, and what benefits are reported?\",\"answer\":\"It investigates self-supervised pretraining using Masked Spectral Modeling (MSM) and a physics-informed Peak Presence Prediction (PPP) objective. Experiments on a pigment dataset show consistent improvements, with PPP further enhancing identification and unmixing when tuned appropriately.\"}]",1784192910,38,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":27},"xrformer-multiscale-tokenization-for-xrf-representation-learning","",{"@graph":35,"@context":84},[36,53,67],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/xrformer-multiscale-tokenization-for-xrf-representation-learning/84110/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-16",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"Why is learning from XRF spectra challenging for automated models?","Question",{"text":74,"@type":75},"XRF spectra are complex one-dimensional signals containing sharp elemental peaks, broader structures, and varying backgrounds. Existing learning-based approaches often do not explicitly account for these characteristics.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"What core architectural idea does XRFormer introduce for XRF representation learning?",{"text":79,"@type":75},"XRFormer uses a multiscale convolutional tokenizer that progressively reduces spectral resolution while increasing embedding dimensionality. The resulting tokens are fed to a standard transformer encoder to enable global self-attention over multi-resolution representations.",{"name":81,"@type":72,"acceptedAnswer":82},"How does XRFormer use self-supervised learning, and what benefits are reported?",{"text":83,"@type":75},"It investigates self-supervised pretraining using Masked Spectral Modeling (MSM) and a physics-informed Peak Presence Prediction (PPP) objective. Experiments on a pigment dataset show consistent improvements, with PPP further enhancing identification and unmixing when tuned appropriately.","https://schema.org",{"og:url":51,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,122,127,130,134],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":45,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":45,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":45,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":45,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":45,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":45,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":45,"category_name":136,"show_sort_weight":105,"slug":137},19,"General","general"]