1. Help Center
  2. Layout Recognition

2. Advanced Layout Configuration Settings

Minor Layout configuration changes might help you to get better results in terms of line recognition and text regions


We recommend first trying the automatic layout recognition with the default settings. However, depending on your material, you may need to change some of them to get optimal results.

To access the Layout Configuration Settings, select the page(s) to process, click on the "Recognize" button, then select "Layout". 

HC-Layout_2_manual-recong_botton-recognize

HC-Layout_2_manual-recong_switch-layout

For a complex layout, it could be a trial-and-error process.
Try to modify some of the settings depending on the issues with your type of material and run the Layout Recognition on a few pages to test the settings out. You can find the "Advanced Settings" button under the selected document(s) bar.

 

Help-Center_LA-AdvSett

a) Layout model

The first thing to choose is the Layout model to use:

  • Universal Lines (selected by default): most general model currently in the platform; we would recommend to use this model when you're unsure regarding the optimal model selection to align with the characteristics of your material.
  • Mixed Line Orientation: when your documents have a heterogeneous layout, i.e. lines in all directions.
  • Horizontal Line Orientation: when your documents have a homogeneous layout, i.e. only horizontal and vertical lines. 
  • Custom baselines model: when you have trained a Baselines model specific to your document typology, as explained on the Baselines Models page.

b) Advanced settings

1) Generation of Text Regions

You can choose to:

  • Generate new Text Regions
    After the lines are detected, they are clustered in text regions.
  • Keep existing Text Regions:
    Choose this option if you have already manually drawn the text regions of your interest (e.g. for tables), as explained on the Manual Layout Recognition page
    In addition you can restrict the baseline recognition on structure types: this will limit the line detection to the text regions tagged with certain structure types

2) Text Region Method

There are two clustering methods available:
  • General (default): it clusters the lines from left to right.
    • To improve the clustering, set the text line orientation to "Horizontal" if your documents have only horizontal lines or to "Mixed" to make the algorithm assume that lines are rotated by 0, 90, 180, and 270 degrees.
  • Custom: it is a simple agglomerative clustering based on the leftmost point of each line. It clusters lines based on their distance. You can choose to have one text region, few, medium or many text regions per image.

3) Image Scaling

You can decide to Upscale low-resolution images or Downscale high-resolution images.
We suggest trying this feature only when Layout Recognition does not work with the default setting (for instance, it detects no or few lines).

4) Baselines Options

These options offer you the possibility of setting parameters for line detection. They are particularly useful if too few/too many lines have been recognised or if they have been joined or separated when they should not.

  • Minimal baseline length:
    it indicates the minimum length of lines in pixels. Lines shorter than this length will not be detected.
  • Baseline accuracy threshold:
    in the first stage of the layout recognition, each pixel is labelled as baseline, separator or other. The baseline accuracy threshold applies to the baseline labelling at this stage.
    It ranges between 0 and 255, and higher values enforce higher accuracy in the detected baselines.
  • Use trained separators:
    separators are small vertical lines drawn beside each baseline; they mark the beginning and end of each baseline (do not confuse them with actual separators in printed document images). As for the baseline accuracy threshold, the separator threshold refers to the first stage, when pixels are labelled.
    The separator threshold ranges between 0 and 255: 0 means that separators are not used at all; with a higher value, separators are used, thus, nearby baselines tend not to be merged.
    Usually, low values are sufficient to prevent a connection between nearby baselines. 
  • Max-dist for merging:
    in the second stage, the algorithm tries to merge nearby baselines but only when their distance is smaller than a set value. 
    Set it to: "Low" to merge only the closest lines (closer than 0.5% of the image width); to "Medium" to merge lines closer than 1% of the image width; to "High" to merge lines that are quite far apart, but closer than 5% of the image width.
    "Medium" should work well in most cases.
  • Split lines on region border (keeping existing regions):
    check this box to make the lines strictly obey the region border, preventing lines close to each other but belonging to different regions from being merged together as one long line.
  • Line Overlap fraction:
    you can increase the minimum overlap fraction between a detected line and an existing text region in case you want the line to extend slightly beyond the region border. If a line overlaps with multiple regions, however, the region with the most overlap is chosen.


 


 

