Raman spectrum cross-instrument conversion method and system based on twin neural network

Through the Raman spectral cross-instrument conversion method based on twin neural networks, the problem of low spectral cosine similarity is solved, and efficient and accurate spectral conversion is achieved. It is suitable for portable instruments and improves the credibility of the detection results.

CN120259698AActive Publication Date: 2025-07-04BEIJING YIXINGYUAN PETROCHEMICAL TECHNOLOGY CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510734552.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-07-04
Estimated Expiration
2045-06-04

AI Technical Summary

Technical Problem

In the existing cross-instrument conversion methods, the spectral cosine similarity before and after the conversion is low, resulting in the accuracy of the detection results being unable to be guaranteed.

Method used

The Raman spectroscopy cross-instrument conversion method based on twin neural networks is adopted. By acquiring the original spectrum and target spectrum for preprocessing, the twin neural network is used for feature extraction and conversion, and spectral reconstruction and denoising are combined with the generation of adversarial networks, and the deep-separable convolutional network is used to improve computing efficiency.

Benefits of technology

The spectral cosine similarity is achieved with nearly 98%, the spectral characteristics are almost lossless, and the execution speed is fast. It is suitable for deployment in portable instruments, and can be converted within 0.05 seconds on the PC CPU and within 0.35 seconds on the development board CPU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259698A_ABST
    Figure CN120259698A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of Raman spectrum, and relates to a Raman spectrum cross-instrument conversion method and system based on a twin neural network. The method aims at solving the problem that in an existing cross-instrument conversion method, spectrum cosine similarity before and after conversion is low. The method comprises the following steps: acquiring at least one original spectrum and one target spectrum, and preprocessing the original spectrum and the target spectrum; respectively and correspondingly inputting each piece of original spectral information after preprocessing and each piece of target spectral information into a sub-network of a twin neural network; a feature extraction module performs feature extraction on the spectral information in each sub-network; the feature conversion module converts each piece of extracted original spectral information into target spectral information; and the generative adversarial network reconstructs a spectrum for the target spectrum information, and de-noising processing is carried out on the reconstructed spectrum. According to the invention, the cosine similarity of the converted spectrum exceeds 98%, the spectrum characteristics are almost lossless, the equipment execution speed is fast, and the device can be directly deployed in a portable instrument.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of Raman spectroscopy, and particularly relates to a Raman spectroscopy cross-instrument conversion method and system based on a Siamese neural network. Background Art

[0002] In the field of Raman spectroscopy for mixture detection, portable instruments are usually used to detect mixtures and output spectra, and then high-precision scientific Raman spectroscopy instruments are used for analysis. However, due to the large differences in hardware design, optical path structure, instrument parameters, etc. between portable Raman spectroscopy instruments and scientific Raman spectrometers, the output spectral data formats and characteristics are different, resulting in low credibility of the final detection results and reduced detection efficiency. To solve this problem, an algorithm for cross-instrument conversion is usually configured in the device to make the spectra measured by different instruments have the same characteristics, so as to improve the accuracy of substance analysis results.

[0003] The existing algorithms mainly use the Piecewise Direct Standardization (PDS) algorithm. By dividing the data into multiple different segments and performing direct standardization within each segment, a conversion coefficient is established between the source spectrum and the target spectrum through a sliding window, thereby realizing spectral instrument transfer. Although this algorithm can ensure the lowest transmission error between two instruments, and the robustness of the result is higher with the increase in the number of conversion samples, this method lacks sufficient similarity between the source spectrum and the target spectrum, and the accuracy of the final detection result cannot be guaranteed.

[0004] In view of this, the present invention is specifically proposed. Summary of the Invention

[0005] An object of the present invention is to solve the problem that the cosine similarity of the spectra before and after conversion is relatively low in the existing cross-instrument conversion method.

[0006] To achieve the above object, the present invention provides a Raman spectroscopy cross-instrument conversion method based on a Siamese neural network, including: Obtain at least one original spectrum and a target spectrum, and perform preprocessing on them; Input each item of the preprocessed original spectrum information and the target spectrum information into a sub-network of the Siamese neural network respectively; The feature extraction module extracts features from the spectral information in each sub-network; The feature conversion module converts each piece of the extracted original spectrum information into target spectrum information; The generative adversarial network reconstructs the spectrum for the target spectral information and denoises the reconstructed spectrum.

