The following procedure provides a basic methodology for using
the CNNClassIndex step to
classify images with a pretrained CNN.
-
Import a pretrained CNN.
-
Optionally,
modify general classification settings.
-
Run the project to the CNNClassIndex step to ensure
your project works as you expect (for example, you can view
your results).
After adding a CNNClassIndex step, click on
the Import
button in the
Configuration pane, and select the .mclass file to import (for
example, C:\Program
Files\Matrox
Imaging\Images\Classification\Pasta\MatroxNet_PastaEx.mclass).
An .mclass
file is a MIL pretrained CNN context that is built, trained (using
the provided training images), and saved by Matrox. You must import
such a file to use the CNNClassIndex step. The
images (or the specified ROI) that you are classifying with this
step must have the same width, height, and number of color bands as
the images with which the imported CNN was trained.
Note that, depending on your agreement with Matrox, the
pretrained CNN might expire. Once you import an .mclass file, the
Configuration pane will either display the expiry date, or
indicate that there is no expiry date. For more information about
acquiring a pretrained CNN for your classification requirements,
contact customer support.
The result that you will generally be most interested in is the
class to which the image belongs. This is referred to as the best
class.
Each class is given a score. This score is a measure, in
percentage, of how well that class represents the image. The class
with the highest score is the best class. The following example
shows an image and its class results. The best class is
highlighted. Results also include each class' name, index,
thumbnail image, and the time it took to establish the best
class.