نحو إعادة تلوين اللوحات الافتراضية باستخدام محول الرؤية على مكعبات بيانات الفلورسنت بالأشعة السينية Towards virtual painting recolouring using vision transformer on x-ray fluorescence datacubes

شارك:
المجلة: Machine Learning Science and Technology، المجلد: 6، العدد: 1
DOI: https://doi.org/10.1088/2632-2153/adb937
تاريخ النشر: 2025-02-21
المؤلف: Alessandro Bombini وآخرون
الموضوع الرئيسي: تحليل مواد التراث الثقافي

نظرة عامة

في هذه الدراسة، يقدم المؤلفون خط أنابيب جديد لإعادة تلوين الرسم الافتراضي باستخدام البيانات الخام من تحليل الفلورسنس بالأشعة السينية (XRF) للأعمال الفنية. لمعالجة تحدي حجم مجموعة البيانات المحدودة، يقومون بإنشاء مجموعة بيانات اصطناعية بناءً على طيف XRF الموجود. يقدم المؤلفون شبكة تضمين عميقة متغيرة فعالة تقوم بتخطيط طيف XRF إلى مساحة ذات أبعاد أقل مناسبة لتجميع K-Means، مما يعزز التعميم ويقلل من متطلبات الذاكرة. تم تصميم خط الأنابيب لتدريب نماذج تربط الصور الملونة ببيانات XRF المضمنة، ويقوم المؤلفون بتقييم أدائها باستخدام مقاييس الجودة البصرية.

تشير النتائج إلى أن خط الأنابيب المقترح يعد أداة قيمة لعلماء الترميم والتراث، حيث يوفر مساعدة بصرية لتفسير بيانات التصوير النووي الخام، خاصة في الحالات التي تظهر فيها الأعمال الفنية وضوحًا بصريًا منخفضًا. يتضمن خط الأنابيب مكونين رئيسيين: نموذج تضمين عميق لمعالجة الأطياف الفردية ومحول رؤية لتحليل البيانات المضمنة. على الرغم من بعض التحديات المرتبطة بإنشاء مجموعة البيانات الاصطناعية، تظهر النتائج قدرة خط الأنابيب على أداء مهمة إعادة التلوين من البداية إلى النهاية بشكل فعال.

مقدمة

تسلط المقدمة الضوء على الدور التحويلي للذكاء الاصطناعي (AI) في مختلف التخصصات الأكاديمية، لا سيما في تطبيقات الفيزياء النووية لتحليل التراث الثقافي. بينما يتم استخدام طرق التعلم العميق بشكل متزايد، لا يزال هناك مجال لمزيد من التكامل، خاصة في تقنيات الاختبار غير التدميرية مثل تصوير النيوترونات، وطيف أشعة غاما، وتصوير الأشعة السينية. يركز التركيز الرئيسي على قياس الفلورسنس بالأشعة السينية (XRF)، وخاصة الفلورسنس بالأشعة السينية الكبيرة (MA-XRF)، الذي يسمح بالتحليل العنصري غير الجراحي للأعمال الفنية دون معالجة مسبقة للعينة. تنتج هذه التقنية مكعبات بيانات يمكن تحليلها لإنتاج خرائط توزيع عنصرية، مما يساعد في فهم تركيب العمل الفني وتقنيات الفنان.

يقترح البحث خط أنابيب جديد للتلوين الافتراضي، والذي يتضمن استخراج صور RGB من مكعبات بيانات MA-XRF، مما يوفر تغذية بصرية لعلماء الحفظ. ومع ذلك، فإن التحديات مثل مجموعات البيانات ذات الجودة المحدودة وتوحيد البيانات تعيق تطبيق التعلم الآلي في هذا السياق. لمعالجة هذه القضايا، يقدم المؤلفون طريقة لإنشاء بيانات MA-XRF اصطناعية ويستخدمون تضمينًا عميقًا متغيرًا لتحسين حجم مجموعة البيانات واستخراج الميزات. ثم يتم تدريب محول رؤية لتخطيط هذه الخرائط الاصطناعية من MA-XRF إلى صور RGB. تمثل هذه الدراسة خطوة أساسية نحو تنفيذ هذا الخط في سيناريوهات العالم الحقيقي، مع خطط لتعلم تكيف المجال لتعزيز قابليته للتطبيق. ستفصل الأقسام التالية مكونات خط الأنابيب، ونتائج التدريب، وتوفر الوصول إلى مستودع الشيفرة.

طرق

في هذا القسم، يحدد المؤلفون بنية وتنفيذ خط أنابيب التلوين الافتراضي المصمم لتعيين الصور الملونة إلى خرائط MA-XRF التي تم إنشاؤها بواسطة جهاز متحرك في منشأة INFN-CHNet في فلورنسا. يتكون خط الأنابيب من عدة خطوات رئيسية: أولاً، يتم إنشاء مجموعة بيانات اصطناعية من الإشارات الطيفية؛ ثانياً، يتم تدريب نموذج تضمين عميق لتخطيط هذه الأطياف إلى مساحة مقياس ذات أبعاد أقل؛ ثالثاً، باستخدام حزمة Python ganX، يتم إنشاء مجموعة بيانات اصطناعية من صور MA-XRF المضمنة من صور RGB؛ وأخيرًا، يتم تدريب نموذج رؤية حاسوبية لربط صور RGB بصور MA-XRF المضمنة. يتم تمثيل العملية العامة بصريًا في الشكل 1.

نتائج

في هذا القسم، يوضح المؤلفون نتائج عملية اختيار النموذج والتدريب لهيكل SmallUViT، الذي يتكون من 3,485,076 معلمة قابلة للتدريب. تم هيكلة النموذج مع 3+1+3 طبقات محول ضمن كتل U-ViT في الداخل/الوسط/الخارج، باستخدام حجم قطعة قدره $16 \times 16$، و9 رؤوس لكل كتلة متعددة الرؤوس، وأبعاد تضمين قدرها 192، وعامل MLP-to-Dim قدره 2، وأبعاد رأس قدرها 32. تم تعيين كل من معدل التسرب ومعدل العمق العشوائي إلى 0.1.

تم تدريب النموذج لمدة 100 دورة على مجموعة بيانات من 30,210 صورة، وتشير نتائج التدريب إلى فقدان sRGB قدره $L_{\text{test}} = 0.1148$ وقيمة مقياس MS-SSIM قدرها $M_{\text{test}} = 0.9196$. يشير المؤلفون إلى أن التباين الملحوظ بين فقدان/مقاييس التحقق والتدريب يمكن أن يُعزى إلى تنفيذ التسرب والعمق العشوائي خلال مرحلة التدريب، كما هو موضح في الشكل 5.

مناقشة

تتناول قسم المناقشة من ورقة البحث تطوير وتطبيق بنية خط أنابيب لإعادة تلوين بيانات مكعبات الفلورسنس بالأشعة السينية الكبيرة (MA-XRF)، والتي تعد ضرورية لتحليل الأعمال الفنية للتراث الثقافي. XRF هي تقنية غير جراحية تحدد العناصر الكيميائية في المواد من خلال قياس الفلورسنس الناتج عن الأشعة السينية. ومع ذلك، يمكن أن تؤدي التحليلات القياسية لنقطة واحدة من XRF إلى نتائج مضللة بسبب عدم تجانس المواد، مما يستدعي الحاجة إلى MA-XRF، الذي ينتج خرائط توزيع عنصرية مفصلة. يبرز المؤلفون التحديات المرتبطة بأحجام البيانات الكبيرة لصور MA-XRF والقيود المفروضة على مجموعات البيانات الحالية لتطبيقات التعلم العميق.

لمعالجة هذه التحديات، يقترح المؤلفون حلاً من جزئين: إنشاء مجموعات بيانات اصطناعية وتنفيذ نموذج تضمين عميق لاستخراج الميزات ذات الصلة مع تقليل بصمة الذاكرة لصور MA-XRF. قاموا بإنشاء مجموعة بيانات اصطناعية تتكون من حوالي 312,000 صورة بناءً على لوحة من الأصباغ ذات الصلة بدراستهم، باستخدام مزيج من تجميع RGB وطرق مونت كارلو لمحاكاة أطياف XRF. يهدف نموذج التضمين العميق، المدرب على هذه الأطياف، إلى تسهيل تخطيط صور MA-XRF المضمنة إلى صور RGB باستخدام بنية محول رؤية. تشير النتائج الأولية إلى أن خط الأنابيب يمكنه بشكل فعال توليد صور RGB من بيانات MA-XRF، على الرغم من أن بعض القيود لا تزال قائمة، خاصة في إعادة بناء بعض الميزات البصرية بدقة. ستركز الأعمال المستقبلية على تحسين مجموعة البيانات وتنقيح النموذج لتحسين الأداء ومعالجة النواقص المحددة.

Journal: Machine Learning Science and Technology, Volume: 6, Issue: 1
DOI: https://doi.org/10.1088/2632-2153/adb937
Publication Date: 2025-02-21
Author(s): Alessandro Bombini et al.
Primary Topic: Cultural Heritage Materials Analysis

Overview

In this study, the authors present a novel pipeline for virtual painting recolouring utilizing raw data from X-Ray Fluorescence (XRF) analysis of artworks. To address the challenge of limited dataset size, they generate a synthetic dataset based on existing XRF spectra. The authors introduce a Deep Variational Embedding network that effectively maps the XRF spectra into a lower-dimensional space conducive to K-Means clustering, enhancing generalization and reducing memory requirements. The pipeline is designed to train models that correlate coloured images with embedded XRF data, and the authors evaluate its performance using visual quality metrics.

