Lesion Conditional Image Generation for Improved Segmentation of Intracranial Hemorrhage from CT Images

03/30/2020 ∙ by Manohar Karki, et al. ∙ 0

Data augmentation can effectively resolve a scarcity of images when training machine-learning algorithms. It can make them more robust to unseen images. We present a lesion conditional Generative Adversarial Network LcGAN to generate synthetic Computed Tomography (CT) images for data augmentation. A lesion conditional image (segmented mask) is an input to both the generator and the discriminator of the LcGAN during training. The trained model generates contextual CT images based on input masks. We quantify the quality of the images by using a fully convolutional network (FCN) score and blurriness. We also train another classification network to select better synthetic images. These synthetic CT images are then augmented to our hemorrhagic lesion segmentation network. By applying this augmentation method on 2.5 of original data, segmentation improved by 12.8



There are no comments yet.


page 5

page 9

page 11

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Although deep learning architectures have solved challenging computer vision tasks in recent years

[7], [12], [22], they require large amounts of data. In the medical field, collecting this vast amount of data is still quite challenging, and models tend to overfit if trained with limited data. As a solution to this problem, synthetic data is commonly added. Standard image transformation techniques like rotations, rescaling and contrast changes are some traditional methods of augmenting image datasets. These methods provide some variations in the dataset when there are a small number of samples. Nonetheless, these methods are still limited [Hüttenrauch2016], as each new synthetic image is a transformation of a single image.

However, images that are synthesized using generative methods can extract information from the entire dataset. These methods learn the underlying distribution of the dataset [7], [11]. Each synthetic image is drawn from the distribution, rather than being transformations of a single image. The development of the Generative Adversarial Networks (GANs) has brought about practical usefulness of deep generative models [7]. GANs have been used for style transfer [25], texture synthesis [18] and image-to-image transformations [10]. GANs are comprised of two competing networks involved in a minimax game [7]. While the generator

produces data by estimating the probability distribution, the

discriminator decides if the data is generated or original. Conditional generative adversarial networks are an extension of this approach [15]. They attempt to learn multi-modal distributions with extra information, which is provided to both the generator and the discriminator. This is a flexible solution when data with specific attributes are desired.

Our contributions in this paper are as follows:

  • We present a lesion-conditional GAN to synthesize Computed Tomography (CT) images. Hemorrhagic segmented lesion, which is an input condition to the network, and the generated CT images together form a CT image label mask pair.

  • For the image generation model, we employ three criteria for evaluating image quality. These are: 1) how well these images can be segmented by a relevant segmentation model, 2) their visual quality, and 3) their perceived authenticity.

  • We examine the benefit of data augmentation with such synthetic images and segmentation label masks for a hemorrhagic segmentation network.

Deep learning algorithms for semantic segmentation also require ample amount of ground truth segmented labels (images). In this respect, our approach conveniently generates a tuple of CT images and ground truth masks from limited data. Just like traditional augmentation, the CT image-label image pair can be used with the original data without further processing. In general, a random vector is used to generate data by a GAN. However, there is more control over the type of generated data when a segmented mask is used. The performance of artificially limited amounts is evaluated by mimicking the effectiveness of our method on datasets of variable sizes.

2 Related Work

Algorithmic design choices while training models have been prevalent to regularize training. Some common methods include: in-network regularization, specialized layers for augmentation, appropriate penalty to the objective functions [6]. Deep learning algorithms learn better fitting models when there are large amounts of diverse data[2]. However, when data available is limited, data augmentation techniques can help improve performance.

Augmentation has been widely used in machine learning algorithms especially for image-based datasets [24]. While studying the effectiveness of data augmentation, the authors of [16] analyze various data augmentation methods for image classification. They train an augmentation network using concatenated images of the same class. They also compare their approach with images generated using a GAN and traditional methods. For medical images, a generative solution [4] was proposed for the classification of liver lesion. The paper studied the usage of classical data augmentation followed by a GAN based approach to generate synthetic dataset. They also trained a separate GAN network for each class.

U - Net [19], which is a popular deep learning-based approach for semantic segmentation that is curated for biomedical image segmentation worked well primarily. The authors stress the need for data augmentation in their approach. Since it is a supervised approach with an architecture built from encoder-decoder style predecessors, it still needs relatively a large amount of labeled data to train. There have been several other approaches for segmentation in medical images such as brain tumor segmentation [8] and V-Net [14] for volumetric segmentation. These segmentation approaches still benefit from data augmentation. Image style transfer [5]

is a popular convolutional neural network approach that transfers known artistic style to a normal image. A solution with this method should be considered but it still requires images from

