OCR method and system based on character-level supervised contrastive learning model

The character-level supervised contrast learning method addresses the limitations of conventional OCR systems by using deep learning to extract and enhance character features, leading to improved OCR accuracy through diverse image training and supervised contrastive learning.

WO2024196144A1PCT designated stage expired Publication Date: 2024-09-26NAVER CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2024/003483
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-23
Filing Date
2024-03-20
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

Conventional contrast learning methods for OCR systems face challenges in preserving character features and accuracy due to data augmentation techniques and inappropriate loss functions, leading to reduced character recognition performance.

Method used

A character-level supervised contrast learning method that uses a deep learning model to extract token sequences representing character and location information from input images, generating synthetic images with varied features to enhance training data and employing a character-wise supervised contrastive loss function for improved recognition.

Benefits of technology

The method improves OCR accuracy by effectively learning character features from diverse image variations and enables supervised learning even with insufficient position information, resulting in enhanced character recognition capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024003483_26092024_PF_FP
    Figure KR2024003483_26092024_PF_FP
Patent Text Reader

Abstract

The present disclosure relates to an OCR method using a character-level supervised contrastive learning model, which is performed by at least one processor of a computing apparatus. The OCR method using a character-level supervised contrastive learning model comprises the steps of: receiving an input image; by means of a character-level supervised contrastive learning model, extracting, from the input image, a token sequence indicating character information and location information of the input image; and converting the token sequence into visualized information.
Need to check novelty before this filing date? Find Prior Art

Description

OCR method and system based on character-level supervised contrastive learning model

[0001] The present disclosure relates to an OCR method and system based on a character-level supervised contrastive learning model, and more particularly, to a character-level supervised contrastive learning method using learning data including an image, character information, and location information associated therewith, and a method and system capable of executing OCR using a deep learning model learned by the learning method.

[0002]

[0003] Contrastive learning is a machine learning method that learns useful representations of data by maximizing the similarity between similar training data pairs and minimizing the similarity between dissimilar training data pairs. Contrastive learning has shown promising performance in various tasks, such as image classification and object detection, making it a popular learning method in computer vision.

[0004] Effective contrastive learning requires a variety of similar training data pairs. Data augmentation techniques are used to increase the amount of training data. For example, data augmentation techniques are often used to generate similar images by randomly cropping images, flipping them horizontally, or flipping them upside down.

[0005] There are several issues with using this type of contrastive learning to train OCR (Optical Character Recognition) systems. Since input images for OCR systems contain characters, data augmentation techniques typically used in contrastive learning can result in character loss or altered character characteristics. Furthermore, the loss function typically used in contrastive learning is not suitable for improving the accuracy of character recognition in OCR systems.

[0006]

[0007] The present disclosure provides a character-based supervised contrastive learning method for solving the above-described problems, an OCR method based on a deep learning model learned by the learning method, a computer-readable non-transitory recording medium and device (system) recording commands.

[0008]

[0009] The present disclosure can be implemented in various ways, including a computer-readable, non-transitory recording medium having recorded thereon a method, device (system), or instructions.

[0010] According to one embodiment of the present disclosure, an OCR method using a character-based supervised learning model performed by at least one processor of a computing device includes the steps of receiving an input image, extracting a token sequence representing character information and positional information of the input image from the input image by the character-based supervised learning model, and converting the token sequence into visualized information.

[0011] According to one embodiment of the present disclosure, a method for character-based supervised contrastive learning for OCR performed by at least one processor of a computing device includes the steps of receiving first learning data including a first image and first character information, receiving second learning data including a second image, second character information corresponding to the first character information, and positional information associated with the second character information, and training a deep learning-based encoder-decoder model to output a token sequence representing character information and positional information for an input image using the first learning data and the second learning data.

[0012] A computer-readable non-transitory recording medium having recorded thereon instructions for executing a method according to one embodiment of the present disclosure on a computer is provided.

[0013] According to one embodiment of the present disclosure, an OCR system using a character-based supervised contrastive learning model includes a memory and at least one processor connected to the memory and configured to execute at least one computer-readable program included in the memory, wherein the at least one program includes one or more commands for receiving an input image, extracting a token sequence representing character position information and character information of the input image from the input image by a character-based supervised contrastive learning model, and converting the token sequence into visualized information.

[0014]

[0015] According to some embodiments of the present disclosure, the character recognition accuracy of an OCR system can be improved by using a deep learning model generated through a character-by-character contrastive learning method.

[0016] According to some embodiments of the present disclosure, by generating a synthetic image including characters of various shapes, such as various fonts, sizes, thicknesses, colors, etc., and using it as learning data, an OCR system can effectively learn various features of character images.

[0017] According to some embodiments of the present disclosure, when there is insufficient training data for supervised learning for OCR, supervised learning for OCR may be enabled by generating a synthetic image including character position information based on an actual image that does not include character position information and using the synthetic image as training data.

[0018] The effects of the present disclosure are not limited to the effects mentioned above, and other effects not mentioned can be clearly understood by a person having ordinary skill in the art to which the present disclosure belongs (“ordinary skilled in the art”) from the description of the claims.

