Diffusion model and auto-encoder steel mechanical property detection method
By combining a diffusion model with an autoencoder, the problem of insufficient detection accuracy in the mechanical property testing of steel was solved, achieving high-precision detection under small sample conditions and meeting the needs of online steel testing.
Patent Information
- Application Number
- CN202511282224.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-09
- Publication Date
- 2026-02-24
AI Technical Summary
Existing technologies for testing the mechanical properties of steel suffer from insufficient testing accuracy, complex operation, and difficulty in meeting online testing requirements, especially under small sample conditions where the testing accuracy is even more insufficient.
By combining a diffusion model with an autoencoder, a quantitative model of peak intensity and elemental content is constructed using a 3D UNet diffusion model to denoise spectral data and an attention autoencoder for feature dimensionality reduction, thereby improving detection accuracy.
It significantly improves detection accuracy, reduces mean square error and root mean square error, enhances the stability and reliability of detection results, and adapts to the detection needs under small sample conditions.
Smart Images

Figure CN121558719A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a diffusion model and an autoencoder for testing the mechanical properties of steel, belonging to the field of laser detection technology, and is applicable to multi-element synchronous quantitative analysis in steel smelting, manufacturing and quality control. Background Technology
[0002] Steel is a core material in industrial production, and its properties are closely related to the content of trace elements within it. Accurate detection of trace element content in steel is crucial for ensuring product quality and optimizing production processes. Traditional methods for steel composition detection mainly include chemical analysis and X-ray fluorescence spectrometry, but these methods suffer from problems such as complex sample pretreatment, long detection cycles, and high operating costs, making it difficult to meet the online detection needs of modern steel production.
[0003] Laser-induced breakdown spectroscopy (LIBS), as an elemental analysis technique, offers advantages such as no sample pretreatment required, high detection speed, and the ability to simultaneously analyze multiple elements. Its basic principle involves focusing a high-energy laser pulse onto the sample surface to generate plasma. Atoms or ions in the plasma emit characteristic spectra during transitions, and qualitative and quantitative elemental analysis is achieved by analyzing the wavelength and intensity of these characteristic spectra. However, in steel testing, due to complex matrix composition, severe spectral interference, and spectral signal fluctuations, the detection accuracy and stability of LIBS technology still need improvement.
[0004] Therefore, how to improve the detection accuracy of steel mechanical properties under small sample conditions has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of this invention is to address the technical problem of improving the detection accuracy of steel mechanical properties under small sample conditions by proposing a diffusion model and autoencoder-based method for steel mechanical property testing. This invention solves the problems of complex operation, poor timeliness, and insufficient accuracy of existing PCA-PLS testing methods. Through spectral data processing using a diffusion denoising model and an attention autoencoder, a quantitative model of peak intensity and elemental content is constructed to achieve steel mechanical property testing, thereby improving the detection accuracy of steel mechanical properties under small sample conditions.
[0006] The objective of this invention is achieved through the following technical solution:
[0007] This invention discloses a diffusion model and an autoencoder for testing the mechanical properties of steel, comprising the following steps:
[0008] Step 1: Laser-induced breakdown spectroscopy is used to acquire the spectra of the steel sample group to be tested. The three-dimensional spectral data of the steel sample group to be tested is obtained and then divided into blocks according to tensor dimension and spectral line direction to form preprocessed three-dimensional spectral data.
[0009] Step 1.1: Focus the pulsed laser onto the surface of the steel sample group to be tested to form plasma;
[0010] Step 1.2: Collect the plasma spectrum using a spectrometer;
[0011] Step 1.3: The collected spectral data are organized into three-dimensional spectral data according to the number of steel sample groups to be tested, spectral channels, and number of spectra. After being divided into blocks according to tensor dimension and spectral line direction, preprocessed three-dimensional spectral data is formed.
[0012] Step 1.3.1: Obtain the three-dimensional spectral data of the steel sample group to be tested as shown in formula (1);
[0013] (x,y,z)(1)
[0014] Where x is the number of steel sample groups to be tested; y is the number of spectral channels in each spectrum; and z is the number of spectra contained in the steel sample group to be tested.
[0015] Step 1.3.2: Divide the three-dimensional spectral data into blocks according to tensor dimension and spectral line direction to form preprocessed three-dimensional spectral data;
[0016] Step 2: Build and use the AdamW optimizer and loss function to optimize and train the 3DUNet diffusion model to obtain denoised spectral data;
[0017] Step 2.1: Construct a progressive stacking 3DUNet diffusion model for denoising spectral data;
[0018] Step 2.1.1: Map the time step parameters to a low-dimensional vector through a linear layer, and project the low-dimensional vector onto three encoders through non-linear activation to obtain low-dimensional features;
[0019] Step 2.1.2: Low-dimensional feature utilization involves three encoders extracting multi-scale features through convolution, normalization, and activation functions;
[0020] Step 2.1.3: Upsample the trilinear interpolation of the multi-scale features using three decoders to obtain the noise corresponding to the current time step;
[0021] Step 2.2: Optimize and train the 3DUNet diffusion model using the AdamW optimizer and denoising loss function based on the preprocessed 3D spectral data;
[0022] Step 2.2.1: Use the mean square error between the predicted noise and the actual noise as the denoising loss function;
[0023] Step 2.2.2: Optimize the training parameter weights of the 3DUNet diffusion model using the AdamW optimizer and the denoising loss function;
[0024] Step 2.3: Use the trained 3D UNet diffusion model to denoise the preprocessed three-dimensional spectral data by inversely solving Equation (2) to obtain denoised spectral data;
[0025]
[0026] Where, x t This represents the spectral data at time step; x0 represents the original noise-free spectral data; ∈ represents the noise term that follows a standard normal distribution; a t =1-β t , where β t For noise scheduling parameters; This represents the cumulative coefficient of noise attenuation.
[0027] Step 3: Construct and train the attention autoencoder module, and use the trained attention autoencoder module to reduce the dimensionality of the denoised spectral data;
[0028] Step 3.1: Construct and train the attention autoencoder module;
[0029] Step 3.1.1: Construct an attention autoencoder module consisting of an encoder and a decoder;
[0030] Step 3.1.2: Construct an attention module and adjust the feature dimensions of the encoder and decoder using the attention weights shown in Equation (3);
[0031] a=Softmax(W2tanh(W1h+b1)+b2 (3)
[0032] Where W1 and W2 are learnable weight matrices, b1 and b2 are bias terms; a represents the attention weights used to weight the input feature vector, and h represents the input feature vector;
[0033] Step 3.1.3: The encoder reduces the dimensionality of the denoised spectral data using a fully connected layer, a normalization layer, and the LeakyReLU activation function;
[0034] Step 3.1.4: The decoder restores the dimensions after reconstructing the features through a fully connected layer;
[0035] Step 3.1.5: Train the encoder and decoder with attention modules using the AdamW optimizer and dimensionality reduction loss function;
[0036] Step 3.1.5.1: Use the mean squared error between the original spectral data and the spectral data after dimensionality restoration by the decoder as the dimensionality reduction loss function;
[0037] Step 3.1.5.2: Train using the AdamW optimizer and dimensionality reduction loss function with an encoder and decoder that have attention modules;
[0038] Step 3.2: Use the trained attention autoencoder module to reduce the dimensionality of the denoised spectral data to form dimensionality-reduced spectral data;
[0039] Step 4: Concatenate the product of the number of dimensions and the amount of dimensionality-reduced spectral data, group the concatenated spectral data into equal groups, and adjust the order of the grouped dimensionality-reduced spectral data by keeping the data within each group unchanged and randomly perposing the data between groups.
[0040] Step 5: Use the least squares regression model to obtain the predicted mechanical property index of steel, and compare the difference between the predicted index and the actual index to obtain the detection accuracy of the mechanical property test of steel.
[0041] Compared with existing technologies, it has the following beneficial effects:
[0042] 1. Significantly Improved Detection Accuracy: This invention employs a diffusion denoising model based on 3D UNet, effectively removing spectral noise while preserving multidimensional spectral features. This solves the problem of insufficient accuracy of the traditional PCA-PLS method under noise interference, reducing the mean square error (MSE) from 954.95 to 297.51, the root mean square error (RMSE) from 30.90 to 17.25, and the coefficient of determination (R²) from [missing value]. 2 The accuracy of the mechanical property testing of steel was improved from 0.0926 to 0.7173.
[0043] 2. Enhanced Error Control Capability: This invention introduces an attention autoencoder for feature dimensionality reduction and key feature enhancement, solving the problem that traditional methods easily lose important information and lead to large prediction bias during multidimensional spectral feature processing. This reduces the mean relative absolute error (RMAE) from 0.0499 to 0.0231, the maximum absolute error (MaxAE) from 54.69 to 33.32, and the maximum relative error (MaxRE) from 0.1052 to 0.0660, thereby enhancing the stability and reliability of the detection results.
[0044] 3. Adaptability under small sample conditions: This invention expands the training set size through a feature group shuffling enhancement strategy, improving the model's generalization ability under small sample conditions and overcoming the shortcomings of traditional methods that rely on a large number of standard samples to achieve high accuracy. Even with only 21 sets of samples, 16 of which are used for training, it still achieves better prediction results than the PCA-PLS method, thus meeting the application requirements of steel inspection in small sample environments. Attached Figure Description
[0045] Figure 1 This is a flowchart illustrating the present invention;
[0046] Figure 2 This is a schematic diagram illustrating the results of analyzing the yield strength of steel samples using raw and corrected spectral data in an embodiment of the present invention. Detailed Implementation
[0047] To better illustrate the purpose and advantages of this invention, the invention will be further described below with reference to the accompanying drawings and examples. It should be noted that the implementation of this invention is not limited to the following embodiments, and any modifications or alterations made to this invention will fall within the scope of protection of this invention.
[0048] Example
[0049] like Figure 1 As shown in the figure, the specific implementation steps of the diffusion model and self-encoder method for detecting the mechanical properties of steel in this embodiment are as follows:
[0050] Step 1: Laser-induced breakdown spectroscopy is used to acquire the spectra of the steel sample group to be tested. The three-dimensional spectral data of the steel sample group to be tested is obtained and then divided into blocks according to tensor dimension and spectral line direction to form preprocessed three-dimensional spectral data.
[0051] Step 1.1: Focus the pulsed laser onto the surface of the steel sample group to be tested to form plasma;
[0052] Step 1.2: Collect the plasma spectrum using a spectrometer;
[0053] Step 1.3: The collected spectral data are organized into three-dimensional spectral data according to the number of steel sample groups to be tested, spectral channels, and number of spectra. After being divided into blocks according to tensor dimension and spectral line direction, preprocessed three-dimensional spectral data is formed.
[0054] Step 1.3.1: Obtain the three-dimensional spectral data of the steel sample group to be tested as shown in formula (1);
[0055] (x,y,z)(1)
[0056] Where x is the number of steel sample groups to be tested; y is the number of spectral channels in each spectrum; and z is the number of spectra contained in the steel sample group to be tested.
[0057] Step 1.3.2: Divide the three-dimensional spectral data into blocks according to tensor dimension and spectral line direction to form preprocessed three-dimensional spectral data;
[0058] In this embodiment, 21 sets of standard steel samples were selected. The steel samples to be tested were placed on a conveying device to ensure that the surface undulation difference of the samples was less than 1 cm during transportation, so as to reduce the interference of spectral acquisition fluctuations. The surface of the steel samples may be gray, some parts may be rusted, and the interior of the samples may be bright white. Whether or not to polish them can be selected according to the actual situation. Both polished and unpolished samples can be tested.
[0059] Laser-induced breakdown spectroscopy (LIBS) was used to analyze steel samples. To address the differences in surface conditions among the steel samples, pretreatment was performed to ensure consistent conditions across the detection area. A laser emits a beam that is focused onto the surface of the steel sample by an optical system, breaking down the material and generating plasma. Multiple pulses are used to penetrate different locations on the sample, and the spectral signals generated by these pulses are transmitted to a spectrometer to obtain spectral data.
[0060] The laser and spectrometer are activated, and a conveyor system propels the steel sample through the detection area at a constant speed. The laser emitted by the laser is focused onto the surface of the steel sample by an optical system, breaking down the material and generating plasma. Multiple spectra are collected for each sample, and 720 valid spectra are retained after quality screening. The input data is three-dimensional spectral data with a shape of (21, 28658, 720), representing 21 samples, each containing 720 spectra, and each spectrum containing 28658 spectral channels. The data is first standardized, and the mean and standard deviation are calculated before normalization to ensure that the distribution is suitable for neural network training. To avoid memory overflow, the data is further reshaped into a 5-dimensional tensor and divided into blocks according to the spectral line direction (D dimension), with 4096 rows processed each time.
[0061] Step 2: Build and use the AdamW optimizer and loss function to optimize and train the 3DUNet diffusion model to obtain denoised spectral data;
[0062] Step 2.1: Construct a progressive stacking 3DUNet diffusion model for denoising spectral data;
[0063] Step 2.1.1: Map the time step parameters to a low-dimensional vector through a linear layer, and project the low-dimensional vector onto three encoders through non-linear activation to obtain low-dimensional features;
[0064] Step 2.1.2: Low-dimensional feature utilization involves three encoders extracting multi-scale features through convolution, normalization, and activation functions;
[0065] Step 2.1.3: Upsample the trilinear interpolation of the multi-scale features using three decoders to obtain the noise corresponding to the current time step;
[0066] In this embodiment, 3D UNet is used as the noise predictor. The network consists of three parts: an encoder, a bottleneck layer, and a decoder, combined with a temporal embedding mechanism: Temporal embedding module: the time step is mapped to a low-dimensional vector (dimension 8) through a linear layer, and then projected onto different encoding layers after nonlinear activation to model the number of diffusion steps; Encoder and bottleneck layer: multi-scale features are extracted step by step through a combination of convolution, normalization, and activation functions; Decoder: trilinear interpolation upsampling is used, combined with skip connections to recover spectral details; Output layer: predicts the noise component corresponding to the current step.
[0067] Step 2.2: Optimize and train the 3DUNet diffusion model using the AdamW optimizer and denoising loss function based on the preprocessed 3D spectral data;
[0068] Step 2.2.1: Use the mean square error between the predicted noise and the actual noise as the denoising loss function;
[0069] Step 2.2.2: Optimize the training parameter weights of the 3DUNet diffusion model using the AdamW optimizer and the denoising loss function;
[0070] In this embodiment, the AdamW optimizer is used with a learning rate of 1×10⁻⁶. -4 The network parameters are iteratively optimized by using the mean squared error between the predicted noise and the actual noise as the loss function.
[0071] Step 2.3: Use the trained 3D UNet diffusion model to denoise the preprocessed three-dimensional spectral data by inversely solving Equation (2) to obtain denoised spectral data.
[0072]
[0073] Where, x t This represents the spectral data at time step; x0 represents the original noise-free spectral data; ∈ represents the noise term that follows a standard normal distribution; a t =1-β t , where β t For noise scheduling parameters; This represents the cumulative coefficient of noise attenuation.
[0074] In this embodiment, a 1000-step linear noise scheduling strategy is employed, with noise intensity β ranging from 1×10⁻⁶. -4The noise level is increased to 0.02. By gradually adding noise, the model can learn the restoration trajectory from high noise to low noise during training. In the forward diffusion process, during the training phase, the system gradually adds Gaussian noise to the clean spectrum at multiple time steps according to a preset noise scheduling strategy. In the reverse denoising process, by learning the above forward process, the model can progressively predict and remove the noise superimposed at each time step during inference.
[0075] Step 3: Construct and train the attention autoencoder module, and use the trained attention autoencoder module to reduce the dimensionality of the denoised spectral data;
[0076] Step 3.1: Construct and train the attention autoencoder module;
[0077] Step 3.1.1: Construct an attention autoencoder module consisting of an encoder and a decoder;
[0078] Step 3.1.2: Construct an attention module and adjust the feature dimensions of the encoder and decoder using the attention weights shown in Equation (3);
[0079] a=Softmax(W2tanh(W1h+b1)+b2 (3)
[0080] Where W1 and W2 are learnable weight matrices, b1 and b2 are bias terms; a represents the attention weights used to weight the input feature vector, and h represents the input feature vector;
[0081] Step 3.1.3: The encoder reduces the dimensionality of the denoised spectral data using a fully connected layer, a normalization layer, and the LeakyReLU activation function;
[0082] Step 3.1.4: The decoder restores the dimensions after reconstructing the features through a fully connected layer;
[0083] Step 3.1.5: Train the encoder and decoder with attention modules using the AdamW optimizer and dimensionality reduction loss function;
[0084] Step 3.1.5.1: Use the mean squared error between the original spectral data and the spectral data after dimensionality restoration by the decoder as the dimensionality reduction loss function;
[0085] Step 3.1.5.2: Train using the AdamW optimizer and dimensionality reduction loss function with an encoder and decoder that have attention modules;
[0086] Step 3.2: Use the trained attention autoencoder module to reduce the dimensionality of the denoised spectral data to form dimensionality-reduced spectral data;
[0087] In this embodiment, the denoised spectral data is compressed into high-dimensional features using an attention-enhanced autoencoder. Specifically, in the encoder structure, the encoder progressively compresses the input high-dimensional spectral data (28658 dimensions) into a lower-dimensional latent representation space (50 dimensions) through multiple fully connected layers. Each fully connected layer is followed by a batch normalization layer and a LeakyReLU activation function to stabilize the training process and enhance the model's non-linear expressive power. In the decoder reconstruction, the 50-dimensional latent features are reconstructed back to the original dimensions using a symmetric fully connected network to minimize reconstruction loss and ensure feature fidelity.
[0088] Step 4: Concatenate the product of the number of dimensions and the amount of dimensionality-reduced spectral data, group the concatenated spectral data into equal groups, and adjust the order of the grouped dimensionality-reduced spectral data by keeping the data within each group unchanged and randomly perposing the data between groups.
[0089] In the embodiments, such as Figure 2 As shown, the 21 samples were divided into 5 quantile intervals according to the target value, and the training and test sets were divided by stratified sampling at 80% / 20% (16 samples in the training set and 5 samples in the test set). The feature matrix and labels of the training set were taken, and the 36000-dimensional features of each sample (obtained from 720×50) were divided into K=180 groups of 200 dimensions each. New samples were generated by randomly permuting the group order, maintaining the feature structure within each group. This process was repeated N=4 times, expanding the sample size to N+1=5 times the original size. This resulted in an enhanced training set (80 samples), while the test set remained unenhanced.
[0090] Step 5: Use the least squares regression model to obtain the predicted mechanical property index of steel, and compare the difference between the predicted index and the actual index to obtain the detection accuracy of the mechanical property test of steel.
[0091] In this embodiment, intercept columns are added to the features of the training set (80 samples) after performing DA and the original test set (5 samples). Ordinary least squares regression (OLS) is used to estimate the parameters on the training data. Predicted values for the training set and test set are calculated separately. MSE, RMSE, and R are calculated. 2 Indicators such as RMAE, MaxAE, and MRE.
[0092] The results show that the detection accuracy of trace elements in steel under small sample conditions is significantly better than that of traditional methods, which can meet the needs of industrial online detection. Evaluation indicators include MSE, RMSE, and coefficient of determination R0. 2 Mean relative absolute error (RMAE), maximum relative error (MaxRE), and maximum absolute error (MaxAE).
[0093] The above detailed description further illustrates the purpose, technical solution, and beneficial effects of the invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting the mechanical properties of steel using a diffusion model and an autoencoder, characterized in that: Includes the following steps, Step 1: Laser-induced breakdown spectroscopy is used to acquire the spectra of the steel sample group to be tested. The three-dimensional spectral data of the steel sample group to be tested is obtained and then divided into blocks according to tensor dimension and spectral line direction to form preprocessed three-dimensional spectral data. Step 2: Build and use the AdamW optimizer and loss function to optimize and train the 3DUNet diffusion model to obtain denoised spectral data; Step 2.1: Construct a progressive stacking 3DUNet diffusion model for denoising spectral data; Step 2.2: Optimize and train the 3DUNet diffusion model using the AdamW optimizer and denoising loss function based on the preprocessed 3D spectral data; Step 2.3: Use the trained 3D UNet diffusion model to denoise the preprocessed three-dimensional spectral data by inversely solving Equation (2) to obtain denoised spectral data; Where, x t This represents the spectral data at time step; x0 represents the original noise-free spectral data; ∈ represents the noise term that follows a standard normal distribution; a t =1-β t , where β t For noise scheduling parameters; The cumulative coefficient representing noise attenuation; Step 3: Construct and train the attention autoencoder module, and use the trained attention autoencoder module to reduce the dimensionality of the denoised spectral data; Step 3.1: Construct and train the attention autoencoder module; Step 3.2: Use the trained attention autoencoder module to reduce the dimensionality of the denoised spectral data to form dimensionality-reduced spectral data; Step 4: Concatenate the product of the number of dimensions and the amount of dimensionality-reduced spectral data, group the concatenated spectral data into equal groups, and adjust the order of the grouped dimensionality-reduced spectral data by keeping the data within each group unchanged and randomly perposing the data between groups. Step 5: Use the least squares regression model to obtain the predicted mechanical property index of steel, and compare the difference between the predicted index and the actual index to obtain the detection accuracy of the mechanical property test of steel.
2. The method for detecting the mechanical properties of steel using a diffusion model and an autoencoder as described in claim 1, characterized in that: Step 1 is implemented as follows: Step 1.1: Focus the pulsed laser onto the surface of the steel sample group to be tested to form plasma; Step 1.2: Collect the plasma spectrum using a spectrometer; Step 1.3: The collected spectral data is organized into three-dimensional spectral data according to the number of steel sample groups to be tested, spectral channels, and number of spectra. After being divided into blocks according to tensor dimension and spectral line direction, preprocessed three-dimensional spectral data is formed.
3. The method for detecting the mechanical properties of steel using a diffusion model and an autoencoder as described in claim 1, characterized in that: Step 1.3 is implemented as follows: Step 1.3.1: Obtain the three-dimensional spectral data of the steel sample group to be tested as shown in formula (1); (x,y,z)(1) Where x is the number of steel sample groups to be tested; y is the number of spectral channels in each spectrum; and z is the number of spectra contained in the steel sample group to be tested. Step 1.3.2: Divide the three-dimensional spectral data into blocks according to tensor dimension and spectral line direction to form preprocessed three-dimensional spectral data.
4. The method for detecting the mechanical properties of steel using a diffusion model and an autoencoder as described in claim 1, characterized in that: Step 2.1 is implemented as follows: Step 2.1.1: Map the time step parameters to a low-dimensional vector through a linear layer, and project the low-dimensional vector onto three encoders through non-linear activation to obtain low-dimensional features; Step 2.1.2: Low-dimensional feature utilization involves three encoders extracting multi-scale features through convolution, normalization, and activation functions; Step 2.1.3: Upsample the multi-scale features using three decoders to perform trilinear interpolation to obtain the noise corresponding to the current time step.
5. The method for detecting the mechanical properties of steel using a diffusion model and an autoencoder as described in claim 1, characterized in that: Step 2.2 is implemented as follows: Step 2.2.1: Use the mean square error between the predicted noise and the actual noise as the denoising loss function; Step 2.2.2: Optimize the training parameter weights of the 3DUNet diffusion model using the AdamW optimizer and the denoising loss function.
6. The method for detecting the mechanical properties of steel using a diffusion model and an autoencoder as described in claim 1, characterized in that: Step 3.1 is implemented as follows: Step 3.1.1: Construct an attention autoencoder module consisting of an encoder and a decoder; Step 3.1.2: Construct an attention module and adjust the feature dimensions of the encoder and decoder using the attention weights shown in Equation (3); a=Softmax(W2tanh(W1h+b1)+b2 (3) Where W1 and W2 are learnable weight matrices, b1 and b2 are bias terms; a represents the attention weights used to weight the input feature vector, and h represents the input feature vector; Step 3.1.3: The encoder reduces the dimensionality of the denoised spectral data using a fully connected layer, a normalization layer, and the LeakyReLU activation function; Step 3.1.4: The decoder restores the dimensions after reconstructing the features through a fully connected layer; Step 3.1.5: Train using the AdamW optimizer and dimensionality reduction loss function with an encoder and decoder that have attention modules.
7. The method for detecting the mechanical properties of steel using a diffusion model and an autoencoder as described in claim 1, characterized in that: The implementation method for step 3.1.5 is as follows: Step 3.1.5.1: Use the mean squared error between the original spectral data and the spectral data after dimensionality restoration by the decoder as the dimensionality reduction loss function; Step 3.1.5.2: Train using the AdamW optimizer and dimensionality reduction loss function with an encoder and decoder that have attention modules.