Variable position Markush molecular structure identification method and system based on atomic adjacency matrix

By constructing a site-variable Markush molecular structure diagram and using the maximum substructure search algorithm and image-to-sequence generation model, the problem of difficult to identify complex variable position Markush molecular structures in the prior art is solved, and accurate identification of these structures and generation of multiple SMILES representations are achieved.

CN119889472APending Publication Date: 2025-04-25EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411977832.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify and process complex variable position Markush molecular structure diagrams, especially when generating multiple similar SMILES representations.

Method used

By constructing a Markush molecular structure diagram with variable positions, and using the maximum substructure search algorithm to obtain atomic adjacency matrix sequence information, combining the image to sequence generation model, training the translation model to generate a fixed and variable structure atomic adjacency matrix sequence, thereby obtaining all possible SMILES representations.

Benefits of technology

It effectively overcomes the complexity of learning tasks caused by SMILES representation, improves the accuracy and consistency of molecular structure recognition, and can handle variable position molecular structure information that cannot be processed by traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119889472A_ABST
    Figure CN119889472A_ABST
Patent Text Reader

Abstract

The invention discloses a variable position Markush molecular structure identification method and system based on an atomic adjacency matrix, and the corresponding method comprises the steps: 1) constructing a variable position Markush molecular structure diagram, and generating a corresponding atomic adjacency matrix sequence; 2) training on a variable position Markush molecular structure diagram-atomic adjacency matrix sequence data pair to obtain a translation model from a picture to a sequence; and 3) inputting the Markush molecular structure diagram at the variable position into a translation model to generate a target atom adjacency matrix sequence, and reducing the target atom adjacency matrix sequence into a molecular SMILES set through a division and combination strategy. The corresponding system comprises an image preprocessing module, a molecular image coding module and a molecular SMILES generation module. According to the method, the problems of incomplete identification result and low identification accuracy of the Markush molecular structure at the variable position are effectively solved, and favorable support is provided for high-quality construction of a biological medicine patent database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for identifying variable position Markush molecular structures in optical chemical structure recognition, and to a method and system for identifying variable position Markush molecular structures based on atomic adjacency matrix sequence representation. Background Art

[0002] As the basis of chemical compounds, molecules are composed of two or more atoms bonded together by chemical bonds. Their unique chemical properties play a decisive role in specific structures. In scientific literature and databases, molecular structures are generally presented in the form of images. Although this display method is more intuitive, it still needs further conversion for machine processing and analysis. Therefore, using optical chemical structure recognition (OCSR) technology to automatically extract and parse molecular information from document images and convert it into a machine-readable text format is one of the key research directions at present.

[0003] In the research process of molecular structure recognition, early rule-based systems relied on traditional image processing techniques to work, such as binarization, line smoothing, thinning, and vectorization. These techniques divide pixel images into atoms and bonds, and then use optical character recognition (OCR) models to identify atomic labels. Later, researchers used heuristic methods to determine the type of chemical bonds (such as single bonds, double bonds, and triple bonds) by analyzing the length, width, spacing, and direction of lines, and combined the identified elements into molecular graphs. With the continuous advancement of technology, researchers proposed an Image-to-SMILES generation model, which uses convolutional neural networks to encode the input molecular images to generate hidden representations, and then decodes them through recurrent neural networks to obtain the SMILES string of the molecule. At the same time, researchers used deep learning models to identify the atoms and bonds of molecules and connect them to reconstruct molecular graphs. This graph-based reconstruction method can achieve effective training with fewer training samples when performing multiple low-level detection operations, providing a natural way to inject prior knowledge or impose chemical rules to achieve precise supervision.

