Welcome to our Support Center

MeanIoU

Description

Computes the mean Intersection-Over-Union metric. Type : polymorphic.

 

 

Input parameters

 

Β y_pred : array,Β predicted values.
Β y_true : array,Β true values.

parameters : cluster,

sparse_y_true : boolean, whether labels are encoded using integers or one hot logits. If True labels are integers and if False, labels are one hot logits and the argmax function will be used to determine each sample’s most likely associated label according to β€œaxis” parameters.
sparse_y_pred : boolean, whether predictions are encoded using integers or one hot logits. If True predictions are integers and if False, predictions are one hot logits and the argmax function will be used to determine each sample’s most likely associated label according to β€œaxis” parameters.
Β axis :Β integer, the dimension containing the logits.

Output parameters

 

mean_iou : float, result.

Use cases

Mean Intersection over Union (Mean IoU) is a metric often used in computer vision, more specifically in image segmentation problems.

Intersection over Union” (IoU) is a metric that evaluates the accuracy of an object detected by a model in relation to the ground truth. It calculates the size of the intersection of the two sets (the area of the object detected by the model and the actual area of the object) and divides it by the size of their union.

The “Mean IoU”, as the name suggests, is simply the average of these IoU measurements for all objects in an image or set of images.

Here are some specific areas where Mean IoU is commonly used :

    • Object detection : in object detection problems, where the aim is to find where one or more specific objects are in an image, Mean IoU can be used to assess the accuracy of model detections.
    • Image segmentation : in image segmentation problems, where the aim is to classify each pixel in an image as belonging to a certain object or background, Mean IoU is a commonly used metric for assessing the accuracy of segmentation.
    • Object tracking : in object tracking problems, where the aim is to track the position of an object through a series of images or a video, Mean IoU can be used to assess tracking accuracy.

Mean IoU is a useful metric because it takes into account both false positives (when the model detects an object that isn’t there) and false negatives (when the model doesn’t detect an object that is), and it gives an idea of the spatial accuracy of detection or segmentation. However, it can be sensitive to object size, giving greater weight to large objects than to small ones.

Calculation

This metric first computes IoUs for all individual classes, then returns the mean of these values.

 

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install HAIBAL library to run it).

Easy to use with one_hot

Easy to use with sparse

Table of Contents