[0019]

[0020] Embodiments of the present disclosure will be described below with reference to the accompanying drawings, wherein like reference numerals represent similar elements, but are not limited thereto.

[0021] FIG. 1 is a schematic diagram illustrating an example of an OCR system using a character-by-character map comparison learning model according to one embodiment of the present disclosure.

[0022] FIG. 2 is a block diagram showing the internal configuration of a computing device according to one embodiment of the present disclosure.

[0023] FIG. 3 is a diagram showing the internal configuration of a processor of a computing device according to one embodiment of the present disclosure.

[0024] FIG. 4 is a diagram illustrating an example of a configuration of a deep learning model according to one embodiment of the present disclosure.

[0025] FIG. 5 is a diagram illustrating an example of a method for generating a synthetic document for character-by-character map comparison learning according to one embodiment of the present disclosure.

[0026] FIG. 6 is a diagram illustrating an example of a character-by-character map comparison learning method according to one embodiment of the present disclosure.

[0027] Figure 7 is a diagram showing examples of feature clustering results of deep learning models learned by various learning methods.

[0028] FIG. 8 is a flowchart illustrating an example of an OCR method using a character-by-character map comparison learning model according to one embodiment of the present disclosure.

[0029] FIG. 9 is a flowchart illustrating an example of a character-by-character map comparison learning method for OCR according to one embodiment of the present disclosure.

[0030]

[0031] Hereinafter, specific details for implementing the present disclosure will be described in detail with reference to the attached drawings. However, in the following description, specific descriptions of widely known functions or configurations will be omitted if they may unnecessarily obscure the gist of the present disclosure.

[0032] In the attached drawings, identical or corresponding components are assigned the same reference numerals. Furthermore, in the description of the embodiments below, duplicate descriptions of identical or corresponding components may be omitted. However, even if a description of a component is omitted, it is not intended that such component is not included in any embodiment.

[0033] The advantages and features of the disclosed embodiments, and methods for achieving them, will become clearer with reference to the embodiments described below, along with the accompanying drawings. However, the present disclosure is not limited to the embodiments disclosed below and may be implemented in various different forms. These embodiments are provided solely to ensure the completeness of the disclosure and to fully inform those skilled in the art of the scope of the invention.

[0034] The terms used in this specification will be briefly explained, followed by a detailed description of the disclosed embodiments. The terms used in this specification have been selected from widely used, current terms, taking into account the functions of the present disclosure. However, these terms may vary depending on the intentions of engineers working in the relevant field, precedents, the emergence of new technologies, etc. Furthermore, in certain cases, terms may be arbitrarily selected by the applicant, and in such cases, their meanings will be described in detail in the relevant description of the invention. Therefore, the terms used in this disclosure should not be defined simply as names of terms, but rather based on their meanings and the overall content of the present disclosure.

[0035] In this specification, singular expressions include plural expressions unless the context clearly indicates otherwise. Furthermore, plural expressions include singular expressions unless the context clearly indicates otherwise. When a part of the specification is said to include a component, this does not exclude other components, but rather implies that other components may be included, unless otherwise specifically stated.

[0036] Also, the term 'module' or 'part' used in the specification means a software or hardware component, and the 'module' or 'part' performs certain roles. However, the 'module' or 'part' is not limited to software or hardware. The 'module' or 'part' may be configured to reside on an addressable storage medium and may be configured to execute one or more processors. Thus, as an example, the 'module' or 'part' may include at least one of components such as software components, object-oriented software components, class components, and task components, processes, functions, attributes, procedures, subroutines, segments of program code, drivers, firmware, microcode, circuitry, data, databases, data structures, tables, arrays, or variables. The functionality provided within the components and 'modules' or 'parts' may be combined into a smaller number of components and 'modules' or 'parts', or further separated into additional components and 'modules' or 'parts'.

[0037] According to one embodiment of the present disclosure, a 'module' or 'unit' may be implemented as a processor and a memory. 'Processor' should be broadly construed to include a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, and the like. In some circumstances, a 'processor' may also refer to an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field-programmable gate array (FPGA), and the like. A 'processor' may also refer to a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or any other such combination of configurations. In addition, 'memory' should be broadly construed to include any electronic component capable of storing electronic information. 'Memory' may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage, registers, etc. Memory is said to be in electronic communication with the processor if the processor can read information from, and / or write information to, the memory. Memory integrated in a processor is in electronic communication with the processor.

[0038] In the present disclosure, the "system" may include, but is not limited to, at least one of a server device and a cloud device. For example, the system may be comprised of one or more server devices. As another example, the system may be comprised of one or more cloud devices. As yet another example, the system may be configured and operated by a combination of a server device and a cloud device.

[0039] In the present disclosure, a "deep learning model" may refer to a machine learning algorithm or model capable of achieving a high level of abstraction through a combination of multiple or more nonlinear transformation techniques or models. A deep learning model may be implemented as a deep neural network capable of modeling complex nonlinear relationships, and a deep neural network may represent an artificial neural network that includes multiple hidden layers between an input layer and an output layer.

