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

How to run the code?And why the result is so poor? #2

Open
zccoder opened this issue Sep 20, 2017 · 26 comments
Open

How to run the code?And why the result is so poor? #2

zccoder opened this issue Sep 20, 2017 · 26 comments

Comments

@zccoder
Copy link

zccoder commented Sep 20, 2017

hello,lishen.I have read carefully about your paper and source code.I have questions here.

1.There are so many models in your code.Such as dm_resnet_train.py dm_enet_train.py etc.And it seems that not all files that you have submitted here,is it?For myself,I can not successfully run the dm_enet_train.py,and it occurs

IOError: Unable to open file (unable to open file: name = 'none', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)".

I think it is because the dl_state file('./modelState/resnet50_288_best_model.h5')is lost,and i do not know how to create it.

2.I tried to run .sh files to run the models,however no one worked.Then I ran the python files,like these
python dm_resnet_train.py trainingData --img-extension=png
It worked but the result is very poor,you can see it below:

>>> Found best AUROC: 0.5000 at epoch: 1, saved to: ./modelState/dm_resnet_best_model.h5 <<<
>>> AUROC for all cls: 0.5 <<<

==== Training summary ====
Minimum val loss achieved at epoch: 2
Best val loss: 23.6154212532
Best val sensitivity: 0.648351631322
Best val specificity: 0.0

Can you give me the reason and give me the way how to run .sh files ?or can you tell me how to run the different models?
Thanks a lot.

@lishen
Copy link
Owner

lishen commented Sep 20, 2017

@zccoder ,
Sorry about your experience but you shall not use those scripts. They were created during the competition and were no longer used (last updated 8 months ago). The results in the paper were obtained from the code in the ddsm_train folder. Right now, I don't have time to write a tutorial. But hopefully they are enough for you to get started. You may continue to post your experience here. Thanks!

@zccoder
Copy link
Author

zccoder commented Sep 20, 2017

@lishen ,
Thank you!Now I test the files in the ddsm_train,and I get the dateset CBIS-DDSM from the paper you referenced

[14] R. S. Lee, F. Gimenez, A. Hoogi, and D. Rubin, “Curated Breast Imaging Subset of DDSM,” The Cancer
Imaging Archive, 2016.

which contains images that have already been converted into the standard DICOM format as you reported in your paper.
And then I found I should ran sample_patches_main.py or sample_patches_combined.py.But it seems that I can not get the following files:

   parser = argparse.ArgumentParser(description="Sample patches for DDSM images")
    parser.add_argument("roi_mask_path_file", type=str)
    parser.add_argument("roi_mask_dir", type=str)
    parser.add_argument("pat_train_list_file", type=str)
    parser.add_argument("full_img_dir", type=str)
    parser.add_argument("train_out_dir", type=str)
    parser.add_argument("val_out_dir", type=str)

roi files did not in the changed dataset,So how can I change the code to fit the program or do you have any other methods to solve it?
Thanks!

@zccoder
Copy link
Author

zccoder commented Sep 20, 2017

@lishen
I read carefully about your paper and appreciated the ideas that you posted in the paper.
I want to know how can I use my own dataset based on your fine-tune results on CBIS-DDSM, any advice for me?Thanks!

@lishen
Copy link
Owner

lishen commented Sep 20, 2017

@zccoder As I mentioned, I'm too busy to write a detailed tutorial at this time. sample_patches_combined.py is the one I used to samples patches from images and masks. It basically takes in images and masks and patient lists to generate patches. You'll have to figure out other details by your own.

Last time I checked CBIS-DDSM, the calcification images and masks are still missing. I got those data through personal communications with the site maintainers. I just shot them an email this morning and let's hope they'll solve this issue soon.

If you just want to finetune the whole image models on your own dataset then you don't have to go through patch sampling and patch classifier training. I have already provided an example in Readme.md. Is that good enough?

@lishen
Copy link
Owner

lishen commented Sep 20, 2017

I just got back from the maintainer that if you download the whole data, the calcification masks are included.

@zccoder
Copy link
Author

