Exemplo n.º 1
0
def build_objectives(interface_layers):
    obj_weighted = WeightedSegmentationCrossEntropyObjective(
        classweights=[10000, 1],
        input_layer=interface_layers["outputs"]["predicted_segmentation"],
        target_name="luna:gaussian",
    )

    obj_jaccard = JaccardIndexObjective(
        smooth=1e-5,
        input_layer=interface_layers["outputs"]["predicted_segmentation"],
        target_name="luna:gaussian",
    )

    obj_dice = SoerensonDiceCoefficientObjective(
        smooth=1e-5,
        input_layer=interface_layers["outputs"]["predicted_segmentation"],
        target_name="luna:gaussian",
    )

    obj_precision = PrecisionObjective(
        smooth=1e-5,
        input_layer=interface_layers["outputs"]["predicted_segmentation"],
        target_name="luna:gaussian",
    )

    obj_recall = RecallObjective(
        smooth=1e-5,
        input_layer=interface_layers["outputs"]["predicted_segmentation"],
        target_name="luna:gaussian",
    )

    obj_custom = ClippedFObjective(
        smooth=1e-5,
        recall_weight=1.0001,
        precision_weight=3.0,
        input_layer=interface_layers["outputs"]["predicted_segmentation"],
        target_name="luna:gaussian",
    )

    return {
        "train": {
            "objective": obj_custom,
            "jaccard": obj_jaccard,
            "weighted": obj_weighted,
            "Dice": obj_dice,
            "precision": obj_precision,
            "recall": obj_recall,
        },
        "validate": {
            "objective": obj_custom,
            "jaccard": obj_jaccard,
            "weighted": obj_weighted,
            "Dice": obj_dice,
            "precision": obj_precision,
            "recall": obj_recall,
        }
    }
Exemplo n.º 2
0
def build_objectives(interface_layers):
    obj_weighted = WeightedSegmentationCrossEntropyObjective(
        classweights=[10000, 1],
        input_layers=interface_layers["outputs"],
        target_name="luna",
    )

    obj_jaccard = JaccardIndexObjective(
        smooth=1e-5,
        input_layers=interface_layers["outputs"],
        target_name="luna",
    )

    obj_dice = SoerensonDiceCoefficientObjective(
        smooth=1.,
        input_layers=interface_layers["outputs"],
        target_name="luna",
    )

    obj_precision = PrecisionObjective(
        smooth=1.,
        input_layers=interface_layers["outputs"],
        target_name="luna",
    )

    obj_recall = RecallObjective(
        smooth=1.,
        input_layers=interface_layers["outputs"],
        target_name="luna",
    )

    return {
        "train": {
            "objective": obj_jaccard,
            "weighted": obj_weighted,
            "Dice": obj_dice,
            "precision": obj_precision,
            "recall": obj_recall,
        },
        "validate": {
            "objective": obj_jaccard,
            "weighted": obj_weighted,
            "Dice": obj_dice,
            "precision": obj_precision,
            "recall": obj_recall,
        }
    }