[0004] However, all three methods mentioned above have their own shortcomings. The rule-based system has poor generalization ability when facing various molecular structure diagrams in real scenes, and manually designed rules are difficult to cover all types of molecular structure diagrams. The limitation of the Image-to-SMILES method is that it requires a large amount of training data, and the expression of molecular SMILES may cause similar molecules to have different string representations, which increases the complexity of the learning task. The method based on graph reconstruction requires a large amount of accurate annotation data, including the coordinate information of atoms and chemical bonds on the image, which increases the annotation cost. At the same time, the application of these three methods is mainly limited to processing ordinary molecular structure diagrams and simple Markush structure diagrams. It is impossible to process more complex Markush structure diagrams, especially those with variable position types, where an atomic structure can be connected to any position on the ring. This uncertainty indicates that the same molecular structure may have multiple molecular SMILES representations due to different connection positions of atoms on the ring.

[0005] Table 1 presents all possible SMILES representations corresponding to a variable position Markush molecular structure graph and their corresponding atomic adjacency matrix sequences. The ones shown in the square brackets are the atomic adjacency matrix sequence parts of the fixed structure, while the ones shown in the small brackets are the atomic adjacency matrix sequence parts of the variable structure. It can be observed that the differences between these molecular SMILES are quite small, so it is difficult to predict multiple similar SMILES at one time using the Image-to-SMILES method. In addition, the chemical bonds representing the variable position structures are not chemical bonds with exact chemical meanings, so the graph reconstruction-based method cannot build a model for the variable position chemical structure graph. However, it can be found from the example that all these molecular SMILES cover the same core structure, and only the structures on some rings are different. Therefore, by using the method based on the atomic adjacency matrix sequence representation, the connection positions of these different structures on the rings are identified and integrated with the fixed structure to generate all possible molecular SMILES representations. Appendix Figure 1 The figure below is the molecular structure diagram of the variable position corresponding to this example. Figure 2 It is a schematic diagram of the sequence combination of atomic adjacency matrices.

[0006] Table 1

[0007] Summary of the invention

[0008] The main purpose of the present invention is to provide a method and system for identifying variable position Markush molecular structures based on atomic adjacency matrix sequences, which solves the problems in the prior art of being unable to identify variable position Markush molecular structures in different chemical literatures and incomplete identification results, thereby promoting the construction of a biopharmaceutical patent database.

[0009] The specific technical solution for achieving the purpose of the present invention is:

[0010] A variable position Markush molecular structure recognition method based on atomic adjacency matrix, the method comprising the following steps:

[0011] Step 1: Use the SMILES form of the molecule to construct a position-variable Markush molecular structure graph, and obtain the atomic adjacency matrix sequence information of the position-variable Markush molecular structure graph according to the maximum substructure search algorithm, including the atomic adjacency matrix information of the fixed structure and the atomic adjacency matrix information of the variable structure;

[0012] Step 2: Using the image-to-sequence generation model, the position-variable Markush molecular structure diagram obtained in step 1 is input into the visual image encoder, and the vector representation obtained after image encoding is input into the sequence decoder. The corresponding fixed structure and variable structure atomic adjacency matrix sequences are used as generation targets for training, and the translation model F including the image encoder and sequence decoder is obtained. θ ; Update the parameters of the encoder and decoder using the gradient descent method;

[0013] Step 3: Input the Markush molecular structure image of the variable position to be identified into the translation model F obtained in step 2 θ The atomic adjacency matrix sequences of fixed structures and variable structures are obtained, and the atomic adjacency matrix sequences of variable structures and fixed structures are divided and combined to obtain the SMILES corresponding to the Markush molecular structure diagrams of all variable positions.

[0014] Furthermore, the step 1 specifically includes the following steps:

[0015] Step a1: Construct a Markush molecular structure diagram containing variable positions; first, collect the SMILES form of the molecular formula and the corresponding molecular image pairs (s i , p i ), and use the chemical toolkit Rdkit to p i Render to vector graphics format; then create a list F = {f1, f2, ..., f 100}; For each SMILES string s i Scan, identify and record the position set P(f j )={(m,n)|s i [m:n] = f j}, where m is s i The mth position index of , n is s iThe nth position index of ; Use random probability q to decide whether to replace the functional group with the R group form; Specifically, for each functional group f at position (m, n) j If the functional group is located on the ring structure, it is replaced by the R group with probability q, and the new SMILES expression is obtained: s′ i =s i [0:m]+R k +si[n+|f j |:len(s i )] Among them, R k Selected from a group of R group forms; since each s i Will be updated multiple times, so s i It is a collection of multiple replaced SMILES; finally, virtual bonds are added to the vector map and connected to the R group, rendering it as a Markush molecular structure diagram with variable positions I i ;

