Method for discriminating group to be protected in chemical reaction based on attention network

Through deep learning model based on attention network, the groups to be protected in chemical reactions are identified, and the problems of insufficient accuracy and efficiency in the prior art are solved, and the accurate prediction of protected groups and the efficiency improvement of chemical reaction research are achieved.

CN119517225APending Publication Date: 2025-02-25SHAANXI EXQUISITE TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411517832.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When identifying groups to be protected in chemical reactions, the prior art lacks accuracy and efficiency, and cannot be automatically identified, limiting the efficiency and success rate of chemical synthesis.

Method used

The deep learning model based on attention network is adopted, including feature extraction module, feature reconstruction module, combined feature building module and discriminator, and the complex interaction characteristics between atoms are captured through the self-attention layer and the graph attention network layer, and non-linear transformation is performed through a multi-layer perceptron to output the discrimination results of the groups to be protected by chemical reactions.

Benefits of technology

It realizes accurate prediction of protecting groups, improves the research efficiency of chemical reactions, simplifies the research process, fills the gaps in the current research, and provides effective guidance for reverse synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119517225A_ABST
    Figure CN119517225A_ABST
Patent Text Reader

Abstract

The invention provides a chemical reaction to-be-protected group distinguishing method based on an attention network. The technical problem that an existing to-be-protected group distinguishing method is insufficient in accuracy and efficiency is solved. By constructing the deep learning model based on the self-attention layer, the graph attention network and the multi-layer perceptron, the complex interaction characteristics of the to-be-protected group in the chemical reaction can be automatically extracted and learned, and the pre-discrimination accuracy of the to-be-protected group is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer-aided drug development, and in particular relates to a method for identifying protected groups in chemical reactions based on an attention network. Background Art

[0002] In the process of chemical synthesis and drug development, it is crucial to identify the groups to be protected in chemical reactions. The groups to be protected refer to functional groups that may be adversely affected in the reaction or require temporary protection to avoid interference. Accurately identifying these groups can help chemists determine in advance which groups need to be protected during the reaction process in retrosynthetic design, thereby effectively adjusting the reaction route, avoiding unnecessary trial and error, and improving research efficiency and the reliability of results.

[0003] Current research focuses on the use of protecting groups to achieve selective reactions in chemical synthesis. Protecting groups can temporarily mask active groups in molecules to prevent them from participating in reactions under inappropriate reaction conditions. For example, amino groups can be converted to carbamates, thereby reducing their reactivity (Welcome to Bentham Science Publisher). However, traditional protecting group strategies often require additional steps to achieve protection and deprotection, which increases the complexity and cost of the synthesis (Organic Chemistry Portal).

[0004] In recent years, researchers have developed a variety of new protecting group technologies, including photoremovable protecting groups and other environmentally sensitive protecting groups (Springer). These technologies have shown great potential in improving reaction selectivity, simplifying synthesis steps, and reducing environmental impact. However, despite these significant advances, there is still a lack of a tool that can automatically and efficiently identify the groups to be protected.

[0005] Currently, the work of identifying the groups to be protected mainly relies on the experience and theoretical knowledge of chemists. However, as the complexity of the target molecules increases, the traditional methods are insufficient in accuracy and efficiency. Existing methods cannot automatically identify the groups to be protected, which limits the efficiency and success rate of chemical synthesis. In addition, the selection and use of protecting groups need to comprehensively consider their stability, deprotection conditions and the impact on other functional groups, which further increases the difficulty of design and implementation (Organic Chemistry Portal).

[0006] To this end, the present invention proposes a method for identifying the protected groups in chemical reactions based on an attention network. Summary of the invention

[0007] The purpose of the present invention is to solve the technical problems that the existing methods for identifying protected groups are insufficient in accuracy and efficiency, and to provide a method for identifying protected groups in chemical reactions based on an attention network. The method aims to train a friendly deep learning model to complete the pre-identification of protected groups in chemical reactions, provide guidance for chemical research (such as retrosynthesis), and fill the gap in current research.

[0008] To achieve the above purpose, the technical solution provided by the present invention is:

[0009] A chemical reaction protected group discrimination model based on an attention network, which is special in that: from input to output, it includes a feature extraction module, a feature reconstruction module, a combined feature construction module and a discriminator;