[0040] In the present disclosure, a 'document image' may include an electronic file containing a document, a scanned image of a document, or an image taken of a document.

[0041] In the present disclosure, 'each of the plurality of As' or 'each of the plurality of As' may refer to each of all components included in the plurality of As, or may refer to each of some components included in the plurality of As.

[0042] FIG. 1 is a schematic diagram illustrating an example of an OCR system (100) using a character-by-character supervised contrastive learning model according to one embodiment of the present disclosure. The OCR system (100) can extract a series of token sequences (140) representing character information and associated positional information from an image (110) using a deep learning model (130), and can convert the extracted token sequences (140) into visualized information.

[0043] For example, the OCR system (100) may first receive an image (110). Here, the image may include a document image and / or a scene image containing characters.

[0044] Then, the OCR system (100) can input an image (110) into a deep learning model (130) and output a token sequence (140). Here, the deep learning model (130) may be a deep learning-based encoder-decoder model. For example, the encoder included in the deep learning model (130) can extract an embedding representing the features of the image (110) from the image, and the decoder included in the deep learning model (130) can extract a token sequence (140) based on the embedding extracted from the encoder. The structure of the deep learning model (130) will be described in more detail below with reference to FIG. 4.

[0045] According to one embodiment, the deep learning model (130) may be a model trained to perform an OCR task of extracting a token sequence (140) representing character information and position information of the input image (110) from the input image (110). For example, the deep learning model (130) may be a model trained through a character-by-character contrastive learning method to improve the accuracy of character recognition. The training method of the deep learning model (130) will be described in more detail below with reference to FIGS. 3, 5, and 6.

[0046] A deep learning model (130) trained to extract a token sequence (140) representing character information and position information can output a token sequence (140) representing character information and position information from an input image (110). For example, the token sequence (140) can include a sequence of word instances included in the input image (110), and the sequence of word instances can include position information (e.g., four coordinate tokens (Xmin, Ymin, Xmax, Ymax)) and character information (e.g., one or more character tokens).

[0047] In one embodiment, the deep learning model (130) can be fine-tuned to perform various downstream operations from an input image (110) in response to various user commands (120). The deep learning model (130) can output a token sequence (140) from the input image (110) in response to a user command (120) indicating an OCR operation type.

[0048] For example, a deep learning model (130) may perform parsing on a document image according to a user command (120) (e.g., '[Table Reconstruction]') that requires parsing (e.g., table restructuring) of a document image, and output a token sequence (140) representing the parsed result.

[0049] As another example, the deep learning model (130) may output a token sequence (140) representing the result of classifying a document image, based on a user command (120) requesting classification of a document image (e.g., '[Classification]').

[0050] As another example, a deep learning model (130) may output a token sequence (140) representing a response to a question (e.g., '[VQA] CORAZON ') based on a user command (120) requesting visual question answering for a scene image containing characters (e.g., '[VQA] What is the last word that starts with ac?').

[0051] Additionally, the OCR system (100) can convert the token sequence (140) output by the deep learning model (130) into visualized information. For example, the visualized information may be a layer added on top of the input image that includes character information included in the input image and / or positional information (e.g., a bounding box) corresponding to the character information.

[0052] FIG. 2 is a block diagram illustrating the internal configuration of a computing device (200) according to one embodiment of the present disclosure. The computing device (200) may include a memory (210), a processor (220), a communication module (230), and an input / output interface (240). As illustrated in FIG. 2, the computing device (200) may be configured to communicate information and / or data via a network using the communication module (230).

[0053] The memory (210) may include any non-transitory computer-readable recording medium. According to one embodiment, the memory (210) may include a non-permanent mass storage device such as a random access memory (RAM), a read only memory (ROM), a disk drive, a solid state drive (SSD), a flash memory, etc. As another example, a non-permanent mass storage device such as a ROM, an SSD, a flash memory, a disk drive, etc. may be included in the computing device (200) as a separate permanent storage device distinct from the memory (210). In addition, the memory (210) may store an operating system and at least one program code (e.g., code for character-based supervised contrastive learning installed and run in the computing device (200), OCR using a character-based supervised contrastive learning model, etc.).

[0054] These software components may be loaded from a computer-readable recording medium separate from the memory (210). This separate computer-readable recording medium may include a recording medium directly connectable to the computing device (200), for example, a computer-readable recording medium such as a floppy drive, a disk, a tape, a DVD / CD-ROM drive, a memory card, etc. As another example, the software components may be loaded into the memory (210) through a communication module (230) other than a computer-readable recording medium. For example, at least one program may be loaded into the memory (210) based on a computer program (e.g., a program for character-by-character supervised contrastive learning, an OCR using a character-by-character supervised contrastive learning model, etc.) that is installed by files provided by developers or a file distribution system that distributes installation files of applications through the communication module (230).

