AI Optical Character Recognition Tool

You are currently viewing the documentation for the latest version (2.2.0). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

Introduction

The "AI Optical Character Recognition Tool" is a deep learning-based visual reading tool that supports custom training for different characters. By completing the wizard-style configuration process, users can quickly implement the full workflow from image acquisition to model inference. This tool is typically used in scenarios that are difficult for traditional algorithms to handle, such as metal engravings, curved surface characters, and complex backgrounds.

This tool has a built-in pre-trained model. After setting the ROI, you can directly perform inference without training from scratch. Users only need to add additional training to optimize the model based on the validation results as needed.

overall workflow
  1. Acquire images: Acquire image data for validating and optimizing the model. It is recommended to cover typical conditions in the actual production environment to ensure image quality and diversity and improve the model’s judgment accuracy.

  2. Set ROI: Set the ROI on the acquired images, supporting rectangle or ring shapes, accurately selecting the character area to lock the core range for subsequent recognition.

  3. Validate and optimize model: Use the acquired images to validate the model recognition performance. You can set character correction, recognition range, judgment conditions, and string concatenation rules according to actual conditions. If the recognition results are inaccurate, you can use the "Additional training" function to supplement images and optimize the model directionally until the performance meets actual requirements.

Usage Workflow

After entering the tool, click the New button in the upper right corner of the model list on the left to create and enter a new model configuration process.

Acquire Images

Acquire image data for validating and optimizing the model.

  1. Confirm that the input port for the current step is connected to the image data.

  2. When entering the tool, the camera will automatically acquire an image for model validation; you can click the Acquire Images button to acquire new image data for model validation.

When acquiring images, it is recommended to cover typical variations in the production site, including:

  • Position and angle differences: Cover images where the target object is translated, rotated, or tilted within the field of view.

  • Lighting and background differences: Cover images with different brightness, shadows, and cluttered or color-changing backgrounds.

  • Appearance and shape differences: Cover images where the workpiece has slight deformation, stains, scratches, or batch color differences.

Diverse images help to more comprehensively validate the model’s effectiveness and improve subsequent optimization efficiency.

Set ROI

After acquiring images, you need to set the ROI to define the character recognition range.

When the "2D Alignment Parameter Group" port has input, the ROI will transform in sync with the target pose. The ROI set here is the reference position, and during actual recognition, it will dynamically shift based on the alignment parameters.

  1. Click the Edit button to enter the ROI setting interface.

  2. Set character size.

    The system will automatically generate an orange default character size rectangle in the visualization area. After selecting it, you can adjust its size by dragging the border. To ensure model inference accuracy, please adjust this box to a size close to the actual character size. Too large or too small will affect recognition performance.

    If the character size region is not displayed in the visualization area, please check whether the "Show character size region" switch is enabled.

  3. Set the ROI. Two methods are available:

    Setting method Description

    Set all as ROI

    The ROI automatically covers the entire image. Suitable for scenarios where the target characters fill the image. To exclude certain areas, you can set mask regions in the next step.

    Custom ROI

    Select the "Rectangle" or "Ring" selection tool to drag and draw the ROI in the visualization area. Please accurately select the target area based on the actual position and shape of the target characters, avoiding irrelevant backgrounds.

    • Rectangle selection: Drag directly to draw a rectangular ROI.

    • Ring selection: Refer to the image below to drag along the circumference to draw a ring ROI. After drawing is complete, you need to set the reading direction of the circular text to clockwise or counterclockwise.

      set circular roi
  4. Set mask region (optional).

    When there are irrelevant interferences such as reflections, shadows, or fixed backgrounds within the target area, you can set mask regions to exclude them, avoiding impact on model training and classification judgment results.

    Click the Set mask region button, and use the "Polygon" selection tool to draw the mask region in the visualization area: click the left mouse button to add polygon vertices, and double-click the right mouse button to close the polygon and complete the selection.

  5. After the setting is completed, click Save and apply to apply the ROI configuration.

When the masks of the character size region, target area, and mask region completely overlap, only the topmost layer supports editing.

Right-click the mouse to quickly perform delete, bring to top, or send to bottom operations on areas.

Validate and Optimize Model

After completing the ROI setting, click the validate button to enter the validation interface.

Set Validation Parameters and Validate Model Performance

You can view or set the following parameters in the validation interface, and observe whether the model’s recognition results meet expectations.

Parameters Description

Validation result

Parameter description: Displays the character recognition result. After enabling judgment, the validation result will be displayed as OK or NG based on the set judgment conditions.

Time

Parameter description: Displays the single inference time (unit: ms).

Confidence threshold

Parameter description: The minimum confidence standard for the model to recognize characters. Recognition results below this value will be judged as recognition failure.
Default value: 0.5
Tuning instructions: It is recommended to use the default value.

Character correction

Parameter description: Used to constrain the types of the first N characters in the recognition result. The number of wildcards entered determines the number of character positions constrained; subsequent characters beyond this length are not affected. When a character at a certain position does not match the constrained type, the model will replace it with the candidate character with the highest confidence of that type. Supported wildcards: ? (any character), $ (letter), % (number), @ (symbol), ! (uppercase letter), & (lowercase letter).

