+

WO2025050579A1 - Molecular structure recognition method and apparatus, electronic device and storage medium - Google Patents

Molecular structure recognition method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2025050579A1
WO2025050579A1 PCT/CN2023/143320 CN2023143320W WO2025050579A1 WO 2025050579 A1 WO2025050579 A1 WO 2025050579A1 CN 2023143320 W CN2023143320 W CN 2023143320W WO 2025050579 A1 WO2025050579 A1 WO 2025050579A1
Authority
WO
WIPO (PCT)
Prior art keywords
angle
molecular structure
decoding
branch angle
branch
Prior art date
Application number
PCT/CN2023/143320
Other languages
French (fr)
Chinese (zh)
Inventor
胡金水
吴浩
陈明军
刘辰宇
殷实
吴嘉嘉
殷保才
殷兵
刘聪
Original Assignee
科大讯飞股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 科大讯飞股份有限公司 filed Critical 科大讯飞股份有限公司
Publication of WO2025050579A1 publication Critical patent/WO2025050579A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Definitions

  • the present disclosure relates to the field of image recognition technology, and in particular to a molecular structure recognition method, device, electronic device and storage medium.
  • Chemical molecular structure recognition can be widely used in fields including pharmaceutical research and development, human-computer interaction, biochemistry, education, organic synthesis, etc.
  • the present disclosure provides a molecular structure recognition method, device, electronic device and storage medium to solve the defect of the prior art that it is difficult to recognize complex handwritten molecular structures.
  • the present disclosure provides a molecular structure recognition method, comprising:
  • Initialize an empty angle set and when decoding the molecular structure based on the image features of the molecular image and decoding the branch angle for the first time, store the branch angle in the angle set; take a branch angle from the angle set, and use the branch angle
  • the molecular structure at the branch angle is decoded based on the image features of the molecular image, and the angle set is updated based on the new branch angle obtained by decoding for decoding of the molecular structure at the next branch angle, until the angle set is empty;
  • the molecular structure corresponding to the molecular image is determined.
  • the updating of the angle set based on the new branch angle obtained by decoding includes:
  • the angle set is updated.
  • the branch angle that forms a chemical bond with the new branch angle is deleted from the angle set.
  • the molecular structure at the branching angle is decoded based on the image features of the molecular image with the branching angle as a guide, including:
  • the molecular structure of the image feature at the current decoding moment is decoded to obtain the decoding state at the current decoding moment, and the current decoding moment is returned as the previous decoding moment for decoding until the decoding at the branch angle is completed.
  • the method of taking A branch angle is obtained, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for decoding the molecular structure under the next branch angle, until the angle set is empty, including:
  • a branch angle is taken out from the angle set, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for decoding of the molecular structure under the next branch angle, until the angle set is empty;
  • the recognition model is trained based on the sample image and the molecular structure label corresponding to the sample image;
  • the molecular structure label is obtained by connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure graph and then performing graph traversal.
  • the step of determining the molecular structure tag includes:
  • the molecular structure graph is traversed, and the molecular structure label is generated based on the atomic groups, chemical bonds, angles, nesting symbols and reconnection marks obtained through the traversal.
  • the training step of the recognition model includes:
  • molecular structure recognition is performed on the sample image to obtain a chemical bond detection result between the sample branch angle decoded in the molecular structure recognition process and the existing branch angles in the sample angle set, as well as a structural recognition result of the sample image;
  • the initial model is iterated with parameters to obtain the recognition model.
  • the present disclosure also provides a molecular structure recognition device, comprising:
  • An acquisition unit used for acquiring a molecular image
  • the specific rules can be pre-set fixed rules.
  • the molecular structure graph can be traversed from a specific point, and the nodes (atomic groups) and edges (chemical bonds) are appended to the end of the string.
  • a standardized label can be obtained.
  • the molecular structure graph shown in Figure 4 is traversed to obtain the following standardized labels:
  • each unit is separated by a space.
  • Graph traversal can use Depth-First Search (DFS).
  • DFS Depth-First Search
  • the above standardized labels can contain four types of elements, namely "atom group”, “chemical bond”, “angle”, “nested symbol” and “reconnection mark”. Specifically in the above standardized labels, “H O” represents the atomic group, "?[a]”, “?[a, ⁇ - ⁇ ]” are reconnection marks, "-” represents the chemical bond, "[:0]” represents the angle, and "(" represents the nested symbol.
  • the standardized labels shown above can be integrated to form the molecular structure label shown in Figure 5, in which the nested relationship and the reconnection relationship at different angles are marked.
  • " ⁇ eob” indicates that the decoding is completed at a branch angle
  • the line with an arrow between " ⁇ angle[:60]” and “-[:60]” indicates the nested relationship
  • the double-arrow line between " ⁇ angle[:300]” and " ⁇ angle[:120]” and "reconnection” indicate the reconnection mark.
  • the training step of the recognition model includes:
  • molecular structure recognition is performed on the sample image to obtain a chemical bond detection result between the sample branch angle decoded in the molecular structure recognition process and the existing branch angles in the sample angle set, as well as a structural recognition result of the sample image;
  • the initial model is iterated with parameters to obtain the recognition model.
  • an initial model of the encoder + decoder structure can be obtained, where the model parameters of the initial model can be initialized.
  • the molecular structure of the sample image can be recognized based on the initial model.
  • the image feature of the sample image can be extracted based on the initial model, and then a sample branch angle is taken out from the sample angle set.
  • the sample branch angle is used as a guide, and the molecular structure under the sample branch angle is decoded based on the image features of the sample image, and the sample angle set is updated based on the new sample branch angle obtained by decoding for the molecular structure decoding under the next sample branch angle, until the sample angle set is empty.
  • the sample angle set needs to be updated based on the new sample branch angle obtained by decoding.
  • the new sample branch angle needs to be chemically bonded with each existing branch angle in the sample angle set respectively, thereby obtaining the chemical bond detection result between the sample branch angle and the existing branch angles in the sample angle set.
  • the presence or absence of chemical bonds in the chemical bond detection results is used to reflect whether there is a reconnection relationship between the branch angles of the two samples.
  • the chemical bond detection results can be compared with the reconnection mark in the molecular structure label to measure the initial model from the perspective of reconnection relationship detection. Training loss.
  • the structure recognition results and molecular structure labels can be compared to measure the training loss of the initial model from the perspective of molecular structure recognition.
  • loss L ce of molecular structure recognition can be expressed based on the following formula:
  • Lce is the cross entropy loss
  • V represents the number of unit characters of the model
  • yti represents whether the molecular structure label is the i-th character at the t-th decoding time
  • pti represents the probability that the structure recognition result is the i-th character at the t-th decoding time.
  • s t is the decoding state of the branch angle obtained by decoding at the current decoding time t.
  • W m and W o are parameters for chemical bond detection.
  • the chemical bond detection probability distribution between the state feature s b of the existing branch angle b stored in the angle set and the branch angle t is expressed as Where N is the total number of chemical bond types, and N+1 includes N types of chemical bonds and the case where there are no chemical bonds.
  • B is the total number of branch angles in the angle set
  • z tbi is whether the chemical bond type between the molecular structure label and the branch angle b is i at the tth decoding time
  • q tbi represents the probability that the chemical bond type i between the branch angle b is detected at the tth decoding time in the chemical bond detection result.
  • the overall loss L here can be expressed as L ce +L bc , or as the result of the weighted sum of L ce and L bc , which is not specifically limited in the embodiments of the present disclosure.
  • the parameters of the initial model can be iterated based on the overall loss, thereby obtaining a fully trained recognition model.
  • the method provided in the embodiment of the present disclosure realizes molecular structure recognition for molecular images through end-to-end modeling and training.
  • the initial model is an encoder + decoder structure.
  • the encoder is DenseNet, which includes three dense blocks for converting the input RGB three-channel image into high-dimensional features. The growth rate and depth of each dense block are set to 24 and 32, respectively.
  • both the encoder and the decoder use a GRU with a hidden state dimension of 256 as the recurrent unit of the RNN, and the dimension of the attention projection parameter is set to 128.
  • the dimension of the embedding parameter is set to 256, and a drop-out rate of 15% is applied.
  • the projection parameter dimension of the chemical bond detection classification is set to 256.
  • the optimizer used for parameter iteration of the initial model can be Adam, the initial learning rate is 2e-4, the learning rate decay strategy is multi-step decay, Pytorch's MultiStepLR is used to adjust the learning rate, and the decay factor gamma is set to 0.5.
  • the disclosed embodiments provide a molecular structure recognition method, which is implemented based on a recognition model.
  • the recognition model here includes a random conditional decoder different from a string decoder, and the random conditional decoder combines three mechanisms to solve the problems existing in the prior art: conditional guided attention, loop and path selection.
  • the conditionally guided attention mechanism can take advantage of the natural graph structure of molecular structures and regard its recognition process as a graph traversal problem.
  • the recognition model traverses the graph, it encounters multiple branch angles, and the order of these angles in the proposed modeling unit follows a fixed counterclockwise direction.
  • the branch angle can be used as conditional information to guide the decoding process.
  • the recognition model encounters a branch, it continues decoding along the specified branch angle direction.
  • the updated decoder no longer uses "(" and ")" to indicate the start and end of the branch.
  • the branch angle of each branch is first predicted, that is, " ⁇ angle[: ⁇ angle value>]", and the decoded features of each branch angle obtained by decoding are stored separately into the angle set.
  • Memory that is, the context and attention weight information of each branch angle.
  • the graph structure has a cyclic characteristic.
  • the branch angle corresponding to the loop has been stored in the angle set Memory and has not been decoded. Therefore, a simple multi-label classification module can be constructed for chemical bond detection to determine the direction corresponding to the loop angle and classify the type of loop bond (such as single bond, double bond, etc.).
  • the result obtained by chemical bond detection may be empty or the type of bond, and empty means that there is no loop with a corresponding branch angle that has not been decoded.
  • the corresponding branch angle is deleted from the angle set Memory, and the branch angle obtained by decoding at the current moment is not stored. On the contrary, if there is no loop, that is, the test result is empty, the branch angle at the current moment is saved in the angle set Memory for future decoding selection.
  • the recognition process of the random conditional decoder can be viewed as a graph traversal problem, where different traversals of the graph can produce multiple target sequences. Therefore, a single graph can have multiple training labels.
  • the conditionally guided attention mechanism still decodes according to a fixed counterclockwise order, it may cause overfitting and recognition errors in complex or uncommon structures. Therefore, the disclosed embodiment can be combined with a path selection mechanism for decoding, which randomly selects different paths during the training process to improve the alignment between visual information and decoded characters using a conditionally guided attention mechanism.
  • the recognition model can attempt to decode all branch angles stored in the angle set and participate in the calculation of the beam search path score PK, thereby selecting the path with the highest score to continue decoding.
  • the recognition model can have better versatility and recognition efficiency.
  • the disclosed embodiment uses the publicly accessible CASIA-CSDB dataset as a benchmark to establish a handwriting dataset for use as sample images.
  • Real-world handwritten molecular structures are available from educational settings.
  • the dataset includes many instances with writing errors and non-existent structure data.
  • the handwritten dataset consists of 52,987 images of handwritten molecular structures collected in educational scenarios. These images were obtained using various devices such as cameras, scanners, and screens, and were labeled as native Chemfig strings.
  • many instances in the dataset contain a combination of formulas and molecular structures.
  • different structural writing styles are integrated into the dataset, such as the use/non-use of abbreviations, the type of Keckler ring representation of benzene, and the inclusion/exclusion of hydrogen atoms.
  • the dataset also contains a large number of examples of human writing errors that violate chemical principles or even non-existent structures.
  • the recognition of such structures by the model trained based on this can potentially be applied to correct and modify handwritten answers.
  • the molecular structures in the dataset need to maintain a certain complexity. Specifically, the sum of the number of atoms and bonds can be used to evaluate the complexity level of the molecular structure. The complexity level of about 10% of the dataset exceeds the complexity level of the most complex sample in the regular training set.
  • an experimental test may be performed on the recognition model.
  • the Exact Match (EM) score can be calculated using the following formula:
  • auxiliary indicators as follows:
  • Structure EM For samples containing mixed molecular structures and rule formulas, when all molecular structure recognition results match the labeled graph, it is determined that the structure in the sample is correctly recognized. Let T be the number of samples, R struct represents the number of correctly recognized structure samples, and the structure EM score is as follows:
  • the structural EM score EM struct and the single EM score EM can measure the recognition performance of the recognition model for the molecular structures in the handwritten dataset under mixed mode.
  • the molecular structure recognition method provided by the disclosed embodiment significantly improves the recognition performance compared with the SMILES-based recognition method. This is mainly due to the reduced ambiguity of the molecular structure label and the stronger consistency between the image and the label.
  • the random conditional decoder proposed in the disclosed embodiment has significant advantages over the string decoder. It should be emphasized that the computational and parameter costs of the random conditional decoder are almost the same as those of the string decoder.
  • FIG6 is a schematic diagram of the structure of a molecular structure recognition device provided by the present disclosure. As shown in FIG6 , the device includes:
  • An acquisition unit 610 configured to acquire a molecular image
  • the logic instructions in the above-mentioned memory 730 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
  • the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
  • Initialize an empty angle set and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take a branch angle from the angle set, and decode the molecular structure under the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for the next step. Decoding the molecular structure under the branch angle until the angle set is empty;
  • the molecular structure corresponding to the molecular image is determined.
  • the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the molecular structure recognition method provided by the above methods, the method comprising:
  • Initialize an empty angle set and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take a branch angle from the angle set, and decode the molecular structure under the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for decoding the molecular structure under the next branch angle, until the angle set is empty;
  • the molecular structure corresponding to the molecular image is determined.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
  • each implementation method can be implemented by means of software plus a necessary general hardware platform, or of course by hardware.
  • the above technical solution in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, a disk, an optical disk, or a computer-readable medium.
  • the disk, etc. includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure provides a molecular structure recognition method and apparatus, an electronic device and a storage medium. The method comprises: acquiring a molecule image; initializing an empty angle set and, when a molecular structure is decoded on the basis of image features of the molecule image and a branch angle is obtained for the first time, storing the branch angle into the angle set; extracting one branch angle from the angle set, using the branch angle as a guide to decode the molecular structure at the branch angle on the basis of the image features of the molecular image, and updating the angle set on the basis of a new decoded branch angle for decoding the molecular structure at the next branch angle until the angle set is empty; and, on the basis of decoding results at each branch angle, determining the molecular structure corresponding to the molecule image.