[0055] The processor (220) may be configured to process commands of a computer program by performing basic arithmetic, logic, and input / output operations. The commands may be provided to a user terminal (not shown) or another external system via a memory (210) or a communication module (230). For example, the processor (220) may train a deep learning-based encoder-decoder model using first learning data and second learning data to output a token sequence representing character information and positional information for an input image. In addition, the processor (220) may extract a token sequence representing character information and positional information of the input image from the input image using the trained deep learning-based encoder-decoder model.

[0056] The communication module (230) may provide a configuration or function for a user terminal (not shown) and a computing device (200) to communicate with each other via a network, and may provide a configuration or function for the computing device (200) to communicate with an external system (e.g., a separate cloud system, etc.). For example, control signals, commands, data, etc. provided under the control of the processor (220) of the computing device (200) may be transmitted to the user terminal and / or the external system via the communication module (230) and the network through the communication module of the user terminal and / or the external system. For example, structured information extracted by the computing device may be transmitted to the user terminal.

[0057] In addition, the input / output interface (240) of the computing device (200) may be a means for interfacing with a device (not shown) for input or output that is connected to the computing device (200) or that the computing device (200) may include. In FIG. 2, the input / output interface (240) is illustrated as an element configured separately from the processor (220), but is not limited thereto, and the input / output interface (240) may be configured to be included in the processor (220). The computing device (200) may include more components than those illustrated in FIG. 2. However, there is no need to explicitly illustrate most of the conventional components.

[0058] The processor (220) of the computing device (200) may be configured to manage, process, and / or store information and / or data received from a plurality of user terminals and / or a plurality of external systems. According to one embodiment, the processor (220) may receive an input image from the user terminal and / or the external system. In this case, the processor (220) may extract a token sequence representing character information and location information of the input image from the image using a learned character-by-character supervised contrastive learning model. Additionally, the processor (220) may convert the token sequence into visualized information.

[0059] FIG. 3 is a diagram illustrating an internal configuration of a processor (220) of a computing device according to one embodiment of the present disclosure. According to one embodiment, the processor (220) may include a deep learning model inference unit (310), a visualized information generation unit (320), a deep learning model learning unit (330), and a synthetic document generation unit (340). In one embodiment, the processor may receive an image, and the received image may be provided to the deep learning model inference unit (310), provided to the deep learning model learning unit (330), or stored in a learning data database (DB) (350) to be used for inference and / or learning of the deep learning model.

[0060] The deep learning model inference unit (310) can output a token sequence based on an input image using a deep learning model. Here, the deep learning model may be a deep learning-based encoder-decoder model.

[0061] First, the deep learning model inference unit (310) can extract an embedding from an input image using an encoder. For example, the deep learning model inference unit (310) can convert an input image into an embedding using an encoder. In one embodiment, the encoder may include either a convolutional neural network (CNN)-based model or a transformer-based model. The embedding extracted by the encoder can be provided to a decoder.

[0062] Additionally, the deep learning model inference unit (310) can extract a token sequence from the embedding using a decoder. For example, the deep learning model inference unit (310) can extract a token sequence from the embedding using a decoder. According to one embodiment, the decoder can use a Transformer-based decoder, such as BERT (Bidirectional Encoder Representations from Transformer) or BART (Bidirectional and Auto-Regressive Transformers).

[0063] According to one embodiment, the deep learning model inference unit (310) may additionally receive a user command in addition to an input image, in which case the deep learning model inference unit (310) may extract a token sequence based on the received user command and embedding using a decoder. The deep learning model inference unit (310) may provide the token sequence extracted by the decoder to the visualized information generation unit (320). A specific example of a deep learning model extracting a token sequence from an input image is described in more detail below with reference to FIG. 4.

[0064] The visualized information generation unit (320) can convert the token sequence provided by the deep learning model inference unit (310) into visualized information. For example, the visualized information generation unit (320) can generate visualized information by adding a new layer on top of the input image. Here, the new layer can include character information included in the input image and / or position information (e.g., a bounding box) corresponding to the character information.

[0065] The deep learning model learning unit (330) can perform deep learning model learning using learning data stored in the learning data DB (350).

[0066] The training data may include first training data, second training data paired with the first training data, and third training data. The first training data may include actual images (document images and / or scene images including characters) and character information associated with the actual images. The second training data may include a synthetic image including characters identical to the actual images included in the first training data, character information, and location information associated with the character information. The second training data may be generated by the synthetic document generation unit (340) based on the first training data. The third training data may include images, character information, and location information associated with the character information. The pairs of the first training data and the second training data may be used for contrastive learning.

[0067] The deep learning model training unit (330) can train the deep learning model to output a token sequence representing character information and location information for an input image.

[0068] For example, the deep learning model training unit (330) can train the deep learning model to output a token sequence representing character information and position information for an input image using the first training data and the second training data. The deep learning model training unit (330) can calculate a loss function and train the deep learning model to minimize the loss function. For example, the deep learning model training unit (330) can calculate a first loss function that maximizes the probability of predicting character information included in an input image with a real image as input and the probability of predicting character information and associated position information included in a synthetic image with a synthetic image as input. Additionally or alternatively, the deep learning model training unit (330) can calculate a second loss function representing a character-wise supervised contrastive loss based on the first training data and the second training data. The total loss function can be calculated based on the first loss function and / or the second loss function.