[0007] Further, the step of "obtaining at least one original spectrum and a target spectrum and performing preprocessing on them" includes: obtaining at least one original spectrum and a target spectrum; respectively performing characteristic peak intensity transformation on each of the original spectra and the target spectrum to limit the spectral characteristic peak intensity within the range of [0, 1].

[0008] Further, the step of "respectively performing characteristic peak intensity transformation on each of the original spectra and the target spectrum" includes: Input signal: , is set to the original spectrum or the target spectrum; obtaining the minimum value in the spectral information, i.e., ; subtracting the minimum value from the spectral information, i.e., ; obtaining the maximum value in the spectral information, i.e., ; performing normalization processing on the spectral information, and outputting the signal , i.e., .

[0009] Further, the step of "performing feature extraction on the spectral information in each of the sub-networks" includes: mapping the spectral information in each of the sub-networks to a low-dimensional feature space to obtain a plurality of feature vectors; calculating the distance between the feature vector corresponding to each original spectrum and the feature vector corresponding to the target spectrum; judging the similarity between the original spectrum and the target spectrum according to the distance; extracting the eigenvalue of the original spectrum and the target spectrum to obtain the feature matrix corresponding to each original spectrum and the feature matrix corresponding to the target spectrum.

[0010] Further, the step of "converting each of the extracted original spectral information into target spectral information" includes: converting each original spectral feature matrix into a target feature matrix.

[0011] Further, the generative adversarial network includes an encoder and a decoder. The step of "the generative adversarial network reconstructs the spectrum from the converted spectral information" includes: the encoder maps each converted target feature matrix to a higher-dimensional feature space to obtain the parameter Z of the latent variable, and expresses the latent variable z as a formula; ; where , is the mean of the output latent variable, is the standard deviation of the output latent variable, represents the normal distribution, is the identity matrix; the decoder reconstructs the data from the latent space, maps the latent variable z back to the target spectral data space, and reconstructs the spectrum.

[0012] Further, the step of denoising the reconstructed spectrum includes: sequentially performing multi-Bessey wavelet transform, Fourier transform, and Butterworth low-pass filter on the reconstructed spectrum to perform enhanced denoising processing on the spectral signal; and then removing the noise spikes in the spectral signal through value filtering.

[0013] Further, the siamese neural network is composed of two or more sub-networks with the same structure and weight sharing, and is trained using the cross-entropy loss function.

[0014] Further, the feature extraction module is configured as the siamese neural network composed of three one-dimensional convolutional layers with a convolution kernel size of 1*3 to extract features from the spectral information within all the sub-networks, so as to obtain the original spectral matrix corresponding to each of the original spectra and the target spectral matrix corresponding to the target spectrum; alternatively, the feature extraction module is configured as a depthwise separable convolutional network, and the depthwise separable convolutional network receives the spectral information in each sub-network through an acceptance layer and performs convolutional calculations on the spectral information in each channel respectively, so as to obtain the original spectral matrix corresponding to each of the original spectra and the target spectral matrix corresponding to the target spectrum.

[0015] Further, the feature transformation module is configured to be composed of one convolutional layer and two fully connected layers, and the MSE function is used as the loss function to train the feature transformation module.

[0016] Further, the network layer of the generative adversarial network is set as a fully connected layer, and the VAE loss function is used to train the generative adversarial network; and the input and output dimensions of the fully connected layers in the siamese neural network, the feature extraction module, the feature transformation module, and the generative adversarial network module are respectively configured to be 64*256, 256*512, and 512*1700.

[0017] In some other embodiments, a Raman spectrum cross-instrument conversion system is provided, and the Raman spectrum cross-instrument conversion method according to any one of the above can be applied to the Raman spectrum cross-instrument conversion system.

[0018] In still some other embodiments, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the Raman spectrum cross-instrument conversion method according to any one of the above is implemented and applied to the Raman spectrum cross-instrument conversion system described above.