[0016] Step a2: Obtain atomic adjacency matrix sequence information; for each SMILES expression set s in step a1 i , use the maximum substructure search algorithm to identify its largest common substructure, that is, the fixed structure, denoted as A fied , and extract the information of atoms and bonds, and generate an adjacency matrix sequence representation A fixed : A fixed= (i, atom i ,j,atom j , bond ij ) where i and j are atom numbers, atom i and atom j is the atomic label, bond ij is the chemical bond type; then, from each s i Remove the atomic and chemical bond information related to A fixed The same information, the rest is the information of atoms and chemical bonds of the variable structure, recorded as A var : A var =(i, atom i ,j,atom j , SPECIAL); the chemical bond type is marked as "SPECIAL" to indicate the chemical bond of the variable position structure, and ensure that all atom numbers are unique in the entire molecular diagram; A fixed and A var The atomic adjacency matrix sequence A is composed.

[0017] Further, the step 2 specifically includes the following steps:

[0018] Step b1: The variable position Markush molecular structure diagram I obtained in step 1i As input, the visual image encoding model SwinTransformer is used to encode the image and obtain the vector representation V of the global structural information containing the variable position Markush molecular structure diagram i ;

[0019] Step b2: The vector representation V of the global structure information of the variable position Markush molecular structure diagram obtained in step b1 i As the input of the sequence decoder, the corresponding atomic adjacency matrix sequence A is generated in an autoregressive manner i ;

[0020] Step b3: Use the cross entropy loss function and the gradient descent method to optimize the model parameters to obtain the trained model F θ .

[0021] Further, the step three specifically includes the following steps:

[0022] Step c1: The Markush molecular structure image I of the variable position to be identified q Input the translation model F obtained in step 2 θ , get the fixed structure atomic adjacency matrix sequence information of the target molecule and variable structure atomic adjacency matrix sequence information

[0023] Step c2: Traverse the atomic adjacency matrix sequence of the variable structure For each record, namely, atom number, atom label, atom number, atom label and chemical bond type, it is compared with the atomic adjacency matrix sequence information of the fixed structure. Combine to obtain the atomic adjacency matrix sequence set of the complete molecular structure where k is The total number of records in Then create an empty molecular structure instance mol, and then traverse For each record in , if it is an atom number, it is necessary to check whether the atom corresponding to this atom number in mol has been successfully created. If not, then create the corresponding atom instance in mol according to the atom label information following the atom number; if the atom already exists in mol, then directly skip this atom number and the atom label following it, and continue to process the next record; and when traversing to the chemical bond type, it is necessary to determine whether the type of this chemical bond is "SPECIAL"; if the chemical bond type is "SPECIAL", then add a "SINGLE" chemical bond between the corresponding two atom instances in mol; if it is not the "SPECIAL" type, then add the chemical bond type corresponding to the record between the corresponding two atom instances in mol; after processing After all the records in the collection are collected, the chemical toolkit Rdkit is used to generate the corresponding SMILES according to the mol structure; Each of After the above processing, all SMILES corresponding to the Markush molecular structure diagram at the variable position are obtained.

[0024] A variable position Markush molecular structure recognition system based on the atomic adjacency matrix based on the above method, comprising an image preprocessing module, a molecular image encoding module and a SMILES generation module;

[0025] The image preprocessing module, based on existing image processing tools, performs cropping, normalization, and filtering operations on molecular structure images in real scenes to meet the needs of model reasoning;

