Train a Classification Model

The Classification model can be used to classify different images based on their features. This topic describes how to train a Classification model to distinguish between the front and back sides of the condensers.

classification example

The workflow for training the Classification model is as follows:

classfication workflow

Preparations

Before you start training, make sure you have acquired and selected the images for training according to the data acquisition standard. In this example, you need to prepare the front and back images of the condensers.

Create a Project and Add a Module

  1. Create a project: Open Mech-DLK. In the upper-left corner of the startup interface, click New Project, name the project, and select a directory to save the project.

  2. Add a module: In the upper-right corner of the project interface, click icon create in the Modules section, and then select the Classification module.

Import and Label the Image Data

  1. Create labels: In the Labeling tab, click icon create in the Classes section to create labels. In this example, you need to create the Front and Back labels to classify the front and back sides of the condensers.

    classification label
  2. Import image data:

    1. On the upper part of the image list, click Import/Export  Import Folder, and import the folder of the front side images.

    2. In the pop-up Import and Label Data window, click Existing label, select the label Front, and click Import. All images in the folder will be imported into the project and labeled as Front.

    3. Follow the same steps to import the folder of the back side images and label them as Back.

      classification import
    • If you need a new label for the imported folder, you can click New label in the Import and Label Data window, create a new class, and then click Import.

    • If you do not want to label the images during import, you can click No label in the Import and Label Data window. The images will be imported without labels. You can import all the images and manually label them afterwards.

  3. Split the dataset: After all images are imported and labeled, click images divide icon and drag the slider to split 80% of the images in the dataset into the training set, and the rest 20% into the validation set.

    classification image divide

Train the Model

After the images are imported and labeled, you can start training the model.

In the Training tab, click the Train button to start training. You can click Training Center to view the training progress, or click Show chart to view training accuracy and loss parameters by epochs.

classification train

Validate and Export the Model

After the model is trained, in the Validation tab, click the Validate button, Mech-DLK will validate the model with the current data.

After the validation is complete, check the validation results for accuracy. A Classification model is successfully trained to distinguish between the front and back sides of the condensers.

classification validate

In the lower-right corner of the Validation tab, click Export, and select a directory to save the exported model. The exported model can be used in Mech-Vision and Mech-DLK SDK. Click here to view the details.

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.