Collection of metrics used to evaluate the state of an EUnsupervisedSegmenter. More...
#include <eVision/EasyDeepLearning/EasySegment/EUnsupervisedSegmenterMetrics.h>
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_ |
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
| eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::EUnsupervisedSegmenterMetrics | ( | ) |
Constructs an EUnsupervisedSegmenterMetrics object.
| eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::EUnsupervisedSegmenterMetrics | ( | const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & | other | ) |
Copy constructor of an EUnsupervisedSegmenterMetrics object.
| other | Reference to the EUnsupervisedSegmenterMetrics object that should be copied |
|
virtual | ||||||||||||
| eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::EUnsupervisedSegmenterMetrics | ( | CppWrapperInternal::InternalConstructor | ) |
| 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.
| result | A reference to an EUnsupervisedSegmenterResult object. |
| void eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::AddMetrics | ( | const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & | other | ) |
Adds the other metrics to the current metrics of this object.
| other | Unsupervised segmenter metrics |
| 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.
| result | A reference to an EUnsupervisedSegmenterResult object. |
| isGoodImage | True if the ground truth of this result is good, else false. |
| float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetAverageScoreOnDefectiveImages | ( | ) | const |
Gets the average score of defective images.
| float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetAverageScoreOnGoodImages | ( | ) | const |
Gets the average score of good images.
| 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.
| dataset | Dataset 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.
| 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.
| goodWeight | weight of the good label. |
| badWeight | weight 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.
| float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracyClassificationThreshold | ( | const eVision::EasyDeepLearning::EDataset & | dataset | ) | const |
Classification threshold giving the best achievable weighted accuracy (see EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy).
| dataset | Dataset to get the label weight from. |
| float eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracyClassificationThreshold | ( | float | goodWeight, |
| float | badWeight ) const |
Classification threshold giving the best achievable weighted accuracy (see EUnsupervisedSegmenterMetrics::GetBestWeightedAccuracy).
| goodWeight | Weight for the good label |
| badWeight | Weight for the bad label |
| 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.
| 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.
| bool eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::IsValid | ( | ) | const |
Indicates whether the object contains at least one result.
|
virtual |
Loads an unsupervised segmentation metric. The given ESerializer must have been created for reading.
| path | The file path. |
Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.
|
virtual |
Loads an unsupervised segmentation metric. The given ESerializer must have been created for reading.
| serializer | The serializer. |
Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.
| eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics::operator= | ( | const eVision::EasyDeepLearning::EUnsupervisedSegmenterMetrics & | other | ) |
Assignment operator.
| other | Reference to the EUnsupervisedSegmenterMetrics object used for the assignment |
| 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.
| result | A reference to an EUnsupervisedSegmenterResult object. |
| 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.
| result | A reference to an EUnsupervisedSegmenterResult object. |
| isGoodImage | True if the ground truth of this result is good, else false. |
|
virtual |
Saves an unsupervised segmentation metric. The given ESerializer must have been created for writing.
| path | The file path. |
Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.
|
virtual |
Saves an unsupervised segmentation metric. The given ESerializer must have been created for writing.
| serializer | The serializer. |
Reimplemented from eVision::EasyDeepLearning::EDeepLearningDefectDetectionMetrics.