eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics Class Reference

Collection of metrics used to evaluate the state of an EUnsupervisedSegmenter. More...

#include <eVision/EasyDeepLearning/EasySegment/EUnsupervisedSegmenterMetrics.h>

Inheritance diagram for eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics:
Collaboration diagram for eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics:

Public Member Functions

 EUnsupervisedSegmenterMetrics ()
 Constructs an EUnsupervisedSegmenterMetrics object.
 EUnsupervisedSegmenterMetrics (const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics &other)
 Copy constructor of an EUnsupervisedSegmenterMetrics object.
virtual ~EUnsupervisedSegmenterMetrics () throw ()
eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & operator= (const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics &other)
 Assignment operator.
bool IsTotallyUnsupervised () const
 Whether this metrics has results from only good images (true) or from both good and defective images (false).
bool IsValid () const
 Indicates whether the object contains at least one result.
virtual void Load (const std::string &path)
 Loads an unsupervised segmentation metric. The given ESerializer must have been created for reading.
virtual void Load (eVision::ESerializer *serializer)
 Loads an unsupervised segmentation metric. The given ESerializer must have been created for reading.
virtual void Save (const std::string &path)
 Saves an unsupervised segmentation metric. The given ESerializer must have been created for writing.
virtual void Save (eVision::ESerializer *serializer)
 Saves an unsupervised segmentation metric. The given ESerializer must have been created for writing.
void AddResult (const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult &result, bool isGoodImage)
 Adds the given result with the corresponding ground truth label to the metrics.
void AddErrorResult (const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult &result)
 Adds the given result to the metric for error computation. The result must be computed from a good image that was corrupted during training.
void RemoveResult (const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult &result, bool isGoodImage)
 Removes the given result with the corresponding ground truth label to the metrics.
void RemoveErrorResult (const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult &result)
 Removes the given result from the metric for error computation. The result must be computed from a good image that was corrupted during training.
void AddMetrics (const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics &other)
 Adds the other metrics to the current metrics of this object.
float GetBestWeightedAccuracy (float goodWeight, float badWeight) const
 Best achievable weighted accuracy.
float GetBestWeightedAccuracy (const eVision::EasyDeepLearning::EDataset &dataset) const
 Best achievable weighted accuracy.
float GetBestWeightedAccuracyClassificationThreshold (float goodWeight, float badWeight) const
 Classification threshold giving the best achievable weighted accuracy (see EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy).
float GetBestWeightedAccuracyClassificationThreshold (const eVision::EasyDeepLearning::EDataset &dataset) const
 Classification threshold giving the best achievable weighted accuracy (see EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy).
float GetError () const
 The error of the segmenter.
float GetAverageScoreOnGoodImages () const
 Gets the average score of good images.
float GetAverageScoreOnDefectiveImages () const
 Gets the average score of defective images.
 EUnsupervisedSegmenterMetrics (CppWrapperInternal::InternalConstructor)
Public Member Functions inherited from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics
 EDeepLearningDefectDetectionMetrics ()
 Constructs an empty EDeepLearningDefectDetectionMetrics object.
 EDeepLearningDefectDetectionMetrics (const eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics &other)
 Copy constructor.
virtual ~EDeepLearningDefectDetectionMetrics () throw ()
eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics & operator= (const eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics &other)
 Copy operator.
bool IsDefectDetectionMetricsValid () const
 Whether the defect detection metrics are valid or not. Defect detection metrics are completely valid when the metrics has results for at least one good and one defective images. Some metrics might be valid with only defective or good results.
int GetNumDefectiveSample () const
 Number of defective sample added to the metric.
int GetNumGoodSample () const
 Number of good sample added to the metric.
float GetAccuracy (int index) const
 The accuracy of the segmenter.
float GetAccuracy () const
 The accuracy of the segmenter.
float GetBestAccuracy () const
 Best achievable accuracy.
float GetBestBalancedAccuracy () const
 Best achievable balanced accuracy.
float GetBestWeightedAccuracy (float goodWeight, float badWeight) const
 Best achievable weighted accuracy.
float GetBestAccuracyClassificationThreshold () const
 Classification threshold giving the best achievable accuracy (see EDeepLearningDefectDetectionMetrics::GetBestAccuracy).
float GetBestBalancedAccuracyClassificationThreshold () const
 Classification threshold giving the best achievable balanced accuracy (see EDeepLearningDefectDetectionMetrics::GetBestBalancedAccuracy).
