Mech-DLK Quick Start

  • This section shows how to train and export an example model that can be used for defect detection and defect classification.

  • You can use a Semantic Segmentation module cascaded with a Classification module in Mech-DLK to make a final trained model.

  • Before using Mech-DLK, please ensure that Deep Learning Environment and Mech-DLK are both installed successfully.

  1. Create a new project

    Open Mech-DLK, click on New Project to create a new project, as shown in Figure 1.

    ../../_images/new_project.png

    Figure 1. New project

  2. Name and save the project

    Name the project, select a folder to save the project, and add descriptions if necessary. Then click on OK to finish setting, as shown below.

    ../../_images/project_settings.png

    Figure 2. Project settings

  3. Select a module

    Add a module: Click on icon1 on the right side of the panel Modules, and then select Semantic Segmentation. Click on OK to finish setting.

    ../../_images/module_selection.png

    Figure 3. Add module

  4. Import data

    Click icon2 in the upper left corner to import local images.

    ../../_images/dataset.png

    Figure 4. Import data

    Attention

    Images imported into the Semantic Segmentation module must include defect-free images, which should also be included in both the validation set and the training set, or else an alert will be displayed and the training cannot continue.

  1. Labeling

    The Semantic Segmentation algorithm will have an automatically generated Defect label. You can use the tools icon3, icon4, and icon5 on the left to label the images.

    ../../_images/defect_image.png

    Figure 5. Labeling in Semantic Segmentation

  2. Train the model

    Click on Train in the lower right corner to start training. Click on Show chart to check the accuracy and loss during the training.

    ../../_images/training_chart.png

    Figure 6. Learning curves in the chart

  3. Validate the model

    After training the Semantic Segmentation model, click on Validate to validate the results. A training result will be saved after the validation.

    ../../_images/result_verification.png

    Figure 7. Validation

  4. Add another module

    After confirming that the model training is completed and satisfactory, click on icon1 in the upper right corner to add the Classification module.

    ../../_images/add_algorithm.png

    Figure 8. Add another module

  5. Import the data to the Classification module

    The training result of the previous model will be imported as the source data to the Classification module. Click on icon2 to display all selectable images, and then manually select the images needed for training/validation of classification.

    ../../_images/data_source.png

    Figure 9. Import source data

  6. Label images of different classes

    Before labeling images of different classes, you need to click on icon6 in the lower left part of the panel Classes to create different labels for different classes. After creating the labels, you can label the images by clicking on icon7 or icon8.

    ../../_images/label.png

    Figure 10. Classification and labeling

  7. Train the model

    Click on Train in the lower right corner to start training. Click on Show chart to check the accuracy and loss of the training.

  8. Export the final model

    After the training of the model is completed, click on Export to export the trained model. You can select a folder to save the final model, and the model file is as shown below.

    ../../_images/model_files1.png

    Figure 11. Model file