normal patients. Image pairs could be created by merging the segmentation mask (style) into such images, but some intervention may be needed for the image compositing.

3 Method

Our proposed method employs generative adversarial networks (GANs) and takes masked lesion images as a condition to translate them into lesion corresponding CT images. Using the combination of generated images and some traditional transformations, a larger dataset is built. The segmentation architecture is a modified fully convolutional network (FCN-8s) [13] suitable for this application.

Figure 1: The generator architecture is based on U-Net [19] which has skip connections between higher and lower levels.

3.1 Conditional Generative Adversarial Networks

Conditional GANs (cGANs) learn the mapping of input , along with a random vector , to . The generator learns to synthesize . The discriminator also sees along with the generated data () or the target data (

) and tries to discriminate the real data from the fake ones. The objective loss function that a cGAN is trying to learn (from

[10]) is defined as follows :


When an image is the condition instead of a random vector , the same input is shown to both the generator and the discriminator. As seen in Fig. 1 and Fig. 2, the same lesion segmented image is an input to both the generator and discriminator. The LcGAN architecture follows the image to image translation approach where the discriminator makes decisions at the level of patches instead of pixels [10]

. The generator has an architecture like U-Net with skip connections between convolution and deconvolution layers, and the discriminator is simply convolutional neural network (CNN) that classifies the patches as real or fake. The condition images are segmented lesions, which are labeled for different types of hemorrhages. The segmented lesions help to steer the generation of CT images. The hemorrhage image (

) and its segmentation mask () are input to the generator during the training. The segmentation mask is also used as input to the discriminator along with the real CT image () or the generated CT image () from the generator. The generator loss includes L1 loss since it has been known to yield less blurry images [10].

Figure 2: Discriminator architecture is based on image to image translation [10]. Final output image (30 x 30) corresponds to results from all patches (70 x 70) over the original image.

3.2 Image Quality Criteria

The ultimate goal of generating synthetic images is to aid the training of the segmentation network. For this reason, LcGAN models generating the best synthetic images must be chosen. GANs learn the loss function during the training which makes it impractical to determine the best fitting model. Different LcGAN

models with different hyperparameters yield with diverse qualities of images. The quality of images generated by such models can determine the best model. Quality of generated images is difficult to quantify. Several methods have been proposed for this problem

[23]. However, since there is absence of universally accepted metric, we use the following metrics to measure the quality of images generated by LcGAN models.

3.2.1 FCN Score

The most common way of evaluating images, which are generated using GANs, is to use another network trained on a similar dataset [1]. The classification performance of the generated images on the network is called Inception Score and it represents the quality of the images. For segmentation tasks, it is more appropriate to use a segmentation performance value. When a fully convolutional network is used for the segmentation, the dice similarity coefficient can be used as metrics to measure the quality of images. However, upon inspection, images with comparable fully convolutional network (FCN) segmentation scores sometimes had very different quality. Fig. 3 shows examples of some images that have almost identical FCN scores, but the visual quality is quite different. While this is the most important metrics that eventually defines how our augmentation data improves our intended performance, we also present two other metrics to establish the quality of generated data.

Figure 3: Examples of generated images from different LcGAN models using 10% data with high FCN Scores all belonging to the same class (EDH).

3.2.2 Blurriness

There are a variety of methods to determine how blurry an image is [20]

. Images can be converted to the frequency domain using fast Fourier transform to check the presence of high level features


. Blurry images will lack such features. The mean of all values in the frequency domain is assigned as blurriness value for the image. Another option, we chose, is the variance of Laplacian of each individual image

[17]. Laplacian is used for edge detection in images to determine vast intensity changes. Images that are not blurry will have sharp edges. For each of these methods, the mean blurriness of the entire set of images derived from a trained LcGAN model can then be calculated. Both methods have drawbacks in determining blurriness in natural images. Natural images can be blurry locally in small regions and sharp in other areas. Brain CT images are more homogenous as they have salient pixels in the central region surrounded by background pixels (black) in the edges. Hence, the comparison of blurriness calculated by these two approaches are meaningful.

3.2.3 CNN based Classifier

Some of the images, which had high FCN scores, were not very blurry but had unnatural patches. The second image in Fig. 3 is an example of this. Another convolutional neural network (CNN) based classifier can act like a discriminator and choose realistic synthetic images. Using a combination of generated images with different parameters and the original images, a CNN is trained to distinguish between the original and the generated images. While a probability of 50% would be used for classification of two-class problem (real and fake), more fake images can be deemed acceptable by decreasing the threshold. Ideally, the best generative model should generate images that are harder to distinguish with this classifier. Models that can fool this classifier by generating the largest number of realistic images are chosen to generate the augmented data.

