DeepCAD-RT icon indicating copy to clipboard operation
DeepCAD-RT copied to clipboard

Split data uneven baselines

Open brian1000 opened this issue 1 year ago • 3 comments

Hello,

I don't like to repeat issues but I've also experienced the uneven baselines phenomenon when running deepcad on multiple split files of the same movie.

Currently, I have deepcad installed in a fresh anaconda venv ~ Specs: Windows 10; Python v3.9; DeepCad v1.0.1

I tested a 2000 frame tif file split into five 400 frame samples. The first 400 frame denoised output was considerably higher in background fluorescence than all the other outputs, which had relatively stable background intensity. I'm wondering if it has to do with our experimental paradigm where the stimulus (and high neural activation) begins around the first 200 frames and then continues for the entire movie. Maybe DeepCad is trying to do a sort of histogram equalization for each 400 fr stack and so the first stack is off compared to the rest due to less neural activity?

Here's a link to my model (yaml + pth) and test .tif files. I trained the model on the entire 2000frames of the original movie.

Examples ~ (left = denoised output, right = raw input) Fr400: Fr401:

I assume the issue could also stem from the high baseline intensity. I want to retry the experiment with lower light strength because most likely the SNR will be even better and the background will confuse deepCAD less.

brian1000 avatar Nov 13 '23 22:11 brian1000

Hi! I tried to denoise 1-400.tif and 401-800.tif using the model and parameter you offer. I didn't find any issues with intensity variations (the uneven baselines phenomenon you mentioned). The mean values of Fr.400 and Fr.401 are nearly identical. Intensity comparison: image

My code: image

In the pre-processing step, we subtract the mean value but we add it back in the post-processing step. And we didn't use histogram equalization in DeepCAD. Although there are no obvious problems with splitting them into 400 frames, It is recommended that you directly compose the 2000 frames of data into a single file for inference.

cabooster avatar Nov 14 '23 08:11 cabooster

We found an issue with 8-bit data. Although this did not affect the results much, it made the output file size smaller. We have updated the pip release of DeepCAD-RT pypi and GitHub code. Please type pip install deepcad==1.1.0 to upgrade the pip package and try again.

cabooster avatar Nov 14 '23 09:11 cabooster

Thanks for your timely assistance @cabooster. I really appreciate having the output be the same bit size as the input (8-bit in my case) ~ it reduces the need for conversion and saves disk space on my end. It appears that the issue with the extra bright bg in the first stack did not happen this time. Perhaps it was fixed by the update.

Thanks for your recommendation, but my computer doesn't have enough RAM to handle more than 400 images at a time hehe.

Perhaps we can rename this issue to 8-bit input or something else. Thanks again for your help, my issue is closed!

brian1000 avatar Nov 15 '23 18:11 brian1000