Use the Defect Segmentation Module

Please click here to download an image dataset of network ports. 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 network ports.

  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_module1.png
  2. Import the image dataset of network ports: Unzip the downloaded dataset file. Click on the Import button in the upper left corner, select Folder, and import the image dataset. The pins in the images can be deformed, fractured, or intact.

    ../../../_images/import_images2.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/roi.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 network ports meet quality requirements and NG means that there are defects such as deformations and fractures on the network ports.

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

    For NG images, Right-click on the Polygon Tool and select a suitable tool to select the defect region. 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_data1.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_ok1.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_chart2.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 function Set Defect Judgment Rules to adjust the criteria for evaluating defects.

    ../../../_images/result_verification2.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_files1.png