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

model for greyscale images? #53

Closed
dschneiderch opened this issue Jan 5, 2021 · 5 comments
Closed

model for greyscale images? #53

dschneiderch opened this issue Jan 5, 2021 · 5 comments

Comments

@dschneiderch
Copy link

dschneiderch commented Jan 5, 2021

Hi @phue,
the segmentation worked great on the first dataset after I sorted out the docker storage issue. Next I tried to run model A on some greyscale images - is that possible or do the models depend on shape and color differences?
I got this error which wasn't clear to me if it was related and i couldnt find a .command.sh

Staging foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb                                                                                       WARN: Unable to stage foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb (try 1) -- Cause: Unable to access path: /record/3946618/files/1_class_singlescale.pb                                                                                                                                                              WARN: Unable to stage foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb (try 2) -- Cause: Unable to access path: /record/3946618/files/1_class_singlescale.pb                                                                                                                                                              WARN: Unable to stage foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb (try 3) -- Cause: Unable to access path: /record/3946618/files/1_class_singlescale.pb
Error executing process > 'run_predictions (42)'

Caused by:
  Can't stage file https://zenodo.org/record/3946618/files/1_class_singlescale.pb -- reason: Unable to access path: /record/3946618/files/1_class_singlescale.pb

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`

my command

nextflow run Gregor-Mendel-Institute/aradeepopsis --images 'data/psII/*.png' -profile docker --shiny false --outdir output/deeposisA-psII --model A
@phue
Copy link
Member

phue commented Jan 6, 2021

Hi @dschneiderch,

the segmentation worked great on the first dataset after I sorted out the docker storage issue. Next I tried to run model A on some greyscale images - is that possible or do the models depend on shape and color differences?

The models have been trained on RGB images, so colour information certainly plays a role for the model prediction. I don't think it will work well on singlechannel images.

I got this error which wasn't clear to me if it was related and i couldnt find a .command.sh

Staging foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb                                                                                       WARN: Unable to stage foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb (try 1) -- Cause: Unable to access path: /record/3946618/files/1_class_singlescale.pb                                                                                                                                                              WARN: Unable to stage foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb (try 2) -- Cause: Unable to access path: /record/3946618/files/1_class_singlescale.pb                                                                                                                                                              WARN: Unable to stage foreign file: https://zenodo.org/record/3946618/files/1_class_singlescale.pb (try 3) -- Cause: Unable to access path: /record/3946618/files/1_class_singlescale.pb
Error executing process > 'run_predictions (42)'

Caused by:
  Can't stage file https://zenodo.org/record/3946618/files/1_class_singlescale.pb -- reason: Unable to access path: /record/3946618/files/1_class_singlescale.pb

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`

The pipeline fetches the pretrained models from this Zenodo record, which doesn't seem to be very reliable for that purpose. I need to upload them somewhere else and update the pipeline.

In the meantime, you can either try again (it will work eventually) or change back to the dropbox links (see f7566a0)

phue added a commit that referenced this issue Jan 6, 2021
@dschneiderch
Copy link
Author

do you think it would be possible to train a similar model with grayscale images or does imagenet+ rely on color info too?

@phue
Copy link
Member

phue commented Jan 7, 2021

It should be possible, although the input layer of the model needs to be changed to work with 1-channel images.

I think the main problem is that the pretrained weights in DeepLabV3+ are obtained by pretraining on the ImageNet dataset which also consists of RGB images.
So I guess if you use that for transfer learning with grayscale images, it is also not optimal (but it might be worth a try)

A better way would be to convert the whole ImageNet dataset to grayscale and train on that, but that is probably not feasible because of the hardware requirements that come with it.

@dschneiderch
Copy link
Author

that was my intuition. do you work with grayscale images? automated segmentation would be 👌
I do a lot of chlorophyll fluorescence imaging and often algae turns up. it can be quite difficult to segment well.
A1-doi-20200531T210155-PSII0-12

@phue
Copy link
Member

phue commented Jan 7, 2021

do you work with grayscale images?

No I don't. Fluorescence imaging is an interesting topic, but we currently don't have a camera for that.

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