4 Experiment

For our experiments, a NVIDIA Tesla V100 GPU was used with TensorFlow and Caffe frameworks. During these experiments, CT images consisting of at least one type of hemorrhage were included. There are 5 different types of intracranial hemorrhages that were segmented: 1) Intraparenchymal (IPH) 2) Intraventricular (IVH) 3) Subarachnoid (SAH) 4) Epidural (EDH) 5) Subdural (SDH). There was a total of 2117 patients’ data in the training set and 660 patients’ data in the testing set. Some patients had more images compared to others, and the data was selected based on patients. Each cross validation set still had similar number of image samples. Each set had 26k training and 6k validation hemorrhagic CT images. On the entire dataset, augmentation did not yield any improvements during the segmentation. We then limited the size of the training data from the original dataset and improved the performance of the limited dataset with augmentation.

The synthetic image generation method using cGAN is developed from the TensorFlow adaptation [9] of the image to image translation implementation [10]. Only the synthetic images created from the constrained dataset were used to augment the constrained dataset. The CNN used for determining the quality of synthetic images was based on GoogleNet architecture [22]. Original images and equal numbers of generated images from each of the trained models were used for training and validation of the network.

4.1 Training the fully convolutional network

In segmenting the hemorrhagic lesions on the CT images, a fully convolutional network (FCN) was used. By replacing the fully connected layers of a conventional convolutional network, fully convolutional networks were designed, and they have been widely used to segment regions in images [13]. The network consists of an encoder-decoder style architecture where segmentation mask is the final output. Our FCN uses the weights from a pretrained VGG-16 model [21]. Augmented data is fed into this network along with the original data in order to improve the segmentation.

Dice Similarity Coefficient:

Segmentation by FCN was evaluated by using the Dice Similarity Coefficient (DSC). Using the original validation set, each of the models trained with various percentages (2.5%, 10%, 25%) of the total images was evaluated. A large part of the images consists of background pixels. The inclusion of the background class during calculation is not very useful in measuring subtle improvements in performance. Hence, background pixels were ignored during the evaluation. For the performance of segmentation, DSC metrics have been widely used, especially for medical images. It is based on the ratio of overlapping area of the segmented output (S) and ground truth (G) to the total area of both. The DSC performance is calculated for each image and averaged over the entire evaluation set.


The precision and recall of the entire test set are also evaluated by only accounting for each prediction that passes certain thresholds. These thresholds are based on the number of pixels in the image and DSC value. A false positive detection with less than 200 pixels area and a true positive detection where DSC score is less than .25 are not included. Instances where there were only a few pixels detected, were thus considered as noise and thus, ignored.

4.2 Training the lesion conditional GAN

The LcGAN algorithm uses the segmentation masks of the original CT images to generate synthetic CT images. The size of the original dataset is increased to two-fold as every time each ground truth mask generates a new synthetic CT image based on it. During the LcGAN training process, which follows the flow of image to image translation [10], hemorrhage segments were used for the inputs to both the generator for synthetic image generation and to the discriminator along with the real or fake image. After the training, the best models were chosen based on our criteria for image quality. With these models and label images from the training data, more data was generated. They are then augmented to original data for training the segmentation algorithm. For training the LcGAN, we used Adam solver and fixed our initial learning rate () of .0002 and momentum (

) of .5 and trained for 10, 50, 100 and 200 epochs. The number of filters for each layer of the generator and discriminator is shown in Fig.

1 and 2 respectively. These values are based on the image-image translation implementation in TensorFlow [9].

Figure 4: Image generation and evaluation scheme. A segmentation model is trained using the full training dataset and generative models are trained with subsets of the original set. Following that, the testing set is used to evaluate the models.

The training and evaluation steps are shown in Fig. 4. The LcGAN models are trained with N% of the original training data. When selecting the N% of patients’ data, all images from each selected patient was used. These images are then evaluated using FCN score, blurriness and the probability value from the CNN classifier. The models that generate the best images based on these metrics are chosen to augment the same N% of data. For the experiments, 2.5%, 10% and 25% of the total number patients and their CT images were used.

4.3 Traditional Augmentation

