Training dataset generation device, training dataset generation method, and program
The training dataset generation device and method address the scarcity of error-containing RIP images by generating and labeling images with character defects, enhancing the accuracy of machine learning models in detecting text defects during RIP processing.
Patent Information
- Application Number
- JP2021120638
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-07-21
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2041-07-21
AI Technical Summary
Existing methods for generating training datasets for machine learning models to detect text defects during RIP processing are limited by the scarcity of RIP images containing errors, making it difficult to create large and accurate datasets.
A training dataset generation device and method that generates images with character defects by creating correct and incorrect sentence images based on text information and layout parameters, using a character image database to arrange characters correctly or incorrectly, and labeling error locations.
Enables the creation of images with character defects as error locations, facilitating the generation of comprehensive training datasets for improved machine learning models in detecting text defects during RIP processing.
Smart Images

Figure 0007790044000001 
Figure 0007790044000002 
Figure 0007790044000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to a training dataset generation device, a training dataset generation method, and a program. [Background technology]
[0002] During the platemaking process, a process called RIP is carried out to convert the print manuscript into data suitable for printing. When RIP is carried out on print manuscripts that contain text, such as paperbacks and magazines, defects can occur in the text. Examples of defects that can occur in text include characters being missing, missing, or garbled. For this reason, an inspection is carried out to compare the print sample with the print manuscript after RIP.
[0003] Machine learning (deep learning) is sometimes used for this inspection. By using machine learning to match images, it is possible to extract subtle defects in text that would be overlooked by human inspection.
[0004] One possible inspection method using machine learning is the use of semantic segmentation. For example, if a scanned image of a print sample (scanned image) and a RIP-processed print manuscript (RIP image) are input into a trained semantic segmentation model, the trained model will output the locations where character defects (error locations) have occurred.
[0005] To use this method, a trained model must be generated. To generate a trained model, a training dataset is required, which is a set of images equivalent to the training print sample, RIP images, and labeled images in which errors in the training RIP images are labeled. To improve the accuracy of detecting errors in the trained model, it is necessary to train a large number of training RIP images containing various errors. However, because defects do not occur frequently in the RIP process, sources for obtaining RIP images containing errors are limited, making it difficult to obtain large training datasets.
[0006] Patent Documents 1 and 2 disclose techniques for generating image data used to train machine learning models. Patent Document 1 generates training data for a general GAN (Generative Adversarial Network) or semantic segmentation. Patent Document 2 adds an alpha channel to defective areas of an imaged item and assigns pixel values to areas corresponding to the defective areas to create labeled data. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] Japanese Patent Publication No. 2020-102041 [Patent Document 2] Japanese Patent Publication No. 2020-13507 Summary of the Invention [Problem to be solved by the invention]
[0008] However, the techniques of Patent Documents 1 and 2 cannot generate images that include character defects as error locations.
[0009] The present invention has been made in consideration of the above circumstances, and aims to provide a training dataset generation device, a training dataset generation method, and a program that are capable of generating images that include character defects as error locations. [Means for solving the problem]
[0010] The learning dataset generation device of the present invention acquires text information of a sentence. and generating image data of characters corresponding to the acquired text information and image data of characters different from the characters corresponding to the text information, and storing the generated image data in a character image database. a learning sentence image generating unit that generates correct sentence images that do not include errors and incorrect sentence images that include errors based on the text information acquired by the acquiring unit and parameters that indicate the layout of the images; and a label image generating unit that generates label images that indicate the errors in the incorrect sentence images generated by the learning image generating unit, wherein the learning sentence image generating unit: By referring to the character image database The character image corresponding to the text information Get the character image and generating the correct sentence image by placing the correct sentence image on the image; By referring to the character image database An image of characters different from the characters arranged in the correct sentence image The acquired image is The erroneous sentence image is generated by arranging the erroneous sentence as an image containing the erroneous sentence.
[0011] The training dataset generation method of the present invention is a training dataset generation method performed by a computer, the method comprising: an acquisition unit acquiring text information of a sentence; generating image data of characters corresponding to the acquired text information and image data of characters different from the characters corresponding to the text information, and storing the generated image data in a character image database; A learning sentence image generation unit generates a correct sentence image that does not include errors and an incorrect sentence image that includes errors based on the text information acquired by the acquisition unit and parameters indicating the layout of the image, and a label image generation unit generates a label image that indicates the errors in the incorrect sentence image generated by the learning image generation unit, and the learning sentence image generation unit By referring to the character image database The character image corresponding to the text information Get the character image and generating the correct sentence image by placing the correct sentence image on the image; By referring to the character image database An image of characters different from the characters arranged in the correct sentence image The acquired image is The erroneous sentence image is generated by arranging the erroneous sentence as an image containing the erroneous sentence.
[0012] The program of the present invention causes a computer to acquire text information of a sentence, generating image data of characters corresponding to the acquired text information and image data of characters different from the characters corresponding to the text information, and storing the generated image data in a character image database; generating a correct sentence image that does not include errors and an incorrect sentence image that includes errors based on the acquired text information and parameters that indicate the layout of the image, and generating a label image that indicates the errors in the generated incorrect sentence image; By referring to the character image database The character image corresponding to the text information The acquired text image is generating the correct sentence image by placing the correct sentence image on the image; By referring to the character image database An image of characters different from the characters arranged in the correct sentence image The acquired image is The program generates the erroneous sentence image by arranging the erroneous sentence as an image containing the erroneous sentence. [Effects of the Invention]
[0013] According to the present invention, an image containing character defects as error locations can be generated. [Brief explanation of the drawings]
[0014] [Figure 1] FIG. 1 is a block diagram showing an example of the configuration of a training dataset generation device 100 according to a first embodiment. [Figure 2] FIG. 2 is a diagram showing an example of a parameter database 8 according to the first embodiment. [Figure 3] FIG. 2 is a diagram showing an example of a character image database 7 according to the first embodiment. [Figure 4] FIG. 10 is a diagram showing an example of a correct sentence image BG according to the first embodiment. [Figure 5] FIG. 10 is a diagram showing an example of a correct sentence image BG according to the first embodiment. [Figure 6] 10A to 10C are diagrams showing examples of a correct sentence image BG, an incorrect sentence image EG, and a label image LG according to the first embodiment. [Figure 7] 10A and 10B are diagrams showing examples of an erroneous sentence image EG and a label image LG according to the first embodiment. [Figure 8]1 is a flowchart showing the flow of processing performed by a training dataset generation device 100 according to the first embodiment. [Figure 9] 10 is a flowchart showing the flow of processing performed by the training dataset generation device 100 according to the second embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0015] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0016] First Embodiment FIG. 1 is a block diagram showing an example configuration of a training dataset generation device 100 according to the first embodiment. The training dataset generation device 100 is a computer, such as a PC (Personal Computer), a server device, or a tablet terminal. The training dataset generation device 100 generates a training dataset. A training dataset is a dataset used for machine learning, and is information that includes a set of training data and teacher data.
[0017] The training data in the training dataset are text images. Text images are images in which characters or character strings that make up a text are arranged. Text images correspond to, for example, printed manuscripts (images equivalent to print samples) such as paperbacks and magazines, and images obtained by RIP-processing printed manuscripts. Text images include printed manuscripts and RIP-processed images that do not contain errors (correct text image BG, see Figure 4), and images that contain errors (incorrect text image EG, see Figure 6). An error is a defect in the characters that can occur when a printed manuscript is RIP-processed. An error is, for example, a location where a character is missing, missing, or garbled.
[0018] The training data in the training dataset are labeled images. A labeled image is an image that shows an error in a sentence image. For example, an image that shows either a first color indicating an error, such as white (pixel value 255), or a second color indicating an error-free area, such as black (pixel value 0), can be used as a labeled image.
[0019] As shown in FIG. 1, the training dataset generation device 100 includes, for example, a parameter setting unit 1, a template acquisition unit 2, a sentence data acquisition unit 3, a training sentence image generation unit 4, a label image generation unit 5, a display unit 6, a character image database 7, and a parameter database 8.
[0020] The parameter setting unit 1 sets parameters. The parameters are information indicating the layout of a text image. The parameters are information set for items related to the arrangement of characters in a text image, such as the top, bottom, left, and right margins of the text image, character size, line spacing, character spacing, vertical or horizontal writing, and maximum number of characters. The parameter setting unit 1, for example, displays, on the display unit 6, setting items related to the layout and input fields for inputting setting values for each setting item. The operator inputs setting values for each setting item using a keyboard, mouse, or the like. The parameter setting unit 1 acquires the input setting values for each setting item as parameters. The parameter setting unit 1 stores the acquired parameters in a parameter database 8.
[0021] The parameter database 8 will now be described with reference to FIG. 2. FIG. 2 is a diagram showing an example of the parameter database 8 according to the first embodiment. The parameter database 8 stores setting values corresponding to items such as margins, character size, line spacing, character spacing, vertical / horizontal writing, and maximum number of characters. The margins are spaces provided in a text image, and for example, a top margin, a bottom margin, a left margin, and a right margin are set for each of the top, bottom, left, and right sides. The character size is the size of characters arranged in a text image. The line spacing is the size of the space between lines in a text image. The character spacing is the size of the space between characters arranged in a line of a text image. The vertical / horizontal writing is information indicating whether the text written in the text image is vertically written or horizontally written. The maximum number of characters is the maximum number of characters to be arranged on one page as a text image.
[0022] The units of the setting values for the top, bottom, left, and right margins, character size, line spacing, and character spacing are, for example, pixels. When the unit is pixels, the character size can be expressed as size1 x size2 [pixels]. In this case, size1 and size2 are set as the character sizes. Size1 and size2 may be the same value. The setting values for character size, line spacing, and character spacing are not limited to being in pixels, but in the following explanation, it is assumed that the parameter setting values are set in pixels.
[0023] The parameter database 8 may also store other information, such as parameters that specify the font of characters.
[0024] The text data acquisition unit 3 acquires text data. The text data is text information of a text shown in a text image. The text here is not limited to a text that is properly formatted as a text, but may be a random arrangement of characters or character strings. A text may be an arrangement of specific characters or characters or character strings belonging to a specific character type. A character type is a type of character, such as alphabet, hiragana, katakana, kanji, or symbols. The text data acquisition unit 3 stores the acquired text information in the character image database 7.
[0025] The text data acquisition unit 3 generates character image data based on the acquired text information. The character image data is image information indicating the shape of characters corresponding to the text information. The character image data is, for example, information represented by a bitmap in which pixel values are associated with groups of pixels corresponding to character sizes. The text data acquisition unit 3 generates, for example, character images of characters corresponding to the text information in a specific font as character image data. The text data acquisition unit 3 also generates image information of characters that contain errors in the characters corresponding to the text information as character image data. For example, the text data acquisition unit 3 generates, as character image data of characters that contain errors, images of characters that correspond to the text information in a font different from the specific font. Alternatively, the text data acquisition unit 3 generates images of characters that are different from the characters corresponding to the text information as character image data of characters that contain errors. The text data acquisition unit 3 stores the generated character image data in the character image database 7.
[0026] The character image database 7 will now be described with reference to FIG. 3. FIG. 3 is a diagram showing an example of the character image database 7 according to the first embodiment. The character image database 7 stores information corresponding to items such as image number, text information, character image, font difference 1-2, incorrect character 1, .... The image number is a number that uniquely identifies an image of a character (character image). The text information is text information of the character image specified by the image number. The character image stores a character image showing a character corresponding to the text information in a specific font. The font difference 1-2 stores a character image showing that character in a font different from the font shown in the character image. The incorrect character stores a character image of a character different from the character corresponding to the text information.
[0027] The training sentence image generating unit 4 generates sentence images to be used as training data for the training data set. The training sentence image generating unit 4 includes, for example, a correct sentence image generating unit 41 and an incorrect sentence image generating unit .
[0028] The correct sentence image generating unit 41 generates a correct sentence image BG. The correct sentence image BG is a sentence image that does not include any errors. The correct sentence image generating unit 41 generates the correct sentence image BG, for example, by arranging images of characters corresponding to the text information of the sentence based on layout parameters.
[0029] Here, a method by which the correct sentence image generating unit 41 generates a correct sentence image BG will be described with reference to Figs. 4 and 5. Figs. 4 and 5 are diagrams showing examples of a correct sentence image BG according to the first embodiment. The correct sentence image generating unit 41 specifies the position at which to place the first character in the correct sentence image BG. In the following, an example will be described in which the sentence shown in the correct sentence image BG is written vertically, but the same concept can be applied to a case in which the sentence is written horizontally.
[0030] The correct sentence image generation unit 41 acquires the setting values set for the top margin and right margin by referring to the parameter database 8. Using the acquired setting values, the correct sentence image generation unit 41 specifies, as the position for placing the first character, the coordinate values that are located below the top edge of the correct sentence image BG by the set value of the top margin and to the left of the right edge of the correct sentence image BG by the set value of the right margin. The correct sentence image generation unit 41 places the character image M1 at the specified position.
[0031] The character images to be placed here are character images corresponding to the text information acquired by the text data acquisition unit 3. The correct text image generation unit 41 acquires image information of the character image corresponding to the text information by referring to the character image database 7. The correct text image generation unit 41 places the character image at a specified position based on the acquired image information.
[0032] The correct sentence image generation unit 41 specifies the position at which to place the second and subsequent characters. The correct sentence image generation unit 41 specifies the coordinate value located below the position of the first placed character by the set value of character spacing as the position at which to place the second subsequent character. The correct sentence image generation unit 41 places image M2 of the second character at the specified position. As with the second character, the correct sentence image generation unit 41 also places the image of the third and subsequent characters at coordinate values located below the position at which the previous character was placed by the set value of character spacing. The correct sentence image generation unit 41 sequentially places characters, and completes the placement of the first line when character image M3 is placed at a position above the bottom edge of the correct sentence image BG by the set value of the bottom margin.
[0033] The correct sentence image generation unit 41 specifies the coordinate value located to the left of the position of the first character placed on the first line by the set line spacing as the position where the first character on the second line should be placed. The correct sentence image generation unit 41 places image M4 of the first character on the second line at the specified position. The correct sentence image generation unit 41 similarly places character images on the second, third, etc. lines. When the correct sentence image generation unit 41 places image M5 of the last character on the last line, the correct sentence image generation unit 41 completes the arrangement of characters in the correct sentence image BG. Alternatively, if the maximum number of characters to be displayed in the correct sentence image BG is set in the parameter database 8, the correct sentence image generation unit 41 completes the arrangement of characters in the correct sentence image BG when the number of arranged character images reaches that maximum number of characters. In this way, the correct sentence image generation unit 41 generates the correct sentence image BG.
[0034] The incorrect sentence image generating unit 42 generates an incorrect sentence image EG. The incorrect sentence image EG is a sentence image including an error. The incorrect sentence image generating unit 42, for example, arranges character images corresponding to text information of a sentence based on layout parameters, similar to the correct sentence image generating unit 41. At this time, the incorrect sentence image generating unit 42 generates the incorrect sentence image EG by performing processing by the character processing unit 421 or processing by the character group processing unit 422.
[0035] The character processing unit 421 regards an image of at least one character included in the incorrect sentence image EG as an image containing an error. When arranging a character image in the incorrect sentence image EG, the character processing unit 421 refers to the character image database 7 to obtain image information of a character image containing an error for a character corresponding to the text information. The incorrect sentence image generation unit 42 arranges the character image based on the obtained image information. In this way, the incorrect sentence image generation unit 42 generates the incorrect sentence image EG.
[0036] Alternatively, the incorrect sentence image generating unit 42 may place a background color image at the position where the character image is placed in the correct sentence image BG. The background color image is an image in which the pixel values of the pixel group corresponding to the character size are all the same color as the background color of the incorrect sentence image EG, for example, white (pixel value 255). This allows the incorrect sentence image generating unit 42 to generate an incorrect sentence image EG that reproduces the defect of characters being deleted during RIP processing.
[0037] The erroneous text image generating unit 42 performs at least one of arranging an erroneous character image or arranging a background color image. As the arrangement of an erroneous character image, the erroneous text image generating unit 42 may perform either or both of arranging a character image in a different font or arranging a character image of characters different from the characters corresponding to the text information.
[0038] The character group processing unit 422 treats an image of a character group included in the erroneous sentence image EG as an image containing an error. The character group here refers to a plurality of characters included in the erroneous sentence image EG, such as a character group written in one line or a character group written in a part of a sentence image.
[0039] The character group processing unit 422 introduces errors by, for example, adding missing characters to character groups written in some lines of the correct sentence image BG. Missing characters mean that part of a character is missing. For example, the character group processing unit 422 places a line image in some of the lines of the correct sentence image BG. The line image is a linear image that is narrower and longer than the character size and has the same color as the background color of the incorrect sentence image EG. The character group processing unit 422 places the line image so that the longitudinal direction of the line image is along the line direction. In this way, the character group processing unit 422 generates an erroneous sentence image in which missing characters have been generated in some of the characters of the character group included in the line written in the incorrect sentence image EG.
[0040] The erroneous sentence image generating unit 42 generates an erroneous sentence image EG by performing at least one or both of the processing of the character processing unit 421 and the processing of the character group processing unit 422. The erroneous sentence image generating unit 42 outputs image information of the generated erroneous sentence image EG and information (such as pixel coordinates) indicating the location of the error in the correct sentence image BG to the label image generating unit 5.
[0041] The text image processing unit 43 processes the correct text image BG. The processed correct text image BG is used as an image equivalent to a print sample in which the effects of shadows and the like that occur when scanned are reproduced.
[0042] For example, the text image processing unit 43 processes the correct text image BG by changing the brightness of the image or adding noise to the image. This makes it possible to reproduce effects such as shadows that occur when the correct text image BG is scanned. The text image processing unit 43 changes the brightness of the image by changing the pixel value of the background color of the correct text image BG. For example, if the background color of the correct text image BG is white (pixel value 255), the text image processing unit 43 adds a predetermined offset value (e.g., 16) to the background color of the correct text image BG to change it to light gray, pixel value (255-16). Alternatively, the text image processing unit 43 changes the brightness of the image by changing the pixel value of the character color of the correct text image BG. For example, if the background color of the correct text image BG is black (pixel value 0), the text image processing unit 43 adds a predetermined offset value (e.g., 16) to the background color of the correct text image BG to change it to dark gray, pixel value (0+16).
[0043] The text image processing unit 43 may change the overall brightness of the correct text image BG, or may change the brightness of a partial area in the correct text image BG. The text image processing unit 43 may also add a uniform offset value, or may add a gradually changing offset value to a pixel group along a predetermined direction in the correct text image BG. It is not necessary to process the correct text image BG, and the text image processing unit 43 may not process the correct text image BG. The incorrect text image EG is not processed, however. This is because the processed incorrect text image EG will not be used as an image corresponding to a print sample.
[0044] The label image generation unit 5 generates a label image LG. The label image LG is an image that indicates the error locations in the sentence images (correct sentence image BG and incorrect sentence image EG). The label image generation unit 5 classifies the pixels in the sentence images into two classes: pixels that do not contain errors and pixels that contain errors. The label image generation unit 5 classifies all pixels in the correct sentence image BG as pixels that do not contain errors. Of the pixels in the incorrect sentence image EG, the label image generation unit 5 classifies pixels that have been notified by the incorrect sentence image generation unit 42 as pixels that contain errors, and classifies the other pixels as pixels that do not contain errors. For example, the label image generation unit 5 generates, as the label image LG, an image in which the locations that contain errors are colored white (pixel value 255) and the locations that do not contain errors are colored black (pixel value 0).
[0045] The display unit 6 displays the correct sentence image BG, the incorrect sentence image EG, and the label image LG. An operator may check the images displayed on the display unit 6. The operator, for example, visually checks the correspondence between the incorrect sentence image EG and the label image LG. Specifically, the operator checks whether an erroneous pixel in the label image LG corresponds to an error in the incorrect sentence image EG. If the operator determines that the correspondence between the incorrect sentence image EG and the label image LG is incorrect, the operator may instruct the incorrect sentence image generation unit 42 to regenerate the incorrect sentence image EG and the label image LG. In this case, the operator, in accordance with the operator's instructions, erases the incorrect sentence image EG and the label image LG displayed on the display unit 6 and regenerates the incorrect sentence image EG and its label image LG.
[0046] Here, the correct sentence image BG, the incorrect sentence image EG, and the label image LG will be described with reference to Fig. 6 and Fig. 7. Fig. 6 and Fig. 7 are diagrams showing examples of the correct sentence image BG, the incorrect sentence image EG, and the label image LG according to the first embodiment.
[0047] FIG. 6 shows an example of an incorrect sentence image EG containing an error in a character. In the example shown in this figure, the character "nani" is written as the sixth character from the top on the second line in the correct sentence image BG, whereas the character "same" is written in the same position in the incorrect sentence image EG, which is different from the character "nani". In other words, the character that is the sixth character from the top on the second line in the incorrect sentence image EG contains an error. Furthermore, an image surrounded by white is placed in the same position in the label image LG, indicating that an error is contained in that position.
[0048] Furthermore, while the character "I" is written as the 12th character from the top on the 6th line in the correct sentence image BG, the character "I" is written in the same position in the incorrect sentence image EG in a font different from the font of the surrounding characters. In other words, the 12th character from the top on the 6th line in the incorrect sentence image EG is shown as a character containing an error. Furthermore, an image surrounded by white is placed in the same position in the label image LG, indicating that an error is contained in that position.
[0049] FIG. 7 shows an example of an erroneous sentence image EG in which a group of characters contains an error. In this example, a line is placed to the right of the character string on the third line in the erroneous sentence image EG, and a portion of the character is missing to the right of each character that reads "I don't think there's any hope of salvation." That is, the group of characters on the third line in the erroneous sentence image EG contains an erroneous character group. An image surrounded by a white circle is placed at the same position in the label image LG, indicating that an error is contained in that position.
[0050] Here, the flow of processing performed by the training dataset generation device 100 will be described with reference to Fig. 8. Fig. 8 is a flowchart showing the flow of processing performed by the training dataset generation device 100 according to the first embodiment.
[0051] The training dataset generation device 100 sets parameters (step S10). The training dataset generation device 100 sets parameters by setting margin values and the like for the sentence image using the parameter setting unit 1. The training dataset generation device 100 generates a correct sentence image BG (step S11). The training dataset generation device 100 generates a sentence image that does not contain an error using the correct sentence image generation unit 41, and designates the generated image as the correct sentence image BG. The training dataset generation device 100 generates an incorrect sentence image EG (step S12). The training dataset generation device 100 generates a sentence image that contains an error using the incorrect sentence image generation unit 42, and designates the generated image as the correct sentence image BG. The training dataset generation device 100 processes the sentence image (step S13). The training dataset generation device 100 generates an image by changing the brightness of the sentence image or adding noise using the text image processing unit 43, and designates the generated image as the processed text image. The training dataset generation device 100 generates a labeled image LG (step S14). The training dataset generation device 100 generates an image indicating the error location using the labeled image generation unit 5, and designates the generated image as the labeled image LG. The training dataset generation device 100 generates a training dataset and displays the generated training dataset (step S15). The training dataset generation device 100 generates a training dataset for learning error-free sentence images by pairing a correct sentence image BG with its labeled image LG. The training dataset generation device 100 generates a training dataset for learning erroneous sentence images by pairing an error sentence image EG with its labeled image LG. The training dataset generation device 100 displays the generated correct sentence image BG, error sentence image EG, and labeled image LG on the display unit 6.
[0052] In the above-described flowchart, the processes shown in steps S10 to S15 are sequentially executed to generate a correct sentence image BG, an incorrect sentence image EG, and a label image LG. However, this is not limiting. The training dataset generation device 100 may generate multiple incorrect sentence images EG and label images LG corresponding to the multiple incorrect sentence images EG for one correct sentence image BG. In this case, the error locations included in the multiple incorrect sentence images EG are randomly positioned so that the error locations included in the incorrect sentence images EG are not the same. Similarly, when an error is included in a character group or when a sentence image is edited, the locations of the error locations or the positions at which the image is edited are not the same. This makes it possible to generate multiple training datasets in which the locations containing errors and the edited locations are different in the same sentence.
[0053] As described above, the training dataset generation device 100 of the embodiment includes a sentence data acquisition unit 3, a training sentence image generation unit 4, and a label image generation unit 5. The sentence data acquisition unit 3 acquires text information of a sentence. The training sentence image generation unit 4 generates a correct sentence image BG that does not contain errors and an incorrect sentence image EG that does contain errors, based on the text information of the document and parameters indicating the image layout. The label image generation unit 5 generates a label image that indicates the errors in the incorrect sentence image EG. This allows the training dataset generation device 100 of the embodiment to generate an incorrect sentence image EG based on the text information of the document and parameters indicating the image layout. Therefore, it is possible to generate images that contain character defects as errors, such as using characters that differ from characters corresponding to the text information or not placing characters where they should be placed.
[0054] Here, the text data acquisition unit 3 is an example of an "acquisition unit." The text information acquired by the text data acquisition unit 3 is an example of "text information of the text." The parameters set by the parameter setting unit 1 are an example of "parameters indicating the layout of the image."
[0055] <Second embodiment> A second embodiment will now be described. This embodiment differs from the above-described embodiment in that a text image is generated using a template image. The template image is an image that serves as a prototype for the text image, and in this case, is an image that reflects the layout of the text image. The template image is an image that shows registration marks, a header, a footer, etc. Alternatively, the template image may be an image that is created so that text cannot be placed in areas that are to be blank, corresponding to the set values for the top, bottom, left, and right margins, and in areas where text can be placed, the positions at which text can be placed are specified corresponding to the set values for character spacing and line spacing.
[0056] The template acquisition unit 2 acquires image information of a template image. The template image is, for example, an image in which a layout for arranging characters is shown against a background color (for example, white) of the image. The template acquisition unit 2 acquires image information of the template image stored in, for example, a USB (Universal Serial Bus) memory via a USB interface (not shown) provided in the parameter setting unit 1. Alternatively, the template acquisition unit 2 may acquire, as a template, a model of a sentence image generated based on parameters stored in the parameter database 8.
[0057] The template acquisition unit 2 includes, for example, a template processing unit 21. The template processing unit 21 processes the template image. The template processing unit 21 processes the template image by moving an area in the template image where characters are arranged (referred to as a character area). For example, the template processing unit 21 processes the template image by flipping the character area upside down about an axis that passes through the center of the template image and is parallel to the left-right direction. Alternatively, the template processing unit 21 processes the template image by flipping the character area upside down about an axis that passes through the center of the template image and is parallel to the up-down direction.
[0058] The learning sentence image generator 4 generates a correct sentence image BG and an incorrect sentence image EG by arranging characters in the template and the processed template according to the layout parameters. This allows the same template image to be used to generate four different sentence images: an "unedited template image," a "vertically inverted template image," a "horizontally inverted template image," and a "vertically and horizontally inverted template image."
[0059] Here, the flow of processing performed by the training dataset generation device 100 will be described with reference to Fig. 9. Fig. 9 is a flowchart showing the flow of processing performed by the training dataset generation device 100 according to the second embodiment. Steps S20 and S25 to S29 in Fig. 9 are the same as steps S10 to S15 in Fig. 8, and therefore description thereof will be omitted.
[0060] The training dataset generation device 100 determines whether a template image can be acquired (step S21). If the template image is stored in, for example, a USB memory or a storage unit (not shown) of the training dataset generation device 100, the training dataset generation device 100 determines that the template image can be acquired. If the template image has not been acquired, the training dataset generation device 100 proceeds to the process shown in step S25.
[0061] If a template image has already been acquired, the training dataset generation device 100 acquires the template image using the template acquisition unit 2 (step S22). The training dataset generation device 100 determines whether to process the acquired template image. For example, if a sentence image has already been created using an (unprocessed) template image, the training dataset generation device 100 determines to process the template image. If the template image will not be processed, the training dataset generation device 100 proceeds to the process shown in step S25. On the other hand, if the template image will be processed, the training dataset generation device 100 processes the template image by moving the character area in the template image, for example by inverting the character area (step S24). Then, the training dataset generation device 100 proceeds to the process shown in step S25.
[0062] As described above, the training dataset generation device 100 of the second embodiment generates a correct sentence image BG or an incorrect sentence image EG by arranging character images corresponding to text information in a template image. This makes it possible to generate a correct sentence image BG or an incorrect sentence image EG through the simple process of arranging characters in an image whose layout is shown in advance.
[0063] Furthermore, in the training dataset generation device 100 of the second embodiment, the training sentence image generation unit 4 generates a correct sentence image BG or an incorrect sentence image EG using a new template image obtained by moving the area in which characters are arranged in the template image. This makes it possible to generate a plurality of different correct sentence images BG or incorrect sentence images EG using the same template image.
[0064] In at least one of the above-described embodiments, when creating text data of a random character string, the frequency of occurrence of the character type (alphabet / hiragana / katakana / kanji / symbols) may be changed. If it is desired to improve the accuracy of the inspection for alphabets, it is possible to generate text that includes a large amount of alphabets by increasing the frequency of occurrence of alphabets compared to other character types.
[0065] All or part of the training dataset generation device 100 in the above-described embodiment may be implemented by a computer. In this case, a program for implementing this function may be recorded on a computer-readable recording medium, and the program may be loaded into a computer system and executed. Note that the term "computer system" as used herein includes hardware such as an OS and peripheral devices. Furthermore, the term "computer-readable recording medium" refers to portable media such as flexible disks, optical magnetic disks, ROMs, and CD-ROMs, as well as storage devices such as hard disks built into a computer system. Furthermore, the term "computer-readable recording medium" may also include devices that dynamically store programs for a short period of time, such as communication lines used when transmitting programs via networks such as the Internet or telephone lines, or devices that store programs for a certain period of time, such as volatile memory within a computer system that serves as a server or client. The program may be for implementing some of the above-described functions, or may be capable of implementing the above-described functions in combination with a program already stored in the computer system, or may be implemented using a programmable logic device such as an FPGA.
[0066] Although an embodiment of the present invention has been described above in detail with reference to the drawings, the specific configuration is not limited to this embodiment, and includes designs within the scope of the gist of the present invention. [Explanation of symbols]
[0067] 1...Parameter setting section 2...Template acquisition section 3...Text data acquisition section 4...Learning sentence image generation unit 5...Label image generation unit 6...Display section 7. Character image database 8...Parameter database
Claims
1. an acquisition unit that acquires text information of a sentence, generates image data of characters corresponding to the acquired text information and image data of characters different from the characters corresponding to the text information, and stores the generated image data in a character image database; a learning sentence image generation unit that generates correct sentence images that do not include errors and incorrect sentence images that include errors based on the text information acquired by the acquisition unit and parameters that indicate the layout of images; a label image generation unit that generates a label image indicating an error in the erroneous sentence image generated by the learning sentence image generation unit; Equipped with The learning sentence image generation unit acquires a character image corresponding to the text information by referring to the character image database, generates the correct sentence image by arranging the acquired character image in an image, acquires an image of a character different from the character arranged in the correct sentence image by referring to the character image database, and generates the incorrect sentence image by arranging the acquired image as an image including an error. Training dataset generator.
2. the learning sentence image generation unit generates the erroneous sentence image by converting a group of characters in the correct sentence image that does not include an error into a group of characters that includes an error. The training dataset generation device according to claim 1 .
3. the learning sentence image generation unit generates the correct sentence image or the incorrect sentence image by arranging an image of a character corresponding to the text information in a template image showing an image layout; The training dataset generation device according to claim 1 or 2.
4. the learning sentence image generation unit generates the correct sentence image or the incorrect sentence image using a new template image obtained by moving an area in which characters are arranged in the template image; The training data set generation device according to claim 3 .
5. a display unit that displays the correct sentence image, the incorrect sentence image, and the label image generated by the learning sentence image generation unit; The training dataset generation device according to claim 1 .
6. A computer-implemented method for generating a training dataset, comprising: an acquisition unit acquires text information of a sentence, generates image data of characters corresponding to the acquired text information and image data of characters different from the characters corresponding to the text information, and stores the generated image data in a character image database; a learning sentence image generation unit generates a correct sentence image that does not include an error and an incorrect sentence image that includes an error based on the text information acquired by the acquisition unit and parameters that indicate the layout of the image; a label image generating unit generating a label image indicating an error in the erroneous sentence image generated by the learning sentence image generating unit; The learning sentence image generation unit acquires a character image corresponding to the text information by referring to the character image database, generates the correct sentence image by arranging the acquired character image in an image, acquires an image of a character different from the character arranged in the correct sentence image by referring to the character image database, and generates the incorrect sentence image by arranging the acquired image as an image including an error. Training dataset generation method.
7. On the computer, Get the text information of the sentence, generating image data of characters corresponding to the acquired text information and image data of characters different from the characters corresponding to the text information, and storing the generated image data in a character image database; generating a correct sentence image that does not include an error and an incorrect sentence image that includes an error based on the acquired text information and parameters that indicate the layout of the image; generating a label image indicating an error in the generated erroneous sentence image; acquiring character images corresponding to the text information by referring to the character image database, and generating the correct sentence image by arranging the acquired character images in an image; By referring to the character image database, an image of a character different from the character arranged in the correct sentence image is acquired, and the acquired image is arranged as an image including an error, thereby generating the incorrect sentence image. program.
Citation Information
Patent Citations
Labeled image data creation method, inspection method, program, labeled image data creation device, and inspection device
JP2020013507A
Learning data generation system, learning data generation method, and machine learning model learning method
JP2020102041A
Information processing apparatus and method for generating learning model
JP2020119004A
Computer, generation method of learning data, and computer system
JP2020126328A
Machine learning device, machine learning method, and program
JP2021047797A