zccoder commented Sep 21, 2017

@lishen Thank you very much!
The puzzle I referred to above had confused me a few days.
Thanks again!

@zccoder
Copy link
Author

zccoder commented Sep 21, 2017

@lishen
Sorry to disturb you again. As you referred in the .sh files, I know train_image_clf_im1152.py is running for the whole image on ddsm dataset. The configure that you set is below:

TRAIN_DIR="Combined_full_images/full_train_1152x896"
VAL_DIR="Combined_full_images/full_val_1152x896"
TEST_DIR="Combined_full_images/full_test_1152x896"
PATCH_STATE="Combined_patches_im1152_224_s1/resnet_prt_best1.h5"
BEST_MODEL="Combined_full_images/resnet_1152x896_prt_addtop1.h5"
FINAL_MODEL="NOSAVE"

So where is resnet_prt_best1.h5 and resnet_1152x896_prt_addtop1.h5
At first, I thought these are the h5 files after you ran patch classifier. But it seems not. So bother you again, and wait for your answer.

In addition, thank you for your help and I have get the dataset. Can you give me a .sh files as an example to get the patches?
Thanks a lot!

@lishen
Copy link
Owner

lishen commented Sep 21, 2017

@zccoder ,
PATCH_STATE defines the path to a trained patch classifier.
BEST_MODEL defines the path to the best whole image classifier to be saved during training.
I won't upload all the intermediate files for my research. Nobody does that. You'll have to become familiar with Python and shell scripting enough to use the code. Everybody has to do that. I'll try to provide more tutorials to help people get started in the future.

@zccoder
Copy link
Author

zccoder commented Sep 22, 2017

@lishen
I am sure that I had read your code carefully, your code to get patch failed, unless the CBIS-DDSM's format has been changed. On CBIS-DDSM, all the files were built in the format below:

DOI: Dicoms files through the path DOI\Calc-Test_P_00038_LEFT_CC\1.3.6.1.4.1.9590.100.1.2.85935434310203356712688695661986996009\1.3.6.1.4.1.9590.100.1.2.374115997511889073021386151921807063992
CSV files: calc_case_description_train_set.csv and mass_case_description_train_set.csv

The process I follow from your code is that:

preprocess: To make the .dicoms files to .png files
patch: By running sample_patches_combined.py to get the patch files
patch classifier: To get the `PATCH_STAGE`
whole image classifier: To get the `BEST_MODEL`

For your code, preprocess is impossible to work and the patch can not get, then from the beginning to the last, I have to create all these files by my own but I still don't know whether your code works well.
And I don't think PATCH_STAGE is an intermediate file that can be ignored, because you have listed the results in your paper. Without comments to important files in your code ,is it better to upload the files to make people understand the important files in your work so that can follow your work?

@lishen
Copy link
Owner

lishen commented Sep 25, 2017

I have just uploaded the patch classifier models. I have no problem sharing them. But you shall convert the image files and renaming them by yourself. I'm not going to provide step-by-step instructions on that.

@zpfu
Copy link

zpfu commented Oct 17, 2017

@zccoder
hi, i also get the same problem like you, have you been running the sample_patches_main.py or sample_patches_combined.py successfully later? when i ran the modules,the result shows below:

sample_patches_combined.py: error: the following arguments are required: roi_mask_path_file, roi_mask_dir, pat_train_list_file, full_img_dir, train_out_dir, val_out_dir

sample_patches_main.py: error: the following arguments are required: roi_mask_path_file, roi_mask_dir, pat_train_list_file, full_img_dir, train_out_dir, val_out_dir

i also don't know how to get the parameters you have mentioned above: roi_mask_path_file, roi_mask_dir, pat_train_list_file, full_img_dir, train_out_dir, val_out_dir. can you tell me ? thanks a lot

@zccoder
Copy link
Author

zccoder commented Oct 19, 2017

