{# REVIEW: the wording of this section was written by the builder, not by the author. #}

The hospital fingerprint

A simple classifier, logistic regression, tried to name the hospital of a patch from held-out slides. With {{ p2.pb.chance|pct(0) }} as chance, the color histogram of the patch alone gets it right {{ p2.pb.hist.accuracy_mean|pct(0) }} of the time. The plain model's internal features give {{ p2.pb.plain.accuracy_mean|pct(0) }}, and the stain-augmented model's features give {{ p2.pb.aug.accuracy_mean|pct(0) }}.

{% for r in p2.pb.rows %} {% endfor %}
Hospital recognized from held-out slides ({{ p2.pb.n|count }} patches, {{ p2.pb.n_folds|count }} folds, chance {{ p2.pb.chance|pct(0) }})
ProbeAccuracySpread over foldsBalanced accuracy
{{ r.description }}{{ r.accuracy_mean|pct(1) }}{{ r.accuracy_sd|pct(1) }}{{ r.balanced_accuracy_mean|pct(1) }}

So augmentation reduced the hospital information in the features: the augmented probe was lower than the plain one in {{ p2.pb.aug_lower_in_folds|count }} of {{ p2.pb.n_folds|count }} folds, by {{ p2.pb.aug_minus_plain_mean_abs|pct(1) }} on average. It did not remove it: the augmented features still identify the hospital far above chance. The spread between folds is larger than the gap, so the direction is what these numbers support.

{{ p2.map_n|count }} patches, balanced by hospital and label, placed by UMAP from the plain hospital-level model's features. Hover a point for the patch. Distance on a UMAP map is only a rough guide.

Caveats