Open zccoder opened 6 years ago
@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!
@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!
@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!
@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?
I just got back from the maintainer that if you download the whole data, the calcification masks are included.
@lishen Thank you very much! The puzzle I referred to above had confused me a few days. Thanks again!
@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!
@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.
@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?
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.
@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
@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.
@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.
@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".
@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 zhipengfu@nudt.edu.cn
thank you so much
@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.
@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?
@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!
@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~~
Hi, the program gets stuck in the following row:
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!
@wurenzhong I am also just started working on it. I have not got anything running yet, let's keep in touch and share progresses...
@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?
@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 .
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.
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)
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
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
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: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.