Help Center> Huawei HiLens> SDK Reference> Hard Example Upload> Introduction to Hard Example Upload
Updated on 2023-06-15 GMT+08:00

Introduction to Hard Example Upload

The 1.1.2 version supports hard example mining algorithms for edge AI. If you want to use the hard example upload API, upgrade the firmware version to 1.1.2. For details about how to upgrade the firmware, see Upgrading HiLens_Device_Agent Firmware.

The following hard example mining algorithms are supported:

  • Image classification

    CrossEntropyFilter(threshold_cross_entropy)

    Principle: Determine whether the entropy is less than the cross entropy of the inference result. If the entropy is less than the cross entropy, the sample is a hard example.

    Input: prediction classes list, for example, [class1-score, class2-score, class2-score,....], where class-score indicates the class score ranging from 0 to 1.

    Output: True or False. True indicates that the image is a hard example, and False indicates the image is not a hard example.

  • Object detection

    IBT (image-box-thresholds)

    Principle: box_threshold calculates the hard example coefficient (the confidence score less than the threshold to the total number of output inference boxes). img_threshold determines whether an image is a hard example.

    Input: prediction boxes list, for example, [bbox1, bbox2, bbox3,....], where bbox = [xmin, ymin, xmax, ymax, score, label], x, and y indicate the coordinates of the bounding box, score indicates the confidence score ranging from 0 to 1, and label indicates the class label.

    Output: True or False. True indicates that the image is a hard example, and False indicates the image is not a hard example.

    CSF(confidence score filter)

    Principle: box_threshold_low and box_threshold_up determine whether an image is a hard example. As long as the confidence score of an output box is within the range specified by [box_threshold_low, box_threshold_up], the image is a hard example.

    Input: prediction boxes list, for example, [bbox1, bbox2, bbox3,....], where bbox = [xmin, ymin, xmax, ymax, score, label], x, and y indicate the coordinates of the bounding box, score indicates the confidence score ranging from 0 to 1, and label indicates the class label.

    Output: True or False. True indicates that the image is a hard example, and False indicates the image is not a hard example.