MVTec Software GmbH
 

Best Practice for Classification and OCR

View all samples of your classes

A recommended practice for setting up classification tasks and OCR: Regularly review your growing set of training data with the HDevelop OCR Training File Browser – while developing the segmentation part, but also at further development steps. It is quick and convenient. Although it does not solve the classification task itself, it helps with almost no extra effort to avoid segmentation mistakes and others. In addition, it also points out possible classification issues.

You are setting up a classification or an OCR solution. Not to mention, you have potentially laboriously collected and labeled sample images. If only a few samples are labeled wrongly or segmented badly, your classification result might already be skewed. To prevent this, make use of the HDevelop OCR Training File Browser:

  • Get an overview of your data with a few clicks within the training file browser: Have you got the right samples and enough of them? Have you got a balanced class distribution?
  • Review your data more in-depth and correct it:

    • Instantaneously spot labeling mistakes and drag&drop the wrongly labeled samples to their correct class.
    • Spot bad samples and remove them.
    • Spot segmentation mistakes and correspondingly improve your segmentation code

  • Boost your training data with the generation of sample variation data.
  • By looking at the classification confidences (a field within the Sample Inspection Window), instantaneously spot rough weaknesses of the classifier. Also, exclude (rare) cases like when the training for the classifier has run into a wrong minimum, etc.

 

When to use the training file browser?

After each and every code change of the segmentation, after a manual segmentation, after any setting and adjustment of the classification parameters, etc.

 

What does it take?

Simply write each image and segmented region to a training file, open the OCR assistant (Visualization ⇒ Tools ⇒ OCR Training File Browser) and load the training file and the classifier, as soon as there is one.

write_ocr(regions, image, ClassName, TraininingFileName) // at the first occurrence
append_ocr_file(regions, image, TrainingFileName) // afterwards 

What are the limitations?

  • Not applicable for COLOR classifications
  • Only suitable for datasets of moderate size (<1.000 samples)

You can find more information about this tool in the HDevelop User's Guide, chapter 6.17 OCR Training File Browser.