[0069] Additionally or alternatively, the deep learning model training unit (330) may train a deep learning model to output a token sequence representing character information and location information for an input image using third learning data. An example of the deep learning model training unit (330) training a deep learning model is described in more detail below with reference to FIG. 6.

[0070] In one embodiment, the training data may further include user commands indicating the type of OCR operation. In this case, the deep learning model training unit (330) may train the deep learning model to output a token sequence corresponding to the input image and the user command.

[0071] The synthetic document generation unit (340) can generate a synthetic document image for character-level supervised comparison learning. For example, the synthetic document generation unit (340) can generate a synthetic document image including the same characters as the actual image based on character information (character information included in the actual image), font information, and image background information. A specific example of the synthetic document generation unit (340) generating a synthetic document image is described in more detail below with reference to FIG. 5. The synthetic document image generated by the synthetic document generation unit (340) can be stored in the training data DB (350) and used for training a deep learning model by the deep learning model training unit (330).

[0072] FIG. 4 is a diagram illustrating an example of a configuration of a deep learning model according to one embodiment of the present disclosure. According to one embodiment, the deep learning model (130) may output a predicted token sequence based on an input image (410). Here, the deep learning model (130) may include a visual encoder (420) and a textual decoder (440).

[0073] The visual encoder (420) included in the deep learning model (130) can extract an embedding (430) from an input image (410). For example, the visual encoder (420) can extract an embedding (430) from an input image (410). Embedding (430) can be converted to . Here, may be the height, width, and channel of the input image (410), respectively. According to one embodiment, the visual encoder (420) may include one of a convolutional neural network (CNN)-based model or a transformer-based model.

[0074] Embedding (430) extracted by visual encoder (420) ) can be provided to a text decoder (440), which automatically recursively generates a token sequence from the embedding (430) extracted by the visual encoder (420) and the given user command. (Here, is the i-th generated token, is the length of the token sequence generated by the decoder). For example, the text decoder (440) can predict the token sequence "[Table Reconstruction]" representing the result of parsing based on the extracted embedding (430) according to the user command "[Table Reconstruction]" which requests the structuring of the table included in the image.

[0075]

[0076]

[0077]

[0078]

[0079]

[0080]

[0081]

[0082]

[0083]

[0084]

[0085]

[0086]

[0087]

[0088]

[0089]

[0090]

[0091]

[0092]

[0093]

[0094]

[0095]

[0096]

[0097]

[0098]

[0099]

[0100]

[0101]

[0102]

[0103]

[0104]

[0105]

[0106]

[0107]

[0108]

[0109]

[0110]

[0111]

[0112]

[0113]

[0114]

[0115]

[0116]

[0117]

[0118]

[0119]

[0120]

[0121]

[0122]

[0123]

[0124]

[0125]

[0126]

[0127]

[0128]

[0129]

[0130]