Reducing the sizes of data makes the data less diverse and traditional augmentation provides some variance to the dataset. Among the traditional data augmentation methods, only those with techniques that are suitable for medical images were chosen. Affine transformations such as rotation, rescaling, shearing and cropping, as well as pixel level contrast changes and blurring were applied to the selected training images. Fig. 5 shows some examples of the images after such transformations. In all cases, the addition of these transformations was intended to mimic slight and plausible variations that may occur in such images. Each image was transformed with a certain random level of each transformation and hence another dataset was created of the same size. This dataset was then augmented to the original data during FCN training. Transformation levels for rotation were -25 to 25 degrees, rescale were -15 to 15 percent increase and shear were -10 to 10 pixels horizontally. Images were also blurred, and the pixel intensities were changed with a probability of 50% for each. In these cases, gaussian blur was applied with radius 2 and for contrast changes, each pixel intensity was increased randomly by up to 50%. When needed, label images are appropriately transformed so that they match the transformed CT images.

Figure 5: Examples with images with different transformations. Each image is transformed with multiple types of augmentation such as rotations, contrast changes, blurring and rescaling. From a specific range of values, random levels are chosen for each transformation.

5 Results and Discussion

As mentioned before in the evaluation criteria, background class was ignored during evaluation. Background class consists of large amounts of black pixels all around the brain, and other non-hemorrhage pixels constituting the brain. This allowed a better judgement on performance improvements in the desired classes. Fig. 6 shows some examples of generated images (Output). While some of the images are visually like the Target, others have some differences. Some desired variance between the original CT image and synthetic counterpart can be observed. The combination of the data augmentation improved performance in each investigated category. Comparatively high FCN scores and low average blurriness were criteria for good models. Chosen models also had the most number of generated images misclassified as real by the CNN classifier. The threshold for CNN classifier was lowered to 10% (instead of 50%).

When augmentation was done to the full original dataset, the improvements on each of the metrics was less than 1%. Adding augmented data (which includes some noisy data) also made the training harder and took significantly more time for large sizes of data. The evaluation metrics defined in Section

3.2 were applied to choose the best models trained on each size of data (2.5%, 10%, 25%). As shown in Table. 1, the DSC value increased by 13% for 2.5%, 6% for 10% and 2% when 25% of data was used. Table 1 and 2 show the performance, on various metrics, of selected number of images and the augmentation by GAN generated images, traditional augmentation and with the addition of both. When 25% of the original data was used, the DSC segmentation was 3% worse than using the full (100%) data. This difference reduced to 2% upon augmentation.

Figure 6: Different hemorrhage types and corresponding generated CT images. On each example, a ground truth image (Original) is used as condition to the input CT image (Target) generating another synthetic CT image (Output).
2.5% 10% 25%
Selected (Original) .244 .478 .565
+ GAN generated .323 .489 .571
+ traditional aug. .352 .529 .580
+ both .371 .538 .581
Entire dataset (100%) 0.628
Table 1: DSC Segmentation performance with various amounts of training data
Precision Recall
2.5% 10% 25% 2.5% 10% 25%
Selected (Original) .408 .695 .809 .360 .681 .747
+ GAN generated .519 .719 .810 .479 .684 .757
+ traditional aug. .549 .762 .834 .502 .724 .763
+ both .607 .766 .844 .540 .737 .777
Entire dataset (100%) 0.850 0.802
Table 2: Overall precision and recall performance with various amounts of training data
2.5% (Original) .772 .186 .424 .558 .246 .427
+ GAN generated .773 .513 .672 .602 .456 .603
+ traditional augment .782 .553 .612 .635 .481 .613
+ both .777 .517 .708 .642 .529 .635
10% (Original) .809 .682 .716 .690 .629 .705
+ GAN generated .816 .685 .738 .691 .630 .712
+ traditional augment .818 .702 .768 .737 .645 .734
+ both .821 .715 .775 .752 .636 .740
25% (Original) .829 .737 .811 .767 .654 .760
+ GAN generated .832 .748 .832 .766 .652 .766
+ traditional augment .828 .737 .837 .781 .652 .767
+ both .832 .750 .837 .780 .653 .771
100% (Entire Dataset) .842 .760 .872 .817 .657 .789
Table 3: Segmentation performance (DSC) for each class using various % of training data

Performance of each of the classes improved mostly with augmentation. However, in some cases the performance of segmentation on some classes was slightly worse but significantly better on others as shown in Table 3. The DSC score for segmentation is calculated without any thresholds. This is the single performance criteria that was used to monitor the progress of training the segmentation model. Fig. 7 shows that as the number of data increased the effect of augmentation on performance decreased. When separately compared, traditional augmentation had better performance than the generative approach. But in almost all comparisons, the combination of both had the best performance. Adding traditional augmentation to the generative algorithm training did not yield any overall improvements.

Figure 7: DSC, recall and precision improvement with various percentages of data with combined augmentation

6 Conclusion and Future Work

