Link Search Menu Expand Document

[Notebook example]

ArtDL - a multi label classification task example

Package import and variables definition

from odin.classes import TaskType, Metrics, Curves, CustomMetric, DatasetClassification, AnalyzerClassification

# define the path of the GT .json file
dataset_gt_param = "../../test-data/classification-ml/gt_art.json"

# define the path of the folder that contains the predictions .txt files for each model
path_to_detections = "../../test-data/classification-ml/predictions"

# define the task type
classification_type = TaskType.CLASSIFICATION_MULTI_LABEL

# define groups of categories which are similar to each other (useful for the error analysis)
similar_classes=[[1, 4, 7], [2, 6, 10], [5, 8], [3, 6, 9]]

# define the file_name for the meta-annotations
properties_file = "properties_art.json"

Dataset

my_dataset = DatasetClassification(dataset_gt_param,
                                   classification_type,
                                   proposals_paths=path_to_detections,
                                   similar_classes=similar_classes,
                                   properties_file=properties_file,
                                   save_graphs_as_png=False)

Dataset

Categories distribution

my_dataset.show_distribution_of_categories()

categories_distribution

Properties distribution

my_dataset.show_distribution_of_properties()

properties_distribution_a properties_distribution_d

properties_distribution_b properties_distribution_c properties_distribution_e properties_distribution_f properties_distribution_g

Analyzer

my_analyzer = AnalyzerClassification('my_model',
                                     my_dataset,
                                     metric=Metrics.F1_SCORE,
                                     save_graphs_as_png=False)

Properties analysis

my_analyzer.analyze_properties()

analyze_properties_a analyze_properties_b

Sensitivity and impact analysis

my_analyzer.analyze_sensitivity_impact_of_properties()

sensitivity_impact

False Positive categorization and impact

my_analyzer.analyze_false_positive_errors()

fp_analysis_a fp_analysis_b

fp_analysis_c fp_analysis_d

fp_analysis_e fp_analysis_f

fp_analysis_g fp_analysis_h

fp_analysis_i fp_analysis_l

fp_analysis_m fp_analysis_n

fp_analysis_o fp_analysis_p

fp_analysis_q fp_analysis_r

fp_analysis_s fp_analysis_t

fp_analysis_u fp_analysis_v

False Negative categorization

my_analyzer.analyze_false_negative_errors()

fn_analysis_a fn_analysis_b fn_analysis_c fn_analysis_d fn_analysis_e fn_analysis_f fn_analysis_g fn_analysis_h fn_analysis_i fn_analysis_l

Precision-Recall curve - Overall

my_analyzer.analyze_curve(average="micro")

pr_curve

Precision-Recall curve - Per-category

my_analyzer.analyze_curve_for_categories()

pr_curve_categories

Reliability analysis

my_analyzer.analyze_reliability()

reliability

Performance summary

my_analyzer.base_report()

report