Raman Spectrum Self-Supervised Learning Method and System Based on Masked Autoencoder
The Raman spectrum self-supervised learning method using a masked autoencoder addresses the data scarcity issue by pre-training on untagged data and fine-tuning, enhancing classification accuracy and reducing computational costs.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- SHANGHAI MARITIME UNIVERSITY
- Filing Date
- 2025-09-29
- Publication Date
- 2026-07-08
AI Technical Summary
Existing Raman spectroscopy methods require large amounts of tagged data for training, which is difficult to obtain, especially in medical pathological analysis, and retraining is necessary when reference databases change, incurring additional computational costs.
A Raman spectrum self-supervised learning method using a masked autoencoder with spectral data augmentation and random masking, pre-training on untagged data, and fine-tuning with tagged data to optimize the model for classification.
Enables effective feature learning from untagged data, improving generalization performance and classification accuracy with limited tagged data, reducing computational costs and noise sensitivity.
Smart Images

Figure 0007886587000001_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of spectral analysis and spectral classification, and specifically relates to a Raman spectrum self-supervised learning method and system based on a masked autoencoder.
Background Art
[0002] Raman spectroscopy is a non-destructive chemical analysis technique that can deeply analyze the chemical composition and properties of a sample by utilizing the interaction between light and matter. Currently, Raman spectroscopy technology is widely applied in clinical research and pathological analysis, showing great application potential for rapid diagnosis without marking during surgery.
[0003] Many of the currently proposed Raman spectrum analysis methods are traditional supervised learning methods. The structure of the neural network is very complex, and the parameters usually reach more than one million. Therefore, the phenomenon of data hunger is likely to occur, and a large amount of tagged data is required to support training. [[ID=B]]
[0004] However, in medical pathological analysis, for example, in liver samples, it is very difficult to obtain a large number of spectral marks. Especially in some dynamic systems, it is necessary to obtain training data pairs in two or more consecutive experiments. In cancer disease analysis, only a few spectra can be used for each patient's tissue. Creating a large-scale, well-marked spectral dataset requires a great deal of time and effort from field experts.
[0005] In addition, when the reference database is changed, it is necessary to retrain the supervised learning network, adding additional computational cost. Therefore, how to learn important feature spaces in a large amount of untagged spectral data is a problem to be solved.
Summary of the Invention
Problems to be Solved by the Invention
[0006] The technical problem that this invention aims to solve is to provide a Raman spectral self-supervised learning method and system based on a masked autoencoder, thereby solving the problem in conventional techniques of how to learn important feature spaces in large amounts of untagged spectral data. [Means for solving the problem]
[0007] A Raman spectrum self-supervised learning method based on a masked autoencoder, A spectral data augmentation step that performs data augmentation on the original Raman spectra in pre-training and fine-tuning datasets, wherein the pre-training dataset consists of untagged Raman spectral data and the fine-tuning dataset consists of tagged Raman spectral data. The spectral random masking step involves dividing the pre-training dataset spectra after spectral data augmentation into spectral blocks of equal size, masking the spectral intensity of 50% of the spectral blocks randomly to zero, and obtaining a pre-training dataset with mask damage. The model pre-training step involves training a masked autoencoder on a pre-training dataset with mask corruption using a generative learning policy, optimizing the autoencoder using a mean squared error loss function, and obtaining a pre-trained masked autoencoder model. A pre-trained model evaluation step involves inputting an untagged spectrum into a pre-trained autoencoder model with a pre-trained mask and evaluating the model's denoising and clustering capabilities. The model fine-tuning step involves fine-tuning the encoders and increased classification layer weights obtained through pre-training using the augmented and fine-tuned dataset to obtain a good classification model. This includes a model fine-tuning evaluation step in which a test dataset is input into the fine-tuned classification model to obtain the final Raman spectral discriminant classification result.
[0008] In the aforementioned spectral data augmentation step, the feasibility of all policies is 50%, specifically, Step 1: Randomly add Gaussian noise with a mean of 0 and a variance of [0.01, 0.05], Step 2: Use a filter with a spectral filtering window size between [2,5] and randomly add mean blur. Step 3: Randomly set the intensity of each spectral point to zero with a 5% probability, Step 4: Randomly scale some of the spectral point intensities in each spectrum, setting the number of scaling factors between [0.9, 1.1], Step 5 involves adopting either Step 1 or Step 2's randomness, and combining this with Steps 3 and 4, which set the execution order randomly, to perform data augmentation. Step 6 involves performing normalization on the [0,1] interval for the Raman spectral data after data augmentation.
[0009] The spectral random masking step specifically involves: Step a: For each Raman spectral data X of the data augmentation, randomly select a filter with a filtering window size of L / 10, set the filtering step length to L / 10, and obtain 10 spectral blocks of equal size, where L represents the sequence length of the Raman spectrum, i.e., there are L Raman signals per Raman spectrum. Step b involves randomly masking the spectral intensity of 50% of the obtained 10 equally sized spectral blocks to zero, recording the positional order of the masked and unmasked spectral blocks, and constructing the masked spectral reconstruction as a pre-training agent task in self-supervised learning, with the masked and unmasked spectra as self-supervised pre-training data sample pairs.
[0010] The aforementioned model pre-training step is specifically as follows: The unmasked spectral blocks in each spectrum are input into a masked autoencoder for coding, a spectral feature vector is generated after coding, the masked spectral blocks and the obtained spectral feature vector are rejoined in the order of the recorded spectral blocks, and then input into a decoder to reconstruct a new spectral feature block. By introducing a mean squared error loss function (MSE) and calculating the mean squared errors between the original and reconstructed spectral blocks, the autoencoder model parameters are optimized by minimizing this loss function. The mean squared error loss function is shown below: JPEG0007886587000002.jpg36165
[0011] The aforementioned masked autoencoder consists of several multi-head self-attention mechanism modules, and adds position coding by linear mapping in the autoencoder, retains front-to-back position information of spectral blocks, and adds type tags.
[0012] The decoder is comprised of additional multi-head self-attention mechanism modules, and the number of multi-head self-attention mechanism modules is less than the number of multi-head self-attention mechanism modules in the autoencoder structure.
[0013] The aforementioned model fine-tuning step specifically involves, The process involves adding a single classification layer as the final layer of the classification model based on the masked autoencoder of the pre-trained model, then, in the model fine-tuning step, progressively decompressing the weights of each layer of the model, and fine-tuning the weights of the classification model with a small amount of tagged data to obtain the optimal classification model.
[0014] The aforementioned pre-training model evaluation step specifically involves, The process involves inputting untagged Raman spectral data into a pre-trained, masked autoencoder to obtain the denoised spectral signal-to-noise ratio and clustering accuracy.
[0015] A spectral data augmentation module that performs data augmentation on the original Raman spectra in the pre-training and fine-tuning datasets, A spectral random masking module processes the spectrum of a pre-training dataset after spectral data augmentation is complete, masks a random number of spectral intensities to zero, and obtains a pre-training dataset with mask damage. A model pre-training module that uses a pre-trained dataset with mask corruption to train and optimize a masked autoencoder and obtain a pre-trained masked autoencoder model, A pre-trained model evaluation module for evaluating the denoising and clustering capabilities of a model, A model fine-tuning module that fine-tunes the encoder and increased classification layer weights obtained by pre-training using a data-enhanced fine-tuning dataset to obtain a good classification model, It includes a fine-tuning model evaluation module that inputs a test dataset into the fine-tuning classification model and obtains the final Raman spectral discrimination classification result.
[0016] A computer-readable storage medium storing computer-readable instructions that, when executed by a processor, invoke all or some of the steps of the method.
[0017] The present invention adopts the following technical solutions to solve the above technical problems.
Advantages of the Invention
[0018] Compared with the prior art, the present invention has the following beneficial effects.
[0019] 1. The present invention proposes to apply generative self-supervised learning pre-training to Raman spectra. This method can handle the influence of noise and baseline shift without any spectral preprocessing process and can learn from different data sources. By fully utilizing tagless data and extracting the feature space of Raman spectra between different samples, the tag limitation in supervised learning can be broken through, and a more comprehensive feature representation can be obtained.
[0020] 2. By using the pre-training model, the present invention can be easily deployed to the set Raman spectrum classification task. Since the model contains a large amount of prior knowledge, only by fine-tuning the model weights with a small amount of tagged data, the generalization performance and classification performance of the model can be significantly improved.
[0021] 3. The learning policy of masked autoencoding proposed by the present invention does not require any high signal-to-noise ratio spectral training and can weaken the spectral noise to a certain extent.
Brief Description of the Drawings
[0022] [Figure 1] It is a flowchart of the implementation steps of an embodiment of the present invention. [Figure 2] It is a schematic diagram of the spectral data of two disclosed datasets of an embodiment of the present invention. [Figure 3] This is a network structure diagram of an embodiment of the present invention. [Figure 4] This figure shows the result of spectral reconstruction in an embodiment of the present invention. [Figure 5] This figure shows the classification confusion matrix of a pathogenic bacterial test set and the results of noise reduction of the breast cancer cell spectrum according to an embodiment of the present invention. [Modes for carrying out the invention]
[0023] The structure and operation process of the present invention will be further explained below, with reference to the attached drawings.
[0024] The objective of this invention is to solve problems in the background art and to fully utilize the value of untagged data and enhance the model's decision-making ability for diverse data in order to achieve better model generalization ability when dealing with Raman spectral data under different instrument sampling conditions or different detection tasks. This invention applies self-supervised learning to spectral classification tasks, explores novel methods for feature extraction in untagged spectral data, and improves generalization ability to the maximum extent by fine-tuning the model with a small amount of tagged spectral data, thereby better solving the problem of Raman spectral data classification.
[0025] Self-supervised learning is a subfield of unsupervised learning that effectively avoids the drawback of supervised learning, which requires a large amount of data tags, and has broad application potential in other fields such as images, videos, and audio. Self-supervised learning discovers internal relationships between data by setting up agent tasks and building simulated data tags. Therefore, self-supervised learning is a powerful tool in spectral analysis.
[0026] Based on the philosophy and methods of self-supervised learning, a generative Raman spectrum realization method is constructed. By randomly masking some spectral segment intensity values, the masked autoencoder completes the self-learning process as a self-supervised pre-agent task by reconstructing and recovering the original Raman spectral segment intensity as much as possible. Generative learning does not require arbitrary tag data and can be applied to large amounts of untagged spectral data, overcoming the limitations of feature learning with tagged data and enabling the learning of more subtle spectral features. At the same time, this method can be applied to specific spectral classification tasks. After generative learning is completed, the model gains a vast amount of prior knowledge, resulting in improved classification performance and better classification results even with limited tag data learning.
[0027] To further clarify the purpose and technical methods of the present invention, the present invention will be described below in conjunction with the accompanying drawings and cases. It should be understood that the cases described herein are for illustrative purposes only and are not intended to limit the present invention.
[0028] Specific examples are shown in Figures 1 to 5, In this example, the disclosed datasets used are the pathogenic bacteria dataset (Bacteria-ID) and the breast cancer cell dataset (MDA-MB-231). Bacteria-ID is used for self-supervised pre-training and fine-tuning validation of the network. This dataset contains spectral data for 30 types of pathogenic bacteria and is divided into three subsets: pre-training, fine-tuning, and test. Each type has 2000, 100, and 100 spectral data points, respectively. In the pre-training subset, an untagged situation is simulated, and only spectral data is supplied to the network. Spectral tags are discarded, and the feature space is obtained through training, allowing for the validation of the model's unsupervised clustering effect on spectra. The classification network is then fine-tuned and trained using the fine-tuning subset, and finally tested using the test subset to validate the network's self-supervised learning effect. MDA-MB-231 is a disclosed spectral denoising dataset used to verify the denoising effect of a masked autoencoder. This dataset consists of a vast number of low signal-to-noise ratio spectra and corresponding high signal-to-noise ratio spectra. The training set contains 159,618 spectral pairs, and the test set contains 12,694 spectral pairs, for a total of 172,312 spectral pairs. Spectral diagrams of the two disclosed datasets are shown in Figure 2, and the implementation steps of the method are shown in Figure 1, specifically, The spectral data augmentation step involves performing data augmentation on the original Raman spectra in the pre-training and fine-tuning datasets, where the pre-training dataset consists of untagged Raman spectral data and the fine-tuning dataset consists of tagged Raman spectral data. For the pre-training dataset spectra after spectral data augmentation is complete, a spectral random masking step is performed where each spectrum is divided into spectral blocks of equal size, and the spectral intensity of 50% of the spectral blocks is randomly masked to zero. The model pre-training step involves training a masked autoencoder on a pre-training dataset with mask corruption using a generative learning policy, optimizing the autoencoder using a mean squared error loss function, and obtaining a pre-trained masked autoencoder model. The masked autoencoder model obtained through pre-training already contains a vast amount of spectral prior knowledge. The pre-trained model evaluation step involves inputting untagged spectra into the pre-trained model and evaluating the model's denoising and clustering capabilities. The model fine-tuning step involves fine-tuning the masked autoencoder obtained through pre-training and the increased weights of the classification layer using the data-enhanced fine-tuning dataset to obtain a good classification model. The model fine-tuning evaluation step involves inputting the test dataset into the fine-tuned classification model and obtaining the final Raman spectral discrimination classification result.
[0029] Specifically, as shown in Figure 1, first, data augmentation is performed on the original spectrum by randomly adding Gaussian noise, blurring the mean, and scaling, increasing the amount of data pre-trained by the network. Then, each spectrum in the pre-training dataset is divided into several equally sized spectral blocks, and the spectral intensity of 50% of the random spectral blocks is masked to zero. The unmasked spectral blocks are input into a masked autoencoder, and the resulting spectral blocks are reconstructed with the original spectral blocks to calculate the mean squared error loss, and the network model is iteratively optimized. After the model is pre-trained, the reconstructed and recovered spectra have a certain spectral denoising performance, and one classification layer is added using the pre-trained encoder. The network weights are then fine-tuned and optimized on another small tagged dataset, and finally tested on a test dataset to obtain the final classification result.
[0030] As can be seen from the above, when processing the classification task, the present invention constructs three-stage datasets: a pre-training dataset, a fine-tuning dataset, and a test dataset. Here, (1) The pre-training dataset may include a large amount of untagged spectral data and may consist of spectral data from different instruments or different detection tasks. After pre-training is complete, the model has a large amount of prior knowledge of this dataset. (2) The fine-tuning dataset is used to retrain the model after pre-training, allowing for further fine-tuning and optimization of the model's weights, which enables the model to have better decision-making ability on specific classification tasks. This dataset requires spectral data with complete tag information. (3) The role of the test dataset is to evaluate the model's feature extraction ability and classification performance in specific classification tasks, and this dataset should correspond to the detection tasks of the fine-tuning dataset.
[0031] In processing the spectral denoising task, the present invention constructs two-stage datasets: a pre-training dataset and a test dataset. (1) The pre-training dataset includes all low signal-to-noise ratio spectra, and the model needs to extract useful spectral features from the noise if there are no high signal-to-noise ratio spectra. (2) The test dataset is input to a pre-trained model, and the model evaluates its denoising ability by reconstructing spectral data with a clearly improved signal-to-noise ratio.
[0032] In this embodiment, the spectral data augmentation step is specifically implemented as follows.
[0033] The spectral data augmentation step specifically includes the following steps: Step 1: Randomly generate Gaussian noise with a mean of 0 and distributed within the interval [0.01, 0.05], and add Gaussian noise processing to the original Raman spectrum. Step 2: Randomly add mean blur to the original Raman spectrum and use a filter with a spectral filtering window size between [2,5] to obtain the mean blur spectrum. Randomly run the extension policy in Steps 1 and 2. Step 3: Set the intensity of a random 5% of the segments in the Raman spectrum obtained by performing Step 1 or Step 2 to zero. Step 4: Randomly scale the spectral point intensities of the Raman spectrum obtained by performing Step 1 or Step 2, setting the number of scaling factors between [0.9, 1.1]. The feasibility of the data expansion policies in steps 1 through 4 above is 50%. Step 5, the execution order of the random settings in Steps 3 and 4, is combined with either Step 1 or Step 2. Step 6: The Raman spectrum from which data augmentation has been completed is subjected to normalization of the [0,1] interval.
[0034] In this embodiment, the spectral random mask processing step is specifically implemented as follows.
[0035] JPEG0007886587000003.jpg72170
[0036] After blocking all Raman spectra, each spectrum yields 10 equally sized spectral blocks. Randomly, 50% of the segment intensities of each spectral block are masked to zero, i.e., 5 spectral blocks are masked, and the positional order of the original masked and unmasked spectral blocks is recorded. The original spectrum, reconstructed using the masked spectrum, is used as a pre-training agent task in self-supervised learning. The masked spectrum and the original spectrum then construct self-supervised pre-training data sample pairs.
[0037] In this embodiment, the model pre-training step is specifically implemented as follows.
[0038] In the model pre-training step, a generative learning method is employed to construct a masked autoencoder, learn high-level feature representations in spectral data by restoring spectral reconstruction in case of mask corruption, and optimize the model using a mean squared error loss function. The masked autoencoder consists of a simple encoder-decoder structure, which includes several multi-head self-attention mechanism modules. These modules capture relevance information between feature peaks across the entire spectrum, facilitate information interaction and integration between different attention heads, and help extend the model's expressive and learning capabilities. The encoder adds position coding through linear mapping, preserving the front-to-back position information of spectral blocks, and adds type tags, which is advantageous for subsequent fine-tuning training of the classification model to obtain better classification results. The decoder consists of additional multi-head self-attention mechanism modules. Compared to the encoder structure, it uses fewer multi-head self-attention mechanism modules, and since the decoder only plays the role of spectral reconstruction, it thus helps extend the encoder's feature extraction capabilities.
[0039] After the construction of the masked autoencoder is complete, the unmasked spectral blocks in each spectrum are input to the encoder for coding. After generating the coding, a spectral feature vector is obtained. Then, the masked spectral blocks and the obtained spectral feature vector are rejoined in the order of the recorded spectral block positions and input to the decoder to reconstruct the new spectral feature block. A mean squared error loss function (MSE) is introduced during pre-training to calculate the mean squared error between the original spectral block and the reconstructed spectral block, and the autoencoder model parameters are optimized by minimizing this loss function. The mean squared error loss function is shown as follows: JPEG0007886587000004.jpg46170
[0040] In this embodiment, the pre-training model evaluation step is specifically implemented as follows.
[0041] Prior to model training, the model already possesses a large amount of prior spectral knowledge, and at this stage, it exhibits relatively strong spectral reconstruction, denoising, and clustering capabilities. The results of spectral reconstruction on the pathogenic bacterial dataset are shown in Figure 4. In testing the spectral denoising capability, the disclosed breast cancer cell dataset (MDA-MB-231) was used as a sample test dataset. Denoising did not require a model fine-tuning step; the denoised spectrum of the model reconstruction could be obtained by directly inputting the noisy spectral data into the pre-trained model. Denoising capability is measured using the spectral signal-to-noise ratio (SNR), which is generally the ratio of the required signal intensity to the background noise intensity. A higher SNR indicates higher spectral quality, and less noise results in a higher SNR. JPEG0007886587000005.jpg37169
[0042] The original spectral signal-to-noise ratio was 5.0883, but the reconstructed spectral signal-to-noise ratio could reach 10.4039, an improvement of more than 1x. The results of spectral noise reduction in this embodiment are shown in Figure 5. In the spectral clustering capability test, when the spectra of pathogenic bacteria in the pre-training data were input to a pre-trained masked autoencoder, and no tags were present, the clustering accuracy reached 80.56%, an improvement of more than 40% compared to the conventional K-means clustering method. This demonstrated that the pre-trained masked autoencoder has relatively good spectral understanding capabilities.
[0043] In this embodiment, the model fine-tuning step is specifically implemented as follows.
[0044] In the model fine-tuning step, a relatively small number of tagged Raman spectral fine-tuning datasets are used to retrain the encoder obtained in the model pre-training step on a specific classification task, thereby achieving greater classification performance improvements on limited tagged data. During fine-tuning, a single classification layer is added as the final layer of the model after the pre-trained model's encoder, and the encoder and classification layer are optimized by incrementally adjusting the weights for the specific classification task.
[0045] In this embodiment, the model fine-tuning evaluation step is specifically implemented as follows.
[0046] In the model fine-tuning evaluation step, the fine-tuned model is tested and evaluated using a test set to verify the model's feature extraction ability and performance. Specifically, in the classification task, the disclosed pathogenic bacteria dataset (Bacteria-ID) is used as a sample test dataset. This test set is input into the classification model obtained through fine-tuning, and the model determines whether each prediction matches a true tag, thereby evaluating the model's accuracy and reliability.
[0047] The following experiments will verify the classification method of this embodiment.
[0048] Table 1 shows an overview of the two disclosed datasets used in this embodiment. The high parameters for training the network model employed in this experiment are set as follows: In the pre-training stage, the number of training epochs is 500, the number of samples per iteration (BatchSize) is 64, the initial learning rate is 0.001, the weight decay is 0.00001, gradient descent is optimized using the AdamW optimization method, and the learning rate is adjusted using an exponential decline policy. In the fine-tuning stage, the number of training epochs is 100, the number of samples per iteration is 16, the initial learning rate is 0.0001, the weight decay is 0.00001, gradient descent is optimized using the AdamW optimization method, and the learning rate is adjusted using a policy based on a performance metric (ReduceLROnPlateau). The model is stopped training when the accuracy of the validation set no longer increases within 10 iterations.
[0049] The network structure used in this experiment is shown in Figure 3.
[0050] Table 1: Summary information of two disclosed datasets JPEG0007886587000006.jpg62169
[0051] In this experiment, classification accuracy (ACC) was used as a performance metric to evaluate the model in a classification task. Generally, the proportion of correctly classified samples to the total number of samples is shown to indicate that a higher ACC represents a better decision-making ability and stronger classification ability of the model. The formula for calculating the overall ACC is as follows: The image is JPEG0007886587000007.jpg19152. In a dataset of 30 pathogenic bacteria tests, the accuracy obtained from 3000 Raman spectra was 83.90%. This is significantly more competitive than the conventional supervised learning network ResNet (accuracy 83.40%), and the confusion matrix for pathogenic bacteria test set classification is shown in Figure 5.
[0052] From the above, the present invention demonstrates that it is possible to fully utilize untagged Raman spectral data, extract effective spectral peak features, improve spectral quality based on prior knowledge obtained through model pre-training, enhance substance identification accuracy, and stimulate the potential for intrinsic application value in self-supervised learning of Raman spectra.
[0053] Based on the above method, the present invention further provides a Raman spectrum self-supervising learning system based on a masked autoencoder, which Raman spectrum self-supervising learning system A spectral data augmentation module that performs data augmentation on the original Raman spectra in the pre-training and fine-tuning datasets, A spectral random masking module processes the spectrum of a pre-training dataset after spectral data augmentation is complete, masks a random number of spectral intensities to zero, and obtains a pre-training dataset with mask damage. A model pre-training module that uses a pre-trained dataset with mask corruption to train and optimize a masked autoencoder and obtain a pre-trained masked autoencoder model, A pre-trained model evaluation module for evaluating the denoising and clustering capabilities of a model, A model fine-tuning module that fine-tunes the encoder and increased classification layer weights obtained by pre-training using a data-enhanced fine-tuning dataset to obtain a good classification model, It includes a fine-tuning model evaluation module that inputs a test dataset into the fine-tuning classification model and obtains the final Raman spectral discrimination classification result.
[0054] A computer-readable storage medium, wherein computer-readable instructions are stored in the computer-readable storage medium, and all or some of the steps of the method are invoked when the computer-readable instructions are executed by a processor.
[0055] The above functions may be implemented in the form of a software function unit and, if sold or used as an independent product, may be stored on a single computer-readable storage medium. With this understanding, the proposed technical aspects of the present invention may be substantially or substantially contributed to the prior art, or parts of this proposed technical aspect may be expressed in the form of a software product. This computer software product is stored on a single storage medium and includes some instructions for causing a single computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. However, the storage medium may include various media capable of storing program code, such as U disks, removable hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0056] The above embodiments are illustrative of the principles and effects of the present invention and do not limit the present invention. Those skilled in the art can modify or change the above embodiments without contradicting the spirit and scope of the present invention. Therefore, any simple modifications, equivalent changes and alterations substantially made to the above embodiments based on the art of the present invention, without departing from the claims of the present invention, fall within the scope of the claims of the present invention.
Claims
1. A Raman spectrum self-supervised learning method based on a masked autoencoder, A spectral data augmentation step that performs data augmentation on the original Raman spectra in pre-training and fine-tuning datasets, wherein the pre-training dataset consists of untagged Raman spectral data and the fine-tuning dataset consists of tagged Raman spectral data. The spectral random masking step involves dividing the pre-training dataset spectra after spectral data augmentation into spectral blocks of equal size, masking the spectral intensity of 50% of the spectral blocks randomly to zero, and obtaining a pre-training dataset with mask damage. The model pre-training step involves training a masked autoencoder on a pre-training dataset with mask corruption using a generative learning policy, optimizing the autoencoder using a mean squared error loss function, and obtaining a pre-trained masked autoencoder model. A pre-trained model evaluation step involves inputting an untagged spectrum into a pre-trained autoencoder model with a pre-trained mask and evaluating the model's denoising and clustering capabilities. The model fine-tuning step involves fine-tuning the encoders and increased classification layer weights obtained through pre-training using the augmented and fine-tuned dataset to obtain a good classification model. A Raman spectral self-supervised learning method characterized by including a model fine-tuning evaluation step of inputting a test dataset into a fine-tuned classification model and obtaining the final Raman spectral discriminant classification result.
2. In the aforementioned spectral data augmentation step, the feasibility of all policies is 50%, specifically, Step 1: Randomly add Gaussian noise with a mean of 0 and a variance of [0.01, 0.05] within the interval, Step 2: Use a filter with a spectral filtering window size between [2, 5] and randomly add mean blurring. Step 3: Randomly set the intensity of each spectral point to zero with a 5% probability, Step 4: Randomly scale some of the spectral point intensities in each spectrum, setting the number of scaling factors between [0.9, 1.1], Step 5 involves adopting one of the random steps from Step 1 or Step 2, and combining this with Steps 3 and 4, which set the execution order randomly, to perform data augmentation. Step 6 is to perform a normalization process on the [0,1] interval of the Raman spectral data after data augmentation is complete, as described in claim 1, which is a Raman spectral self-supervised learning method based on a masked autoencoder.
3. The spectral random masking step specifically involves: Step a: For each Raman spectral data X of the data augmentation, randomly select a filter with a filtering window size of L / 10, set the filtering step length to L / 10, and obtain 10 spectral blocks of equal size, where L represents the sequence length of the Raman spectrum, i.e., there are L Raman signals per Raman spectrum. Step b: For the obtained 10 equally sized spectral blocks, randomly mask the spectral intensity of 50% of the spectral blocks to zero, record the positional order of the masked and unmasked spectral blocks, and construct the masked and unmasked spectra as self-supervised pre-training data sample pairs, with the masked spectral reconstruction being the preceding agent task in self-supervised learning. This is the Raman spectral self-supervised learning method based on a masked autoencoder according to claim 2.
4. The aforementioned model pre-training step is specifically as follows: The unmasked spectral blocks in each spectrum are input into a masked autoencoder for coding, a spectral feature vector is generated after coding, the masked spectral blocks and the obtained spectral feature vector are rejoined in the order of the recorded spectral blocks, and then input into a decoder to reconstruct a new spectral feature block. By introducing a mean squared error loss function (MSE), calculating the mean squared errors between the original and reconstructed spectral blocks, and minimizing this loss function, the autoencoder model parameters are optimized. The mean squared error loss function is shown below: A Raman spectrum self-supervised learning method based on a masked autoencoder as described in feature 3.
5. The masked autoencoder is composed of several multi-head self-attention mechanism modules, and the autoencoder adds position coding by linear mapping to retain front-to-back position information of spectral blocks, and also adds type tags, as described in claim 4, for a Raman spectrum self-supervised learning method based on a masked autoencoder.
6. The Raman spectral self-supervising learning method based on a masked autoencoder according to claim 5, characterized in that the decoder is composed of additional multi-head self-attention mechanism modules, and the number of multi-head self-attention mechanism modules is less than the number of multi-head self-attention mechanism modules in the autoencoder structure.
7. The aforementioned model fine-tuning step specifically involves, The Raman spectral self-supervised learning method based on a masked autoencoder according to claim 6, characterized in that a single classification layer is added as the last layer of the classification model based on a masked autoencoder of a pre-trained model, and in the model fine-tuning step, the weights of each layer of the model are progressively defrosted, and the weights of the classification model are fine-tuned with a small amount of tagged data to obtain an optimal classification model.
8. The aforementioned pre-training model evaluation step specifically involves, The Raman spectrum self-supervising learning method based on a masked autoencoder according to claim 4, characterized in that untagged Raman spectral data is input to a pre-trained masked autoencoder, and the spectral signal-to-noise ratio and clustering accuracy after denoising are obtained.
9. A spectral data augmentation module that performs data augmentation on the original Raman spectra in the pre-training and fine-tuning datasets, A spectral random masking module processes the spectrum of a pre-training dataset after spectral data augmentation is complete, masks a random number of spectral intensities to zero, and obtains a pre-training dataset with mask damage. A model pre-training module that uses a pre-trained dataset with mask corruption to train and optimize a masked autoencoder and obtain a pre-trained masked autoencoder model, A pre-trained model evaluation module for evaluating the denoising and clustering capabilities of a model, A model fine-tuning module that fine-tunes the encoder and increased classification layer weights obtained by pre-training using a data-enhanced fine-tuning dataset to obtain a good classification model, A Raman spectral self-supervised learning system based on a masked autoencoder, characterized by including a fine-tuning model evaluation module that inputs a test dataset into a fine-tuning classification model and obtains the final Raman spectral discrimination classification result.
10. A computer-readable storage medium, wherein computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, all or some steps of the method according to any one of claims 1 to 8 are invoked.