Default value: Off.

Tuning instructions: Suitable for fixed-format character correction, such as scenarios where the first few positions have clear type requirements. It is recommended to fill in wildcards from left to right according to the actual encoding rules, avoiding over-constraining that may cause incorrect replacements.

Tuning example:

It is known that the actual encoding format is "number + uppercase letter + number + ...", but the model recognition result is iR20181102ar06Xd", where the first character was incorrectly recognized as a lowercase letter.

before character correction

In this case, enter "%!%" in the input box (the 1st position is constrained to a number, the 2nd position is constrained to an uppercase letter, the 3rd position is constrained to a number; the 4th position and beyond are not constrained). After re-inference, the first character is corrected to the number with the highest confidence, and the result becomes "1R20181102ar06Xd".

after character correction

Recognition target

Parameter description: Used to specify the character types to be extracted from the recognition results for further processing. Unselected character types will be ignored.
Value list: Uppercase, Lowercase, Numbers, Symbols
Default value: All selected.
Tuning instructions: Select the character types that participate in recognition based on actual character content. Reducing irrelevant character interference can improve the model’s judgment accuracy.

Insert separator

Parameter description: When multiple lines of characters are recognized, this parameter is used to specify the separator to join segments for the final output.
Default value: None.
Tuning instructions: Adjust according to actual requirements.

Enable judgment

Parameter description: Used to validate whether the recognition result meets expectations. Character type, character count, or fixed formats can be specified. Results that do not meet the rules will be judged as NG. Two judgment modes are supported:

  • Validate character count: Set a character count range [minimum, maximum]. Recognition results with a length outside the range will be judged as NG.

  • Validate character content: Compare the recognition result character by character against a reference string. Only characters within the length of the reference string are compared; characters beyond that length are not included in the judgment (considered as passed). Inconsistencies will be judged as NG. Two reference sources are supported:

    • Manual input mode: Manually enter a fixed string or wildcard template as the reference. The wildcard rules are the same as "Character correction".

      For example, entering "%!%", with a recognition result of "iR20181102ar06Xd", the system only compares the first 3 positions: the 1st position "i" is not a number (%), so it is judged as NG. The 4th position and beyond are not included in the judgment.

    • Global variable mode: Obtain the reference string from global variables for comparison. After switching to this mode, the system will list available global variables for selection. Only global variables with the "single result" mode and string (String) data type are supported here. After selection, the current value of this variable is used as the judgment reference. For usage instructions on global variables, refer to Global Variable.

Default value: Off.

Tuning instructions: Used for automatic compliance checking. Use manual input mode for fixed-format validation, and global variable mode for dynamic content validation.

Additional Training and Model Optimization (Optional)

If inaccurate recognition results are found during validation (such as character misrecognition, missed recognition, or background false detection), you can use the "Additional training" function for targeted correction until the model performance meets actual requirements.

Additional training is recommended in the following situations:

  • Character misrecognition: Such as recognizing "A" as "4", or confusing "0" with "O".

  • Character missed recognition: Some characters were not detected.

  • Background misdetection: Non-character areas (such as logos, textures, or reflective spots) are incorrectly recognized as characters.

The specific operation process is as follows:

  1. Click the additional training button on the validation interface to enter the additional training page.

  2. Add additional content based on the problem type:

    Additional content Description Operation

    Recognition content

    Used to correct missed or misrecognized characters. Select the character area that was not correctly recognized on the image, enter the correct character content for that position, and add it as training content.

    1. Click the Add button to draw a rectangle in the visualization area to select the character area.

    2. Enter the correct character, and click a blank area to confirm the addition.

    3. Click Infer next image, and the system will update the model based on the added content and perform inference validation on the newly acquired image. Repeat the above steps until the training content labeling is completed.

    Exclusion content

    Used to eliminate background false detection. Select the area on the image that was incorrectly recognized as characters, and mark it as an exclusion area. The recognition results of this area will be removed.

    1. Click the Add button to drag and draw the exclusion area in the visualization area. Release the mouse to complete the addition.

    2. Click Infer next image, and the system will update the model based on the added content and perform inference validation on the newly acquired image. Repeat the above steps until the exclusion content labeling is completed.

  3. Click the Train button to retrain the model using the additional training content. After training is completed, the system automatically returns to the validation interface, where you can validate the optimized recognition performance.

    Under the current mechanism, characters labeled during additional training are not restricted by the "Character correction" and "Recognition target" validation rules, and may still appear in the recognition results. To avoid conflicts between recognition results and validation rules, it is recommended to only add training content that is consistent with the character correction and recognition target settings.

  4. After validation is passed, click the Save and apply button to save the model configuration.

At this point, the model configuration is completed. After closing the tool window, select the model from the "Model Name" parameter drop-down list to use it for character recognition in subsequent inference Steps.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.