Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split data uneven baselines #33

Open
brian1000 opened this issue Nov 13, 2023 · 3 comments
Open

Split data uneven baselines #33

brian1000 opened this issue Nov 13, 2023 · 3 comments

Comments

@brian1000
Copy link

brian1000 commented Nov 13, 2023

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.

@cabooster
Copy link
Owner

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
Copy link
Owner

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.

@brian1000
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants