Painting composition recognition method based on multi-wavelength raman spectrum and reconstruction constraint
Patent Information
- Application Number
- CN202610649414.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-12
- Publication Date
- 2026-08-18
AI Technical Summary
针对现有技术的不足,本发明提供了一种基于多波长拉曼光谱与重构约束的油画成分识别方法,解决了现有拉曼光谱检测方法难以对油画中的着色剂与结合介质进行有效区分,多波长信息融合困难、特征缺乏物理结构约束,导致识别精度与模型稳定性不足的技术问题
本发明中,首先采集并预处理油画同一检测区域的多波长拉曼光谱;其次,编码预处理得到的各标准化拉曼光谱,获取对应的多波长低维特征;再次,对各多波长低维特征执行注意力特征融合;接着,基于融合特征,并结合着色剂与结合介质的标签信息,在光谱重构所获重构损失的约束下,分别训练得到着色剂分类模型与结合介质分类模型;最后,利用两个分类模型获取待识别油画区域的成分结果。本方法通过多波长信息协同利用与注意力融合实现高效特征整合,配合光谱重构的物理约束,使模型特征表达更合理、学习过程更稳定,能够显著提升油画不同成分的区分效果与识别稳定性,从而在复杂油画体系中保持高精度、鲁棒性的材料识别效果。
Smart Images