[0010] The feature extraction module is used to construct the initial features of each atom in each reactant involved in the chemical reaction;

[0011] The feature reconstruction module includes a self-attention layer, a graph attention network layer (i.e., a GAT layer), and a splicing layer, which are used to reconstruct the initial features of each atom output by the feature extraction module, aggregate the information of each atom and other atoms around it (such as: information of neighbors or second-order neighbors), and then construct its new features (i.e., increase the correlation between the atom and its neighbor atoms);

[0012] The combined feature building module is used to splice new features of any two atoms in all reactants involved in the chemical reaction to form multiple groups of spliced ​​features;

[0013] The discriminator includes a hidden layer and an output layer from input to output, which is used to perform nonlinear transformation on each splicing feature and output the discrimination result of the chemical reaction group to be protected (i.e., which atoms undergo chemical reaction and which atoms do not undergo chemical reaction); wherein the hidden layer is a multilayer perceptron (MLP) with L layers.

[0014] Furthermore, in the present invention, the feature extraction module can adopt an existing feature extraction module, whose input is data in the chemical molecule smiles format. After extracting features through rdkit, the initial features of atoms are constructed by splicing, that is, all features of atoms are spliced; the specific processing process is as follows:

[0015] The reactant chemical molecules are processed into the standard smiles format as input, and the following features are extracted for each atom in the reactant chemical molecules, and all features are concatenated into a feature vector to form the initial features of the atom:

[0016] ① One-Hot encoding is used to represent the type of each atom, with a characteristic length of 23 dimensions;

[0017] ② Calculate the degree of each atom, with a characteristic length of 1 dimension;

[0018] ③ Determine whether the atom belongs to an aromatic ring, represented by 0 or 1, with a characteristic length of 1 dimension;

[0019] ④ Calculate the number of hydrogen atoms connected to the atom, with a characteristic length of 1 dimension;

[0020] ⑤ Calculate the charge carried by the atom, with a characteristic length of 1 dimension;

[0021] ⑥ Count the atomic mass of the atom, with a characteristic length of 1 dimension;

[0022] ⑦ Statistical analysis of the electronegativity of the atom, with a characteristic length of 1 dimension;

[0023] After splicing, the length of the feature vector of each atom is the sum of the lengths of the above features, 29 dimensions.

[0024] Furthermore, the specific processing process of the feature reconstruction module is as follows:

[0025] ① Use the self-attention layer to capture the correlation between the target atom and other atoms:

[0026] Calculate the Query, Key, and Value matrices

[0027] For the input sequence (the set of all atoms of the reactant chemical molecules) the set of all atoms Where n is the number of atoms and d is the dimension of each atomic feature, which is first mapped to the Query, Key, and Value matrices through three different weight matrices:

[0028] Q=XW Q ,K=XW K ,V=XW V

[0029] Where X is the initial characteristic of the atom, is a trainable weight matrix; d k is the dimension after the original feature transformation;

[0030] Calculating attention weights

[0031] The attention weights are calculated using the dot product between the query and the key, and are scaled and softmax normalized:

[0032]

[0033] in, is the scaling factor, is the attention weight matrix;

[0034] Calculating self-attention output

[0035] Use the attention weight matrix and the Value matrix to calculate the output:

[0036]

[0037] in, is the output of the self-attention layer; then Represents the features of atom i after being updated by the self-attention layer;

[0038] In summary, the input of the self-attention layer is the set of initial features of chemical molecular atoms output by the feature extraction module, and the output is the features updated by the self-attention layer;

[0039] ② Use the graph attention network layer to capture the attention of the target atom to its neighbor atoms:

[0040] For each chemical molecule of the input reactant, based on the chemical bonds between atoms, the chemical molecule needs to be converted into a topological graph before entering the graph attention network layer;

[0041] Node feature linear transformation

[0042] For each node i in the topological graph (i.e. each atom of a chemical molecule) and its eigenvector First, a linear transformation is performed through a trainable weight matrix:

[0043] x′ i =Wx i

[0044] in, is a trainable weight matrix, is the transformed eigenvector of atom i;

[0045] Calculate the attention coefficient

[0046] For each pair of adjacent nodes i and j, Represents the set of neighbor atoms of atom i and calculates the attention coefficient:

[0047] e ij =LeakyReLU(a T [x′ i ∥x j ′])

[0048] in, is a trainable weight vector, || represents a vector concatenation operation, and LeakyReLU is an activation function;

[0049] Compute weighted sum of atomic features

[0050] Use the normalized attention coefficient to weighted sum the features of neighbor atoms to obtain the new feature representation of atom i:

[0051]

[0052] Where σ is the activation function (such as ReLU); Represents the features of atom i after being updated by the graph attention network layer; x j ′ is the transformed eigenvector of atom j;

[0053] In summary, the input of the graph attention network layer is the set of initial features of chemical molecule atoms output by the feature extraction module and the topological map transformed by the target chemical molecule, and the output is the features updated by the graph attention network layer;

[0054] ③ Get new features for each atom through splicing

[0055] The feature representations updated by the self-attention layer and the graph attention network layer are concatenated to obtain the new features after atom i is reconstructed, as follows:

[0056]

[0057] There is no obvious time sequence between ① and ② above.

[0058] Furthermore, the specific processing process of the combined feature construction module is as follows:

[0059] Assume that there are two atoms A and B. After feature extraction and feature reconstruction, their new feature vectors are simplified as and

[0060] The new feature vectors of any two atoms in all reactants involved in the chemical reaction are spliced ​​together to form the spliced ​​sample feature h AB :

[0061] h AB =h A ∥h B

[0062] in, and Respectively represent the new feature vectors of atom A and atom B; || represents the concatenation operation of vectors, F is the dimension after reconstruction of each atomic feature. In this process, multiple sets of spliced ​​sample features can be formed. During the splicing process, it should be ensured that the atoms with small atomic mass are on the left and the atoms with large atomic mass are on the right to prevent the order differences in different molecules.

[0063] Furthermore, the specific processing process of the discriminator is as follows:

[0064] ① Combine the features to construct the sample features obtained by the combined feature building module Input to a multi-layer perceptron with L layers;

[0065] The number of neurons in each layer is m1, m2, ..., m L , the calculation of each layer is as follows:

[0066] Layer 1, i.e. the initial input layer to the first hidden layer:

[0067] h (1) =σ(W (1) h AB +b (1) )

[0068] in, is the weight matrix of layer 1, is the bias vector of the first layer, σ is the activation function, such as ReLU, Sigmoid, etc.;

[0069] …

[0070] The lth layer, that is, the l-1th hidden layer to the lth hidden layer:

[0071] h (l) =σ(W (l) h (l-1) +b (l) )

[0072] in, is the weight matrix of the lth layer, is the bias vector of the lth layer;

[0073] ② Map the output of the last hidden layer to the output layer into 1 dimension to get the prediction result

[0074]

[0075] in, is the weight matrix of the output layer, is the bias vector of the output layer.

[0076] At the same time, the present invention provides a method for distinguishing protected groups in chemical reactions based on an attention network, the special feature of which is that all reactant chemical molecules in the chemical reaction to be distinguished are input into the trained model for distinguishing protected groups in chemical reactions based on the attention network, and the distinguishing results of protected groups in chemical reactions are output.

[0077] Furthermore, the chemical reaction protected group discrimination model based on the attention network is trained according to the following method:

[0078] 1) Collect chemical reaction data and process them into a standard format. Since chemical reaction data come from different sources, the formats may be different. Therefore, after collecting the data, the format should be unified first. Label the two atoms that can and cannot react between the reactants in the chemical reaction to form positive samples and negative samples.

[0079] 2) inputting all the reactant chemical molecules in the chemical reaction collected in step 1) into the attention network-based chemical reaction protected group discrimination model, and outputting the prediction result;

[0080] 3) A cross-entropy loss function is used to calculate the loss between the prediction result of step 2) and the true label of step 1), and the trainable parameters in the model are updated through negative feedback adjustment according to the loss residual to obtain a trained chemical reaction protected group discrimination model.

[0081] Furthermore, in step 1), the chemical reaction data is collected from USPTO, Reaxys, chemical books, web pages or papers; it contains 13k data, which need to be uniformly processed into the standard SMILES format for the convenience of computer recognition and calculation;

[0082] If two atoms can react, it is a positive sample, marked as y=1; otherwise, it is a negative sample, marked as y=0;