[0131] … " can be extracted. As another example, the text decoder (440) may extract a token sequence "[OCR Read] Xmin=72 Ymin=487 Xmax=167 Ymax=538 EN …" representing the result of the character recognition operation based on the extracted embedding (430) according to a user command "[OCR Read]" requesting an OCR operation on an image. " can be extracted. Here, a token including square brackets ("[]") among the user command and token sequence is a special token and may be a token learned by a deep learning model. According to one embodiment, the text decoder (440) may use a Transformer-based decoder. The token sequence extracted by the text decoder (440) may be the output of the deep learning model (130). According to one embodiment, the token sequence output by the deep learning model (130) may then be converted into visualized information. FIG. 5 is a diagram showing an example of a method for generating a synthetic document for supervised comparison learning on a character-by-character basis according to one embodiment of the present disclosure. Since the conventional supervised comparison learning method is mainly used in image classification, most of them are learned by using images or objects in images as instances. However, if this method is applied as it is to an OCR system, the accuracy of character recognition cannot be effectively improved. Therefore, according to one embodiment of the present disclosure, each character may be regarded as an instance and supervised comparison learning on a character-by-character basis may be performed. Effective comparison Learning requires a variety of similar training data pairs. Data augmentation techniques can be used to increase the amount of training data. For example, data augmentation techniques are frequently used to create similar images by randomly cropping the image, flipping it horizontally, or flipping it upside down. However, since the input images of OCR systems contain characters, data augmentation techniques typically used for comparison learning can result in the loss of characters or alteration of their characteristics.Accordingly, according to one embodiment of the present disclosure, a synthetic image (520) for character-level map contrastive learning can be generated. According to one embodiment, the synthetic document generation unit (340) can generate a synthetic image (520) including the same characters as the actual image (510). For example, the synthetic document generation unit (340) can receive a set of words included in the actual image (510) as character information as input, and generate the synthetic image (520) by rendering the words included in the actual image (510) in an arbitrary font at an arbitrary location on an arbitrary background color. Additionally or alternatively, the synthetic document generation unit (340) can receive settings for generating the synthetic image (520), and generate the synthetic image (520) including the same characters as the actual image (510) according to the received settings. For example, the composite document generation unit (340) receives settings such as background information (e.g., RGB range of background color, etc.), font information (e.g., font type list, font size range, font thickness range, etc.), and whether to generate character-level coordinates, and can generate a composite image (520) including the same characters as the actual image (510) according to the set range. Since the composite image (520) is directly generated by the composite document generation unit (340), it can have location information (e.g., coordinate information) associated with the character information included in the composite image (520). Accordingly, even if the actual image (510) does not include character position information and thus supervised learning for OCR is impossible, the synthetic image (520) generated by the synthetic document generation unit (340) includes character position information, and thus supervised learning for OCR may become possible. According to one embodiment, the OCR system may perform training of a deep learning model using training data including a pair of a real image (510) and a synthetic image (520) generated based on the real image (510).The loss function for training a deep learning model may include a character-wise supervised contrastive loss. By training a deep learning model in a direction that minimizes the character-wise supervised contrastive loss, the model can be trained to extract similar features from the same character and to extract dissimilar features from different characters. That is, by training using the character-wise supervised contrastive loss, the deep learning model can be trained to have feature pairs (A and A, R and R) extracted from the same character be close to each other in the embedding space (530) (e.g., contrastive subspace) as a positive view, and have feature pairs (A and R) extracted from different characters be far from each other in the embedding space (530) as a negative view. A specific deep learning model training method and a method of calculating a supervised comparison loss are described in more detail below with reference to FIG. 6. Referring to the illustrated example, the shape of the letter "A" of "ADDRESS" included in the actual image (510) is not significantly different from the shape of the letter "A" of "Attn" in the actual image (510). The data augmentation method used in the prior art also hardly changes the shape of the letter. On the other hand, it can be confirmed that the letter "A" included in the synthetic image (520) generated by the synthetic document generation unit (340) is rendered in various shapes (various fonts, sizes, thicknesses, colors, etc.). In this way, by using the synthetic image (520) in which the letters are rendered in various shapes, the deep learning model can effectively learn various features. FIG. 6 is a diagram illustrating an example of a character-based supervised comparison learning method according to an embodiment of the present disclosure. The deep learning model training unit can train the deep learning model (620) to output a token sequence (640) representing character information and location information for an input image (612, 614).For example, the deep learning model training unit may train the deep learning model (620) using training images, character information included in the training images, and position information associated with the character information. As a specific example, the deep learning model (620) may be trained to predict target tokens including prompts, coordinate tokens, and character tokens using a loss function as in Mathematical Expression 1 below. Here, is an input image, is a token (where is the ith generated token, is the length of the token sequence generated by the decoder). Additionally or alternatively, the deep learning model training unit may train the deep learning model (620) using a pair of a real image (612) and a synthetic image (614) including the same characters as the real image. For example, the deep learning model (620) may generate a token sequence (640), i.e., a token, automatically regressively, using the real image (612) and the synthetic image (614) including the same characters as the real image as input. Here, may be the last hidden embedding of the decoder at the i-th generation stage (generation index). In addition, the last hidden embedding ( ) of the decoder may be input to the projection model (650), so that the projection of each character may be placed in the contrastive subspace. According to one embodiment, the real image (612) may not have position information associated with a character. Therefore, in the input command (630), the position information (coordinate token) associated with the real image (612) may be replaced with a mask token ([MASK]). In addition, the loss associated with the position information (coordinate token) predicted for the real image (612) may also be masked. The deep learning model learning unit may calculate a first loss function that maximizes the probability of predicting character information included in the real image (612) and the probability of predicting character information included in the synthetic image (614) and the position information associated therewith. As a specific example, the first loss function can be calculated by the following mathematical expression 2.Here, may be a pre-assigned weight for a coordinate token of the token sequence (640). For example, may be assigned to a coordinate token predicted for an actual image, and may be assigned to a coordinate token predicted for a synthetic image. In addition, the deep learning model training unit may calculate a second loss function representing a character-level map-contrast loss based on the actual image (612) and the synthetic image (614). As a specific example, the second loss function may be calculated by the following mathematical expression 3 for all characters included in one batch. Here, is a set of all characters included in the actual image and the synthetic image, is an index of a character, is a set of indices having the same character label, is the cardinality of , the symbol is a dot product, and is a scalar temperature. The deep learning model learning unit can train the deep learning model (620) by calculating a total loss function and minimizing the total loss function. The total loss function can be calculated based on the first loss function and / or the second loss function. As a specific example, the total loss function can be calculated by the following mathematical expression 4. Here, represents the number of image and label pairs, and represents a scaling factor of . As described above, the trained deep learning model (620) can predict a token sequence including character information (character token) included in an input image and location information (coordinate token) associated with the character information. As described above, the trained deep learning model (620) can be fine-tuned to perform various downstream tasks from an input image according to various user prompts indicating task types. FIG. 7 is a diagram showing examples of feature clustering results of a deep learning model trained by various learning methods.The feature clustering result of the deep learning model illustrated in FIG. 7 is obtained by mapping the high-dimensional features extracted from the last layer of the decoder of the deep learning model into a low-dimensional space using the t-SNE (t-distributed Stochastic Neighbor Embedding) method. The first example (710) shows the feature clustering result of the basic deep learning model, the second example (720) shows the feature clustering result of the character-level supervised contrastive learning model, and the third example (730) shows the feature clustering result of the character-level supervised contrastive learning model using learning data including synthetic character images and actual character images. As you go from the first example (710) to the third example (730), you can see that the features extracted from each character are clearly distinguished. That is, when using the character-based supervised contrastive learning model according to the present disclosure, it is possible to extract distinct character features compared to the prior art, and when additionally using a synthetic image through rendering according to the present disclosure, the accuracy of character recognition can be further improved. FIG. 8 is a flowchart illustrating an example of an OCR method (800) using a character-based supervised contrastive learning model according to an embodiment of the present disclosure. The OCR method (800) using a character-based supervised contrastive learning model can be performed by a processor (e.g., at least one processor of a computing device). First, the processor can receive an input image (S810). Here, the input image can include a document image and / or a scene image including characters. Then, the processor can extract a token sequence representing character information and positional information of the input image from the input image by the character-based supervised contrastive learning model (S820). According to one embodiment, the token sequence can be extracted from the input image according to a user command by the character-based supervised contrastive learning model.For example, a processor may extract an embedding from an input image using a deep learning-based encoder, and extract a token sequence from the embedding using a deep learning-based decoder. In one embodiment, the deep learning-based encoder may be either a convolutional neural network (CNN)-based model or a Transformer-based model. Also, in one embodiment, the deep learning-based decoder may include one of a BART (Bidirectional and Auto-Regressive Transformers)-based decoder or an auto-regressive decoder. According to one embodiment, a character-level supervised contrastive learning model may be a model trained to output a token sequence representing character information and position information for an input image using first training data including a first image and first character information, and second training data including second character information corresponding to a second image and the first character information and position information associated with the second character information. Additionally, the processor may convert the token sequence into visualized information (S830). For example, the visualized information may be a layer including character information and / or position information (e.g., a bounding box) corresponding to the character information added on top of the input image. FIG. 9 is a flowchart illustrating an example of a character-level supervised contrastive learning method (900) for OCR according to one embodiment of the present disclosure. A method (900) for character-based map comparison learning for OCR can be performed by a processor (e.g., at least one processor of a computing device). The processor can receive first learning data including a first image and first character information. In addition, the processor can receive second learning data including a second image, second character information corresponding to the first character information, and position information associated with the second character information (S910).According to one embodiment, the second image may be generated based on the first character information, font information, and image background information. Then, the processor may train a deep learning-based encoder-decoder model to output a token sequence representing character information and positional information for the input image using the first learning data and the second learning data (S920). For example, the processor may train the deep learning-based encoder-decoder model using a first loss function that maximizes the probability of predicting the first character information using the first image as input and the probability of predicting the second character information and positional information associated with the second character information using the second image as input. Additionally or alternatively, the processor may train the deep learning-based encoder-decoder model using a second loss function that calculates a character-wise supervised contrastive loss based on the first learning data and the second learning data. According to one embodiment, the deep learning-based encoder-decoder model may be further trained to output a token sequence according to a user command. In this case, each of the first learning data and the second learning data may further include a user command indicating an OCR operation type. The flowcharts and the above descriptions illustrated in FIGS. 8 and 9 are merely examples, and may be implemented differently in some embodiments. For example, in some embodiments, the order of each step may be changed, some steps may be repeated, some steps may be omitted, or some steps may be added. The above-described method may be provided as a computer program stored on a computer-readable recording medium for execution on a computer. The medium may continuously store the computer-executable program, or may temporarily store it for execution or download.In addition, the medium may be a variety of recording or storage means in the form of a single or multiple hardware combinations, and is not limited to a medium directly connected to a computer system, but may also be distributed on a network. Examples of the medium may include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical recording media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and those configured to store program instructions, including ROMs, RAMs, and flash memories. In addition, examples of other media may include recording or storage media managed by app stores that distribute applications or other sites or servers that supply or distribute various software. The methods, operations, or techniques of the present disclosure may be implemented by various means. For example, these techniques may be implemented by hardware, firmware, software, or a combination thereof. Those skilled in the art will understand that the various exemplary logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure of the present application may be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability of hardware and software, various exemplary components, blocks, modules, circuits, and steps have been generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and design requirements imposed on the overall system. Skilled artisans may implement the described functionality in various ways for each specific application, but such implementations should not be construed as departing from the scope of the present disclosure.In a hardware implementation, the processing units used to perform the techniques may be implemented within one or more ASICs, DSPs, digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, electronic devices, other electronic units designed to perform the functions described herein, a computer, or a combination thereof. Accordingly, the various illustrative logical blocks, modules, and circuits described in connection with the present disclosure may be implemented or performed with a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.In a firmware and / or software implementation, the techniques may be implemented as instructions stored on a computer-readable medium, such as random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable PROM (EEPROM), flash memory, a compact disc (CD), a magnetic or optical data storage device, etc. The instructions may be executable by one or more processors and may cause the processor(s) to perform certain aspects of the functionality described herein. If implemented in software, the techniques may be stored on or transmitted over a computer-readable medium as one or more instructions or code. Computer-readable media includes both computer storage media and communication media, including any medium that facilitates transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a computer. By way of non-limiting example, such computer-readable media can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any such connection is properly termed a computer-readable medium.For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, digital subscriber line, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes compact discs, laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks usually reproduce data magnetically, whereas discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium may be coupled to the processor such that the processor can read information from or write information to the storage medium. Alternatively, the storage medium may be integral to the processor. The processor and the storage medium may reside within an ASIC. The ASIC may reside within a user terminal. Alternatively, the processor and the storage medium may reside as discrete components within the user terminal. While the embodiments described above have been described as utilizing aspects of the presently disclosed subject matter in one or more standalone computer systems, the present disclosure is not limited thereto and may be implemented in conjunction with any computing environment, such as a network or distributed computing environment. Furthermore, aspects of the present disclosure may be implemented in multiple processing chips or devices, and storage may be similarly affected across multiple devices.These devices may include PCs, network servers, and portable devices. While the present disclosure has been described in connection with certain embodiments herein, various modifications and variations may be made without departing from the scope of the present disclosure as understood by those skilled in the art. Furthermore, such modifications and variations should be considered to fall within the scope of the claims appended hereto.