float GetBestWeightedAccuracyClassificationThreshold (float goodWeight, float badWeight) const
 Classification threshold giving the best achievable weighted accuracy (see EDeepLearningDefectDetectionMetrics::GetBestWeightedAccuracy).
uint32_t GetConfusion (eVision::EasyDeepLearning::EConfusionMatrixElement element, int index) const
 Confusion value of one label with another.
uint32_t GetConfusion (eVision::EasyDeepLearning::EConfusionMatrixElement element) const
 Confusion value of one label with another.
float GetAreaUnderROCCurve () const
 The area under ROC curve (AUC) of the classifier (see EDeepLearningDefectDetectionMetrics::GetROCPoint). It's value is between 0 and 1.
float GetAveragePrecision () const
 Average precision.
float GetBestFScore () const
 Best F1-Score.
float GetBestFScoreThreshold () const
 Classification threshold that yields the best F1-Score.
float GetRecall (int index) const
 Recall for the current threshold.
float GetRecall () const
 Recall for the current threshold.
float GetPrecision (int index) const
 Precision for the current threshold.
float GetPrecision () const
 Precision for the current threshold.
float GetFScore (int index) const
 The F1-Score for the current threshold.
float GetFScore () const
 The F1-Score for the current threshold.
int GetPrecisionRecallCurveIndex () const
 Index in the precision/recall curve for the current EDeepLearningDefectDetectionMetrics::GetClassificationThreshold.
int GetNumPrecisionRecallCurvePoint () const
 Number of point in the precision/recall curve.
eVision::EasyDeepLearning::EROCPoint GetPrecisionRecallCurvePoint (int index) const
 Get a point on the precision/recall curve.
eVision::EasyDeepLearning::EROCPoint GetPrecisionRecallCurvePoint () const
 Get a point on the precision/recall curve.
int GetNumberOfClassifiers () const
 Number of different possible classifiers.
eVision::EasyDeepLearning::EROCPoint GetROCPoint (int index) const
 ROC (Receiver Operating Characteristic) point.
eVision::EasyDeepLearning::EROCPoint GetROCPoint () const
 ROC (Receiver Operating Characteristic) point.
float GetClassificationThreshold () const
 Classification threshold.
void SetClassificationThreshold (float threshold)
 Classification threshold.
 EDeepLearningDefectDetectionMetrics (CppWrapperInternal::InternalConstructor)

Additional Inherited Members

Public Attributes inherited from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics
CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Collection of metrics used to evaluate the state of an EUnsupervisedSegmenter.

A metric is a value summarizing the quality of a collection of unsupervised segmentation results (see EUnsupervisedSegmenterResult) with respect to their ground truth. New results can be added to the object individually with EUnsupervisedSegmenterMetrics::AddResult or collectively with EUnsupervisedSegmenterMetrics::AddMetrics.

EUnsupervisedSegmenterMetrics contains two types of metrics: unsupervised metrics that are computed only on good images and supervised/defect detection metrics that are computed on both good and bad images. The defect detection metrics are accessible only when results for bad images were added to the object. When supervised metrics are accessible, EUnsupervisedSegmenterMetrics::IsTotallyUnsupervised is false.

There is only one unsupervised metric: the error (see EUnsupervisedSegmenterMetrics::GetError). See EDeepLearningDefectDetectionMetrics for a description of the defect detection metrics.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ EUnsupervisedSegmenterMetrics() [1/3]

eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::EUnsupervisedSegmenterMetrics ( )

Constructs an EUnsupervisedSegmenterMetrics object.

◆ EUnsupervisedSegmenterMetrics() [2/3]

eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::EUnsupervisedSegmenterMetrics ( const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & other)

Copy constructor of an EUnsupervisedSegmenterMetrics object.

Parameters
otherReference to the EUnsupervisedSegmenterMetrics object that should be copied

◆ ~EUnsupervisedSegmenterMetrics()

eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::~EUnsupervisedSegmenterMetrics ( )
throw ( )
virtual

◆ EUnsupervisedSegmenterMetrics() [3/3]

eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::EUnsupervisedSegmenterMetrics ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ AddErrorResult()

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::AddErrorResult ( const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult & result)

Adds the given result to the metric for error computation. The result must be computed from a good image that was corrupted during training.

Parameters
resultA reference to an EUnsupervisedSegmenterResult object.

◆ AddMetrics()

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::AddMetrics ( const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & other)