Figure CN122591635A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Raman spectroscopy for oil painting composition identification technology, specifically to a method for oil painting composition identification based on multi-wavelength Raman spectroscopy and reconstruction constraints. Background Technology
[0002] Oil painting materials are composed of colorants (including organic and inorganic colorants) and binding media such as oils, resins, and proteins. Rapid, non-destructive, and accurate identification of these components is crucial for oil painting material analysis, cultural relic preservation, and authentication. Raman spectroscopy, which can non-destructively obtain molecular vibrational information, has become an important technique for detecting the composition of oil painting materials.
[0003] In related technologies, existing Raman spectroscopy detection mostly uses a single excitation wavelength to acquire spectral signals. After conventional preprocessing such as baseline correction, smoothing, and normalization, the components are identified through manual interpretation or traditional machine learning. Some multi-wavelength detection schemes simply splice or weight different wavelength spectra, and the model takes classification loss as the sole optimization objective without imposing constraints on feature representation.
[0004] However, the Raman characteristic peaks of organic colorants and binding media overlap significantly, and the signals of inorganic colorants, some fillers, and aging products are also prone to interference, making it difficult for traditional methods to achieve effective differentiation. Single excitation wavelength detection suffers from the problem of not being able to simultaneously achieve signal intensity and fluorescence suppression. Multi-wavelength spectral information fusion is insufficient, resulting in high feature redundancy; the model feature expression lacks physical structural constraints, leading to poor consistency; and in complex oil painting scenarios involving aging, contamination, and multi-layered stacking, the accuracy of component identification is low, and the model stability is insufficient. Summary of the Invention
[0005] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints. This method solves the technical problems of existing Raman spectroscopy detection methods, which struggle to effectively distinguish between colorants and binding media in oil paintings, have difficulty in fusing multi-wavelength information, and lack physical structural constraints on features, resulting in insufficient recognition accuracy and model stability.
[0006] (II) Technical Solution A method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints includes: Multi-wavelength Raman spectra of multiple detection areas of the oil painting were collected, and the multi-wavelength Raman spectra of each detection area were preprocessed to obtain the corresponding standardized Raman spectra. Encode the standardized Raman spectra of each spectrum to obtain the corresponding multi-wavelength low-dimensional features; Attention feature fusion is performed on each of the multi-wavelength low-dimensional features to obtain fused features; Based on the fusion features and combined with the label information of the colorant and the binding medium, a colorant classification model and a binding medium classification model are trained respectively under the constraint of reconstruction loss; wherein, the reconstruction loss is obtained by spectral reconstruction of each of the multi-wavelength low-dimensional features and calculation. Multi-wavelength Raman spectra of the oil painting area to be identified are collected, and after preprocessing, encoding and attention feature fusion, they are used as inputs to the colorant classification model and the binding medium classification model to obtain the oil painting component identification results.
[0007] Preferably, the preprocessing is a combination of one or any of the following operations: Baseline correction, smoothing and denoising, wavenumber axis alignment and normalization.
[0008] Preferably, the step of performing attention feature fusion on each of the multi-wavelength low-dimensional features to obtain fused features includes: The current multi-wavelength low-dimensional feature is mapped to a query vector, and other multi-wavelength low-dimensional features are mapped to key vectors and value vectors respectively. Based on the query vector and the key vector, attention weights are obtained through scaling and normalization calculations. The corresponding value vectors are weighted and summed using the attention weights, and then superimposed with the current multi-wavelength low-dimensional features to obtain the weighted fusion result of each of the multi-wavelength low-dimensional features; By concatenating all weighted fusion results, the fusion feature is obtained.
[0009] Preferably, the process of obtaining the reconstruction loss includes: A decoder is used to reconstruct the spectrum of each of the multi-wavelength low-dimensional features to obtain the corresponding reconstructed Raman spectrum. Based on the reconstructed Raman spectra and their corresponding normalized Raman spectra, the reconstruction error is calculated to construct the reconstruction loss.
[0010] Preferably, the step of training a colorant classification model and a binding medium classification model based on the fusion features and combined with the label information of the colorant and binding medium, respectively, under the constraint of reconstruction loss, includes: Using the fusion features as classification input, the label information of the colorant and the binding medium are matched respectively, and the colorant classification loss and the binding medium classification loss are constructed accordingly. The colorant classification loss and the reconstruction loss are weighted and fused together, and the binding medium classification loss and the reconstruction loss are weighted and fused together to construct the total colorant loss and the total binding medium loss, respectively. Based on iterative training using the total loss of the colorant and the total loss of the binding medium, the colorant classification model and the binding medium classification model are obtained.
[0011] Preferably, the multi-wavelength Raman spectrum includes Raman spectra acquired at two different excitation wavelengths of 532 nm and 785 nm.
[0012] An oil painting component identification system based on multi-wavelength Raman spectroscopy and reconstruction constraints, comprising: The data acquisition and preprocessing module is used to acquire multi-wavelength Raman spectra from multiple detection areas of the oil painting, and to preprocess each of the multi-wavelength Raman spectra in the same detection area to obtain the corresponding standardized Raman spectra. The spectral encoding module is used to encode each of the standardized Raman spectra and obtain the corresponding multi-wavelength low-dimensional features. The feature fusion module is used to perform attention feature fusion on each of the multi-wavelength low-dimensional features to obtain fused features; The model training module is used to train a colorant classification model and a binding medium classification model respectively based on the fusion features and combined with the label information of the colorant and binding medium, under the constraint of reconstruction loss; wherein, the reconstruction loss is obtained by spectral reconstruction of each of the multi-wavelength low-dimensional features and calculation. The component identification module is used to collect multi-wavelength Raman spectra of the oil painting area to be identified. After being preprocessed, encoded, and fused with attention features, the spectra are used as inputs to the colorant classification model and the binding medium classification model to obtain the oil painting component identification results.
[0013] A computer program product, comprising computer program code, which, when run on a computer, enables the computer to implement the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints as described above.
[0014] A storage medium storing a computer program, wherein the computer program causes a computer to execute the oil painting composition identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints as described above.
[0015] An electronic device, the electronic device comprising: Processor and memory; The memory stores program instructions; The processor is used to run the program instructions to execute the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints as described above.
[0016] (III) Beneficial Effects This invention provides a method for identifying the components of oil paintings based on multi-wavelength Raman spectroscopy and reconstruction constraints. Compared with existing technologies, it has the following advantages: In this invention, firstly, multi-wavelength Raman spectra of the same detection area of an oil painting are acquired and preprocessed; secondly, the standardized Raman spectra obtained from the preprocessing are encoded to obtain corresponding multi-wavelength low-dimensional features; thirdly, attention feature fusion is performed on each multi-wavelength low-dimensional feature; next, based on the fused features and combined with the label information of colorants and binding media, under the constraint of the reconstruction loss obtained from spectral reconstruction, colorant classification models and binding media classification models are trained respectively; finally, the composition results of the oil painting area to be identified are obtained using the two classification models. This method achieves efficient feature integration through the synergistic use of multi-wavelength information and attention fusion. Combined with the physical constraints of spectral reconstruction, the model feature expression is more reasonable and the learning process is more stable, which can significantly improve the differentiation effect and recognition stability of different components of oil paintings, thereby maintaining high-precision and robust material recognition effects in complex oil painting systems. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints, provided as an embodiment of the present invention; Figure 2 A schematic diagram of the training phase of a method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints provided in an embodiment of the present invention; Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0019] Component labeling explanation: 100 - electronic device, 101 - memory, 102 - processor, 103 - display. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are described clearly and completely. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] As mentioned in the background section, Raman spectroscopy detection in related technologies often uses a single excitation wavelength to acquire signals. After conventional preprocessing, component analysis is performed by manual interpretation or traditional machine learning. Some multi-wavelength schemes only use simple splicing or weighting methods. Most models use classification loss as the sole optimization objective, without applying effective constraints to feature learning. Due to the similar functional group structures of organic and inorganic colorants and binding media in oil paintings, Raman vibration peaks are prone to overlap and interference. In addition, a single wavelength cannot simultaneously address fluorescence suppression and signal intensity, making it difficult to effectively distinguish between various colorants and binding media. Multi-wavelength spectral information cannot be deeply integrated, resulting in high feature redundancy and low utilization of effective information. The models lack physical structural constraints, leading to poor consistency in feature expression. In complex scenarios such as aging, contamination, and multi-layered oil paintings, the component differentiation ability is weak, and the recognition accuracy and model stability cannot meet the actual needs of cultural relic detection.
[0022] To address the aforementioned problems, this invention provides a method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints. This method first preprocesses the multi-wavelength Raman spectra by baseline correction, smoothing and denoising, normalization, and wavenumber alignment. Then, it achieves feature dimensionality reduction through an encoding structure. An attention mechanism is used to query, key-value map, and weightedly fuse the low-dimensional features of each multi-wavelength spectrum, deeply coordinating spectral information from different wavelengths. Simultaneously, a decoder is used to reconstruct the spectrum and calculate the reconstruction loss. Using the reconstruction loss as a constraint, a colorant classification model and a binding medium classification model are trained separately, combined with classification labels. This significantly improves the physical rationality of feature representation and the stability of model learning, thus enabling high-precision and robust component identification of organic colorants, inorganic colorants, and binding media even in complex oil painting scenarios such as aging, contamination, and multi-layer stacking.
[0023] It should be noted that the colorants specifically encompass two types of core pigment components: organic colorants and inorganic colorants. Organic colorants are mostly synthetic pigments with complex molecular structures and high spectral overlap, while inorganic colorants are mostly natural minerals or inorganic oxides with stable physicochemical properties, but their spectral characteristics are easily coupled and interfered with by auxiliary material peaks. The overall method architecture of this invention is compatible with both types of colorant detection scenarios. It can accurately identify the differences between organic colorants and various oil-based, resin-based, and protein-based binding media, and also efficiently and accurately distinguish and adapt inorganic colorants to their corresponding binding media. This comprehensively covers the non-destructive traceability testing of core raw material components across all categories of oil paintings, and is suitable for diverse application scenarios such as the verification of materials used in the reproduction of various old painted cultural relics and genuine museum oil paintings.
[0024] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods. Example
[0025] like Figure 1 As shown, this embodiment of the invention provides a method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints, including: S1. Collect multi-wavelength Raman spectra from multiple detection areas of the oil painting, and preprocess each multi-wavelength Raman spectrum in the same detection area to obtain the corresponding standardized Raman spectrum. S2. Encode the standardized Raman spectra of each spectrum to obtain the corresponding multi-wavelength low-dimensional features; S3. Perform attention feature fusion on each of the multi-wavelength low-dimensional features to obtain fused features; S4. Based on the fusion features and combined with the label information of the colorant and the binding medium, a colorant classification model and a binding medium classification model are trained respectively under the constraint of reconstruction loss; wherein, the reconstruction loss is obtained by spectral reconstruction of each of the multi-wavelength low-dimensional features and calculation. S5. Collect multi-wavelength Raman spectra of the oil painting area to be identified, and use them as inputs to the colorant classification model and the binding medium classification model after preprocessing, encoding and attention feature fusion, to obtain the oil painting component identification results.
[0026] This invention, through the construction of an integrated model combining encoding, cross-modal feature fusion, and spectral reconstruction constraints, achieves the effective synergistic utilization of spectral information of different wavelengths. While improving the ability to distinguish between colorants and binding media, it also enhances the physical consistency of feature expression and model stability, thereby achieving high-precision and robust material recognition in complex oil painting systems.
[0027] As shown in Figure 2, Figure 2 This diagram illustrates the training phase of a method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints, as provided in an embodiment of the present invention. The process comprises a parallel main branch (feature extraction and classification training) and a constraint branch (spectral reconstruction loss constraint), both sharing basic features through the same preprocessing workflow. The main branch sequentially includes spectral preprocessing, spectral encoding, attention feature fusion, and classification model training; the constraint branch sequentially includes spectral reconstruction, error calculation, loss construction, and training constraints. Specifically, the encoder encodes standardized Raman spectra to obtain multi-wavelength low-dimensional features. These features are input to the attention feature fusion module of the main branch and the decoder of the constraint branch for spectral reconstruction. After the decoder outputs the reconstructed spectrum, it calculates the reconstruction error based on the reconstructed spectrum and the standardized Raman spectrum, generating a reconstruction loss. This reconstruction loss is then fed back to the classification model training stage to optimize the physical constraints of the model.
[0028] Next, we will combine Figure 2 The steps of the above technical solution are described in detail: In step S1, multi-wavelength Raman spectra of multiple detection areas of the oil painting are collected, and the multi-wavelength Raman spectra of each detection area are preprocessed to obtain the corresponding standardized Raman spectra.
[0029] First, it should be noted that this step involves collecting multi-wavelength Raman spectra of the same detection area of the oil painting at least two different excitation wavelengths. .in, To excite the wavelength index, For detection area indexing, For Raman shift, Represents the set of real numbers. Represents multi-wavelength Raman spectra The feature dimensions.
[0030] It should be understood that using multi-wavelength excitation can take into account different Raman signal response intensities and fluorescence suppression effects, fully obtain the characteristic information of colorants and binding media under different excitation conditions, improve the richness and applicability of spectral data, and provide a reliable data foundation for subsequent feature extraction, deep fusion and high-precision identification.
[0031] Subsequently, the acquired multi-wavelength Raman spectra are preprocessed. In an optional embodiment, the preprocessing includes baseline correction, smoothing and noise reduction, wavenumber axis alignment, and normalization, resulting in the corresponding standardized Raman spectra. .
[0032] Taking organic colorants as an example, for instance, three categories were set for organic colorants: dye A, dye B, and dye C, and three categories were set for binding media: linseed oil, protein glue, and natural resin. Two excitation wavelengths, 532nm and 785nm, were used for acquisition, and 400 spectral data were collected for each category of samples at each wavelength, for a total of 4800 data points.
[0033] It should be noted that the Raman spectra acquired at two different excitation wavelengths, 532 nm and 785 nm, balance signal intensity and fluorescence suppression, respectively, thus improving the applicability and stability of the spectral acquisition.
[0034] Next, the spectral data obtained at the same measurement point under the two excitation wavelengths were paired to form 2400 dual-wavelength spectral data pairs. Each pair was then labeled with the corresponding organic colorant and binding medium labels, resulting in a complete labeled dataset for subsequent model training. Among these: The first pairing The dual-wavelength spectral data are represented as follows: ; in, Indicates the first The first excitation wavelength Raman spectrum corresponding to each detection region, namely the 532nm excitation wavelength Raman spectrum; Indicates the first The second excitation wavelength Raman spectrum corresponding to each detection region, namely the 785nm excitation wavelength Raman spectrum.
[0035] Corresponding to the Each label is denoted as: ; in, For the first Each detection area corresponds to an organic colorant category label (dye A, dye B, or dye C). For the first Each detection area corresponds to a label for the binding medium category (flaxseed oil, protein glue, or natural resin).
[0036] Furthermore, the collected raw Raman spectra were analyzed in the corresponding fingerprint region (400-1800 cm⁻¹). -1 Preprocess according to the following parameters: 1) Baseline correction: Asymmetric least squares method is used for baseline correction, where the smoothing parameter λ is 1×10. 5 The penalty factor p is set to 0.01.
[0037] 2) Smoothing and denoising: The Savitzky-Golay filtering method is used for smoothing, with the window width set to 11 sampling points and the polynomial order set to 3.
[0038] 3) Spectral Alignment: Create a common coordinate axis from 200-2000cm -1 Align the Raman spectral data to this common coordinate axis.
[0039] 4) Normalization: Apply maximum value normalization to each spectrum to map the spectral intensity to the [0,1] interval.
[0040] In step S2, the standardized Raman spectra are encoded to obtain the corresponding multi-wavelength low-dimensional features.
[0041] This step uses a pre-built encoder to perform the encoding operation for each of the normalized Raman spectra: .in, Indicates the first The first one collected at the excitation wavelength The multi-wavelength low-dimensional features corresponding to each detection region ,and ; This represents the encoding function.
[0042] More specifically, the above encoding process can be represented as: ; in, Both are the weight matrices of the encoder; These are all encoder bias terms; is a non-linear activation function; Pool is a pooling operation used to achieve feature dimensionality reduction.
[0043] Continuing with the example above, all 2400 dual-wavelength spectral data pairs were randomly divided into a training set and a test set in an 8:2 ratio. The training set contained 1920 dual-wavelength spectral data pairs, and the test set contained 480 dual-wavelength spectral data pairs. Feature extraction was then performed on the dual-wavelength spectral data pairs in the training set.
[0044] More specifically, a one-dimensional convolutional neural network is pre-constructed as the encoder. This encoder is used for feature extraction from spectra. Its network structure consists of: a first convolutional layer, a ReLU activation function, a max-pooling layer, a second convolutional layer, a ReLU activation function, a max-pooling layer, a third convolutional layer, a ReLU activation function, a global pooling layer, and a fully connected layer. The first convolutional layer has 16 channels and a kernel size of 3, used to extract initial spectral features. After processing with the ReLU activation function, it is input to the max-pooling layer for downsampling, with a pooling stride of 2. The second and third convolutional layers have 32 and 64 channels respectively. Each convolutional layer is followed by a ReLU activation function, and a max-pooling layer is added after the second convolutional layer to further reduce the feature dimensionality. After multi-layer convolutional feature extraction, the features are compressed by the global pooling layer and then input to the fully connected layer, mapping the features to a 128-dimensional feature space, ultimately obtaining a low-dimensional feature representation of the spectrum. .
[0045] In step S3, attention feature fusion is performed on each of the multi-wavelength low-dimensional features to obtain fused features.
[0046] This step performs attention feature fusion on different wavelength features. In an optional implementation, the attention feature fusion process specifically includes: S31. Map the current multi-wavelength low-dimensional features to a query vector, and map each of the other multi-wavelength low-dimensional features to a key vector and a value vector, respectively, as follows: ; in, Indicates the first The query vector corresponding to each multi-wavelength low-dimensional feature is used to represent the query intent of the current feature; Indicates the first The key vectors corresponding to the multi-wavelength low-dimensional features are used for matching calculations with the query vector; Indicates the first The value vectors corresponding to the multi-wavelength low-dimensional features provide a feature carrier for subsequent weighted fusion. , , These are the learnable mapping matrices for the query, key, and value vectors, respectively.
[0047] S32. Based on the query vector and the key vector, the attention weight is obtained through scaling and normalization, and is expressed as follows: ; in, Indicates the first The low-dimensional feature is relative to the first Attention weights for low-dimensional features; superscript Indicates transpose calculation; It is a normalization function that makes the sum of all weights equal to 1.
[0048] S33. The corresponding value vectors are weighted and summed using the attention weights, and then superimposed with the current multi-wavelength low-dimensional features to obtain the weighted fusion result of each of the multi-wavelength low-dimensional features, expressed as: ; S34. Concatenate all weighted fusion results to obtain the fusion feature, represented as: ; in, No. The fusion features corresponding to each detection region; This is a feature splicing operation.
[0049] Understandably, the attention feature fusion step described above can dynamically weight and complement the spectral features of different excitation wavelengths, automatically enhance high-discrimination features, weaken redundant information, achieve deep synergy of multi-wavelength spectral information, effectively improve the representation ability and robustness of fused features, and provide more accurate and physically meaningful feature inputs for subsequent classification models.
[0050] Continuing with the example above, we will represent the low-dimensional features. Perform feature fusion operation to finally obtain the first... Fusion features corresponding to each detection region .
[0051] In step S4, based on the fusion features and combined with the label information of the colorant and binding medium, a colorant classification model and a binding medium classification model are trained respectively under the constraint of reconstruction loss. The reconstruction loss is obtained by spectral reconstruction of each of the multi-wavelength low-dimensional features and calculation.
[0052] This step involves training the colorant classification model and the combined medium classification model. First, the multi-wavelength low-dimensional features are spectrally reconstructed and the reconstruction loss is calculated to impose physical structural constraints on the encoding process.
[0053] In an optional implementation, the process of obtaining the reconstruction loss includes: S10. The decoder is used to reconstruct the spectra of each of the multi-wavelength low-dimensional features to obtain the corresponding reconstructed Raman spectra, which are represented as follows: ; in, Indicates the first The first one collected at the excitation wavelength The reconstructed Raman spectra corresponding to each detection region; This represents the decoding function.
[0054] S20. Based on the reconstructed Raman spectra and their corresponding normalized Raman spectra, calculate the reconstruction error to construct the reconstruction loss.
[0055] It should be noted that the reconstruction error includes, but is not limited to, mean squared error, L1 norm loss, Pearson correlation coefficient loss, etc., preferably mean squared error, to ensure reconstruction accuracy and training stability. In this case, the reconstruction loss function is expressed as: ; in, The total number of samples; It is the square of the L2 norm, i.e., the mean square error.
[0056] Continuing with the example above, the decoder structure includes, in sequence: a first fully connected layer, used to represent the 128-dimensional low-dimensional features of the input. The features are mapped to a 256-dimensional feature space; after a nonlinear transformation using the ReLU activation function, they are input into the second fully connected layer, further mapping the 256-dimensional features to a 1200-dimensional output space, thus obtaining the reconstructed spectrum and achieving an approximate recovery of the original spectral signal. The reconstruction loss function is then specifically expressed as follows: ; Subsequently, under the constraint of reconstruction loss, a colorant classification model and a binding medium classification model are trained respectively. In an optional implementation, the training process includes: S10' Using the fused features as classification input, match the label information of the colorant and the binding medium respectively, and construct the colorant classification loss and the binding medium classification loss accordingly, wherein: The colorant classification model is represented as follows: ; in, Indicates the first Predicted probability of colorant category in each detection area These represent the weight matrix and bias term of the colorant classification model, respectively.
[0057] Correspondingly, the colorant classification loss is expressed as: ; The network structure of the combined media classification model can be the same as that of the colorant classification model described above, but the model parameters of the two are independent and do not share weights. The combined media classification model is represented as follows: ; in, Indicates the first Each detection area has a probability prediction based on the media category; This represents the weight matrix and bias terms of the combined media classification model.
[0058] Accordingly, the media classification loss is expressed as: ; It is understood that both the aforementioned colorant classification model and the combined medium classification model employ a fully connected layer and Softmax activation structure to map the fused features into a class probability distribution. The introduction of cross-entropy loss effectively quantifies the deviation between the model's predictions and the true labels, enabling the model to optimize towards improving classification accuracy during training. It should be noted that the introduction of cross-entropy loss is merely illustrative; those skilled in the art can replace it with other classification loss functions according to actual needs, such as weighted cross-entropy loss, Focal loss, etc., without departing from the scope of protection of this invention.
[0059] S20', The colorant classification loss and the reconstruction loss are weighted and fused together, and the binding medium classification loss and the reconstruction loss are weighted and fused together, respectively constructing the total colorant loss and the total binding medium loss, which are expressed as follows: ; in, , These represent the total loss of colorant and the total loss of binding medium, respectively. To reconstruct the loss The weighting coefficients.
[0060] S30': Based on the total loss of the colorant and the total loss of the binding medium, iterative training is performed to obtain the colorant classification model and the binding medium classification model.
[0061] Understandably, this embodiment of the invention introduces reconstruction loss as a physical constraint, incorporating spectral reconstruction error into the total loss function for joint optimization. During training, it not only focuses on the recognition accuracy of the classification task but also forces low-dimensional features to retain the physical information of the original spectrum through the encoder-decoder structure. This constraint effectively avoids the model learning noise or overfitting features unrelated to the physical properties of the spectrum solely for the sake of classification accuracy. It significantly improves the physical consistency and robustness of the fused features, enabling the model to maintain stable and reliable recognition performance even in complex scenarios such as aging, pollution, and multi-layer superposition of oil paintings. This overcomes the shortcomings of existing single classification loss optimization schemes, such as the lack of physical meaning in feature representation and insufficient generalization ability.
[0062] Continuing with the previous example, we construct an organic colorant classification model and a binding medium classification model. Both have the same network structure, and for example, they both include, in sequence: [the following is a list of features]. The input is passed through a fully connected layer (dimension mapped from 256 to 64), a ReLU activation function, another fully connected layer (dimension mapped from 64 to the number of classes), and finally outputs the class probability distribution through a Softmax activation function.
[0063] Furthermore, the organic colorant classification model is trained using the total loss. To optimize the objective, the training of the media classification model is combined with the total loss. To optimize the objective, both models employ independent training processes and do not share training parameters. For example, the training process uses the Adam optimizer, with an initial learning rate of 0.001, a batch size of 32, and 100 training iterations until the model converges.
[0064] In step S5, multi-wavelength Raman spectra of the oil painting area to be identified are acquired, and after preprocessing, encoding and attention feature fusion, they are used as inputs to the colorant classification model and the binding medium classification model to obtain the oil painting component identification results.
[0065] This step involves sequentially processing the multi-wavelength Raman spectra of the oil painting area to be identified through step S1 (preprocessing), step S2 (encoding), and step S3 (attention feature fusion). The corresponding fused features are then used as inputs to the colorant classification model and the binding medium classification model to finally obtain the oil painting component identification results, namely, the organic or inorganic colorant identification results and the binding medium identification results.
[0066] Continuing with the previous example, using 480 dual-wavelength spectral data points from the test set, the same encoding and attention feature fusion operations were performed (the dual-wavelength spectral data in the test set consisted of pairs of preprocessed normalized Raman spectra, so no further preprocessing was required). These results were then used as input to the organic colorant classification model and the binding medium classification model to obtain the test results. That is, for each test dual-wavelength spectral data point, the model outputs the corresponding category label, and the predicted result is compared with the true label to evaluate the model performance.
[0067] Furthermore, classification accuracy is used as a metric to evaluate model performance, typically expressed as the proportion of correctly classified samples out of the total number of samples. In classification tasks, the more correctly classified samples, the higher the accuracy, indicating a stronger classification ability of the model. The formula for calculating overall accuracy is: In this experiment, the classification accuracy of organic colorants reached over 90% in the test set, and the classification accuracy of combined media reached over 88%, demonstrating that fully utilizing spectral data information can improve the efficiency and accuracy of oil painting component identification and promote the research progress of Raman spectroscopy material identification.
[0068] This concludes the complete process of the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints. In summary, this invention achieves high-precision identification of organic or inorganic colorants and binding media in oil paintings by constructing a multi-wavelength spectral data system, spectral encoding dimensionality reduction, attention feature fusion, and training a dual-classification model with fusion reconstruction loss constraints. It exhibits stronger robustness and generalization ability, especially under complex conditions such as aging and contamination.
[0069] Example 2: This invention provides a system for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints, comprising: The data acquisition and preprocessing module is used to acquire multi-wavelength Raman spectra from multiple detection areas of the oil painting, and to preprocess each of the multi-wavelength Raman spectra in the same detection area to obtain the corresponding standardized Raman spectra. The spectral encoding module is used to encode each of the standardized Raman spectra and obtain the corresponding multi-wavelength low-dimensional features. The feature fusion module is used to perform attention feature fusion on each of the multi-wavelength low-dimensional features to obtain fused features; The model training module is used to train a colorant classification model and a binding medium classification model respectively based on the fusion features and combined with the label information of the colorant and binding medium, under the constraint of reconstruction loss; wherein, the reconstruction loss is obtained by spectral reconstruction of each of the multi-wavelength low-dimensional features and calculation. The component identification module is used to collect multi-wavelength Raman spectra of the oil painting area to be identified. After being preprocessed, encoded, and fused with attention features, the spectra are used as inputs to the colorant classification model and the binding medium classification model to obtain the oil painting component identification results.
[0070] This invention, through the construction of an integrated model combining encoding, cross-modal feature fusion, and spectral reconstruction constraints, achieves the effective synergistic utilization of spectral information of different wavelengths. While improving the ability to distinguish between colorants and binding media, it also enhances the physical consistency of feature expression and model stability, thereby achieving high-precision and robust material recognition in complex oil painting systems.
[0071] In an optional implementation, the preprocessing is one or any combination of the following operations: Baseline correction, smoothing and denoising, wavenumber axis alignment and normalization.
[0072] In an optional implementation, performing attention feature fusion on each of the multi-wavelength low-dimensional features to obtain fused features includes: The current multi-wavelength low-dimensional feature is mapped to a query vector, and other multi-wavelength low-dimensional features are mapped to key vectors and value vectors respectively. Based on the query vector and the key vector, attention weights are obtained through scaling and normalization calculations. The corresponding value vectors are weighted and summed using the attention weights, and then superimposed with the current multi-wavelength low-dimensional features to obtain the weighted fusion result of each of the multi-wavelength low-dimensional features; By concatenating all weighted fusion results, the fusion feature is obtained.
[0073] In an optional implementation, the process of obtaining the reconstruction loss includes: A decoder is used to reconstruct the spectrum of each of the multi-wavelength low-dimensional features to obtain the corresponding reconstructed Raman spectrum. Based on the reconstructed Raman spectra and their corresponding normalized Raman spectra, the reconstruction error is calculated to construct the reconstruction loss.
[0074] In an optional implementation, the step of training a colorant classification model and a binding medium classification model respectively based on the fusion features and combined with the label information of the colorant and binding medium, under the constraint of reconstruction loss, includes: Using the fusion features as classification input, the label information of the colorant and the binding medium are matched respectively, and the colorant classification loss and the binding medium classification loss are constructed accordingly. The colorant classification loss and the reconstruction loss are weighted and fused together, and the binding medium classification loss and the reconstruction loss are weighted and fused together to construct the total colorant loss and the total binding medium loss, respectively. Based on iterative training using the total loss of the colorant and the total loss of the binding medium, the colorant classification model and the binding medium classification model are obtained.
[0075] In an optional embodiment, the multi-wavelength Raman spectrum includes Raman spectra acquired at two different excitation wavelengths of 532 nm and 785 nm.
[0076] Example 3: This invention provides a computer program product, which includes computer program code. When the computer program code is run on a computer, the computer implements the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints provided in any embodiment of this invention.
[0077] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. In the embodiments of the present invention, the computer program can be stored in a non-volatile computer-readable storage medium, and when executed, the computer program can include the processes of the embodiments of the methods described above.
[0078] Example 4: This invention provides a storage medium storing a computer program that causes a computer to execute the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints as provided in any embodiment of this invention.
[0079] In embodiments of the present invention, any combination of one or more storage media may be used. The storage medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, RAM, ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in connection with an instruction execution system, apparatus, or device.
[0080] Example 5: This invention provides an electronic device. Figure 3The diagram shown illustrates the structure of the electronic device 100 provided in an embodiment of the present invention. In some embodiments, the electronic device may be a mobile phone, tablet computer, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or other terminal device. Furthermore, the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints provided in this embodiment can also be applied to databases, servers, and service response systems based on terminal artificial intelligence. This embodiment does not limit the specific application scenarios of the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints.
[0081] like Figure 3 As shown, the electronic device 100 provided in this embodiment of the invention includes a memory 101 and a processor 102.
[0082] The memory 101 is used to store computer programs; preferably, the memory 101 includes various media that can store program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk.
[0083] Specifically, memory 101 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. Electronic device 100 may further include other removable / non-removable, volatile / non-volatile computer system storage media. Memory 101 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0084] The processor 102 is connected to the memory 101 and is used to execute the computer program stored in the memory 101 so that the electronic device 100 executes the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints provided in any embodiment of the present invention.
[0085] In an optional implementation, the processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, evaluation index gate or transistor logic devices, or evaluation index hardware components.
[0086] In an optional embodiment of the invention, the electronic device 100 may further include a display 103. The display 103 is communicatively connected to the memory 101 and the processor 102, and is used to display a GUI interface related to the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints.
[0087] It is understood that the oil painting component identification system, computer program product, storage medium and electronic device based on multi-wavelength Raman spectroscopy and reconstruction constraints provided in the embodiments of the present invention correspond to the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints provided in the embodiments of the present invention. The explanation, examples and beneficial effects of the relevant contents can be referred to the corresponding parts of the method, and will not be repeated here.
[0088] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0089] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints, characterized in that, include: Multi-wavelength Raman spectra of multiple detection areas of the oil painting were collected, and the multi-wavelength Raman spectra of each detection area were preprocessed to obtain the corresponding standardized Raman spectra. Encode the standardized Raman spectra of each spectrum to obtain the corresponding multi-wavelength low-dimensional features; Attention feature fusion is performed on each of the multi-wavelength low-dimensional features to obtain fused features; Based on the fusion features and combined with the label information of the colorant and the binding medium, a colorant classification model and a binding medium classification model are trained respectively under the constraint of reconstruction loss; wherein, the reconstruction loss is obtained by spectral reconstruction of each of the multi-wavelength low-dimensional features and calculation. Multi-wavelength Raman spectra of the oil painting area to be identified are collected, and after preprocessing, encoding and attention feature fusion, they are used as inputs to the colorant classification model and the binding medium classification model to obtain the oil painting component identification results.
2. The method for identifying oil painting components as described in claim 1, characterized in that, The preprocessing is one or any combination of the following operations: Baseline correction, smoothing and denoising, wavenumber axis alignment and normalization.
3. The method for identifying oil painting components as described in claim 1, characterized in that, The step of performing attention feature fusion on each of the multi-wavelength low-dimensional features to obtain fused features includes: The current multi-wavelength low-dimensional feature is mapped to a query vector, and other multi-wavelength low-dimensional features are mapped to key vectors and value vectors respectively. Based on the query vector and the key vector, attention weights are obtained through scaling and normalization calculations. The corresponding value vectors are weighted and summed using the attention weights, and then superimposed with the current multi-wavelength low-dimensional features to obtain the weighted fusion result of each of the multi-wavelength low-dimensional features; By concatenating all weighted fusion results, the fusion feature is obtained.
4. The method for identifying oil painting components as described in claim 1, characterized in that, The process of obtaining the reconstruction loss includes: A decoder is used to reconstruct the spectrum of each of the multi-wavelength low-dimensional features to obtain the corresponding reconstructed Raman spectrum. Based on the reconstructed Raman spectra and their corresponding normalized Raman spectra, the reconstruction error is calculated to construct the reconstruction loss.
5. The method for identifying oil painting components as described in claim 1, characterized in that, Based on the fusion features and combined with the label information of the colorant and binding medium, a colorant classification model and a binding medium classification model are trained respectively under the constraint of reconstruction loss, including: Using the fusion features as classification input, the label information of the colorant and the binding medium are matched respectively, and the colorant classification loss and the binding medium classification loss are constructed accordingly. The colorant classification loss and the reconstruction loss are weighted and fused together, and the binding medium classification loss and the reconstruction loss are weighted and fused together to construct the total colorant loss and the total binding medium loss, respectively. Based on iterative training using the total loss of the colorant and the total loss of the binding medium, the colorant classification model and the binding medium classification model are obtained.
6. The method for identifying oil painting components as described in claim 1, characterized in that, The multi-wavelength Raman spectrum includes Raman spectra acquired at two different excitation wavelengths: 532 nm and 785 nm.
7. A system for identifying oil painting components based on multi-wavelength Raman spectroscopy and reconstruction constraints, characterized in that, include: The data acquisition and preprocessing module is used to acquire multi-wavelength Raman spectra from multiple detection areas of the oil painting, and to preprocess each of the multi-wavelength Raman spectra in the same detection area to obtain the corresponding standardized Raman spectra. The spectral encoding module is used to encode each of the standardized Raman spectra and obtain the corresponding multi-wavelength low-dimensional features. The feature fusion module is used to perform attention feature fusion on each of the multi-wavelength low-dimensional features to obtain fused features; The model training module is used to train a colorant classification model and a binding medium classification model respectively based on the fusion features and combined with the label information of the colorant and binding medium, under the constraint of reconstruction loss; wherein, the reconstruction loss is obtained by spectral reconstruction of each of the multi-wavelength low-dimensional features and calculation. The component identification module is used to collect multi-wavelength Raman spectra of the oil painting area to be identified. After being preprocessed, encoded, and fused with attention features, the spectra are used as inputs to the colorant classification model and the binding medium classification model to obtain the oil painting component identification results.
8. A computer program product, characterized in that, The computer program product includes computer program code, which, when run on a computer, enables the computer to implement the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, It stores a computer program, wherein the computer program causes a computer to execute the oil painting composition identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints as described in any one of claims 1 to 6.
10. An electronic device, characterized in that, The electronic device includes: Processor and memory; The memory stores program instructions; The processor is configured to run the program instructions to execute the oil painting component identification method based on multi-wavelength Raman spectroscopy and reconstruction constraints as described in any one of claims 1 to 6.