Start Using the “Defect Segmentation” Module

Please click here to download an image dataset of connectors. In this section, we will use a Defect Segmentation module and train a model to detect the defects such as deformations and fractures on the connectors.

  1. Create a new project and add the defect segmentation module

    Click on New Project in the interface, name the project, and select a directory to save the project. Click on icon_create in the upper right corner of the Modules panel and add the Defect Segmentation module.

    ../../../_images/add_new_module2.png
  2. Import the image dataset of connectors

    Decompress the downloaded dataset file. Click on the Import button in the upper left corner, select Folder, and import the image dataset. The connector pins in the images can be deformed, fractured, or intact.

    ../../../_images/import_images3.png
  3. Select an ROI

    Click on the ROI Tool button icon_roi and adjust the frame to select the pins in the image as an ROI, and click on Apply to save the settings. Setting the ROI can avoid interferences from the background and reduce processing time.

    ../../../_images/roi1.png
  4. Label images

    In this section, you will need to label the OK images and NG images in each dataset. OK means that the connectors meet quality requirements and NG means that there are defects such as deformations and fractures on the connectors.

    ../../../_images/ok_defect_features1.png

    For NG images, Right-click on the Polygon Tool and select a proper tool to select the defect area. Please select the defect as precisely as possible with the tools, and avoid including irrelevant regions.

    Hint

    The quality of labeling is the most important factor affecting the performance of the model. Please refer to Ensure Labeling Quality for detailed instructions on image labeling.

    ../../../_images/label_data2.png

    For OK images that do not contain any defect, select the image and then right-click and select Set to OK in the context menu.

    ../../../_images/label_ok2.png
  5. Split the dataset into the training set and validation set

    Please make sure that both the training set and validation set include images with all types of defects, which will guarantee that the algorithm can learn all different types of defects and validate the images with different defects properly. If the default training set and validation set cannot meet this requirement, please right-click the individual image and switch it to the training/validation set manually.

    ../../../_images/move_image1.png
  6. Train the model

    Keep the default training parameter settings and click on Train to start training the model.

    ../../../_images/training_chart3.png
  7. Validate the model

    After the training is completed, click on Validate to validate the model and check the results. You can also use the Set Defect Judgment Rules to adjust the criteria for evaluating defects.

    ../../../_images/result_verification3.png
  8. Export the model

    Click on Export and select a directory to save the exported model. You can deploy the model according to actual needs.

    ../../../_images/model_files2.png