Description

分子结构识别方法、装置、电子设备和存储介质Molecular structure recognition method, device, electronic device and storage medium

相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS

本申请要求于2023年09月04日提交的申请号为2023111369517,发明名称为“分子结构识别方法、装置、电子设备和存储介质”的中国专利申请的优先权,其通过引用方式全部并入本文。This application claims priority to Chinese patent application No. 2023111369517, filed on September 4, 2023, entitled “Molecular structure identification method, device, electronic device and storage medium”, which is incorporated herein by reference in its entirety.

技术领域Technical Field

本公开涉及图像识别技术领域,尤其涉及一种分子结构识别方法、装置、电子设备和存储介质。The present disclosure relates to the field of image recognition technology, and in particular to a molecular structure recognition method, device, electronic device and storage medium.

背景技术Background Art

化学分子结构识别,可广泛应用在包括制药研发、人机交互、生物化学、教育、有机合成等领域。Chemical molecular structure recognition can be widely used in fields including pharmaceutical research and development, human-computer interaction, biochemistry, education, organic synthesis, etc.

目前,针对手写化学分子结构识别的研究,过度依赖基于规则的后处理方法,简化了分子结构识别本身的复杂性,导致手写的复杂分子布局在现有方案下难以完成解析识别。Currently, research on handwritten chemical molecular structure recognition relies too much on rule-based post-processing methods, which simplifies the complexity of molecular structure recognition itself, making it difficult to parse and recognize complex handwritten molecular layouts under existing solutions.

发明内容Summary of the invention

本公开提供一种分子结构识别方法、装置、电子设备和存储介质,用以解决现有技术中面向复杂的手写分子结构识别困难的缺陷。The present disclosure provides a molecular structure recognition method, device, electronic device and storage medium to solve the defect of the prior art that it is difficult to recognize complex handwritten molecular structures.

本公开提供一种分子结构识别方法,包括:The present disclosure provides a molecular structure recognition method, comprising:

获取分子图像;Acquire molecular images;

初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度 为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Initialize an empty angle set, and when decoding the molecular structure based on the image features of the molecular image and decoding the branch angle for the first time, store the branch angle in the angle set; take a branch angle from the angle set, and use the branch angle For guidance, the molecular structure at the branch angle is decoded based on the image features of the molecular image, and the angle set is updated based on the new branch angle obtained by decoding for decoding of the molecular structure at the next branch angle, until the angle set is empty;

基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。Based on the decoding results at each branch angle, the molecular structure corresponding to the molecular image is determined.

根据本公开提供的一种分子结构识别方法,所述基于解码得到新的分支角度更新所述角度集合,包括:According to a molecular structure recognition method provided by the present disclosure, the updating of the angle set based on the new branch angle obtained by decoding includes:

将所述新的分支角度分别与所述角度集合中的各已有分支角度,进行化学键检测;Perform chemical bond detection on the new branch angle and each existing branch angle in the angle set;

基于所述化学键检测的检测结果,更新所述角度集合。Based on the detection result of the chemical bond detection, the angle set is updated.

根据本公开提供的一种分子结构识别方法,所述基于所述化学键检测的检测结果,更新所述角度集合,包括:According to a molecular structure recognition method provided by the present disclosure, the updating of the angle set based on the detection result of the chemical bond detection includes:

在所述检测结果指示不存在化学键的情况下,将所述新的分支角度存入所述角度集合;When the detection result indicates that there is no chemical bond, storing the new branch angle into the angle set;

在所述检测结果指示存在化学键的情况下,将与所述新的分支角度构成化学键的分支角度从所述角度集合中删除。In the case where the detection result indicates the presence of a chemical bond, the branch angle that forms a chemical bond with the new branch angle is deleted from the angle set.

根据本公开提供的一种分子结构识别方法,所述以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,包括:According to a molecular structure recognition method provided by the present disclosure, the molecular structure at the branching angle is decoded based on the image features of the molecular image with the branching angle as a guide, including:

基于所述分支角度的解码特征,以及所述分支角度下的前一个解码时刻的解码状态,确定所述分支角度下的当前解码时刻的视觉上下文特征;Determining visual context features at a current decoding moment at the branch angle based on the decoding features of the branch angle and a decoding state at a previous decoding moment at the branch angle;

基于所述视觉上下文特征,对所述图像特征进行当前解码时刻的分子结构解码,得到当前解码时刻的解码状态,并将所述当前解码时刻作为前一个解码时刻返回解码,直至所述分支角度下的解码结束。Based on the visual context feature, the molecular structure of the image feature at the current decoding moment is decoded to obtain the decoding state at the current decoding moment, and the current decoding moment is returned as the previous decoding moment for decoding until the decoding at the branch angle is completed.

根据本公开提供的一种分子结构识别方法,所述从角度集合中取 出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空,包括:According to a molecular structure recognition method provided by the present disclosure, the method of taking A branch angle is obtained, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for decoding the molecular structure under the next branch angle, until the angle set is empty, including:

基于识别模型,从角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Based on the recognition model, a branch angle is taken out from the angle set, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for decoding of the molecular structure under the next branch angle, until the angle set is empty;

所述识别模型基于样本图像、以及所述样本图像对应的分子结构标签训练得到;The recognition model is trained based on the sample image and the molecular structure label corresponding to the sample image;

所述分子结构标签是将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图之后进行图遍历得到。The molecular structure label is obtained by connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure graph and then performing graph traversal.

根据本公开提供的一种分子结构识别方法,所述分子结构标签的确定步骤包括:According to a molecular structure recognition method provided by the present disclosure, the step of determining the molecular structure tag includes:

将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图;Connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure diagram;

遍历所述分子结构图,并基于遍历所得的原子群、化学键、角度、嵌套符号和重连标记生成所述分子结构标签。The molecular structure graph is traversed, and the molecular structure label is generated based on the atomic groups, chemical bonds, angles, nesting symbols and reconnection marks obtained through the traversal.

根据本公开提供的一种分子结构识别方法,所述识别模型的训练步骤包括:According to a molecular structure recognition method provided by the present disclosure, the training step of the recognition model includes:

基于初始模型,对所述样本图像进行分子结构识别,得到所述分子结构识别过程中解码到的样本分支角度与样本角度集合中已有分支角度之间的化学键检测结果,以及所述样本图像的结构识别结果;Based on the initial model, molecular structure recognition is performed on the sample image to obtain a chemical bond detection result between the sample branch angle decoded in the molecular structure recognition process and the existing branch angles in the sample angle set, as well as a structural recognition result of the sample image;

基于所述结构识别结果和所述分子结构标签,以及所述化学键检测检测和所述分子结构标签中的重连标记,对所述初始模型进行参数迭代,得到所述识别模型。 Based on the structure recognition result and the molecular structure label, as well as the chemical bond detection and the reconnection mark in the molecular structure label, the initial model is iterated with parameters to obtain the recognition model.

本公开还提供一种分子结构识别装置,包括:The present disclosure also provides a molecular structure recognition device, comprising:

获取单元,用于获取分子图像;An acquisition unit, used for acquiring a molecular image;

识别单元,用于初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;The identification unit is used to initialize an empty angle set, and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take out a branch angle from the angle set, and decode the molecular structure under the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for decoding of the molecular structure under the next branch angle, until the angle set is empty;

输出单元,用于基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。The output unit is used to determine the molecular structure corresponding to the molecular image based on the decoding results at each branch angle.

本公开还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述分子结构识别方法。The present disclosure also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the molecular structure recognition method described above is implemented.

本公开还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述分子结构识别方法。The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the molecular structure recognition methods described above.

本公开还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述分子结构识别方法。The present disclosure also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the molecular structure recognition method described above is implemented.

本公开提供的分子结构识别方法、装置、电子设备和存储介质,增加了对于化学分子结构中各个分支角度的解码和待探索的分支角度的维护机制,并将化学分子结构中的分支角度作为解码时的引导条件,以丰富分子结构解码的信息,提高分子结构解码的可靠性,提高面向复杂化学分子结构的解码准确性。The molecular structure recognition method, device, electronic device and storage medium provided by the present invention add a decoding mechanism for each branch angle in the chemical molecular structure and a maintenance mechanism for the branch angle to be explored, and use the branch angle in the chemical molecular structure as a guiding condition during decoding to enrich the information of molecular structure decoding, improve the reliability of molecular structure decoding, and improve the decoding accuracy for complex chemical molecular structures.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本公开或现有技术中的技术方案,下面将对实 施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, A brief introduction is given to the drawings required for use in the examples or descriptions of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

图1是本公开提供的分子结构识别方法的流程示意图之一;FIG1 is a schematic diagram of a molecular structure recognition method provided by the present disclosure;

图2是本公开提供的分子结构解码的示意图;FIG2 is a schematic diagram of molecular structure decoding provided by the present disclosure;

图3是本公开提供的手写分子图像;FIG3 is a handwritten molecular image provided by the present disclosure;

图4是本公开提供的分子结构图;FIG4 is a molecular structure diagram provided by the present disclosure;

图5是本公开提供的分子结构标签;FIG5 is a molecular structure tag provided by the present disclosure;

图6是本公开提供的分子结构识别装置的结构示意图;FIG6 is a schematic diagram of the structure of a molecular structure recognition device provided by the present disclosure;

图7是本公开提供的电子设备的结构示意图。FIG. 7 is a schematic diagram of the structure of an electronic device provided by the present disclosure.

具体实施方式DETAILED DESCRIPTION

为使本公开的目的、技术方案和优点更加清楚,下面将结合本公开中的附图,对本公开中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions in the present disclosure will be clearly and completely described below in conjunction with the drawings in the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

近年来,由于计算机视觉技术在目标检测和语义分割方面的进步,对于简单可控的印刷分子图像已经取得了令人满意的识别性能。与此同时,面向手写化学分子结构的识别研究取得了重大进展。然而,这些面向手写化学分子结构的识别方法可能忽略了识别手写分子图像在人机交互中的重要性,或者过度简化了分子结构识别的复杂性,过度依赖基于规则的后处理方法,导致识别大而复杂的分子结构仍然是一个主要的挑战。In recent years, due to the progress of computer vision technology in object detection and semantic segmentation, satisfactory recognition performance has been achieved for simple and controllable printed molecular images. At the same time, research on the recognition of handwritten chemical molecular structures has made significant progress. However, these recognition methods for handwritten chemical molecular structures may ignore the importance of recognizing handwritten molecular images in human-computer interaction, or oversimplify the complexity of molecular structure recognition and over-rely on rule-based post-processing methods, resulting in the recognition of large and complex molecular structures still being a major challenge.

图1是本公开提供的分子结构识别方法的流程示意图之一,如图 1所示,该方法包括:FIG. 1 is a schematic diagram of a molecular structure recognition method provided by the present disclosure. 1, the method comprises:

步骤110,获取分子图像。Step 110, acquiring a molecular image.

此处的分子图像,即绘制有化学分子结构的图像。进一步地,分子图像中的化学分子结构,可以是印刷而成的,也可以是手写绘制的,本公开实施例对此不作具体限定。The molecular image here refers to an image with a chemical molecular structure drawn on it. Furthermore, the chemical molecular structure in the molecular image may be printed or handwritten, and this is not specifically limited in the embodiments of the present disclosure.

步骤120,初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空。Step 120, initialize an empty angle set, and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take out a branch angle from the angle set, and decode the molecular structure at the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for decoding of the molecular structure at the next branch angle, until the angle set is empty.

考虑到化学分子结构本身的复杂性,在针对分子图像进行分子结构识别时,可以在常规的编码器+解码器的架构下,增加对于化学分子结构中各个分支的角度解码和维护机制,并将化学分子结构中的分支角度作为解码时的引导条件,以提高面向复杂化学分子结构的解码可靠性和准确性。Taking into account the complexity of the chemical molecular structure itself, when performing molecular structure recognition on molecular images, we can add an angle decoding and maintenance mechanism for each branch in the chemical molecular structure under the conventional encoder + decoder architecture, and use the branch angle in the chemical molecular structure as a guiding condition for decoding, so as to improve the decoding reliability and accuracy for complex chemical molecular structures.

