WO2023020210A1 - Chemical structure formula identification method and apparatus, storage medium, and electronic device - Google Patents

Chemical structure formula identification method and apparatus, storage medium, and electronic device Download PDF

Info

Publication number
WO2023020210A1
WO2023020210A1 PCT/CN2022/107752 CN2022107752W WO2023020210A1 WO 2023020210 A1 WO2023020210 A1 WO 2023020210A1 CN 2022107752 W CN2022107752 W CN 2022107752W WO 2023020210 A1 WO2023020210 A1 WO 2023020210A1
Authority
WO
WIPO (PCT)
Prior art keywords
chemical structure
chemical
image
text
conversion model
Prior art date
Application number
PCT/CN2022/107752
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 WO2023020210A1 publication Critical patent/WO2023020210A1/en

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/80Data visualisation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Definitions

  • the present disclosure relates to the technical field of chemical informatics, in particular to a method, device, storage medium and electronic equipment for identifying chemical structural formulas.
  • recognition and reading are carried out by methods such as InDraw, KingDraw, etc.
  • lines and nodes are interpreted as bonds and atoms after image vectorization, involving image segmentation, image thinning, line enhancement, optical character recognition, and molecular reconstruction , that is, it needs to divide the complete chemical structural formula, convert each line to obtain the small molecule corresponding to each line, and then combine the small molecules according to the preset rules and grammar to obtain the chemical text corresponding to the chemical structural formula .
  • these methods need to extract transformation rules and summarize grammars, which have long development cycle, high development cost, and difficult maintenance; moreover, the accuracy of recognition results is low when the existing methods deal with blurry and noisy images.
  • the purpose of the embodiments of the present disclosure is to provide a chemical structural formula recognition method, device, storage medium and electronic equipment, which are used to solve the need to extract conversion rules and summarize grammar in the prior art, which has a long development cycle and high development cost. , Difficulty in maintenance, and low accuracy of recognition results when dealing with blurry and noisy images.
  • the embodiment of the present disclosure provides a method for identifying a chemical structural formula, which includes:
  • the chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  • the chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
  • the conversion of the chemical structure image into its corresponding chemical text using a pre-trained conversion model includes:
  • the chemical structure sub-image is used as an input of the conversion model, so that the conversion model performs calculation on the chemical structure sub-image, and outputs a chemical text corresponding to the chemical structure sub-image.
  • the conversion model calculates the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image, including:
  • the conversion model calculates the sub-image of the chemical structure to obtain a plurality of candidate texts and a probability value corresponding to each candidate text;
  • the candidate text with the largest probability value is selected as the chemical text corresponding to the chemical structure sub-image.
  • the step of training the conversion model includes:
  • the training set includes a first image sample and its corresponding first text sample
  • the first error is not within the allowable range, adjusting parameters of the conversion model to be trained until the first error falls within the allowable range.
  • the identification method also includes:
  • the second image sample included in the verification set is converted into a second input vector, and the second input vector is respectively input to each conversion after the adjustment parameters In the model, the second actual text is obtained;
  • the conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
  • the embodiment of the present disclosure also provides a chemical structural formula recognition device, which includes:
  • An acquisition module configured to acquire a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula
  • a conversion module configured to convert the chemical structure image to its corresponding chemical text using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  • the identification device further includes a cropping module, which is configured to:
  • the chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
  • an embodiment of the present disclosure further provides a storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the following steps are performed:
  • the chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  • an embodiment of the present disclosure further provides an electronic device, which includes: a processor and a memory, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the The processor communicates with the memory through a bus, and when the machine-readable instructions are executed by the processor, the following steps are performed:
  • the chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  • the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc.
  • Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time.
  • the development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
  • Fig. 1 shows the flowchart of the identification method of the chemical structural formula provided by the present disclosure
  • Fig. 2 shows a flow chart of a training conversion model in the recognition method provided by the present disclosure
  • FIG. 3 shows a flowchart of another training conversion model in the recognition method provided by the present disclosure
  • FIG. 4 shows a schematic structural diagram of a device for identifying chemical structural formulas provided by the present disclosure
  • Fig. 5 shows a schematic structural diagram of an electronic device provided by the present disclosure.
  • the identification method of the chemical structural formula provided for the embodiment of the present disclosure specifically includes the following steps:
  • the chemical structure image may be in JPG format, PNG format or the like.
  • each chemical structure image contains multiple complete chemical structural formulas. Therefore, before using the pre-trained conversion model to convert the chemical structure image into its corresponding chemical text, first identify each complete chemical formula The area occupied by the chemical structural formula in the chemical structure image, and then cut the chemical structure image according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images, each chemical structure sub-image contains only a complete chemical structural formula, and also That is, a complete chemical structural formula is converted each time.
  • the embodiment of the present disclosure does not need to divide the complete chemical structural formula, and converts each line separately to obtain the small molecule corresponding to each line, and then combines the small molecules according to the preset rules and syntax to obtain the chemical text corresponding to the chemical structural formula , but using the Graphics Processing Unit (GPU) assisted conversion model, on the basis of improving the recognition and processing speed of the chemical structure sub-image, one-time conversion of the chemical structure sub-image can obtain the chemical text, Compared with the segmentation, multiple conversion, and recombination of chemical structure sub-images, the development cycle and development cost are lower, the operation rules are simple, the operation efficiency is high, and the accuracy of recognition results is also improved.
  • GPU Graphics Processing Unit
  • the chemical structure sub-image may be a preset shape, or a preset size, etc., which is not specifically limited in this embodiment of the present disclosure.
  • the chemical structure sub-image is used as the input of the conversion model, and the chemical structure sub-image is converted into a feature vector according to the preset conversion algorithm, so that the conversion model calculates the feature vector corresponding to the chemical structure sub-image, wherein,
  • the preset conversion algorithm may be a mapping relationship between chemical structure sub-images and feature vectors.
  • the conversion model outputs the chemical text corresponding to the chemical structure sub-image, and then completes the conversion of the chemical structural formula to the chemical text.
  • the conversion model converts the chemical structure sub-image
  • a plurality of candidate texts and a probability value corresponding to each candidate text are obtained; wherein, each candidate text Both are possible texts corresponding to the chemical structural formula in the chemical structure sub-image. Further, the candidate text with the highest probability value is selected as the chemical text corresponding to the chemical structure sub-image.
  • the embodiment of the present disclosure also provides a method for training a transformation model, specifically referring to the steps shown in FIG. 2 , which includes S201-S204.
  • the training set is obtained first, and the training set includes the first image sample and its corresponding first text sample, the first text sample is obtained by manual conversion, or manually verified after automatic conversion by a preset algorithm got after.
  • the first image sample is converted into a first input vector according to a preset conversion algorithm, wherein the first image sample can be converted into a first input vector based on a pre-established dictionary, wherein the dictionary includes the image sample and the input vector The mapping relationship between and the mapping relationship between the candidate text and the output vector.
  • input the first input vector into the conversion model to be trained and calculate the first input vector through the conversion model to be trained to obtain the first actual text.
  • the conversion model to be trained will also calculate multiple candidate text, and the first actual text is the candidate text with the largest probability value calculated by the conversion model to be trained.
  • the conversion model to be trained calculates the first input vector to obtain the first output vector, and converts the first output vector into a candidate text based on the dictionary.
  • the conversion model to be trained in the embodiment of the present disclosure includes but not limited to random forest, support vector machine, neural network, etc.
  • the conversion model to be trained uses a feature extractor-translator architecture, feature extractor and translator Both are composed of neural networks.
  • the first actual text After obtaining the first actual text, calculate a first error between the first actual text and the first text sample, and determine whether the first error is within an allowable range. If the error is not within the allowable range, adjust the parameters of the conversion model to be trained, and use the conversion model after adjusting the parameters to perform the next round of training until the first error falls within the allowable range, and complete the training of the conversion model.
  • the second image sample included in the verification set is converted into a second input vector, and the second input vector is respectively input into each conversion model after adjusting parameters,
  • the second actual text is obtained, wherein the method of converting the second image sample into the second input vector is the same as the method of converting the first image sample into the first input vector, and will not be repeated here.
  • the smallest second error is selected from the plurality of second errors, and the conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
  • the final conversion model can also be tested by using the test set, so as to further verify the accuracy of the conversion model.
  • the conversion model can also be updated and trained periodically to ensure the accuracy of the conversion model.
  • the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc.
  • Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time.
  • the development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
  • the second aspect of the present disclosure also provides a device for identifying chemical structural formulas. Since the problem-solving principle of the device in the present disclosure is similar to the identification method for the above-mentioned chemical structural formulas in the present disclosure, the implementation of the device can be found in Methods The implementation of this method will not be repeated here.
  • the recognition device of the chemical structural formula includes:
  • An acquisition module 401 configured to acquire a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula
  • the conversion module 402 is configured to convert the chemical structure image to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  • the device for identifying chemical structural formulas further includes a tailoring module 403, which is configured to:
  • the chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
  • the conversion module 402 is specifically configured as:
  • the chemical structure sub-image is used as an input of the conversion model, so that the conversion model performs calculation on the chemical structure sub-image, and outputs a chemical text corresponding to the chemical structure sub-image.
  • the conversion model in the conversion module 402 calculates the chemical structure sub-image, and when outputting the chemical text corresponding to the chemical structure sub-image, specifically includes:
  • the conversion model calculates the sub-image of the chemical structure to obtain a plurality of candidate texts and a probability value corresponding to each candidate text;
  • the candidate text with the largest probability value is selected as the chemical text corresponding to the chemical structure sub-image.
  • the device for identifying chemical structural formulas further includes a first training module 404 configured to:
  • the training set includes a first image sample and its corresponding first text sample
  • the first error is not within the allowable range, adjusting parameters of the conversion model to be trained until the first error falls within the allowable range.
  • the device for identifying chemical structural formulas further includes a second training module 405 configured to:
  • the second image sample included in the verification set is converted into a second input vector, and the second input vector is respectively input to each conversion after the adjustment parameters In the model, the second actual text is obtained;
  • the conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
  • the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc.
  • Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time.
  • the development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
  • the third aspect of the present disclosure also provides a storage medium, which is a computer-readable medium and stores a computer program.
  • a storage medium which is a computer-readable medium and stores a computer program.
  • the computer program Before the computer program is executed by the processor to convert the chemical structure image into its corresponding chemical text using a pre-trained conversion model, it is also specifically executed by the processor as follows: identify each complete chemical structure formula in the chemical structure image The area occupied by ; cropping the chemical structure image according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
  • the processor When the computer program is executed by the processor to convert the chemical structure image to its corresponding chemical text using a pre-trained conversion model, the processor specifically performs the following steps: using the chemical structure sub-image as the input of the conversion model , so that the conversion model performs calculation on the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image.
  • the computer program is executed by the processor to convert the model to calculate the chemical structure sub-image, and when the chemical text corresponding to the chemical structure sub-image is output, the processor also executes the following steps: the conversion model converts the chemical structure sub-image Performing calculations to obtain a plurality of candidate texts and a probability value corresponding to each candidate text; selecting the candidate text with the largest probability value as the chemical text corresponding to the chemical structure sub-image.
  • the processor When the computer program is executed by the processor to perform the recognition method, the processor also executes the following steps: obtaining a training set, the training set including a first image sample and its corresponding first text sample; converting the first image sample into a first text sample An input vector, and input the first input vector into the conversion model to be trained to obtain the first actual text; calculate whether the first error between the first actual text and the first text sample is allowed within the range; if the first error is not within the allowable range, adjust the parameters of the conversion model to be trained until the first error falls within the allowable range.
  • the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc.
  • Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time.
  • the development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
  • the storage medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any storage medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • Program code contained on a storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the fourth aspect of the present disclosure also provides an electronic device. As shown in FIG.
  • the program implements the method provided by any embodiment of the present disclosure. Exemplarily, the method executed by the computer program of the electronic device is as follows:
  • the processor Before the processor executes converting the chemical structure image into its corresponding chemical text using a pre-trained conversion model stored on the memory, it further executes the following computer program: identifying each complete chemical structural formula in the chemical structure image The occupied area: the chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
  • the processor executes the pre-trained conversion model stored on the memory to convert the chemical structure image to its corresponding chemical text, it also executes the following computer program: using the chemical structure sub-image as the input of the conversion model , so that the conversion model performs calculation on the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image.
  • the processor executes the conversion model stored in the memory to calculate the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image, it also executes the following computer program: the conversion model converts the chemical structure sub-image Performing calculations to obtain a plurality of candidate texts and a probability value corresponding to each candidate text; selecting the candidate text with the largest probability value as the chemical text corresponding to the chemical structure sub-image.
  • the processor executes the recognition method stored on the memory, it also executes the following computer program: when there are multiple conversion models to be trained, convert the second image sample included in the verification set into a second input vector, and convert The second input vector is respectively input into the conversion model after each of the adjusted parameters to obtain the second actual text; calculating the distance between each of the second actual text and the second text sample included in the verification set
  • the second error the conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
  • the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc.
  • Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time.
  • the development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Chemical & Material Sciences (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure provides a chemical structure formula identification method and apparatus, a storage medium, and an electronic device. The identification method comprises: acquiring a chemical structure image, the chemical structure image containing at least one complete chemical structure formula; converting the chemical structure image into a corresponding chemical text thereof by using a pre-trained conversion model, the conversion model performing single conversion on the complete chemical structure formulae in the chemical structure image. Compared with performing image vectorization on the chemical structure image, respectively converting the obtained lines and nodes, and combining to form the chemical text, in the present disclosure, a single conversion is executed on each complete chemical structure formula in chemical structure images in publications and patents by means of a pre-trained conversion model, thereby obtaining in one step a complete chemical text corresponding to a complete chemical structure formulae. The method has a short development period, low development costs, and easy maintenance, and can guarantee high accuracy of recognition results when processing images that have relatively large blur and noise.

Description

化学结构式的识别方法、装置、存储介质及电子设备Recognition method, device, storage medium and electronic equipment of chemical structural formula 技术领域technical field
本公开涉及化学信息学技术领域,特别涉及化学结构式的识别方法、装置、存储介质及电子设备。The present disclosure relates to the technical field of chemical informatics, in particular to a method, device, storage medium and electronic equipment for identifying chemical structural formulas.
背景技术Background technique
在期刊和专利等出版物中,有机化合物通常以化学结构式的形式来表示。但这些化学结构图像并不是计算机能够识别的化学语言。因此,自动从此类图像文件中识别出计算机可读的化学结构对应的化学文本(包括但不限于Inchi,Smiles,IUPAC),可以使化学家快速地获取有参考价值的“化学数据”。In publications such as journals and patents, organic compounds are often represented as chemical structural formulas. But these images of chemical structures are not the language of chemistry that computers can recognize. Therefore, automatically identifying chemical texts corresponding to computer-readable chemical structures (including but not limited to Inchi, Smiles, IUPAC) from such image files can enable chemists to quickly obtain valuable reference "chemical data".
现有技术中通过InDraw,KingDraw等方法进行识别读取,具体地,将图像矢量化之后将线条和节点解释为键和原子,涉及图像分割、图像细化、线条增强、光学字符识别以及重建分子,也即其需要将完整的化学结构式进行分割,将每个线条分别进行转换得到每个线条对应的小分子,之后,将小分子按照预设规则和语法进行组合以得到化学结构式对应的化学文本。但这些方法需要提取转化规则和总结语法,开发周期长、开发成本高、维护困难;并且,现有方法在处理模糊和噪声较大的图像时,识别结果的准确率较低。In the prior art, recognition and reading are carried out by methods such as InDraw, KingDraw, etc. Specifically, lines and nodes are interpreted as bonds and atoms after image vectorization, involving image segmentation, image thinning, line enhancement, optical character recognition, and molecular reconstruction , that is, it needs to divide the complete chemical structural formula, convert each line to obtain the small molecule corresponding to each line, and then combine the small molecules according to the preset rules and grammar to obtain the chemical text corresponding to the chemical structural formula . However, these methods need to extract transformation rules and summarize grammars, which have long development cycle, high development cost, and difficult maintenance; moreover, the accuracy of recognition results is low when the existing methods deal with blurry and noisy images.
发明内容Contents of the invention
有鉴于此,本公开实施例的目的在于提供一种化学结构式的识别方法、装置、存储介质及电子设备,用于解决现有技术中需要提取转化规则和总结语法,开发周期长、开发成本高、维护困难,以及在处理模糊和噪声较大的图像时,识别结果的准确率较低等问题。In view of this, the purpose of the embodiments of the present disclosure is to provide a chemical structural formula recognition method, device, storage medium and electronic equipment, which are used to solve the need to extract conversion rules and summarize grammar in the prior art, which has a long development cycle and high development cost. , Difficulty in maintenance, and low accuracy of recognition results when dealing with blurry and noisy images.
第一方面,本公开实施例提供了一种化学结构式的识别方法,其中,包括:In the first aspect, the embodiment of the present disclosure provides a method for identifying a chemical structural formula, which includes:
获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;Acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。The chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
在一种可能的实施方式中,在利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本之前,还包括:In a possible implementation manner, before using a pre-trained conversion model to convert the chemical structure image to its corresponding chemical text, it also includes:
识别每个完整的化学结构式在所述化学结构图像中所占的区域;identifying the region each complete chemical structure occupies in said chemical structure image;
按照所述化学结构式所占的区域裁剪所述化学结构图像,得到多个化学结构子图像。The chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
在一种可能的实施方式中,所述利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,包括:In a possible implementation manner, the conversion of the chemical structure image into its corresponding chemical text using a pre-trained conversion model includes:
将所述化学结构子图像作为所述转换模型的输入,以使所述转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本。The chemical structure sub-image is used as an input of the conversion model, so that the conversion model performs calculation on the chemical structure sub-image, and outputs a chemical text corresponding to the chemical structure sub-image.
在一种可能的实施方式中,所述转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本,包括:In a possible implementation manner, the conversion model calculates the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image, including:
所述转换模型对所述化学结构子图像进行计算,得到多个候选文本以及每个候选文本对应的概率值;The conversion model calculates the sub-image of the chemical structure to obtain a plurality of candidate texts and a probability value corresponding to each candidate text;
选取所述概率值最大的所述候选文本作为所述化学结构子图像对应的化学文本。The candidate text with the largest probability value is selected as the chemical text corresponding to the chemical structure sub-image.
在一种可能的实施方式中,训练所述转换模型的步骤包括:In a possible implementation manner, the step of training the conversion model includes:
获取训练集,所述训练集包括第一图像样本和其对应的第一文本样本;Obtain a training set, the training set includes a first image sample and its corresponding first text sample;
将所述第一图像样本转化为第一输入向量,并将所述第一输入向量输入至待训练的转换模型中,得到第一实际文本;converting the first image sample into a first input vector, and inputting the first input vector into a conversion model to be trained to obtain a first actual text;
计算所述第一实际文本与所述第一文本样本之间的第一误差是否在允许范围内;calculating whether a first error between the first actual text and the first text sample is within an allowable range;
若所述第一误差不在所述允许范围内,调整所述待训练的转换模型的参数,直至所述第一误差落入所述允许范围内。If the first error is not within the allowable range, adjusting parameters of the conversion model to be trained until the first error falls within the allowable range.
在一种可能的实施方式中,识别方法还包括:In a possible implementation manner, the identification method also includes:
所述待训练的转换模型为多个的情况下,将验证集包括的第二图像样本转化为第二输入向量,并将所述第二输入向量分别输入至每个所述调整参数后的转换模型中,得到第二实际文本;When there are multiple conversion models to be trained, the second image sample included in the verification set is converted into a second input vector, and the second input vector is respectively input to each conversion after the adjustment parameters In the model, the second actual text is obtained;
计算每个所述第二实际文本与所述验证集包括的第二文本样本之间的第 二误差;calculating a second error between each of said second actual text and a second text sample included in said validation set;
将最小的第二误差对应的调整参数后的转换模型作为转换模型。The conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
第二方面,本公开实施例还提供了一种化学结构式的识别装置,其包括:In the second aspect, the embodiment of the present disclosure also provides a chemical structural formula recognition device, which includes:
获取模块,其配置为获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;An acquisition module configured to acquire a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
转换模块,其配置为利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。A conversion module configured to convert the chemical structure image to its corresponding chemical text using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
在一种可能的实施方式中,识别装置还包括裁剪模块,其配置为:In a possible implementation manner, the identification device further includes a cropping module, which is configured to:
识别每个完整的化学结构式在所述化学结构图像中所占的区域;identifying the region each complete chemical structure occupies in said chemical structure image;
按照所述化学结构式所占的区域裁剪所述化学结构图像,得到多个化学结构子图像。The chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
第三方面,本公开实施例还提供了一种存储介质,其中,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如下步骤:In a third aspect, an embodiment of the present disclosure further provides a storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the following steps are performed:
获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;Acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。The chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
第四方面,本公开实施例还提供了一种电子设备,其中,包括:处理器和存储器,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如下步骤:In a fourth aspect, an embodiment of the present disclosure further provides an electronic device, which includes: a processor and a memory, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the The processor communicates with the memory through a bus, and when the machine-readable instructions are executed by the processor, the following steps are performed:
获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;Acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。The chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
相较于现有技术中将化学结构图像进行图像矢量化之后以对得到的线条和节点分别进行转换,进而组合形成化学文本,本公开实施例通过预先训练好的转换模型将期刊、专利等出版物中的化学结构图像中的每个完整的化学 结构式进行单次转换,进而一次性得到完整的化学结构式对应的完整的化学文本,开发周期较短,开发成本较低,易于维护,在处理模糊和噪声较大的图像时,能够确保识别结果准确率较高。Compared with the prior art that converts the obtained lines and nodes after image vectorization of chemical structure images, and then combines them to form chemical texts, the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc. Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time. The development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only the present invention. For some embodiments described in the publication, for those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1示出了本公开所提供的化学结构式的识别方法的流程图;Fig. 1 shows the flowchart of the identification method of the chemical structural formula provided by the present disclosure;
图2示出了本公开所提供的识别方法中一种训练转换模型的流程图;Fig. 2 shows a flow chart of a training conversion model in the recognition method provided by the present disclosure;
图3示出了本公开所提供的识别方法中另一种训练转换模型的流程图;FIG. 3 shows a flowchart of another training conversion model in the recognition method provided by the present disclosure;
图4示出了本公开所提供的化学结构式的识别装置的结构示意图;FIG. 4 shows a schematic structural diagram of a device for identifying chemical structural formulas provided by the present disclosure;
图5示出了本公开所提供的电子设备的结构示意图。Fig. 5 shows a schematic structural diagram of an electronic device provided by the present disclosure.
具体实施方式Detailed ways
此处参考附图描述本公开的各种方案以及特征。Various aspects and features of the present disclosure are described herein with reference to the accompanying drawings.
应理解的是,可以对此处申请的实施例做出各种修改。因此,上述说明书不应该视为限制,而仅是作为实施例的范例。本领域的技术人员将想到在本公开的范围和精神内的其他修改。It should be understood that various modifications may be made to the embodiments applied for herein. Accordingly, the above description should not be viewed as limiting, but only as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the disclosure.
包含在说明书中并构成说明书的一部分的附图示出了本公开的实施例,并且与上面给出的对本公开的大致描述以及下面给出的对实施例的详细描述一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and, together with the general description of the disclosure given above and the detailed description of the embodiments given below, serve to explain the embodiments of the disclosure. principle.
通过下面参照附图对给定为非限制性实例的实施例的优选形式的描述,本公开的这些和其它特性将会变得显而易见。These and other characteristics of the present disclosure will become apparent from the following description of preferred forms of embodiment given as non-limiting examples with reference to the accompanying drawings.
还应当理解,尽管已经参照一些具体实例对本公开进行了描述,但本领域技术人员能够确定地实现本公开的很多其它等效形式,它们具有如权利要求所述的特征并因此都位于借此所限定的保护范围内。It should also be understood that, while the disclosure has been described with reference to a few specific examples, those skilled in the art will surely be able to implement many other equivalents of the disclosure which have the features of the claims and which are therefore situated within the scope of the claims. within the limited scope of protection.
当结合附图时,鉴于以下详细说明,本公开的上述和其他方面、特征和优势将变得更为显而易见。The above and other aspects, features and advantages of the present disclosure will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
此后参照附图描述本公开的具体实施例;然而,应当理解,所申请的实施例仅仅是本公开的实例,其可采用多种方式实施。熟知和/或重复的功能和结构并未详细描述以避免不必要或多余的细节使得本公开模糊不清。因此,本文所申请的具体的结构性和功能性细节并非意在限定,而是仅仅作为权利要求的基础和代表性基础用于教导本领域技术人员以实质上任意合适的详细结构多样地使用本公开。Specific embodiments of the present disclosure are hereinafter described with reference to the accompanying drawings; however, it should be understood that the applied embodiments are merely examples of the disclosure, which may be embodied in various ways. Well-known and/or repetitive functions and constructions are not described in detail to avoid obscuring the disclosure with unnecessary or redundant detail. Therefore, specific structural and functional details disclosed herein are not intended to be limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present invention in virtually any suitable detailed structure. public.
本说明书可使用词组“在一种实施例中”、“在另一个实施例中”、“在又一实施例中”或“在其他实施例中”,其均可指代根据本公开的相同或不同实施例中的一个或多个。This specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may refer to the same or one or more of the different embodiments.
第一方面,为便于对本公开进行理解,首先对本公开所提供的一种化学结构式的识别方法进行详细介绍。如图1所示,为本公开实施例提供的化学结构式的识别方法具体包括以下步骤:In the first aspect, in order to facilitate the understanding of the present disclosure, a method for identifying a chemical structural formula provided in the present disclosure is first introduced in detail. As shown in Figure 1, the identification method of the chemical structural formula provided for the embodiment of the present disclosure specifically includes the following steps:
S101,获取化学结构图像,其中,化学结构图像中包含至少一个完整的化学结构式。S101. Acquire a chemical structure image, where the chemical structure image includes at least one complete chemical structural formula.
这里,在期刊和专利等出版物中,有机化合物通常以化学结构式的形式来表示。进而,用户在查阅期刊、专利等出版物时,期刊、专利等文件中的任意一页便可以作为化学结构图像。Here, in publications such as journals and patents, organic compounds are often represented in the form of chemical structural formulas. Furthermore, when users consult periodicals, patents and other publications, any page in the periodicals, patents and other documents can be used as a chemical structure image.
其中,化学结构图像可以是JPG格式、PNG格式等。Wherein, the chemical structure image may be in JPG format, PNG format or the like.
S102,利用预先训练好的转换模型将化学结构图像转换为其对应的化学文本,其中,转换模型对化学结构图中完整的化学结构式进行单次转换。S102, using a pre-trained conversion model to convert the chemical structure image into its corresponding chemical text, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
在具体实施中,存在一个化学结构图像中包含多个完整的化学结构式的情况,因此,在利用预先训练好的转换模型将化学结构图像转换为其对应的化学文本之前,先识别每个完整的化学结构式在化学结构图像中所占的区域,之后,按照化学结构式所占的区域裁剪化学结构图像,得到多个化学结构子图像,每个化学结构子图像中仅包含一个完整的化学结构式,也即每次针对一个完整的化学结构式进行转换。In the specific implementation, there are situations where a chemical structure image contains multiple complete chemical structural formulas. Therefore, before using the pre-trained conversion model to convert the chemical structure image into its corresponding chemical text, first identify each complete chemical formula The area occupied by the chemical structural formula in the chemical structure image, and then cut the chemical structure image according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images, each chemical structure sub-image contains only a complete chemical structural formula, and also That is, a complete chemical structural formula is converted each time.
这里,本公开实施例无需完整的化学结构式进行分割,将每个线条分别进行转换得到每个线条对应的小分子,之后将小分子按照预设规则和语法进行组合以得到化学结构式对应的化学文本,而是利用图形处理器(Graphics  Processing Unit,GPU)辅助转换模型,在提高对化学结构子图像的识别、处理速度的基础上,对化学结构子图像进行一次性转换,便能够得到化学文本,相较于对化学结构子图像进行分割、多次转换、重新组合,开发周期、开发成本均较低,运算规则简单,运算效率较高,还提高了识别结果准确率。Here, the embodiment of the present disclosure does not need to divide the complete chemical structural formula, and converts each line separately to obtain the small molecule corresponding to each line, and then combines the small molecules according to the preset rules and syntax to obtain the chemical text corresponding to the chemical structural formula , but using the Graphics Processing Unit (GPU) assisted conversion model, on the basis of improving the recognition and processing speed of the chemical structure sub-image, one-time conversion of the chemical structure sub-image can obtain the chemical text, Compared with the segmentation, multiple conversion, and recombination of chemical structure sub-images, the development cycle and development cost are lower, the operation rules are simple, the operation efficiency is high, and the accuracy of recognition results is also improved.
其中,化学结构子图像可以是预设形状、还可以是预设尺寸等,本公开实施例对此不做具体限定。Wherein, the chemical structure sub-image may be a preset shape, or a preset size, etc., which is not specifically limited in this embodiment of the present disclosure.
在具体实施过程中,将化学结构子图像作为转换模型的输入,按照预设转换算法将化学结构子图像转换为特征向量,以使转换模型对化学结构子图像对应的特征向量进行计算,其中,预设转换算法可以为化学结构子图像与特征向量之间的映射关系等。之后,转换模型输出化学结构子图像对应的化学文本,进而完成化学结构式向化学文本的转换。In the specific implementation process, the chemical structure sub-image is used as the input of the conversion model, and the chemical structure sub-image is converted into a feature vector according to the preset conversion algorithm, so that the conversion model calculates the feature vector corresponding to the chemical structure sub-image, wherein, The preset conversion algorithm may be a mapping relationship between chemical structure sub-images and feature vectors. Afterwards, the conversion model outputs the chemical text corresponding to the chemical structure sub-image, and then completes the conversion of the chemical structural formula to the chemical text.
可选地,转换模型在对化学结构子图像进行转换时,对化学结构子图像对应的特征向量进行计算之后,得到多个候选文本以及每个候选文本对应的概率值;其中,每个候选文本均为化学结构子图像中的化学结构式可能对应的文本。进一步地,选取概率值最大的候选文本作为化学结构子图像对应的化学文本。Optionally, when the conversion model converts the chemical structure sub-image, after calculating the feature vector corresponding to the chemical structure sub-image, a plurality of candidate texts and a probability value corresponding to each candidate text are obtained; wherein, each candidate text Both are possible texts corresponding to the chemical structural formula in the chemical structure sub-image. Further, the candidate text with the highest probability value is selected as the chemical text corresponding to the chemical structure sub-image.
本公开实施例还提供了训练转换模型的方法,具体参照图2示出的步骤,其包括S201-S204。The embodiment of the present disclosure also provides a method for training a transformation model, specifically referring to the steps shown in FIG. 2 , which includes S201-S204.
S201,获取训练集,训练集包括第一图像样本和其对应的第一文本样本。S201. Acquire a training set, where the training set includes a first image sample and a corresponding first text sample.
S202,将第一图像样本转化为第一输入向量,并将第一输入向量输入至待训练的转换模型中,得到第一实际文本。S202. Convert the first image sample into a first input vector, and input the first input vector into a conversion model to be trained to obtain a first actual text.
S203,计算第一实际文本与第一文本样本之间的第一误差是否在允许范围内。S203. Calculate whether the first error between the first actual text and the first text sample is within an allowable range.
S204,若误差不在允许范围内,调整待训练的转换模型的参数,直至误差落入允许范围内。S204. If the error is not within the allowable range, adjust the parameters of the conversion model to be trained until the error falls within the allowable range.
在具体实施中,先获取训练集,训练集包括第一图像样本和其对应的第一文本样本,该第一文本样本为人工转换得到的,或者由预设算法进行自动转换之后人工进行校验之后得到的。In a specific implementation, the training set is obtained first, and the training set includes the first image sample and its corresponding first text sample, the first text sample is obtained by manual conversion, or manually verified after automatic conversion by a preset algorithm got after.
之后,按照预设转换算法将第一图像样本转化为第一输入向量,其中,可以基于预先建立的字典将第一图像样本转化为第一输入向量,其中,该字典中包括图像样本与输入向量之间的映射关系以及候选文本与输出向量之间 的映射关系。之后,将第一输入向量输入至待训练的转换模型中,经待训练的转换模型对第一输入向量进行计算,得到第一实际文本,当然,待训练的转换模型也会计算得到多个候选文本,而第一实际文本为待训练的转换模型计算得到的概率值最大的候选文本。其中,待训练的转换模型对第一输入向量进行计算得到的为第一输出向量,基于字典将第一输出向量转化为候选文本。Afterwards, the first image sample is converted into a first input vector according to a preset conversion algorithm, wherein the first image sample can be converted into a first input vector based on a pre-established dictionary, wherein the dictionary includes the image sample and the input vector The mapping relationship between and the mapping relationship between the candidate text and the output vector. After that, input the first input vector into the conversion model to be trained, and calculate the first input vector through the conversion model to be trained to obtain the first actual text. Of course, the conversion model to be trained will also calculate multiple candidate text, and the first actual text is the candidate text with the largest probability value calculated by the conversion model to be trained. Wherein, the conversion model to be trained calculates the first input vector to obtain the first output vector, and converts the first output vector into a candidate text based on the dictionary.
本公开实施例中的待训练的转换模型包括但不限于随机森林、支持向量机、神经网络等,可选地,待训练的转换模型用特征提取器-翻译器架构,特征提取器和翻译器均由神经网络组成。当然,本领域技术人员应知晓的是,上述为本公开的一个实施例,并不限定于此。The conversion model to be trained in the embodiment of the present disclosure includes but not limited to random forest, support vector machine, neural network, etc. Optionally, the conversion model to be trained uses a feature extractor-translator architecture, feature extractor and translator Both are composed of neural networks. Certainly, those skilled in the art should know that the foregoing is an embodiment of the present disclosure, and is not limited thereto.
在得到第一实际文本之后,计算第一实际文本与第一文本样本之间的第一误差,并确定该第一误差是否在允许范围内。若误差不在允许范围内,调整待训练的转换模型的参数,利用调整参数之后的转换模型进行下一轮将训练,直至第一误差落入允许范围内,完成转换模型的训练。After obtaining the first actual text, calculate a first error between the first actual text and the first text sample, and determine whether the first error is within an allowable range. If the error is not within the allowable range, adjust the parameters of the conversion model to be trained, and use the conversion model after adjusting the parameters to perform the next round of training until the first error falls within the allowable range, and complete the training of the conversion model.
在具体实施中,模型中的处理层数量不同或处理层的顺序不同均可能导致计算得到的结果不同,因此,可以预先建立多个待训练的转换模型,在对每个待训练的转换模型完成训练之后,利用验证集确定最终的转换模型,具体参照图3示出的方法流程图,步骤包括S301-S303。In specific implementation, different numbers of processing layers in the model or different order of processing layers may lead to different calculation results. Therefore, multiple conversion models to be trained can be established in advance, and each conversion model to be trained is completed After training, use the verification set to determine the final conversion model, specifically refer to the method flowchart shown in FIG. 3 , the steps include S301-S303.
S301,待训练的转换模型为多个的情况下,将验证集包括的第二图像样本转化为第二输入向量,并将第二输入向量分别输入至每个调整参数后的转换模型中,得到第二实际文本。S301, when there are multiple conversion models to be trained, convert the second image sample included in the verification set into a second input vector, and input the second input vector into each conversion model after adjusting parameters, to obtain Second actual text.
S302,计算每个第二实际文本与验证集包括的第二文本样本之间的第二误差。S302. Calculate a second error between each second actual text and the second text samples included in the verification set.
S303,将最小的第二误差对应的调整参数后的转换模型作为转换模型。S303. Use the conversion model after adjusting the parameters corresponding to the smallest second error as the conversion model.
这里,在待训练的转换模型为多个的情况下,利用验证集包括的第二图像样本转化为第二输入向量,并将第二输入向量分别输入至每个调整参数后的转换模型中,得到第二实际文本,其中,将第二图像样本转化为第二输入向量的方式与将第一图像样本转化为第一输入向量的方式相同,在此,便不做过多赘述。Here, in the case of multiple conversion models to be trained, the second image sample included in the verification set is converted into a second input vector, and the second input vector is respectively input into each conversion model after adjusting parameters, The second actual text is obtained, wherein the method of converting the second image sample into the second input vector is the same as the method of converting the first image sample into the first input vector, and will not be repeated here.
在得到每个调整参数后的转换模型对应的第二实际文本之后,计算该第二实际文本与验证集包括的第二文本样本之间的第二误差,也即该调整参数 后的转换模型产生的误差。After obtaining the second actual text corresponding to the conversion model after each adjustment parameter, calculate the second error between the second actual text and the second text sample included in the verification set, that is, the conversion model after the adjustment parameter produces error.
之后,从多个第二误差中选取最小的第二误差,将最小的第二误差对应的调整参数后的转换模型作为转换模型。Afterwards, the smallest second error is selected from the plurality of second errors, and the conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
进一步地,还可以利用测试集对最终确定的转换模型进行测试,以进一步验证转换模型的准确性。另外,还可以周期性的对转换模型进行更新训练,以确保转换模型的准确性。Further, the final conversion model can also be tested by using the test set, so as to further verify the accuracy of the conversion model. In addition, the conversion model can also be updated and trained periodically to ensure the accuracy of the conversion model.
相较于现有技术中将化学结构图像进行图像矢量化之后以对得到的线条和节点分别进行转换,进而组合形成化学文本,本公开实施例通过预先训练好的转换模型将期刊、专利等出版物中的化学结构图像中的每个完整的化学结构式进行单次转换,进而一次性得到完整的化学结构式对应的完整的化学文本,开发周期较短,开发成本较低,易于维护,在处理模糊和噪声较大的图像时,能够确保识别结果准确率较高。Compared with the prior art that converts the obtained lines and nodes after image vectorization of chemical structure images, and then combines them to form chemical texts, the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc. Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time. The development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
基于同一发明构思,本公开的第二方面还提供了一种化学结构式的识别装置,由于本公开中的装置解决问题的原理与本公开上述化学结构式的识别方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the second aspect of the present disclosure also provides a device for identifying chemical structural formulas. Since the problem-solving principle of the device in the present disclosure is similar to the identification method for the above-mentioned chemical structural formulas in the present disclosure, the implementation of the device can be found in Methods The implementation of this method will not be repeated here.
参见图4所示,化学结构式的识别装置包括:Referring to Fig. 4, the recognition device of the chemical structural formula includes:
获取模块401,其配置为获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;An acquisition module 401 configured to acquire a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
转换模块402,其配置为利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。The conversion module 402 is configured to convert the chemical structure image to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
在另一实施例中,化学结构式的识别装置还包括裁剪模块403,其配置为:In another embodiment, the device for identifying chemical structural formulas further includes a tailoring module 403, which is configured to:
识别每个完整的化学结构式在所述化学结构图像中所占的区域;identifying the region each complete chemical structure occupies in said chemical structure image;
按照所述化学结构式所占的区域裁剪所述化学结构图像,得到多个化学结构子图像。The chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
在另一实施例中,转换模块402具体配置为:In another embodiment, the conversion module 402 is specifically configured as:
将所述化学结构子图像作为所述转换模型的输入,以使所述转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本。The chemical structure sub-image is used as an input of the conversion model, so that the conversion model performs calculation on the chemical structure sub-image, and outputs a chemical text corresponding to the chemical structure sub-image.
在另一实施例中,转换模块402中转换模型对所述化学结构子图像进行 计算,输出所述化学结构子图像对应的化学文本时,具体包括:In another embodiment, the conversion model in the conversion module 402 calculates the chemical structure sub-image, and when outputting the chemical text corresponding to the chemical structure sub-image, specifically includes:
所述转换模型对所述化学结构子图像进行计算,得到多个候选文本以及每个候选文本对应的概率值;The conversion model calculates the sub-image of the chemical structure to obtain a plurality of candidate texts and a probability value corresponding to each candidate text;
选取所述概率值最大的所述候选文本作为所述化学结构子图像对应的化学文本。The candidate text with the largest probability value is selected as the chemical text corresponding to the chemical structure sub-image.
在另一实施例中,化学结构式的识别装置还包括第一训练模块404,其配置为:In another embodiment, the device for identifying chemical structural formulas further includes a first training module 404 configured to:
获取训练集,所述训练集包括第一图像样本和其对应的第一文本样本;Obtain a training set, the training set includes a first image sample and its corresponding first text sample;
将所述第一图像样本转化为第一输入向量,并将所述第一输入向量输入至待训练的转换模型中,得到第一实际文本;converting the first image sample into a first input vector, and inputting the first input vector into a conversion model to be trained to obtain a first actual text;
计算所述第一实际文本与所述第一文本样本之间的第一误差是否在允许范围内;calculating whether a first error between the first actual text and the first text sample is within an allowable range;
若所述第一误差不在所述允许范围内,调整所述待训练的转换模型的参数,直至所述第一误差落入所述允许范围内。If the first error is not within the allowable range, adjusting parameters of the conversion model to be trained until the first error falls within the allowable range.
在另一实施例中,化学结构式的识别装置还包括第二训练模块405,其配置为:In another embodiment, the device for identifying chemical structural formulas further includes a second training module 405 configured to:
所述待训练的转换模型为多个的情况下,将验证集包括的第二图像样本转化为第二输入向量,并将所述第二输入向量分别输入至每个所述调整参数后的转换模型中,得到第二实际文本;When there are multiple conversion models to be trained, the second image sample included in the verification set is converted into a second input vector, and the second input vector is respectively input to each conversion after the adjustment parameters In the model, the second actual text is obtained;
计算每个所述第二实际文本与所述验证集包括的第二文本样本之间的第二误差;calculating a second error between each of said second actual text and a second text sample included in said verification set;
将最小的第二误差对应的调整参数后的转换模型作为转换模型。The conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
相较于现有技术中将化学结构图像进行图像矢量化之后以对得到的线条和节点分别进行转换,进而组合形成化学文本,本公开实施例通过预先训练好的转换模型将期刊、专利等出版物中的化学结构图像中的每个完整的化学结构式进行单次转换,进而一次性得到完整的化学结构式对应的完整的化学文本,开发周期较短,开发成本较低,易于维护,在处理模糊和噪声较大的图像时,能够确保识别结果准确率较高。Compared with the prior art that converts the obtained lines and nodes after image vectorization of chemical structure images, and then combines them to form chemical texts, the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc. Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time. The development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
本公开的第三方面还提供了一种存储介质,该存储介质为计算机可读介质,存储有计算机程序,该计算机程序被处理器执行时实现本公开任意实施例提供的方法,包括如下步骤:The third aspect of the present disclosure also provides a storage medium, which is a computer-readable medium and stores a computer program. When the computer program is executed by a processor, the method provided by any embodiment of the present disclosure is implemented, including the following steps:
S11,获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;S11, acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
S12,利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。S12. Using a pre-trained conversion model to convert the chemical structure image into its corresponding chemical text, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
计算机程序被处理器执行利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本之前,还具体被处理器执行如下步骤:识别每个完整的化学结构式在所述化学结构图像中所占的区域;按照所述化学结构式所占的区域裁剪所述化学结构图像,得到多个化学结构子图像。Before the computer program is executed by the processor to convert the chemical structure image into its corresponding chemical text using a pre-trained conversion model, it is also specifically executed by the processor as follows: identify each complete chemical structure formula in the chemical structure image The area occupied by ; cropping the chemical structure image according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
计算机程序被处理器执行利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本时,具体被处理器执行如下步骤:将所述化学结构子图像作为所述转换模型的输入,以使所述转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本。When the computer program is executed by the processor to convert the chemical structure image to its corresponding chemical text using a pre-trained conversion model, the processor specifically performs the following steps: using the chemical structure sub-image as the input of the conversion model , so that the conversion model performs calculation on the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image.
计算机程序被处理器执行转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本时,还被处理器执行如下步骤:所述转换模型对所述化学结构子图像进行计算,得到多个候选文本以及每个候选文本对应的概率值;选取所述概率值最大的所述候选文本作为所述化学结构子图像对应的化学文本。The computer program is executed by the processor to convert the model to calculate the chemical structure sub-image, and when the chemical text corresponding to the chemical structure sub-image is output, the processor also executes the following steps: the conversion model converts the chemical structure sub-image Performing calculations to obtain a plurality of candidate texts and a probability value corresponding to each candidate text; selecting the candidate text with the largest probability value as the chemical text corresponding to the chemical structure sub-image.
计算机程序被处理器执行识别方法时,还被处理器执行如下步骤:获取训练集,所述训练集包括第一图像样本和其对应的第一文本样本;将所述第一图像样本转化为第一输入向量,并将所述第一输入向量输入至待训练的转换模型中,得到第一实际文本;计算所述第一实际文本与所述第一文本样本之间的第一误差是否在允许范围内;若所述第一误差不在所述允许范围内,调整所述待训练的转换模型的参数,直至所述第一误差落入所述允许范围内。When the computer program is executed by the processor to perform the recognition method, the processor also executes the following steps: obtaining a training set, the training set including a first image sample and its corresponding first text sample; converting the first image sample into a first text sample An input vector, and input the first input vector into the conversion model to be trained to obtain the first actual text; calculate whether the first error between the first actual text and the first text sample is allowed within the range; if the first error is not within the allowable range, adjust the parameters of the conversion model to be trained until the first error falls within the allowable range.
计算机程序被处理器执行识别方法时,还被处理器执行如下步骤:所述待训练的转换模型为多个的情况下,将验证集包括的第二图像样本转化为第二输入向量,并将所述第二输入向量分别输入至每个所述调整参数后的转换模型中,得到第二实际文本;计算每个所述第二实际文本与所述验证集包括 的第二文本样本之间的第二误差;将最小的第二误差对应的调整参数后的转换模型作为转换模型。When the computer program is executed by the processor to perform the recognition method, the processor also executes the following steps: when there are multiple conversion models to be trained, convert the second image sample included in the verification set into a second input vector, and convert The second input vector is respectively input into the conversion model after each of the adjusted parameters to obtain the second actual text; calculating the distance between each of the second actual text and the second text sample included in the verification set The second error: the conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
相较于现有技术中将化学结构图像进行图像矢量化之后以对得到的线条和节点分别进行转换,进而组合形成化学文本,本公开实施例通过预先训练好的转换模型将期刊、专利等出版物中的化学结构图像中的每个完整的化学结构式进行单次转换,进而一次性得到完整的化学结构式对应的完整的化学文本,开发周期较短,开发成本较低,易于维护,在处理模糊和噪声较大的图像时,能够确保识别结果准确率较高。Compared with the prior art that converts the obtained lines and nodes after image vectorization of chemical structure images, and then combines them to form chemical texts, the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc. Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time. The development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
需要说明的是,本公开上述的存储介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何存储介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the storage medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any storage medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code contained on a storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
本公开的第四方面还提供了一种电子设备,如图5所示,该电子设备至少包括存储器501和处理器502,存储器501上存储有计算机程序,处理器502在执行存储器501上的计算机程序时实现本公开任意实施例提供的方法。示例性的,电子设备计算机程序执行的方法如下:The fourth aspect of the present disclosure also provides an electronic device. As shown in FIG. The program implements the method provided by any embodiment of the present disclosure. Exemplarily, the method executed by the computer program of the electronic device is as follows:
S21,获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;S21, acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
S22,利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。S22. Convert the chemical structure image to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
处理器在执行存储器上存储的利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本之前,还执行如下计算机程序:识别每个完整的化学结构式在所述化学结构图像中所占的区域;按照所述化学结构式所占的区域裁剪所述化学结构图像,得到多个化学结构子图像。Before the processor executes converting the chemical structure image into its corresponding chemical text using a pre-trained conversion model stored on the memory, it further executes the following computer program: identifying each complete chemical structural formula in the chemical structure image The occupied area: the chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
处理器在执行存储器上存储的利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本时,还执行如下计算机程序:将所述化学结构子图像作为所述转换模型的输入,以使所述转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本。When the processor executes the pre-trained conversion model stored on the memory to convert the chemical structure image to its corresponding chemical text, it also executes the following computer program: using the chemical structure sub-image as the input of the conversion model , so that the conversion model performs calculation on the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image.
处理器在执行存储器上存储的转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本时,还执行如下计算机程序:所述转换模型对所述化学结构子图像进行计算,得到多个候选文本以及每个候选文本对应的概率值;选取所述概率值最大的所述候选文本作为所述化学结构子图像对应的化学文本。When the processor executes the conversion model stored in the memory to calculate the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image, it also executes the following computer program: the conversion model converts the chemical structure sub-image Performing calculations to obtain a plurality of candidate texts and a probability value corresponding to each candidate text; selecting the candidate text with the largest probability value as the chemical text corresponding to the chemical structure sub-image.
处理器在执行存储器上存储的识别方法时,还执行如下计算机程序:获取训练集,所述训练集包括第一图像样本和其对应的第一文本样本;将所述第一图像样本转化为第一输入向量,并将所述第一输入向量输入至待训练的转换模型中,得到第一实际文本;计算所述第一实际文本与所述第一文本样本之间的第一误差是否在允许范围内;若所述第一误差不在所述允许范围内,调整所述待训练的转换模型的参数,直至所述第一误差落入所述允许范围内。When the processor executes the recognition method stored on the memory, it also executes the following computer program: obtain a training set, the training set includes the first image sample and its corresponding first text sample; convert the first image sample into the first text sample An input vector, and input the first input vector into the conversion model to be trained to obtain the first actual text; calculate whether the first error between the first actual text and the first text sample is allowed within the range; if the first error is not within the allowable range, adjust the parameters of the conversion model to be trained until the first error falls within the allowable range.
处理器在执行存储器上存储的识别方法时,还执行如下计算机程序:所述待训练的转换模型为多个的情况下,将验证集包括的第二图像样本转化为第二输入向量,并将所述第二输入向量分别输入至每个所述调整参数后的转换模型中,得到第二实际文本;计算每个所述第二实际文本与所述验证集包括的第二文本样本之间的第二误差;将最小的第二误差对应的调整参数后的转换模型作为转换模型。When the processor executes the recognition method stored on the memory, it also executes the following computer program: when there are multiple conversion models to be trained, convert the second image sample included in the verification set into a second input vector, and convert The second input vector is respectively input into the conversion model after each of the adjusted parameters to obtain the second actual text; calculating the distance between each of the second actual text and the second text sample included in the verification set The second error: the conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
相较于现有技术中将化学结构图像进行图像矢量化之后以对得到的线条和节点分别进行转换,进而组合形成化学文本,本公开实施例通过预先训练好的转换模型将期刊、专利等出版物中的化学结构图像中的每个完整的化学结构式进行单次转换,进而一次性得到完整的化学结构式对应的完整的化学文本,开发周期较短,开发成本较低,易于维护,在处理模糊和噪声较大的图像时,能够确保识别结果准确率较高。Compared with the prior art that converts the obtained lines and nodes after image vectorization of chemical structure images, and then combines them to form chemical texts, the embodiment of the present disclosure uses a pre-trained conversion model to publish journals, patents, etc. Each complete chemical structural formula in the chemical structure image in the object is converted once, and then the complete chemical text corresponding to the complete chemical structural formula is obtained at one time. The development cycle is short, the development cost is low, and it is easy to maintain. When it comes to images with large noise and noise, it can ensure a high accuracy of recognition results.
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本邻域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principle. Those skilled in the art should understand that the scope of disclosure involved in this disclosure is not limited to the technical solution formed by the specific combination of the above technical features, but also covers the technical solutions made by the above technical features without departing from the above disclosed concepts. Other technical solutions formed by any combination of or equivalent features thereof. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, while operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or performed in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while the above discussion contains several specific implementation details, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特 征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
以上对本公开多个实施例进行了详细说明,但本公开不限于这些具体的实施例,本邻域技术人员在本公开构思的基础上,能够做出多种变型和修改实施例,这些变型和修改都应落入本公开所要求保护的范围之内。Multiple embodiments of the present disclosure have been described in detail above, but the present disclosure is not limited to these specific embodiments. Those skilled in the art can make various modifications and modified embodiments on the basis of the concept of the present disclosure. These modifications and Any modifications should fall within the scope of protection claimed by the present disclosure.

Claims (10)

  1. 一种化学结构式的识别方法,其特征在于,包括:A method for identifying a chemical structural formula, characterized in that it comprises:
    获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;Acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
    利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。The chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  2. 根据权利要求1所述的识别方法,其特征在于,在利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本之前,还包括:The recognition method according to claim 1, wherein, before using a pre-trained conversion model to convert the chemical structure image into its corresponding chemical text, it also includes:
    识别每个完整的化学结构式在所述化学结构图像中所占的区域;identifying the region each complete chemical structure occupies in said chemical structure image;
    按照所述化学结构式所占的区域裁剪所述化学结构图像,得到多个化学结构子图像。The chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
  3. 根据权利要求2所述的识别方法,其特征在于,所述利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,包括:The recognition method according to claim 2, wherein said converting said chemical structure image into its corresponding chemical text using a pre-trained conversion model comprises:
    将所述化学结构子图像作为所述转换模型的输入,以使所述转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本。The chemical structure sub-image is used as an input of the conversion model, so that the conversion model performs calculation on the chemical structure sub-image, and outputs a chemical text corresponding to the chemical structure sub-image.
  4. 根据权利要求3所述的识别方法,其特征在于,所述转换模型对所述化学结构子图像进行计算,输出所述化学结构子图像对应的化学文本,包括:The recognition method according to claim 3, wherein the conversion model calculates the chemical structure sub-image, and outputs the chemical text corresponding to the chemical structure sub-image, including:
    所述转换模型对所述化学结构子图像进行计算,得到多个候选文本以及每个候选文本对应的概率值;The conversion model calculates the sub-image of the chemical structure to obtain a plurality of candidate texts and a probability value corresponding to each candidate text;
    选取所述概率值最大的所述候选文本作为所述化学结构子图像对应的化学文本。The candidate text with the largest probability value is selected as the chemical text corresponding to the chemical structure sub-image.
  5. 根据权利要求1所述的识别方法,其特征在于,训练所述转换模型的步骤包括:The recognition method according to claim 1, wherein the step of training the transformation model comprises:
    获取训练集,所述训练集包括第一图像样本和其对应的第一文本样本;Obtain a training set, the training set includes a first image sample and its corresponding first text sample;
    将所述第一图像样本转化为第一输入向量,并将所述第一输入向量输入至待训练的转换模型中,得到第一实际文本;converting the first image sample into a first input vector, and inputting the first input vector into a conversion model to be trained to obtain a first actual text;
    计算所述第一实际文本与所述第一文本样本之间的第一误差是否在允许范围内;calculating whether a first error between the first actual text and the first text sample is within an allowable range;
    若所述第一误差不在所述允许范围内,调整所述待训练的转换模型的参数,直至所述第一误差落入所述允许范围内。If the first error is not within the allowable range, adjusting parameters of the conversion model to be trained until the first error falls within the allowable range.
  6. 根据权利要求5所述的识别方法,其特征在于,还包括:The identification method according to claim 5, further comprising:
    所述待训练的转换模型为多个的情况下,将验证集包括的第二图像样本转化为第二输入向量,并将所述第二输入向量分别输入至每个所述调整参数后的转换模型中,得到第二实际文本;When there are multiple conversion models to be trained, the second image sample included in the verification set is converted into a second input vector, and the second input vector is respectively input to each conversion after the adjustment parameters In the model, the second actual text is obtained;
    计算每个所述第二实际文本与所述验证集包括的第二文本样本之间的第二误差;calculating a second error between each of said second actual text and a second text sample included in said validation set;
    将最小的第二误差对应的调整参数后的转换模型作为转换模型。The conversion model after adjusting parameters corresponding to the smallest second error is used as the conversion model.
  7. 一种化学结构式的识别装置,其特征在于,包括:An identification device for a chemical structural formula, characterized in that it comprises:
    获取模块,其配置为获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;An acquisition module configured to acquire a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
    转换模块,其配置为利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。A conversion module configured to convert the chemical structure image to its corresponding chemical text using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  8. 根据权利要求7所述的识别装置,其特征在于,还包括裁剪模块,其配置为:The identification device according to claim 7, further comprising a cropping module configured to:
    识别每个完整的化学结构式在所述化学结构图像中所占的区域;identifying the region each complete chemical structure occupies in said chemical structure image;
    按照所述化学结构式所占的区域裁剪所述化学结构图像,得到多个化学结构子图像。The chemical structure image is cropped according to the area occupied by the chemical structural formula to obtain multiple chemical structure sub-images.
  9. 一种存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如下步骤:A storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the following steps are performed:
    获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;Acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
    利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。The chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
  10. 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如下步骤:An electronic device is characterized in that it includes: a processor and a memory, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory pass through Bus communication, when the machine-readable instructions are executed by the processor, the following steps are performed:
    获取化学结构图像,其中,所述化学结构图像中包含至少一个完整的化学结构式;Acquiring a chemical structure image, wherein the chemical structure image contains at least one complete chemical structural formula;
    利用预先训练好的转换模型将所述化学结构图像转换为其对应的化学文 本,其中,所述转换模型对所述化学结构图中完整的化学结构式进行单次转换。The chemical structure image is converted to its corresponding chemical text by using a pre-trained conversion model, wherein the conversion model performs a single conversion on the complete chemical structural formula in the chemical structure diagram.
PCT/CN2022/107752 2021-08-16 2022-07-26 Chemical structure formula identification method and apparatus, storage medium, and electronic device WO2023020210A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110935708.6A CN115908775A (en) 2021-08-16 2021-08-16 Chemical structural formula identification method and device, storage medium and electronic equipment
CN202110935708.6 2021-08-16

Publications (1)

Publication Number Publication Date
WO2023020210A1 true WO2023020210A1 (en) 2023-02-23

Family

ID=85239461

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/107752 WO2023020210A1 (en) 2021-08-16 2022-07-26 Chemical structure formula identification method and apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN115908775A (en)
WO (1) WO2023020210A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116721713B (en) * 2023-08-09 2023-10-31 北京望石智慧科技有限公司 Data set construction method and device oriented to chemical structural formula identification

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102436447A (en) * 2010-09-29 2012-05-02 国际商业机器公司 Methods and systems for processing and matching information of chemical substance as well as storage system
CN108062529A (en) * 2017-12-22 2018-05-22 上海鹰谷信息科技有限公司 A kind of intelligent identification Method of chemical structural formula
CN108334839A (en) * 2018-01-31 2018-07-27 青岛清原精准农业科技有限公司 A kind of chemical information recognition methods based on deep learning image recognition technology
WO2021131324A1 (en) * 2019-12-26 2021-07-01 富士フイルム株式会社 Information processing device, information processing method, and program

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102436447A (en) * 2010-09-29 2012-05-02 国际商业机器公司 Methods and systems for processing and matching information of chemical substance as well as storage system
CN108062529A (en) * 2017-12-22 2018-05-22 上海鹰谷信息科技有限公司 A kind of intelligent identification Method of chemical structural formula
CN108334839A (en) * 2018-01-31 2018-07-27 青岛清原精准农业科技有限公司 A kind of chemical information recognition methods based on deep learning image recognition technology
WO2021131324A1 (en) * 2019-12-26 2021-07-01 富士フイルム株式会社 Information processing device, information processing method, and program

Also Published As

Publication number Publication date
CN115908775A (en) 2023-04-04

Similar Documents

Publication Publication Date Title
US20210272551A1 (en) Speech recognition apparatus, speech recognition method, and electronic device
US10553201B2 (en) Method and apparatus for speech synthesis
US10755701B2 (en) Method and apparatus for converting English speech information into text
US10621971B2 (en) Method and device for extracting speech feature based on artificial intelligence
Birnbaum et al. Temporal FiLM: Capturing Long-Range Sequence Dependencies with Feature-Wise Modulations.
US20190096385A1 (en) Method and apparatus for generating speech synthesis model
US10978042B2 (en) Method and apparatus for generating speech synthesis model
CN108831505B (en) Method and device for identifying use scenes of application
CN111368559A (en) Voice translation method and device, electronic equipment and storage medium
WO2023115790A1 (en) Chemical structure image extraction method and apparatus, storage medium, and electronic device
WO2023020210A1 (en) Chemical structure formula identification method and apparatus, storage medium, and electronic device
CN111862944B (en) Speech recognition apparatus, method, electronic device, and computer-readable storage medium
CN111653270B (en) Voice processing method and device, computer readable storage medium and electronic equipment
US20190066662A1 (en) Priors adaptation for conservative training of acoustic model
CN111353039B (en) File category detection method and device
WO2023130925A1 (en) Font recognition method and apparatus, readable medium, and electronic device
CN116821327A (en) Text data processing method, apparatus, device, readable storage medium and product
WO2023165018A1 (en) Method and device for extracting element in chemical reaction flow chart
WO2024055752A1 (en) Speech synthesis model training method, speech synthesis method, and related apparatuses
CN115019769A (en) Speech synthesis method, apparatus, computer device and medium based on artificial intelligence
CN115222842A (en) Method and device for processing video data, electronic equipment and storage medium
WO2020129716A1 (en) Model learning device, model learning method, and program
CN115132168A (en) Audio synthesis method, device, equipment, computer readable storage medium and product
CN115935228A (en) Text classification method, readable storage medium and electronic device
KR20230059677A (en) Method And Apparatus for Removing Background Music from Video

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE