Giter Site home page Giter Site logo

junqiangchen / luna16-lung-nodule-analysis-2016-challenge Goto Github PK

View Code? Open in Web Editor NEW
249.0 9.0 85.0 1.87 MB

LUNA16-Lung-Nodule-Analysis-2016-Challenge

Home Page: https://luna16.grand-challenge.org/

Python 92.27% Jupyter Notebook 7.73%
lung-cancer-detection vnet resnet classification detection tensroflow python lidc-dataset luna16

luna16-lung-nodule-analysis-2016-challenge's Introduction

LUNA16-LUng-Nodule-Analysis-2016-Challenge

This is an example of the CT images lung nodule detection and false positive reduction from LUNA16-LUng-Nodule-Analysis-2016-Challenge

Prerequisities

The following dependencies are needed:

  • numpy >= 1.11.1
  • SimpleITK >=1.0.1
  • opencv-python >=3.3.0
  • tensorflow-gpu ==1.8.0
  • pandas >=0.20.1
  • scikit-learn >= 0.17.1

How to Use

1、Preprocess

nodule detection

  • convert annotation.csv file to image mask file:run the LUNA_mask_extraction.py
  • analyze the ct image,and get the slice thickness and window width and position:run the dataAnaly.py
  • generate lung nodule ct image and mask:run the data2dprepare.py
  • generate patch(96,96,16) lung nodule image and mask:run the data3dprepare.py
  • save lung nodule data and mask into csv file run the utils.py,like this:G:\Data\segmentation\Image/0_161....

nodule classify

  • convert candidates.csv file to nodule and not-nodule image(48,48,48):run the LUNA_node_extraction.py
  • Augment the nodule image data: run the Augmain.py
  • split data into train data(80%) and test data(20%):run the subset.py
  • save lung nodule data and label into csv file like this:1,G:\Data\classify\1_aug/0_17.npy

2、Nodule Detection

  • the VNet model

  • train and predict in the script of vnet3d_train.py and vnet3d_predict.py

3、False Positive Reducution

  • the ResVGGNet model

  • train and predict in the script of ResNet3d_train.py and ResNet3d_predict.py

4、download trained model

Result

1、Nodule Detection

  • train loss and train accuracy

  • the segment result

2、False Positive Reducution

  • train loss and train accuracy

  • ROC,Confusion Matrix and Metrics

Contact

luna16-lung-nodule-analysis-2016-challenge's People

Contributors

donkeybobo avatar junqiangchen avatar minshenhao1 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

luna16-lung-nodule-analysis-2016-challenge's Issues

Prediction result

I have trained your models. The results are good by your way.
But when I tested on dataset without segmentation techniques. The results for nodule class(label = 1) is very poor.
Do you think about it ? the test set should not be augmented.

I also want to download your trained models, but it is impossible with foreigners.
Why you do not upload on github ??

Thank you very much

Citation missing!

Hello, it would be helpful if the paper presenting the work in this repo be cited here for reference.

Any elaboration would be much appreciated :) thanks in advance.

How to test a complete 3D image?

I want to know how can we test a complete 3D image? If I have a 3D image (512512300), how to generate the nodule? Is there a such test code?
In addition, how to generate the confusion matrix and metrics?

about the dataprcessing

陈老师,你好
我运行数据预处理部分的LUNA_node_extraction.py时,本来应该是生成classification文件夹的,但是我运行后没有结果。调试了一下代码发现line 93处的 if mini_df.shape[0] > 0: 这个判断都没有进去。尝试在此之前添加了一句print(mini_df.shape[0]),发现全部都是零。
多谢老师指教

良恶性分类

您好,感谢您的代码!但在运行分类代码的过程中遇到了无法生成分类文件0和1的问题,请问怎么解决?万分感激。

data3prepare.py

您好:
在data3prepare.py中,如果不想切出太多的sub_image,可以把numberxy=10, numberz=6
改成numberxy=3, numberz=20吗?

How to run Step 4