[0019] In other embodiments, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program which, when executed by a processor, implements the Raman spectrum cross-instrument conversion method based on a twin neural network as described in any one of the above, and is applied to the Raman spectrum cross-instrument conversion system described above.

[0020] Based on the foregoing description, those skilled in the art can understand that by using a twin neural network to perform contrastive learning on the original spectrum and the target spectrum, and then automatically extracting features by a feature extraction network, a neural network is generated to convert the acquisition data of different instruments into the spectral space of the target instrument, realizing the standardized conversion of the spectral data collected by different instruments. By mapping the source domain data to the target domain spectral space, the influence of instrument hardware differences on the analysis accuracy is eliminated. The cosine similarity of the spectrum after conversion by the present invention exceeds 98%, the spectral features are almost lossless, and the execution speed is very fast, which can reach within 0.05 s on a PC CPU and 0.35 s on a development board CPU. Moreover, the method of the present invention has the characteristics of fast execution speed, less resource occupation, and accurate conversion accuracy, and can be directly deployed in portable instruments. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings, as a part of the present invention, are used to provide a further understanding of the present invention. The schematic embodiments and descriptions thereof of the present invention are used to explain the present invention, but do not constitute an improper limitation to the present invention. Obviously, the drawings in the following description are only some embodiments, and those of ordinary skill in the art can obtain other drawings according to these drawings without creative efforts. In the drawings: Figure 1 is a flowchart of the Raman spectrum cross-instrument conversion method based on a twin neural network in some embodiments of the present invention; Figure 2 is a comparison chart of cosine similarities after cross-instrument conversion by multiple algorithms; Figure 3 are different spectral diagrams of ethanol; Figure 4 are different spectral diagrams of n-propanol. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0022] 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 will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0023] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "upper", "lower", "front", "rear", "left", "right", "vertical", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to the present invention.

[0024] In the description of the present invention, it should be noted that unless otherwise clearly specified and defined, the terms "installed", "connected", "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0025] Those skilled in the art should understand that the embodiments described below are only some embodiments of the present invention, rather than all embodiments of the present invention. These embodiments are intended to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention. Based on the embodiments provided by the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts should still fall within the protection scope of the present invention.

[0026] Next, with reference to Figures 1 to 4 , a Raman spectroscopy cross-instrument conversion method based on a Siamese neural network in some embodiments of the present invention will be described in detail. Figure 1 is a flowchart of a Raman spectroscopy cross-instrument conversion method based on a Siamese neural network in some embodiments of the present invention; Figure 2 is a comparison chart of cosine similarities after cross-instrument conversion by multiple algorithms; Figure 3 is a different spectrogram of ethanol; Figure 4 is a different spectrogram of n-propanol.

[0027] As Figure 1 shown, in some embodiments of the present invention, a Raman spectroscopy cross-instrument conversion method based on a Siamese neural network is provided, including: Step S110, obtain at least one original spectrum and a target spectrum, and preprocess them. The original spectrum is the spectral information detected by the original instrument (the original instrument can be a portable instrument or a conventional Raman spectroscopy detection instrument), and the target spectrum is the spectral information detected by the target instrument.

[0028] Among them, the preprocessing process includes: denoising both the original spectrum and the target spectrum. Specifically, it includes: enhancing the characteristic peaks of the original spectrum so that the intensity of the characteristic peaks of the original spectral information is controlled within the range of [0, 1]. Specifically, step S110 includes: obtaining at least one original spectrum and one target spectrum; respectively performing characteristic peak intensity transformation on each of the original spectra and the target spectrum to limit the spectral characteristic peak intensity within the range of [0, 1].

[0029] Among them, the step of "respectively performing characteristic peak intensity transformation on each of the original spectra and the target spectrum" includes: Input signal: , Set as the original spectrum or the target spectrum; Obtain the minimum value in the spectral information, that is ; Subtract the minimum value from the spectral information, that is ; Obtain the maximum value in the spectral information, that is ; Perform normalization processing on the spectral information, and output the signal , that is .

