Issue creating Minos classifier with invariants in TeachBench

Hello All

I’ve been using Teach Bench to create a classifier in a mono image. This went fine. However, I then added some invariants, 5 degrees of rotation either way, no scaling. Now when I try to create a classifier, It will start the process, it will get to 100% and say it failed. There didn’t seem to be any specific error it mentioned, just “Minos Classifier generation failed.”

I thought it might be memory related so I closed everything else I had open and tried again but saw the same error. I’ve also closed and reopened TeachBench but that did not fix it.

Any ideas on how to resolve this?

I’ve just tried what you explained and it worked just fine, with or without creation of new models.

Are you using the most recent CVB release? I’ve tested it with CVB 13.00 64bit on Win7.

What resolution have your images?

CVB 13.0.0 64 bit on Windows 10, 750x550 Mono8 images.

Where is your instance located within the original image? If it’s too close to the edge of the image, it can lead to issues. Depending on the image content and the chosen invariance, the algorithm will try to extract features from outside the image what might lead to an error.

Of all my images, this is the closest they come to the edge of the image. If it’s at all important, I did rotate some of my images (such as this one), before adding them to the image pool.

I see. Well, at this point, it would be helpful for us to have a look at the MTS. Can you send it with a short description of the issue to support@stemmer-imaging.de?

Thank you for providing the training set.

The problem seems to be rooted in the appearance of thecharacters. Even in the basic training set, without additional invariances, the characters will be hard to separate for Minos. For many characters the dots that make up the font are not always in the same place and the characters generally appear deformed on many occasions. This can easily lead to ambiguity.

With the added invariances, this leads to a scenario where Minos is not able to create a classifier where the classes can be clearly distinguished. In such a case the classifier creation fails. Sadly, this scenario can not be identified conclusively; The user cannot be notified about what exactly went wrong. :disappointed:

I suggest using Polimago for this application since it is more capable to work with objects that are that varied.

@Frank is right, the training data at hand is not a good use case for Minos. Minos, after all, like ShapeFinder and many other pattern recognition tools, tries to build a feature-based description of the object(s) the classifier is supposed to be able to identify. For Minos, the basic features from which a model is constructed are contrast-based geometrical descriptions of dark/bright regions in an object. This means, that in order to build a suitable feature description for a given model - suitable in this context meaning that the feature description matches each and every instance that has been trained for this model - it’ll be necessary to find features that match every instance of a model.

This task, as you can imagine, is made horribly difficult by geometric variations (which is incidentally the reason why Minos is not without some additional tricks capable of working scale and/or rotation invariant) and even more so by an unpredictable constellation of features. The latter is usually the case when looking at characters generated by cheap industrial ink jet printers like the ones in your training set.

Consider for example the following specimens of the model for 6:

All these images have been added to the same model - yet finding features that are common to all of these four images is nearly impossible (and effectively what Minos will find on these is descriptive for noise and background rather than the object you’re looking at in this case). This alone might already give rise to the behavior you’re seeing (the defined, albeit somewhat poorly described interruption of the training process).

To further complicate things, your training set contains a fairly large number of models (most of which exhibit to some extent the problem pointed out on model 6), which adds to the problem in that it’ll now not only be difficult to find feature sets common to all instances of a given model, but also features that will not introduce ambiguities between different models.

The two factors together - the poorly reproducible feature configuration inside the trained models plus the large number of models to be distinguished - bring up the behavior you are seeing: The interruption of the learning process. Unfortunately, the underlying function LearnCLFFromMTS only returns a boolean value, which makes it hard for the TeachBench to give further diagnostic information. On the other hand, luckily there are only two cases I know of when the classifier generation fails:

  1. If Minos tries to reach outside the images for feature extraction (this can happen when making too generous use of the invariants generation feature while having at least one instance lying close to the edge of the image - therefore @Frank’s questions…).
  2. In a situation where the generation of a suitable and unambiguous set of features is not possible.

Luckily both of them don’t occur too often :wink:

The bad news for you is that it’s - at least to my opinion - not possible to successfully generate a worthwhile classifier for your use case with Minos. I have made good experience with Manto on cases like this, and its successor Polimago will most likely perform equally well if not better (but it’ll also require a significant number of training images (but the 948 instances that you have already trained are no trifle either…). Should you already have purchased Minos at this point then please contact your sales channel so that we can work out a solution for you.