Intelligent compound identification method and system based on nuclear magnetic resonance hydrogen spectrum
By constructing a simulated proton spectrum dataset and a deep learning architecture that encodes and decodes attention mechanisms, the problem of automated identification of complex molecular mixtures is solved, achieving high-precision, low-threshold compound identification, which is suitable for high-throughput chemical analysis and drug screening.
Patent Information
- Application Number
- CN202511447005.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-01-09
AI Technical Summary
Existing technologies face challenges in analyzing complex molecular mixtures due to issues such as overlapping spectral peaks, fluctuating chemical shifts, and unstable signal intensity. These challenges require time-consuming and specialized experimental procedures and computational tools, and lack efficient and automated multidimensional analysis methods.
We construct a simulated proton spectrum dataset that integrates physical realism with an end-to-end deep learning architecture based on an encoding and decoding attention mechanism. By generating training and test sets, and designing loss functions and optimizers, we achieve high-precision automated identification of compounds. We also utilize position encoding and multi-head self-attention mechanisms to capture semantic correlations between spectral peaks.
Without the need for manual labeling and preset peak positions, it significantly improves the accuracy and generalization performance of compound identification, lowers the barrier to entry, and is suitable for high-throughput automated chemical analysis and drug screening.
Smart Images

Figure CN121306309A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nuclear magnetic resonance technology, specifically to a method and system for intelligent identification of compounds using proton nuclear magnetic resonance (NMR) spectra. Background Technology
[0002] Nuclear magnetic resonance spectroscopy (NMR) is a powerful tool for analyzing complex molecular mixtures, offering advantages such as non-destructive sampling and atomic-level resolution. One-dimensional proton NMR spectroscopy, due to its fast data acquisition speed and ease of operation, has become a core technology for high-throughput analysis of small molecules. However, challenges such as peak overlap, chemical shift fluctuations, and signal intensity instability often require a strong theoretical foundation, specialized experimental procedures, and advanced computational tools to resolve complex mixtures. Analysis of multi-component systems typically takes several hours, highlighting the urgent need for integrated, multi-dimensional analytical methods.
[0003] To more accurately analyze complex molecular mixtures, traditional methods primarily enhance molecular structure resolution by introducing additional spectral dimensions, providing higher resolution and revealing complex interatomic relationships. However, this enhancement comes at the cost of significantly longer acquisition times. Summary of the Invention
[0004] To address the aforementioned issues, this invention proposes a method and system for intelligent compound identification using nuclear magnetic resonance hydrogen spectroscopy. By constructing a simulated hydrogen spectrum dataset that integrates physical realism and designing an end-to-end deep learning architecture based on an encoding / decoding attention mechanism, it achieves high-precision automated intelligent identification of compounds with highly similar structures in complex mixtures without the need for manual annotation or preset peak positions.
[0005] On the one hand, intelligent compound identification methods using proton nuclear magnetic resonance spectroscopy include:
[0006] S1, generating the training and test sets required for the deep learning model; the training and test sets include one-dimensional nuclear magnetic resonance hydrogen spectrum data;
[0007] S2, based on the training set and test set, constructs a deep learning model architecture;
[0008] The deep learning model architecture includes an input feature downsampling module, a position encoding module, an encoder module, a decoder module, and an output module;
[0009] The input feature downsampling module extracts local peak features from the one-dimensional NMR 1H spectrum and compresses the feature sequence length to obtain a compact feature sequence after dimensionality reduction. Position coding is added to the compact feature sequence to introduce chemical shift position information, thereby obtaining a one-dimensional NMR 1H spectrum of a mixture and a one-dimensional NMR 1H spectrum of a pure substance with position coding. The one-dimensional NMR 1H spectrum of the mixture with position coding is input to the encoder module to obtain the mixture spectrum, and the one-dimensional NMR 1H spectrum of the pure substance with position coding is input to the decoder module to obtain the pure spectrum. The output module calculates the matching relationship between the pure spectrum and the mixture spectrum to achieve feature alignment across spectra, obtains the aligned features, and performs recognition.
[0010] S3: Train the deep learning model using the training set and verify the model performance using the test set until the model converges, thus obtaining the trained deep learning model.
[0011] S4 inputs the one-dimensional proton NMR spectrum of the test set sample or experimentally collected data into the trained deep learning model, outputs the probability of the presence of the compound to be identified in the mixture, and completes the compound identification.
[0012] S1 specifically includes:
[0013] S11, based on the linear relationship between NMR signal intensity and component concentration, and considering the actual situation that chemical shifts may shift overall due to environmental influences, pre-acquired pure compound proton spectra are shifted overall and then linearly superimposed to generate a one-dimensional NMR mixture proton spectrum as one source of the dataset; on the other hand, the spectral peak characteristics of each pure component are measured, including chemical shift, intensity, and spectral width, and Voigt line shapes are constructed to characterize the spectrum of each component. During the simulation, reasonable changes in intensity, chemical shift, spectral width, and line shape of each component are allowed, while small relative shifts between different spectral peaks of the same component are introduced, and random noise is superimposed. Finally, a simulated mixture proton spectrum that closely resembles the actual experimental conditions is generated by the linear superposition of multi-component spectra as another source of the dataset;
[0014] S12, randomly select a pure compound spectrum from the simulated one-dimensional NMR mixture proton spectrum as the identification target;
[0015] S13, construct hydrogen spectrum pair data based on one-dimensional nuclear magnetic resonance mixture hydrogen spectrum and pure compound spectrum. If the target compound is a component of the mixture, it is marked as a positive sample; otherwise, it is marked as a negative sample.
[0016] S14 iterates through S11–S13 to generate a predetermined number of training and test sets based on positive and negative samples.
[0017] Furthermore, the generation method of one-dimensional NMR mixture proton spectrum also includes: based on the one-dimensional proton spectrum peak feature library of the compound, the final one-dimensional NMR mixture proton spectrum is generated by mathematical model simulation. This spectrum includes Voigt peak shape, background noise, natural compound abundance differences and spectrum distortion effects.
[0018] Furthermore, the deep learning model is trained using the training set, specifically including:
[0019] First, a binary cross-entropy loss function is designed to measure the difference between the model's predicted output and the true label. Then, a single training process is initiated, where one-dimensional NMR spectral data pairs from the training set are input into the model batch by batch. After forward propagation to obtain the prediction results, the loss value between the predicted output and the corresponding label is calculated, and the Adam optimizer is used to backpropagate the gradient to update the model parameters. The above training process is repeated iteratively until the maximum number of training rounds is reached or the loss function converges to a stable state. At this point, the optimal model parameters are saved, completing the entire training process.
[0020] Furthermore, the testing and evaluation of deep learning models specifically include:
[0021] The test set is input into the model to obtain the predicted probability of the target compound in each mixture sample. Based on the predicted value and the true label, the confusion matrix is calculated to count the number of correctly and incorrectly classified samples. The ROC curve is plotted and its area under the curve is calculated to evaluate the overall discrimination ability of the model. At the same time, the PR curve and its area under the curve are generated to measure the recognition performance of the model in the scenario of sparse positive samples or imbalance. Thus, the accuracy, generalization and robustness of the model are analyzed, and the end-to-end recognition performance is verified.
[0022] On the other hand, a one-dimensional nuclear magnetic resonance hydrogen spectrum-based intelligent compound identification method system includes:
[0023] A dataset generation module is used to generate the training and test sets required for the deep learning model; the training and test sets include one-dimensional nuclear magnetic resonance hydrogen spectrum data.
[0024] The deep learning model building module is used to build deep learning model architectures based on training and test sets.
[0025] The deep learning model architecture includes an input feature downsampling module, a position encoding module, an encoder module, a decoder module, and an output module;
[0026] The input feature downsampling module extracts local peak features from the one-dimensional NMR 1H spectrum and compresses the feature sequence length to obtain a compact feature sequence after dimensionality reduction. Position coding is added to the compact feature sequence to introduce chemical shift position information, thereby obtaining a one-dimensional NMR 1H spectrum of a mixture and a one-dimensional NMR 1H spectrum of a pure substance with position coding. The one-dimensional NMR 1H spectrum of the mixture with position coding is input to the encoder module to obtain the mixture spectrum, and the one-dimensional NMR 1H spectrum of the pure substance with position coding is input to the decoder module to obtain the pure spectrum. The output module calculates the matching relationship between the pure spectrum and the mixture spectrum to achieve feature alignment across spectra, obtains the aligned features, and performs recognition.
[0027] The training module is used to train the deep learning model using the training set and to verify the model performance using the test set until the model converges and the trained deep learning model is obtained.
[0028] The identification module is used to input the one-dimensional nuclear magnetic resonance hydrogen spectrum of the test set sample or experimentally collected data into the trained deep learning model, and output the probability of the presence of the compound to be identified in the mixture, thus completing the compound identification.
[0029] The present invention adopts the above technical solution and has the following beneficial effects:
[0030] (1) This invention constructs a high-fidelity simulated mixed hydrogen spectrum dataset that includes Voigt peak shape, noise, compound abundance differences and spectral distortion effects, and combines multi-head self-attention and cross-spectral feature alignment mechanism in deep learning models, so that the model can effectively capture the semantic association and spatial distribution features between complex spectral peaks, thereby maintaining high recognition accuracy in real experimental spectra or noise interference environments, and significantly improving the generalization performance of the model in unknown mixture scenarios.
[0031] (2) This invention designs a complete closed-loop process of “data generation - model architecture - training optimization - probability output”, which eliminates the need for manual preset of peak positions, integration regions or reliance on expert experience. Only the original one-dimensional 1H NMR spectrum needs to be input to automatically output the probability of compound presence, which greatly reduces the threshold for use and improves the efficiency of analysis. It is suitable for industrial application scenarios such as high-throughput, automated chemical analysis and drug screening.
[0032] (3) This invention introduces position encoding and attention visualization mechanisms into the model architecture, which makes the peak matching process interpretable to a certain extent; at the same time, it is equipped with a complete performance evaluation system (confusion matrix, ROC curve, PR curve), which can quantify the performance of the model under different signal-to-noise ratios and different data distributions, demonstrating the reliability and practicality of the recognition results. Attached Figure Description
[0033] Figure 1This is a flowchart of the intelligent compound identification method based on proton nuclear magnetic resonance spectroscopy according to an embodiment of the present invention;
[0034] Figure 2 This is a schematic diagram of the deep learning model structure according to an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram illustrating the performance of this invention in identifying multiple amino acid components in complex mixtures according to an embodiment of the invention;
[0036] Figure 4 This is a graph showing the performance comparison and error analysis of the models in the embodiments of the present invention;
[0037] Figure 5 This is a diagram of a compound intelligent identification system based on hydrogen nuclear magnetic resonance spectroscopy, according to an embodiment of the present invention. Detailed Implementation
[0038] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0039] like Figure 1 As shown, the intelligent compound identification method based on proton nuclear magnetic resonance spectroscopy of the present invention includes:
[0040] S1 represents the training and test sets required to generate a deep learning model.
[0041] Specifically, S1 includes:
[0042] S11, based on the linear relationship between NMR signal intensity and component concentration, and considering the actual situation that chemical shifts may shift overall due to environmental influences, pre-acquired pure compound proton spectra are shifted overall and then linearly superimposed to generate a one-dimensional NMR mixture proton spectrum as one source of the dataset; on the other hand, the spectral peak characteristics of each pure component are measured, including chemical shift, intensity, and spectral width, and Voigt line shapes are constructed to characterize the spectrum of each component. During the simulation, reasonable changes in intensity, chemical shift, spectral width, and line shape of each component are allowed, while small relative shifts between different spectral peaks of the same component are introduced, and random noise is superimposed. Finally, a simulated mixture proton spectrum that closely resembles the actual experimental conditions is generated by the linear superposition of multi-component spectra as another source of the dataset;
[0043] S12, randomly select a pure compound spectrum from the simulated one-dimensional NMR mixture proton spectrum as the identification target;
[0044] S13, construct hydrogen spectrum pair data based on one-dimensional nuclear magnetic resonance mixture hydrogen spectrum and pure compound spectrum. If the target compound is a component of the mixture, it is marked as a positive sample; otherwise, it is marked as a negative sample.
[0045] S14 iterates through S11–S13 to generate a predetermined number of training and test sets based on positive and negative samples.
[0046] Specifically, the generation of one-dimensional NMR mixture proton spectra also includes: based on a one-dimensional proton spectrum feature library of compounds, the final one-dimensional NMR mixture proton spectrum is generated by mathematical model simulation. This spectrum includes Voigt peak shape, background noise, natural compound abundance differences, and spectrum distortion effects.
[0047] Specifically, the parameters of the simulated one-dimensional proton NMR spectrum in this embodiment include: the number of compounds, the compound concentration scaling factor, the peak position, and the noise intensity; and the generated magnetic resonance spectral pairs are of two different types: positive spectral pairs and negative spectral pairs. For positive spectral pairs, one of the compounds is a component of the mixture, and the label of the spectral pair is 1; for negative spectral pairs, one of the compounds is not a component of the mixture, and the label of the spectral pair is 0.
[0048] S2, based on the training set and test set, constructs a deep learning model architecture;
[0049] The deep learning model architecture includes an input feature downsampling module, a position encoding module, an encoder module, a decoder module, and an output module;
[0050] The input feature downsampling module extracts local peak features from the one-dimensional NMR 1H spectrum and compresses the feature sequence length to obtain a compact feature sequence after dimensionality reduction. Position coding is added to the compact feature sequence to introduce chemical shift position information, resulting in a one-dimensional NMR 1H spectrum of the mixture and a one-dimensional NMR 1H spectrum of the pure substance with position coding. The one-dimensional NMR 1H spectrum of the mixture with position coding is input to the encoder module to obtain the mixture spectrum, and the one-dimensional NMR 1H spectrum of the pure substance with position coding is input to the decoder module to obtain the pure spectrum. The output module calculates the matching relationship between the pure spectrum and the mixture spectrum to achieve feature alignment across spectra, obtains the aligned features, and performs recognition.
[0051] Specifically, in this embodiment, an input feature downsampling module is first constructed (the input feature downsampling module consists of two levels of one-dimensional convolutional layers combined with a max-pooling layer with a stride of 2). A two-level one-dimensional convolutional structure (1D-CMD module) is adopted, configured with 32 and 64 filters respectively. Each level is followed by a max-pooling layer with a stride of 2, realizing local feature extraction and sequence length compression of the original one-dimensional NMR 1H NMR spectral data. Through this module, the sequence length of the input spectrum is halved step by step, significantly reducing the computational complexity of subsequent operations while preserving key spectral peak features, laying the foundation for the model to efficiently process long sequence spectral data. A position encoding module is introduced, superimposing sine-cosine position encoding onto the feature sequence after convolutional downsampling, explicitly injecting the spatial position information corresponding to the chemical shift. This design enables the model to perceive the relative distribution relationship of spectral peaks on the chemical shift axis, compensating for the weak perception of position information by convolutional operations, thereby improving the model's ability to model the spatial structure of spectral peaks. The core of the model consists of encoder and decoder modules. The encoder employs an alternating stacked structure of a multi-head self-attention mechanism (4 heads) and a feedforward network (128-dimensional hidden layers, ReLU activation), supplemented by residual connections and layer normalization, effectively capturing long-range dependencies and contextual semantics within the mixture spectrum. The decoder, building upon self-attention, introduces an encoder-decoder cross-attention mechanism, using pure spectral features as queries to dynamically align relevant regions in the mixture spectrum, accurately modeling the matching relationship between them. The encoder handles contextual feature abstraction, while the decoder achieves cross-spectral semantic alignment; together, they complete multi-level modeling from local features to global semantics. Finally, the output module performs global average pooling on the high-dimensional feature sequence output by the decoder, followed by a fully connected layer and a sigmoid activation function, outputting probability values in the 0-1 range. This directly characterizes the likelihood of the target compound's presence in the mixture, achieving end-to-end, quantifiable intelligent recognition without post-processing or manual intervention.
[0052] S3 uses the training set to train the deep learning model and the test set to verify the model's performance until the model converges, thus obtaining the trained deep learning model.
[0053] Specifically, training deep learning models using training sets includes:
[0054] First, a binary cross-entropy loss function is designed to measure the difference between the model's predicted output and the true label. Then, a single training process is initiated, where one-dimensional NMR spectral data pairs from the training set are input into the model batch by batch. After forward propagation to obtain the prediction results, the loss value between the predicted output and the corresponding label is calculated, and the Adam optimizer is used to backpropagate the gradient to update the model parameters. The above training process is repeated iteratively until the maximum number of training rounds is reached or the loss function converges to a stable state. At this point, the optimal model parameters are saved, completing the entire training process.
[0055] Specifically, in this embodiment, the loss function is implemented using binary cross-entropy. During a single network training iteration, the one-dimensional proton NMR spectrum from the training set is input into the model. The model's output and labels are used to calculate the loss function, and the Adam optimizer is used to update the model's parameters based on this loss function. Simultaneously, after each training iteration, the test set is used to calculate the loss function, and the best model is selected. The training steps are repeated multiple times until the preset maximum number of training iterations is reached, or training stops when the loss function decreases to convergence, resulting in a fully trained deep learning model. The test set samples or experimentally collected one-dimensional proton NMR spectra are input into the trained deep learning model, which outputs the probability of the presence of the compound to be identified in the mixture, thus completing the compound identification.
[0056] Specifically, this method also includes testing and evaluation of deep learning models, including:
[0057] The test set is input into the model to obtain the predicted probability of the target compound in each mixture sample. Based on the predicted value and the true label, the confusion matrix is calculated to count the number of correctly and incorrectly classified samples. The ROC curve is plotted and its area under the curve is calculated to evaluate the overall discrimination ability of the model. At the same time, the PR curve and its area under the curve are generated to measure the recognition performance of the model in the scenario of sparse positive samples or imbalance. Thus, the accuracy, generalization and robustness of the model are analyzed, and the end-to-end recognition performance is verified.
[0058] Specifically, in this embodiment, the evaluation indicators are designed as follows: the accuracy of amino acid identification is evaluated by calculating the true positive (TP), false positive (FP), true negative (TN), false negative (FN), precision, and recall rates. The meanings of the evaluation indicators are as follows:
[0059] TP: Determines that the mixture contains the compound to be identified, and the label indicates that it contains it;
[0060] FP: The mixture is determined to contain the compound to be identified, but the label indicates that it does not contain it;
[0061] TN: The mixture is determined to not contain the compound to be identified, and the label indicates that it does not contain it;
[0062] FN: Indicates that the mixture does not contain the compound to be identified, but the label indicates that it does;
[0063] Accuracy:
[0064] ;
[0065] Recall rate:
[0066]
[0067] The accuracy of compound identification can be quantitatively determined using two formulas. The closer the precision and recall are to 100%, the more accurate the compound identification. Then, the one-dimensional proton spectrum samples obtained from the test set or experiments are input into the model, and the model outputs the probability of the presence of the compound to be identified. Based on the obtained probability data, the compounds present in the mixture are evaluated.
[0068] Specifically, in this embodiment, the invention was specifically verified through experiments. Step 1: Generate the training set and test set required for the deep learning model. Based on the linear relationship between NMR signal intensity and component concentration, and the independent chemical shift between different components, the mixture spectrum is simulated by the linear superposition of pure compound spectra. And based on the peak feature library of the one-dimensional NMR hydrogen spectrum of the processed compound, a mathematical model is used to generate the corresponding peak with Voigt peak shape, generating a simulated one-dimensional NMR mixture hydrogen spectrum with noise, natural abundance differences and distortion; the parameters of the simulated one-dimensional NMR hydrogen spectrum include: amino acid number of [2,7] and [5,18], chemical shift shift of [-0.03, 0.03] ppm, concentration difference of [0.1, 1] and [0.1, 6], linewidth of [5,12] Hz, signal-to-noise ratio (SNR) of
[40] dB; the above SNR calculation formula is: All parameters above are randomly generated; the final generated data is of size (12000, 12000, 1 / 0), which are the one-dimensional proton spectra of mixed amino acids, the one-dimensional proton spectra of pure amino acids, and the labels, respectively; repeat the above steps to generate a training set of 160,000 and a test set of 10,000.
[0069] Step 2: Design the deep learning model architecture and build the model. Deep learning models include... Figure 2As shown, the model consists of five parts: an input feature downsampling module, a position encoding module, an encoder, a decoder, and an output module. The input feature downsampling module consists of a convolutional layer followed by a max-pooling layer with a stride of 2. The convolutional layer employs a two-stage design with 32 and 64 filters respectively. The first stage uses 32 filters, and the second stage uses 64 filters. Combining the convolutional operation with a stride of 2 with the max-pooling operation, the sequence length is halved at each stage. The position encoding module consists of sine-cosine position encoding. The encoder module consists of a multi-head attention mechanism and a feedforward network, with residual connections and layer normalization applied after each sub-layer. The multi-head attention mechanism uses four attention heads. The feedforward network contains two fully connected layers, where the hidden layer has a dimension of 128 and uses ReLU activation function, followed by a linear transformation to restore the embedding dimension. The decoder module consists of a multi-head attention mechanism, a feedforward network, and an encoder-decoder cross-attention module. The encoder-decoder cross-attention module combines contextual information from the encoder output to calculate the correlation between the decoder input and encoder output, capturing the complex relationship between the pure matter spectrum and the mixture spectrum. Residual connections and layer normalization are applied after each sub-layer. The multi-head attention mechanism uses four attention heads. The feedforward network contains two fully connected layers, where the hidden layers have a dimension of 128 and use ReLU activation, followed by a linear transformation to restore the embedding dimension. The output module consists of a global average pooling layer, a fully connected layer performing binary classification prediction, and outputting a single node with a sigmoid activation function.
[0070] Step 3: Train the deep learning model using the training and test sets to obtain a converged and trained deep learning model. The loss function is implemented using binary cross-entropy. A single network training iteration involves inputting a one-dimensional hydrogen spectrum from the training set into the model, calculating the aforementioned loss function using the model's output and labels, and updating the model's parameters using the Adam optimizer based on this loss function. Simultaneously, after each training iteration, the loss function is calculated using the test set to select the best model. This training process is repeated multiple times until the preset maximum number of training iterations is reached, or training stops when the loss function decreases to convergence, resulting in a fully trained deep learning model.
[0071] Step 4: Test the trained deep learning model using the test set and the one-dimensional hydrogen spectrum obtained from the experiment.
[0072] Specifically, such as Figure 3The diagram illustrates the performance of this invention in identifying multiple amino acid components in complex mixtures: the left half shows the actual composition of seven experimental mixtures (S1–S7), displaying the concentrations of Glu, Gln, Leu, Val, Ile, Asp, and Pro; the right half shows the predicted probabilities of the presence of seven amino acids obtained by inputting the experimentally acquired one-dimensional nuclear magnetic resonance hydrogen spectrum into the model; even if some amino acids are difficult to distinguish (e.g., Glu, Gln) and identify (Leu, Val, Ile), the model can still accurately identify them, giving a probability value close to 1.
[0073] Specifically, such as Figure 4 The diagram shows a comparison of model performance and error analysis in an embodiment of the present invention: The predicted probabilities of the presence of 18 amino acids were obtained by inputting the one-dimensional proton NMR spectra of 10 mixtures (S8–S17) collected in the experiment into the model, and the identification results of S8–S17 by ASICS were compared. Hollow circles represent missed identifications (false negatives, FN), and circled crosses represent incorrect identifications (false positives, FP). This demonstrates the model's compound identification ability in crowded spectra, its performance under dominant peak conditions, and its limitations under significant peak shift conditions.
[0074] like Figure 5 As shown, this embodiment also discloses a compound intelligent identification system based on proton nuclear magnetic resonance spectroscopy, including:
[0075] Dataset generation module 51 is used to generate the training and test sets required for deep learning models;
[0076] Deep learning model building module 52 is used to build deep learning model architectures based on training and test sets;
[0077] The deep learning model architecture includes an input feature downsampling module, a position encoding module, an encoder module, a decoder module, and an output module;
[0078] The input feature downsampling module extracts local peak features from the one-dimensional NMR 1H spectrum and compresses the feature sequence length to obtain a compact feature sequence after dimensionality reduction. Position coding is added to the compact feature sequence to introduce chemical shift position information, thereby obtaining a one-dimensional NMR 1H spectrum of a mixture and a one-dimensional NMR 1H spectrum of a pure substance with position coding. The one-dimensional NMR 1H spectrum of the mixture with position coding is input to the encoder module to obtain the mixture spectrum, and the one-dimensional NMR 1H spectrum of the pure substance with position coding is input to the decoder module to obtain the pure spectrum. The output module calculates the matching relationship between the pure spectrum and the mixture spectrum to achieve feature alignment across spectra, obtains the aligned features, and performs recognition.
[0079] Training module 53 is used to train the deep learning model using the training set and to verify the model performance using the test set until the model converges and the trained deep learning model is obtained.
[0080] The identification module 54 is used to input the one-dimensional nuclear magnetic resonance hydrogen spectrum of the test set sample or the experimentally collected sample into the trained deep learning model, and output the probability of the presence of the compound to be identified in the mixture to complete the compound identification.
[0081] The specific implementation of the compound intelligent identification system based on 1H NMR spectroscopy is the same as that of the compound intelligent identification method based on 1H NMR spectroscopy, and will not be repeated in this embodiment.
[0082] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.
Claims
1. A method for intelligent identification of compounds using proton nuclear magnetic resonance spectroscopy, characterized in that, Includes the following steps: S1, generating the training and test sets required for the deep learning model; the training and test sets include one-dimensional nuclear magnetic resonance hydrogen spectrum data; S2, based on the training set and test set, constructs a deep learning model architecture; The deep learning model architecture includes an input feature downsampling module, a position encoding module, an encoder module, a decoder module, and an output module; The input feature downsampling module extracts local peak features from the one-dimensional NMR 1H spectrum and compresses the feature sequence length to obtain a compact feature sequence after dimensionality reduction. Position coding is added to the compact feature sequence to introduce chemical shift position information, thereby obtaining a one-dimensional NMR 1H spectrum of a mixture and a one-dimensional NMR 1H spectrum of a pure substance with position coding. The one-dimensional NMR 1H spectrum of the mixture with position coding is input to the encoder module to obtain the mixture spectrum, and the one-dimensional NMR 1H spectrum of the pure substance with position coding is input to the decoder module to obtain the pure spectrum. The output module calculates the matching relationship between the pure spectrum and the mixture spectrum to achieve feature alignment across spectra, obtains the aligned features, and performs recognition. S3: Train the deep learning model using the training set and verify the model performance using the test set until the model converges, thus obtaining the trained deep learning model. S4 inputs the one-dimensional proton NMR spectrum of the test set sample or experimentally collected data into the trained deep learning model, outputs the probability of the presence of the compound to be identified in the mixture, and completes the compound identification.
2. The intelligent compound identification method based on proton nuclear magnetic resonance spectroscopy according to claim 1, characterized in that, S1 specifically includes: S11, based on the linear relationship between NMR signal intensity and component concentration, and considering the actual situation that chemical shifts may shift overall due to environmental influences, pre-acquired pure compound proton spectra are shifted overall and then linearly superimposed to generate a one-dimensional NMR mixture proton spectrum as one source of the dataset. On the other hand, the peak characteristics of each pure component are measured, including chemical shift, intensity, and spectral width, and Voigt line shapes are constructed to characterize the spectrum of each component. During the simulation, reasonable changes in intensity, chemical shift, spectral width, and line shape of each component are allowed. At the same time, small relative shifts between different peaks of the same component are introduced, and random noise is superimposed. Finally, a simulated mixture proton spectrum that closely resembles the actual experimental conditions is generated by the linear superposition of multi-component spectra as another source of the dataset. S12, randomly select a pure compound spectrum from the simulated one-dimensional NMR mixture proton spectrum as the identification target; S13, construct hydrogen spectrum pair data based on one-dimensional nuclear magnetic resonance mixture hydrogen spectrum and pure compound spectrum. If the target compound is a component of the mixture, it is marked as a positive sample; otherwise, it is marked as a negative sample. S14 iterates through S11–S13 to generate a predetermined number of training and test sets based on positive and negative samples.
3. The intelligent compound identification method based on proton nuclear magnetic resonance spectroscopy according to claim 2, characterized in that, The generation of one-dimensional NMR mixture proton spectra also includes: considering peak shift and background noise, generating one-dimensional NMR mixture proton spectra by linear superposition of experimental spectra; and generating the final one-dimensional NMR mixture proton spectrum by mathematical model simulation based on a one-dimensional proton spectrum peak feature library of compounds, which includes Voigt peak shape, background noise, natural compound abundance differences and spectrum distortion effects.
4. The intelligent compound identification method based on proton nuclear magnetic resonance spectroscopy according to claim 1, characterized in that, In S3, the deep learning model is trained using the training set, specifically including: First, a binary cross-entropy loss function is designed to measure the difference between the model's predicted output and the true label. Then, a single training process is initiated, where one-dimensional NMR spectral data pairs from the training set are input into the model batch by batch. After forward propagation to obtain the prediction results, the loss value between the predicted output and the corresponding label is calculated, and the Adam optimizer is used to backpropagate the gradient to update the model parameters. The above training process is repeated iteratively until the maximum number of training rounds is reached or the loss function converges to a stable state. At this point, the optimal model parameters are saved, completing the entire training process.
5. The intelligent compound identification method based on proton nuclear magnetic resonance spectroscopy according to claim 1, characterized in that, It also includes the testing and evaluation of deep learning models, specifically including: The test set is input into the model to obtain the predicted probability of the target compound in each mixture sample. Based on the predicted value and the true label, the confusion matrix is calculated to count the number of correctly and incorrectly classified samples. The ROC curve is plotted and its area under the curve is calculated to evaluate the overall discrimination ability of the model. At the same time, the PR curve and its area under the curve are generated to measure the recognition performance of the model in the scenario of sparse positive samples or imbalance. Thus, the accuracy, generalization and robustness of the model are analyzed, and the end-to-end recognition performance is verified.
6. A compound intelligent identification system based on proton nuclear magnetic resonance spectroscopy, characterized in that, include: The dataset generation module is used to generate the training and test sets required for deep learning models. The training and test sets include one-dimensional nuclear magnetic resonance hydrogen spectrum data; The deep learning model building module is used to build deep learning model architectures based on training and test sets. The deep learning model architecture includes an input feature downsampling module, a position encoding module, an encoder module, a decoder module, and an output module; The input feature downsampling module extracts local peak features from the one-dimensional NMR 1H spectrum and compresses the feature sequence length to obtain a compact feature sequence after dimensionality reduction. Position coding is added to the compact feature sequence to introduce chemical shift position information, thereby obtaining a one-dimensional NMR 1H spectrum of a mixture and a one-dimensional NMR 1H spectrum of a pure substance with position coding. The one-dimensional NMR 1H spectrum of the mixture with position coding is input to the encoder module to obtain the mixture spectrum, and the one-dimensional NMR 1H spectrum of the pure substance with position coding is input to the decoder module to obtain the pure spectrum. The output module calculates the matching relationship between the pure spectrum and the mixture spectrum to achieve feature alignment across spectra, obtains the aligned features, and performs recognition. The training module is used to train the deep learning model using the training set and to verify the model performance using the test set until the model converges and the trained deep learning model is obtained. The identification module is used to input the one-dimensional nuclear magnetic resonance hydrogen spectrum of the test set sample or experimentally collected data into the trained deep learning model, and output the probability of the presence of the compound to be identified in the mixture, thus completing the compound identification.