[0030] Step S120, respectively input each item in the preprocessed original spectral information and the target spectral information into a sub-network of the siamese neural network one by one.

[0031] The siamese neural network (SNN, Siamese Neural Network) consists of two or more sub-networks with the same structure and shared weights, and is trained using the cross-entropy loss function.

[0032] Step S130, the feature extraction module extracts features from the spectral information in each sub-network.

[0033] In some other embodiments of the present invention, the feature extraction module is configured as a siamese neural network composed of three one-dimensional convolutional layers, the convolutional kernel size is 1*3, and the spectral information in all sub-networks is extracted to obtain the original spectral matrix corresponding to each original spectrum and the target spectral matrix corresponding to the target spectrum. The present invention uses multiple identical network branches to process two or more input samples, that is, each original spectrum and the target spectrum respectively. These multiple branch sub-neural networks share weights to ensure the same feature extraction operation for the two input samples. In the present invention, the siamese neural network is trained in an unsupervised manner without giving labels, and the cross-entropy loss function is used as the loss function. Finally, two feature matrices of the original spectral information detected by the original instrument and the target spectral information detected by the target instrument are obtained.

[0034] In some further embodiments of the present invention, the feature extraction module is configured as a depthwise separable convolutional network. The depthwise separable convolutional network receives the spectral information in each sub-network through an acceptance layer, and performs convolutional calculations on the spectral information within each channel respectively to obtain the original spectral matrix corresponding to each original spectrum and the target spectral matrix corresponding to the target spectrum. That is, the features in each original spectral information and the target spectrum are respectively extracted through multiple convolutional layers, and then the multiple convolutional layers are stacked together to achieve hierarchical learning.

[0035] Among them, step S130 includes: Mapping the spectral information in each sub-network to a low-dimensional feature space to obtain multiple feature vectors; Calculating the Euclidean distance between the feature vector corresponding to each original spectrum and the feature vector corresponding to the target spectrum; Judging the similarity between the original spectrum and the target spectrum according to the Euclidean distance.

[0036] Extracting the eigenvalue of the original spectrum and the target spectrum to obtain the feature matrix corresponding to each original spectrum and the feature matrix corresponding to the target spectrum. After the feature extraction module trains each sub-network in the siamese neural network through the above steps, the corresponding feature matrix is output.

[0037] In step S140, the feature conversion module converts each of the extracted original spectral information into target spectral information.

[0038] The feature conversion module consists of a convolutional layer and two fully connected layers. The convolutional layer further extracts features and reduces the dimension. The fully connected layer can gradually adjust the feature distribution and enhance the representation ability of the features. The mean squared error (MSE) function is used as the loss function to train it to convert the original spectral feature vector into the target spectral feature vector.

[0039] Specifically, step S140 includes converting each original feature matrix into a target feature matrix.

[0040] In step S150, the generative adversarial network reconstructs the spectrum for the target spectral information and denoises the reconstructed spectrum. Specifically, the encoder maps the input feature matrix, that is, the target feature matrix, to a higher-dimensional feature space to obtain the parameters (mean μ and variance σ) of the latent variable, that is, to obtain the mean μ and standard deviation σ of the latent variable, and the noise ε sampled from the standard normal distribution, ε~N(0, I), to obtain the following formula: .

[0041] The decoder reconstructs data from the latent space, maps the latent variable z back to the target spectral data space, and reconstructs the original input, that is, reconstructs the spectral signal.

[0042] The network layers of the generative adversarial network are set as fully connected layers.

[0043] Since the fully connected layer can simplify the training process, all the network layers adopted in the present invention are fully connected layers, and the input and output dimensions are 64*256, 256*512, 512*1700 respectively, that is, the fully connected layers in the siamese neural network, the feature extraction module, the feature transformation module and the generative adversarial network module are all configured with their input and output dimensions being 64*256, 256*512, 512*1700 respectively.

[0044] Through the structural setting of the network layer, the VAE loss function is used to learn the latent structure of the data distribution and reconstruct the target spectral information. And new samples similar to the original data are generated by decoding the points in the latent space. Then the original spectrum is converted into the spectrum of the target instrument. During the training process, the VAE loss function includes two parts: the root mean square reconstruction loss (MSEReconstruction Loss) and the KL divergence loss (KL Divergence Loss). These two parts of the loss are combined by weighting to form the total loss for updating the model parameters.