[0083] Step 3) is specifically:

[0084] Use the cross entropy loss function to calculate the prediction results The loss between y and the true label y;

[0085] For the binary classification problem, the formula of the cross entropy loss function is:

[0086]

[0087] in:

[0088] y is the true label, which takes the value of 0 or 1;

[0089] is the predicted probability of the model, and its value range is [0,1].

[0090] At the same time, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and the steps of the above method are implemented when the computer program is executed by a processor. And an electronic device, including a processor and a computer-readable storage medium; similarly, the computer-readable storage medium stores a computer program, and the steps of the above method are implemented when the computer program is executed by the processor.

[0091] Concept and principle of the present invention:

[0092] The present invention automatically extracts and learns the complex interaction characteristics of the protected groups in chemical reactions by constructing a deep learning model based on a self-attention layer, a graph attention network (GAT) and a multi-layer perceptron (MLP). First, a graph attention network is used to capture the correlation between atoms and their neighbors, and the node features are weighted and summed by the attention coefficient. Then, the feature vectors of any two atoms are spliced ​​to generate spliced ​​sample features; then, the spliced ​​feature vectors are input into a multi-layer perceptron for nonlinear transformation, and finally the prediction results are output. During training, the model calculates the loss between the predicted results and the true labels through a cross-entropy loss function, and uses back propagation and gradient descent methods to update the model parameters. After multiple trainings, the model is continuously optimized to achieve accurate judgment of the protected groups, provide guidance for chemical research (such as retrosynthesis), and fill the gap in current research.

[0093] Advantages of the present invention:

[0094] The present invention proposes a chemical reaction protected group discrimination model based on an attention network, which can accurately capture and learn the complex interactions between atoms and improve the accuracy of pre-discrimination of protected groups. The method has a high degree of automation and does not require a large amount of manual feature engineering, which greatly simplifies the research process. Its wide applicability makes it suitable for the prediction and retrosynthesis of various chemical reactions, filling the gap in current research and providing new tools and methods for chemical research. Through automated and efficient deep learning models, the research efficiency is significantly improved. In addition, the cross entropy loss function and back propagation algorithm are used, combined with multiple training and parameter optimization to ensure that the model performance is optimal. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] Figure 1 It is the overall training and prediction flow chart of the present invention;

[0096] Figure 2 It is a flow chart for constructing a discrimination model for the group to be protected in a chemical reaction in the present invention; DETAILED DESCRIPTION

[0097] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:

[0098] The present invention proposes a discriminant model and a discriminant method for chemical reaction protected groups based on an attention network. The model includes a feature extraction module, a feature reconstruction module, a combined feature construction module and a discriminator from input to output. The feature extraction module is used to construct the initial features of each atom in each reactant involved in the chemical reaction; the feature reconstruction module is used to reconstruct the initial features of each atom output by the feature extraction module, and to construct its new features after aggregating the information of each atom and other atoms around it; the combined feature construction module is used to splice the new features of any two atoms in all reactants involved in the chemical reaction to form multiple groups of spliced ​​features; the discriminator is used to perform nonlinear transformation on each spliced ​​feature and output the discrimination result of the chemical reaction protected group.

[0099] The present invention can be used to discriminate the protected groups in chemical reactions. After testing, it has high accuracy, which provides a certain basis for the development of subsequent chemical reaction protecting group identification work. An embodiment of a chemical reaction protected group discrimination model and discrimination method based on an attention network proposed by the present invention is as follows:

[0100] First, the discriminant model is trained to improve its discrimination accuracy.

[0101] For the raw data, the present invention uses the algorithm for reading chemical reactions in Rdkit to organize the collected chemical reaction data, processes all chemical reaction data into unified standard Smiles type data, and then converts the compound into graph data according to the topological relationship between atoms in the target molecule. At the same time, the original features of each atom are constructed.

[0102] For each molecule’s graph data, the feature reconstruction module is used to reconstruct the initial features of the atoms in combination with the original features of the atoms. Specifically, the feature reconstruction module includes a self-attention layer, a graph attention network layer, and a splicing layer.

[0103] Using the reconstructed atoms, the feature splicing method is adopted to construct the features corresponding to the positive and negative samples (before this, after collecting the data, the two atoms that can and cannot react chemically between the reactants in the chemical reaction can be labeled to form positive and negative samples).