[0026] The molecular image encoding module, based on a visual image encoder, encodes the variable position Markush molecular structure image into a vector representation with global structure information;

[0027] The molecular SMILES generation module uses a sequence decoder to decode the vector representation containing global structure information to obtain the atomic adjacency matrix sequence of the target molecular structure; divides the atomic adjacency matrix sequence into atomic adjacency matrix sequences of fixed structure and variable structure, and combines the variable structure sequence with the fixed structure sequence in sequence, and obtains all molecular SMILES through Rdkit.

[0028] The differences between the present invention and the prior art are as follows: (1) Compared with the traditional image-to-sequence method, the present invention combines the existing natural language processing technology to convert the SMILES text sequence representation of molecules into an atomic adjacency matrix that describes the internal atomic and chemical bond relationships of the molecule. This method effectively overcomes the limitation of the SMILES representation method that may cause completely different character strings to be incorrectly mapped to similar molecules in learning tasks, thereby improving the accuracy and consistency of molecular representation. (2) Compared with the method based on graph reconstruction, the present invention does not rely on the coordinate position information of atoms and chemical bonds in the molecular graph, thereby alleviating the complexity problem in the data annotation process to a certain extent. In addition, by covering all potential positions of variable position chemical bonds in molecular structures such as benzene rings in the atomic adjacency matrix, the present invention can effectively deal with the problem of variable position structural information that cannot be handled by traditional graph reconstruction methods.

[0029] The beneficial effects of the present invention include: the present invention proposes a variable position Markush molecular structure recognition method and system based on atomic adjacency matrix sequence representation, which converts the SMILES text sequence representation of molecules into an atomic adjacency matrix that describes the internal atomic and chemical bond relationships of the molecule. This method effectively overcomes the limitation of the SMILES representation method that incorrectly maps completely different character strings to similar molecules in learning tasks, thereby improving the accuracy of molecular structure recognition. The present invention can effectively deal with variable position molecular structure information that cannot be processed by traditional methods, and provides more comprehensive tools and support for molecular structure analysis and related research. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The variable position molecular structure diagram in the background technology of the present invention;

[0031] Figure 2 is the atomic adjacency matrix combination graph in the background technology of the present invention;

[0032] Figure 3 A flowchart of the method according to an embodiment of the present invention;

[0033] Figure 4 Schematic diagram of a system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The present invention is further described in detail with reference to the following specific examples and drawings. The process, conditions, experimental methods, etc. for implementing the present invention, except for the contents specifically mentioned below, are all common knowledge and common common sense in the art and are not particularly limited by the present invention.

[0035] The definitions of the professional terms involved in this invention are as follows:

[0036] Molecule: refers to a stable structure formed by atoms connected by chemical bonds. It is one of the basic building blocks of matter and has a clear chemical composition and spatial structure.

[0037] Simplified Molecular Input Line Entry System (SMILES): A concise text format for representing chemical molecular structures by using strings to describe the atoms of a molecule and how they are connected.

[0038] Markush Structure: A special way of describing chemical structures used to describe compounds with a common core structure but with variable or substitutable groups in certain parts. These structures provide a broad and flexible way of describing chemistry that covers many potential compounds by allowing different groups or atoms to be substituted at specific positions.

[0039] Variable Position Markush Structure: A more flexible way to describe chemical structures that expands the concept of Markush structure. In this representation, specific groups or atoms of a compound can be replaced or moved in multiple possible positions, rather than just replacing different groups.

[0040] Adjacency Matrix: A square matrix used to describe the structure of a graph, where the rows and columns correspond to the nodes of the graph. For a graph with n nodes, the adjacency matrix is ​​an n×n matrix. In this matrix, each element a ij Describes the connection relationship between node i and node j. In addition, the adjacency matrix can also be expressed by a sequence, usually in the form of a triple (i, j, w). Among them, the tuple (i, j, w) indicates the existence of an edge of type w from node i to node j.