[0045] The present invention replaces the simple one-dimensional convolution with the depthwise separable convolution. Among them, the steps of constructing the depthwise separable convolution include: first, depthwise convolution (Depthwise Convolution, DW), which performs convolution independently on each input channel, and the convolution results of each input channel remain independent; then pointwise convolution (Pointwise Convolution, PW), which uses a 1×1 convolution kernel to perform a linear combination in the channel dimension, and the number of channels of the output feature map is determined by the number of output channels of the pointwise convolution kernel. This decomposition method is based on the following theorem: for a standard convolution with C input channels and M output channels, its computational complexity is O(C×M×K²), where K is the convolution kernel size. While the depthwise separable convolution reduces the computational complexity to O(C×K²+C×M), achieving effective dimensionality reduction for the depthwise separable convolution. The depthwise separable convolution greatly reduces the amount of computation through the decomposition operation, making the model run faster, and is especially suitable for resource-constrained environments, which makes the algorithm of the present invention very suitable for deployment on portable instruments.

[0046] Steps for denoising the reconstructed spectrum, including: sequentially performing multi-Daubechies wavelet transform, Fourier transform, and Butterworth low-pass filter on the reconstructed spectrum to enhance the denoising of the spectral signal; and then removing the noise spikes in the spectral signal through median filtering. First, perform multi-Daubechies wavelet transform on the reconstructed spectral signal, use db4 for the wavelet cap, calculate the wavelet decomposition coefficients of the signal, and then apply a threshold to eliminate the noise. After that, use the fast Fourier transform (FFT) to convert the time-domain signal into a frequency-domain signal for better analysis of the signal characteristics. Then, through the Butterworth low-pass filter, extract and suppress specific frequency components to smooth the reconstructed spectral signal. Finally, use median filtering to remove the noise spikes in the signal.

[0047] In other embodiments of the present invention, a Raman spectrum cross-instrument conversion system is provided, and the Raman spectrum cross-instrument conversion method based on the twin neural network described in any of the above can be applied to the Raman spectrum cross-instrument conversion system.

[0048] The Raman spectrum cross-instrument conversion system of the present invention includes a scientific Raman instrument and a portable Raman instrument. The original spectrum refers to the spectrum collected by the portable Raman instrument, and the target spectrum is the spectrum collected by the scientific Raman instrument. The portable Raman device mentioned in the present invention is the portable Raman spectrometer produced by Liqiong Optoelectronics Co., Ltd. Specifically, the portable Raman device is of the Blade 785B Pro model, providing a spectral range of 200 cm -1 to 3200 cm -1 , with a wavelength of 785 nm, a resolution between 6 cm -1 and 8 cm -1 , and a maximum power output of 500 mW. The scientific benchtop Raman instrument is the Horiba LabRAM HR Evolution Raman spectrometer, with a spectral range of 50 cm -1 to 4000 cm -1 , a resolution of 0.35 cm -1 , available excitation wavelengths including 325 nm, 532 nm, 633 nm, and 785 nm, and an output power of 500 mW.

[0049] In this embodiment, the operator compared a variety of methods, including the original spectrum, the convolutional neural network trained based on VAE that extracts features only using a one-dimensional convolutional neural network (1D Convolutional Neural Network, 1D-CNN), the convolutional neural network trained based on VAE that uses a siamese neural network combined with an ordinary 1D-CNN (SNN-VAE-CNN), the convolutional neural network trained based on VAE that uses a siamese neural network combined with a depthwise separable convolution (DSCNN) (SNN-VAE-DSCNN), and the generative adversarial network (Cycle-GAN).

