axondeepseg / model_seg_generalist

Axon and myelin segmentation model trained on all ADS datasets. Works across contrasts and resolutions.
1 stars 0 forks source link

Add CARS data #7

Closed hermancollin closed 5 months ago

hermancollin commented 8 months ago

We have annotated CARS data buried somewhere - deep within duke or something. We need to add this data to the study in order to cover all 4 major microscopy imaging modalities. I will update my progress for this task in this issue.

hermancollin commented 8 months ago

I think I found the data in the shared lab gDrive. In the 2016 AxonSeg paper, the CARS data is described as such:

CARS images were obtained from one rat (thoracic section). Sample was imaged with a 60× objective lens (UPLSAPO 1.2 NA w, Olympus) and recorded images were stitched to reconstruct the whole section (~0.2 μm/pixel).

This is what the GT looks like: Screenshot_20240123_171451

Only problem is that only the axon masks are available as GT. The myelin segmentation was the result of another postprocessing step in this study, and only the axon segmentation was evaluated. With that being said, we should look for the myelin segmentations available and potentially use them as GTs. (some CARS myelin segs were shown in the paper so they obviously exist). I will dig deeper in duke but might run into perm issues.

hermancollin commented 8 months ago

Ok. After digging on duke, I found a folder named 20180208_CARS_segs_with_SEM_model. It contains 3 images with axon + myelin masks. However, the quality of the myelin mask is not great except for one image:

Screenshot_20240124_110455

Other masks are not incredible: image_segmented

image_segmented