[0041] Atom Adjacency Matrix: An extended form of the sequence representation adjacency matrix, specifically used to describe chemical molecular structures. The matrix uses a five-tuple form (id1, label1, id2, label2, type) to express the connection relationship between atoms. Among them, id1 and id2 are integers used to uniquely identify atoms, label1 and label2 are the chemical symbols of the corresponding atoms, and type indicates the type of chemical bond connecting label1 and label2.

[0042] Example

[0043] See also Figure 3 , the input of this example is: (1) molecular structure Figure 1 SMILES data pair set Q = {(s i , p i )|i∈[0,...,N]}, where N is the number of molecular structure graph-SMILES data pairs, s i and p i They represent the molecular SMILES and molecular structure diagram corresponding to the i-th item respectively. (2) Markush molecular structure diagram of the variable position to be identified I q The output of this embodiment is qThe corresponding SMILES set of all possible molecules

[0044] The first step of this embodiment is to use the existing chemical structure processing toolkit to build a high-quality and diverse variable position Markush molecular structure graph data set. Then, the maximum common substructure in these molecular structures is calculated using a method based on the maximum substructure search algorithm. Through this calculation, the atomic adjacency matrix sequence representation of the variable position Markush molecular graph can be obtained.

[0045] Input: Molecular structure Figure 1 SMILES data pair set Q = {(s i , p i )|i∈[0,...,N]}.

[0046] Output: The output result is a set of N variable position Markush molecular structure images I = I1, I2, I3, ..., I N , and the set A=A1,A2,A3,...,A that generates its corresponding atomic adjacency matrix sequence representation N , where I i represents the i-th variable position molecular structure diagram, A i Represents the atomic adjacency matrix sequence of the i-th image.

[0047] process:

[0048] Step a1: Construct a Markush molecular structure diagram containing variable positions. First, collect the SMILES form of the molecular formula and the corresponding molecular image pairs (s i , p i ), and use Rdkit to transform the molecular image p i Render to vector graphics format. Then create a list F = {f1, f2, ..., f 100}. This list includes functional groups such as hydroxyl (-OH), amino (-NH2), and carboxyl (-COOH). For each SMILES string S i Scan, identify and record the position set P(f j )={(m,n)|s i [m:n] = f j}, where m is s i The mth position index of , n is s i The nth position index of . A random probability q (e.g., 40%) is used to decide whether to replace the functional group with an R group form (e.g., R1, R2). Specifically, for each functional group f at position (m, n) j, if the random number rand() < q and the functional group is located on the ring structure, then replace it with the R group to obtain a new SMILES structure: s' i = s i [0:m] + R k + s i [n + |f j |: len(s i )] where R k is selected from a group of R group forms. Since each s i will be updated multiple times, s i is a set composed of multiple replaced SMILES. Finally, add virtual bonds on the ring in the vector diagram and connect the R group at the end of the virtual bond, and render it as a Markush molecular structure diagram I with variable positions i .

[0049] Step a2: To obtain the atomic adjacency matrix information of the Markush molecular structure diagram with variable positions, it is necessary to systematically process all SMILES corresponding to the Markush molecular structure diagram with variable positions generated in step a1. First, for each SMILES expression s' i , use the maximum substructure search algorithm to identify its maximum common substructure, that is, the fixed structure. Denote this fixed structure as A fixed , which represents the same structure of all SMILES in s i . Using the chemical toolkit Rdkit, extract the atomic and bond information of this fixed structure. The information of this fixed structure can be organized into an atomic adjacency matrix A fied , and the form of its elements is: (atom number 1, atom label 1, atom number 2, atom label 2, chemical bond type) which is expressed as follows: A fixed =(i, atom i , j, atom j , bond ij ). Among them, i and j are the unique numbers of atoms, atom i and atom j are the labels of atoms (such as C, N, O), and bond ij refers to the chemical bond type (such as single bond, double bond). Next, continue to use Rdkit to extract the complete atomic and chemical bond information of each SMILES in s' i , which is expressed as the全集. From this全集,剔除 the atomic and chemical bond information that is the same as the maximum substructure A fixed , and the remaining part is the information related to the variable structure. Organize the atomic and chemical bond information of the variable structure into an adjacency matrix form A varAnd ensure that the number of each atom is unique in the entire molecular graph. In addition, since these variable position chemical bonds are non-standard chemical bonds, the types of these chemical bonds are uniformly marked as "SPECIAL" in the adjacency matrix to indicate special treatment, as shown below: A var =(i, atom i ,j,atom j , SPECIAL).

