File Exchange

image thumbnail

3-D Deep Learning : Lung Tumor Segmentation

version 1.1 (2.02 MB) by Kei Otsuka
How to create and train a V-Net neural network and perform semantic segmentation of lung tumors from 3-D medical images


Updated 26 Nov 2019

View Version History

View License

Deep Learning is powerful approach to segment complex medical image.
This example shows how to create, train and evaluate a V-Net network to perform 3-D lung tumor segmentation from 3-D medical images. The steps to train the network include:
・Download and preprocess the training data.
・Create a randomPatchExtractionDatastore that feeds training data to the network.
・Define the layers of the V-Net network.
・Specify training options.
・Train the network using the trainNetwork function.

After training the V-Net network, the example performs semantic segmentation. The example evaluates the predicted segmentation by a visual comparison to the ground truth segmentation and by measuring the Dice similarity coefficient between the predicted and ground truth segmentation.

[Japanese] 医用画像処理において、Deep Learningは非常に強力なアプローチの一つです。


[Keyward] 画像処理・セグメンテーション・3次元・3-D・ディープラーニング・DeepLearning・デモ・IPCVデモ

Cite As

Kei Otsuka (2021). 3-D Deep Learning : Lung Tumor Segmentation (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (15)

kamel tawfic

I have 3-D images with size [512 512 36]. I need to run lung tumor segmentation with dataset images size [512 512 36]

I would appreciate it if you could answer.

Takato Yasuno

In this template, the input size [128 128 16] was possible.
Here, the bridge stage size is [8 8 1 c] within 49th - 62nd among whole 116 layers.
This size also enable to learn such a tumor segmentation task.

Takato Yasuno

This is a practical template. I applied to another heart CT, so the training performance is stable and surely improved accuracy.

Kei Otsuka

ネットワークに入力するデータのサイズは[64 64 64]である必要があります。セグメンテーションの対象となるデータのサイズが[64 64 64]よりも大きい場合、
その中から[64 64 64]のボリュームを切り出し、セグメンテーションの結果を得る、という流れを繰り返すことで、最終的に大きいサイズのセグメンテーションも
実現可能かと思います。セグメンテーションの対象が[128 128 128]になるようでしたら、データの切り出しを8回繰り返す感じでしょうか。

Shingo Tsuji

V-Netの入力ボリュームデータのサイズを[64 64 64]とするとセグメンテーションに用いるボリュームデータのサイズは入力ボリュームデータのサイズと同様でなければならないといけないのでしょうか?
仮にセグメンテーションに用いるボリュームデータのサイズを[128 128 128]にすると以下のエラーが発生してしまいます。

エラー: DoVnet (line 86)
層 prelu3dLayer で 'predict' を使用中にエラーが発生しました。関数がエラーをスローし、実行できませんでした。

配列の次元は、2 進数配列 op と一致しなければなりません。


Kei Otsuka

Hi Miroslav,
Thank you for pointing it out.
I have included augment3dPatch function into this submission.

Miroslav Yosifov

l can not find the augment3dPatch function, could you please add it ?

Kei Otsuka


Pre-trained network is too big to upload here.
Could you please try to train V-Net on your machine?

Atallah Baydoun

Was anyone able to download the pre-trained V Net ?

Kei Otsuka

Hi Safwana,

Trained network - lungTumor3DVNET.mat is too large to upload here.
You should train the network on your machine.

Kei Otsuka

Thank you for pointing it out.
Since FileExtensions is the parameter supported from R2019a release, can you use R2019a?

I will update the information of release compatibility for this submission.

Qing Lei Shi

Hi, Kei Otsuka, thanks for your contribution, it is very sueful for my work, but when I run the preprocess function. The following error occors. Can you give me some suggestions:
Error using pixelLabelDatastore>parseInputs (line 201)
'FileExtensions' is not a recognized parameter. For a list of valid name-value pair arguments, see the
documentation for this function.


It gives the following error while preprocess the data.
'FileExtensions' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this

Safwana Razak

can you upload lungTumor3DVNet.mat. thank you.

Takuji Fukumoto

MATLAB Release Compatibility
Created with R2019b
Compatible with R2019b
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!