Transkribus eXpert (deprecated)

We recommend first trying the automatic layout recognition with the default settings. However, depending on your material, you may need to change some of them to get optimal results.

To access the Layout Configuration Settings, go to the "Layout Analysis" section in the “Tools” tab in the Managing & Tools Bar (on the left side of the screen). 

For a complex layout, it could be a trial-and-error process. Try to modify some of the settings depending on the issues with your type of material and run the Layout Analysis on a few pages to test the settings out.

Click on "Configure", to the right of "Method", to open the Layout Analysis Configuration window. The setting you can configure are:

1) Layout Model

The first thing to choose is the Layout model to use:

  • Horizontal Text Line Orientation (selected by default): when your documents have a homogeneous layout, i.e. only horizontal and vertical lines.
  • Mixed Text Line Orientation: when your documents have a heterogeneous layout, i.e. lines in all directions.
  • Custom Baselines model: when you have trained a Baselines model specific to your document typology, as explained on the Baselines Models page.

Click on the model's name to open the window with the list of all the public models as well as the private baselines models you have trained.

2) Baseline Detection Settings

These options offer you the possibility of setting parameters for baseline detection. They are particularly useful if too few/too many baselines have been recognised or if they have been joined or separated when they should not. For each parameter, you can choose one of the three suggested values (Low, Medium, HighI) or customise the value manually.

  • Minimal baseline length:
    it indicates the minimum length of lines in pixels. Lines shorter than this length will not be detected.
  • Baseline accuracy threshold:
    in the first stage of the layout recognition, each pixel is labelled as baseline, separator or other. The baseline accuracy threshold applies to the baseline labelling at this stage.
    It ranges between 0 and 255, and higher values enforce higher accuracy in the detected baselines.
  • Use trained separators:
    separators are small vertical lines drawn beside each baseline; they mark the beginning and end of each baseline (do not confuse them with actual separators in printed document images). As for the baseline accuracy threshold, the separator threshold refers to the first stage, when pixels are labelled.
    The separator threshold ranges between 0 and 255: 0 means that separators are not used at all; with a higher value, separators are used, thus, nearby baselines tend not to be merged.
    Usually, low values are sufficient to prevent a connection between nearby baselines. 
  • Max-dist for merging:
    in the second stage, the algorithm tries to merge nearby baselines but only when their distance is smaller than a set value. 
    Set it to: "Low" to merge only the closest lines (closer than 0.5% of the image width); to "Medium" to merge lines closer than 1% of the image width; to "High" to merge lines that are quite far apart, but closer than 5% of the image width.
    "Medium" should work well in most cases.
  • Image scaling: 
    You can decide to Upscale low-resolution images or Downscale high-resolution images.
    We suggest trying this feature only when Layout Recognition does not work with the default setting (for instance, it detects no or few lines).

3) Region Detection Settings

After the baselines are detected, they are clustered in text regions. There are two clustering methods available:  

  • General (default): it clusters the lines from left to right.
    To improve the clustering, set the text line orientation to "Horizontal" if your documents have only horizontal lines or to "Mixed" to make the algorithm assume that lines are rotated by 0, 90, 180, and 270 degrees.
  • Custom: it is a simple agglomerative clustering based on the leftmost point of each line. It clusters lines based on their distance.
    You can choose to have one text region, few, medium or many text regions per image.

eXpert-Layout Analysis Configuration

It may be the case that you have drawn the text regions of your interest by hand (e.g. for tables), as explained on the Manual Layout Recognition page, and you want just to detect the baselines while keeping the existing text regions. In the "Layout Analysis" section in the “Tools” tab, untick the “Find Text Regions”-option before starting the layout analysis.

When keeping the existing text regions, it is also possible to:

  • restrict on structure tags: limit the baseline detection to the text regions tagged with certain structure tags.
  • split lines on regions: make the lines strictly obey the region border, preventing lines close to each other but belonging to different regions from being merged together as one long line.
    You can increase the minimum overlap fraction between a detected line and an existing text region in case you want the line to extend slightly beyond the region border. If a line overlaps with multiple regions, however, the region with the most overlap is chosen.

    For more information about the Transkribus LA algorithm and setting, consult this page.