在具体实现中,可以基于分子图像的图像特征进行逐个分支的解码。可以理解的是,此处逐个分支的解码,即,对于分子图像的一次图遍历。In a specific implementation, branch-by-branch decoding may be performed based on the image features of the molecular image. It is understandable that the branch-by-branch decoding here is, that is, a graph traversal of the molecular image.

图2是本公开提供的分子结构解码的示意图,如图2所示,在图2的(a)中,图遍历之初,可以初始化一个空的角度集合Memory,在遍历过程中,遇到一个分支点,在这个分支点处可以解码得到两个分支角度,即分支角度①和分支角度②,其中分支角度①指向上方,分支角度②指向右下方,分支角度①和分支角度②作为首次解码到的分支角度,均被存入角度集合Memory。Figure 2 is a schematic diagram of molecular structure decoding provided by the present invention. As shown in Figure 2, in (a) of Figure 2, at the beginning of the graph traversal, an empty angle set Memory can be initialized. During the traversal, a branch point is encountered. At this branch point, two branch angles can be decoded, namely branch angle ① and branch angle ②, wherein branch angle ① points upward and branch angle ② points to the lower right. Branch angle ① and branch angle ② are the branch angles decoded for the first time and are both stored in the angle set Memory.

随后,在图2的(b)中,从角度集合Memory中取出分支角度 ①,沿着分支角度①向上遍历,直至遇到新的分支点。在图2的(c)中,解码得到两个分支角度,即分支角度③和分支角度④,其中分支角度③指向右方,分支角度④指向下方,分支角度③和分支角度④均被存入角度集合Memory。接着,在图2的(d)中,先后从角度集合Memory中取出分支角度①、③、⑤、⑦进行图遍历,直至一个分支遍历完成。Then, in (b) of Figure 2, the branch angle is taken from the angle set Memory ①, traverse upward along branch angle ① until a new branch point is encountered. In Figure 2 (c), two branch angles are obtained through decoding, namely branch angle ③ and branch angle ④, where branch angle ③ points to the right and branch angle ④ points downward. Branch angle ③ and branch angle ④ are both stored in the angle set Memory. Then, in Figure 2 (d), branch angles ①, ③, ⑤, and ⑦ are taken out from the angle set Memory in turn to traverse the graph until a branch traversal is completed.

在图2的(e)中,已经完成一个分支的遍历之后,从角度集合Memory中取出分支角度⑥,沿着分支角度⑥继续遍历,此时发现遍历到的原子与之前被访问的原子连接,即在图2的(e)中标记为两个实心圆的原子相连接。针对这种情况,在图2的(f)中,可以预测已经存储在角度集合Memory中的分支角度⑧是否为环路键,如果是则可以认为分支角度⑧已完成遍历,从角度集合Memory中取出删除。此次的环路键,理解为两个分支角度是否形成重连关系(reconnection),即,形成分支角度的循环。In Figure 2 (e), after completing the traversal of a branch, the branch angle ⑥ is taken out from the angle set Memory, and the traversal continues along the branch angle ⑥. At this time, it is found that the traversed atom is connected to the previously visited atom, that is, the atoms marked as two solid circles in Figure 2 (e) are connected. For this situation, in Figure 2 (f), it can be predicted whether the branch angle ⑧ stored in the angle set Memory is a loop key. If so, it can be considered that the branch angle ⑧ has completed the traversal and is taken out and deleted from the angle set Memory. The loop key this time is understood as whether the two branch angles form a reconnection relationship (reconnection), that is, a cycle of branch angles is formed.

基于上述遍历方式,在完成角度集合Memory中所有分支角度下的分支解码遍历之后,即可认为针对分子图像的图遍历完成。Based on the above traversal method, after completing the branch decoding traversal under all branch angles in the angle set Memory, it can be considered that the graph traversal for the molecular image is completed.

可以理解的是,角度集合是一个用于存储待遍历的分支角度的集合,在图遍历之初,可以先初始化一个角度集合,此时的角度集合为空,即,图遍历之初,角度集合中不存在待遍历的分支角度。在图遍历的过程中,首次遍历到分支点,即首次解码到分支角度时,可以将首次解码到的分支角度存入角度集合,此时角度集合不再为空,角度集合中存储了待遍历的分支角度,且再后续遍历时,可以从角度集合中取出分支角度进行探索。由此,角度集合用于存储维护待遍历的分支角度,并且角度集合在针对分支角度的解码过程中,可以基于解码到的新的分支角度作相应的更新调整,以便于下一分支角度的解码。It can be understood that the angle set is a set for storing branch angles to be traversed. At the beginning of the graph traversal, an angle set can be initialized first. At this time, the angle set is empty, that is, at the beginning of the graph traversal, there are no branch angles to be traversed in the angle set. In the process of graph traversal, when the branch point is traversed for the first time, that is, when the branch angle is decoded for the first time, the branch angle decoded for the first time can be stored in the angle set. At this time, the angle set is no longer empty, and the branch angles to be traversed are stored in the angle set, and in subsequent traversals, the branch angles can be taken out from the angle set for exploration. Therefore, the angle set is used to store and maintain the branch angles to be traversed, and the angle set can be updated and adjusted accordingly based on the decoded new branch angles during the decoding process of the branch angles to facilitate the decoding of the next branch angle.

进一步地,在针对任一分支角度进行解码的过程中,需要先从角 度集合中取出该分支角度,即,确认该分支角度为正在探索或已经探索的分支角度,从而使得角度集合能够始终维护尚未探索的分支角度。Furthermore, in the process of decoding any branch angle, it is necessary to first decode the angle The branch angle is taken out from the degree set, that is, the branch angle is confirmed to be the branch angle being explored or has been explored, so that the angle set can always maintain the branch angle that has not been explored.

在取出该分支角度之后,即可对该分支角度下的分子结构进行解码,此处在解码时,可以沿着该分支角度进行分子结构的解码,即,将该分支角度作为条件信息来指导分子结构的解码,由此丰富分子结构解码的信息,提高分子结构解码的可靠性。After taking out the branch angle, the molecular structure under the branch angle can be decoded. Here, when decoding, the molecular structure can be decoded along the branch angle, that is, the branch angle is used as conditional information to guide the decoding of the molecular structure, thereby enriching the information of the molecular structure decoding and improving the reliability of the molecular structure decoding.

在针对该分支角度下的分子结构进行解码的过程中,如果解码到新的分支角度,可以基于新的分支角度,对于角度集合进行更新,具体可以是将新的分支角度作为尚未探索的分支角度加入角度集合以便后续解码。此外,在将新的分支角度作为尚未探索的分支角度加入角度集合之前,还可以将该分支角度与角度集合中的已有的各分支角度进行关系判断,即,判断新的分支角度和已有的分支角度是否构成分子结构中的重连关系,如果构成重连关系,则可以认为新的分支角度以及与之构成重连关系的已有分支角度均已完成探索,新的分支角度无需存入角度集合,与之构成重连关系的已有分支角度亦可以从角度集合中删除,由此使得角度集合能够始终维护尚未探索的分支角度。In the process of decoding the molecular structure under the branch angle, if a new branch angle is decoded, the angle set can be updated based on the new branch angle. Specifically, the new branch angle can be added to the angle set as a branch angle that has not been explored for subsequent decoding. In addition, before adding the new branch angle as a branch angle that has not been explored to the angle set, the relationship between the branch angle and the existing branch angles in the angle set can also be judged, that is, whether the new branch angle and the existing branch angle constitute a reconnection relationship in the molecular structure. If a reconnection relationship is formed, it can be considered that the new branch angle and the existing branch angles that constitute a reconnection relationship with it have been explored, and the new branch angle does not need to be stored in the angle set, and the existing branch angles that constitute a reconnection relationship with it can also be deleted from the angle set, so that the angle set can always maintain the branch angles that have not been explored.

步骤130,基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。Step 130: Determine the molecular structure corresponding to the molecular image based on the decoding results at each branch angle.

具体地,在针对分子图像中的各个分支角度下的分子结构进行解码之后,即可得到各个分支角度下的解码结果。此处的解码结果可以包括该分支角度下的化学键、角度、原子群等。在此基础上,结合各分支角度下解码结果,即可得到分子图像所对应的分子结构,此处的分子结构可以是基于有机化学结构式的标记语言记录的字符串,还可以是分子结构的表示图,或者还可以是分子结构在特定编码语言下的向量表示,本公开实施例对此不作具体限定。Specifically, after decoding the molecular structure at each branch angle in the molecular image, the decoding results at each branch angle can be obtained. The decoding results here may include chemical bonds, angles, atomic groups, etc. at the branch angle. On this basis, combined with the decoding results at each branch angle, the molecular structure corresponding to the molecular image can be obtained. The molecular structure here can be a string recorded in a markup language based on an organic chemical structural formula, or a representation diagram of the molecular structure, or a vector representation of the molecular structure in a specific coding language. The embodiments of the present disclosure do not specifically limit this.

本公开实施例提供的方法,增加了对于化学分子结构中各个分支 角度的解码和待探索的分支角度的维护机制,并将化学分子结构中的分支角度作为解码时的引导条件,以丰富分子结构解码的信息,提高分子结构解码的可靠性,提高面向复杂化学分子结构的解码准确性。The method provided in the embodiment of the present disclosure adds the ability to identify the branches in the chemical molecular structure. The decoding of angles and the maintenance mechanism of branch angles to be explored, and the branch angles in the chemical molecular structure are used as guiding conditions for decoding to enrich the information of molecular structure decoding, improve the reliability of molecular structure decoding, and improve the decoding accuracy for complex chemical molecular structures.

基于上述实施例,步骤120中,所述基于解码得到新的分支角度更新所述角度集合,包括:Based on the above embodiment, in step 120, updating the angle set based on the new branch angle obtained by decoding includes:

将所述新的分支角度分别与所述角度集合中的各已有分支角度,进行化学键检测;Perform chemical bond detection on the new branch angle and each existing branch angle in the angle set;

基于所述化学键检测的检测结果,更新所述角度集合。Based on the detection result of the chemical bond detection, the angle set is updated.

具体地,考虑到分子结构中可能存在重连关系,例如苯环中的6的单键首尾相连,如果不考虑解码所得的新的分支角度与角度集合中尚未探索的分支角度之间是否构成化学键,则很有可能导致重复遍历,即分别对两个分支角度分别下的分子结构进行解码,使得原本应该是一个分支下的分子结构被错误解码成为两个分子结构,影响分子结构识别的准确性。Specifically, considering that there may be reconnection relationships in the molecular structure, for example, the single bonds of 6 in the benzene ring are connected end to end, if we do not consider whether the new branch angle obtained by decoding constitutes a chemical bond with the branch angle that has not been explored in the angle set, it is very likely to lead to repeated traversal, that is, decoding the molecular structures under the two branch angles separately, so that the molecular structure that should have been under one branch is incorrectly decoded into two molecular structures, affecting the accuracy of molecular structure recognition.

因此,可以在解码得到新的分支角度之后,将新的分支角度分别与角度集合中的各已有分支角度进行化学键检测。此处,针对新的分支角度以及角度集合中的任一分支角度,可以对此两个分支角度之间是否构成化学键进行检测,由此得到的检测结果可以包括是否存在化学键,还可以在确定包括化学键的情况下进一步包括所构成化学键的类别,例如单键、双键等。Therefore, after decoding to obtain a new branch angle, the new branch angle can be respectively compared with each existing branch angle in the angle set for chemical bond detection. Here, for the new branch angle and any branch angle in the angle set, it is possible to detect whether a chemical bond is formed between the two branch angles, and the detection result obtained thereby can include whether a chemical bond exists, and can further include the type of the formed chemical bond, such as a single bond, a double bond, etc., when it is determined that a chemical bond is included.

在得到新的分支角度和角度集合中的各已有分支角度之间的化学键检测的检测结果之后,即可基于此更新角度集合。可以理解的是,如果新的分支角度与各已有分支角度之间均不存在化学键,说明暂未解码到重连关系,可以将新的分支角度也作为尚未探索的分支角度置入角度集合;如果新的分支角度与其中一个已有分支角度之间存在化学键,说明解码到重连关系,将与该新的分支角度之间存在化学键的 已有分支角度从角度集合中删除,并且,不将新的分支角度存入角度集合。After obtaining the test results of the chemical bond detection between the new branch angle and each existing branch angle in the angle set, the angle set can be updated based on this. It can be understood that if there is no chemical bond between the new branch angle and each existing branch angle, it means that the reconnection relationship has not been decoded yet, and the new branch angle can also be placed in the angle set as a branch angle that has not been explored; if there is a chemical bond between the new branch angle and one of the existing branch angles, it means that the reconnection relationship has been decoded, and the chemical bond between the new branch angle and the new branch angle will be placed in the angle set. Existing branch angles are deleted from the angle collection, and new branch angles are not stored in the angle collection.

基于上述任一实施例,步骤120中,所述基于所述化学键检测的检测结果,更新所述角度集合,包括:Based on any of the above embodiments, in step 120, updating the angle set based on the detection result of the chemical bond detection includes:

