Code Monkey home page Code Monkey logo

deeplung's Introduction

DeepLung:

Please add paper into reference if the repository is helpful to you.

Zhu, Wentao, Chaochun Liu, Wei Fan, and Xiaohui Xie. "DeepLung: Deep 3D Dual Path Nets for Automated Pulmonary Nodule Detection and Classification." IEEE WACV, 2018.

Dependecies: Ubuntu 14.04, python 2.7, CUDA 8.0, cudnn 5.1, h5py (2.6.0), SimpleITK (0.10.0), numpy (1.11.3), nvidia-ml-py (7.352.0), matplotlib (2.0.0), scikit-image (0.12.3), scipy (0.18.1), pyparsing (2.1.4), pytorch (0.1.10+ac9245a) (anaconda is recommended)

Download LUNA16 dataset from https://luna16.grand-challenge.org/data/

Download LIDC-IDRI dataset from https://wiki.cancerimagingarchive.net/display/Public/LIDC-IDRI

For preprocessing, run ./DeepLung/prepare.py. The parameters for prepare.py is in config_training.py. *_data_path is the unzip raw data path for LUNA16. *_preprocess_result_path is the save path for the preprocessing. *_annos_path is the path for annotations. *_segment is the path for LUNA16 segmentation, which can be downloaded from LUNA16 website.

Use run_training.sh to train the detector. You can use the resnet or dual path net model by revising --model attribute. After training and test are done, use the ./evaluationScript/frocwrtdetpepchluna16.py to validate the epoch used for test. After that, collect all the 10 folds' prediction, use ./evaluationScript/noduleCADEvaluationLUNA16.py to get the FROC for all 10 folds. You can directly run noduleCADEvaluationLUNA16.py, and get the performance in the paper.

The trained model is in ./detector/dpnmodel/ or ./detector/resmodel/ The performances on each fold are (these results are in the supplement)

Method Deep 3D Res18 Deep 3D DPN26 Fold 0 0.8610 0.8750 Fold 1 0.8538 0.8783 Fold 2 0.7902 0.8170 Fold 3 0.7863 0.7731 Fold 4 0.8795 0.8850 Fold 5 0.8360 0.8095 Fold 6 0.8959 0.8649 Fold 7 0.8700 0.8816 Fold 8 0.8886 0.8668 Fold 9 0.8041 0.8122

The performances on each average false positives in FROC compared with other approaches (these results are in the supplement)

Methods 0.125 0.25 0.5 1 2 4 8 FROC DIAG_ConvNet 0.692 0.771 0.809 0.863 0.895 0.914 0.923 0.838 ZENT 0.661 0.724 0.779 0.831 0.872 0.892 0.915 0.811 Aidence 0.601 0.712 0.783 0.845 0.885 0.908 0.917 0.807 MOT_M5Lv1 0.597 0.670 0.718 0.759 0.788 0.816 0.843 0.742 VisiaCTLung 0.577 0.644 0.697 0.739 0.769 0.788 0.793 0.715 Etrocad 0.250 0.522 0.651 0.752 0.811 0.856 0.887 0.676 Dou et al 2017 0.659 0.745 0.819 0.865 0.906 0.933 0.946 0.839 3D RES 0.662 0.746 0.815 0.864 0.902 0.918 0.932 0.834 3D DPN 0.692 0.769 0.824 0.865 0.893 0.917 0.933 0.842

For nodule classification, first clean the data from LIDC-IDRI. Use the ./data/extclsshpinfo.py to extract nodule labels. humanperformance.py is used to get the performance of doctors.

dimcls.py is used to get the classification based on diameter. nodclsgbt.py is used to get the performance based on GBM, nodule diameter and nodule pixel. pthumanperformance.py is used for patient-level diagnosis performance. kappatest.py is used for kappa value calculation in the paper.

For classification using DPN, use the code in main_nodcls.py. Use the testdet2cls.py to test the trained model. You may revise the code a little bit for different test settings.

For system's classification, that is classification based on detection. First, use the detection's test script in the run_training.sh to get the detected nodules for training CTs. Use the det2cls.py to train the model. And use the testdet2cls.py to test the trained model. You may revise the code a little bit for different test settings.

Feel free to ask any questions. Wentao Zhu, [email protected]

deeplung's People

Contributors

wentaozhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deeplung's Issues

About the test results

Hello, teacher.

I run before the test, in part due to insufficient memory, I use a total of three figures, run frocwrtdetpepchluna16. Py and noduleCADEvaluationLUNA16 py document gets a result;

Recently, I added all the data, and ran the detection part with ten data again. Running the two files above, I got a result.

Oddly, the results of these two runs are exactly the same. What's causing this?

Thanks for comment!

why you put coord in net?

  when the net forward:  out8 = self.layer6(torch.cat((out2, out7, coord), 1))。if not add coord seems ok?

Confused about Faster R-CNN