[0050] As Figure 2 shown, since the cosine similarity between the original spectrum and the standard spectrum, i.e., the target spectrum, is very low, the effect of using the original data for instrument transfer is not good, and further feature extraction and processing are required. The VAE that extracts features using 1D-CNN (CNN-VAE) significantly improves the performance. Further, the VAE that uses a siamese neural network combined with 1D-CNN (SNN-VAE-CNN) performs better than CNN-VAE in most cases, especially for cyclohexane and n-propanol. Therefore, the present invention adopts a siamese network for feature extraction and fusion. At the same time, the generative adversarial network Cycle-GAN performs excellently in terms of generation quality, especially for n-propanol and tetraethyl orthosilicate, achieving the highest performance, but is slightly lower than SNN-VAE-CNN for ethanol and acetonitrile. The VAE that uses a siamese neural network combined with a depthwise separable convolution (DSCNN) (SNN-VAE-DSCNN) is comparable to SNN-VAE-CNN in performance, and performs slightly better than SNN-VAE-CNN in some cases (such as ethanol and acetonitrile), but is slightly inferior in other cases (such as n-propanol). Therefore, the present invention combines the siamese neural network and the VAE of depthwise separable convolution (SNN-VAE-DSCNN), making it perform excellently in the instrument transfer task, especially in terms of computational efficiency and feature extraction. The generative adversarial network Cycle-GAN performs best in some complex tasks, but its performance is slightly inferior to SNN-VAE-CNN and SNN-VAE-DSCNN in some cases because the network is more complex and training is more difficult. Therefore, the present invention selects different algorithms to comprehensively complete the conversion of Raman spectra across instruments.

[0051] As Figure 3 and Figure 4As shown, the differences between the spectra of ethanol and n-propanol obtained on different instruments, and the role of the instrument transfer algorithm in spectral conversion. Among them, the instrument transfer algorithm uses SNN-VAE-DSCNN. By horizontally comparing the two subgraphs in the figure, the differences between the spectra of the portable instrument and its converted spectra can be clearly observed. The spectra of ethanol and n-propanol obtained by the portable instrument show more background noise and random noise than the spectra of scientific instruments, with a poorer peak shape and a more serious peak deviation. In the subgraph at the bottom of the figure, most of the noise has been filtered out from the spectra converted by the instrument transfer algorithm, and the peak shape has been adjusted according to the standard spectra by the instrument transfer algorithm, thus significantly improving the quality and accuracy of the spectra. This shows that the instrument transfer algorithm plays an important role in the spectral conversion process, effectively enhancing the credibility of the detection results of the spectra of portable instruments.

[0052] In other embodiments of the present invention, a computer device is further provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it performs the relevant steps of the Raman spectrum cross-instrument conversion system. When the processor executes the computer program, it implements the Raman spectrum cross-instrument conversion method based on the twin neural network described above and applies it to the Raman spectrum cross-instrument conversion system described above.

[0053] The central processing unit (CPU) of the computer device used in the present invention is the 11th generation Intel Core i5-1155G7 @2.50GHz to verify the execution speed of training and testing each algorithm. Among them, both the training and testing are 50 rounds, and the learning rate is 0.01. At the same time, the algorithm is also deployed to the CPU of Atlas 200 DK, using a quad-core 1.0GHz Arm-A55 processor, and the system memory is 8GB. For Cycle-GAN, we use the pre-trained model on Github.

[0054] As shown in Table 1, it was found that although Cycle-GAN performed excellently in terms of generation quality, especially for n-propanol and tetraethyl orthosilicate, achieving the highest performance, in terms of execution speed, SNN-VAE-CNN and SNN-VAE-DSCNN showed significant advantages. Although in terms of cosine similarity, SNN-VAE-CNN was slightly lower than Cycle-GAN, this difference was extremely small and almost negligible. However, when we turned our perspective to the key indicator of execution speed, the advantage of SNN-VAE-DSCNN became obvious. In the PC CPU environment, the execution time of SNN-VAE-DSCNN was only 0.044 seconds. Compared with Cycle-GAN's 1.42 seconds, SNN-VAE-DSCNN had a greater advantage in execution speed and was twice as fast as SNN-VAE-CNN; on the development board CPU, this gap was even wider. SNN-VAE-DSCNN only needed 0.35 seconds, while Cycle-GAN needed 22.31 seconds. Further, portable devices are usually limited by computing resources and battery life. The SNN-VAE using depthwise separable convolution can not only process data quickly but also provide high-quality spectral conversion results while maintaining high efficiency. Its comprehensive ability is stronger than that of the SNN-VAE using only 1D-CNN and the classical 1D-CNN. Therefore, considering speed, efficiency, and applicability comprehensively, the SNN-VAE using depthwise separable convolution in the present invention can not only complete complex feature extraction and conversion tasks in a short time but also ensure that the generated spectral data meets the requirements of practical applications in terms of quality and accuracy, thus realizing efficient and reliable spectral instrument transfer on portable devices and providing strong technical support for on-site rapid detection and real-time data analysis.

