Training of Custom Classifiers in MVTec HALCON

Published on October 31, 2019

This post, Training of Custom Classifiers in MVTec HALCON is the sixth in a series of 7 posts from Pushing OCR Performance with MVTec HALCON: 1, 2, 3, 4, 5, 6, 7.

Previous posts covered working with the OCR assistant and the underlying methodology of a text model reader. This post focuses on the classification aspects of optical character recognition and, most importantly, the training of a custom classifier.

In some cases, the pre-trained fonts or symbol sets available in HALCON are unsuitable for the text at hand or do not deliver satisfactory results. Under these circumstances, an option to be considered is training a custom classifier tailored to the application's needs.

<b>Fig. 1:</b> <i>Segmented symbols for training with OCR assistant</i>

HALCON's OCR Assistant provides options for creating so-called training files. Training files contain information about the symbol region's ground truth class as well as information about their width and height.

<b>Fig. 2:</b> OCR assistant

The successful implementation of the segmentation step is crucial to the creation of such a training file (or when adding symbols with their respective class). This means, the image and region containing the symbols have been defined and set with correct segmentation parameters. Please note: Quick Setup can be used to perform these tasks.

After successful segmentation, teaching works as follows: By clicking into the text field (fig. 2, above), the first symbol for labeling is displayed in the image field (right). This process should be repeated with every symbol which needs to be taught, one after the other, by typing the corresponding class name into the text field. If all symbols are labeled with their ground truth class, the information can be added to the training data by clicking the button add to training data.

The number of samples is automatically adapted in the next section and training of the classifier is enabled. The classifier filename and status give some basic information about training success (e.g. the classifier's confidence score if it is applied on the training data set). You can click on Train Now to start the training process.

In the next post, the training of custom classifiers will be the topic as well as the creation of a training file and the usage of the Training File Browser in HDevelop. (Please see navigation at the top of this page for additional posts.)

Please click here to download image.

Share this post with your friends and coworkers:

Post published by TIS Marketing on October 31, 2019.

About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, video converters and embedded vision components for factory automation, quality assurance, medicine, science, security and a variety of other markets.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE, MIPI interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

ISO 9001:2015 certified MVTEC | Edge AI + Vision Alliance | EMVA

Contact us