Convolutional Neural Networks for Heart MRIs Segmentation

CNN image processing
By Pierre Feilles Published on Last update on



Our aim was to train a deep neural network so that so that it is then able to segment zones of interest in heart MRIs.

This is for example a heart MRI, unlabelled:

MRI image

And this is the same MRI, labelled by a cardiologist:

MRI image contoured

convolutional neural Network

Our solution is derived from the deeplab convolutional neural network designed by Chen et al. (2016 and 2017) and from its implementation in pytorch by Kazuto Nakashima (github repository)

The deeplab (v3) architecture (Chen et al, 2017):

One key element in our implementation is to set the loss definition as follows:

The best results were achieved with the deeplab v3 architecture. The batch size is set to \(2\). In the first part of the training, the learning rate is constant and is set to \(2.5 \times 10^{-4}\).

We keep the \(15000\) iterations point as the starting point of a second phase of training. This time, the learning rate is automatically decreased. It is multiplied by :

$$ (1 - \frac{iter}{max\_iter})^{0.9} $$

We obtain the following evolution of the performance:

And we keep the \(10000\) (additional) iterations checkpoint.

Overall, the total training time was \(30\) hours for the \(25000\) iterations. The training was performed on a Geforce Titan X GPU, with a batch size of 2, and each iteration would last about 4.3 seconds.


Here are two examples (from the test set) for which the prediction is rather good:

And a two more examples (from the test set) for which it is more problematic:

The performance metrics are:

$$ % outer vertical array of arrays \begin{array}{c} % inner array of mean values \begin{array}{| c | c | c | c | c | } \hline Mean IoU & Mean Dice & Mean Acc & FreqW Acc & Overall Acc \\ \hline 0.72 & 0.81 & 0.90 & 0.98 & 0.99 \\ \hline \end{array} \\ % inner array of IOU and Dice, by class \begin{array}{| c | c | c | c | c | } \hline IoU (class 0) & IoU (class 1) & Dice (class 0) & Dice (class 1) \\ \hline \textbf{0.46} & 0.99 & 0.63 & 0.99 \\ \hline \end{array} \end{array} $$

Dice: the Dice coefficient; IoU: Intersection over Union.

Class 0 corresponds to black, that is the contour being drawn. An IoU of \(0.46\) means that the prediction by the training network is rather good.


Many thanks to Raphaël Couturier and Michel Salomon from the AND research group of the femto-st institute, for their support and advice, and for providing computer time on their GPUs.

And also many thanks to Kazuto Nakashima for sharing his excellent pytorch implementation of deeplab.


comments powered by Disqus