However, images that are synthesized using generative methods can extract information from the entire dataset. These methods learn the underlying distribution of the dataset , . 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 . GANs have been used for style transfer , texture synthesis  and image-to-image transformations . GANs are comprised of two competing networks involved in a minimax game . While the generatordiscriminator decides if the data is generated or original. Conditional generative adversarial networks are an extension of this approach . 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 . Deep learning algorithms learn better fitting models when there are large amounts of diverse data. 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 . While studying the effectiveness of data augmentation, the authors of  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  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 , 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  and V-Net  for volumetric segmentation. These segmentation approaches still benefit from data augmentation. Image style transfer 
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 fromnormal 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.
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)  suitable for this application.
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) 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 
. 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 .
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. 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 . 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.
There are a variety of methods to determine how blurry an image is 3]
. 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. 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.
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  of the image to image translation implementation . 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 . 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 . 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 . 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 , 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 .
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.
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 Section3.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.
|+ GAN generated||.323||.489||.571|
|+ traditional aug.||.352||.529||.580|
|Entire dataset (100%)||0.628|
|+ GAN generated||.519||.719||.810||.479||.684||.757|
|+ traditional aug.||.549||.762||.834||.502||.724||.763|
|Entire dataset (100%)||0.850||0.802|
|+ GAN generated||.773||.513||.672||.602||.456||.603|
|+ traditional augment||.782||.553||.612||.635||.481||.613|
|+ GAN generated||.816||.685||.738||.691||.630||.712|
|+ traditional augment||.818||.702||.768||.737||.645||.734|
|+ GAN generated||.832||.748||.832||.766||.652||.766|
|+ traditional augment||.828||.737||.837||.781||.652||.767|
|100% (Entire Dataset)||.842||.760||.872||.817||.657||.789|
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.
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.
-  (2018) Pros and cons of gan evaluation measures. arXiv preprint arXiv:1802.03446. Cited by: §3.2.1.
-  (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.
-  (2013) Image sharpness measure for blurred images in frequency domain. Procedia Engineering 64, pp. 149–158. Cited by: §3.2.2.
-  (2018) Synthetic data augmentation using gan for improved liver lesion classification. arXiv preprint arXiv:1801.02385. Cited by: §2.
Image style transfer using convolutional neural networks.
Computer Vision and Pattern Recognition (CVPR), 2016 IEEE Conference on, pp. 2414–2423. Cited by: §2.
-  (2016) Deep learning. Vol. 1, MIT press Cambridge. Cited by: §2.
-  (2014) Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680. Cited by: §1, §1.
-  (2017) Brain tumor segmentation with deep neural networks. Medical image analysis 35, pp. 18–31. Cited by: §2.
-  (2017) Image-to-image translation in tensorflow - affine layer. External Links: Cited by: §4.2, §4.
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.
-  (2013) Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114. Cited by: §1.
-  (2012) Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105. Cited by: §1.
-  (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.
-  (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.
-  (2014) Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784. Cited by: §1.
-  (2017) The effectiveness of data augmentation in image classification using deep learning. arXiv preprint arXiv:1712.04621. Cited by: §2.
-  (2013) Analysis of focus measure operators for shape-from-focus. Pattern Recognition 46 (5), pp. 1415–1432. Cited by: §3.2.2.
-  (2015) Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434. Cited by: §1.
-  (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.
-  (2016) The image processing handbook. CRC press. Cited by: §3.2.2.
-  (2014) Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556. Cited by: §4.1.
-  (2015) Going deeper with convolutions. Cited by: §1, §4.
-  (2015) A note on the evaluation of generative models. arXiv preprint arXiv:1511.01844. Cited by: §3.2.
-  (2016) Data mining: practical machine learning tools and techniques. Morgan Kaufmann. Cited by: §2.
-  (2017) Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593. Cited by: §1.