kreshuklab / plant-seg

A tool for cell instance aware segmentation in densely packed 3D volumetric images
https://kreshuklab.github.io/plant-seg/
MIT License
88 stars 31 forks source link

Strong tiling artifacts #190

Closed Buglakova closed 4 months ago

Buglakova commented 7 months ago

When I run the network prediction, the result has strong tiling artifacts. I use quite big halo, but it doesn't help. I encountered this before when using U-Net that wasn't trained for long enough or didn't see enough ground truth, which is kind of the case when applying a pretrained network to different data. As a workaround, would be nice to have an option for smooth transition between tiles, like in the original U-Net publication, where within the halo the weight of the tile in the result falls linearly towards the edge of the tile.

Here is an example: Screenshot from 2024-02-05 13-49-59 Screenshot from 2024-02-05 13-50-18

Furthermore, it propagates to the superpixels (here GASP run on the wrong channel, but still you can see clearly the squares) Screenshot from 2024-02-05 13-50-43

qin-yu commented 6 months ago

I'm looking into it and believe it relates to #205

qin-yu commented 4 months ago

Fixing #205 doesn't help, i.e. changing size of halo doesn't improve prediction, which indicates more serious problems. Thus #220 and https://github.com/wolny/pytorch-3dunet/pull/113

Progress:

  1. Halo implementation is fixed, which already greatly improved the prediction (https://github.com/wolny/pytorch-3dunet/pull/113#issue-2236219588)
  2. Intensity normalisation doesn't cause problem at least for ovules (training data) and mouse (another dataset).
  3. Batch norm fix hallucinations created by group norm in mouse embryo (I mean you need to train with batch norm again).
qin-yu commented 4 months ago

For PlantSeg: