Apparatus, method, and storage medium
The information processing apparatus addresses false character detections in OCR by calculating detection scores and generating vicinity images, facilitating easy correction and reducing user effort in document digitization.
Patent Information
- Application Number
- US19/684338
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Priority Date
- 2025-05-26
- Filing Date
- 2026-05-21
- Publication Date
- 2026-11-26
AI Technical Summary
Existing OCR processes in document digitization often result in false detection of character string regions due to factors like faint printing, dust, or overlapping seals, leading to errors and a cumbersome correction process for users.
An information processing apparatus that calculates detection scores for character strings using positional information and generates vicinity images to identify undetected characters, allowing users to easily correct false detections through a user interface.
Reduces user burden by accurately identifying and correcting false character string detections, enhancing the efficiency of character extraction from scanned documents.
Smart Images

Figure US20260378242A1-D00000_ABST
Abstract
Description
BACKGROUNDField of the Technology
[0001] The aspect of the embodiments relates to a technique for extracting character strings from an image including characters.Description of the Related Art
[0002] Conventionally, paper documents are frequently digitized by being scanned with a scanner or the like. For the document digitization, a technique is widely used in which a character recognition process (OCR process) is performed on an image obtained by scanning (hereinafter referred to as "scanned image"), and recognized character strings obtained by the OCR process are used as a file name of the scanned image.
[0003] In the OCR process, false detection of character string regions in a scanned image may occur due to various factors such as faint printing or dust on the document to be scanned, a seal or signature overlapping a character, or the color of the paper on which the document is printed, or the color of the characters. Since the false detection of character string regions may lead to errors in the recognized character strings, some measures are required. In this regard, Japanese Patent Laid-Open No. 2015-215878, for example, discloses a technique that allows an editing operation (such as deletion or addition of characters) to be performed on a recognized character string obtained by an OCR process by using a keyboard or the like. Here, a task in which the user checks and corrects errors in recognized character strings is cumbersome and imposes a heavy burden on the user.SUMMARY
[0004] An apparatus according to an aspect of the embodiments includes: an obtaining unit configured to obtain positional information of a character string region detected from an image including one or more characters; and an output unit configured to output information on false detection of the character string region based on the positional information of the character string region.
[0005] Features of the disclosure will become apparent from the following description of embodiments with reference to the attached drawings. The following description of embodiments is described by way of example.BRIEF DESCRIPTION OF THE DRAWINGS
[0006] FIG. 1 is a schematic diagram of a multi-function printer (MFP);
[0007] FIG. 2 is a diagram illustrating an example of a document image;
[0008] FIG. 3 is a block diagram illustrating a hardware configuration of the MFP;
[0009] FIG. 4 is a block diagram illustrating a functional configuration of an information processing apparatus according to a first embodiment;
[0010] FIG. 5 is a flowchart illustrating a flow of processing by the information processing apparatus according to the first embodiment;
[0011] FIGS. 6A and 6B are explanatory diagrams illustrating an example of a process through which a vicinity image is generated;
[0012] FIG. 7 is a diagram illustrating an example of a user interface (UI) screen;
[0013] FIG. 8 is a diagram illustrating an example of a UI screen;
[0014] FIG. 9 is a diagram illustrating an example of a UI screen indicating the result of item extraction in the first embodiment;
[0015] FIG. 10 is a block diagram illustrating a functional configuration of an information processing apparatus according to a second embodiment;
[0016] FIG. 11 is a flowchart illustrating a flow of processing by the information processing apparatus according to the second embodiment;
[0017] FIG. 12 is a block diagram illustrating a functional configuration of an information processing apparatus according to a third embodiment;
[0018] FIG. 13 is a flowchart illustrating a flow of processing by the information processing apparatus according to the third embodiment; and
[0019] FIG. 14 is a diagram illustrating an example of a UI screen indicating the result of item extraction in the third embodiment.DESCRIPTION OF THE EMBODIMENTS
[0020] Exemplary embodiments of the disclosure will be specifically described below with reference to the accompanying drawings. Note that the following embodiments do not limit the contents of the disclosure, and not all of the combinations of the features described in the following embodiments are necessarily essential for the solution to be provided by the disclosure. Note that identical components will be described with the same reference sign.First EmbodimentOverview of Document Scanning
[0021] An example of document scanning will be described as an example in which an information processing apparatus according to the embodiment is employed. In document scanning, from a scanned image obtained by scanning (reading) a document, character strings are extracted by OCR, and a file name is automatically assigned using the extracted character strings.
[0022] FIG. 1 is a schematic diagram of an MFP 10 equipped with the information processing apparatus according to the embodiment. The MFP 10 is a composite machine having a plurality of functions, such as a scanner function and a printer function. The MFP 10 includes a scanner 11, a printer 12, and a touch panel display 13.
[0023] The scanner 11 scans a document, such as an invoice, to generate a scanned image. The scanner 11 includes an automatic document feeder (ADF) not illustrated and is capable of automatically scanning a plurality of documents. Incidentally, the scanner 11 may include no ADF.
[0024] The printer 12 prints an image on a print medium, such as paper, by an electrophotographic method, for example. Incidentally, the printer 12 is not limited to an electrophotographic printer, and may be a printer employing a different printing method, such as an inkjet method.
[0025] The touch panel display 13 includes an input unit 55 and a display unit 56 (see FIG. 3 to be described later). The display unit 56 of the touch panel display 13 displays the result of a scan by the scanner 11, the result of a process by an information processing apparatus 100 (see FIG. 4 to be described later), and the like.
[0026] The MFP 10 has an OCR function in addition to the scanner function and the printer function. By scanning a document with the scanner 11 and performing an OCR process on the obtained scanned image, the MFP 10 extracts the character strings included in the scanned image. It is to be noted that "OCR process" in the embodiment includes a process of detecting character string regions from a scanned image and a process of recognizing a character string from each of the detected character string regions (an OCR process in a narrow sense). Also, the MFP 10 performs item extraction that identifies for each recognized character string obtained by the OCR process to which item the recognized character string corresponds to. The information processing apparatus 100 according to the embodiment calculates detection scores using positional information of the character string regions for the character strings corresponding to the extracted items. Each detection score is an indicator indicating the possibility that a vicinity region or regions around a character string region detected from the scanned image include characters that are supposed to be present in the character string region but have failed to be detected (undetected characters).
[0027] FIG. 2 is a diagram illustrating an example of a document image obtained by scanning an invoice (invoice image). In an invoice image 510, there are: a character string "INVOICE" 511 representing an item "title"; a character string "Factory Inc." 512 representing an item "destination company name"; and a character string "Edmond Grey" 513 representing an item "destination company person-in-charge name." Further, in the invoice image 510, there are: a character string "June, 14, 2024" 514 representing an item "date"; and a character string "354,000" 515 representing an item "amount." Furthermore, in the invoice image 510, there are: a character string "Family Company" 516 representing an item "sender company name"; and a character string "King Wrenn" 517 representing an item "person-in-charge signature." A character string with no item type "To:" 502 is present to the left of the character string "Factory Inc." 512 representing the item "destination company name." A character string with no item type "Dear:" 503 is present to the left of the character string "Edmond Grey" 513 representing the item "destination company person-in-charge name." A character string with no item type "USD" 505 is present to the right of the character string "354,000" 515 representing the item "amount." Here, in the invoice image 510, a right portion of the character string "Family Company" 516 representing the item "sender company name" and a left portion of the character string "King Wrenn" 517 representing the item "person-in-charge signature" overlap. Consequently, the character string region of the character string "Family Company" 516 fails to be properly detected, preventing proper character recognition of the "any" portion in the original character string "Family Company." A main object of the disclosure is to present to a user a failure to extract a character string or strings due to false detection of character string regions as described above.Definitions of Terms
[0028] Terms used in the embodiment are defined as follows.
[0029] A sequence of one or more consecutive characters is referred to as a character string. Hereinafter, each character included in a character string will be referred to as "character."
[0030] Positional information of a character string means coordinate information for identifying the position of the character string in the scanned image. The positional information of a character string in the embodiment is held in the form of a list listing the coordinate values of the pixels at the four vertices of a rectangle surrounding each character included in the character string.
[0031] The detection score is a scalar value that takes 1 in a case where the scanned image includes a character, and takes 0 in a case where the scanned image includes no character.
[0032] Item extraction refers to extraction of items written in the document to be scanned, such as organizations' names, persons' names, a document number, and the issuance date of the document. The item extraction can be implemented using a named entity extraction technique. Specifically, character strings are converted into a sequence of tokens which are small chunks of words or characters. Then, using bidirectional encoder representations from transformers (BERT), a label is estimated for each token to extract an item. Character string selection to be described later refers to selection of character strings with particular labels estimated by BERT. The information processing apparatus 100 according to the embodiment calculates a detection score for each character string selected using the item extraction (target character string). Note that description of BERT is omitted since the method by Jacob et al. describes it in detail. The following is the title of the document describing the method by Jacob et al.
[0033] "Jacob et al., BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, arxiv, 2018."
[0034] The scanned image is assumed to be a color image with three 8-bit RGB channels, for example.Hardware Configuration of MFP
[0035] Next, a hardware configuration of the MFP 10 in the embodiment will be described. FIG. 3 is a block diagram illustrating a hardware configuration of the MFP 10 in the embodiment. The MFP 10 includes a central processing unit (CPU) 51, a read-only memory (ROM) 52, a random-access memory (RAM) 53, an external memory 54, the input unit 55, the display unit 56, a communication interface (I / F) 57, and an input-output unit (I / O) 58. The CPU 51, the ROM 52, the RAM 53, the external memory 54, the input unit 55, the display unit 56, the communication interface 57, and the input-output unit 58 are electrically connected via a system bus 61.
[0036] The CPU 51 performs processes in the embodiment by executing control programs. The CPU 51 also controls various devices connected via the system bus 61, such as the input unit 55 and the display unit 56. The ROM 52 stores a BIOS program and a boot program. The RAM 53 is used as a main storage device for the CPU 51. The external memory 54 stores programs to be executed by the information processing apparatus 100 according to the embodiment. The input unit 55 is, for example, provided in the touch panel display 13 and performs a process corresponding to an input into the touch panel display 13. The display unit 56 is, for example, provided in the touch panel display 13 and displays the result of a process by the information processing apparatus 100 in accordance with an instruction from the CPU 51. The display unit 56 may be configured using a liquid crystal display device, or configured using a projector, or configured using a light emitting diode (LED) indicator. The communication interface 57 performs information communication through a network. The type of the communication interface 57 may be Ethernet, Universal Serial Bus (USB), serial communication, or wireless communication. The input-output unit (I / O) 58 receives scanned images output from the scanner 11 of the MFP 10.Functional Configuration of Information Processing Apparatus
[0037] Next, the information processing apparatus 100 according to the first embodiment will be described. FIG. 4 is a block diagram illustrating a functional configuration of the information processing apparatus 100 according to a first embodiment. The information processing apparatus 100 according to the first embodiment includes a positional information input unit 101, an image information input unit 102, a position obtaining unit 103, a vicinity image generation unit 104, an information creation unit 105, a detection score calculation unit 106, a detection score calculation model 107, and an output unit 108. The CPU 51 serving as a computer implements these functions by loading programs included in software stored in the external memory 54 to the RAM 53 and executing processes in accordance with flowcharts to be described later. The CPU 51 then holds the results of the executed processes in the RAM 53. In this case, the CPU 51 can be regarded as having each of the functions of the information processing apparatus 100 illustrated in FIG. 4, but does not need to have all of these functions. For example, the information processing apparatus 100 may include a dedicated processing circuit that performs a process corresponding to at least one of the functions of the information processing apparatus 100.
[0038] Also, the information processing apparatus 100 is electrically connected to an image obtaining unit 21, a character string processing unit 22, and the display unit 56 of the MFP 10. Moreover, the image obtaining unit 21 and the character string processing unit 22 are electrically connected to a character string recognition unit 31 of the MFP 10. The image obtaining unit 21 is included in the scanner function of the MFP 10 (scanner 11), for example. The image obtaining unit 21 scans a document containing characters, such as an invoice, to obtain a scanned image. The image obtaining unit 21 outputs the obtained scanned image to the character string processing unit 22, the character string recognition unit 31, and the information processing apparatus 100. Incidentally, the image obtaining unit 21 may be included in the information processing apparatus 100.
[0039] The character string processing unit 22 obtains the positional information of the character string regions in the scanned image input from the image obtaining unit 21. The positional information of the character string regions can be obtained by, for example, performing a so-called block selection process on the scanned image. The character string processing unit 22 outputs the obtained positional information of the character string regions to the character string recognition unit 31 and the information processing apparatus 100. Based on the result of an OCR process by the character string recognition unit 31 to be described later, the character string processing unit 22 also executes item extraction that, for each of the recognized character strings in the character string regions in the scanned image, identifies which item in the target document (e.g., a destination company name, a sender company name, or the like) the character string corresponds to. The character string processing unit 22 outputs the result of the item extraction to the information processing apparatus 100. Incidentally, the character string processing unit 22 may be included in the information processing apparatus 100.
[0040] The character string recognition unit 31 performs an OCR process based on the scanned image input from the image obtaining unit 21 and the positional information of the character string regions input from the character string processing unit 22 to obtain a recognized character string for each character string region.
[0041] Incidentally, in the embodiment, the character string processing unit 22 and the character string recognition unit 31 have been described as independent functional units, but may be combined into a single functional unit. Specifically, the functions of the two units may be implemented using a machine learning model capable of concurrently detecting character string regions in a scanned image and performing a character recognition process on each character string region.
[0042] The information processing apparatus 100 calculates detection scores using the scanned image input from the image obtaining unit 21 and the positional information of the character string regions input from the character string processing unit 22. The information processing apparatus 100 outputs the calculated detection scores to the display unit 56 of the touch panel display 13. The display unit 56 presents a display based on the detection scores calculated by the information processing apparatus 100. As described earlier, each detection score indicates the possibility of a vicinity region or regions peripheral to a character string region including characters in an undetected state in which the characters are outside the character string region (undetected characters). The detection score is also referred to as "character string detection score."
[0043] The positional information input unit 101 outputs the positional information of the character string regions input from the character string processing unit 22 to the position obtaining unit 103 and the information creation unit 105. The positional information input unit 101 also outputs information on the character strings corresponding to the items extracted by the character string processing unit 22 to the position obtaining unit 103. The image information input unit 102 outputs the scanned image input from the image obtaining unit 21 to the vicinity image generation unit 104.
[0044] Based on the positional information of the character string regions input from the positional information input unit 101 and the information on the character strings corresponding to the items extracted by the character string processing unit 22, the position obtaining unit 103 obtains the positional information of the character string regions for target character strings. In the embodiment, the position obtaining unit 103 sets the character strings corresponding to the items extracted by the character string processing unit 22 as target character strings for which to calculate a detection score. The position obtaining unit 103 selects the coordinate values of the pixels at the four vertices of rectangles respectively surrounding the target character strings as the positional information of the detected character string regions for the target character strings. As described above, the positional information of the character string region for a target character string is information indicating a rectangle surrounding that target character string. The position obtaining unit 103 outputs the obtained positional information of the character string regions (for the target character strings) to the vicinity image generation unit 104.
[0045] The vicinity image generation unit 104 generates vicinity images based on the positional information of the character string regions (for the target character strings) input from the position obtaining unit 103 and the scanned image input from the image information input unit 102. Each vicinity image is an image representing vicinity regions including regions peripheral to the character string region for a target character string. The vicinity image generation unit 104 outputs the generated vicinity images to the information creation unit 105.
[0046] Based on the positional information of the character string regions input from the positional information input unit 101 and the vicinity images input from the vicinity image generation unit 104, the information creation unit 105 creates image information of undetected regions each obtained by excluding a character or characters in a vicinity region that have been detected if any. Hereinafter, a character or characters in a vicinity region that have been detected will be referred to also as "detected character or characters." In the embodiment, the information creation unit 105 creates a mask image as the image information of each undetected region. The mask image is an image obtained by filling (masking) the character or characters included in the vicinity region that have been detected (detected characters) with the background color. The information creation unit 105 outputs the created mask images (the image information of the undetected regions) to the detection score calculation unit 106.
[0047] With the detection score calculation model 107, the detection score calculation unit 106 calculates detection scores based on the mask images (the image information of the undetected regions) input from the information creation unit 105. The detection score calculation model 107 will be described later. Incidentally, the detection score calculation model 107 may be provided to be separate from the information processing apparatus 100. The detection score calculation unit 106 outputs the calculated detection scores to the output unit 108. The output unit 108 outputs the detection scores calculated by the detection score calculation unit 106 to the display unit 56 of the touch panel display 13.Processing Operation of Information Processing Apparatus
[0048] Next, an information processing method using the information processing apparatus 100 according to the first embodiment will be described. FIG. 5 is a flowchart illustrating a flow of processing by the information processing apparatus 100 according to the first embodiment. The processing illustrated in the flowchart of FIG. 5 is automatically started in response to starting the information processing apparatus 100 by powering on the information processing apparatus 100.
[0049] In step S101, the information processing apparatus 100 performs a system initialization process. Specifically, the information processing apparatus 100 loads programs from the external memory 54 and renders them able to operate the information processing apparatus 100. The information processing apparatus 100 also stores setting parameters of the programs saved in the external memory 54 and the like in the RAM 53, as necessary. After the initialization process is completed, the processing proceeds to step S102.
[0050] In step S102, the positional information input unit 101 outputs the positional information of character string regions input from the character string processing unit 22 to the position obtaining unit 103 and the information creation unit 105. The positional information input unit 101 also outputs information on character strings corresponding to items extracted by the character string processing unit 22 to the position obtaining unit 103.
[0051] In step S103, the image information input unit 102 outputs the scanned image input from the image obtaining unit 21 to the vicinity image generation unit 104.
[0052] In step S104, the position obtaining unit 103 obtains the positional information of the character string regions for target character strings. The position obtaining unit 103 outputs the obtained positional information of the character string regions (for the target character strings) to the vicinity image generation unit 104.
[0053] In step S105, the vicinity image generation unit 104 generates vicinity images. For each of the character string regions for the target character strings, the vicinity image generation unit 104 cuts out image regions located in the same line as the character string region as the vicinity images from the scanned image. In a case where the target character strings are written horizontally, the vicinity image generation unit 104 extends regions to the left and right of each character string region by a predetermined length, and cuts out image regions in the vicinity of the left and right sides of the character string region such that the image regions do not include the target character string. Subsequently, the vicinity image generation unit 104 horizontally joins the image region cut out from the vicinity of the left side of the character string region and the image region cut out from the vicinity of the right side of the character string region to generate a single vicinity image. In a case where the target character strings are written vertically, the vicinity image generation unit 104 extends regions on the above and under each character string region by a predetermined length, and cuts out image regions in the vicinity of the upper and lower sides of the character string region such that the image regions do not include the target character string. Subsequently, the vicinity image generation unit 104 vertically joins the image region cut out from the vicinity of the upper side of the character string region and the image region cut out from the vicinity of the lower side of the character string region to generate a single vicinity image. The vicinity image generation unit 104 outputs data of the generated vicinity images to the information creation unit 105. After the generation of the vicinity images is completed, the processing proceeds to step S106. Incidentally, in the embodiment, it is assumed that the character string processing unit 22 has determined whether the character strings are written horizontally or vertically based on the positional relationship between the characters in each character string.
[0054] FIGS. 6A and 6B are explanatory diagrams illustrating an example of a process through which a vicinity image is generated. FIG. 6A is a diagram illustrating two vicinity regions 522 for a target character string "Family Comp." FIG. 6B is a diagram illustrating a vicinity image 520 obtained by joining the two vicinity regions 522. As illustrated in FIG. 6A, image regions in the vicinity of the left and right sides of a character string region 521 for the target character string "Family Comp" are cut out as the vicinity regions 522. The vicinity region 522 located to the right of the character string region 521 includes undetected characters "any" in the character string "Family Company" representing the item "sender company name." Subsequently, as illustrated in FIG. 6B, the image region cut out from the vicinity of the left side of the character string region and the image region cut out from the vicinity of the right side of the character string region are horizontally joined to generate a single vicinity image 520.
[0055] Referring back to FIG. 5, in step S106, the information creation unit 105 creates mask images as image information of undetected regions. Specifically, first, using the positional information of the character string regions for the characters that have been detected (detected characters), the information creation unit 105 derives rectangles indicating the positions of the detected characters in the vicinity regions. Then, the information creation unit 105 scans the pixels in each vicinity region outside the derived rectangle, and calculates an average pixel value of the scanned image region to derive the background color of the characters. Thereafter, the information creation unit 105 fills the rectangle indicating the position of the detected character or characters in the vicinity region with the derived background color. As a result, a mask image is obtained. The information creation unit 105 outputs the created mask images as the image information of the undetected regions to the detection score calculation unit 106.
[0056] In step S107, the detection score calculation unit 106 calculates detection scores. The detection score calculation unit 106 outputs the calculated detection scores to the output unit 108. The output unit 108 outputs the detection scores calculated by the detection score calculation unit 106 to the display unit 56 of the touch panel display 13.
[0057] In the embodiment, the detection score calculation model 107 is configured using data-efficient image transformers (DeiT). DeiT is a neural network model in which 12 Transformer blocks are stacked. Note that description of the DeiT network configuration and training method is omitted since the method by Hugo et al. describes it. The following is the title of the document describing the method by Hugo et al.
[0058] "Hugo et al., Training data-efficient image Transformers & distillation through attention, arxiv, 2020."
[0059] Also, it is assumed that DeiT has been trained (fine-tuned) to estimate a value that takes 1 in a case where the vicinity image (the image of the undetected regions) includes a character or characters, and takes 0 in a case where the vicinity image includes no character. Note that each of the detection scores may be estimated to be a value within the range of 0 to 1 and then determined to be a value of 0 or 1 using a predetermined threshold value. In the embodiment, the detection scores are values estimated by a calculation model with this neural network (detection score calculation model 107). The training (fine tuning) of the detection score calculation model 107 will be described later in a second embodiment.
[0060] In step S108, the information processing apparatus 100 determines whether to terminate the processing. If the processing is not to be terminated (if it is determined NO), the processing returns to step S102. On the other hand, if the processing is to be terminated (if it is determined YES), the processing is terminated.
[0061] The display unit 56 of the touch panel display 13 presents a display corresponding to the detection scores input from the output unit 108. FIG. 7 is a diagram illustrating an example of a UI screen 530 for presenting to the user a failure to extract character strings due to false detection of character string regions. The middle part of the UI screen 530 in FIG. 7 illustrates the result of item extraction for the item "destination company name" and the item "sender company name." For the item "destination company name," an extracted character string "Factory Inc" 531 is displayed. To the left of the extracted character string "Factory Inc" 531, an item display image 532 is displayed which includes a character string "To:" indicating that the character string "Factory Inc" 531 has been extracted as a character string corresponding to the item "destination company name." For the item "sender company name," an extracted character string "Family Comp" 533 is displayed. To the left of the extracted character string "Family Comp" 533, an item display image 534 is displayed which includes a character string "From:" indicating that the character string "Family Comp" 533 has been extracted as a character string corresponding to the item "sender company name." For example, the extracted character string "Family Comp" 533 is underlined indicating that the extracted character string is likely to be incomplete and there is likely to be an undetected character or characters because the detection score calculated for the item "sender company name" is lower than a predetermined score.
[0062] Also, the lower part of the UI screen 530 in FIG. 7 displays a peripheral image 535 obtained by cutting out a region where an undetected character or characters are likely to be present. In the peripheral image 535, a solid frame 536 surrounding the character string "Family Comp" indicates the detected character string region for the character string. Further, in the peripheral image 535, the region indicated by a dashed line 537 to the right of the solid frame 536 represents a vicinity region in which an undetected character or characters are suspected to be present. Note that a dashed line indicating a vicinity region is not displayed at a region to the left of the solid frame 536 because no undetected character is likely to be present there. Furthermore, in the peripheral image 535, a balloon 538 with an exclamation mark is displayed as an annotation indicating that an undetected character or characters are likely to be present. The user can easily find the false detection of the character string region based on the display of this balloon 538. After finding the false detection of the character string region, the user corrects the character string for the item "sender company name" by performing input on the touch panel display 13. After correcting the character string, the file name is determined using predetermined character strings including the corrected character string for the item (e.g., the character string for the destination company name and the character string for the sender company name). Incidentally, in a case where it is determined that no undetected character is present peripheral to any of the character strings for the extracted items, the task in which the user checks for false detection of character string regions may be skipped.
[0063] FIG. 8 is a diagram illustrating an example of a UI screen 540. The UI screen 540 in FIG. 8 indicates that the digitized document (electronic document) is saved to a shared folder on a network from the MFP 10. The UI screen 540 in FIG. 8 displays a path 541 to the shared folder and a file name 542 of the electronic document saved to the shared folder. The file name 542 of the electronic document is determined using the character string "Factory Inc." for the item "destination company name" and the character string "Family Company" for the item "sender company name." In the example illustrated in FIG. 8, the user presented with the false detection of the character string region has corrected the character string, and the electronic document is saved to the shared folder on the network with the file name 542 generated using the corrected character string. Incidentally, in a case where it is determined that no undetected character is present peripheral to any of character strings for items extracted from one document image, the task in which the user checks for false detection of character string regions may be skipped.Another Example of UI Screen
[0064] Next, another example of a UI screen will be described. FIG. 9 is a diagram illustrating an example of a UI screen 600 indicating the result of item extraction in the first embodiment. On the left side of the UI screen 600 in FIG. 9, an invoice image 510 is displayed. In the invoice image 510 on the UI screen 600 in FIG. 9, target character strings corresponding to the items extracted by the item extraction are surrounded by solid frames 560. Incidentally, the solid frames 560 may be dashed frames. On the right side of the UI screen 600 in FIG. 9, a character string region 621 corresponding to a target character string is displayed for each item extracted from the invoice image 510. The character string region 621 for each item is surrounded by a solid line. A vicinity region 622 surrounded by a dashed line is displayed to the left of and to the right of the character string region 621 for each item. Each vicinity region 622 is displayed as a mask image (an image of an undetected region) obtained by masking a character or characters that have been detected (detected character or characters). Under the character string region 621 for each item, there are displayed: a recognized character string 623 corresponding to the target character string; an item type 624 of the target character string; and a detection score 626 of the target character string.
[0065] For an item "title" 611 represented by the character string "INVOICE" in the invoice image 510, the recognized character string 623 is "INVOICE." As the item type 624, a character string "Title" representing the item "title" is displayed. Also, the detection score 626 is 0.9. The item "title" 611 is an item with a detection score 626 higher than a predetermined score (e.g., 0.7), thus requiring no check on the target character string by the user.
[0066] For an item "destination company name" 612 represented by the character string "Factory Inc." in the invoice image 510, the recognized character string 623 is "Factory Inc" without a period. As the item type 624, a character string "Org To" representing the item "destination company name" is displayed. Also, the detection score 626 is 0.3. For the item "destination company name" 612, "." in the character string "Factory Inc." is included as an undetected character in the vicinity region 622 to the right of the character string region 621. As described earlier, the character string with no item type "To:" is present to the left of the character string "Factory Inc." in the invoice image 510. The character string "To:" is masked in the vicinity region 622 to the left of the character string region 621 as detected characters. The item "destination company name" 612 is an item with a detection score 626 lower than the predetermined score, thus requiring a check on the target character string by the user. To indicate that the target character string needs to be checked, a balloon 638 with an exclamation mark is displayed for the item "destination company name"612.
[0067] For an item "destination company person-in-charge name" 613 represented by the character string "Edmond Grey" in the invoice image 510, the recognized character string 623 is "Edmond Grey." As the item type 624, a character string "Person To" representing the item "destination company person-in-charge name" is displayed. Also, the detection score 626 is 0.9. As described earlier, the character string with no item type "Dear:" is present to the left of the character string "Edmond Grey" in the invoice image 510. The character string "Dear:" is masked in the vicinity region 622 to the left of the character string region 621 as characters that have been detected. The item "destination company person-in-charge name" 613 is an item with a detection score 626 higher than the predetermined score, thus requiring no check on the target character string by the user.
[0068] For an item "date" 614 represented by the character string "June, 14, 2024" in the invoice image 510, the recognized character string 623 is "June, 14, 2024." As the item type 624, a character string "Date" representing the item "date" is displayed. Also, the detection score 626 is 0.9. The item "date" 614 is an item with a detection score 626 higher than the predetermined score, thus requiring no check on the target character string by the user.
[0069] For an item "amount" 615 represented by the character string "354,000" in the invoice image 510, the recognized character string 623 is "354,0000." As the item type 624, a character string "Amount" representing the item "amount" is displayed. Also, the detection score 626 is 0.9. As described earlier, the character string with no item type "USD" is present to the right of the character string "354,000" in the invoice image 510. "SD" in the character string "USD" is masked in the vicinity region 622 to the right of the character string region 621 as characters that have been detected. For the item "amount" 615, "U" in the character string "USD" has been falsely detected as the rightmost "0" in "354,0000," which is the recognized character string 623. In one embodiment, the item "amount" 615 is an item with a detection score 626 higher than the predetermined score but requires a check on the target character string by the user.
[0070] For an item "sender company name" 616 represented by the character string "Family Company" in the invoice image 510, the recognized character string 623 is "Family Comp." As the item type 624, a character string "Org To" representing the item "destination company name" is displayed, not a character string representing the item "sender company name." Also, the detection score 626 is 0.3. For the item "sender company name" 616, "any" in the character string "Family Company" is included as undetected characters in the vicinity region 622 to the right of the character string region 621. In one embodiment, the item "sender company name" 616 is an item with a detection score 626 lower than the predetermined score, thus requiring a check on the target character string by the user. To indicate that the target character string needs to be checked, a balloon 638 with an exclamation mark is displayed for the item "sender company name" 616.
[0071] For an item "person-in-charge signature" 617 represented by the character string "King Wrenn" in the invoice image 510, the recognized character string 623 is "VVews." As the item type 624, a character string "Org From" representing the item "sender company name" is displayed, not a character string representing the item "person-in-charge signature." Also, the detection score 626 is 0.1. For the item "person-in-charge signature" 617, "King" in the character string "King Wrenn" is included as undetected characters in the vicinity region 622 to the left of the character string region 621. Moreover, the recognized character string 623 has been falsely detected as "VVews." In one embodiment, the item "person-in-charge signature" 617 is an item with a detection score 626 lower than the predetermined score, thus requiring a check on the target character string by the user. To indicate that the target character string needs to be checked, a balloon 638 with an exclamation mark is displayed for the item "person-in-charge signature" 617.
[0072] With a UI screen 600 as described above, the user can easily find target character strings whose character string region may have been falsely detected by checking target character strings for items with low detection scores 626. Also, the user can correct the character strings for the false detection of the character string regions by selecting items using the touch panel display 13. This saves time and effort to perform the task of correcting the character strings.
[0073] On the UI screen 600 in FIG. 9, a character string region 621 for a target character string and vicinity regions 622 are displayed for each item extracted from the invoice image 510, but the display is not limited to this. For example, in one embodiment, of the character string region 621 and the vicinity regions 622, only the character string region 621 may be displayed, or only the vicinity regions 622 may be displayed. In this way, the user only needs to look at and check the character string region 621 for the target character string or the vicinity regions 622. This reduces the cumbersomeness of the task of checking false detection of character string regions.
[0074] Note that the output unit 108 outputs the detection scores calculated by the detection score calculation unit 106 as information on false detection of character string regions. In a case where a detection score is lower than the predetermined score, the output unit 108 may output information indicating that the character string region for the corresponding item may have been falsely detected.Advantageous Effects
[0075] As described above, according to the first embodiment, it is possible to reduce the burden on the user in extraction of character strings from an image including characters by an OCR process. Specifically, in the embodiment, the output unit 108 outputs detection scores as information on false detection of character string regions. In this way, the user can easily find target character strings whose character string region may have been falsely detected based on the information on false detection of character string regions. This reduces the cumbersomeness of the task of finding falsely detected character string regions. Accordingly, it is possible to reduce the burden on the user in extraction of character strings from an image including characters by an OCR process.
[0076] Also, the detection score calculation unit 106 calculates the detection scores based on image information of undetected regions each obtained by excluding a character or characters in a vicinity region that have been detected (detected character or characters) if any. Masking the detected characters in the vicinity regions allows the detection score calculation unit 106 to calculate the detection scores without having to take into account whether the characters included in the vicinity regions have been detected. This allows for accurate calculation of the detection scores and reduces the cumbersomeness of the task of finding falsely detected character string regions.Modifications
[0077] In the embodiment, the scanned image is a color image with three 8-bit RGB channels but is not limited to this. For example, the scanned image may be a high dynamic range (HDR) image with three 10-bit RGB channels. Alternatively, the scanned image may be a monochrome image or a binary image.
[0078] In the embodiment, the positional information of each character string is coordinate information indicating the coordinates of pixels in the image, but is not limited to this. The positional information of each character string may only need to be information that can indicate the position of the character string region in the image. For example, the positional information of each character string may be information indicating values normalized to range from 0 to 1 or from −1 to 1 based on the image's vertical and horizontal dimensions.
[0079] In the embodiment, a detection score is calculated for each item (target character string) extracted by item extraction, but the calculation is not limited to this. For example, a detection score may be calculated for every character string extracted by the OCR process including the character strings with no item type. In a case where the OCR process extracts a character string spanning a plurality of lines, the detection score of the character string may be calculated line by line. Also, a detection score may be calculated for each character in each character string extracted by the OCR process, and a detection score can be calculated for each character string with which a vicinity image can be generated. Also, in a case where character strings can be divided on a word-by-word basis, the range of the character string region for each target character string may be divided on a word-by-word basis, and the range of the character string region for each target character string can be set to any range. Thus, calculation of a detection score is not limited to cases where items (character strings) are extracted by item extraction, and is applicable to any applications that handle images including character strings.
[0080] In the embodiment, the information processing apparatus 100 is installed in the MFP 10 including the scanner 11, but is not limited to this. For example, the information processing apparatus 100 may be provided on a network. Also, what is input into the information processing apparatus 100 is not limited to a scanned image obtained by the image obtaining unit 21, and may be an electronic file including an image and character strings included in the image.
[0081] The embodiment has been described taking as an example a case where a document, such as an invoice, is scanned to obtain a scanned image, but is not limited to this. For example, the "image including characters" may be an image obtained by imaging a product with characters depicted on its surface. In this case, the embodiment is applicable to defect detection systems that check for failure to print a lot number in a manufacturing process of a product, faint printing of a lot number, or the like. Alternatively, the "image including characters" may be a natural image with characters. In this case, the embodiment is applicable to a case of checking whether an undetected character or characters are present in any of the vicinity regions by a character string for a translation system that extracts character strings from a natural image by an OCR process and translates them.
[0082] In the embodiment, the detection score calculation model 107 is a neural network model using a Transformer, but is not limited to this. It suffices that the detection score calculation model 107 outputs a low detection score in a case where an undetected character or characters are present in a vicinity region. In this case, any model such as a convolutional neural network (CNN) model or a fully-connected neural network model can be used as the detection score calculation model 107.
[0083] Moreover, the detection score calculation model 107 is not limited to a neural network model. For example, edge detection, such as the Sobel filter, may be applied to the vicinity images. In this case, if a response value obtained by applying the edge detection to a vicinity image becomes high, the vicinity region may be assumed to include an undetected character or characters and the detection score may be set low. If the response value obtained by applying the edge detection to a vicinity image becomes low, the detection score may be set high. Alternatively, for example, the spatial frequency within the vicinity images may be analyzed. In this case, if the spatial frequency within a vicinity image includes a predetermined low frequency component, one or both vicinity regions may be assumed to include undetected characters and the detection score may be set low. If the spatial frequency within a vicinity image does not include the predetermined low frequency component, the vicinity regions may be assumed to include no undetected character and the detection score may be set high. Thus, in a case where the detection score calculation model 107 is configured not to use a neural network, it is possible to quickly determine whether a vicinity region includes an undetected character or characters.
[0084] In the embodiment, the detection score is a scalar value that takes 1 in a case where the vicinity image includes a character, and takes 0 in a case where the vicinity image includes no character, but is not limited to this. The detection score may be a value ranging from 0 to 100 or a binary value indicating high or low as long as it is a value with which the presence or absence of an undetected character or characters can be determined.
[0085] In the embodiment, the vicinity image generation unit 104 generates a vicinity image by cutting out and joining image regions above and under or to the left and right of a character string region, but is not limited to this. The vicinity image generation unit 104 does not need to join the cut image regions as long as the detection score calculation model 107 can determine the presence or absence of an undetected character or characters. Specifically, the vicinity image generation unit 104 may generate a vicinity image based on at least one of a region in the vicinity of the upper side of a character string region, a region in the vicinity of the lower side of the character string region, a region in the vicinity of the left side of the character string region, or a region in the vicinity of the right side of the character string region.
[0086] For example, a vicinity image may be an image of a region in the vicinity of the upper side of a character string region. In this case, the configuration may be such that the entirety of image information of the document is used to mask the image regions other than the regions in the vicinity of the upper sides of the character string regions and the characters that have been detected. A vicinity image may be an image of a region in the vicinity of the lower side of a character string region. In this case, the configuration may be such that the entirety of the image information of the document is used to mask the image regions other than the regions in the vicinity of the lower sides of the character string regions and the characters that have been detected. A vicinity image may be an image of a region in the vicinity of the left side of a character string region. In this case, the configuration may be such that the entirety of the image information of the document is used to mask the image regions other than the regions in the vicinity of the left sides of the character string regions and the characters that have been detected. A vicinity image may be an image of a region in the vicinity of the right side of a character string region. In this case, the configuration may be such that the entirety of the image information of the document is used to mask the image regions other than the regions in the vicinity of the right sides of the character string regions and the characters that have been detected.
[0087] Also, the vicinity image generation unit 104 may generate vicinity images each including at least one of a region in the vicinity of the upper side of a character string region, a region in the vicinity of the lower side of the character string region, a region in the vicinity of the left side of the character string region, or a region in the vicinity of the right side of the character string region, and the character string region. In a case where the vicinity image includes the character string region, the information creation unit 105 masks the target character string included in the character string region. This prevents the target character string from being detected as undetected characters. Also, the configuration may be such that, in the image information of a document, information indicating the pixels of a particular region is demarcated by a region of interest (ROI) to avoid explicitly generating a vicinity image. In this case, the vicinity image generation unit 104 can be omitted.
[0088] In the embodiment, the character string processing unit 22 determines whether a character string is written horizontally or vertically based on the positional relationship between the characters in the character string, but the determination method is not limited to this. For example, the character string processing unit 22 may determine whether a character string is written horizontally or vertically based on the aspect ratio of the character string. Alternatively, whether to process character strings as horizontally written character strings or vertically written character strings may be set in advance as an initial setting. In this way, the character string processing unit 22 can omit the function to determine whether a character string is written horizontally or vertically.
[0089] In the embodiment, the information creation unit 105 fills a character or characters included in a vicinity image that have been detected with the background color to create image information of an undetected region (mask image), but the method of masking the character or characters that have been detected (detected character or characters) is not limited to this. The method of masking the character or characters that have been detected (detected character or characters) may only need to be a method that enables the detection score calculation model 107 to distinguish the detected character or characters. For example, the information creation unit 105 may fill a detected character or characters in a vicinity region by inpainting. The information creation unit 105 may recognize a region with a detected character or characters in a vicinity region by semantic segmentation, and fill the recognized region with the detected character or characters with the background color. Also, the configuration may be such that, as image information of an undetected region, the positional information (coordinate information) of the detected character or characters in the vicinity region is input into the detection score calculation model 107. In this case, the detection score calculation model 107 can distinguish the detected character or characters and the undetected character or characters in the vicinity region based on the input positional information of the detected character or characters, and therefore accurately calculate the detection score.
[0090] Also, the configuration may be such that a character or characters included in a vicinity image that have been detected (detected character or characters) are not masked. The configuration can be implemented by further training the detection score calculation model 107 to set a detection score high in a case where one or both vicinity regions include a detected character or characters and include no undetected character. The configuration can be implemented by further training the detection score calculation model 107 to set a detection score low in a case where one or both vicinity regions include a detected character or characters and include an undetected character or characters. In this way, it is possible to omit the process of masking characters included in vicinity images that have been detected.
[0091] Also, the information creation unit 105 may create 4-channel image information of an undetected region by creating information indicating the masked region in the vicinity region as mask information and set the created mask information as a fourth channel. The information creation unit 105 creates the mask information such that the tone value of the masked region in the vicinity region is 0 and the tone values of the other regions than the masked region in the vicinity region are 255. In this case, the image information of the undetected region is 4-channel image information including three channels corresponding to the three colors (RGB) in the vicinity image and a channel representing the masked region in the vicinity region. In a case where the scanned image is a 4-channel CMYK color image, image information of an undetected region may include four channels corresponding to the four colors (CMKY) in the vicinity image and a channel representing the masked region in the vicinity region. As described above, image information of an undetected region may include a plurality of channels corresponding to a plurality of colors in the vicinity image and a channel representing the masked region in the vicinity region. Also, in a case where a multi-head model into which two types of information can be input is used as the detection score calculation model 107, information on each vicinity image may be input into one head, and image information of each undetected region (mask image) may be input into another or the other head.
[0092] Also, the information creation unit 105 may fill (mask) a character or characters included in a vicinity region that have been detected and a ruled line included in the vicinity region with the background color to create image information of an undetected region. Note that positional information of the ruled line included in the vicinity region is obtained by a ruled line recognition unit not illustrated. In this way, the detection score calculation model 107 can avoid falsely recognizing a ruled line as a character string with "1" and "L", for example, and consequently lowering the detection score, and thus accurately calculate the detection score.
[0093] In the embodiment, in a case where a detection score is lower than a predetermined score (e.g., lower than 0.7), the image obtaining unit 21 may re-obtain a scanned image by scanning the document. Also, in the case where a detection score is lower than the predetermined score, the character string processing unit 22 may re-obtain the positional information of the character string region in the scanned image with a changed parameter or parameters. Image processing parameters related to the brightness of the image, the contrast of the image, smoothing of the image, and the like may be changed, or a parameter such as the gain for scanning may be changed. In response to the image obtaining unit 21 re-obtaining a scanned image and the character string processing unit 22 re-obtaining the positional information of the character string region with a changed parameter or parameters, the information processing apparatus 100 (detection score calculation unit 106) re-calculates a detection score and selects the higher detection score. In this way, it is possible to accurately detect undetected characters included in vicinity images.
[0094] In the embodiment, in a case where each detection score is a predetermined score or higher (e.g., 0.7 or higher), the output unit 108 may output (send) the data of the scanned image to the display unit 56 without outputting the detection scores. In this case, the display unit 56 may, for example, skip displaying the UI screen 530 in FIG. 7 (or the UI screen 600 in FIG. 9) and display the UI screen 540 in FIG. 8. In this way, in the case where each detection score is the predetermined score or higher, the user can omit the task of checking false detection of character string regions. This reduces the cumbersomeness of the task of checking false detection of character string regions. In a case where a detection score is lower than the predetermined score, the output unit 108 may perform output for displaying the UI screen 530 in FIG. 7 (or the UI screen 600 in FIG. 9) on the display unit 56. For example, the output unit 108 may output image information of the undetected region in a case where the vicinity region includes a detected character or characters, and output image information of the vicinity region in a case where the vicinity region includes no detected character. As described above, the output unit 108 may perform output for displaying at least one of a vicinity region or an undetected region on the display unit 56. Note that, in a case where a detection score calculated by the detection score calculation unit 106 is the predetermined score or higher, it means that the vicinity regions include no undetected character. In a case where a detection score calculated by the detection score calculation unit 106 is lower than the predetermined score, it means that one or both of the vicinity regions include an undetected character or characters.
[0095] In the embodiment, one character string included in a character string region is selected as a target character string, but target character strings are not limited to this. For example, two character strings arranged side by side in the vertical direction may be selected as one target character string. For example, a character string region is detected in which a plurality of character strings are arranged side by side at equal intervals and the line spacing is wider (e.g., twice wider) than in the other portions. In a case where the character strings recognized by an OCR process from the character string region in which the line spacing is wider than in the other portions are, for example, character strings that are not registered in a dictionary, two character strings in that character string region are selected as a single target character string.Second Embodiment
[0096] Next, a second embodiment will be described. Each individual member in the second embodiment has a similar configuration to that in the above first embodiment. Thus, the description will be given with these members denoted by the same reference signs as those in the above first embodiment.
[0097] In the first embodiment, the detection score calculation unit 106 uses the detection score calculation model 107 to calculate detection scores. In the second embodiment, a method of training the detection score calculation model 107 will be described. Specifically, portions of target character strings are handled as undetected characters to modify the positional information of the character string regions such that the undetected characters are included in vicinity regions. Then, the detection score calculation model 107 is trained using the positional information of the character string regions subjected to the modification. Note that the positional information of a character string region for a target character string subjected to the modification may be referred to as "modified positional information”.Functional Configuration of Information Processing Apparatus
[0098] FIG. 10 is a block diagram illustrating a functional configuration of an information processing apparatus 100 according to the second embodiment. Description of portions in the second embodiment common to those in the first embodiment will be omitted as appropriate. The information processing apparatus 100 according to the second embodiment includes: a positional information input unit 101, an image information input unit 102, a position obtaining unit 103, a vicinity image generation unit 104, an information creation unit 105, a detection score calculation unit 106, and a detection score calculation model 107. The information processing apparatus 100 according to the second embodiment also includes an information modification unit 201 and a detection score calculation model training unit 202.
[0099] The information modification unit 201 creates modified positional information based on the positional information of character string regions (for target character strings) obtained by the position obtaining unit 103. The modified positional information is the positional information of character string regions modified such that portions of the target character strings are included in vicinity regions as undetected characters outside the character string regions. The information modification unit 201 outputs the created modified positional information to the information creation unit 105.
[0100] Into the detection score calculation model training unit 202, image information of undetected regions and flags for training the detection score calculation model 107 are input. Each flag indicates whether one or both vicinity regions by a character string region for a target character string include an undetected character or characters. In the embodiment, the flag is set to 1 in a case where one or both vicinity regions include an undetected character or characters, and set to 0 in a case where the vicinity regions include no undetected. An operator who causes the detection score calculation model training unit 202 to train the detection score calculation model 107 inputs each flag into the detection score calculation model training unit 202 from an input unit not illustrated. Here, the operator generates each flag by inputting information indicating whether one or both vicinity regions by the character string region (for the target character string) selected by the position obtaining unit 103 include an undetected character or characters. In the embodiment, each flag is input into the detection score calculation model training unit 202 in the form of a dataset attached to the positional information of the target character string. For example, each flag is attached as a fifth element of a dataset following the coordinate values of the pixels at the four vertices of the rectangle surrounding the target character string. In a case where the information modification unit 201 modifies the positional information of a character string region (for a target character string), a flag indicating that one or both vicinity regions include an undetected character or characters is attached to the modified positional information. The detection score calculation model training unit 202 trains (updates) the detection score calculation model 107 such that a score based on such a flag and a detection score to be calculated by the detection score calculation unit 106 will match. A method of training the detection score calculation model 107 will be described later.Processing Operation of Information Processing Apparatus
[0101] Next, an information processing method using the information processing apparatus 100 according to the second embodiment will be described. FIG. 11 is a flowchart illustrating a flow of processing by the information processing apparatus 100 according to the second embodiment. The processing illustrated in the flowchart of FIG. 11 is automatically started in response to starting the information processing apparatus 100 by powering on the information processing apparatus 100.
[0102] In step S201, as in the first embodiment, the information processing apparatus 100 performs a system initialization process. After the initialization process is completed, the processing proceeds to step S202.
[0103] In step S202, as in the first embodiment, the positional information input unit 101 outputs the positional information of character string regions input from the character string processing unit 22 to the position obtaining unit 103 and the information creation unit 105. The positional information input unit 101 also outputs information on character strings corresponding to items extracted by the character string processing unit 22 to the position obtaining unit 103.
[0104] In step S203, as in the first embodiment, the image information input unit 102 outputs the scanned image input from the image obtaining unit 21 to the vicinity image generation unit 104.
[0105] In step S204, as in the first embodiment, the position obtaining unit 103 obtains the positional information of the character string regions for target character strings. The position obtaining unit 103 outputs the obtained positional information of the character string regions (for the target character strings) to the vicinity image generation unit 104 and the information modification unit 201.
[0106] In step S205, as in the first embodiment, the vicinity image generation unit 104 generates vicinity images. The vicinity image generation unit 104 outputs data of the generated vicinity images to the information creation unit 105.
[0107] In step S206, the information processing apparatus 100 determines whether to modify the positional information of the character string regions for the target character strings. If the positional information is not to be modified (if it is determined NO), the processing proceeds to step S207. On the other hand, if the positional information is to be modified (if it is determined YES), the processing proceeds to step S209. Incidentally, the positional information may be modified at a predetermined ratio. Also, the positional information may be modified in response to input of a flag as described above.
[0108] In step S207, as in the first embodiment, the information creation unit 105 creates mask images as image information of undetected regions. The information creation unit 105 outputs the created mask images as the image information of the undetected regions to the detection score calculation unit 106.
[0109] In step S208, as in the first embodiment, the detection score calculation unit 106 calculates detection scores. The output unit 108 outputs the detection scores calculated by the detection score calculation unit 106 to a display unit 56 of a touch panel display 13.
[0110] In step S209, the information modification unit 201 modifies the positional information of the character string regions (for the target character strings) input from the position obtaining unit 103 to create modified positional information. The information modification unit 201 selects the first or last character of each target character string, and modifies the positional information such that the selected character is included in a vicinity region as an undetected character outside the character string region. Specifically, the information modification unit 201 calculates the coordinate values of the pixels at the four vertices of a rectangle externally abutting the remaining characters in the target character string excluding the character selected (deleted). The position obtaining unit 103 obtains the calculated coordinate values of the pixels at the four vertices of the rectangle as modified positional information. The information modification unit 201 outputs the created modified positional information to the information creation unit 105. After the creation of the modified positional information is completed, the processing proceeds to step S210.
[0111] In step S210, the information creation unit 105 creates image information of undetected regions for training of the detection score calculation model 107. The information creation unit 105 creates the image information of the undetected regions for training based on the modified positional information input from the information modification unit 201, the positional information of the character string regions input from the positional information input unit 101, and the vicinity images input from the vicinity image generation unit 104. In a case where a vicinity region includes a character or characters that have been detected (detected character or characters), a mask image is created by filling (masking) the detected character or characters with the background color as image information of the undetected region including the undetected character deleted from the unmodified target character string. The information creation unit 105 outputs the created image information of the undetected regions for training (mask images) to the detection score calculation model training unit 202. After the creation of the image information of the undetected regions for training is completed, the processing proceeds to step S211.
[0112] In step S211, the detection score calculation model training unit 202 trains the detection score calculation model 107 using the image information of the undetected regions for training input from the information creation unit 105. The detection score calculation model training unit 202 trains (updates) the detection score calculation model 107 so as to reduce the difference between a score based on the flag described above and a detection score to be calculated using the detection score calculation model 107. Specifically, the detection score calculation model training unit 202 updates weights in the neural network using error back-propagation with the difference between the flag-based score and the detection score as a loss. In the embodiment, cross-entropy is used as the loss. Incidentally, L2 loss or binary cross-entropy may be used as the loss, and it suffices that a method which achieve high accuracy is used. After the training of the detection score calculation model 107 is completed, the processing proceeds to step S212.
[0113] In step S212, the information processing apparatus 100 determines whether to terminate the processing. If the processing is not to be terminated (if it is determined NO), the processing returns to step S202. On the other hand, if the processing is to be terminated (if it is determined YES), the processing is terminated.Advantageous Effects
[0114] As described above, according to the second embodiment, as in the first embodiment, it is possible to reduce the burden on the user in extraction of character strings from an image including characters by an OCR process. Moreover, in the second embodiment, the detection score calculation model training unit 202 trains (updates) the detection score calculation model 107, enabling the detection score calculation unit 106 to accurately calculate detection scores. This reduces the cumbersomeness of the task of finding falsely detected character string regions.
[0115] Furthermore, the information modification unit 201 increases undetected characters in vicinity images in a pseudo manner. In this way, the detection score calculation model 107 is efficiently trained (updated) even in a case where the number of undetected characters included in a vicinity region is small and in a case where particular characters in a target character string tend to be undetected characters.Modifications
[0116] In the embodiment, in a case where the positional information of character string regions for target character strings are modified at a predetermined ratio, the predetermined ratio may be set to such a ratio that the detection scores can be calculated most accurately. In this case, the detection score calculation model training unit 202 may be caused to train the detection score calculation model 107 with the ratio to be applied to the positional information modification switched between a plurality of ratios, and the ratio with which the detection scores can be calculated most accurately may be employed.
[0117] In the embodiment, the information modification unit 201 selects the first or last character of each target character string, and modifies the positional information such that the selected character is included in a vicinity region as an undetected character, but the embodiment is not limited to this. For example, the positional information modification may be omitted. In this case, the detection score calculation model training unit 202 may train (update) the detection score calculation model 107 using image information of undetected regions created by the information creation unit 105 in which real undetected characters are present.
[0118] In the embodiment, the information modification unit 201 selects the first or last character of each target character string, but the selection target is not limited to this. For example, the information modification unit 201 may select first or last two characters of each target character string or select two or more characters in each target character string. In this way, the detection score calculation model training unit 202 can easily recognize the presence of an undetected character in a vicinity region by a character string region for a target character string during the training of the detection score calculation model 107. Also, in a case where a particular character appears at the beginning or end of a target character string, the information modification unit 201 may select the particular character at the beginning or end of the target character string. In this way, the detection score calculation model training unit 202 can easily recognize that the particular character is present undetected in a vicinity region by a character string region for a target character string during the training of the detection score calculation model 107.
[0119] In the embodiment, the detection score calculation model training unit 202 trains the detection score calculation model 107 using image information of undetected regions for training created based on modified positional information, but the training is not limited to this. For example, image information of undetected regions may be created such that an undetected character or characters are added in the undetected regions in a pseudo manner. Specifically, a character or characters are rendered into a vicinity image, and the flag is changed to indicate that one or both vicinity regions include an undetected character or characters. The character or characters to be added to the undetected region may be selected at random. Alternatively, a character or characters that tend to be undetected may be selected as the character or characters to be added to the undetected region.
[0120] In the embodiment, flags each of which represents 1 or 0 are input into the detection score calculation model training unit 202, but the flags are not limited to this. For example, the flags may each be a scalar value ranging from 0 to 1 in order to learn the degree of detection failure. This scalar value is set to be closer to 1 the larger the size of the undetected character or characters becomes or the larger the number of undetected characters becomes.
[0121] In the embodiment, the detection score calculation model training unit 202 updates weights in the neural network using error backpropagation, but the method is not limited to this. For example, error diffusion, a genetic algorithm, or the like may be used instead of error backpropagation.Third Embodiment
[0122] Next, a third embodiment will be described. Each individual member in the third embodiment has a similar configuration to that in the above first embodiment. Thus, the description will be given with these members denoted by the same reference signs as those in the above first embodiment.
[0123] The information processing apparatus 100 in the first embodiment calculates detection scores. An information processing apparatus 100 in a third embodiment calculates recognition scores and item scores in addition to detection scores. Each recognition score is a score indicating whether a recognized character string obtained by the character string recognition unit 31 is correct. In other words, each recognition score is a score indicating the possibility of false character recognition having occurred in a character string recognized from a character string region (target character string). Each recognition score is referred to also as "character recognition score." Each item score is a score indicating whether an item extracted by item extraction for a target character string is correct. In other words, each item score is a score indicating whether an item extracted by item extraction is correct as the item corresponding to a target character string, that is, the possibility of false item extraction having occurred in the target character string. Each item score is referred to also as "target character string selection score." In the third embodiment, the information processing apparatus 100 calculates a certainty factor score using these three types of scores. Then, based on the calculated certainty factor score, whether a check on the target character string by the user is required is determined. The certainty factor score is a score indicating whether the target character string is correct.
[0124] As described earlier, in an OCR process, character string regions in the scanned image may be falsely detected. It is necessary to take some measures against the false detection of character string regions as it can result in false character string recognition and false item extraction. According to the first embodiment, the user can easily find target character strings whose character string region may have been falsely detected. Nonetheless, the task of finding false character recognition and false item extraction on target character strings is still cumbersome.Functional Configuration of Information Processing Apparatus
[0125] FIG. 12 is a block diagram illustrating a functional configuration of the information processing apparatus 100 according to the third embodiment. Description of portions in the third embodiment common to those in the first embodiment will be omitted as appropriate. The information processing apparatus 100 according to the third embodiment includes a positional information input unit 101, an image information input unit 102, a position obtaining unit 103, a vicinity image generation unit 104, an information creation unit 105, a detection score calculation unit 106, a detection score calculation model 107, and an output unit 108. The information processing apparatus 100 according to the third embodiment also includes a character string information input unit 301, a character image generation unit 302, a recognition score calculation unit 303, a recognition score calculation model 304, an item score calculation unit 305, and a certainty factor score calculation unit 306.
[0126] Also, the information processing apparatus 100 is electrically connected to a character string recognition unit 31. The character string recognition unit 31 outputs data of recognized character strings each associated with the positional information of a character string region to the information processing apparatus 100. Incidentally, the character string recognition unit 31 may be included in the information processing apparatus 100.
[0127] The information processing apparatus 100 calculates certainty factor scores using a scanned image input from an image obtaining unit 21, the positional information of character string regions input from a character string processing unit 22, and data of recognized character strings input from the character string recognition unit 31. The information processing apparatus 100 outputs information on the calculated certainty factor scores to a display unit 56 of a touch panel display 13. The display unit 56 presents a display based on the certainty factor scores calculated by the information processing apparatus 100.
[0128] The character string information input unit 301 outputs the data of the recognized character strings input from the character string recognition unit 31 to the recognition score calculation unit 303 and the item score calculation unit 305. As the data of each recognized character string associated with the positional information of a character string region, the coordinates of each character included in the character string region and the character code of the character, for example, are held together.
[0129] The character image generation unit 302 generates images of target character strings based on the positional information of the character string regions (for the target character strings) input from the position obtaining unit 103 and the scanned image input from the image information input unit 102. The character image generation unit 302 outputs the generated image data of the target character strings to the recognition score calculation unit 303. Incidentally, the vicinity image generation unit 104 and the character image generation unit 302 may be combined into a single image generation unit that generates vicinity images and images of target character strings.
[0130] Using the recognition score calculation model 304, the recognition score calculation unit 303 calculates recognition scores based on the images of the target character strings input from the character image generation unit 302 and the data of the recognized character strings input from the character string information input unit 301. The recognition score calculation unit 303 outputs the calculated recognition scores to the certainty factor score calculation unit 306. Incidentally, the recognition score calculation model 304 may be provided to be separate from the information processing apparatus 100. The recognition score calculation model 304 will be described later.
[0131] The item score calculation unit 305 calculates item scores based on the positional information of the character string regions (for the target character strings) input from the position obtaining unit 103 and the data of the recognized character strings input from the character string information input unit 301. The item score calculation unit 305 outputs the calculated item scores to the certainty factor score calculation unit 306. A method of calculating the item scores will be described later.
[0132] The certainty factor score calculation unit 306 calculates certainty factor scores based on the detection scores calculated by the detection score calculation unit 106, the recognition scores calculated by the recognition score calculation unit 303, and the item scores calculated by the item score calculation unit 305. In one embodiment, each certainty factor score is a binary score that takes 1 in a case where no check on the target character string by the user is required, and takes 0 in a case where a check on the target character string by the user is required. In other words, each certainty factor score is a binary score that takes 1 in a case where the target character string is correct, and takes 0 in a case where the target character string is incorrect. The certainty factor score calculation unit 306 outputs the calculated certainty factor scores to the output unit 108.
[0133] In the third embodiment, the output unit 108 outputs the certainty factor scores input from the certainty factor score calculation unit 306 to the display unit 56 of the touch panel display 13. The display unit 56 presents a display corresponding to the certainty factor scores input from the output unit 108. Incidentally, the certainty factor score calculation unit 306 may output the detection scores, the recognition scores, and the item scores to the display unit 56 via the output unit 108 as information on the calculated certainty factor scores.Processing Operation of Information Processing Apparatus
[0134] Next, an information processing method using the information processing apparatus 100 according to the third embodiment will be described. FIG. 13 is a flowchart illustrating a flow of processing by the information processing apparatus 100 according to the third embodiment. The processing illustrated in the flowchart of FIG. 13 is automatically started in response to starting the information processing apparatus 100 by powering on the information processing apparatus 100.
[0135] In step S301, as in the first embodiment, the information processing apparatus 100 performs a system initialization process. After the initialization process is completed, the processing proceeds to step S302.
[0136] In step S302, as in the first embodiment, the positional information input unit 101 outputs the positional information of character string regions input from the character string processing unit 22 to the position obtaining unit 103 and the information creation unit 105. The positional information input unit 101 also outputs information on character strings corresponding to items extracted by the character string processing unit 22 to the position obtaining unit 103.
[0137] In step S303, as in the first embodiment, the image information input unit 102 outputs the scanned image input from the image obtaining unit 21 to the vicinity image generation unit 104. The image information input unit 102 also outputs the scanned image input from the image obtaining unit 21 to the character image generation unit 302.
[0138] In step S304, as in the first embodiment, the position obtaining unit 103 obtains the positional information of the character string regions for target character strings. The position obtaining unit 103 outputs the obtained positional information of the character string regions (for the target character strings) to the vicinity image generation unit 104 and the item score calculation unit 305.
[0139] In step S305, as in the first embodiment, the vicinity image generation unit 104 generates vicinity images. The vicinity image generation unit 104 outputs data of the generated vicinity images to the information creation unit 105.
[0140] In step S306, as in the first embodiment, the information creation unit 105 creates mask images as image information of undetected regions. The information creation unit 105 outputs the created mask images as the image information of the undetected regions to the detection score calculation unit 106.
[0141] In step S307, as in the first embodiment, the detection score calculation unit 106 calculates detection scores. The detection score calculation unit 106 outputs the calculated detection scores to the certainty factor score calculation unit 306.
[0142] In step S308, the character string information input unit 301 outputs data of the recognized character strings input from the character string recognition unit 31 to the recognition score calculation unit 303 and the item score calculation unit 305. In the embodiment, the data of the recognized character strings is the Unicode Transformation Format 8-bit (UTF-8) code of each character. Note that the data of the recognized character strings is not limited to UTF-8 codes, and may be American Standard Code for Information Interchange (ASCII) codes, and may only need to be character codes with which characters can be identified. Each piece of data of each recognized character string is held in association with an element representing the same character in the positional information of the character string region. Specifically, the data of each recognized character string is held by, for each character included in the positional information of the character string region, adding a character code as a fifth element to the coordinate values of the four vertices of a rectangle surrounding the character. Note that the method of holding the data of each recognized character string only needs to be a holding method by which, for each character included in the positional information of the character string region, a character code is held in association with the rectangle surrounding the character.
[0143] In step S309, the character image generation unit 302 generates images of the target character strings. The character image generation unit 302 outputs the generated image data of the target character strings to the recognition score calculation unit 303.
[0144] In step S310, the recognition score calculation unit 303 calculates recognition scores. The recognition score calculation unit 303 outputs the calculated recognition scores to the certainty factor score calculation unit 306.
[0145] In the embodiment, the recognition score calculation model 304 is configured using a late-fusion model. In the Late-Fusion model, a compact DistilBERT for language understanding and a DeiT for image understanding are used, and the feature amounts of the first token in the final Transformer layer in each of them are combined into a one-dimensional vector. In a case where the number of layers in the Transformer is 12, for example, the final Transformer layer is the 12th layer. Note that description of the model structures of the DistilBERT and the DeiT and their training methods is omitted since the method by Hugo et al. mentioned earlier and the method by Victor et al. describe them in detail. The following is the title of the document describing the method by Victor et al.
[0146] "Victor et al., DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter, Arxiv2020."
[0147] Moreover, the recognition score calculation model 304 has been trained to calculate a recognition score in response to input of the data of a recognized character string into the DistilBERT and input of the image data of a target character string into the DeiT. The recognition score is calculated to be low in a case where false character recognition has occurred in the target character string, and calculated to be high in a case where no false character recognition has occurred in the target character string.
[0148] In step S311, the item score calculation unit 305 calculates item scores. The item score calculation unit 305 outputs the calculated item scores to the certainty factor score calculation unit 306.
[0149] In the embodiment, out-of-distribution (OOD) is used to calculate the item scores. With OOD, the distance between the distribution of internal feature amounts of an item extraction BERT model obtained during inference on training data used to train the BERT, and the internal feature amounts calculated by the BERT model during actual item extraction is used as an item score. Also, the item score is calculated on the assumption that false item extraction may occur with unknown data during inference. The item score is calculated to be high in a case where the internal feature amounts are close to the training data, and calculated to be low in a case where the internal feature amounts are not close to the training data. Note that description of the OOD is omitted since the method by Shiyu et al. describes it in detail. The following is the title of the document describing the method by Shiyu et al.
[0150] "Shiyu, et al., ENHANCING THE RELIABILITY OF OUT-OF-DISTRIBUTION IMAGE DETECTION IN NEURAL NETWORKS, ICLR2018."
[0151] In step S312, the certainty factor score calculation unit 306 calculates certainty factor scores based on the detection scores, the recognition scores, and the item scores. The certainty factor score calculation unit 306 outputs the calculated certainty factor scores to the output unit 108. The output unit 108 outputs the certainty factor scores input from the certainty factor score calculation unit 306 to the display unit 56 of the touch panel display 13. In the embodiment, each certainty factor score may be the lowest of the detection score, the recognition score, and the item score. In one embodiment, if all of the detection score, the recognition score, and the item score are a predetermined score or higher (e.g., 0.7 or higher), it is determined that the certainty factor score is high and no check on the target character string by the user is required. If at least one of the detection score, the recognition score, or the item score is lower than the predetermined score, it is determined that the certainty factor score is low and a check on the target character string by the user is required. After the calculation of the certainty factor scores is completed, the processing proceeds to step S313.
[0152] In step S313, the information processing apparatus 100 determines whether to terminate the processing. If the processing is not to be terminated (if it is determined NO), the processing returns to step S302. On the other hand, if the processing is to be terminated (if it is determined YES), the processing is terminated.
[0153] The display unit 56 of the touch panel display 13 presents a display corresponding to the certainty factor scores input from the output unit 108. As in the first embodiment, the output unit 108 can display the UI screen 530 in FIG. 7 and the UI screen 540 in FIG. 8. In the middle part of the UI screen 530 in FIG. 7, the extracted character string "Family Comp" 533 is underlined indicating that the character string is likely to be incorrect because the certainty factor score calculated for the item "sender company name" is lower than the predetermined score. In the lower part of the UI screen 530 in FIG. 7, the balloon 538 with an exclamation mark is displayed in the peripheral image 535 as an annotation indicating that the extracted character string is likely to be incorrect. The user can easily find the false character recognition and the false item extraction in addition to the false detection of the character string region based on the display of this balloon 538.Another Example of UI Screen
[0154] Next, another example of a UI screen will be described. FIG. 14 is a diagram illustrating an example of a UI screen 600 indicating the result of item extraction in the third embodiment. As with the UI screen 600 in FIG. 9 in the first embodiment, on the left side of the UI screen 600 in FIG. 14, an invoice image 510 is displayed. As with the UI screen 600 in FIG. 9, on the right side of the UI screen 600 in FIG. 14, a character string region 621 corresponding to a target character string and vicinity regions 622 are displayed for each item extracted from the invoice image 510. In the third embodiment, under the character string region 621 for each item, there are displayed a recognized character string 623 corresponding to the target character string and an item type 624 of the target character string. Moreover, under the character string region 621 for each item, there are displayed a recognition score 625 of the target character string, a detection score 626 of the target character string, and an item score 627 of the target character string.
[0155] As in the first embodiment, for an item "title" 611, the recognized character string 623 is "INVOICE." As the item type 624, a character string "Title" representing the item "title" is displayed. Also, the recognition score 625 is 0.9, the detection score 626 is 0.9, and the item score 627 is 0.9. In one embodiment, the item "title" 611 is an item with a recognition score 625, a detection score 626, and an item score 627 higher than a predetermined score (e.g., 0.7), thus requiring no check on the target character string by the user.
[0156] As in the first embodiment, for an item "destination company name" 612, the recognized character string 623 is "Factory Inc" without a period. As the item type 624, a character string "Org To" representing the item "destination company name" is displayed. Also, the recognition score 625 is 0.9, the detection score 626 is 0.3, and the item score 627 is 0.9. For the item "destination company name" 612, "." in the character string "Factory Inc." is included as an undetected character in the vicinity region 622 to the right of the character string region 621. As described earlier, the character string "To:" in the invoice image 510 is masked in the vicinity region 622 to the left of the character string region 621 as detected characters. In one embodiment, the item "destination company name" 612 is an item with a detection score 626 lower than the predetermined score, thus requiring a check on the target character string by the user. To indicate that the target character string needs to be checked, a balloon 638 with an exclamation mark is displayed for the item "destination company name" 612.
[0157] As in the first embodiment, for an item "destination company person-in-charge name" 613, the recognized character string 623 is "Edmond Grey." As the item type 624, a character string "Person To" representing the item "destination company person-in-charge name" is displayed. Also, the recognition score 625 is 0.9, the detection score 626 is 0.9, and the item score 627 is 0.9. As described earlier, the character string "Dear:" in the invoice image 510 is masked in the vicinity region 622 to the left of the character string region 621 as characters that have been detected. The item "destination company person-in-charge name" 613 is an item with a recognition score 625, a detection score 626, and an item score 627 higher than the predetermined score, thus requiring no check on the target character string by the user.
[0158] As in the first embodiment, for an item "date" 614, the recognized character string 623 is "June, 14, 2024." As the item type 624, a character string "Date" representing the item "date" is displayed. Also, the recognition score 625 is 0.9, the detection score 626 is 0.9, and the item score 627 is 0.9. The item "date" 614 is an item with a recognition score 625, a detection score 626, and an item score 627 higher than the predetermined score, thus requiring no check on the target character string by the user.
[0159] As with first embodiment, for an item "amount" 615, the recognized character string 623 is "354,000 0." As the item type 624, a character string "Amount" representing the item "amount" is displayed. Also, the recognition score 625 is 0.4, the detection score 626 is 0.9, and the item score 627 is 0.9. As described earlier, "SD" in the character string "USD" in the invoice image 510 is masked in the vicinity region 622 to the right of the character string region 621 as characters that have been detected. For the item "amount" 615, "U" in the character string "USD" has been falsely detected as the rightmost "0" in "354,000 0," which is the recognized character string 623. The item "amount" 615 is an item with a recognition score 625 lower than the predetermined score, thus requiring a check on the target character string by the user. To indicate that the target character string needs to be checked, a balloon 638 with an exclamation mark is displayed for the item "amount" 615.
[0160] As in the first embodiment, for an item "sender company name" 616, the recognized character string 623 is "Family Comp." As the item type 624, a character string "Org To" representing the item "destination company name" is displayed, not a character string representing the item "sender company name." Also, the recognition score 625 is 0.9, the detection score 626 is 0.3, and the item score 627 is 0.5. For the item "sender company name" 616, "any" in the character string "Family Company" is included as undetected characters in the vicinity region 622 to the right of the character string region 621. The item "sender company name" 616 is an item with a detection score 626 and an item score 627 lower than the predetermined score, thus requiring a check on the target character string by the user. To indicate that the target character string needs to be checked, a balloon 638 with an exclamation mark is displayed for the item "sender company name" 616.
[0161] As in the first embodiment, for an item "person-in-charge signature" 617, the recognized character string 623 is "VVews." As the item type 624, a character string "Org From" representing the item "sender company name" is displayed, not a character string representing the item "person-in-charge signature." Also, the recognition score 625 is 0.2, the detection score 626 is 0.1, and the item score 627 is 0.5. For the item "person-in-charge signature" 617, "King" in the character string "King Wrenn" is included as undetected characters in the vicinity region 622 to the left of the character string region 621. Moreover, in one embodiment, the recognized character string 623 has been falsely detected as "VVews." The item "person-in-charge signature" 617 is an item with a detection score 626 lower than the predetermined score, thus requiring a check on the target character string by the user. To indicate that the target character string needs to be checked, a balloon 638 with an exclamation mark is displayed for the item "person-in-charge signature" 617.
[0162] The user can easily find target character strings whose character string region, character or characters, and / or item may have been falsely detected, falsely recognized, and / or falsely extracted by checking target character strings for items with low certainty factor scores. Also, the user can correct the character strings for the false detection of the character string regions, the false recognition of the character or characters, and / or the like by selecting items using the touch panel display 13. This saves time and effort to perform the task of correcting the character strings.
[0163] Note that the certainty factor score calculation unit 306 outputs the recognition scores, the detection scores, and the item scores as information on the certainty factor scores via the output unit 108. In a case where a certainty factor score is lower than the predetermined score, the certainty factor score calculation unit 306 may output information indicating that the target character string may be incorrect via the output unit 108.
[0164] Also, the certainty factor score calculation unit 306 may calculate each certainty factor score based on two scores instead of the three scores (recognition score, detection score, and item score). For example, the information processing apparatus 100 does not need to be provided with the item score calculation unit 305. In this case, the certainty factor score calculation unit 306 calculates each certainty factor score based on the detection score and the recognition score. Also, the information processing apparatus 100 does not need to be provided with the recognition score calculation unit 303 or the recognition score calculation model 304. In this case, the certainty factor score calculation unit 306 calculates each certainty factor score based on the detection score and the item score.
[0165] Also, on the UI screen 600 in FIG. 14, a certainty factor score may be displayed for each item, such as the item "title" 611. In a case where the certainty factor score is a predetermined score or higher, information indicating that the target character string is correct (e.g., an OK mark, a check mark, or the like) may be displayed for the item, such as the item "title" 611.Advantageous Effects
[0166] As described above, according to the third embodiment, the output unit 108 outputs certainty factor scores as information on false detection of character string regions based on detection scores, recognition scores, and item scores. In this way, the user can easily find target character strings that may be incorrect based on the display of a UI screen corresponding to the certainty factor scores. This reduces the cumbersomeness of the task of finding falsely recognized characters and falsely extracted items in addition to falsely detected character string regions. Accordingly, as with the first embodiment, it is possible to reduce the burden on the user in extraction of character strings from an image including characters by an OCR process.Modifications
[0167] In the embodiment, the recognition score calculation model 304 is configured using a late-fusion model, but is not limited to this. The recognition score calculation unit 303 only needs to be capable of calculating a score with which the occurrence of false character recognition can be determined. For example, the recognition score calculation unit 303 may be configured to select the smaller of a recognition score calculated using the image data of the target character string and a recognition score calculated using the data of the recognized character string. The recognition score calculation unit 303 may calculate a recognition score using either one of the image data of the target character string or the data of the recognized character string. Also, the recognition score calculation model 304 may be configured using a CNN or configured using a Transformer. The recognition score calculation model 304 is not limited to a neural network, and may be a word database and configured to set the score of a character string high in a case where it is included in the database.
[0168] In the embodiment, the item score calculation unit 305 calculates each item score using OOD, but is not limited to this. The item score calculation unit 305 may only need to be capable of calculating a score with which whether the item of the target character string has been falsely extracted can be determined. For example, the item score calculation unit 305 may utilize a database in which a list of items (character strings) to be extracted by item extraction is recorded in advance. In this case, the item score of a target character string will be high if it is included in the list, and will be low if it is not included in the list. Also, in a case where a log of items (character strings) extracted by item extraction is held, the item score calculation unit 305 may utilize the log. In this case, the item score of a target character string will be high if it is included in the log, and will be low if it is not included in the log.
[0169] In the embodiment, each certainty factor score calculated by the certainty factor score calculation unit 306 is the lowest of the detection score, the recognition score, and the item score, but is not limited to this. For example, each certainty factor score may be an average value of the detection score, the recognition score, and the item score.
[0170] Also, each certainty factor score calculated by the certainty factor score calculation unit 306 may only need to be a score with which whether the target character string is correct can be determined. For example, each certainty factor score may be calculated as a value from 0 to 1 with the average value of the detection score, the recognition score, and the item score as a median value. Each certainty factor score may be calculated as a value from 0 to 1 with the lowest of the detection score, the recognition score, and the item score as a reference value. Each score certainty factor score may be calculated to be 1 in a case where an estimated value calculated as a value from 0 to 1 is a predetermined value or higher, and calculated to be 0 in a case where the estimated value is lower than the predetermined value. Incidentally, the magnitude relationship between the certainty factor scores may be reversed, and the calculation result of each certainty factor score may only need to indicate whether the target character string is correct. For example, based on an estimated value calculated as a value from 0 to 1, each certainty factor score may be calculated to be 1 in a case where the target character string is incorrect, and calculated to be 0 in a case where the target character string is correct. In other words, in one embodiment, each certainty factor score may be calculated to be 1 in a case where a check on the target character string by the user is required, and calculated to be 0 in a case where no check on the target character string by the user is required.
[0171] Also, the certainty factor score calculation unit 306 may calculate each certainty factor score by combining the detection score, the recognition score, and the item score into a single score by logistic regression. In this case, using a predetermined threshold value, the certainty factor score may be calculated to be 0 in a case where the target character string is incorrect, and calculated to be 1 in a case where the target character string is correct. The certainty factor score calculation unit 306 may calculate each certainty factor score by summing the detection score, the recognition score, and the item score. In this case, using a predetermined threshold value, the certainty factor score may be calculated to be 0 in a case where the target character string is incorrect, and calculated to be 1 in a case where the target character string is correct.
[0172] In the embodiment, the certainty factor score calculation unit 306 calculates each certainty factor score based on the detection score, the recognition score, and the item score, but is not limited to this. The certainty factor score calculation unit 306 may stop calculating the certainty factor score when any one of the detection score, the recognition score, and the item score input sequentially is determined to be lower than a predetermined score, and output information indicating that the target character string needs to be checked to the output unit 108. This reduces the time required to determine whether a check on the target character string by the user is required.
[0173] In the embodiment, in a case where each certainty factor score is a predetermined score or higher (e.g., 0.7 or higher), the output unit 108 may output (send) the data of the scanned image to the display unit 56 without outputting the certainty factor scores. In this case, the display unit 56 may, for example, skip displaying the UI screen 530 in FIG. 7 (or the UI screen 600 in FIG. 14) and display the UI screen 540 in FIG. 8. In this way, in the case where each certainty factor score is the predetermined score or higher, the user can omit the task of checking target character strings. This reduces the cumbersomeness of the task of checking target character strings. In a case where a certainty factor score is lower than the predetermined score, the output unit 108 may perform output for displaying the UI screen 530 in FIG. 7 (or the UI screen 600 in FIG. 14) on the display unit 56. For example, the output unit 108 may output image information of the undetected region in a case where the vicinity region includes a detected character or characters, and output image information of the vicinity region in a case where the vicinity region includes no detected character. As described above, the output unit 108 may perform output for displaying at least one of a vicinity region or an undetected region on the display unit 56.
[0174] Note that the information processing apparatus 100 according to the third embodiment may include the information modification unit 201 and the detection score calculation model training unit 202 in the second embodiment. As in the second embodiment, the detection score calculation model training unit 202 trains (updates) the detection score calculation model 107 to thereby enable the detection score calculation unit 106 to accurately calculate detection scores.
[0175] Also, the information processing apparatus 100 according to the third embodiment may include a blank score calculation unit that calculates blank scores. Each blank score is a score indicating whether a space or spaces (black character or characters) are falsely recognized. The blank score calculation unit may input the calculated blank scores into the certainty factor score calculation unit 306. In this case, the certainty factor score calculation unit 306 may calculate certainty factor scores based on the detection scores, the recognition scores, the item scores, and the blank scores. Note that each blank score is calculated based on the character-to-character distance in the target character string. For example, each blank score is calculated to be 1 in a case where the character-to-character distance in the target character string is statistically within a normal range, and is calculated to be 0 in a case where the character-to-character distance in the target character string is outside the normal range.
[0176] Also, the information processing apparatus 100 according to the third embodiment may include a match score calculation unit that calculates match scores. Each match score is a score indicating whether the results of two OCR processes on image information match. The match score calculation unit may input the calculated match scores into the certainty factor score calculation unit 306. In this case, the certainty factor score calculation unit 306 may calculate certainty factor scores based on the detection scores, the recognition scores, the item scores, and the match scores. For example, each match score is calculated to be 1 in a case where the results of the two OCR processes match, and is calculated to be 0 in a case where the results of the two OCR processes differ.
[0177] Also, the information processing apparatus 100 according to the third embodiment may include a determination score calculation unit that calculates determination scores. Each determination score is a score indicating whether a comma or a period is correctly recognized. The determination score calculation unit may input the calculated determination scores into the certainty factor score calculation unit 306. In this case, the certainty factor score calculation unit 306 may calculate certainty factor scores based on the detection scores, the recognition scores, the item scores, and the determination scores. Note that each determination score is calculated based on the difference between the profile of a comma and the profile of a period. For example, each determination score is calculated to be 1 in a case where the profile of a character recognized as a period is circular, and calculated to be 0 in a case where the profile of the character recognized as a period is elongated. In the case where the profile of a character recognized as a period is circular, it is determined that the character (period) has been correctly recognized. In the case where the profile of a character recognized as a period is elongated, it is determined that a character which is actually a comma has been falsely recognized (to be a period). Also, each determination score is calculated to be 1 in a case where the profile of a character recognized as a comma is elongated, and calculated to be 0 in a case where the profile of the character recognized as a comma is circular. In the case where the profile of a character recognized as a comma is elongated, it is determined that the character (comma) has been correctly recognized. In the case where the profile of a character recognized as a comma is circular, it is determined that a character which is actually a period has been falsely recognized (to be a comma).
[0178] Also, the information processing apparatus 100 according to the third embodiment may include a line segment score calculation unit that calculates line segment scores. Each line segment score is a score indicating whether an underscore has failed to be recognized. The line segment score calculation unit may input the calculated line segment scores into the certainty factor score calculation unit 306. In this case, the certainty factor score calculation unit 306 may calculate certainty factor scores based on the detection scores, the recognition scores, the item scores, and the line segment scores. For example, each line segment score is calculated to be 1 in a case where no line segment (underscore) is present at a region in the vicinity of the lower side of the target character string, and calculated to be 0 in a case where a line segment is present at the region in the vicinity of the lower side of the target character string. In the case where a line segment is present at the region in the vicinity of the lower side of a target character string, it is determined that the underscore has failed to be recognized.
[0179] Also, the information processing apparatus 100 according to the third embodiment may include a similarity score calculation unit that calculates similarity scores. Each similarity score is a score indicating whether a plurality of characters recognized as the same character are falsely recognized. The similarity score calculation unit may input the calculated similarity scores into the certainty factor score calculation unit 306. In this case, the certainty factor score calculation unit 306 may calculate certainty factor scores based on the detection scores, the recognition scores, the item scores, and the similarity scores. Note that each similarity score is calculated based on the result of a comparison between the plurality of characters recognized as the same character and a plurality of character images representing the plurality of characters. For example, each similarity score is calculated to be 1 in a case where the plurality of character images are the same, and calculated to be 0 in a case where one or more of the plurality of character images are different from the other character image or images.Other Embodiments
[0180] Embodiment(s) of the disclosure can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a 'non-transitory computer-readable storage medium') to perform the functions of one or more of the above-described embodiment(s) and / or that includes one or more circuits (e.g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiment(s), and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s) and / or controlling the one or more circuits to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more processors (e.g., central processing unit (CPU), micro processing unit (MPU)) and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)TM), a flash memory device, a memory card, and the like.
[0181] While the disclosure has been described with reference to embodiments, it is to be understood that the disclosure is not limited to the disclosed embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
[0182] According to the disclosure, it is possible to reduce the burden on a user in extraction of character strings from an image including characters by an OCR process.
[0183] This application claims the benefit of Japanese Patent Application No. 2025-087145, filed May 26, 2025, which is hereby incorporated by reference herein in its entirety.
Claims
1. An apparatus comprising:an obtaining unit configured to obtain positional information of a character string region detected from an image including one or more characters; andan output unit configured to output information on false detection of the character string region based on the positional information of the character string region.
2. The apparatus according to claim 1, further comprising:a generation unit configured to generate a vicinity image representing a vicinity region including a region peripheral to the character string region based on the positional information of the character string region and information of the image including one or more characters; anda first calculation unit configured to calculate a detection score indicating a possibility of the vicinity region including an undetected character in an undetected state in which the undetected character is outside the character string region, whereinthe output unit outputs the detection score as the information on false detection of the character string region.
3. The apparatus according to claim 2, wherein the generation unit generates the vicinity image based on at least one of a region in the vicinity of an upper side of the character string region, a region in the vicinity of a lower side of the character string region, a region in the vicinity of a left side of the character string region, or a region in the vicinity of a right side of the character string region.
4. The apparatus according to claim 2, wherein the first calculation unit calculates the detection score using a calculation model which is a machine learning model.
5. The apparatus according to claim 2, further comprisinga creation unit configured to create image information of an undetected region obtained by excluding a detected character in the vicinity region that has been detected if any, whereinthe first calculation unit calculates the detection score based on the image information of the undetected region.
6. The apparatus according to claim 5, wherein the creation unit creates the image information of the undetected region by masking the detected character in the vicinity region using a background color of the vicinity image.
7. The apparatus according to claim 6, wherein the creation unit masks the detected character and a ruled line in the vicinity region using the background color of the vicinity image.
8. The apparatus according to claim 5, wherein the image information of the undetected region includes a plurality of channels corresponding to a plurality of colors in the vicinity image and a channel representing a region to be masked in the vicinity region.
9. The apparatus according to claim 5, wherein the image information of the undetected region includes positional information of the detected character in the vicinity region.
10. The apparatus according to claim 5, whereinthe first calculation unit calculates the detection score based on the image information of the undetected region using a calculation model which is a machine learning model, andthe apparatus further comprises a training unit configured to train the calculation model using the image information of the undetected region.
11. The apparatus according to claim 10, further comprisinga modification unit configured to modify positional information of the character string region such that part of a character string recognized from the character string region is included in the vicinity region as the undetected character, whereinthe creation unit creates image information of the undetected region for training of the calculation model using the modified positional information of the character string region, andthe training unit trains the calculation model using the image information of the undetected region for the training.
12. The apparatus according to claim 5, wherein in a case where the calculated detection score indicates that the vicinity region includes the undetected character, the output unit performs output for displaying at least of the vicinity region or the undetected region on a display unit.
13. The apparatus according to claim 2, wherein the output unit outputs the information on the image including one or more characters in a case where the calculated detection score indicates that the vicinity region does not include the undetected character.
14. The apparatus according to claim 1, further comprising:a generation unit configured to generate a vicinity image representing a vicinity region including a region peripheral to the character string region based on the positional information of the character string region and information of the image including one or more characters;a first calculation unit configured to calculate a detection score indicating a possibility of the vicinity region including an undetected character in an undetected state in which the undetected character is outside the character string region;a fourth calculation unit configured to calculate a recognition score indicating a possibility of false character recognition having occurred in a character string recognized from the character string region; anda third calculation unit configured to calculate a certainty factor score based on the detection score and the recognition score, the certainty factor score indicating whether the character string is correct, whereinthe output unit outputs the certainty factor score as the information on false detection of the character string region.
15. The apparatus according to claim 14, further comprisinga second calculation unit configured to calculate an item score indicating a possibility of false item extraction having occurred in the character string, whereinthe third calculation unit calculates the certainty factor score based on the detection score, the recognition score, and the item score.
16. The apparatus according to claim 1, further comprising:a generation unit configured to generate a vicinity image representing a vicinity region including a region peripheral to the character string region based on the positional information of the character string region and information of the image including one or more characters;a first calculation unit configured to calculate a detection score indicating a possibility of the vicinity region including an undetected character in an undetected state in which the undetected character is outside the character string region;a second calculation unit configured to calculate an item score indicating a possibility of false item extraction having occurred in a character string recognized from the character string region; anda third calculation unit configured to calculate a certainty factor score based on the detection score and the item score, the certainty factor score indicating whether the character string is correct, whereinthe output unit outputs the certainty factor score as the information on false detection of the character string region.
17. The apparatus according to claim 1, wherein the image including one or more characters is a scanned image obtained by scanning a document.
18. The apparatus according to claim 1, wherein the positional information of the character string region is information representing a rectangle surrounding a character string recognized from the character string region.
19. A method comprising:obtaining positional information of a character string region detected from an image including one or more characters; andoutputting information on false detection of the character string region based on the positional information of the character string region.
20. A non-transitory computer readable storage medium storing a program for causing a computer to execute a method, the method comprising:obtaining positional information of a character string region detected from an image including one or more characters; andoutputting information on false detection of the character string region based on the positional information of the character string region.
