Is a convolutional neural network inspired on the paper of (S. Pereira et al.) for the model implementation and the code of Nikki Aldeborgh
(naldeborgh7575) for the patch extraction and image preprocessing.
The model for HGG tumor modality is the following:
Layers | Input | Output |
---|---|---|
Convolution | 4x33x33 | 64x33x33 |
Leaky Relu | 64x33x33 | 64x33x33 |
Convolution | 64x33x33 | 64x33x33 |
Leaky Relu | 64x33x33 | 64x33x33 |
Convolution | 64x33x33 | 64x33x33 |
Leaky Relu | 64x33x33 | 64x33x33 |
Max Pooling | 64x33x33 | 64x16x16 |
Convolution | 64x16x16 | 128x16x16 |
Leaky Relu | 128x16x16 | 128x16x16 |
Convolution | 128x16x16 | 128x16x16 |
Convolution | 128x16x16 | 128x16x16 |
Leaky Relu | 128x16x16 | 128x16x16 |
Max Pooling | 128x16x16 | 128x7x7 |
Fully Connected | 6272 | 256 |
Fully Connected | 256 | 5 |
For LGG tumor modality instead the following
Layers | Input | Output |
---|---|---|
Convolution | 4x33x33 | 64x33x33 |
Leaky Relu | 64x33x33 | 64x33x33 |
Convolution | 64x33x33 | 64x33x33 |
Leaky Relu | 64x33x33 | 64x33x33 |
Max Pooling | 64x33x33 | 64x16x16 |
Convolution | 64x16x16 | 128x16x16 |
Leaky Relu | 128x16x16 | 128x16x16 |
Convolution | 128x16x16 | 128x16x16 |
Max Pooling | 128x16x16 | 128x7x7 |
Fully Connected | 6272 | 256 |
Fully Connected | 256 | 5 |
For both models in the and is used the SoftMax activation function.
You can find brain_pipeline here.
in Segmentaion_Model the cnn models are created and compiled. Is possible to choose between hgg or lgg model (as descibed in the article) depending from which kind of tumoral pattern is treated.
in image_png_converter there is a randomic conversion of a mha file into png file in order to output some testing material.
The workflow is described as follow:
This is the segmented image with a low number of patches 10000
For a sharpen result 100000 or 150000 patches are reccomended
user path/to/package $ python Segmentation_Model.py -option expected_value
-train','-t', set the number of data to train with default=1000 (int value expected)
-augmentation','-a', set data augmentation option through rotating angle express values in degrees, as default no augmentation is made (int value expected)
'-modality','-m', set to use model for hgg(True) or lgg(False), default=True (boolean value expected)
'-load','-l', load the model already trained, as default no load happen. insert model name as: 'model_name' (string value expected)
'-save', '-s', save the trained model in the specified path, as default no save happen( the name and all it's specification happens automatically) (no value expected)
'-test', execute test with the expressed datas (no value expected)