Claims

1. An OCR method using a character-by-character supervised contrastive learning model, performed by at least one processor of a computing device, Step of receiving an input image; A step of extracting a token sequence representing character information and location information of the input image from the input image by a character-unit supervised contrastive learning model; and An OCR method comprising a step of converting the above token sequence into visualized information.

2. In paragraph 1, The step of extracting a token sequence representing character information and location information of the input image from the input image by a character-unit supervised contrastive learning model is as follows. An OCR method comprising a step of extracting the token sequence from the input image according to a user command by the character-by-character supervised contrastive learning model.

3. In paragraph 1, The step of extracting a token sequence representing character information and location information of the input image from the input image by a character-unit supervised contrastive learning model is as follows. A step of extracting an embedding from the input image by a deep learning-based encoder; and An OCR method comprising a step of extracting the token sequence from the embedding by a deep learning-based decoder.

4. In paragraph 1, An OCR method wherein the character-based supervised contrastive learning model is trained to output a token sequence representing character information and position information for an input image using first learning data including a first image and first character information, and second learning data including a second image, second character information corresponding to the first character information, and position information associated with the second character information.

5. A method for character-by-character supervised learning for OCR, performed by at least one processor of a computing device, A step of receiving first learning data including first image and first character information; A step of receiving second learning data including a second image, second character information corresponding to the first character information, and location information associated with the second character information; and A method for supervised contrastive learning at the character level, comprising the step of training a deep learning-based encoder-decoder model to output a token sequence representing character information and positional information for an input image using the first learning data and the second learning data.

