Skip to main content

No project description provided

Project description

Overview

After training a neural network for binary segmentation, it will produce a grayscale prediction map where each pixel represents the probability of belonging to the positive class (i.e. 0 is negative, and 1 is positive).

Given the human label, which acts as the ground-truth, the correctness of each pixel-wise prediction can be classified using the confusion matrix:

  • True positive
  • True negative
  • False positive (type 1 error)
  • False negative (type 2 error)

It may be informative to see where predictions were correct/incorrect given the human label, and to further see the type of error made by the machine. This visualizes the disagreement between human and machine and helps show biased labelling.

Usage

The script src/demo.py performs a demo of the program using some provided data in data/. It can also be used with custom data by supplying arguments that define paths to the top-level data directory and its sub-directories containing training images, labels, and output predictions. The user can also define a custom path (absolute, or relative) to a directory that will contain program output. Use demo.py --help to see more information about customizing supplied paths.

Predictions should be a result of binary segmentation; multiclass objectives are not supported. Each image/label/prediction pair should also have the same shape and filenames, though different (but consistent) extensions can be used.

Output Results

The program creates a new directory that contains three sub-directories:

  • confusion_masks/
    • Standalone images with each pixel colored according to the confusion mask
  • confusion_compare/
    • Raw images, human labels, and confusion masks plotted together with the F1 found from Otsu thresholding
  • prediction_compare/
    • Raw images, human labels, and raw output predictions plotted together

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confusion_visualization-1.0.tar.gz (31.3 MB view details)

Uploaded Source

Built Distribution

confusion_visualization-1.0-py2.py3-none-any.whl (6.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file confusion_visualization-1.0.tar.gz.

File metadata

  • Download URL: confusion_visualization-1.0.tar.gz
  • Upload date:
  • Size: 31.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for confusion_visualization-1.0.tar.gz
Algorithm Hash digest
SHA256 9d08cf2ac1ef9ff20fe1896d9920d8996169a21fd6d340e8266a8eaf2053da8c
MD5 ce244374713fb7cf038961441eca84d3
BLAKE2b-256 0b28da714536c2443e291cba79773209830760ec03eb17decfaaa97a91bd8b0a

See more details on using hashes here.

File details

Details for the file confusion_visualization-1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for confusion_visualization-1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 06d53c85e2402e87a62873e0b5b1166695f2bc7d700732b5453b1bfa217f0074
MD5 8ecc497e94937de5c392f24e0c8c3220
BLAKE2b-256 ec1ff58a4c504d112cceb9d718a400779cd5088034ac46c690f56ac322262978

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page