Skip to content

19th Dec 2023: Improving robustness of well segmentation

Ablencourt edited this page Dec 20, 2023 · 3 revisions

Description of robustness improvement to well segmentation

In our last meeting we noted a potential flaw in the well segmentation algorithm, where a single well on an otherwise blank row or column would be ignored. I've made some changes to the well segmentation algorithm to address this.

The new function is called def _filter_spurious_peaks(peaks: list, threshold=0.2) -> tuple[list, float]: in the codebase. I've also adjusted the default values of the LoG and peak finder functions.

Here are a couple of examples of the effect of changing the threshold parameter of the LoG algorithm. This finds candidate well centres, which is the basis for the automatic grid detection.

test2_0 01 test2_0 05 test2_0 09999999999999999 test2_0 15000000000000002 test2_0 2

Question from Adrien:

With these segmentation algorithms, are we able to clearly attribute a label to each well that contains cells for us to put a name on each well correctly?

I've added a unit test using real data to test the single-well case:

Input image:

test1

After projecting the peaks to the vertical axis, you get a histogram like this:

test3

I found that the following parameters are robust to a few spurious well detections, and still find the correct 16x24 grid on this test case and all other plates so far

peak_finder_kwargs={"peak_prominence": 1/25, "filter_threshold": 0.2}, blob_log_kwargs={"threshold": 0.12},