BACKGROUND

The present invention relates to a computer-implemented method to generate training-data as ground-truth for image segmentation applications.

The present invention further relates to a corresponding system and a corresponding computer program product.

The extraction of fundamental components from scanned documents, e.g. text cells, paragraphs, lines etc. may be done in two fundamentally different ways. Either one uses a rule-based method, in which one encodes explicitly certain properties of these components and uses those for their identification and extraction. Another more popular way is to use a machine learning approach, in which one uses training data to learn those properties implicitly. This approach is more general, but typically requires lots of annotated data as training data which is hard and costly to obtain. Such training data is often referred to as ground-truth.

The generation of such ground-truth, in particular pixel-perfect ground-truth, is very difficult to obtain through human annotation. In essence, one needs to assign to each pixel in the image a class-label.

Accordingly, there is a need for methods which facilitate to generate such training data in an efficient way.

SUMMARY

According to an embodiment, the invention is embodied as a computer-implemented method to generate a training data set for image segmentation applications.

The method comprises providing a set of input documents of a first format, wherein the input documents each comprise one or more document pages. The method further comprises splitting the input documents into its individual document pages and parsing the individual document pages of the first format. The parsing comprises identifying a predefined set of items including position information of the position of the predefined set of items in the individual document pages. The method comprises generating a bitmap image of a second format for each individual document page of the first format, wherein the bitmap image comprises a predefined number of pixels, and generating a mask for each individual document, wherein the mask comprises the predefined number of pixels of the corresponding bitmap image. The generating of the mask comprises assigning an encoded class label to each pixel of the mask based on the position information of identified items of the predefined set of items.

Such an embodied method may allow to generate ground truth for image segmentation applications, in particular pixel perfect ground truth, in an advanced way.

According to an embodiment, the assigning of the class label comprises evaluating whether the respective pixel of the mask overlaps with an identified item of the predefined set of items or not. This is an efficient way to assign the class label.

According to an embodiment, the predefined set of items comprises text cells and the position information of the text cells include bounding box coordinates of bounding boxes of the text cells. The identification of such text cells may provide basic information of bitmap images in an efficient way.

According to an embodiment, the predefined set of items comprises paths and the position information comprises path coordinates and the width of the path. Such paths may provide basic information of bitmap images in an efficient way.

According to an embodiment, the mask is a 3-dimensional mask with the dimensions number of pixels in height, number of pixels in width and number of class labels.

According to an embodiment, the bitmap images are 3-dimensional images with dimensions number of pixels in height, number of pixels in width and number of color channels.

According to an embodiment, the generating of the mask comprises initializing the encoded class label of all pixels of the mask to a first value and assigning a second value as encoded class label to all pixels of the mask that overlap with an identified item of the predefined set of items according to the position information of the predefined set of items. This is a particularly efficient approach for generating the mask.

According to an embodiment, the method further comprises providing the bitmap image and the corresponding mask as tuple to the training data set for the image segmentation application. This allows to enhance the training data set with new ground-truth.

According to another embodiment a system for performing a computer-implemented method for generating training data sets of image segmentation applications is provided. The system comprises a processor and a computer readable memory. The system is configured to provide a set of input documents of a first format, the input documents each comprising one or more document pages. The system is further configured to split the input documents into its individual document pages and to parse the individual document pages of the first format, wherein the parsing comprises identifying a predefined set of items including position information of the position of the predefined set of items in the individual document pages. The system is further configured to generate a bitmap image of a second format for each individual document page of the first format, wherein the bitmap image comprises a predefined number of pixels. The system is further configured to generate a mask for each individual document page, the mask comprising the predefined number of pixels of the corresponding bitmap image. The system is further configured to assign an encoded class label to each pixel of the mask based on the position information of identified items of the predefined set of items.

According to another embodiment a computer program product for generating training data sets of image segmentation applications by a system comprising a processor and computer readable memory is provided. The computer program product comprises a computer readable storage medium having program instructions embodied therewith, the program instructions executable by the system to cause the system to perform a method comprising providing a set of input documents of a first format, wherein the input documents each comprise one or more document pages. The method further comprises splitting the input documents into its individual document pages, parsing the individual document pages of the first format. The parsing comprises identifying a predefined set of items including position information of the position of the predefined set of items in the individual document pages. The method further comprises generating a bitmap image of a second format for each individual document page of the first format, the bitmap image comprising a predefined number of pixels. The method further comprises generating a mask for each individual document page, the mask comprising the predefined number of pixels of the corresponding bitmap image, and assigning an encoded class label to each pixel of the mask based on the position information of identified items of the predefined set of items.

According to another embodiment a training data set obtainable by a computer-implemented method of the previous embodiment is provided.

According to another embodiment a computer-implemented method for training an image segmentation application, a cognitive model for an image segmentation application encoded on a non-transitory computer readable medium and a computer-implemented method for performing an image segmentation application are provided.

Embodiments of the invention will be described in more detail below, by way of illustrative and non-limiting examples, with reference to the accompanying drawings.