We present a conditionally generative adversarial algorithm to enhance the segmentation performance of hemorrhagic lesions in CT images. Training with a condition based on the ground truth empirical image creates a data-label pair of images, which is ready for augmentation. In conclusion, performance of segmentation models trained with smaller sizes of data benefited more from the addition of synthetic data. The difference in performance between the constrained and the full datasets was reduced considerably when the traditional and GAN generated augmentation methods were combined. Further refinement can be done in training the generative network to be able to quantify the quality of images. Ground truth labels that are considered to be plausible by experts; but not labeled from existing CT hemorrhages could be used to generate more CT images. Also, an end-to-end system could simplify the training and reduce disk space.


  • [1] A. Borji (2018) Pros and cons of gan evaluation measures. arXiv preprint arXiv:1802.03446. Cited by: §3.2.1.
  • [2] J. Cho, K. Lee, E. Shin, G. Choy, and S. Do (2015) How much data is needed to train a medical image deep learning system to achieve necessary high accuracy?. arXiv preprint arXiv:1511.06348. Cited by: §2.
  • [3] K. De and V. Masilamani (2013) Image sharpness measure for blurred images in frequency domain. Procedia Engineering 64, pp. 149–158. Cited by: §3.2.2.
  • [4] M. Frid-Adar, E. Klang, M. Amitai, J. Goldberger, and H. Greenspan (2018) Synthetic data augmentation using gan for improved liver lesion classification. arXiv preprint arXiv:1801.02385. Cited by: §2.
  • [5] L. A. Gatys, A. S. Ecker, and M. Bethge (2016) Image style transfer using convolutional neural networks. In

    Computer Vision and Pattern Recognition (CVPR), 2016 IEEE Conference on

    pp. 2414–2423. Cited by: §2.
  • [6] I. Goodfellow, Y. Bengio, A. Courville, and Y. Bengio (2016) Deep learning. Vol. 1, MIT press Cambridge. Cited by: §2.
  • [7] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio (2014) Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680. Cited by: §1, §1.
  • [8] M. Havaei, A. Davy, D. Warde-Farley, A. Biard, A. Courville, Y. Bengio, C. Pal, P. Jodoin, and H. Larochelle (2017) Brain tumor segmentation with deep neural networks. Medical image analysis 35, pp. 18–31. Cited by: §2.
  • [9] C. Hesse (2017) Image-to-image translation in tensorflow - affine layer. External Links: Link Cited by: §4.2, §4.
  • [10] P. Isola, J. Zhu, T. Zhou, and A. A. Efros (2016)

    Image-to-image translation with conditional adversarial networks

    arXiv preprint arXiv:1611.07004. Cited by: §1, Figure 2, §3.1, §3.1, §4.2, §4.
  • [11] D. P. Kingma and M. Welling (2013) Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114. Cited by: §1.
  • [12] A. Krizhevsky, I. Sutskever, and G. E. Hinton (2012) Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105. Cited by: §1.
  • [13] J. Long, E. Shelhamer, and T. Darrell (2015) Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3431–3440. Cited by: §3, §4.1.
  • [14] F. Milletari, N. Navab, and S. Ahmadi (2016) V-net: fully convolutional neural networks for volumetric medical image segmentation. In 3D Vision (3DV), 2016 Fourth International Conference on, pp. 565–571. Cited by: §2.
  • [15] M. Mirza and S. Osindero (2014) Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784. Cited by: §1.
  • [16] L. Perez and J. Wang (2017) The effectiveness of data augmentation in image classification using deep learning. arXiv preprint arXiv:1712.04621. Cited by: §2.
  • [17] S. Pertuz, D. Puig, and M. A. Garcia (2013) Analysis of focus measure operators for shape-from-focus. Pattern Recognition 46 (5), pp. 1415–1432. Cited by: §3.2.2.
  • [18] A. Radford, L. Metz, and S. Chintala (2015) Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434. Cited by: §1.
  • [19] O. Ronneberger, P. Fischer, and T. Brox (2015) U-net: convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234–241. Cited by: §2, Figure 1.
  • [20] J. C. Russ (2016) The image processing handbook. CRC press. Cited by: §3.2.2.
  • [21] K. Simonyan and A. Zisserman (2014) Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. Cited by: §4.1.
  • [22] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, A. Rabinovich, et al. (2015) Going deeper with convolutions. Cited by: §1, §4.
  • [23] L. Theis, A. v. d. Oord, and M. Bethge (2015) A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844. Cited by: §3.2.
  • [24] I. H. Witten, E. Frank, M. A. Hall, and C. J. Pal (2016) Data mining: practical machine learning tools and techniques. Morgan Kaufmann. Cited by: §2.
  • [25] J. Zhu, T. Park, P. Isola, and A. A. Efros (2017) Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593. Cited by: §1.