Adds the other metrics to the current metrics of this object.

Parameters
otherUnsupervised segmenter metrics

◆ AddResult()

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::AddResult ( const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult & result,
bool isGoodImage )

Adds the given result with the corresponding ground truth label to the metrics.

Parameters
resultA reference to an EUnsupervisedSegmenterResult object.
isGoodImageTrue if the ground truth of this result is good, else false.

◆ GetAverageScoreOnDefectiveImages()

float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetAverageScoreOnDefectiveImages ( ) const

Gets the average score of defective images.

◆ GetAverageScoreOnGoodImages()

float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetAverageScoreOnGoodImages ( ) const

Gets the average score of good images.

◆ GetBestWeightedAccuracy() [1/2]

float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy ( const eVision::EasyDeepLearning::EDataset & dataset) const

Best achievable weighted accuracy.

The weighted accuracy is the weighted average of the true positive rate and the true negative rate (which is equal to 1 minus the false positive rate). See EROCPoint.

The classification threshold corresponding to this accuracy is given by EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracyClassificationThreshold.

Parameters
datasetDataset to get the label weight from.

When using a dataset as the source for the label weights, the good weight is the weight of the "good" label and the bad weight is the sum of the weights of all the other labels.

◆ GetBestWeightedAccuracy() [2/2]

float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy ( float goodWeight,
float badWeight ) const

Best achievable weighted accuracy.

The weighted accuracy is the weighted average of the true positive rate and the true negative rate (which is equal to 1 minus the false positive rate). See EROCPoint.

The classification threshold corresponding to this accuracy is given by EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracyClassificationThreshold.

Parameters
goodWeightweight of the good label.
badWeightweight of the bad label.

When using a dataset as the source for the label weights, the good weight is the weight of the "good" label and the bad weight is the sum of the weights of all the other labels.

◆ GetBestWeightedAccuracyClassificationThreshold() [1/2]

float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracyClassificationThreshold ( const eVision::EasyDeepLearning::EDataset & dataset) const

Classification threshold giving the best achievable weighted accuracy (see EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy).

Parameters
datasetDataset to get the label weight from.

◆ GetBestWeightedAccuracyClassificationThreshold() [2/2]

float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracyClassificationThreshold ( float goodWeight,
float badWeight ) const

Classification threshold giving the best achievable weighted accuracy (see EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy).

Parameters
goodWeightWeight for the good label
badWeightWeight for the bad label

◆ GetError()

float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetError ( ) const

The error of the segmenter.

This metric is only available in the metrics computed during a training which are accessible through EUnsupervisedSegmenter::GetValidationMetrics.

The error, which is also called the loss, is the quantity that is minimized during the training of the deep neural network.

◆ IsTotallyUnsupervised()

bool eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::IsTotallyUnsupervised ( ) const

Whether this metrics has results from only good images (true) or from both good and defective images (false).

Some metrics are accessible only if EUnsupervisedSegmenterMetrics::IsTotallyUnsupervised is false.

◆ IsValid()

bool eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::IsValid ( ) const

Indicates whether the object contains at least one result.

◆ Load() [1/2]

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::Load ( const std::string & path)
virtual

Loads an unsupervised segmentation metric. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.

◆ Load() [2/2]

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::Load ( eVision::ESerializer * serializer)
virtual

Loads an unsupervised segmentation metric. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.

◆ operator=()

eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::operator= ( const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & other)

Assignment operator.

Parameters
otherReference to the EUnsupervisedSegmenterMetrics object used for the assignment

◆ RemoveErrorResult()

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::RemoveErrorResult ( const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult & result)

Removes the given result from the metric for error computation. The result must be computed from a good image that was corrupted during training.

Parameters
resultA reference to an EUnsupervisedSegmenterResult object.

◆ RemoveResult()

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::RemoveResult ( const eVision::EasyDeepLearning::EUnsupervisedSegmenterResult & result,
bool isGoodImage )

Removes the given result with the corresponding ground truth label to the metrics.

Parameters
resultA reference to an EUnsupervisedSegmenterResult object.
isGoodImageTrue if the ground truth of this result is good, else false.

◆ Save() [1/2]

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::Save ( const std::string & path)
virtual

Saves an unsupervised segmentation metric. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.

◆ Save() [2/2]

void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::Save ( eVision::ESerializer * serializer)
virtual

Saves an unsupervised segmentation metric. The given ESerializer must have been created for writing.

Parameters
serializerThe serializer.

Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.