1. Help Center
  2. Layout Recognition

5. Field Models

Field Models in Transkribus use AI to enhance layout recognition in historical documents. Unlike standard options, these trainable models can be customized to identify specific fields in your documents such as regions, marginalia, name fields etc.

Available on Beta


How to Train a Field Model

Step 1: Preparing the Training Data in Transkribus Desk

Before you can train a Field Model, you need to prepare your training data. Import the historical documents you want to use for training into a specific collection in Transkribus Desk and then tag the structure of your documents as explained in this article

Once you have tagged enough pages (we recommend at least 50 pages, depending on the complexity of your document's layout), it is time to start the model training.

Step 2: Training a Model in Transkribus

The training setup is made of four steps: training data, tag selection, validation data, model setup and start. You can go to the next or the previous step whenever you want by using "Next" and "Back" buttons.

Please note that training data and validation data are two different parts of the same dataset. Training Data is a set of examples used to fit the parameters of the model (so the model is trained on those pages). Validation Data is a set of examples that provides an unbiased evaluation of a model (these pages are used to assess its accuracy).


Step 2.1: Choosing Training Data


Navigate to Transkribus Models and click "Train New Model" and then select "Field Model" to enter the field training menu.

Then choose a collection where you will train your model, and select the specific documents within the collection you want to use as your training data. You can choose to include in the training the last version of all pages (with text regions) or to restrict the dataset on the Ground Truth pages. 
To personally select the pages to include in the training set, click on "Select Pages" (on the document preview image). This menu shows you a list of the pages with a small preview: you can select or deselect the single pages. Click on "Save and go back" to continue the training setup.


Step 2.2: Tag Selection

Select the structural tags that you’ve prepared during the data preparation phase. These tags will be what the model learns to recognise.

You can choose to include untagged regions in your training. Without this option, untagged regions will be ignored, and the resulting model will not recognise them.

Fields models can be used to train line polygons (the underlying algorithm is the same). Line polygons are shapes encasing all the handwritten text in a line. While baselines run at the bottom of the text line, line polygons comprise the body of the written characters, including the ascenders and descenders. During text recognition (or training), line polygons are automatically computed from baselines. The automatic computing of polygons can show inadequate results for your goal and your particular document (e.g. big-size characters, music scores, mathematical expressions), causing errors in the text recognition. 
If this looks like your case, and you need to train a line polygon model, correct the line polygons in the Ground Truth and check the box "Train on line polygons" to train a Field Model designed for line polygons.


Step 2.3: Validation Data

Now that the training data is set, it is time to set the validation data. You can see two different options. With the automatic selection of the validation set, you just need to decide a percentage of pages of the dataset that will be used as validation data (we recommend 10%).

You can otherwise manually set specific pages as your validation data.


Step 2.4: Model Setup

The training set is ready: all you have to do is add some information about your model.

  • Model Name: Choose a name for you new model; for example, you can use a couple of words that explain the layout you model is meant to recognise.
  • Description: Provide a brief description of what kind of material you used as GT and what the model is for (e.g. octavo editions with handwritten marginalia; administrative documents with charts).
  • Preview Thumbnail: Optionally, you can add an image that will serve as a preview thumbnail for your model; copy and paste the image URL to do so.

You can also set advanced options regarding the training process.

The first is the number of Training Cycles. These cycles indicate how many times (between 1'000 and 30'000) the model will go through the training data to learn and adjust. More cycles could result in a more accurate model but may also risk overfitting.

Then you can set a Learning Rate. It defines the increment (between 0.001 and 0.05) from one cycle to another, so how fast the training will proceed. This will affect the accuracy: the higher the value (so the speed), the higher the risk that details are overlooked.

For initial trainings, it is recommended not to modify these advanced parameters and to adhere to the default advanced options, which have proven to be effective in most scenarios.


Step 2.5: Summary

Your model is ready to start. Review all the settings and data you have inputted. Once everything looks good, proceed by clicking "Start" to launch the training process.

You can follow the progress of the training by clicking the "Jobs" button in the top bar to the left of you user icon. You will receive an email when the training process is completed.

How to Use the Trained Field Model

Once your new Field Model is ready, you can try it out on your documents.

Step 1: Selecting Documents for Recognition

Go to your Transkribus Desk and select the documents or specific pages you want to recognise.

Please remember that your model will work better on documents that fit the training set. For example, if it has been trained only on folio books with just body text, page number and headings, it can show poor results on books with also headers and footers.

Step 2: Recognition Process

Open the page you want to try your model on and click on the "Recognition" on the editor's top left bar to enter the recognition menu. Then switch to Fields and, under your Private Models, locate and select your newly trained Field Model.

You can optionally set the Advandced Setting for the recognition:
  • Detection Confidence Level: this parameter (between 0.5 and 1) adjusts how sure the model has to be before labeling a field.
  • Shape Detail Level: it determines the detail level of the shapes of the fields; "High" keeps the field complex; "Low" simplifies the shapes to basic forms; "Medium" balances detail and simplicity.
  • Add to Existing Layout: checking this box, the model will tag the existing layout or add new fields according to model data settings.

And that’s it! Your Field Model will now be applied to recognise the layouts of the selected documents or pages.