6. In paragraph 5, A character-by-character supervised contrastive learning method, wherein each of the first learning data and the second learning data further includes a user command indicating an OCR operation type.

7. In paragraph 5, The second image is a character-by-character map contrast learning method generated based on the first character information, font information, and image background information.

8. In paragraph 5, The step of training a deep learning-based encoder-decoder model to output a token sequence representing character information and position information for an input image is as follows: A method for supervised contrastive learning at the character level, comprising a step of training the deep learning-based encoder-decoder model using a first loss function that maximizes the probability of predicting the first character information using the first image as input and the probability of predicting the second character information and position information associated with the second character information using the second image as input.

9. In paragraph 5, The step of training a deep learning-based encoder-decoder model to output a token sequence representing character information and position information for an input image is as follows: A character-wise supervised contrastive learning method, comprising a step of training the deep learning-based encoder-decoder model using a second loss function that calculates a character-wise supervised contrastive loss based on the first learning data and the second learning data.

10. A computer-readable non-transitory recording medium recording commands for executing the method according to paragraph 1 on a computer.

11. An OCR system using a character-level map contrast learning model, memory; and At least one processor connected to said memory and configured to execute at least one computer-readable program contained in said memory Including, At least one program above, Receive the input image, By a character-based supervised contrastive learning model, a token sequence representing character position information and character information of the input image is extracted from the input image, An OCR system comprising one or more commands for converting the token sequence into visualized information.

Citation Information

Patent Citations

  • Live Commerce Broadcasting Curation Service Providing Method and Service Providing Server Used Therein

    KR1020220139087A

  • Server and method for providing investment information based on important keyword selected using keyword weight and item importance weight

    KR1020230000418A

  • Lettering cake brokerage platform, oh! My Cakku

    KR1020240083220A

  • Air quality sensing system including mobile terminal device

    KR102501871B1

  • Systems and Methods For Automatic Data Extraction From Document Images

    US20210012102A1