在所述检测结果指示不存在化学键的情况下,将所述新的分支角度存入所述角度集合;When the detection result indicates that there is no chemical bond, storing the new branch angle into the angle set;

在所述检测结果指示存在化学键的情况下,将与所述新的分支角度构成化学键的分支角度从所述角度集合中删除。In the case where the detection result indicates the presence of a chemical bond, the branch angle that forms a chemical bond with the new branch angle is deleted from the angle set.

具体地,针对新的分支角度,该分支角度与各已有分支角度之间的化学键检测的检测结果中,如果所有检测结果均指示不存在化学键,即新的分支角度与各已有分支角度之间均不存在化学键,说明暂未解码到重连关系,新的分支角度也需要进行探索,此时可以将新的分支角度存入角度集合,以使得角度集合能够继续维护所有尚未探索的分支角度;Specifically, for a new branch angle, in the detection results of the chemical bond detection between the branch angle and each existing branch angle, if all the detection results indicate that there is no chemical bond, that is, there is no chemical bond between the new branch angle and each existing branch angle, it means that the reconnection relationship has not been decoded yet, and the new branch angle also needs to be explored. At this time, the new branch angle can be stored in the angle set, so that the angle set can continue to maintain all branch angles that have not been explored;

如果存在一个检测结果指示存在化学键,也就是说新的分支角度与角度集合中的一个已有分支角度之间存在化学键,此时新的分之角度与该已有分支角度之间存在重连关系,可以认为新的分支角度以及与之构成重连关系的已有分支角度均已完成探索,新的分支角度无需存入角度集合,与之构成重连关系的已有分支角度亦可以从角度集合中删除,由此使得角度集合能够始终维护尚未探索的分支角度。If there is a detection result indicating the existence of a chemical bond, that is, there is a chemical bond between the new branch angle and an existing branch angle in the angle set, at this time there is a reconnection relationship between the new branch angle and the existing branch angle, it can be considered that the new branch angle and the existing branch angle that forms a reconnection relationship with it have been explored, and the new branch angle does not need to be stored in the angle set, and the existing branch angle that forms a reconnection relationship with it can also be deleted from the angle set, so that the angle set can always maintain the branch angles that have not been explored.

基于上述任一实施例,步骤120中,所述以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,包括:Based on any of the above embodiments, in step 120, the decoding of the molecular structure at the branching angle based on the image features of the molecular image and guided by the branching angle includes:

基于所述分支角度的解码特征,以及所述分支角度下的前一个解码时刻的解码状态,确定所述分支角度下的当前解码时刻的视觉上下文特征; Determining visual context features at a current decoding moment at the branch angle based on the decoding features of the branch angle and a decoding state at a previous decoding moment at the branch angle;

基于所述视觉上下文特征,对所述图像特征进行当前解码时刻的分子结构解码,得到当前解码时刻的解码状态,并将所述当前解码时刻作为前一个解码时刻返回解码,直至所述分支角度下的解码结束。Based on the visual context feature, the molecular structure of the image feature at the current decoding moment is decoded to obtain the decoding state at the current decoding moment, and the current decoding moment is returned as the previous decoding moment for decoding until the decoding at the branch angle is completed.

具体地,在针对一个分支角度下的分子结构进行解码的过程中,可以将分支角度作为分子结构解码的引导条件。在遇到分支时,可以沿着从角度集合中取出的分支角度的方向继续解码,并将此时应用到的分支角度引导针对该分支角度下的分子结构进行解码时的视觉上下文特征的生成。Specifically, in the process of decoding a molecular structure at a branch angle, the branch angle can be used as a guiding condition for decoding the molecular structure. When a branch is encountered, decoding can continue along the direction of the branch angle taken from the angle set, and the branch angle applied at this time guides the generation of visual context features when decoding the molecular structure at the branch angle.

即,在生成一个解码时刻的视觉上下文特征时,相较于现有技术中仅应用前一个解码时刻的解码状态确定当时解码时刻的视觉上下文特征,还另外考虑了分支角度的解码特征。可以理解的是,此处,分支角度的解码特征是在分子结构的解码过程中解码到该分支角度时存储的,分支角度的解码特征具体可以包括该分支角度的注意权重信息和状态特征。That is, when generating a visual context feature at a decoding moment, compared with the prior art that only applies the decoding state of the previous decoding moment to determine the visual context feature at the current decoding moment, the decoding feature of the branch angle is also considered. It can be understood that here, the decoding feature of the branch angle is stored when the branch angle is decoded during the decoding process of the molecular structure, and the decoding feature of the branch angle can specifically include the attention weight information and state feature of the branch angle.

例如,针对当前解码时刻的视觉上下文特征的计算,可以表示为如下公式:


For example, the calculation of the visual context features at the current decoding moment can be expressed as the following formula:


式中,et,i为第t个解码时刻的特征图中第i个位置的能量,w、Wx、Wy、WS、Wa、Wsp、Wap均为注意力模块的投影参数。xi为分子图像在第i个位置的图像特征,为第t-1个解码时刻的解码 结果,st-1为第t-1个解码时刻的解码状态,at-1、at分别为第t-1个解码时刻和第t个解码时刻的注意力权重,ab、sb分别为分支角度解码时的注意力权重信息和状态特征。需要说明的是,当没有分之角度进行解码时,ab和sb均为零向量,此时et,i的计算公式与常规的字符串解码器中视觉上下文特征获取方式中et,i的计算公式一致。Where, e t,i is the energy of the i-th position in the feature map at the t-th decoding moment, w, W x , W y , W S , Wa , W sp , and W ap are all projection parameters of the attention module. xi is the image feature of the molecular image at the i-th position, is the decoding at the t-1th decoding time As a result, s t-1 is the decoding state at the t-1th decoding time, a t-1 and a t are the attention weights at the t-1th decoding time and the tth decoding time, respectively, and a b and s b are the attention weight information and state features during branch angle decoding, respectively. It should be noted that when there is no branch angle for decoding, a b and s b are both zero vectors, and the calculation formula of e t,i is consistent with the calculation formula of e t,i in the visual context feature acquisition method in the conventional string decoder.

at,i为第t个解码时刻在第i个位置处的注意力权重,h和w分别为分子图像的高和宽;ct为第t个解码时刻的视觉上下文特征。a t,i is the attention weight at the i-th position at the t-th decoding moment, h and w are the height and width of the molecule image respectively; c t is the visual context feature at the t-th decoding moment.

在得到当前解码时刻的视觉上下文特征之后,即可基于此进行当前解码时刻的分子结构解码,从而得到当前解码时刻的解码状态,具体可以表示为如下公式:

pt=softmax(Wcst);
After obtaining the visual context features at the current decoding moment, the molecular structure decoding at the current decoding moment can be performed based on the features, thereby obtaining the decoding state at the current decoding moment, which can be specifically expressed as the following formula:

p t = softmax(W c s t );

式中,st即当前解码时刻的解码状态,GRU表示递归神经网络的计算单元。pt表示当前解码时刻所输出解码结果的概率分布,Wc为分类层的参数。Where s t is the decoding state at the current decoding moment, GRU represents the computational unit of the recursive neural network, p t represents the probability distribution of the decoding result output at the current decoding moment, and W c is the parameter of the classification layer.

可以理解的是,在完成当前解码时刻的分子结构解码之后,即可将当前解码时刻的解码状态作为前一个解码时刻的解码状态,转而执行下一个解码时刻的分子结构解码。并且,在此过程中,在对一个分支角度下的分子结构进行解码的不同时刻,所应用到的是同一个分支角度的解码特征。It is understandable that after the molecular structure decoding at the current decoding moment is completed, the decoding state at the current decoding moment can be used as the decoding state at the previous decoding moment, and the molecular structure decoding at the next decoding moment can be performed. In addition, in this process, at different moments of decoding the molecular structure at a branch angle, the decoding features of the same branch angle are applied.

本公开实施例中,将上述实现分子结构解码的神经网络结构,记为随机条件引导解码器。随机条件引导解码器在复杂结构的泛化方面显著优于传统的字符串解码器,而不增加显著的额外参数或计算负担,采用条件引导机制和路径选择能够有效提高多路径解码的准确性。In the disclosed embodiment, the neural network structure for implementing molecular structure decoding is recorded as a random conditional guided decoder. The random conditional guided decoder is significantly better than the traditional string decoder in generalizing complex structures without adding significant additional parameters or computational burden. The use of conditional guidance mechanism and path selection can effectively improve the accuracy of multi-path decoding.

基于上述任一实施例,步骤120包括:Based on any of the above embodiments, step 120 includes:

基于识别模型,从角度集合中取出一个分支角度,以所述分支角 度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Based on the recognition model, a branch angle is taken from the angle set, and the branch angle The molecular structure under the branch angle is decoded based on the image features of the molecular image, and the angle set is updated based on the new branch angle obtained by decoding for decoding the molecular structure under the next branch angle, until the angle set is empty;

所述识别模型基于样本图像、以及所述样本图像对应的分子结构标签训练得到;The recognition model is trained based on the sample image and the molecular structure label corresponding to the sample image;

所述分子结构标签是将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图之后进行图遍历得到。The molecular structure label is obtained by connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure graph and then performing graph traversal.

具体地,步骤120可以通过预先训练好的识别模型实现。此处,识别模型可以是编码器-解码器的形式。针对识别模型的训练,可以通过有监督学习实现。可以理解的是,有监督学习的样本即绘制有化学分子结构的样本图像,有监督学习的标签即样本图像对应的分子结构标签,此处的分子结构标签以语言的形式反映分子结构。Specifically, step 120 can be implemented by a pre-trained recognition model. Here, the recognition model can be in the form of an encoder-decoder. The training of the recognition model can be implemented by supervised learning. It can be understood that the sample of supervised learning is a sample image with a chemical molecular structure drawn, and the label of supervised learning is the molecular structure label corresponding to the sample image, where the molecular structure label reflects the molecular structure in the form of language.

常规的有机化学结构式的标记语言可以是Chemfig、SMILES等。与最常用的结构标记语言SMILES相比,Chemfig几乎不需要抽象的化学知识,它的设计目的是利用化学结构图形本身,提高相关性和准确性。Chemfig的语法中还提供了针对“角度”的描述,可以用来指定分子中键的方向。在图3示出的手写分子图像中,原子“N”连接着两个双键,一个指向右上方向,另一个指向右下方向。Chemfig语法中的角码如“[1]”和“[-1]”,可以用来表示这两个双键的近似取向,由此,分子的视觉形态的呈现显得更加准确、全面。Conventional markup languages for organic chemical structures can be Chemfig, SMILES, etc. Compared with the most commonly used structural markup language SMILES, Chemfig requires almost no abstract chemical knowledge. It is designed to use the chemical structure graphics themselves to improve relevance and accuracy. The syntax of Chemfig also provides a description of "angle", which can be used to specify the direction of the bonds in the molecule. In the handwritten molecular image shown in Figure 3, the atom "N" is connected to two double bonds, one pointing to the upper right and the other pointing to the lower right. The angle codes in the Chemfig syntax, such as "[1]" and "[-1]", can be used to indicate the approximate orientation of the two double bonds, thereby making the visual presentation of the molecule more accurate and comprehensive.

然而,如果直接使用原始Chemfig标记语言作为识别模型训练的标签,依然存在以下问题:However, if the original Chemfig markup language is directly used as the label for recognition model training, the following problems still exist:

一则,Chemfig存在语法歧义:由于起始点和遍历顺序不同,有多个正确的Chemfig序列可以表示相同的分子图像。这种模糊性是不可避免的,并且增加了模型学习的难度。First, Chemfig has grammatical ambiguity: due to different starting points and traversal orders, there are multiple correct Chemfig sequences that can represent the same molecular image. This ambiguity is inevitable and increases the difficulty of model learning.

二则,Chemfig语法存在复杂性:需要将先验规则和领域知识纳 入语法以保持其简洁性。例如,使用括号对原子进行分组等规则,以及需要删除冗余的化学符号和价破折号来降低语法复杂性。此外,像IUPAC(International Union of Pure and Applied Chemistry,国际纯粹与应用化学联合会))命名规则这样的领域知识对于确保正确标记化合物结构是必要的。这些规则和领域知识的使用增加了Chemfig语法的复杂性。例如,苯环被简单地表示为“*6(––)”,六个单键的方向需要根据苯环的规则自动推断出来。这些先验规则很复杂,增加了模型的学习难度。Second, Chemfig syntax is complex: it is necessary to incorporate prior rules and domain knowledge. The grammar is built into the Chemfig framework to keep it simple. For example, rules such as using brackets to group atoms, and the need to remove redundant chemical symbols and valence dashes to reduce grammatical complexity. In addition, domain knowledge such as IUPAC (International Union of Pure and Applied Chemistry) naming rules are necessary to ensure that compound structures are correctly labeled. The use of these rules and domain knowledge increases the complexity of Chemfig's grammar. For example, a benzene ring is simply represented as "*6(––)", and the directions of the six single bonds need to be automatically inferred based on the rules for benzene rings. These a priori rules are complex and increase the difficulty of learning the model.

为了克服上述问题,本公开实施例中提出将样本图像对应的分子式中的原子群和化学键进行解析并连接成分子结构图之后进行图遍历,以得到分子结构标签。In order to overcome the above problems, the disclosed embodiment proposes parsing the atomic groups and chemical bonds in the molecular formula corresponding to the sample image and connecting them into a molecular structure graph, and then performing graph traversal to obtain a molecular structure label.