[0055] Table 1 Execution Times of Transfer Algorithms between Different Instruments

[0056] In other embodiments of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. The computer program is executed by a processor to perform the Raman spectrum cross-instrument conversion method based on the Siamese neural network described above. When the computer program is executed by the processor, it implements the Raman spectrum cross-instrument conversion method based on the Siamese neural network described above and applies it to the Raman spectrum cross-instrument conversion system described above.

[0057] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, prediction model, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0058] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0059] Those skilled in the art can understand that the present invention performs contrastive learning on the original spectrum and the target spectrum by using a Siamese neural network, and then automatically extracts features through a feature extraction network. The generation neural network converts the acquisition data of different instruments into the spectral space of the target instrument, realizing the standardized conversion of the spectral data collected by different instruments. By mapping the source domain data to the target domain spectral space, the influence of instrument hardware differences on the analysis accuracy is eliminated. The cosine similarity of the spectrum after conversion by the present invention exceeds 98%, the spectral features are almost lossless, and the execution speed is very fast, which can reach within 0.05 s on a PC CPU and 0.35 s on a development board CPU. Moreover, the method of the present invention has the characteristics of fast execution speed, less resource occupation, and accurate conversion accuracy, and can be directly deployed in portable instruments.

[0060] The above are only the preferred embodiments of the present invention, and do not impose any form of limitation on the present invention. Although the present invention has been disclosed above with the preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art of the present invention can make some changes or modifications to equivalent embodiments by using the technical content prompted above within the scope of the technical solution of the present invention. The implementation schemes in the above embodiments can be further combined or replaced. However, as long as it does not depart from the content of the technical solution of the present invention, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention still fall within the scope of the present invention's solution.

Claims

1. A Raman spectroscopy cross-instrument conversion method based on a twin neural network, characterized in that, Including: Obtain at least one original spectrum and one target spectrum, and perform preprocessing on them; Input each of the preprocessed original spectrum information and each item in the target spectrum information into a sub-network of the Siamese neural network respectively; The feature extraction module extracts features from the spectrum information in each sub-network; The feature conversion module converts each of the extracted original spectrum information into target spectrum information; The generative adversarial network reconstructs the spectrum from the target spectrum information and performs denoising processing on the reconstructed spectrum.

2. The Raman spectrum cross-instrument conversion method based on the Siamese neural network according to claim 1, characterized in that The step of obtaining at least one original spectrum and one target spectrum and performing preprocessing on them includes: Obtain at least one original spectrum and one target spectrum; Perform characteristic peak intensity transformation on each of the original spectra and target spectra respectively to limit the spectral characteristic peak intensity within the range of [0, 1].

3. The Raman spectrum cross-instrument conversion method based on the Siamese neural network according to claim 2, characterized in that The step of performing characteristic peak intensity transformation on each of the original spectra and target spectra respectively includes: Input signal: , Set to the original spectrum or the target spectrum; Obtain the minimum value in the spectral information, that is ; Subtract the minimum value from the spectral information, i.e., ; Obtain the maximum value in the spectral information, i.e., ; Normalize the spectral information and output the signal , namely .

4. The Raman spectrum cross-instrument conversion method based on the Siamese neural network according to claim 1, characterized in that The step of extracting features from the spectrum information in each sub-network includes: Map the spectrum information in each sub-network to a low-dimensional feature space to obtain a plurality of feature vectors; Calculate the Euclidean distance between the feature vector corresponding to each original spectrum and the feature vector corresponding to the target spectrum; Judge the similarity between the original spectrum and the target spectrum according to the Euclidean distance; Extract the eigenvalues of the original spectrum and the target spectrum to obtain the feature matrix corresponding to each original spectrum and the feature matrix corresponding to the target spectrum.