Hello, when you run your program, you encounter some doubts. When I finished running Parts 1-3, I encountered difficulties in running Part 4. I don't know how to save the generated mask to the CSV file. Do you need to write your own code, or which Python file do you want to run? I hope to get your help.
Thank you.

结节假阳性二分类数据划分

请问在肺结节假阳性二分类的时候,代码结果是采用的了全部的结节数据集吗?因为我看到这个任务的正样本有1300+而负样本有5'000'000+

GPU

Hello !
On what GPU did you run the training?
Thanks !

subset.py的一些疑惑?

您好!正在复现您项目的分类部分,遇到了点问题,不是很理解subset.py文件的运行机理,
具体是里面的sys.argv[1]所对应的文件是什么?望解惑!感谢

假阳性减少

您好,我之前用luna16数据集已经进行了肺结节的检测,检测结果是假阳性高,想用您的假阳性减少这一模块来去假阳。我看到ResNet3d_train.py这代码里面涉及到nodel_all_train.csv这一文件,但是我没有找到这一文件。请问是不能直接用去假阳这一模块吗?还是有什么解决办法呢?谢谢,祝好!

执行了3、4天的epoch是5吗?

抱歉,又来打扰了,我可能对工程做了点修改,根据现在的情况,感觉单卡训练5个epoch要3、4天;

因为5个epoch确实比着其他工程确实太少了,不太确定是不是我的修改有问题,下图(工程里的loss曲线时间是4天)的时间就是执行了5个epoch的时间吗?
lossDownload

良恶 trainloss不下降

你好,我按照你的代码执行良恶数据处理后训练后loss一直在0.5-0.6几震荡,增加了epoch和BN层以及去除数据增强都没有作用,请问你在LUNA2022中得到的训练结果图是执行的这个代码吗?

关于dice loss

您好,我复现了您的程序,觉得很有收获,只是有一个疑问就是您的loss = -dice,我觉得这里应该是1-dice。祝好。

数据集问题

您好,请问您的原始数据是怎么存放的,可以给出您数据的目录吗?

Mis-matching Total number of candidates

Hello,

after evaluating the predictions file (i.e. METU_VISION_FPRED.csv) using the LUNA16 official script (i.e. noduleCADEvaluationLUNA16.py), I get an output (CADAnalysis.txt) like this :

CADAnalysis.txt

CAD Analysis: METU_VISION_FPRED

Candidate detection results:
True positives: 1128
False positives: 81706
False negatives: 58
True negatives: 0
Total number of candidates: 87794
Total number of nodules: 1186
Ignored candidates on excluded nodules: 4600
Ignored candidates which were double detections on a nodule: 360
Sensitivity: 0.951096121
Average number of candidates per scan: 98.867117117

From what I understand, the the Total number of candidates should be 754,975 according to https://luna16.grand-challenge.org/Evaluation/

Even though METU_VISION_FPRED.csv has 754,975 candidates!! the CADAnalysis.txt still says Total number of candidates: 87794 !!!!!

Looking forward to hearing back from you. Any help is extremely appreciated.

Many thanks.

Any idea why that happens?? Am I missing something?

测试结果的计算

很抱歉,再次打扰一下,想问一下工程里有关于测试结果统计的脚本吗?比如工程中的这个

Confusion_Matrix

良恶性分类

您好,我阅读了您的文章并尝试了分类相关的程序,您提到的良恶性分类,然后实际上 0 代表非结节, 1 代表结节, 没有良恶性相关的区分,我有点困惑您提到的良恶性分类是如何做到的

Ensembling both models for inference

Hello,

Thanks for sharing your work. Are the 2 models meant to ensemble, chain or otherwise combine in some way? I am wondering how you use the Resnet to reduce FP in the Vnet mask output. Thanks!

Augmain.py file is not executing

Dear Sir, your work is helped me a lot in that I'm facing following problem,
please suggest how to run Augmain.py in spyder. when I run it showing following error:

File "D:\mywork\LUNA16 Master\Augmain.py", line 1, in
from dataaugmentation.Augmentation.ImageAugmentation import DataAug3D

ModuleNotFoundError: No module named 'dataaugmentation'

So, please provide the solution for above problem.

thank for advance

运行的几点疑惑

你好,看过工程的readme,有几点疑惑希望能够得到解答;

1、中看过处理的9个步骤,我的理解是1~4重新生成了一次图片的掩膜文件和mhd中的坐标、和尺寸信息,根据luna官方给的数据是不是5~9才是必要的?

2、工程需要的tensorflow是那个版本,仅用GPU可以跑吗?

我想将其转为pytorch来实现,如果你感觉有什么建议或者要注意的,希望可以指教一下,拜谢!

data3dprepare.py

师兄您好,请问您运行data3dprepare.py共花了多长时间呀?我按您的代码,运行3天了,最后崩在了第154-179个生成文件上面是不是我是不是哪里出了问题呀?暂时没改变您在data3dprepare.py里面写的参数

关于模型检测的问题

我发现,如果我用全黑或者全白的图片放入您的V-net中进行检测,结果却显示有结节,这显然是不科学的,但我并不知道有什么问题,不知道您有尝试过吗?

issue with Vnet Train

Dear Sir thanks for your post it helped a lot. But I'm getting following issue when executing Vnet Training:

from Vnet.model_vnet3d import Vnet3dModule

ModuleNotFoundError: No module named 'Vnet'

I'm using Anacond in Windows.

So please suggest the solution for above issue

module 'tensorflow' has no attribute 'placeholder'

When I am using this method:
Vnet3d = Vnet3dModule(128, 128, 16, channels=1, costname=("dice coefficient",), inference=True,
model_path="/content/drive/MyDrive/model/resnet.pd-50000.data-00000-of-00001")

I got this error:

in init(self, image_height, image_width, image_depth, channels, costname, inference, model_path)
195 self.channels = channels
196
--> 197 self.X = tf.placeholder("float", shape=[None, self.image_depth, self.image_height, self.image_width,
198 self.channels])
199 self.Y_gt = tf.placeholder("float", shape=[None, self.image_depth, self.image_height, self.image_width,

AttributeError: module 'tensorflow' has no attribute 'placeholder'

更新后data3dprepare.py异常

师兄您好,这几天我运行了一下您的程序,发现您更新了data3dprepare.py,但运行到
hr_samples[0, 0:blockz, 0:block_width, 0:block_height] = image[0:rangz, 0:rangwidth, 0:rangheight]
的时候报错,
TypeError: slice indices must be integers or None or have an index method
然后我发现rangz rangwidth rangheight 在前几行的计算过程得出的貌似不是整数型,
rangz = lambda imagez, blockz: imagez if imagez < blockz else blockz
rangwidth = lambda width, block_width: width if width < block_width else block_width
rangheight = lambda height, block_height: height if width < block_height else block_height
您看这里是不是需要int强制转换一下???

关于data3dprepare

你好,正在学习相关内容,想问一下data3dprepare是如何获取(96,96,16)的patch的训练数据的
该模型是否可以在原图而不是子图预测出mask

数据集csv文件生成

您好,感谢您的代码。有几个问题我想请教,希望您不吝赐教!
首先是请问这几个数据子集是在哪段代码生成的,我好像并没有找到
image
其次是这两步都是运行utils.py吗?以及要存储分类数据的话,运行完LUNA_node_extraction.py要紧接着运行utils吗?
image
由于学识尚浅,希望您能帮我解答以便我更好的理解您的代码,谢谢🙏

Vnet模型训练的问题

你好,我是一个初学者。在复现您的代码的时候,出现了一些问题,在训练Vnet模型时训练时间很短就结束了,Training_loss为-0.07308,请问可以给我一些建议吗。 还有一个疑问为什么要令Training_accuracy=-training_loss

文件缺失

No such file or directory: 'dataprocess\data\nodel_all_train.csv'

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.