此处,考虑到样本图像对应的分子式可以通过不同的字符串表示,为了解决这种语法层面上的歧义,本公开实施例中从分子式的字符串中手动解析和恢复原子群和化学键,然后将得到的所有原子群和化学键连接起来生成一个图,此处记为分子结构图。Here, considering that the molecular formula corresponding to the sample image can be represented by different character strings, in order to resolve this ambiguity at the grammatical level, in the embodiment of the present disclosure, the atomic groups and chemical bonds are manually parsed and restored from the molecular formula character string, and then all the obtained atomic groups and chemical bonds are connected to generate a graph, which is recorded here as a molecular structure graph.

例如,“HO-**6(---(-COOH)---)”、“COOH-[4]**6(---(-OH)---)”和“**6([:30]-(-OH)---(-COOH)--)”为同一个分子式的不同字符串表示,通过解析和恢复原子群和化学键,可以构建出如图4所示的分子结构图,从而以结构图的形式实现表示上的统一。For example, "HO-**6(---(-COOH)---)", "COOH-[4]**6(---(-OH)---)" and "**6([:30]-(-OH)---(-COOH)--)" are different string representations of the same molecular formula. By parsing and restoring the atomic groups and chemical bonds, a molecular structure diagram as shown in Figure 4 can be constructed, thereby achieving unified representation in the form of a structure diagram.

图4中,字符串被表示为原子群,如“HO”、“COOH”。环形苯分子结构被视为特殊的原子群。原子群之间的线条表示化学键,可以是单键“-”、双键“=”或三键。一个原子群可以通过单个或多个化学键与另一个原子群相连。通过使用原子群作为顶点,化学键作为边,即可得到分子结构图,由此,即便使用不同的Chemfig标记字符串,同一分子的图形表示也是相同的,从而消除了标签中可能存在的歧义。In Figure 4, character strings are represented as atom groups, such as "HO", "COOH". The ring-shaped benzene molecular structure is regarded as a special atom group. The lines between atom groups represent chemical bonds, which can be single bonds "-", double bonds "=" or triple bonds. An atom group can be connected to another atom group through a single or multiple chemical bonds. By using atom groups as vertices and chemical bonds as edges, a molecular structure diagram can be obtained. Therefore, even if different Chemfig label strings are used, the graphical representation of the same molecule is the same, thus eliminating possible ambiguity in the labels.

由此得到的分子结构图,是一个复杂的数据结构,还需要通过图 遍历,将分子结构图转换为适合模型训练的标签形式。此处,具体需要通过图遍历,将分子结构图转换为等价的一维文本表示,此处的转换规则可以是固定规则,具体可以是从一个特定的点开始遍历分子结构图,将遍历到的节点(原子群)和边(化学键)附加到字符串的末尾,由此得到简洁并且不存在语法歧义的分子结构标签。The molecular structure diagram obtained is a complex data structure and needs to be Traverse and convert the molecular structure graph into a label format suitable for model training. Here, the molecular structure graph needs to be converted into an equivalent one-dimensional text representation through graph traversal. The conversion rule here can be a fixed rule, which can be to traverse the molecular structure graph from a specific point and append the traversed nodes (atomic groups) and edges (chemical bonds) to the end of the string, thereby obtaining a concise molecular structure label without grammatical ambiguity.

本公开实施例提供的方法,将分子式中的原子群和化学键连接成分子结构图之后进行图遍历,以得到简洁且不存在语法歧义的分子结构标签,能够降低识别模型有监督学习的难度,提高基于识别模型进行分子结构识别的可靠性。The method provided by the embodiment of the present disclosure connects the atomic groups and chemical bonds in the molecular formula into a molecular structure graph and then performs a graph traversal to obtain a concise molecular structure label without grammatical ambiguity, which can reduce the difficulty of supervised learning of the recognition model and improve the reliability of molecular structure recognition based on the recognition model.

基于上述任一实施例,所述分子结构标签的确定步骤包括:Based on any of the above embodiments, the step of determining the molecular structure tag includes:

将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图;Connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure diagram;

遍历所述分子结构图,并基于遍历所得的原子群、化学键、角度、嵌套符号和重连标记生成所述分子结构标签。The molecular structure graph is traversed, and the molecular structure label is generated based on the atomic groups, chemical bonds, angles, nesting symbols and reconnection marks obtained through the traversal.

具体地,通过对分子式进行结构解析和连接所得的分子结构图,是一个复杂的数据结构,必须将其转换为适合模型训练的形式。对于编码器-解码器结构的识别模型来说,适合训练的形式通常是一维字符串或标准化标签。标准化标签涉及将分子结构图转换为等效的一维文本表示形式。Specifically, the molecular structure graph obtained by structural analysis and connection of molecular formulas is a complex data structure that must be converted into a form suitable for model training. For the recognition model of the encoder-decoder structure, the form suitable for training is usually a one-dimensional string or a standardized label. Standardized labels involve converting the molecular structure graph into an equivalent one-dimensional text representation.

为了保证转换得到分子结构标签的规则保持一致且没有歧义,具体的规则可以是预先设定好的固定规则。针对于分子结构图的遍历,可以从特定点开始遍历分子结构图,将节点(原子群)和边(化学键)附加到字符串的末尾。遍历完成后,即可得到标准化标签。例如,对图4示出的分子结构图进行遍历,可以得到如下标准化标签:In order to ensure that the rules for converting molecular structure labels are consistent and unambiguous, the specific rules can be pre-set fixed rules. For the traversal of the molecular structure graph, the molecular structure graph can be traversed from a specific point, and the nodes (atomic groups) and edges (chemical bonds) are appended to the end of the string. After the traversal is completed, a standardized label can be obtained. For example, the molecular structure graph shown in Figure 4 is traversed to obtain the following standardized labels:

H O-[:0]?[a](-[:60]-[:0]-[:300](-[:0]C O O H)-[:240]-[:180]?[a,{-}](--[:60]\circle)) H O-[:0]? [a](-[:60]-[:0]-[:300](-[:0]C O O H)-[:240]-[:180]?[a,{-}](--[:60]\circle))