I have read the code and paper. The paper mentioned that Faster R-CNN is used in detection part. But I didn't see Faster R-CNN in the folder ./detector . I search for RPN or ROI Pooling but get nothing.

Did you complete Faster-RCNN function in the data preprocessing part?
Or is it just using RCNN? (If my understanding of the code is correct, the original image was partitioned and data-enhanced during preprocessing, and then used as input to the model. Looks like RCNN)

about det2cls.py

Hello, in det2cls.py file, what is the file resmodelpath = './detcls-'+ STR (fold)+' old/ ckptgbit.t7 '?

I don't show this file here, but when I run the det2cls.py file, it always shows that the file is not found.

Thanks for your advice!

9db5b1cd42119240770f8f13a9fb41b
cd1078b92d760c9df0b2c5a7412ca20

about 'annotationdetclsconvfnl_v3.csv' file in your repository

Hi, I am working on a project to classify lung CT scan (cancer/no-cancer) on luna16 dataset using CNN.
Is your file 'annotationdetclsconvfnl_v3.csv' can be used for that purpose? because the file contains cancer class. where did you get this file? because both LIDC-IDRI and luna16 dataset does not have this file. have you created it by yourself based on nodule diameter? can you tell me more detail

What is the reason for the following error when I test times

results/res18/retrft969/bbox
(18, 1, 208, 208, 208)
main.py:327: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
input = Variable(data[splitlist[i]:splitlist[i+1]], volatile = True).cuda()
main.py:328: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
inputcoord = Variable(coord[splitlist[i]:splitlist[i+1]], volatile = True).cuda()
Traceback (most recent call last):
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/multiprocessing/queues.py", line 268, in _feed
send(obj)
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/multiprocessing/queue.py", line 18, in send
self.send_bytes(buf.getvalue())
IOError: [Errno 32] Broken pipe
Traceback (most recent call last):
File "main.py", line 387, in
main()
File "main.py", line 148, in main
test(test_loader, net, get_pbb, save_dir,config)
File "main.py", line 333, in test
output = net(input,inputcoord)
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/zlf/DeepLung/detector/res18.py", line 97, in forward
out = self.preBlock(x)#16
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/nn/modules/module.py", line 493, in call
result = self.forward(*input, **kwargs)
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 476, in forward
self.padding, self.dilation, self.groups)
File "/home/zlf/anaconda3/envs/deeplung/lib/python2.7/site-packages/torch/utils/data/_utils/signal_handling.py", line 63, in handler
_error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 23743) is killed by signal: Killed.

ground truth images

Your study is very impressive. Could you share a link to download ground truth images?

related to mhd files of luna16 dataset

Hello, I'm getting the following issue. When i download the Luna16 dataset some of mhd files are not present. Did you face the same problem? So the Preprocessing work cannot be carried out.
Is there any other option to download the luna16 dataset.

The extclsshpinfo.py "find the match from LIDC-IDRI annotation part", I think there are some mistake

Dear wentao,

When I read the extclsshpinfo.py, I find the "find the match from LIDC-IDRI annotation part" make some mistake.

  • First,the 71th line in the extclsshpinfo.py,voxcrd[-1] = sliceim.shape[0] - voxcrd[0],it aim to do filp for z,so I think it should be voxcrd[0] = sliceim.shape[0] - voxcrd[0].

  • Second,the 154th~156th lines, voxcrd for z, y, x, but lidcant for x, y, z. so I think it should be
    dist = math.pow(voxcrd[0] - lidcant[5], 2) # z
    dist += math.pow(voxcrd[1] - lidcant[4], 2) # y
    dist += math.pow(voxcrd[2] - lidcant[3], 2) # x

question about a function in frocwrtdetpepchluna16.py

Dear Wentao
when I run frocwrtdetpepchluna16.py , I find that you get froclist from the function getfrocvalue,
you can see the getfrocvalue function return noduleCADEvaluation's return, but the function
noduleCADEvaluation in noduleCADEvaluationLUNA16 return nothing. So what should
noduleCADEvaluation return ?

about LIDC-IDRI data

Do you need to filter LIDC data before extracting data labels for LIDC data?

When I run the./data/extclsshpinfo.py file, it always reminds me that I can't find the 000006.dcm file.

Excuse me, why does the program specify 000006.dcm all these pieces?

In some cases, there are no such tablets as 000006.dcm. What should be done in this case?
e3ec9332aa02803670bed08eb9eb5c0

Can't reproduce the paper results.

Hi,
I can't reproduce the paper results. I've trained the detection model from scratch on luna16 dataset, but the results are not close to those on paper. Did you use a pretrained model? If so, which model and on which data is trained? Thanks in advance!

Ground Truth

Hello,
I had a query that what is ground truth image you are using for LUNA16 Data set. Is it the segmentation images provided by the challenge?
Thank you in advance.

Model

Hello, your model is Faster RCNN. I want to know what part of your RPN network is. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.