Skip to main content
FlexiCapture for Invoices matches FlexiLayouts with an invoice in three stages. It applies the generic FlexiLayout, then applies a FlexiLayout variant for the vendor if one exists, and then merges the results. The result is a set of field regions that come from the different FlexiLayouts included in the Document Definition. FlexiCapture for Invoices can use several types of FlexiLayout when matching the Document Definition.

Stage 1: Match the generic FlexiLayout

Apply the main FlexiLayout

First, the program applies the main FlexiLayout. The invoice image is pre-recognized using the pre-recognition parameters specified in the Document Definition. As a result of applying the main FlexiLayout, the program obtains:
  • The ID of the vendor and the ID of the business unit, if detected.
  • The regions of the standard fields. For more information, see Captured fields.

Apply the additional FlexiLayout

Next, the program applies the additional FlexiLayout, if it is available in the generic FlexiLayout. The invoice image is pre-recognized using the pre-recognition parameters (the languages and the pre-recognition mode) specified in the FlexiLayout. Specify the same pre-recognition parameters in the additional FlexiLayout as in the Document Definition. In this case, the program uses the pre-recognition result obtained when applying the main FlexiLayout instead of pre-recognizing the invoice twice. If your invoices contain some unusual fields, you can specify different pre-recognition parameters in the additional FlexiLayout, but this slows down processing. As a result of applying the additional FlexiLayout, the program obtains the regions of all the fields defined in the additional FlexiLayout. These may be either standard invoice fields whose detection logic had to be changed, or additional fields not defined in the main FlexiLayout.

Generate the aggregate result

Next, the program generates the aggregate result of applying the generic FlexiLayout. If the Document Definition includes an additional FlexiLayout, the program merges the results from the main FlexiLayout with those from the additional FlexiLayout at this stage. The fields are identified by their names. The result is a collection of unique fields derived from the main and additional FlexiLayouts. If there are fields with identical names in the main and additional FlexiLayout, the program uses the region from the additional FlexiLayout. This approach allows you to define new fields or change the logic of capturing any of the standard invoice fields.

Stage 2: Apply FlexiLayout variants

If the program detected the vendor by applying the generic FlexiLayout in stage 1 and there is a FlexiLayout variant for this vendor, this FlexiLayout variant is applied at this stage. The pre-recognition parameters from the Document Definition are used. These are the same pre-recognition parameters that were used when matching the main FlexiLayout included in the generic FlexiLayout. Therefore, no additional pre-recognition is required. After matching the FlexiLayout variant with the invoice, the program obtains the regions of all the fields defined in the FlexiLayout variant for this specific vendor. If a FlexiLayout variant is obtained by training the program on a variety of invoices, it includes all the fields defined in the Document Definition. If you create a FlexiLayout variant manually, leave in it only the fields whose detection requires actions specific to the given vendor.

Stage 3: Merge the results

At this stage, the results obtained by matching the generic FlexiLayout are merged with the results obtained by matching the FlexiLayout variant. Information about which FlexiLayout was used to detect the region of a field is recorded in the recognition log.

Trained FlexiLayout variants

If the FlexiLayout variant was obtained by training the program on a variety of invoices, it includes all the fields defined in the Document Definition. The Document Definition stores information about the fields whose regions had to be changed by the user during training, that is, the fields that were detected poorly by the generic FlexiLayout. The program uses this information to decide which field regions to take from the generic FlexiLayout and which to take from the FlexiLayout variant trained on this vendor’s invoices.

Amount field regions

The regions of the Amount fields are selected differently. When applying the generic FlexiLayout, the program specifies the level of confidence with which the regions of the Amount fields have been detected. If the regions are detected unreliably, the Total field requires verification. If there is a FlexiLayout variant trained on invoices from the given vendor, and the generic FlexiLayout fails to detect the Amount fields with a sufficient level of confidence or does not detect them at all, the regions of the Amount fields detected by the FlexiLayout variant are used. To always use the regions of the Amount fields detected by the FlexiLayout variant, set the value of the HKEY_CURRENT_USER\Software\ABBYY\FlexiCapture\12.0\DAForms\UseTrainedInvoiceAmounts registry key to true. The key is set to false by default.

Manually created FlexiLayout variants

If the FlexiLayout variant has been created manually, the program uses the regions of all the fields included in the FlexiLayout variant. The regions of the other fields come from matching the generic FlexiLayout.

Example of merged field regions

Consider two standard invoice fields, InvoiceDate and InvoiceNumber, and two user-defined fields, CustomFieldA and CustomFieldB.
  • InvoiceDate and InvoiceNumber are standard fields, and the detection algorithm for these fields is specified in the main FlexiLayout included in the generic FlexiLayout.
  • CustomFieldA and CustomFieldB are user-defined fields, and the detection algorithms for these fields are specified in the additional FlexiLayout included in the generic FlexiLayout.
Suppose the Operator is not satisfied with the quality of detection of the InvoiceDate and CustomFieldB fields on invoices from a specific vendor and trains the program on invoices from this vendor. Each field region then comes from a different FlexiLayout, depending on the vendor.