其中,各单元由空格分隔。图遍历可以使用深度优先搜索(Depth-First Search,DFS)。以上标准化标签可以包含四类元素,即“原子群”、“化学键”、“角度”、“嵌套符号”和“重连标记”。具体在上述标准化标签中,“H O”表示原子群,“?[a]”、“?[a,{-}]”为重连标记,“-”表示化学键,“[:0]”表示角度,“(”表示嵌套符号。Among them, each unit is separated by a space. Graph traversal can use Depth-First Search (DFS). The above standardized labels can contain four types of elements, namely "atom group", "chemical bond", "angle", "nested symbol" and "reconnection mark". Specifically in the above standardized labels, "H O" represents the atomic group, "?[a]", "?[a,{-}]" are reconnection marks, "-" represents the chemical bond, "[:0]" represents the angle, and "(" represents the nested symbol.

在此基础上,可以对标准化标签进行整合,从而得到特定于结构的分子结构标签。其中,如果原子组不包含任何字符,可以省略。而实体字符可以使用LaTeX表示法进行表示。由于“角度”和“化学键”在视觉信息中紧密相关,可以在标准化标签中将每个化学键后附加相应的角度作为"[:]",以表示“键角”建模单元。角度值在图形构建和输出过程中可以根据格式计算得出。此外,可以使用嵌套符号“()”来表示嵌套分支。此外,可以保留原始的Chemfig语法用于重连标记,由"?[a]"表示,该符号代表被"?[a,-]"表示的循环单位所环绕的单元。当发生重连时,重构的角度值不会被表示出来。最后,还可以用“○”表示苯中的特定原子,并构造一个虚拟的键角单元"–[:]",以表示“○”与环上任意原子之间的连接。On this basis, the standardized labels can be integrated to obtain structure-specific molecular structure labels. Among them, if the atom group does not contain any characters, it can be omitted. The entity characters can be represented using LaTeX notation. Since "angle" and "chemical bond" are closely related in visual information, the corresponding angle can be appended to each chemical bond as "[:]" in the standardized label to represent the "bond angle" modeling unit. The angle value can be calculated according to the format during the graphic construction and output process. In addition, the nested symbol "()" can be used to represent nested branches. In addition, the original Chemfig syntax can be retained for reconnection labeling, represented by "?[a]", which represents the unit surrounded by the cyclic unit represented by "?[a,-]". When reconnection occurs, the reconstructed angle value will not be represented. Finally, "○" can be used to represent a specific atom in benzene, and a virtual bond angle unit "–[:]" can be constructed to represent the connection between "○" and any atom on the ring.

例如,针对上文示出的标准化标签,可以整合形成图5示出的分子结构标签,图5示出的分子结构标签中,标记了不同角度下的嵌套关系,以及重连关系。其中,以“\eob”表示一个分支角度下的解码完成,以“\angle[:60]”与“-[:60]”之间带有箭头的连线表示嵌套关系,以“\angle[:300]”与“\angle[:120]”之间的双箭头连线和“reconnection”表示重连标记。For example, the standardized labels shown above can be integrated to form the molecular structure label shown in Figure 5, in which the nested relationship and the reconnection relationship at different angles are marked. Among them, "\eob" indicates that the decoding is completed at a branch angle, the line with an arrow between "\angle[:60]" and "-[:60]" indicates the nested relationship, and the double-arrow line between "\angle[:300]" and "\angle[:120]" and "reconnection" indicate the reconnection mark.

本公开实施例提供的方法,将分子式中的原子群和化学键连接成分子结构图,并通过遍历分子结构图形成分子结构标签,由此形成的分子结构标签相较于主流语言SMILES,具有与图像一致性更高的优势,更有利于模型学习。此外,分子结构标签的语法不受化学知识的 限制,这使它能够表示错误的或不存在的分子结构,并使其更加通用。上述方法为分子结构的表征提供了一种创新的方法,在化学结构识别和分析的各个领域具有潜在的应用前景。The method provided by the embodiment of the present disclosure connects the atomic groups and chemical bonds in the molecular formula into a molecular structure graph, and forms a molecular structure label by traversing the molecular structure graph. The molecular structure label thus formed has the advantage of being more consistent with the image than the mainstream language SMILES, and is more conducive to model learning. In addition, the syntax of the molecular structure label is not affected by chemical knowledge. This enables it to represent erroneous or non-existent molecular structures and makes it more versatile. The above method provides an innovative approach for the characterization of molecular structures and has potential applications in various fields of chemical structure identification and analysis.

基于上述任一实施例,识别模型的训练步骤包括:Based on any of the above embodiments, the training step of the recognition model includes:

基于初始模型,对所述样本图像进行分子结构识别,得到所述分子结构识别过程中解码到的样本分支角度与样本角度集合中已有分支角度之间的化学键检测结果,以及所述样本图像的结构识别结果;Based on the initial model, molecular structure recognition is performed on the sample image to obtain a chemical bond detection result between the sample branch angle decoded in the molecular structure recognition process and the existing branch angles in the sample angle set, as well as a structural recognition result of the sample image;

基于所述结构识别结果和所述分子结构标签,以及所述化学键检测检测和所述分子结构标签中的重连标记,对所述初始模型进行参数迭代,得到所述识别模型。Based on the structure recognition result and the molecular structure label, as well as the chemical bond detection and the reconnection mark in the molecular structure label, the initial model is iterated with parameters to obtain the recognition model.

具体地,针对于识别模型,可以获取编码器+解码器结构的初始模型,此处初始模型的模型参数可以是初始化得到的。在训练过程中,可以基于初始模型,对样本图像进行分子结构识别,具体可以基于初始模型,对样本图像进行图像特征提取,随后从样本角度集合中取出一个样本分支角度,以该样本分支角度为引导,基于样本图像的图像特征对该样本分支角度下的分子结构进行解码,并基于解码得到新的样本分支角度更新样本角度集合以供下一样本分支角度下的分子结构解码,直至样本角度集合为空。Specifically, for the recognition model, an initial model of the encoder + decoder structure can be obtained, where the model parameters of the initial model can be initialized. During the training process, the molecular structure of the sample image can be recognized based on the initial model. Specifically, the image feature of the sample image can be extracted based on the initial model, and then a sample branch angle is taken out from the sample angle set. The sample branch angle is used as a guide, and the molecular structure under the sample branch angle is decoded based on the image features of the sample image, and the sample angle set is updated based on the new sample branch angle obtained by decoding for the molecular structure decoding under the next sample branch angle, until the sample angle set is empty.

可以理解的是,在初始模型解码得到新的样本分支角度时,需要基于解码得到的新的样本分支角度对样本角度集合进行更新,在对样本角度集合进行更新时,需要将新的样本分支角度分别与样本角度集合中的各已有分支角度进行化学键检测,由此可以得到样本分支角度与样本角度集合中已有分支角度之间的化学键检测结果。It can be understood that when the initial model is decoded to obtain a new sample branch angle, the sample angle set needs to be updated based on the new sample branch angle obtained by decoding. When the sample angle set is updated, the new sample branch angle needs to be chemically bonded with each existing branch angle in the sample angle set respectively, thereby obtaining the chemical bond detection result between the sample branch angle and the existing branch angles in the sample angle set.

此处,化学键检测结果中化学键的有无,用于反映两个样本分支角度之间是否存在重连关系。可以将化学键检测结果与分子结构标签中的重连标记进行比对,从而从重连关系检测的角度衡量初始模型的 训练损失。Here, the presence or absence of chemical bonds in the chemical bond detection results is used to reflect whether there is a reconnection relationship between the branch angles of the two samples. The chemical bond detection results can be compared with the reconnection mark in the molecular structure label to measure the initial model from the perspective of reconnection relationship detection. Training loss.

此外,还可以将结构识别结果和分子结构标签进行比对,从而从分子结构识别的角度衡量初始模型的训练损失。In addition, the structure recognition results and molecular structure labels can be compared to measure the training loss of the initial model from the perspective of molecular structure recognition.

进一步地,可以基于如下公式表示分子结构识别的损失Lce
Furthermore, the loss L ce of molecular structure recognition can be expressed based on the following formula:

式中,Lce为交叉熵损失,V表示模型单位字符的数量,yti为分子结构标签在第t个解码时刻是否为第i个字符,pti表示结构识别结果在第t个解码时刻为第i个字符的概率。Where Lce is the cross entropy loss, V represents the number of unit characters of the model, yti represents whether the molecular structure label is the i-th character at the t-th decoding time, and pti represents the probability that the structure recognition result is the i-th character at the t-th decoding time.

可以基于如下公式表示重连关系的检测损失Lbc,即由循环造成的损失:

qtb=softmax(Wmsb+Wost);
The detection loss L bc of the reconnection relationship, ie, the loss caused by the cycle, can be expressed based on the following formula:

q tb =softmax(W m s b + W o s t );

式中,st为当前解码时刻t解码得到的分支角度的解码状态。Wm和Wo均是用于化学键检测的参数。存储在角度集合中的已有分支角度b的状态特征sb与分支角度t之间的化学键检测概率分布表示为其中N为化学键的类型总数,N+1包括N种化学键以及不存在化学键的情况。Where s t is the decoding state of the branch angle obtained by decoding at the current decoding time t. W m and W o are parameters for chemical bond detection. The chemical bond detection probability distribution between the state feature s b of the existing branch angle b stored in the angle set and the branch angle t is expressed as Where N is the total number of chemical bond types, and N+1 includes N types of chemical bonds and the case where there are no chemical bonds.

B为角度集合中的分支角度总数,ztbi为分子结构标签在第t个解码时刻检测到与分支角度b之间的化学键类型是否为i,qtbi表示化学键检测结果中在t个解码时刻检测到与分支角度b之间的化学键类型为i的概率。B is the total number of branch angles in the angle set, z tbi is whether the chemical bond type between the molecular structure label and the branch angle b is i at the tth decoding time, and q tbi represents the probability that the chemical bond type i between the branch angle b is detected at the tth decoding time in the chemical bond detection result.

结合上述两个损失,即可得到用于识别模型训练的整体损失,此处的整体损失L可以表示为Lce+Lbc,也可以表示为Lce和Lbc加权求和的结果,本公开实施例对此不作具体限定。在得到整体损失之后,即可基于整体损失对初始模型进行参数迭代,从而得到训练完整的识别模型。 By combining the above two losses, the overall loss for the recognition model training can be obtained. The overall loss L here can be expressed as L ce +L bc , or as the result of the weighted sum of L ce and L bc , which is not specifically limited in the embodiments of the present disclosure. After obtaining the overall loss, the parameters of the initial model can be iterated based on the overall loss, thereby obtaining a fully trained recognition model.

本公开实施例提供的方法,通过端到端的建模和训练,实现了面向分子图像的分子结构识别。The method provided in the embodiment of the present disclosure realizes molecular structure recognition for molecular images through end-to-end modeling and training.

基于上述任一实施例,初始模型为编码器+解码器的结构。其中,编码器为DenseNet,包括三个密集块,用于将输入的RGB三通道图像转换为高维特征。每个密集块的生长速率和深度分别设置为24和32。此外,编码器和解码器均采用隐藏状态维为256的GRU作为RNN的循环单元,注意力投影参数的维数设置为128。此外,嵌入参数的维数设置为256,并应用15%的drop-out率。对于解码器,化学键检测分类的投影参数维数设置为256。Based on any of the above embodiments, the initial model is an encoder + decoder structure. Among them, the encoder is DenseNet, which includes three dense blocks for converting the input RGB three-channel image into high-dimensional features. The growth rate and depth of each dense block are set to 24 and 32, respectively. In addition, both the encoder and the decoder use a GRU with a hidden state dimension of 256 as the recurrent unit of the RNN, and the dimension of the attention projection parameter is set to 128. In addition, the dimension of the embedding parameter is set to 256, and a drop-out rate of 15% is applied. For the decoder, the projection parameter dimension of the chemical bond detection classification is set to 256.

针对初始模型进行参数迭代所应用的优化器可以是Adam,初始学习率为2e-4,学习率衰减策略为多步衰减,使用Pytorch的MultiStepLR来调整学习率,衰减因子gamma设置为0.5。The optimizer used for parameter iteration of the initial model can be Adam, the initial learning rate is 2e-4, the learning rate decay strategy is multi-step decay, Pytorch's MultiStepLR is used to adjust the learning rate, and the decay factor gamma is set to 0.5.

基于上述任一实施例,本公开实施例提供一种分子结构识别方法,该分子结果识别方法基于识别模型实现。此处的识别模型包括不同于字符串解码器的随机条件解码器,随机条件解码器结合了三种机制来解决现有技术中存在的问题:条件引导注意力、循环和路径选择。Based on any of the above embodiments, the disclosed embodiments provide a molecular structure recognition method, which is implemented based on a recognition model. The recognition model here includes a random conditional decoder different from a string decoder, and the random conditional decoder combines three mechanisms to solve the problems existing in the prior art: conditional guided attention, loop and path selection.

其中,条件引导注意力机制能够利用分子结构式的自然图结构,将其识别过程视为图遍历问题。当识别模型遍历图时,会遇到多个分支角度,这些角度在提出的建模单元中的顺序遵循固定的逆时针方向。然而,如果仅仅根据固定的角度顺序进行解码,由于后期解码时间的延长,模型可能会忘记哪些角度单元尚未解码。为了解决这个问题,在条件引导注意力机制下,可以使用分支角度作为条件信息来指导解码过程。在识别模型遇到分支时,会沿着指定的分支角度方向继续解码。更新后的解码器不再使用“(”和“)”来指示分支的开始和结束。取而代之的是,首先预测每个分支的分支角度,即“\angle[:<angle value>]”,单独存储解码得到的各个分支角度的解码特征至角度集合 Memory,即各个分支角度的上下文和注意力权重信息。Among them, the conditionally guided attention mechanism can take advantage of the natural graph structure of molecular structures and regard its recognition process as a graph traversal problem. When the recognition model traverses the graph, it encounters multiple branch angles, and the order of these angles in the proposed modeling unit follows a fixed counterclockwise direction. However, if decoding is performed only according to a fixed angle order, the model may forget which angle units have not yet been decoded due to the extension of the later decoding time. To solve this problem, under the conditionally guided attention mechanism, the branch angle can be used as conditional information to guide the decoding process. When the recognition model encounters a branch, it continues decoding along the specified branch angle direction. The updated decoder no longer uses "(" and ")" to indicate the start and end of the branch. Instead, the branch angle of each branch is first predicted, that is, "\angle[:<angle value>]", and the decoded features of each branch angle obtained by decoding are stored separately into the angle set. Memory, that is, the context and attention weight information of each branch angle.

随后在针对一个分支角度下的分子结构的解码过程中,当“\eob”被解码时,表明没有额外的分支角度需要预测,可以从角度集合Memory中选择一个分支角度的解码特征作为继续解码过程的条件。Subsequently, in the decoding process of the molecular structure at a branch angle, when "\eob" is decoded, it indicates that there are no additional branch angles to be predicted, and a decoding feature of a branch angle can be selected from the angle set Memory as a condition for continuing the decoding process.

此外,图结构与树结构的主要区别在于图结构具有循环特性。在本公开实施例提供的分子结构识别方法中,与循环对应的分支角度已经被存储在角度集合Memory中,还没有被解码。因此,可以构建一个简单的多标签分类模块用于进行化学键检测,来确定环路角度对应的方向,同时对环路键的类型(如单键、双键等)进行分类。化学键检测所得的结果可能是空或者键的类型,空表示没有一个具有尚未解码的相应分支角度的循环。如果检测结果中存在循环的化学键,则将对应的分支角度从角度集合Memory中删除,并且不存储当前时刻解码所得的分支角度。相反,如果不存在循环,即检测结果为空,则将当前时刻的分支角度保存在角度集合Memory中,以供将来的解码选择。In addition, the main difference between the graph structure and the tree structure is that the graph structure has a cyclic characteristic. In the molecular structure recognition method provided by the present disclosure embodiment, the branch angle corresponding to the loop has been stored in the angle set Memory and has not been decoded. Therefore, a simple multi-label classification module can be constructed for chemical bond detection to determine the direction corresponding to the loop angle and classify the type of loop bond (such as single bond, double bond, etc.). The result obtained by chemical bond detection may be empty or the type of bond, and empty means that there is no loop with a corresponding branch angle that has not been decoded. If there is a cyclic chemical bond in the test result, the corresponding branch angle is deleted from the angle set Memory, and the branch angle obtained by decoding at the current moment is not stored. On the contrary, if there is no loop, that is, the test result is empty, the branch angle at the current moment is saved in the angle set Memory for future decoding selection.

最后,随机条件解码器的识别过程可以被视为图遍历问题,其中对图的不同遍历可以产生多个目标序列。因此,单个图可以有多个训练标签。尽管条件引导的注意力机制仍然根据固定的逆时针顺序进行解码,但它可能导致在复杂或不常见的结构中出现过拟合和识别错误。因此,本公开实施例可以结合路径选择机制进行解码,该机制在训练过程中随机选择不同的路径,以使用条件引导的注意力机制提高视觉信息与解码字符之间的对齐性。在推理过程中,可以使识别模型尝试解码存储在角度集合中的所有分支角度,并参与计算波束搜索路径得分PK,从而选择具有最高得分的路径以继续解码。Finally, the recognition process of the random conditional decoder can be viewed as a graph traversal problem, where different traversals of the graph can produce multiple target sequences. Therefore, a single graph can have multiple training labels. Although the conditionally guided attention mechanism still decodes according to a fixed counterclockwise order, it may cause overfitting and recognition errors in complex or uncommon structures. Therefore, the disclosed embodiment can be combined with a path selection mechanism for decoding, which randomly selects different paths during the training process to improve the alignment between visual information and decoded characters using a conditionally guided attention mechanism. During the reasoning process, the recognition model can attempt to decode all branch angles stored in the angle set and participate in the calculation of the beam search path score PK, thereby selecting the path with the highest score to continue decoding.

通过上述方式,识别模型能够具备更优的通用性和识别效率。Through the above method, the recognition model can have better versatility and recognition efficiency.

并且,针对识别模型的训练,本公开实施例以用公开访问的CASIA-CSDB数据集作为基准,建立手写数据集用作样本图像。具体 可以从教育环境中获得真实世界的手写分子结构。该数据集包括许多具有书写错误和不存在的结构数据的实例。Furthermore, for the training of the recognition model, the disclosed embodiment uses the publicly accessible CASIA-CSDB dataset as a benchmark to establish a handwriting dataset for use as sample images. Real-world handwritten molecular structures are available from educational settings. The dataset includes many instances with writing errors and non-existent structure data.

进一步地,手写数据集由52,987张在教育场景中收集的手写分子结构图像组成。这些图像是使用相机、扫描仪和屏幕等各种设备获得的,并被标记为原生Chemfig字符串。并且,该数据集中存在分子结构与规则分子式的混合。除了孤立的孤立分子结构外,数据集中的许多实例还包含公式和分子结构的组合。此外,数据集中整合了不同的结构书写风格,例如使用/不使用缩写,苯的凯克勒环表示法的类型,以及氢原子的包含/排除等。数据集中还包含了大量违反化学原理的人为书写错误甚至不存在的结构的实例,基于此训练得到的模型对此类结构的识别可以潜在地应用于纠正和修改手写答案。另外,为了检验模型的泛化性能,数据集中的分子结构需要保持一定的复杂性,具体可以使用原子和键数的总和来评估分子结构复杂性水平,大约10%的数据集的复杂性水平超过了常规训练集中最复杂样本的复杂性水平。Furthermore, the handwritten dataset consists of 52,987 images of handwritten molecular structures collected in educational scenarios. These images were obtained using various devices such as cameras, scanners, and screens, and were labeled as native Chemfig strings. In addition, there is a mixture of molecular structures and regular molecular formulas in this dataset. In addition to isolated isolated molecular structures, many instances in the dataset contain a combination of formulas and molecular structures. In addition, different structural writing styles are integrated into the dataset, such as the use/non-use of abbreviations, the type of Keckler ring representation of benzene, and the inclusion/exclusion of hydrogen atoms. The dataset also contains a large number of examples of human writing errors that violate chemical principles or even non-existent structures. The recognition of such structures by the model trained based on this can potentially be applied to correct and modify handwritten answers. In addition, in order to test the generalization performance of the model, the molecular structures in the dataset need to maintain a certain complexity. Specifically, the sum of the number of atoms and bonds can be used to evaluate the complexity level of the molecular structure. The complexity level of about 10% of the dataset exceeds the complexity level of the most complex sample in the regular training set.

基于上述任一实施例,在完成识别模型训练之后,可以针对识别模型进行实验测试。Based on any of the above embodiments, after the recognition model training is completed, an experimental test may be performed on the recognition model.

具体地,考虑到分子结构标签本身足够简洁,可以直接比较预测得到识别结果的字符串的和标签的字符串是否相同。可以将标签的字符串和识别结果的字符串均转换为分子结构图,然后比较此两者的分子结构图是否匹配。假设T为样本数量,R表示与标签相匹配的识别结果的数量,那么精确匹配(Exact Match,EM)分数可以使用以下公式计算得到:
Specifically, considering that the molecular structure label itself is concise enough, we can directly compare whether the string of the predicted recognition result is the same as the string of the label. We can convert both the string of the label and the string of the recognition result into molecular structure diagrams, and then compare whether the molecular structure diagrams of the two match. Assuming T is the number of samples and R is the number of recognition results that match the label, the Exact Match (EM) score can be calculated using the following formula:

此外,考虑到手写数据集中存在公式和分子结构的混合,单个图像可能包含多个分子结构。因此,本公开实施例定义了两个辅助指标 如下:In addition, considering that there is a mixture of formulas and molecular structures in the handwritten dataset, a single image may contain multiple molecular structures. Therefore, the present embodiment defines two auxiliary indicators: as follows:

结构精确匹配(Structure EM):对于包含混合分子结构和规则公式的样本,当所有分子结构识别结果与标记图形匹配时,确定为该样本中的结构得到正确识别。令T为样本数量,Rstruct表示正确识别的结构样本数量,得到结构EM分数如下:
Structure EM: For samples containing mixed molecular structures and rule formulas, when all molecular structure recognition results match the labeled graph, it is determined that the structure in the sample is correctly recognized. Let T be the number of samples, R struct represents the number of correctly recognized structure samples, and the structure EM score is as follows:

结构EM分数EMstruct和单一的EM分数EM能够度量识别模型对混合模式下手写数据集中分子结构的识别性能。The structural EM score EM struct and the single EM score EM can measure the recognition performance of the recognition model for the molecular structures in the handwritten dataset under mixed mode.

从实验结果来看,本公开实施例提供的分子结构识别方法,与基于SMILES的识别方法相比,显著提高了识别性能。这主要由于分子结构标签的多义性降低,以及图像和标签之间的一致性更强。此外,本公开实施例中提出的随机条件解码器比字符串解码器具有显著的优势。应该强调的是,随机条件解码器的计算和参数成本几乎与字符串解码器相同。From the experimental results, the molecular structure recognition method provided by the disclosed embodiment significantly improves the recognition performance compared with the SMILES-based recognition method. This is mainly due to the reduced ambiguity of the molecular structure label and the stronger consistency between the image and the label. In addition, the random conditional decoder proposed in the disclosed embodiment has significant advantages over the string decoder. It should be emphasized that the computational and parameter costs of the random conditional decoder are almost the same as those of the string decoder.

基于上述任一实施例,图6是本公开提供的分子结构识别装置的结构示意图,如图6所示,该装置包括:Based on any of the above embodiments, FIG6 is a schematic diagram of the structure of a molecular structure recognition device provided by the present disclosure. As shown in FIG6 , the device includes:

获取单元610,用于获取分子图像;An acquisition unit 610, configured to acquire a molecular image;

识别单元620,用于初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;The identification unit 620 is used to initialize an empty angle set, and when the molecular structure is decoded based on the image features of the molecular image and a branch angle is decoded for the first time, the branch angle is stored in the angle set; a branch angle is taken out from the angle set, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for the molecular structure decoding under the next branch angle, until the angle set is empty;

输出单元630,用于基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。 The output unit 630 is used to determine the molecular structure corresponding to the molecular image based on the decoding results at each branch angle.

本公开实施例提供的装置,增加了对于化学分子结构中各个分支角度的解码和待探索的分支角度的维护机制,并将化学分子结构中的分支角度作为解码时的引导条件,以丰富分子结构解码的信息,提高分子结构解码的可靠性,提高面向复杂化学分子结构的解码准确性。The device provided by the embodiment of the present disclosure adds a decoding mechanism for each branch angle in the chemical molecular structure and a maintenance mechanism for the branch angle to be explored, and uses the branch angle in the chemical molecular structure as a guiding condition during decoding to enrich the information of molecular structure decoding, improve the reliability of molecular structure decoding, and improve the decoding accuracy for complex chemical molecular structures.

基于上述任一实施例,所述识别单元620包括集合更新单元,用于:Based on any of the above embodiments, the identification unit 620 includes a set updating unit, which is used to:

将所述新的分支角度分别与所述角度集合中的各已有分支角度,进行化学键检测;Perform chemical bond detection on the new branch angle and each existing branch angle in the angle set;

基于所述化学键检测的检测结果,更新所述角度集合。Based on the detection result of the chemical bond detection, the angle set is updated.

基于上述任一实施例,所述集合更新单元具体用于:Based on any of the above embodiments, the set updating unit is specifically used for:

在所述检测结果指示不存在化学键的情况下,将所述新的分支角度存入所述角度集合;When the detection result indicates that there is no chemical bond, storing the new branch angle into the angle set;

在所述检测结果指示存在化学键的情况下,将与所述新的分支角度构成化学键的分支角度从所述角度集合中删除。In the case where the detection result indicates the presence of a chemical bond, the branch angle that forms a chemical bond with the new branch angle is deleted from the angle set.

基于上述任一实施例,所述识别单元620包括分支解码单元,用于:Based on any of the above embodiments, the identification unit 620 includes a branch decoding unit, which is used to:

基于所述分支角度的解码特征,以及所述分支角度下的前一个解码时刻的解码状态,确定所述分支角度下的当前解码时刻的视觉上下文特征;Determining visual context features at a current decoding moment at the branch angle based on the decoding features of the branch angle and a decoding state at a previous decoding moment at the branch angle;

基于所述视觉上下文特征,对所述图像特征进行当前解码时刻的分子结构解码,得到当前解码时刻的解码状态,并将所述当前解码时刻作为前一个解码时刻返回解码,直至所述分支角度下的解码结束。Based on the visual context feature, the molecular structure of the image feature at the current decoding moment is decoded to obtain the decoding state at the current decoding moment, and the current decoding moment is returned as the previous decoding moment for decoding until the decoding at the branch angle is completed.

基于上述任一实施例,所述识别单元620具体用于:Based on any of the above embodiments, the identification unit 620 is specifically used for:

基于识别模型,从角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下 一分支角度下的分子结构解码,直至所述角度集合为空;Based on the recognition model, a branch angle is taken from the angle set, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for the next step. Decoding the molecular structure at a branch angle until the angle set is empty;

所述识别模型基于样本图像、以及所述样本图像对应的分子结构标签训练得到;The recognition model is trained based on the sample image and the molecular structure label corresponding to the sample image;

所述分子结构标签是将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图之后进行图遍历得到。The molecular structure label is obtained by connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure graph and then performing graph traversal.

基于上述任一实施例,该装置还包括标签转换单元,用于:Based on any of the above embodiments, the device further includes a label conversion unit, which is used to:

将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图;Connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure diagram;

遍历所述分子结构图,并基于遍历所得的原子群、化学键、角度、嵌套符号和重连标记生成所述分子结构标签。The molecular structure graph is traversed, and the molecular structure label is generated based on the atomic groups, chemical bonds, angles, nesting symbols and reconnection marks obtained through the traversal.

基于上述任一实施例,该装置还包括模型训练单元,用于:Based on any of the above embodiments, the device further includes a model training unit, which is used to:

基于初始模型,对所述样本图像进行分子结构识别,得到所述分子结构识别过程中解码到的样本分支角度与样本角度集合中已有分支角度之间的化学键检测结果,以及所述样本图像的结构识别结果;Based on the initial model, molecular structure recognition is performed on the sample image to obtain a chemical bond detection result between the sample branch angle decoded in the molecular structure recognition process and the existing branch angles in the sample angle set, as well as a structural recognition result of the sample image;

基于所述结构识别结果和所述分子结构标签,以及所述化学键检测检测和所述分子结构标签中的重连标记,对所述初始模型进行参数迭代,得到所述识别模型。Based on the structure recognition result and the molecular structure label, as well as the chemical bond detection and the reconnection mark in the molecular structure label, the initial model is iterated with parameters to obtain the recognition model.

图7示例了一种电子设备的实体结构示意图,如图7所示,该电子设备可以包括:处理器(processor)710、通信接口(Communications Interface)720、存储器(memory)730和通信总线740,其中,处理器710,通信接口720,存储器730通过通信总线740完成相互间的通信。处理器710可以调用存储器730中的逻辑指令,以执行分子结构识别方法,该方法包括:FIG7 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG7 , the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the molecular structure recognition method, which includes:

获取分子图像;Acquire molecular images;

初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所 述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Initialize an empty angle set, and when the molecular structure is decoded based on the image features of the molecular image and the branch angle is decoded for the first time, store the branch angle in the The angle set; taking a branch angle from the angle set, using the branch angle as a guide, decoding the molecular structure under the branch angle based on the image features of the molecular image, and updating the angle set based on the new branch angle obtained by decoding for decoding the molecular structure under the next branch angle, until the angle set is empty;

基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。Based on the decoding results at each branch angle, the molecular structure corresponding to the molecular image is determined.

此外,上述的存储器730中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

另一方面,本公开还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的分子结构识别方法,该方法包括:On the other hand, the present disclosure further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the molecular structure recognition method provided by the above methods, the method comprising:

获取分子图像;Acquire molecular images;

初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一 分支角度下的分子结构解码,直至所述角度集合为空;Initialize an empty angle set, and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take a branch angle from the angle set, and decode the molecular structure under the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for the next step. Decoding the molecular structure under the branch angle until the angle set is empty;

基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。Based on the decoding results at each branch angle, the molecular structure corresponding to the molecular image is determined.

又一方面,本公开还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的分子结构识别方法,该方法包括:In another aspect, the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the molecular structure recognition method provided by the above methods, the method comprising:

获取分子图像;Acquire molecular images;

初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Initialize an empty angle set, and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take a branch angle from the angle set, and decode the molecular structure under the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for decoding the molecular structure under the next branch angle, until the angle set is empty;

基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。Based on the decoding results at each branch angle, the molecular structure corresponding to the molecular image is determined.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光 盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, a disk, an optical disk, or a computer-readable medium. The disk, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本公开的技术方案,而非对其限制;尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本公开各实施例技术方案的精神和范围。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims (16)

一种分子结构识别方法,包括:A molecular structure recognition method, comprising: 获取分子图像;Acquire molecular images; 初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Initialize an empty angle set, and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take a branch angle from the angle set, and decode the molecular structure under the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for decoding the molecular structure under the next branch angle, until the angle set is empty; 基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。Based on the decoding results at each branch angle, the molecular structure corresponding to the molecular image is determined. 根据权利要求1所述的分子结构识别方法,其中,所述基于解码得到新的分支角度更新所述角度集合,包括:The molecular structure recognition method according to claim 1, wherein the updating of the angle set based on the new branch angle obtained by decoding comprises: 将所述新的分支角度分别与所述角度集合中的各已有分支角度,进行化学键检测;Perform chemical bond detection on the new branch angle and each existing branch angle in the angle set; 基于所述化学键检测的检测结果,更新所述角度集合。Based on the detection result of the chemical bond detection, the angle set is updated. 根据权利要求2所述的分子结构识别方法,其中,所述基于所述化学键检测的检测结果,更新所述角度集合,包括:The molecular structure recognition method according to claim 2, wherein the updating of the angle set based on the detection result of the chemical bond detection comprises: 在所述检测结果指示不存在化学键的情况下,将所述新的分支角度存入所述角度集合;When the detection result indicates that there is no chemical bond, storing the new branch angle into the angle set; 在所述检测结果指示存在化学键的情况下,将与所述新的分支角度构成化学键的分支角度从所述角度集合中删除。In the case where the detection result indicates the presence of a chemical bond, the branch angle that forms a chemical bond with the new branch angle is deleted from the angle set. 根据权利要求1所述的分子结构识别方法,其中,所述以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,包括:The molecular structure recognition method according to claim 1, wherein the decoding of the molecular structure at the branching angle based on the image features of the molecular image guided by the branching angle comprises: 基于所述分支角度的解码特征,以及所述分支角度下的前一个解 码时刻的解码状态,确定所述分支角度下的当前解码时刻的视觉上下文特征;Based on the decoding features of the branch angle and the previous solution under the branch angle The decoding state at the decoding moment determines the visual context features at the current decoding moment under the branch angle; 基于所述视觉上下文特征,对所述图像特征进行当前解码时刻的分子结构解码,得到当前解码时刻的解码状态,并将所述当前解码时刻作为前一个解码时刻返回解码,直至所述分支角度下的解码结束。Based on the visual context feature, the molecular structure of the image feature at the current decoding moment is decoded to obtain the decoding state at the current decoding moment, and the current decoding moment is returned as the previous decoding moment for decoding until the decoding at the branch angle is completed. 根据权利要求1至4中任一项所述的分子结构识别方法,其中,所述从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空,包括:The molecular structure recognition method according to any one of claims 1 to 4, wherein taking out a branch angle from the angle set, decoding the molecular structure at the branch angle based on the image features of the molecular image with the branch angle as a guide, and updating the angle set based on the new branch angle obtained by decoding for decoding the molecular structure at the next branch angle until the angle set is empty, comprises: 基于识别模型,从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Based on the recognition model, a branch angle is taken out from the angle set, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for decoding of the molecular structure under the next branch angle, until the angle set is empty; 所述识别模型基于样本图像、以及所述样本图像对应的分子结构标签训练得到;The recognition model is trained based on the sample image and the molecular structure label corresponding to the sample image; 所述分子结构标签是将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图之后进行图遍历得到。The molecular structure label is obtained by connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure graph and then performing graph traversal. 根据权利要求5所述的分子结构识别方法,其中,所述分子结构标签的确定步骤包括:The molecular structure recognition method according to claim 5, wherein the step of determining the molecular structure tag comprises: 将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图;Connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure diagram; 遍历所述分子结构图,并基于遍历所得的原子群、化学键、角度、嵌套符号和重连标记生成所述分子结构标签。The molecular structure graph is traversed, and the molecular structure label is generated based on the atomic groups, chemical bonds, angles, nesting symbols and reconnection marks obtained through the traversal. 根据权利要求5所述的分子结构识别方法,其中,所述识别模型的训练步骤包括: The molecular structure recognition method according to claim 5, wherein the step of training the recognition model comprises: 基于初始模型,对所述样本图像进行分子结构识别,得到所述分子结构识别的过程中解码到的样本分支角度与样本角度集合中已有分支角度之间的化学键检测结果,以及所述样本图像的结构识别结果;Based on the initial model, molecular structure recognition is performed on the sample image to obtain a chemical bond detection result between the sample branch angle decoded in the molecular structure recognition process and the existing branch angles in the sample angle set, as well as a structural recognition result of the sample image; 基于所述结构识别结果和所述分子结构标签,以及所述化学键检测检测和所述分子结构标签中的重连标记,对所述初始模型进行参数迭代,得到所述识别模型。Based on the structure recognition result and the molecular structure label, as well as the chemical bond detection and the reconnection mark in the molecular structure label, the initial model is iterated with parameters to obtain the recognition model. 一种分子结构识别装置,包括:A molecular structure recognition device, comprising: 获取单元,用于获取分子图像;An acquisition unit, used for acquiring a molecular image; 识别单元,用于初始化空的角度集合,在基于所述分子图像的图像特征进行分子结构解码、并首次解码到分支角度的情况下,将所述分支角度存入所述角度集合;从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;The identification unit is used to initialize an empty angle set, and when decoding the molecular structure based on the image features of the molecular image and decoding to a branch angle for the first time, store the branch angle in the angle set; take out a branch angle from the angle set, and decode the molecular structure under the branch angle based on the image features of the molecular image with the branch angle as a guide, and update the angle set based on the new branch angle obtained by decoding for decoding of the molecular structure under the next branch angle, until the angle set is empty; 输出单元,用于基于各分支角度下的解码结果,确定所述分子图像对应的分子结构。The output unit is used to determine the molecular structure corresponding to the molecular image based on the decoding results at each branch angle. 根据权利要求8所述的分子结构识别装置,其中,所述基于解码得到新的分支角度更新所述角度集合,包括:The molecular structure recognition device according to claim 8, wherein the updating of the angle set based on the new branch angle obtained by decoding comprises: 将所述新的分支角度分别与所述角度集合中的各已有分支角度,进行化学键检测;Perform chemical bond detection on the new branch angle and each existing branch angle in the angle set; 基于所述化学键检测的检测结果,更新所述角度集合。Based on the detection result of the chemical bond detection, the angle set is updated. 根据权利要求9所述的分子结构识别装置,其中,所述基于所述化学键检测的检测结果,更新所述角度集合,包括:The molecular structure recognition device according to claim 9, wherein the updating of the angle set based on the detection result of the chemical bond detection comprises: 在所述检测结果指示不存在化学键的情况下,将所述新的分支角度存入所述角度集合;When the detection result indicates that there is no chemical bond, storing the new branch angle into the angle set; 在所述检测结果指示存在化学键的情况下,将与所述新的分支角 度构成化学键的分支角度从所述角度集合中删除。In the case where the detection result indicates the presence of a chemical bond, the new branch angle Branch angles that form chemical bonds are deleted from the angle set. 根据权利要求8所述的分子结构识别装置,其中,所述以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,包括:The molecular structure recognition device according to claim 8, wherein the decoding of the molecular structure at the branching angle based on the image features of the molecular image guided by the branching angle comprises: 基于所述分支角度的解码特征,以及所述分支角度下的前一个解码时刻的解码状态,确定所述分支角度下的当前解码时刻的视觉上下文特征;Determining visual context features at a current decoding moment at the branch angle based on the decoding features of the branch angle and a decoding state at a previous decoding moment at the branch angle; 基于所述视觉上下文特征,对所述图像特征进行当前解码时刻的分子结构解码,得到当前解码时刻的解码状态,并将所述当前解码时刻作为前一个解码时刻返回解码,直至所述分支角度下的解码结束。Based on the visual context feature, the molecular structure of the image feature at the current decoding moment is decoded to obtain the decoding state at the current decoding moment, and the current decoding moment is returned as the previous decoding moment for decoding until the decoding at the branch angle is completed. 根据权利要求8至11中任一项所述的分子结构识别装置,其中,所述从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空,包括:The molecular structure recognition device according to any one of claims 8 to 11, wherein taking out a branch angle from the angle set, decoding the molecular structure at the branch angle based on the image features of the molecular image with the branch angle as a guide, and updating the angle set based on the new branch angle obtained by decoding for decoding the molecular structure at the next branch angle until the angle set is empty, comprises: 基于识别模型,从所述角度集合中取出一个分支角度,以所述分支角度为引导,基于所述分子图像的图像特征对所述分支角度下的分子结构进行解码,并基于解码得到新的分支角度更新所述角度集合以供下一分支角度下的分子结构解码,直至所述角度集合为空;Based on the recognition model, a branch angle is taken out from the angle set, and the molecular structure under the branch angle is decoded based on the image features of the molecular image with the branch angle as a guide, and the angle set is updated based on the new branch angle obtained by decoding for decoding of the molecular structure under the next branch angle, until the angle set is empty; 所述识别模型基于样本图像、以及所述样本图像对应的分子结构标签训练得到;The recognition model is trained based on the sample image and the molecular structure label corresponding to the sample image; 所述分子结构标签是将所述样本图像对应的分子式中的原子群和化学键连接成分子结构图之后进行图遍历得到。The molecular structure label is obtained by connecting the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into a molecular structure graph and then performing graph traversal. 根据权利要求12所述的分子结构识别装置,其中,所述分子结构标签的确定步骤包括:The molecular structure recognition device according to claim 12, wherein the step of determining the molecular structure tag comprises: 将所述样本图像对应的分子式中的原子群和化学键连接成分子 结构图;Connect the atomic groups and chemical bonds in the molecular formula corresponding to the sample image into molecules Structural diagram; 遍历所述分子结构图,并基于遍历所得的原子群、化学键、角度、嵌套符号和重连标记生成所述分子结构标签。The molecular structure graph is traversed, and the molecular structure label is generated based on the atomic groups, chemical bonds, angles, nesting symbols and reconnection marks obtained through the traversal. 根据权利要求12所述的分子结构识别装置,其中,所述识别模型的训练步骤包括:The molecular structure recognition device according to claim 12, wherein the step of training the recognition model comprises: 基于初始模型,对所述样本图像进行分子结构识别,得到所述分子结构识别的过程中解码到的样本分支角度与样本角度集合中已有分支角度之间的化学键检测结果,以及所述样本图像的结构识别结果;Based on the initial model, molecular structure recognition is performed on the sample image to obtain a chemical bond detection result between the sample branch angle decoded in the molecular structure recognition process and the existing branch angles in the sample angle set, as well as a structural recognition result of the sample image; 基于所述结构识别结果和所述分子结构标签,以及所述化学键检测检测和所述分子结构标签中的重连标记,对所述初始模型进行参数迭代,得到所述识别模型。Based on the structure recognition result and the molecular structure label, as well as the chemical bond detection and the reconnection mark in the molecular structure label, the initial model is iterated with parameters to obtain the recognition model. 一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现如权利要求1至7任一项所述分子结构识别方法。An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the molecular structure recognition method as claimed in any one of claims 1 to 7 when executing the program. 一种非暂态计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述分子结构识别方法。 A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the molecular structure recognition method as claimed in any one of claims 1 to 7.
PCT/CN2023/143320 2023-09-04 2023-12-29 Molecular structure recognition method and apparatus, electronic device and storage medium WO2025050579A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202311136951.7 2023-09-04
CN202311136951.7A CN117392427A (en) 2023-09-04 2023-09-04 Molecular structure identification method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2025050579A1 true WO2025050579A1 (en) 2025-03-13

Family

ID=89435116

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/143320 WO2025050579A1 (en) 2023-09-04 2023-12-29 Molecular structure recognition method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN117392427A (en)
WO (1) WO2025050579A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117649676A (en) * 2024-01-29 2024-03-05 杭州德睿智药科技有限公司 Chemical structural formula identification method based on deep learning model

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140301608A1 (en) * 2011-08-26 2014-10-09 Council Of Scientific & Industrial Research Chemical structure recognition tool
CN114155539A (en) * 2020-08-17 2022-03-08 中国电信股份有限公司 Method for extracting molecular structural formula, computer readable medium and computing device
CN114359086A (en) * 2021-12-28 2022-04-15 科大讯飞股份有限公司 Molecular formula identification method and related device, equipment and storage medium
CN115272649A (en) * 2021-04-30 2022-11-01 南京燧坤智能科技有限公司 Image recognition, retrieval and entry method and system of molecular structure diagram and medium
WO2023277725A1 (en) * 2021-06-28 2023-01-05 Autonomous Non-Profit Organization For Higher Education "Skolkovo Institute Of Science And Technology" Method and system for recognizing chemical information from document images

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140301608A1 (en) * 2011-08-26 2014-10-09 Council Of Scientific & Industrial Research Chemical structure recognition tool
CN114155539A (en) * 2020-08-17 2022-03-08 中国电信股份有限公司 Method for extracting molecular structural formula, computer readable medium and computing device
CN115272649A (en) * 2021-04-30 2022-11-01 南京燧坤智能科技有限公司 Image recognition, retrieval and entry method and system of molecular structure diagram and medium
WO2023277725A1 (en) * 2021-06-28 2023-01-05 Autonomous Non-Profit Organization For Higher Education "Skolkovo Institute Of Science And Technology" Method and system for recognizing chemical information from document images
CN114359086A (en) * 2021-12-28 2022-04-15 科大讯飞股份有限公司 Molecular formula identification method and related device, equipment and storage medium

Also Published As

Publication number Publication date
CN117392427A (en) 2024-01-12

Similar Documents

Publication Publication Date Title
WO2023020045A1 (en) Training method for text recognition model, and text recognition method and apparatus
CN112163596B (en) Complex scene text recognition method, system, computer equipment and storage medium
CN111738169A (en) A Handwritten Formula Recognition Method Based on End-to-End Network Model
CN111443904A (en) Method for generating executable code and computer readable storage medium
CN111562915A (en) Generation method and device of front-end code generation model
CN113449801B (en) Image character behavior description generation method based on multi-level image context coding and decoding
CN113283336A (en) Text recognition method and system
WO2025050579A1 (en) Molecular structure recognition method and apparatus, electronic device and storage medium
CN113901170A (en) Event extraction method and system combining Bert model and template matching and electronic equipment
CN111507070A (en) Natural language generation method and device
CN118070816A (en) Hybrid expert visual question answering method and system based on strong visual semantics
CN115543437A (en) A code comment generation method and system
CN114973279B (en) Training method and device for handwritten text image generation model and storage medium
CN114581920B (en) A molecular image recognition method based on dual-branch multi-level feature decoding
CN114218940B (en) Text information processing and model training method, device, equipment and storage medium
CN114359086B (en) Molecular formula recognition method and related device, equipment and storage medium
CN114758330A (en) A text recognition method, device, electronic device and storage medium
CN114821603A (en) Bill recognition method, bill recognition device, electronic device and storage medium
CN113052156A (en) Optical character recognition method, device, electronic equipment and storage medium
CN117174177B (en) Training method and device for protein sequence generation model and electronic equipment
CN115687935A (en) Post-processing method, device and equipment for voice recognition and storage medium
CN114360488A (en) Speech synthesis, speech synthesis model training method, device and storage medium
CN115952265A (en) Knowledge-driven dialogue method based on unified generative model
CN114005114B (en) Identification method and device, segmentation model training method and device
CN114943222B (en) Time entity identification method and device, computer storage medium and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23951390

Country of ref document: EP

Kind code of ref document: A1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载