AI Classification (Multi-Class) Tool

You are currently viewing the documentation for the latest version (2.2.2). To access a different version, click the "Switch version" button located in the upper-right corner of the page.

■ If you are not sure which version of the product you are currently using, please feel free to contact Mech-Mind Technical Support.

Introduction

The "AI Classification (Multi-Class) Tool" is a deep learning-based visual classification tool that supports custom labeling, training, and inference for up to 8 classes. By completing the wizard-style configuration process, users can quickly implement the full workflow from image acquisition to deep learning inference. This tool is typically used in scenarios such as identifying mixed specifications of a single product type or grading its visual defects.

rotate-image-workflow
  1. Acquire images: Acquire image data for training. It is recommended to cover typical conditions in the actual production environment to ensure image quality and diversity and improve deep learning inference accuracy.

  2. Set ROI: Select the image area to be detected or recognized in the acquired images. This reduces the impact of irrelevant areas on inference results and prepares the images for labeling.

  3. Label images: Assign a class to the image in the target region. Up to 8 classes can be defined. The tool updates the model based on the labels and outputs inference results.

  4. Model validation and optimization: Validate the model’s inference performance using acquired images, and set inference rules or add labeled images as needed.

Usage Workflow

After entering the tool, click New in the upper-right corner of the model list on the left to create and enter a new model configuration process.

Acquire Images

Acquire image data for training the model.

  1. Confirm that the input port of the current Step is connected to image data.

  2. When you enter the tool, the camera automatically acquires an image for model training. Click Single Capture to acquire another image.

When acquiring images, it is recommended to cover typical variations at the production site, including:

  • Position and angle differences: Cover images where the target object is translated, rotated, or tilted within the field of view.

  • Lighting and background differences: Cover images with different brightness, shadows, and cluttered or color-changing backgrounds.

  • Appearance and shape differences: Cover images where the target object has slight deformation, stains, scratches, or batch color differences.

Diverse images help the model adapt to the actual environment and improve inference accuracy.

Set ROI

After acquiring images, select the image area to be detected or recognized. This reduces the impact of irrelevant areas on inference results and prepares the images for labeling.

When the "Object Pose" port has input, the ROI will transform in sync with the target pose. The ROI set here is the reference position, and during actual recognition, it will dynamically shift based on the alignment parameters.

  1. Click the Edit button to enter the ROI setting interface.

  2. Set the ROI. Two methods are available:

    Setting method Description

    Set all as ROI

    The ROI automatically covers the entire image. Suitable for scenarios where the target object fills the image. To exclude certain areas, you can set mask regions in the next step.

    Custom ROI

    Select the "Rectangle" or "Circle" selection tool to drag and draw the ROI in the visualization area. Only a single ROI can be set here. Please accurately select the target area based on the actual position and shape of the target object, avoiding irrelevant backgrounds.

    When selecting the target area, you can select only the area containing key features.

  3. Set mask region (optional).

    When there are irrelevant interferences such as reflections, shadows, or fixed backgrounds within the target area, you can set mask regions to exclude them, avoiding impact on model training and classification judgment results.

    Click the Set mask region button, and use the "Polygon" selection tool to draw the mask region in the visualization area: click the left mouse button to add polygon vertices, then click the right mouse button to close the polygon and complete the selection.

  4. Save the ROI settings.

    After setting the ROI, click Save and apply to apply the settings.

When the masks of the target area and mask region completely overlap, only the topmost layer supports editing.

Label Images

After setting the ROI, assign a class to each image in the target region. The tool updates the model based on the labels and outputs inference results after image acquisition or labeling.

  1. According to actual requirements, create multiple classes in the label class list (up to 8 supported), and name each class for differentiation.

  2. In the visualization area, select the target ROI, and in the label class options on the right, click the Label images button for the corresponding class to complete labeling of a single target.

    Each class supports labeling up to 30 images.

    Each time you click Label images, the tool updates the model based on the current labels and performs inference on the current image. You can check whether the inference result meets expectations above the parameter configuration area.

  3. Acquire new images and continue labeling.

    Click Single Capture and Inference to acquire a new image. Each time you click this button, the tool acquires one image and performs inference on it using the current model.

    Based on the inference result, select the target region and click Label images for the corresponding class. Continue until at least one image has been labeled for each class.

    • When labeling, it is recommended to label as many images as possible for each class covering different shooting conditions (such as position offset, stains, scratches, deformation, color tone, or background differences). The more thorough the labeling, the stronger the model’s adaptability.

      samples
    • Avoid labeling images with ambiguous classes to prevent affecting the model’s learning performance.

    • If there is uncertainty in lighting or target object angles in the actual production scenario, you can enable the “Adapt to brightness changes” or “Adapt to rotation changes” options in Advanced settings. The system will automatically apply slight rotation and brightness adjustments to the labeled images to generate more virtual images under different conditions for model training, thereby helping to expand training content and improve the model’s generalization ability.

Model Validation and Optimization

After completing the labeling steps above, validate the model using inference images. Set inference rules or add labeled images as needed.

  1. View inference results.

    After labeling images, click Single Capture and Inference to view the inference results from the current model and check whether they meet expectations.

  2. Set inference rules (optional).

    If the inference results are generally correct but the judgment rules do not meet actual needs, adjust the criteria by setting inference rules to improve the accuracy and applicability of the results.

    After you change the inference rules, the tool updates the model based on the current rules and performs inference on the current image. You can view the result above the parameter configuration area.

    Parameter Description

    Validation result

    Parameter description: Displays the classification judgment result. The result is displayed as a custom class or unknown class based on the recognition result.

    Confidence

    Parameter description: Displays the model’s confidence for the current classification result. The higher the value, the more confident the model is that the image belongs to the judged class.

    Time

    Parameter description: Displays the single inference time (unit: ms).

    Confidence threshold

    Parameter description: The minimum confidence threshold for classifying an image. Classification results below this threshold are classified as unknown.
    Default value: 0.5
    Tuning instructions: It is recommended to use the default value.

    Heatmap

    Parameter description: When enabled, a visual heatmap of the model’s attention areas is overlaid on the image. The deeper (or warmer) the color, the higher the model’s attention to the features in that area.

    Default value: Off.

    Tuning instructions: Typically, the heatmap should be concentrated on feature positions within the target area, such as edges, defects, or textures. It can be used to help judge the model’s focus areas.

    If the heatmap distribution is too scattered or concentrated on irrelevant areas, the model may not have learned effective features correctly. In this case, return to the previous steps and add more diverse images to update the model.

  3. Add more labeled images (optional).

    If the inference results still do not meet expectations or the model does not cover certain typical cases, continue acquiring and labeling images. The tool updates the model based on the new labels.

    Prioritize adding labels for images that were incorrectly inferred, have low confidence, or show cases not yet covered. Repeat image acquisition, labeling, and inference until the results meet expectations.

    If adding labeled images does not improve inference results, import the acquired images into Mech-DLK and train the model there to obtain a better model.

At this point, the model configuration is complete. After closing the tool window, select the model from the "Model Name" parameter drop-down list to use it for classification in subsequent inference Steps.

Is this page helpful?

You can give a feedback in any of the following ways:

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.