A processing method and apparatus for molecular affinity analysis
By constructing a molecular affinity prediction model using Uni-Mol and MLP models, and combining big data acquisition and noise perturbation techniques, the high complexity and long computation time of molecular affinity analysis for organic photovoltaic materials were solved, achieving efficient molecular and atomic-level analysis.
Patent Information
- Application Number
- CN202510283221.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-03-11
AI Technical Summary
Existing technologies for analyzing the molecular affinity of organic photovoltaic materials suffer from high computational complexity, long computation time, and low computational efficiency.
A molecular affinity prediction model was constructed using the Uni-Mol model and the MLP model. A training dataset was built through big data collection. Molecular affinity prediction and atomic contribution analysis were performed using the embedding coding module, the Uni-Mol model, and the MLP model. The model parameters were optimized by combining model training and noise perturbation techniques.
This method enables efficient prediction of molecular affinity and atomic-level affinity contribution analysis of organic photovoltaic material molecules, reducing analytical complexity, shortening analysis time, and improving analytical efficiency.
Smart Images

Figure CN120183560B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a processing method and device for molecular affinity analysis. BACKGROUND
[0002] Organic photovoltaics (OPV) materials refer to organic materials composed of organic molecules that can directly convert solar energy or other light energy into electrical energy through photovoltaic effect. The molecular affinity of such organic molecules has a positive impact on improving the stability, light absorption efficiency and photovoltaic conversion efficiency of the material. Currently, there are two types of tasks for analyzing the molecular affinity of such organic molecules: one is to predict the overall molecular affinity, and the other is to predict the atomic affinity contribution. Under normal circumstances, both of these analysis tasks are implemented based on simulation calculations, i.e., predicting molecular affinity and atomic contribution scores through a series of quantum chemical calculations such as density functional theory calculations. However, as practical experience shows, such conventional analysis methods often have high computational complexity, long calculation time and low calculation efficiency. SUMMARY
[0003] The present application is aimed at overcoming the drawbacks of the prior art, and provides a processing method and device for molecular affinity analysis, an electronic device and a computer readable storage medium. The present application constructs a molecular affinity prediction model by using the Uni-Mol model as the encoder and the MLP model as the encoder downstream regression calculation task model. The molecular affinity prediction model is used to perform molecular affinity prediction processing according to the molecular structure input by the model and output the corresponding predicted affinity. A first data set for model training is constructed through big data collection, and the molecular affinity prediction model is trained based on the first data set. After the model training is completed, the molecular affinity of the molecular structure specified by the user is predicted using the molecular affinity prediction model, and the atomic affinity contribution score in the current molecular structure is estimated and analyzed by scrambling the process features generated during the model processing. Through the present application, both of the two affinity analysis tasks for organic photovoltaic material molecules (predicting the overall molecular affinity and analyzing the atomic level affinity contribution) can be realized, and the analysis complexity can be reduced, the analysis time can be shortened, and the analysis efficiency can be improved.
[0004] To achieve the above-mentioned purpose, the first aspect of the present application provides a processing method for molecular affinity analysis, which comprises:
[0005] A molecular affinity prediction model is constructed in a manner that a Uni-Mol model is used as an encoder and an MLP model is used as a downstream regression calculation task model; the molecular affinity prediction model is used for molecular affinity prediction processing according to a model input molecular structure X and outputs a corresponding predicted affinity Y; the molecular structure X includes a plurality of atoms x i , 1≤atomic index i≤M, M is the total number of atoms of the molecular structure X; the atomic parameters of each atom x i include atomic type s i and atomic three-dimensional coordinates c i ; the predicted affinity Y is a real number;
[0006] Through a plurality of preset public data collection channels, the molecular structure of an organic molecule used for an organic photovoltaic material and the corresponding molecular affinity value are collected as big data; and each molecular structure and the corresponding molecular affinity value collected are used as a corresponding first training molecular structure and a first label affinity to form a corresponding first data record; and all the first data records obtained form a corresponding first data set; the plurality of public data collection channels at least include a plurality of public molecular information libraries and a plurality of public technical literatures in the field of organic photovoltaic materials; the first data set includes a plurality of first data records; the first data record includes the first training molecular structure and the first label affinity; the first training molecular structure includes a plurality of first atoms; the atomic parameters of each first atom include a first atomic type and a first atomic three-dimensional coordinate;
[0007] Based on the first data set, the molecular affinity prediction model is trained;
[0008] After the model training is completed, a first molecular structure input by a user is received; the first molecular structure is input as the corresponding molecular structure X into the molecular affinity prediction model for prediction processing, and the predicted affinity Y output by the model in this processing is used as a corresponding first molecular affinity; the contribution scores of each atom in the first molecular structure to the molecular affinity are analyzed to obtain corresponding first atomic contribution scores; and the first molecular affinity and all the first atomic contribution scores obtained are fed back to the current user; the first molecular structure includes a plurality of second atoms; the atomic parameters of each second atom include a second atomic type and a second atomic three-dimensional coordinate.
[0009] Preferably, the molecular affinity prediction model includes an embedding encoding module, the Uni-Mol model and the MLP model;
[0010] The input of the embedding coding module is connected to the input of the molecular affinity prediction model, and the output is connected to the input of the Uni-Mol model; the output of the Uni-Mol model is connected to the input of the MLP model; the output of the MLP model is connected to the output of the molecular affinity prediction model.
[0011] The embedding encoding module is used to encode each atom x of the molecular structure X according to the atom type one-heat encoding rule of the Uni-Mol model. i Encoding yields the corresponding atomic one-heat encoding vector es i And by obtaining all the atomic one-heat encoded vectors es i The corresponding atom type encoding tensor ES is formed; and the encoding rules are initialized according to the pairwise features of the Uni-Mol model, based on the three-dimensional coordinates c of all the atoms of the molecular structure X. i Perform pairwise feature initialization to obtain the corresponding pairwise encoded tensor EP; and send the atom type encoded tensor ES and the pairwise encoded tensor EP to the Uni-Mol model;
[0012] The atomic one-heat encoding vector es i It is a one-dimensional one-hot encoded vector of length D1, where D1 is the total number of atom types in the molecular structure X; the atom one-hot encoded vector es i In and the currently described atom x i The atom type s i The corresponding one-hot encoding is set to 1, and the remaining D1-1 one-hot encodings are set to 0; the tensor shape of the atom type encoding tensor ES is D1×M;
[0013] The paired encoding tensor EP is an M×M paired encoding matrix; the paired encoding matrix consists of M×M encoding matrix units; each encoding matrix unit is a paired encoding vector of length D2, where D2 is a preset encoding vector length; the matrix rows or columns of the paired encoding matrix are related to the atom x. i One-to-one correspondence;
[0014] The Uni-Mol model is used to extract atomic features and paired features based on the input atomic type encoding tensor ES and paired encoding tensor EP to obtain the corresponding atomic feature tensor Q and paired feature tensor P; and to perform feature fusion on the atomic feature tensor Q and paired feature tensor P to obtain the corresponding molecular feature tensor H and send it to the MLP model.
[0015] The tensor shape of the atomic feature tensor Q is D3×M, D3 is a preset atomic feature dimension; the atomic feature tensor Q is specifically composed of M sub-feature vectors q i The atomic feature vector q i corresponds to the atom x i one-to-one;
[0016] The pair feature tensor P is a pair feature matrix with a shape of M×M; the pair feature matrix is composed of M×M feature matrix units; each of the feature matrix units is a pair feature vector with a vector length of D4, D4 is a preset pair feature dimension; the matrix row or the matrix column of the pair feature matrix corresponds to the atom x i one-to-one; the feature vector corresponding to each matrix row of the pair feature matrix is expressed as a row feature vector pl i The vector length of the row feature vector pl i is D4×M, which is sequentially spliced by the M pair feature vectors of the current row;
[0017] The tensor shape of the molecular feature tensor H is (D3+D4×M)×M; the molecular feature tensor H is specifically composed of M sub-feature vectors h i with a vector length of (D3+D4×M); the sub-feature vector h i corresponds to the atom x i one-to-one; the sub-feature vector h i is sequentially spliced by the corresponding sub-feature vector q i with a length of D3 and the row feature vector pl i with a length of D4×M;
[0018] The MLP model is used for molecular affinity calculation according to the input molecular feature tensor H and outputs the corresponding predicted affinity Y;
[0019] The MLP model is specifically composed of multiple layers of sequentially connected fully connected layers FC j , 1≤layer index j≤N, N is a preset total number of fully connected layers, N≥3;
[0020] The function expression of the fully connected layer FC j is:
[0021]
[0022] When j=1, y j-1 =y0=H,
[0023] When j=N, Y=y j=N ;
[0024] wherein, y j-1 , y j are the output features of the j-1th and jth fully connected layers; w j , b j are the weight parameters and bias parameters of each of the fully connected layers FC j ; σ is a preset activation function, which is only used in the 1st to (N-1)th fully connected layers; for the 1st fully connected layer FC j=1 , the corresponding output feature y j-1 of the previous layer is the molecular feature tensor H output by the Uni-Mol model; for the Nth fully connected layer FC j=N , the output feature of the current fully connected layer is a real number, i.e., the predicted affinity Y.
[0025] Preferably, the model training of the molecular affinity prediction model based on the first data set specifically comprises:
[0026] Step 31, based on a preset first split ratio, the first data set is split into two sub-data sets, denoted as a corresponding first training set and a first evaluation set;
[0027] wherein, the first training set and the first evaluation set are both composed of a plurality of first data records; the total number ratio of the records of the first training set and the first evaluation set satisfies the first split ratio;
[0028] Step 32, the first first data record of the first training set is taken as a corresponding current training record;
[0029] Step 33, the first training molecular structure of the current training record is taken as a corresponding molecular structure X input into the molecular affinity prediction model for prediction processing, and the predicted affinity Y output by the model this time is taken as a corresponding first predicted affinity;
[0030] Step 34, the first predicted affinity and the first label affinity of the current training record are taken into a preset first model loss function to obtain a corresponding first loss value;
[0031] wherein, the first model loss function is realized based on an L1 loss function, a smooth L1 loss function or an L2 loss function;
[0032] Step 35, identifying whether the first loss value meets a preset first loss value range; if the first loss value meets the first loss value range, identifying whether the current training record is the last first data record of the first training set, if yes, going to step 36, if no, taking the next first data record of the first training set as a new current training record and returning to step 33 to continue training; if the first loss value does not meet the first loss value range, based on a preset first model optimizer, a round of modulation is performed on the model parameters of the molecular affinity prediction model in the direction of minimizing the first model loss function, and at the end of the round of modulation, returning to step 33 to continue training;
[0033] The first model optimizer at least includes an Adam optimizer, an SGD optimizer;
[0034] Step 36, performing a round of traversal on all the first data records of the first evaluation set; and in the round of traversal, taking the first data record currently traversed as a corresponding current evaluation record; and taking the first training molecular structure of the current evaluation record as a corresponding molecular structure X inputting the molecular affinity prediction model for prediction processing and taking the predicted affinity Y outputted by the model in this processing as a corresponding second predicted affinity; and the second predicted affinity and the first label affinity of the current training record form a corresponding prediction-label pair; and at the end of the round of traversal, taking all the prediction-label pairs obtained to a preset first model evaluation function to obtain a corresponding first evaluation value;
[0035] The first model evaluation function is realized based on an MAE function, an MSE function or an RMSE function;
[0036] Step 37, identifying whether the first evaluation value meets a preset first evaluation value range; if not, returning to step 32 to continue training; if yes, stopping training and confirming that the model training is completed.
[0037] Preferably, the contribution score of each atom in the first molecular structure to the molecular affinity is analyzed to obtain a corresponding first atomic contribution score, specifically including:
[0038] Step 41, setting a first counter initialized as 1; and setting a corresponding first count threshold value as a preset number threshold value K;
[0039] Step 42, the first molecular structure is input into the embedding encoding module of the molecular affinity prediction model to obtain the corresponding atomic type encoding tensor ES and the pair encoding tensor EP; the atomic type encoding tensor ES and the pair encoding tensor EP obtained this time are input into the Uni-Mol model of the molecular affinity prediction model to obtain the corresponding molecular feature tensor H; the molecular feature tensor H obtained this time is taken as the corresponding current feature tensor H now ; and each sub-feature vector h i of the molecular feature tensor H obtained this time is recorded as the corresponding sub-feature vector h now,I ;
[0040] Step 43, the current feature tensor H now is input into the MLP model of the molecular affinity prediction model for processing, and the predicted affinity output by this processing is taken as a corresponding affinity true value z true,k ; 1≤index k≤K;
[0041] Step 44, a random noise vector ε i satisfying Gaussian distribution and having a mean of 0 and a preset first standard deviation is created, and the vector shape of the random noise vector ε k is consistent with the vector shape of the sub-feature vector h now of the molecular feature tensor H;
[0042] Step 45, all the sub-feature vectors h now,I of the current feature tensor H now,I are traversed once; and in the process of this round of traversal, the sub-feature vector h * being traversed is taken as the corresponding current vector h; the current vector h is noise disturbed to obtain the corresponding current disturbance vector h k based on the manner of h * ; the corresponding sub-feature vector h * in the current feature tensor H now is replaced by the current disturbance vector h now,I to obtain a new feature tensor H * ; the current feature tensor H * is input into the MLP model of the molecular affinity prediction model for processing, and the predicted affinity output by this processing is taken as a corresponding disturbance affinity z i,k ; and the first counter is incremented by 1 at the end of this round of traversal;
[0043] Step 46, identifying whether the first counter is greater than the first counting threshold value; if yes, going to step 47; if no, returning to step 42;
[0044] Step 47, according to all the affinity true values z true,k and all the perturbed affinities z i,k , the contribution score of each second atom in the first molecular structure is estimated to obtain the corresponding first atomic contribution score;
[0045] The estimation method of the first atomic contribution score is as follows:
[0046]
[0047] Wherein, score i is the first atomic contribution score corresponding to the i-th second atom in the first molecular structure.
[0048] The second aspect of the embodiment of the application provides a device for realizing the processing method for molecular affinity analysis in the first aspect, and the device comprises a model construction module, a data acquisition module, a model training module and a model application module.
[0049] The model construction module is used to construct a molecular affinity prediction model in the manner of taking a Uni-Mol model as an encoder and taking an MLP model as an encoder downstream regression calculation task model; the molecular affinity prediction model is used to perform molecular affinity prediction processing according to a model input molecular structure X and output a corresponding predicted affinity Y; the molecular structure X comprises a plurality of atoms x i , 1≤atomic index i≤M, and M is the total number of atoms of the molecular structure X; the atomic parameters of each atom x i include an atomic type s i and atomic three-dimensional coordinates c i ; the predicted affinity Y is a real number;
[0050] The data collection module is used for collecting big data of molecular structures of organic molecules for organic photovoltaic materials and corresponding molecular affinity values through a plurality of preset public data collection channels, and each of the collected molecular structures and the corresponding molecular affinity values is taken as a corresponding first training molecular structure and a first label affinity to form a corresponding first data record, and all the obtained first data records form a corresponding first data set, the plurality of public data collection channels at least include a plurality of public molecular information databases and a plurality of public technical documents in the field of organic photovoltaic materials, the first data set includes a plurality of first data records, the first data record includes the first training molecular structure and the first label affinity, the first training molecular structure includes a plurality of first atoms, and the atomic parameters of each first atom include a first atomic type and a first atomic three-dimensional coordinate.
[0051] The model training module is used for model training of the molecular affinity prediction model based on the first data set.
[0052] The model application module is used for receiving a first molecular structure input by a user after the model training is completed, inputting the first molecular structure as a corresponding molecular structure X into the molecular affinity prediction model for prediction processing, taking the predicted affinity Y output by the model in this processing as a corresponding first molecular affinity, analyzing the contribution scores of each atom in the first molecular structure to the molecular affinity to obtain a corresponding first atomic contribution score, and feeding back the obtained first molecular affinity and all the first atomic contribution scores to the current user, the first molecular structure includes a plurality of second atoms, and the atomic parameters of each second atom include a second atomic type and a second atomic three-dimensional coordinate.
[0053] The third aspect of the embodiment of the application provides an electronic device, including a memory, a processor and a transceiver.
[0054] The processor is used for coupling with the memory, reading and executing instructions in the memory to realize the method steps of the first aspect.
[0055] The transceiver is coupled with the processor, and the transceiver is controlled by the processor to perform message transceiving.
[0056] The fourth aspect of the embodiment of the application provides a computer readable storage medium, and the computer readable storage medium stores computer instructions, when the computer instructions are executed by a computer, the computer instructions make the computer execute the instructions of the method of the first aspect.
[0057] This invention provides a processing method, apparatus, electronic device, and computer-readable storage medium for molecular affinity analysis. As described above, this invention constructs a molecular affinity prediction model using a Uni-Mol model as the encoder and an MLP model as the downstream regression calculation model. This molecular affinity prediction model is used to predict molecular affinity based on the molecular structure input to the model and output the corresponding predicted affinity. A first dataset for model training is constructed through big data collection, and the molecular affinity prediction model is trained based on this dataset. After model training, the molecular affinity prediction model is used to predict the molecular affinity of a user-specified molecular structure, and the affinity contribution score of each atom in the current molecular structure is estimated and analyzed by scrambling the process features generated during model processing. Through this invention, two affinity analysis tasks for organic photovoltaic material molecules are achieved (predicting overall molecular affinity and analyzing atomic-level affinity contributions), while also reducing analysis complexity, shortening analysis time, and improving analysis efficiency. Attached Figure Description
[0058] Figure 1 This is a schematic diagram of a processing method for molecular affinity analysis provided in Embodiment 1 of the present invention;
[0059] Figure 2 This is a block diagram of the molecular affinity prediction model provided in Embodiment 1 of the present invention;
[0060] Figure 3 This is a module structure diagram of a processing device for molecular affinity analysis provided in Embodiment 2 of the present invention;
[0061] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0063] Embodiment 1 of the present invention provides a processing method for molecular affinity analysis, such as... Figure 1 The schematic diagram shows a processing method for molecular affinity analysis provided in Embodiment 1 of the present invention. This method mainly includes the following steps:
[0064] Step 1: Construct a molecular affinity prediction model using the Uni-Mol model as the encoder and the MLP model as the downstream regression calculation task model.
[0065] Here, the molecular affinity prediction model of this invention is used to perform molecular affinity prediction processing based on the molecular structure X input to the model and output the corresponding predicted affinity Y; wherein, the molecular structure X includes multiple atoms x i 1 ≤ atom index i ≤ M, where M is the total number of atoms in molecular structure X; each atom x i The atomic parameters include the atom type s i and the three-dimensional coordinates c of the atom i The predicted affinity Y is a real number.
[0066] The model structure of the molecular affinity prediction model is as follows: Figure 2 The module structure diagram of the molecular affinity prediction model provided in Embodiment 1 of the present invention is shown, including: an embedding coding module, a Uni-Mol model, and an MLP model.
[0067] The connection relationships of the various model components of the molecular affinity prediction model are as follows: the input end of the embedded coding module is connected to the model input end of the molecular affinity prediction model, and the output end is connected to the input end of the Uni-Mol model; the output end of the Uni-Mol model is connected to the input end of the MLP model; and the output end of the MLP model is connected to the output end of the molecular affinity prediction model.
[0068] The component functions of each model component in the molecular affinity prediction model are shown below.
[0069] 1) Embedded encoding module:
[0070] The embedding encoding module of this invention is used to encode each atom x of molecular structure X according to the one-heat encoding rules of the atom type of the Uni-Mol model. i Encoding yields the corresponding atomic one-heat encoding vector es i And the obtained atomic unique thermal encoding vector es i The corresponding atom type encoding tensor ES is formed; and the encoding rules are initialized according to the pairwise features of the Uni-Mol model, based on the three-dimensional coordinates c of all atoms in the molecular structure X. i Perform pairwise feature initialization to obtain the corresponding pairwise encoded tensor EP; and send the atom type encoded tensor ES and the pairwise encoded tensor EP to the Uni-Mol model.
[0071] Here, the atomic one-hot encoded vector es in this embodiment of the invention i Let es be a one-dimensional one-hot encoded vector of length D1, where D1 is the total number of atom types in molecular structure X;i The atom type s of the current atom x i i The corresponding one-hot encoding is set to 1, and the remaining D1-1 one-hot encodings are set to 0. The tensor shape of the atom type encoding tensor ES of the embodiment of the application is D1 x M.
[0072] The pair encoding tensor EP of the embodiment of the application is a pair encoding matrix with a shape of M x M; the pair encoding matrix is composed of M x M encoding matrix units; wherein each encoding matrix unit is a pair encoding vector with a vector length of D2, and D2 is a preset encoding vector length; the matrix row or the matrix column of the pair encoding matrix is in one-to-one correspondence with the atom x i .
[0073] It should be noted that the Uni-Mol model used in the embodiment of the application is an encoder model implemented based on an Encoder sub-model of a Transformer model and used for atom-level feature encoding of a molecular structure. The detailed model structure, model inference principle, atom type one-hot encoding rule, pair feature initialization encoding rule, and model pre-training scheme of the Uni-Mol model are explicitly described in the disclosed technical document A Uni-Mol: A Universal 3D Molecular Representation Learning Framework, so further elaboration on the atom type one-hot encoding rule and the pair feature initialization encoding rule used by the embedding encoding module will not be given here.
[0074] 2) Uni-Mol model:
[0075] The Uni-Mol model of the embodiment of the application is used to perform atom feature and pair feature extraction processing according to the input atom type encoding tensor ES and the pair encoding tensor EP to obtain the corresponding atom feature tensor Q and the pair feature tensor P; and the atom feature tensor Q and the pair feature tensor P are fused to obtain the corresponding molecular feature tensor H, which is sent to the MLP model.
[0076] Here, the tensor shape of the atom feature tensor Q of the embodiment of the application is D3 x M, and D3 is a preset atom feature dimension; the atom feature tensor Q can be specifically regarded as being composed of M sub-feature vectors q i , each with a vector length of D3, and each sub-feature vector q i corresponds to an atom x i .
[0077] The pair feature tensor P of the embodiment of the application is a pair feature matrix with a shape of MxM; the pair feature matrix is composed of MxM feature matrix units; each feature matrix unit is a pair feature vector with a vector length of D4, and D4 is a preset pair feature dimension; the matrix row or the matrix column of the pair feature matrix corresponds to an atom x i in one-to-one correspondence; the feature vector corresponding to each matrix row of the pair feature matrix can be expressed as a corresponding row feature vector pl i , and the vector length of each row feature vector pl i is D4xM, and is sequentially spliced by M pair feature vectors in the current row of the pair feature matrix.
[0078] The tensor shape of the molecular feature tensor H of the embodiment of the application is (D3+D4xM)xM; the molecular feature tensor H can be specifically regarded as being composed of M sub-feature vectors h i with a vector length of (D3+D4xM); the sub-feature vector h i corresponds to an atom x i in one-to-one correspondence; each sub-feature vector h i is sequentially spliced by a corresponding sub-feature vector q i (length D3) and a corresponding row feature vector pl i (length D4xM).
[0079] As can be known from the foregoing, the detailed model structure, model reasoning principle and model pre-training scheme of the Uni-Mol model used in the embodiment of the application have been published in the public technical document A, so the encoding process of the Uni-Mol model will not be further described here. It should be noted that the Uni-Mol model used in the embodiment of the application has been pre-trained according to the model pre-training scheme given in the public technical document A.
[0080] 3) MLP model:
[0081] The MLP model of the embodiment of the application is used for performing molecular affinity calculation according to the input molecular feature tensor H and outputting the corresponding predicted affinity Y.
[0082] As shown in Figure 2 , the MLP model is specifically composed of a plurality of fully connected layers FC j connected in sequence, 1≤layer index j≤N, N is a preset total number of fully connected layers, and N≥3.
[0083] The function expression of the fully connected layer FC j of the MLP model is as follows:
[0084]
[0085] When j=1, y j-1 =y0=H,
[0086] When j = N, Y = y j=N ;
[0087] Among them, y j-1 y j The output features of the (j-1)th and j-th fully connected layers; w j b j For each fully connected layer FC j The weights and biases are given; σ is a pre-defined activation function used only in the first to N-1 fully connected layers. This activation function σ can be a linear activation function or a non-linear activation function, but in general, a non-linear activation function is used. For the first fully connected layer FC... j=1 In other words, its corresponding output feature y of the previous layer j-1 This refers to the molecular feature tensor H output by the Uni-Mol model; for the Nth fully connected layer FC... j=N In this case, the output feature of the current fully connected layer is a real number, namely the predicted affinity Y.
[0088] Step 2: Collect big data on the molecular structure and corresponding molecular affinity values of organic molecules used in organic photovoltaic materials through multiple pre-set public data collection channels; and use each collected molecular structure and corresponding molecular affinity value as the first training molecular structure and the first tag affinity to form a corresponding first data record; and use all the obtained first data records to form a corresponding first dataset.
[0089] Here, the various publicly available data acquisition channels in this embodiment of the invention include at least multiple publicly available molecular information databases and various types of publicly available technical literature in the field of organic photovoltaic materials. The first dataset used for model training in this embodiment of the invention includes multiple first data records; each first data record includes a first training molecular structure and a first tag affinity; the first training molecular structure includes multiple first atoms; the atomic parameters of each first atom include a first atom type and three-dimensional coordinates of the first atom.
[0090] Step 3: Train the molecular affinity prediction model based on the first dataset;
[0091] Specifically, it includes: Step 31, dividing the first dataset into two sub-datasets based on a preset first segmentation ratio, denoted as the corresponding first training set and first evaluation set;
[0092] Here, the first split ratio of the embodiment of the application is a pre-set ratio parameter, for example, 8:2; the first training set and the first evaluation set are both composed of a plurality of first data records; the total number of records of the first training set and the first evaluation set meets the first split ratio;
[0093] Step 32, the first data record of the first training set is taken as a corresponding current training record;
[0094] Step 33, the first training molecular structure of the current training record is taken as a corresponding molecular structure X and input into the molecular affinity prediction model for prediction processing, and the prediction affinity Y output by the model in this processing is taken as a corresponding first prediction affinity;
[0095] Step 34, the first prediction affinity and the first label affinity of the current training record are taken into a pre-set first model loss function to obtain a corresponding first loss value through calculation;
[0096] Here, the first model loss function of the embodiment of the application is realized based on an L1 loss function, a smooth L1 loss function or an L2 loss function;
[0097] Step 35, whether the first loss value meets a pre-set first loss value range is identified; if the first loss value meets the first loss value range, whether the current training record is the last first data record of the first training set is identified; if yes, step 36 is entered; if no, the next first data record of the first training set is taken as a new current training record and step 33 is returned to continue training; if the first loss value does not meet the first loss value range, a round of modulation is performed on the model parameters of the molecular affinity prediction model in the direction of making the first model loss function reach a minimum value based on a pre-set first model optimizer, and step 33 is returned to continue training at the end of the round of modulation;
[0098] Here, the first loss value range of the embodiment of the application is a pre-set loss value range; the first model optimizer at least includes an Adam optimizer and an SGD optimizer;
[0099] Step 36, a round of traversal is performed on all the first data records of the first evaluation set; and in the round of traversal, the currently traversed first data record is taken as a corresponding current evaluation record; the first training molecular structure of the current evaluation record is taken as a corresponding molecular structure X and input into the molecular affinity prediction model for prediction processing, and the prediction affinity Y output by the model in this processing is taken as a corresponding second prediction affinity; a corresponding prediction-label pair is composed of the second prediction affinity and the first label affinity of the current training record; and at the end of the round of traversal, all the prediction-label pairs obtained are taken into a pre-set first model evaluation function to obtain a corresponding first evaluation value through calculation;
[0100] Here, the first model evaluation function of the embodiment of the application is implemented based on an MAE function, an MSE function or an RMSE function.
[0101] Step 37, whether the first evaluation value meets a preset first evaluation value range is identified; if not, returning to step 32 for continuous training; if yes, stopping training and confirming that the model training is ended.
[0102] Here, the first evaluation value range of the embodiment of the application is a preset evaluation value range.
[0103] Step 4, after the model training is ended, a first molecular structure input by a user is received; the first molecular structure is input as a corresponding molecular structure X into a molecular affinity prediction model for prediction processing, and a predicted affinity Y output by the model in this processing is taken as a corresponding first molecular affinity; a contribution score of each atom in the first molecular structure to the molecular affinity is analyzed to obtain a corresponding first atomic contribution score; and the obtained first molecular affinity and all first atomic contribution scores are fed back to the current user;
[0104] Specifically, it includes: step 41, after the model training is ended, a first molecular structure input by a user is received;
[0105] Here, the first molecular structure of the embodiment of the application includes a plurality of second atoms; the atomic parameters of each second atom include a second atomic type and a second atomic three-dimensional coordinate;
[0106] Step 2, the first molecular structure is input as a corresponding molecular structure X into a molecular affinity prediction model for prediction processing, and a predicted affinity Y output by the model in this processing is taken as a corresponding first molecular affinity;
[0107] Step 43, a contribution score of each atom in the first molecular structure to the molecular affinity is analyzed to obtain a corresponding first atomic contribution score;
[0108] Specifically, it includes: step 431, a first counter initialized as 1 is set; and a corresponding first counting threshold value is set as a preset times threshold value K;
[0109] Here, the times threshold value K of the embodiment of the application is a preset positive integer greater than 1;
[0110] Step 432, the first molecular structure is input into the embedding coding module of the molecular affinity prediction model as a corresponding molecular structure X to obtain a corresponding atomic type coding tensor ES and a pair coding tensor EP; and the atomic type coding tensor ES and the pair coding tensor EP obtained this time are input into the Uni-Mol model of the molecular affinity prediction model to obtain a corresponding molecular feature tensor H; and the molecular feature tensor H obtained this time is taken as a corresponding current feature tensor H now ; and each sub-feature vector h i of the molecular feature tensor H obtained this time is recorded as a corresponding sub-feature vector h now,I .
[0111] Step 433, the current feature tensor H now is input into the MLP model of the molecular affinity prediction model for processing, and a predicted affinity output by the processing this time is taken as a corresponding affinity true value z true,k ; 1≤index k≤K;
[0112] Step 434, a random noise vector ε i satisfying a Gaussian distribution and having a mean of 0, a first standard deviation as a preset first standard deviation, and a vector shape consistent with that of the sub-feature vector h k of the molecular feature tensor H is created.
[0113] Here, the first standard deviation is a pre-set standard deviation parameter;
[0114] Step 435, all sub-feature vectors h now of the current feature tensor H now,I are traversed for one round; and in the one round of traversal, the sub-feature vector h now,I being traversed is taken as a corresponding current vector h; and the current vector h is noise-perturbed to obtain a corresponding current perturbation vector h * based on the manner of h k = h+ε * ; the corresponding sub-feature vector h * of the current feature tensor H now is replaced by the current perturbation vector h now,I to obtain a new feature tensor H * ; the current feature tensor H * is input into the MLP model of the molecular affinity prediction model for processing, and a predicted affinity output by the processing this time is taken as a corresponding perturbation affinity z i,k ; and the first counter is incremented by 1 at the end of the one round of traversal.
[0115] Step 436, identify whether the first counter is greater than the first counting threshold value; if yes, go to step 437; if no, return to step 432;
[0116] Step 437, according to all the affinity true values z true,k and all the perturbed affinities z i,k The contribution score of each second atom in the first molecular structure is estimated to obtain the corresponding first atomic contribution score;
[0117] Here, the estimation method of the first atomic contribution score of the embodiment of the application is as follows:
[0118]
[0119] Wherein, score i is the first atomic contribution score corresponding to the i-th second atom in the first molecular structure;
[0120] From the above steps 431-437, it can be seen that the embodiment of the application provides an analysis method for estimating the affinity contribution score of each atom in the current molecular structure by perturbing the atomic level features (i.e. sub-feature vectors h i ) and in the processing process, K rounds of estimation are performed to reduce the estimation error and the average value of the K estimated scores of each atom is finally taken as the final estimated score (i.e. the first atomic contribution score);
[0121] Step 44, and the obtained first molecular affinity and all the first atomic contribution scores are fed back to the current user.
[0122] Here, after obtaining the feedback information, on the one hand, the user can intuitively understand the molecular affinity level of the current molecular structure based on the first molecular affinity; on the other hand, the user can intuitively understand the affinity contribution level of each atom and each molecular fragment region in the current molecular structure based on all the first atomic contribution scores, which also provides reference information for the user to further optimize the current molecular structure.
[0123] Figure 3 A module structure diagram of a processing device for molecular affinity analysis is provided for the second embodiment of the application. The device is a terminal device or a server for implementing the foregoing method embodiment, or a device capable of enabling the foregoing terminal device or server to implement the foregoing method embodiment, such as a device or a chip system of the foregoing terminal device or server. As shown in the figure, the device comprises a model construction module 201, a data acquisition module 202, a model training module 203 and a model application module 204. Figure 3
[0124] The model construction module 201 is configured to construct a molecular affinity prediction model in a manner that the Uni-Mol model is used as an encoder and an MLP model is used as a downstream regression calculation task model of the encoder; the molecular affinity prediction model is configured to perform molecular affinity prediction processing according to a model input molecular structure X and output a corresponding predicted affinity Y; the molecular structure X includes a plurality of atoms x i , 1≤atomic index i≤M, M is the total number of atoms of the molecular structure X; the atomic parameters of each atom x i include an atomic type s i and atomic three-dimensional coordinates c i ; the predicted affinity Y is a real number.
[0125] The data acquisition module 202 is configured to acquire molecular structures of organic molecules of organic photovoltaic materials and corresponding molecular affinity values through a plurality of preset public data acquisition channels; and acquire each molecular structure and the corresponding molecular affinity value as a corresponding first training molecular structure and a first label affinity to form a corresponding first data record; and all the obtained first data records form a corresponding first data set; the plurality of public data acquisition channels at least include a plurality of public molecular information databases and a plurality of public technical literatures in the field of organic photovoltaic materials; the first data set includes a plurality of first data records; the first data record includes a first training molecular structure and a first label affinity; the first training molecular structure includes a plurality of first atoms; the atomic parameters of each first atom include a first atomic type and first atomic three-dimensional coordinates.
[0126] The model training module 203 is configured to train the molecular affinity prediction model based on the first data set.
[0127] The model application module 204 is configured to receive a first molecular structure input by a user after the model training is completed; input the first molecular structure as a corresponding molecular structure X into the molecular affinity prediction model for prediction processing and output a predicted affinity Y processed by the model this time as a corresponding first molecular affinity; analyze the contribution scores of each atom in the first molecular structure to the molecular affinity to obtain corresponding first atomic contribution scores; and feed back the obtained first molecular affinity and all first atomic contribution scores to the current user; the first molecular structure includes a plurality of second atoms; the atomic parameters of each second atom include a second atomic type and second atomic three-dimensional coordinates.
[0128] The processing device for molecular affinity analysis provided in the embodiment of the present application can execute the method steps in the method embodiments described above, and has similar implementation principles and technical effects, which will not be described here again.
[0129] It should be noted that the division of the various modules of the above apparatus is only a logical functional division, and in actual implementation, all or part of them can be integrated into one physical entity, or can be physically separated. These modules can all be implemented in the form of software invoked by a processing element; all can be implemented in the form of hardware; or some modules can be implemented in the form of software invoked by a processing element, and some modules can be implemented in the form of hardware. For example, the model construction module can be a separately established processing element, or can be integrated in a certain chip of the above apparatus, in addition, it can also be stored in the form of program code in the memory of the above apparatus, and the function of the above determination module is invoked and executed by a certain processing element of the above apparatus. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or can be independently implemented. The processing element described herein can be an integrated circuit with signal processing capability. In the implementation process, each step of the above method or each module can be completed by the integrated logic circuit of the hardware in the processor element or the instructions in the form of software.
[0130] For example, the above modules can be one or more integrated circuits configured to implement the above method, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs), etc. For another example, when a certain module above is implemented in the form of program code invoked by a processing element, the processing element can be a general purpose processor, such as a central processing unit (CPU) or other processor that can invoke program code. For another example, these modules can be integrated together to implement in the form of system on a chip (SOC).
[0131] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the foregoing method embodiments are generated. The computer described above can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The aforementioned computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the aforementioned computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, Bluetooth, microwave, etc.) means. The aforementioned computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The aforementioned available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).
[0132] Figure 4 This is a schematic diagram of an electronic device provided in Embodiment 3 of the present invention. This electronic device can be a terminal device or server implementing the methods of the aforementioned embodiments, or it can be a terminal device or server connected to the aforementioned terminal device or server implementing the methods of the aforementioned embodiments. Figure 4 As shown, the electronic device may include: a processor 301 (e.g., CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transmission and reception operations of the transceiver 303. The memory 302 may store various instructions for performing various processing functions and implementing the processing steps described in the foregoing embodiments. Preferably, the electronic device involved in the embodiments of the present invention further includes: a power supply 304, a system bus 305, and a communication port 306. The system bus 305 is used to realize communication connections between components. The communication port 306 is used for communication between the electronic device and other peripherals.
[0133] exist Figure 4The system bus 305 mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as a client, a read-write library and a read-only library). The memory can include a Random Access Memory (RAM), and can also include a Non-Volatile Memory, such as at least one disk memory.
[0134] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), a Graphics Processing Unit (GPU), etc.; can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0135] It should be noted that the embodiments of the present application also provide a computer readable storage medium, which stores instructions, and when the instructions run on a computer, the computer executes the method and process provided in the above embodiments.
[0136] The embodiment of the present application provides a processing method and device for molecular affinity analysis, electronic equipment and computer readable storage medium. According to the above content, the embodiment of the present application constructs a molecular affinity prediction model in the manner of taking the Uni-Mol model as an encoder and taking the MLP model as an encoder downstream regression calculation task model, the molecular affinity prediction model is used for molecular affinity prediction processing according to the molecular structure input by the model and outputs the corresponding predicted affinity; and a first data set used for model training is constructed through big data collection, and the molecular affinity prediction model is trained based on the first data set; and after the model training is completed, the molecular affinity of the molecular structure specified by the user is predicted by using the molecular affinity prediction model, and the affinity contribution score of each atom in the current molecular structure is estimated and analyzed in the manner of scrambling the process characteristics generated in the model processing process. Through the embodiment of the present application, on the one hand, two kinds of affinity analysis tasks for organic photovoltaic material molecules (predicting the overall molecular affinity and analyzing the atomic level affinity contribution) are realized, and on the other hand, the analysis complexity is reduced, the analysis time is shortened, and the analysis efficiency is improved.
[0137] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0138] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A processing method for molecular affinity analysis, characterized by, The method comprises: A molecular affinity prediction model is constructed in a manner that a Uni-Mol model is used as an encoder and an MLP model is used as an encoder downstream regression calculation task model; the molecular affinity prediction model is used for molecular affinity prediction processing according to a model input molecular structure X and outputs corresponding predicted affinity Y; the molecular structure X includes a plurality of atoms x i , 1≤atomic index i≤M, M is the total number of atoms of the molecular structure X; each of the atomic parameters of the atom x i includes an atomic type s i and atomic three-dimensional coordinates c i ; the predicted affinity Y is a real number; Collecting big data of molecular structures of organic molecules for organic photovoltaic materials and corresponding molecular affinity values through a plurality of preset public data collection channels; and collecting each molecular structure and the corresponding molecular affinity value as a corresponding first training molecular structure and a first label affinity to form a corresponding first data record; and forming a corresponding first data set from all the first data records obtained; the plurality of public data collection channels at least include a plurality of public molecular information databases and a plurality of public technical documents in the field of organic photovoltaic materials; the first data set comprises a plurality of first data records; the first data record comprises the first training molecular structure and the first label affinity; the first training molecular structure comprises a plurality of first atoms; the atomic parameters of each first atom include a first atomic type and a first atomic three-dimensional coordinate; Model training of the molecular affinity prediction model based on the first data set; After model training, receiving a first molecular structure input by a user; inputting the first molecular structure as a corresponding molecular structure X into the molecular affinity prediction model for prediction processing, and outputting the predicted affinity Y of the model in this processing as a corresponding first molecular affinity; analyzing the contribution scores of each atom in the first molecular structure to the molecular affinity to obtain a corresponding first atomic contribution score; and feeding back the first molecular affinity and all the first atomic contribution scores to the current user; the first molecular structure comprises a plurality of second atoms; the atomic parameters of each second atom include a second atomic type and a second atomic three-dimensional coordinate; The molecular affinity prediction model comprises an embedding encoding module, the Uni-Mol model and the MLP model; The embedding coding module is configured to code each atom x of the molecular structure X according to an atomic type one-hot coding rule of the Uni-Mol model to obtain a corresponding atomic one-hot coding vector es i The atomic one-hot coding vector es i is obtained by coding all the atomic one-hot coding vectors es i The atomic type coding tensor ES is composed of all the atomic one-hot coding vectors es, and a pair feature initialization coding rule of the Uni-Mol model is used to code all the three-dimensional coordinates c of the atoms of the molecular structure X i The pair coding tensor EP is obtained by pair feature initialization coding, and the atomic type coding tensor ES and the pair coding tensor EP are sent to the Uni-Mol model. The Uni-Mol model is used to extract atomic features and pairwise features according to the input atomic type encoding tensor ES and the pairwise encoding tensor EP to obtain a corresponding atomic feature tensor Q and a pairwise feature tensor P; and the atomic feature tensor Q and the pairwise feature tensor P are fused to obtain a corresponding molecular feature tensor H, which is sent to the MLP model; The MLP model is used to calculate the molecular affinity according to the input molecular feature tensor H and output the corresponding predicted affinity Y.
2. The processing method for molecular affinity analysis according to claim 1, wherein: The input end of the embedding encoding module is connected with the model input end of the molecular affinity prediction model, and the output end is connected with the input end of the Uni-Mol model; the output end of the Uni-Mol model is connected with the input end of the MLP model; and the output end of the MLP model is connected with the output end of the molecular affinity prediction model; the atomic one-hot encoded vector es i is a one-dimensional one-hot encoded vector of length D1, D1 being the total number of atom types of the molecular structure X; the atom one-hot encoded vector es i the atom x i the atom type s i corresponding one-hot encoding is set to 1, and the remaining D1-1 one-hot encodings are set to 0; the tensor shape of the atom type encoded tensor ES is D1 x M; The pair coding tensor EP is a pair coding matrix with a shape of MxM; the pair coding matrix is composed of MxM coding matrix units; each coding matrix unit is a pair coding vector with a length of D2, and D2 is a preset coding vector length; a matrix row or a matrix column of the pair coding matrix is in one-to-one correspondence with the atom x i one-to-one correspondence; The tensor shape of the atomic feature tensor Q is D3xM, D3 is a preset atomic feature dimension; the atomic feature tensor Q is specifically composed of M sub-feature vectors q i The sub-feature vector q i Corresponds to the atom x i One-to-one correspondence; The pair feature tensor P is a pair feature matrix with a shape of MxM; the pair feature matrix is composed of MxM feature matrix units; each of the feature matrix units is a pair feature vector with a vector length of D4, and D4 is a preset pair feature dimension; a matrix row or a matrix column of the pair feature matrix corresponds to the atom x i one-to-one; each matrix row of the pair feature matrix corresponds to a feature vector represented as a row feature vector pl i , and a vector length of the row feature vector pl i is D4xM, which is sequentially spliced by M pair feature vectors of the current row. The tensor shape of the molecular feature tensor H is (D3+D4xM)xM; the molecular feature tensor H is specifically composed of M eigenvectors h i The eigenvectors h i Corresponding to the atom x i One-to-one correspondence; the eigenvectors h i Spliced in sequence by the corresponding eigenvectors q i With length D4xM i And the row eigenvector pl The MLP model is specifically composed of a plurality of fully connected layers FC connected in sequence j compositions, 1≤layer index j≤N, N is a preset total number of fully connected layers, N≥3; The full connection layer FC j is expressed as: , , ; wherein y j-1 , y j are the output features of the (j-1)th and jth fully connected layers; w j , b j are the weight parameters and bias parameters of each of the fully connected layers FC j ; σ is a preset activation function, which is only used in the 1st to (N-1)th fully connected layers; for the 1st fully connected layer FC j=1 , the corresponding output feature y j-1 of the previous layer is the molecular feature tensor H output by the Uni-Mol model; for the Nth fully connected layer FC j=N , the output feature of the current fully connected layer is a real number, i.e., the predicted affinity Y.
3. The processing method for molecular affinity analysis according to claim 1, characterized in that, The model training of the molecular affinity prediction model based on the first data set specifically comprises: Step 31, dividing the first data set into two sub-data sets according to a preset first segmentation ratio, which are denoted as a corresponding first training set and a first evaluation set; The first training set and the first evaluation set are composed of a plurality of first data records; the proportion of the total number of records of the first training set and the first evaluation set meets the first split proportion; Step 32, the first first data record of the first training set is taken as a corresponding current training record; Step 33, the first training molecular structure of the current training record is taken as a corresponding molecular structure X and input into the molecular affinity prediction model for prediction processing, and the predicted affinity Y output by the model in this processing is taken as a corresponding first predicted affinity; Step 34, the first predicted affinity and the first label affinity of the current training record are taken into a preset first model loss function to obtain a corresponding first loss value; The first model loss function is realized based on an L1 loss function, a smooth L1 loss function or an L2 loss function; Step 35, whether the first loss value meets a preset first loss value range is identified; if the first loss value meets the first loss value range, whether the current training record is the last first data record of the first training set is identified, if yes, step 36 is turned to, and if no, the next first data record of the first training set is taken as a new current training record and step 33 is returned to continue training; if the first loss value does not meet the first loss value range, a round of modulation is performed on the model parameters of the molecular affinity prediction model in the direction of making the first model loss function reach a minimum value based on a preset first model optimizer, and step 33 is returned to continue training at the end of the round of modulation; The first model optimizer at least includes an Adam optimizer and an SGD optimizer; Step 36, all the first data records of the first evaluation set are traversed in a round; and in the round of traversal, the first data record currently traversed is taken as a corresponding current evaluation record; the first training molecular structure of the current evaluation record is taken as a corresponding molecular structure X and input into the molecular affinity prediction model for prediction processing, and the predicted affinity Y output by the model in this processing is taken as a corresponding second predicted affinity; and the second predicted affinity and the first label affinity of the current training record form a corresponding prediction-label pair; and at the end of the round of traversal, all the prediction-label pairs obtained are taken into a preset first model evaluation function to obtain a corresponding first evaluation value; The first model evaluation function is realized based on an MAE function, an MSE function or an RMSE function; Step 37, whether the first evaluation value meets a preset first evaluation value range is identified; if not, step 32 is returned to continue training; and if yes, the training is stopped and it is confirmed that the model training is ended.
4. The processing method for molecular affinity analysis according to claim 2, wherein, The first atomic contribution score is obtained by analyzing the contribution score of each atom in the first molecular structure to the molecular affinity, and specifically includes: Step 41, set a first counter initialized to 1; and set the corresponding first count threshold to the preset number threshold K; Step 42, the first molecular structure as the corresponding molecular structure X input the embedding encoding module of the molecular affinity prediction model to obtain the corresponding atomic type encoding tensor ES and the pair encoding tensor EP; and the atomic type encoding tensor ES and the pair encoding tensor EP obtained this time are input into the Uni-Mol model of the molecular affinity prediction model to obtain the corresponding molecular feature tensor H; and the molecular feature tensor H obtained this time is taken as the corresponding current feature tensor H now ; and each sub-feature vector h i of the molecular feature tensor H obtained this time is taken as the corresponding sub-feature vector h now,i ; Step 43, the current feature tensor H now The MLP model inputting the molecular affinity prediction model is processed, and the predicted affinity output by this processing is taken as a corresponding affinity true value z true,k ; 1≤index k≤K; Step 44, create a random noise vector ε that meets the Gaussian distribution, and the mean is 0, the standard deviation is the preset first standard deviation, and the vector shape is consistent with the vector shape of the sub-feature vector h of the molecular feature tensor H i of the sub-feature vector h of the molecular feature tensor H k ; Step 45, a round of traversal is performed on all the sub-feature vectors h now of the current feature tensor H now,i ; and during the round of traversal, the sub-feature vector h now,i being currently traversed is taken as a corresponding current vector h; a corresponding current perturbation vector h * is obtained by performing noise perturbation on the current vector h in a manner of h k = h + ε * ; and the corresponding sub-feature vector h * in the current feature tensor H now is replaced by the current perturbation vector h now,i to obtain a new feature tensor H * ; and the current feature tensor H * is input into the MLP model of the molecular affinity prediction model for processing, and a predicted affinity output by the current processing is taken as a corresponding perturbation affinity z i,k ; and the first counter is incremented by 1 at the end of the round of traversal. Step 46, identify whether the first counter is greater than the first count threshold; if yes, go to step 47; if no, return to step 42; Step 47, according to the obtained all the affinity true value z true,k and all the perturbation affinity z i,k The contribution score of each second atom in the first molecular structure is estimated to obtain the corresponding first atomic contribution score; The estimation method of the first atomic contribution score is: ; wherein score i is the first atomic contribution score corresponding to the i-th second atom in the first molecular structure.
5. An apparatus for performing the processing method for molecular affinity analysis according to any one of claims 1 to 4, characterized in that, The device comprises a model construction module, a data acquisition module, a model training module and a model application module; The model construction module is configured to construct a molecular affinity prediction model in a manner that the Uni-Mol model is used as an encoder and an MLP model is used as an encoder downstream regression calculation task model; the molecular affinity prediction model is configured to perform molecular affinity prediction processing according to a molecular structure X input by the model and output a corresponding predicted affinity Y; the molecular structure X includes a plurality of atoms x i , 1≤atomic index i≤M, M is the total number of atoms of the molecular structure X; each atomic parameter of the atom x i includes an atomic type s i and atomic three-dimensional coordinates c i ; the predicted affinity Y is a real number; The data acquisition module is used for collecting big data of molecular structures of organic molecules of organic photovoltaic materials and corresponding molecular affinity values through a plurality of preset public data acquisition channels; and each molecular structure and the corresponding molecular affinity value collected are used as a corresponding first training molecular structure and a first label affinity to form a corresponding first data record; and all the first data records obtained form a corresponding first data set; the plurality of public data acquisition channels at least include a plurality of public molecular information databases and a plurality of public technical literatures in the field of organic photovoltaic materials; the first data set comprises a plurality of first data records; the first data record comprises the first training molecular structure and the first label affinity; the first training molecular structure comprises a plurality of first atoms; the atomic parameters of each first atom include a first atomic type and a first atomic three-dimensional coordinate; The model training module is used for model training of the molecular affinity prediction model based on the first data set; The model application module is used for receiving a first molecular structure input by a user after the model training is completed; and inputting the first molecular structure as the corresponding molecular structure X into the molecular affinity prediction model for prediction processing and outputting the predicted affinity Y of the model this time as the corresponding first molecular affinity; and analyzing the contribution score of each atom in the first molecular structure to the molecular affinity to obtain the corresponding first atomic contribution score; and feeding back the first molecular affinity and all the first atomic contribution scores obtained to the current user; the first molecular structure comprises a plurality of second atoms; the atomic parameters of each second atom include a second atomic type and a second atomic three-dimensional coordinate.
6. An electronic device, comprising: Comprise: Memory, processor and transceiver; The processor is used for coupling with the memory, reading and executing instructions in the memory, so as to realize the method of any one of claims 1-4; The transceiver is coupled with the processor, and the transceiver is controlled by the processor to perform message transceiving.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores computer instructions, when the computer instructions are executed by the computer, the computer executes the method of any one of claims 1-4. The computer readable storage medium stores computer instructions, when the computer instructions are executed by the computer, the computer executes the method of any one of claims 1-4.
Citation Information
Patent Citations
Method and device for processing affinity prediction data of MHC molecules and polypeptides
CN116386761A
Antibody-antigen affinity prediction method, device and system and storage medium
CN118629501A