(this last one has a lot of False Negatives on the left, so with a crop it could be usable). This gives us 3 images for a total of ~ 1.13 Mpx or less (for comparison, the smallest dataset before was VCU with 12 Mpx, and the performance wasn't great). This would be by far the smallest dataset, and it would be hard to have a proper train-val-test split on this.

jcohenadad commented 8 months ago

Other masks are not incredible

ah yeah? there are a few issues, but overall it looks quite good to me (i haven't "put my nose closely", but i don't see anything really shocking). I'll look for other datasets...

jcohenadad commented 8 months ago

There is the 'tanguy_human_histo', project, which is in the archive- I'll make sure you can access it @hermancollin. It has a bunch of segmented SEM scans from human:

image
jcohenadad commented 8 months ago

there is also "atlas_rat"

jcohenadad commented 8 months ago

also: archives/students/Bounou_Oumayma/mikula/data/ground_truths

hermancollin commented 8 months ago

@jcohenadad interesting. I know of 1 annotated human sample (SEM) but if these are annotated this could be really interesting for #11

jcohenadad commented 8 months ago

also: duke:histology/20160830_CARS_Begin

hermancollin commented 8 months ago

@jcohenadad ok maybe this is the one. The AxonSeg paper suggests the CARS images are rat - thoracic section

jcohenadad commented 8 months ago

also plenty of good resources under duke:histology

hermancollin commented 8 months ago

@jcohenadad The images in duke:histology/20160830_CARS_Begin have axon segs, but I don't think there are myelin masks. The axonmyelin masks I showed earlier were generated by AxonSeg I think. I'll keep digging in duke:histology.

Looking at this figure it looks like myelin masks were generated (and it looks really clean). I stared at the image for a while and it's not the same as the 3 I showed above, so we know there are more (and cleaner) myelin masks somewhere.

img

hermancollin commented 8 months ago

I found something CARS-related in duke/histology/rat/others/20140811_CARS_rat/. The image it contains is enormous (this is at 4.35% zoom)

Screenshot_20240124_141308

Upon closer inspection there is a lot of false negatives: Screenshot_20240124_141407

I'm not sure if we should include this in our training set because the quality is not really there. Also the actual myelin segmentation is in a .mat matlab file so I would need to invest some time to retrieve this in a usable PNG format...

hermancollin commented 8 months ago

recap

The only usable stuff I found were 3 images under duke/projects/axondeepseg/20180208_CARS_segs_with_SEM_model. Based on this folder name and its date, I'm guessing this segmentation was obtained with an early deep learning model from the first ADS versions. Here, you can see the image and the prediction:

image

image_segmented

I tried segmenting the same image with our current ivadomed SEM model (with no-patch option) and the result looks slightly better in certain regions:

image_seg-axonmyelin_NO_PATCH


There really isn't a lot of data to work with here (by far smaller than our smallest BF dataset). At most, I could add these 3 images, but as we can see, the myelin segmentation is not optimal as there was no manual correction for myelin on CARS images... I'm not sure this would be a good GT to use given that our old ivadomed SEM model almost gives a better prediction. Should we invest some time to clean up these labels?

At this point, I suggest we give up on adding this to the training set, but we can use the 3 CARS images to test generalizability (#11) and I expect the generalist model to work better than any dedicated model. We will be able to evaluate qualitatively the generalization on an out-of-dist modality. Let's keep in mind that CARS looks a lot like SEM so this sort of generalization is realistic.

@jcohenadad what do you think? Also, @ArthurBoschet and @Nish228 feel free to chip in.

jcohenadad commented 8 months ago

@alzaia I know it's been a while, but maybe you remember of you have notes of the CARS datasets with existing myelin segmentation?

alzaia commented 8 months ago

Hi @jcohenadad and @hermancollin! It's definitely been a while, I'm trying to remember as much info as I can that could help after reading this thread:

I will try to look at my own project archive and see if I can find anything useful.

alzaia commented 8 months ago

I did find something on my own archive: [data4_CARS.zip].(https://github.com/axondeepseg/model_seg_generalist/files/14044042/data4_CARS.zip) But it seems like it's the same first image that @hermancollin references here: https://github.com/axondeepseg/model_seg_generalist/issues/7#issuecomment-1908446169. Note that the myelin in the borders is not annotated in the original image, but there is a cropped version under metrics_final/ that only keeps the annotated part for evaluation. My guess is I annotated/corrected this sample myself so I could use it for eval.

So I think we just didn't have any myelin annotations on CARS. The rare ones you find were likely annotated purely for eval. purposes. :(

hermancollin commented 8 months ago

@alzaia thank you for looking into this. This helps a lot! We now have closure on this subject. In this case, I think we will re-use your manual annotations for eval as well.

jcohenadad commented 8 months ago

@hermancollin you now have access:

Jean-sébastien peux-tu STP donner R access à Armand Collin pour :

duke:archives/projects/2017/tanguy_human_histo duke:archives/projects/2019/atlas_rat archives/students/Bounou_Oumayma/mikula/data/ground_truths

hermancollin commented 8 months ago

Jean-sébastien peux-tu STP donner R access à Armand Collin pour :

duke:archives/projects/2017/tanguy_human_histo duke:archives/projects/2019/atlas_rat archives/students/Bounou_Oumayma/mikula/data/ground_truths

@jcohenadad did you meant to tag Jean-Sébastien?

mathieuboudreau commented 8 months ago

Jean-sébastien peux-tu STP donner R access à Armand Collin pour : duke:archives/projects/2017/tanguy_human_histo duke:archives/projects/2019/atlas_rat archives/students/Bounou_Oumayma/mikula/data/ground_truths

@jcohenadad did you meant to tag Jean-Sébastien?

@hermancollin Julien just mis-copy pasted from our internal Webex channel, I think he meant you now have read access to those three folders.

Screenshot 2024-01-25 at 12 53 10 PM

hermancollin commented 8 months ago

Ok I see. Unfortunately, without access to the archives folder, I'm not sure how to access these subdirectories. I get permission denied when I try to ls or cd into one of these 3.

jcohenadad commented 8 months ago

@mathieuboudreau can you pls follow up with JS on webex? thx

jcohenadad commented 8 months ago

Armand: try maybe to unmount/mount— maybe @namgo has ideas

ArthurBoschet commented 8 months ago

@hermancollin I created a PR to use the CARS data with nnUNet: https://github.com/axondeepseg/default-CARS-model/pull/1

hermancollin commented 8 months ago

thanks @ArthurBoschet . I'm guessing we will also need to update this repo as well (probably just the README)

hermancollin commented 5 months ago

Closing - see https://github.com/axondeepseg/default-CARS-model