[0050] The second step of this embodiment is to train the image-to-sequence translation model. The process is described as follows:

[0051] Input: variable position molecule image-atom adjacency matrix sequence data pair (I i , A i )

[0052] Output: Image to sequence translation model F θ

[0053] process:

[0054] Step b1: The variable position Markush molecular structure image I obtained in step 1 i Input to SwinTransformer for image encoding. First, the input image is divided into non-overlapping image patches, and then each image patch is embedded into a fixed-dimensional vector using a linear transformation. Within each window (consisting of several image patches), self-attention is calculated; then, the information across windows is integrated through the window movement strategy to update the image representation. Ultimately, this process generates a vector representation V of the global structural information of the molecular structure diagram i The specific calculation formula is as follows:

[0055] z i =W e x i +b e , z i ∈R d (1)

[0056] z′=SW-MSA(LN(z))+LN(z) (2)

[0057] V=MLP(z′)+z′ (3)

[0058] Where W e is the learnable weight, b e is the bias, LN is the normalized network layer, SW-MSA is the self-attention mechanism based on the sliding window, and MLP is the multi-layer perceptron.

[0059] Step b2: The vector representation V of the global structure information of the variable position Markush molecular structure diagram obtained in step b1 i As the input of the sequence decoder, the corresponding atomic adjacency matrix sequence A is generated in an autoregressive manner i The neural network model used by the sequence decoder is Bert or Transformer; the generation method is described as follows:

[0060] Remember to input X i =V i , target sequence A i ={a j |j∈[1,|A i |]}

[0061] a j = argmaxP(a j |X i , a <j ,θ) (4)

[0062]

[0063] Among them, P(a j |X i , a <j ,θ) means that the jth word is a j The probability of j It is composed of A i vocabulary, is the output of the sequence decoder at position j, W∈R d×|V| are the parameters of the classification linear layer.

[0064] Step b3: Use the cross entropy loss function and the gradient descent method to optimize the model parameters to obtain the trained model F θ .

[0065] The third step of this embodiment is to input the input variable position molecular structure image into the translation model F obtained in step 2. θ The atomic adjacency matrix sequences of fixed structures and variable structures are obtained, and the atomic adjacency matrix sequences of variable structures are combined with the atomic adjacency matrix sequences of fixed structures to obtain the SMILES corresponding to the Markush molecular structure diagrams of all variable positions. The process is described as follows:

[0066] Input: Source variable position molecular structure image I q , translation model F θ

[0067] Output: SMILES set corresponding to the Markush molecular structure diagram of all variable positions

[0068] Step c1: Input variable position molecular structure image I q Input the translation model F obtained in step 2 θ , get the fixed structure atomic adjacency matrix sequence information of the target molecule and variable structure atomic adjacency matrix sequence information

[0069] Step c2: Traverse the atomic adjacency matrix sequence of the variable structure For each record (atom number, atom label, atom number, atom label and chemical bond type), compare it with the atomic adjacency matrix sequence information of the fixed structure Combine to obtain the atomic adjacency matrix sequence set of the complete molecular structure where k is The total number of records in Then create an empty molecular structure instance mol, and then traverse For each record in , if it is an atom number, it is necessary to check whether the atom corresponding to this atom number in mol has been successfully created. If not, create the corresponding atom instance in mol based on the atom label information following the atom number; if the atom already exists in mol, directly skip this atom number and the atom label following it, and continue to process the next record; and when traversing to the chemical bond type, it is necessary to determine whether the type of this chemical bond is "SPECIAL". If the chemical bond type is "SPECIAL", add a "SINGLE" chemical bond between the corresponding two atom instances in mol; if it is not the "SPECIAL" type, add the chemical bond type corresponding to the record between the corresponding two atom instances in mol. Processing completed After all the records in the collection are collected, the chemical toolkit Rdkit is used to generate the corresponding SMILES according to the mol structure; Each of After all the above processing, all SMILES corresponding to the Markush molecular structure diagram of the variable position are obtained, that is, the SMILES set

[0070] See also Figure 4 , this embodiment also provides a variable position Markush molecular structure recognition system based on atomic adjacency matrix sequence representation, including an image preprocessing module, a molecular image encoding module and a SMILES generation module.

[0071] The image preprocessing module, based on existing image processing tools, performs operations such as cropping, normalization, and filtering on molecular structure images in real scenes to meet the needs of model reasoning.

[0072] The molecular image encoding module, based on the visual image encoder, encodes the variable position molecular structure image into a vector representation with global structure information;

[0073] The molecular SMILES generation module uses a sequence decoder to decode the vector representation containing global structure information to obtain the atomic adjacency matrix sequence of the target molecular structure. The atomic adjacency matrix sequence is divided into atomic adjacency matrix sequences of fixed structure and variable structure, and the variable structure sequence is combined with the fixed structure sequence in sequence to obtain all SMILES through Rdkit. This helps to achieve the analysis of molecular structures in chemical literature and the construction of biological databases.

Claims

1. A variable position Markush molecular structure recognition method based on atomic adjacency matrix, characterized in that: The method comprises the following steps: Step 1: Use the SMILES form of the molecule to construct a position-variable Markush molecular structure graph, and obtain the atomic adjacency matrix sequence information of the position-variable Markush molecular structure graph according to the maximum substructure search algorithm, including the atomic adjacency matrix information of the fixed structure and the atomic adjacency matrix information of the variable structure; Step 2: Using the image-to-sequence generation model, the position-variable Markush molecular structure diagram obtained in step 1 is input into the visual image encoder, and the vector representation obtained after image encoding is input into the sequence decoder. The corresponding fixed structure and variable structure atomic adjacency matrix sequences are used as generation targets for training, and the translation model F including the image encoder and sequence decoder is obtained. θ ; Update the parameters of the encoder and decoder using the gradient descent method; Step 3: Input the Markush molecular structure image of the variable position to be identified into the translation model F obtained in step 2 θ The atomic adjacency matrix sequences of fixed structures and variable structures are obtained, and the atomic adjacency matrix sequences of variable structures and fixed structures are divided and combined to obtain the SMILES corresponding to the Markush molecular structure diagrams of all variable positions.

2. The method for recognizing variable position Markush molecular structures according to claim 1, characterized in that: The step 1 specifically includes the following steps: Step a1: Construct a Markush molecular structure diagram containing variable positions; first, collect the SMILES form of the molecular formula and the corresponding molecular image pairs (s i ,p i ), and use the chemical toolkit Rdkit to p i Render to vector format; then create a list F = {f1, f2, …, f 100 }; For each SMILES string s i Scan, identify and record the position set P(f j )={(m,n)|s i [m:n]=f j }, where m is s i The mth position index of , n is s i The nth position index of ; Use random probability q to decide whether to replace the functional group with the R group form; Specifically, for each functional group f at position (m,n) j If the functional group is located on the ring structure, it is replaced by the R group with probability q, and the new SMILES expression is obtained: s′ i =s i [0:m]+R k +s i [n+|f j ∣∣:len(s i )] Among them, R k Selected from a group of R group forms; since each s i will be updated many times, so s′ i It is a collection of multiple replaced SMILES; finally, virtual bonds are added to the vector map and connected to the R group, rendering it as a Markush molecular structure diagram with variable positions I i ; Step a2: Obtain atomic adjacency matrix sequence information; for each SMILES expression set s′ in step a1 i , use the maximum substructure search algorithm to identify its largest common substructure, that is, the fixed structure, denoted as A fixed , and extract the information of atoms and bonds, and generate an adjacency matrix sequence representation A fixed : A fixed =(i,atom i ,j,atom j ,bond ij ) where i and j are Atom number, atom i and atom j is the atomic label, bond ij is the chemical bond type; then, from each s′ i Remove the atomic and chemical bond information related to A fixed The same information, the rest is the information of atoms and chemical bonds of the variable structure, recorded as A var : A var =(i,atom i ,j,atom j ,SPECIAL); the chemical bond type marked as "SPECIAL" indicates a chemical bond with a variable position structure and ensures that all atom numbers are unique in the entire molecular graph; A fixed and A var The atomic adjacency matrix sequence A is composed.

3. The method for recognizing variable position Markush molecular structures according to claim 1, characterized in that: The step 2 specifically includes the following steps: Step b1: The variable position Markush molecular structure diagram I obtained in step 1 i As input, the visual image encoding model Swin Transformer is used to encode the image to obtain a vector representation V of the global structural information containing the variable position Markush molecular structure diagram i ; Step b2: The vector representation V of the global structure information of the variable position Markush molecular structure diagram obtained in step b1 i As the input of the sequence decoder, the corresponding atomic adjacency matrix sequence A is generated in an autoregressive manner i ; Step b3: Use the cross entropy loss function and the gradient descent method to optimize the model parameters to obtain the trained model F θ .

4. The method for recognizing variable position Markush molecular structures according to claim 1, characterized in that: The step three specifically includes the following steps: Step c1: The Markush molecular structure image I of the variable position to be identified > Input the translation model F obtained in step 2 θ , get the fixed structure atomic adjacency matrix sequence information of the target molecule and variable structure atomic adjacency matrix sequence information Step c2: Traverse the atomic adjacency matrix sequence of the variable structure For each record, namely, atom number, atom label, atom number, atom label and chemical bond type, it is compared with the atomic adjacency matrix sequence information of the fixed structure. Combine to obtain the atomic adjacency matrix sequence set of the complete molecular structure where k is The total number of records in Then create an empty molecular structure instance mol, and then traverse For each record in , if it is an atom number, it is necessary to check whether the atom corresponding to this atom number in mol has been successfully created. If not, then create the corresponding atom instance in mol according to the atom label information following the atom number; if the atom already exists in mol, then directly skip this atom number and the atom label following it, and continue to process the next record; and when traversing to the chemical bond type, it is necessary to determine whether the type of this chemical bond is "SPECIAL"; if the chemical bond type is "SPECIAL", then add a "SINGLE" chemical bond between the corresponding two atom instances in mol; if it is not the "SPECIAL" type, then add the chemical bond type corresponding to the record between the corresponding two atom instances in mol; after processing After all the records in the collection are collected, the chemical toolkit Rdkit is used to generate the corresponding SMILES according to the mol structure; Each of After the above processing, all SMILES corresponding to the Markush molecular structure diagram at the variable position are obtained.

5. A variable position Markush molecular structure recognition system based on the atomic adjacency matrix according to the method of claim 1, characterized in that: It includes image preprocessing module, molecular image encoding module and SMILES generation module; The image preprocessing module, based on existing image processing tools, performs cropping, normalization, and filtering operations on molecular structure images in real scenes to meet the needs of model reasoning; The molecular image encoding module, based on a visual image encoder, encodes the variable position Markush molecular structure image into a vector representation with global structure information; The molecular SMILES generation module uses a sequence decoder to decode the vector representation containing global structure information to obtain the atomic adjacency matrix sequence of the target molecular structure; divides the atomic adjacency matrix sequence into atomic adjacency matrix sequences of fixed structure and variable structure, and combines the variable structure sequence with the fixed structure sequence in sequence, and obtains all molecular SMILES through Rdkit.