5. The Raman spectrum cross-instrument conversion method based on the Siamese neural network according to claim 3, characterized in that The step of converting each of the extracted original spectrum information into target spectrum information includes: Convert each original spectrum feature matrix into a target feature matrix.

6. The Raman spectrum cross-instrument conversion method based on the Siamese neural network according to claim 4, characterized in that The generative adversarial network includes an encoder and a decoder. The step of the generative adversarial network reconstructing the spectrum from the converted spectrum information includes: The encoder maps each converted target feature matrix to a higher-dimensional feature space to obtain the parameter Z of the latent variable, and expresses the latent variable z as a formula; Among them, , is the mean of the output latent variable, is the standard deviation of the output latent variable, represents a normal distribution, is the identity matrix; The decoder reconstructs data from the latent space, maps the latent variable z back to the target spectrum data space, and reconstructs the spectrum.

7. The Raman spectrum cross-instrument conversion method based on the Siamese neural network according to claim 5, characterized in that The step of performing denoising processing on the reconstructed spectrum includes: Perform multi-Bessel wavelet transform, Fourier transform, and Butterworth low-pass filter on the reconstructed spectrum in sequence to perform enhanced denoising processing on the spectral signal; Then, value filtering is used to remove the noise spikes in the spectral signal.

8. The method for Raman spectral cross-instrument conversion based on a siamese neural network according to claim 3, wherein the siamese neural network is composed of two or more sub-networks with the same structure and shared weights, and is trained using a cross-entropy loss function.

9. The method for Raman spectral cross-instrument conversion based on a siamese neural network according to claim 7, wherein the feature extraction module is configured as the siamese neural network composed of three one-dimensional convolutional layers with a convolutional kernel size of 1*3, and performs feature extraction on the spectral information within all the sub-networks to obtain the original spectral matrix corresponding to each of the original spectra and the target spectral matrix corresponding to the target spectrum; or, the feature extraction module is configured as a depthwise separable convolutional network, and the depthwise separable convolutional network receives the spectral information in each sub-network through an acceptance layer and performs convolutional calculations on the spectral information within each channel respectively to obtain the original spectral matrix corresponding to each of the original spectra and the target spectral matrix corresponding to the target spectrum.

10. The method for Raman spectral cross-instrument conversion based on a siamese neural network according to claim 8, wherein the feature conversion module is configured to be composed of a convolutional layer and two fully connected layers, and the MSE function is used as the loss function to train the feature conversion module.

11. The method for Raman spectral cross-instrument conversion based on a siamese neural network according to claim 9, wherein the network layer of the generative adversarial network is set as a fully connected layer, and the VAE loss function is used to train the generative adversarial network; and the input and output dimensions of the fully connected layers in the siamese neural network, the feature extraction module, the feature conversion module, and the generative adversarial network module are respectively configured as 64*256, 256*512, and 512*1700.

12. A Raman spectroscopy cross-instrument conversion system, characterized in that, The method for Raman spectral cross-instrument conversion based on a siamese neural network according to any one of claims 1 to 10 can be applied to the Raman spectral cross-instrument conversion system.

13. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the method for Raman spectral cross-instrument conversion based on a siamese neural network according to any one of claims 1 to 10 and applies it to the Raman spectral cross-instrument conversion system described in claim 11.

14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for Raman spectral cross-instrument conversion based on a siamese neural network according to any one of claims 1 to 10 and applies it to the Raman spectral cross-instrument conversion system described in claim 11.

Citation Information

Patent Citations

  • Database-based Raman spectrum preprocessing method

    CN108169204A

  • Multi-scale twin hyperspectral target detection method and system

    CN119295937A

  • Deep substance Raman spectrum reconstruction method

    CN119574529A

  • Raman spectrum preprocessing model generation method and system, and terminal and storage medium

    WO2024078321A1