@zpfu
I am sorry that I encounted this problem,however I could not find the way to solve it. As you can see in my issue to lishen, I have asked him how to find such files. He thought you should download the ddsm dataset first, then you can know how to solve it. But I failed.
Now, I just try to code my own project to solve it. Hope you can solve it and paste here to help others that want to use the open source.

@zpfu
Copy link

zpfu commented Oct 20, 2017

@zccoder
I've read your communications with lishen carefully, but also don't know how to get the parameters. whatever, thank you so much. best wishes to you.
i will try my best to run the project, if successfully, i will paste here.

@zpfu
Copy link

zpfu commented Oct 24, 2017

@zccoder
in running the sample_patches_main.py or sample_patches_combined.py, i guess the parameters above maybe means as below:
roi_mask_path_file: is the .csv file of the ROI mask
roi_mask_dir: is the directory of the ROI mask
pat_train_list_file: the .csv file which includes the training patient information
full_img_dir: the directory of the full image
train_out_dir: the directory which used to store the training result
val_out_dir: ther directory which used to store the validating result
and when i running with these parameter, it doesn't take wrong.
in the csv files, we should change some columns to the variables in the program, for example, change the "left or right breast" to "side", "image view" to "view".

@zpfu
Copy link

zpfu commented Oct 24, 2017

@zccoder
but i encounter some other problem in changing the .dicom files to .png files in this project. do you have any suggestion for this? if you have the change-image modules for this project, can you send it to me by email? my email is [email protected]

thank you so much

@zccoder
Copy link
Author

zccoder commented Nov 1, 2017

@zpfu
Thanks, these days, I try to accomplish it by myself. The datasets(DDSM) that lishen used has changed a lot that I can not find the files he wrote in the code source. So,for this sentence,

in the csv files, we should change some columns to the variables in the program, for example, change the "left or right breast" to "side", "image view" to "view".

I could not understand ,can you give me explanation?
As for the problems you asked me, the 'preprocess' filedirectory that lishen gave has solved it, although I use the python api'dicom' to read the .dicom files.Maybe you can use it, I emailed you.

@wurenzhong
Copy link

wurenzhong commented Jul 17, 2018

@zccoder
hello~did you get this problem when you run the "dm_keras_ext.py"? I can't find the function of flip_axis. If you havn't this problem, what's the version of your keras?
image
image

@sarahthegao
Copy link

@wurenzhong
try
from keras_processing.image import flip_axis

it looks like keras.preprocessing name has been changed to keras_processing in newer keras. Hopefully, its functionality has not been changed.
Good luck!

@wurenzhong
Copy link

@sarahthegao
Wow~~
Thankyou very much, the code "from keras_preprocessing.image import flip_axis" make me successfully run the "dm_keras_ext.py".
And~
Did you successfully run all the code? I still have many problems~If you have time, can you try to answer some of my other questions?Thankyou~~

@961635637
Copy link

Hi, the program gets stuck in the following row:
gspgo5e 2_ 1wqwkmj0646
7 p7 5bae8c i t8wzxo59
It seems the return of next() are more than 3. I am wondering is there anyone meet the same question or any idea to figure this out? Thanks!

@sarahthegao
Copy link

@wurenzhong
I am also just started working on it. I have not got anything running yet, let's keep in touch and share progresses...

@danieltao
Copy link

@wurenzhong
I am also just started working on it. I have not got anything running yet, let's keep in touch and share progresses...

Did you guys manage to get it running?

@bintykhany
Copy link

@wurenzhong
I am also just started working on it. I have not got anything running yet, let's keep in touch and share progresses...

Plz share full steps to run this code successfully
.

@genuinwix
Copy link

Is there anyone who is having only small set of dataset of mammography?? (Because original dataset is about 163 GB of size)

I just need small set of data from that dataset.

@AbdoSaeed
Copy link

Did anyone manage to download the models mentioned in the README file?
I do not have permissions to the drive (ex: https://drive.google.com/open?id=0B1PVLadG_dCKMTc2RGV1NGF6bm8)

@kanika-star
Copy link

can anyone please help me to know the sequence of the files to run this code..as I am unable to find the sequence of files to run successfully this code of lishen

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