[0104] Next, a multi-layer perceptron is used to map the key features to obtain the calculation results.

[0105] Finally, the cross entropy loss function is used to calculate the loss between the result and the true label, and the parameters in the model are trained through negative feedback adjustment based on the loss residual.

[0106] After the training is completed, a model for identifying protected groups in chemical reactions based on an attention network is obtained.

[0107] In order to evaluate the performance of the model, the present invention uses a five-fold cross-validation method to calculate the accuracy of the model in identifying the group to be protected on the test set. The test results are shown in Table 1:

[0108] Table 1 Performance display of chemical reaction protection group identification model

[0109]

[0110] It can be seen from the test results that the present invention has a high accuracy rate for identifying the protected groups in chemical reactions, wherein the accuracy rate of multi-class mixed data identification reaches 0.861, which has a significant effect.

[0111] In summary, the method of the present invention can automatically extract and learn the complex interaction characteristics of the protected groups in chemical reactions; the model uses the attention mechanism to calculate the correlation between atoms, and is trained and optimized through the cross-entropy loss function to achieve accurate prediction of the protected groups. This method not only improves the accuracy of recognition, but also significantly simplifies the research process, reduces dependence on manual experience, provides effective guidance for chemical research such as retrosynthesis, and fills the gap in current research; this innovation is of great significance in improving the efficiency of chemical synthesis, reducing costs and promoting the development of new drugs.

Claims

1. A model for identifying protected groups in chemical reactions based on an attention network, characterized in that: From input to output, it includes feature extraction module, feature reconstruction module, combined feature construction module and discriminator; The feature extraction module is used to construct the initial features of each atom in each reactant involved in the chemical reaction; The feature reconstruction module includes a self-attention layer, a graph attention network layer, and a splicing layer, which are used to reconstruct the initial features of each atom output by the feature extraction module, and to construct a new feature of each atom after aggregating the information of each atom and other atoms around it; The combined feature building module is used to splice new features of any two atoms in all reactants involved in the chemical reaction to form multiple groups of spliced ​​features; The discriminator includes a hidden layer and an output layer from input to output, which is used to perform nonlinear transformation on each splicing feature and output the discrimination result of the chemical reaction group to be protected; wherein the hidden layer is a multilayer perceptron with L layers.

2. The chemical reaction protected group discrimination model based on the attention network according to claim 1, characterized in that: The specific processing process of the feature extraction module is as follows: For each atom in the reactant chemical molecule, the following features are extracted and all features are concatenated into a feature vector to form the initial features of the atom: ① One-Hot encoding is used to represent the type of each atom, with a characteristic length of 23 dimensions; ② Calculate the degree of each atom, with a characteristic length of 1 dimension; ③ Determine whether the atom belongs to an aromatic ring, represented by 0 or 1, with a characteristic length of 1 dimension; ④ Calculate the number of hydrogen atoms connected to the atom, with a characteristic length of 1 dimension; ⑤ Calculate the charge carried by the atom, with a characteristic length of 1 dimension; ⑥ Count the atomic mass of the atom, with a characteristic length of 1 dimension; ⑦ Statistical analysis of the electronegativity of the atom, with a characteristic length of 1 dimension; After splicing, the length of the feature vector of each atom is the sum of the lengths of the above features, 29 dimensions.

3. The chemical reaction protected group discrimination model based on the attention network according to claim 2, characterized in that: The specific processing process of the feature reconstruction module is as follows: ① Use the self-attention layer to capture the correlation between the target atom and other atoms: Calculate the Query, Key, and Value matrices For the set of all atoms in the input sequence Where n is the number of atoms and d is the dimension of each atomic feature, which is first mapped to the Query, Key, and Value matrices through three different weight matrices: Where X is the initial characteristic of the atom, is a trainable weight matrix; d k is the dimension after the original feature transformation; Calculating attention weights The attention weights are calculated using the dot product between the query and the key, and are scaled and softmax normalized: in, is the scaling factor, is the attention weight matrix; Calculating self-attention output Use the attention weight matrix and the Value matrix to calculate the output: in, is the output of the self-attention layer; then Represents the features of atom i after being updated by the self-attention layer; ② Use the graph attention network layer to capture the attention of the target atom to its neighbor atoms: For each chemical molecule of the input reactant, based on the chemical bonds between atoms, the chemical molecule needs to be converted into a topological graph before entering the graph attention network layer; Node feature linear transformation For each node i and its eigenvector in the topology graph First, a linear transformation is performed through a trainable weight matrix: x′ i =Wx i in, is a trainable weight matrix, is the transformed eigenvector of atom i; Calculate the attention coefficient For each pair of adjacent nodes i and j, Represents the set of neighbor atoms of atom i and calculates the attention coefficient: e ij =LeakyReLU(a T [x′ i ||x′ j ]) in, is a trainable weight vector, || represents a vector concatenation operation, and LeakyReLU is an activation function; Compute weighted sum of atomic features Use the normalized attention coefficient to weighted sum the features of neighbor atoms to obtain the new feature representation of atom i: Where σ is the activation function; Represents the features of atom i after being updated by the graph attention network layer; x′ j is the transformed eigenvector of atom j; ③ Get new features for each atom through splicing The feature representations updated by the self-attention layer and the graph attention network layer are concatenated to obtain the new features after atom i is reconstructed, as follows:

4. The chemical reaction protected group discrimination model based on the attention network according to claim 3, characterized in that: The specific processing process of the combined feature construction module is as follows: The new feature vectors of any two atoms in all reactants involved in the chemical reaction are spliced ​​together to form the spliced ​​sample feature h AB : h AB =h A ||h B in, and Respectively represent the new feature vectors of atom A and atom B; || represents the concatenation operation of vectors, F is the dimension after reconstruction of each atomic feature.

5. The chemical reaction protected group discrimination model based on the attention network according to claim 4, characterized in that: The specific processing process of the discriminator is as follows: ① Combine the features to construct the sample features obtained by the combined feature building module Input to a multi-layer perceptron with L layers; The number of neurons in each layer is m1, m2, ..., m L , the calculation of each layer is as follows: Layer 1, i.e. the initial input layer to the first hidden layer: h ⑴ =σ(w (1) h AB +b (1) in, is the weight matrix of layer 1, is the bias vector of layer 1, σ is the activation function; …… The lth layer, that is, the l-1th hidden layer to the lth hidden layer: in, is the weight matrix of the lth layer, is the bias vector of the lth layer; ② Map the output of the last hidden layer to the output layer into 1 dimension to get the prediction result in, is the weight matrix of the output layer, is the bias vector of the output layer.

6. A method for identifying protected groups in chemical reactions based on an attention network, characterized in that: All reactant chemical molecules in the chemical reaction to be identified are input into the trained chemical reaction protected group identification model based on the attention network as described in any one of claims 1 to 5, and the identification result of the chemical reaction protected group is output.

7. The method for identifying protected groups in chemical reactions based on an attention network according to claim 6, characterized in that: The chemical reaction protected group discrimination model based on the attention network is trained according to the following method: 1) Collect chemical reaction data and process them into a standard format. Label the two atoms that can and cannot react between the reactants in the chemical reaction to form positive and negative samples. 2) inputting all the reactant chemical molecules in the chemical reaction collected in step 1) into the attention network-based chemical reaction protected group discrimination model, and outputting the prediction result; 3) A cross entropy loss function is used to calculate the loss between the prediction result of step 2) and the true label of step 1), and the trainable parameters in the model are updated through negative feedback adjustment according to the loss residual to obtain a trained chemical reaction protected group discrimination model.

8. The method for identifying protected groups in chemical reactions based on an attention network according to claim 7, characterized in that: In step 1), the chemical reaction data are collected from USPTO, Reaxys, chemical books, web pages or papers; and are uniformly processed into a standard SMILES format; If two atoms can react, it is a positive sample, marked as y=1; otherwise, it is a negative sample, marked as y=0; Step 3) is specifically: Use the cross entropy loss function to calculate the prediction results The loss between y and the true label y; For the binary classification problem, the formula of the cross entropy loss function is: in: y is the true label, which takes the value of 0 or 1; is the predicted probability of the model, and its value range is [0,1].

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 6 are implemented.

10. An electronic device, characterized in that: comprising a processor and a computer readable storage medium; The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to claim 6 are executed.