janelia-flyem / gala

Automatic segmentation of electron microscopy volumes
BSD 3-Clause "New" or "Revised" License
75 stars 29 forks source link

Remove bug in ARE in evaluate.py #89

Closed JohnnyTeutonic closed 7 years ago

JohnnyTeutonic commented 7 years ago

As per discussion at https://github.com/cremi/cremi_python/issues/3#issuecomment-241711193 about errors with the normalisation of the Adapted Rand Errror, I have incorporated the changes to the ARE, adapted from the fixed code found in the above discussion, which is seen in the link: https://gist.github.com/thouis/63888c375cbeb2f702e94e2e82eebee8. The main change to the code is the removal of the division by 'n' , which previously had included division by both zero and non-zero pixels, which occurred when calculating the sum of the pixels in segments A and B. So now this code reflects only division by non-zero pixels, which is what should have been reflected in the reference implementation.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.05%) to 50.079% when pulling 81c0f60526050530fee0f86f8080b1a8a2ebdf24 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.03%) to 50.105% when pulling de738fcb0a0e1cb14d463176edbd13b8f451909f on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.03%) to 50.105% when pulling de738fcb0a0e1cb14d463176edbd13b8f451909f on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.03%) to 50.105% when pulling 685ac89bd22d52c1b65d456057fd8379b333f20b on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.08%) to 50.052% when pulling f760002d8af8b78bb8b50e8902bcaa2c1db57136 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.08%) to 50.052% when pulling fe8468a47b7ffabac99c8e9691f7eee05347c248 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.08%) to 50.052% when pulling 7ca16bebe8ce4ab002538950bc326b14238468cd on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.08%) to 50.052% when pulling 86e6dd8db510bfa7f39b49921c00fb9ba3b35312 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.05%) to 50.079% when pulling 6c3b5a314c9ba25fba2b0a605215d2fdad97e8dc on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.01%) to 50.118% when pulling 83910910252217089a7edb3b82da2ce5f9d32116 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 50.618% when pulling c7abd48e6ff059224a201cba9c6388ef1a6c0b88 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 50.618% when pulling 1c612af396b57467e757ff8f1ecf8db8af152164 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 50.592% when pulling 9018d0c01eaf382aceaf14f6fac6446aa3c79659 on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.

JohnnyTeutonic commented 7 years ago

Okay, I included all your changes and also removed the unnecessary ravel functional calls (segA = np.ravel(gt), segB = np.ravel(seg)) at the beginning of the function, as I realised that the contingency table already flattens the input arrays anyway. So that removes some more redundant code.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.5%) to 50.618% when pulling 90988b6f3b2b38873c0002b51b9f6dc2e542c30a on JohnnyTeutonic:adapted_rand_index into 6613db219ce7fd29cd5a45d7e01f49eb14f9cfec on janelia-flyem:master.