The findings indicate that the proposed pipeline serves as a valuable tool for restoration and heritage scientists, providing a visual aid to interpret raw nuclear imaging data, particularly in cases where artworks exhibit diminished visual clarity. The pipeline includes two key components: a Deep Embedding model for processing individual spectra and a Vision Transformer for analyzing the embedded data. Despite some challenges associated with the synthetic dataset generation, the results demonstrate the pipeline’s capability to perform the end-to-end recolouring task effectively.

Introduction

The introduction highlights the transformative role of Artificial Intelligence (AI) in various academic disciplines, particularly in nuclear physics applications for Cultural Heritage analysis. While deep learning methods are increasingly utilized, there remains potential for further integration, especially in non-destructive testing techniques such as neutron imaging, gamma-ray spectroscopy, and X-ray imaging. A key focus is on X-Ray Fluorescence (XRF) spectrometry, particularly Macro X-Ray Fluorescence (MA-XRF), which allows for non-invasive elemental analysis of artworks without sample pretreatment. This technique generates data cubes that can be analyzed to produce elemental distribution maps, aiding in the understanding of an artwork’s composition and the artist’s techniques.

The paper proposes a novel pipeline for virtual coloring, which involves extracting RGB images from MA-XRF data cubes, thereby providing visual feedback for conservation scientists. However, challenges such as limited quality datasets and data standardization hinder the application of machine learning in this context. To address these issues, the authors introduce a method for synthetic MA-XRF data generation and employ Deep Variational Embedding to optimize dataset size and feature extraction. A Vision Transformer is then trained to map these synthetic MA-XRF maps to RGB images. This study represents a foundational step towards implementing this pipeline in real-world scenarios, with plans for domain adaptation learning to enhance its applicability. Subsequent sections will detail the pipeline’s components, training results, and provide access to the code repository.

Methods

In this section, the authors outline the architecture and implementation of a virtual colouring pipeline designed to assign colored images to MA-XRF maps generated by a movable apparatus at the INFN-CHNet node facility in Florence. The pipeline consists of several key steps: first, a synthetic dataset of spectral signals is generated; second, a Deep Embedding model is trained to map these spectra into a lower-dimensional metric space; third, using the Python package ganX, a synthetic dataset of embedded MA-XRF images is created from RGB images; finally, a Computer Vision model is trained to correlate the RGB images with the embedded MA-XRF images. The overall process is visually represented in Figure 1.

Results

In this section, the authors detail the results of their model selection and training process for the SmallUViT architecture, which consists of 3,485,076 trainable parameters. The model is structured with 3+1+3 Transformer layers within the in/mid/out U-ViT blocks, utilizing a patch size of $16 \times 16$, 9 heads per MultiHead block, an embedding dimension of 192, a MLP-to-Dim factor of 2, and a head dimension of 32. Both the dropout rate and stochastic depth rate are set to 0.1.

The model was trained for 100 epochs on a dataset of 30,210 images, and the training results indicate a sRGB loss of $L_{\text{test}} = 0.1148$ and an MS-SSIM metric value of $M_{\text{test}} = 0.9196$. The authors note that the observed discrepancy between validation and training loss/metrics can be attributed to the implementation of Dropout and Stochastic Depth during the training phase, as illustrated in Figure 5.

Discussion

The discussion section of the research paper outlines the development and application of a pipeline architecture for virtual recoloring of Macro X-Ray Fluorescence (MA-XRF) data cubes, which are crucial for analyzing cultural heritage artworks. XRF is a non-invasive technique that identifies chemical elements in materials by measuring emitted X-ray fluorescence. However, standard single-spot XRF analysis can yield misleading results due to material inhomogeneities, prompting the need for MA-XRF, which generates detailed elemental distribution maps. The authors highlight the challenges associated with the large data sizes of MA-XRF images and the limitations of existing datasets for deep learning applications.

To address these challenges, the authors propose a two-part solution: the generation of synthetic datasets and the implementation of a Deep Embedding model to extract relevant features while reducing the memory footprint of MA-XRF images. They constructed a synthetic dataset of approximately 312,000 images based on a palette of pigments relevant to their study, utilizing a combination of RGB clustering and Monte Carlo methods to simulate XRF spectra. The Deep Embedding model, trained on these spectra, aims to facilitate the mapping of embedded MA-XRF images to RGB images using a Vision Transformer architecture. Initial results indicate that the pipeline can effectively generate RGB images from MA-XRF data, although some limitations remain, particularly in accurately reconstructing certain visual features. Future work will focus on enhancing the dataset and refining the model to improve performance and address the identified shortcomings.