Data Augmentation using Generative Adversarial Network for Gastrointestinal Parasite Microscopy Image Classification

Gastrointestinal parasitic diseases represent a latent problem in developing countries; it is necessary to create a support tools for the medical diagnosis of these diseases, it is required to automate tasks such as the classification of samples of the causative parasites obtained through the microscope using methods like deep learning. However, these methods require large amounts of data. Currently, collecting these images represents a complex procedure, significant consumption of resources, and long periods. Therefore it is necessary to propose a computational solution to this problem. In this work, an approach for generating sets of synthetic images of 8 species of parasites is presented, using Deep Convolutional Adversarial Generative Networks (DCGAN). Also, looking for better results, image enhancement techniques were applied. These synthetic datasets (SD) were evaluated in a series of combinations with the real datasets (RD) using the classification task, where the highest accuracy was obtained with the pre-trained Resnet50 model (99,2%), showing that increasing the RD with SD obtained from DCGAN helps to achieve greater accuracy. Keywords—Generative Adversarial Network (GAN); Deep Convolutional Generative Adversaria Network (DCGAN); gastrointestinal parasites; classification; deep learning


I. INTRODUCTION
Diseases caused by parasites are a public health problem on a global scale; they can be of high risk and high prevalence, as shown by their incidence rates in the population. According to the World Health Organization (WHO), the malaria disease caused by the Plasmodium parasite causes 400000 deaths per year [1], and more than 2 billion people are infected with soiltransmitted helminthiases. [2].
According to the National Institute of Health of Peru (INS), intestinal parasitism increased its prevalence rate among sectors with fewer resources [3]. Although the cases registered in the south of the country with a diagnosis of intestinal parasitism were more frequent in children or people in school age 41.75%, this problem also affects people in adulthood or youth, who also presented a considerable percentage of incidence in this disease with 20.45% and 35.09%, respectively [4].
Here is the importance of addressing this problem using computational methods to implement support systems for medical diagnosis, recognition, and classification of images obtained through the microscope. However, methods based on deep learning that have had excellent results in similar applications require large datasets. The collection of medical data involves a lengthy procedure that may require applying different protocols and the intervention of a specialist. Therefore it is a task that represents a significant consumption of time and resources.
In this work, the application of two techniques for image enhancement is presented, Wiener and Wavelet, in order to obtain an improvement in the quality of the images; also, an approach to increase data is presented for the generation of synthetic training samples of microscopy images of eight species of gastrointestinal parasites, using DCGAN a variation of GAN [5], from a reduced initial dataset. In total, three sets of augmented data are generated resulting from the training of DCGAN, both for the dataset resulting from the application of image enhancement with Wiener filter, the dataset resulting from image enhancement with Wavelet denoising, and the original dataset without enhancement. The three datasets are used for training in classification models pre-trained by transfer learning, Resnet34, Resnet50, among others, independently to verify a performance improvement and compare the results obtained.
The article's structure is explained below: In Section II, related works are addressed, Section III describes the methodology used, to finish with the results and conclusions in Sections IV and V, respectively.

II. RELATED WORKS
According to the literature, various authors have applied deep learning in analyzing medical images [6], [7]. And in particular for the treatment of microscopy images of parasites [8], [9].
However, RD collection usually has a difficult and timeconsuming procedure; this generates insufficient data for experimentation with deep learning methods for tasks such as image segmentation and classification. For this reason, some authors focus on increasing datasets for better results.
To address this problem in classifying in microscopy images of parasites, some authors used: The Python Augmentor library, [10], or traditional data augmentation techniques, [11]. On the other hand, due to the problems encountered when working with layered laser scanning microscopy image data, in [12] M. Bloice et. al, present their own software package: Augmentor which is a stochastic pipeline-based augmentation (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 11, 2020 library of images and includes features relevant to the domain of biomedical images, in order to to ensure that the new data is meaningful.
In recent works, GANs have been used for the task of recognizing microscopic images of parasites [13], where through transfer learning, the authors intend to identify the parasite Toxoplasma gondii using Fuzzy Cycle Generative Adversarial Network (FCGAN) and in [10], where V. Fomene proposes a classifier for the diagnosis of malaria in rural areas using MobileNet and GAN.
GAN has even been used to the transfer between different modalities of microscopy images, as presented in [14], the authors investigate a conditional GAN in order to use the monitoring techniques of cells through the microscope: Phase Contrast (PC) and Differential Interference Contrast (DIC), passing from one to the other through the proposed algorithm. The focus of this work is to use GANs for the generation of data augmentation in order to face the problem of data deficiency for the application of deep learning models in tasks such as the segmentation [15], [16], and classification [17], [18], of microscopy images.
GANs have also been used to segmentation microscopic images of pluripotent retinal pigmented epithelial stem cells [19], where M. Majurski et al., use GAN in one of their approaches to optimize the coefficients of their Convolutional Neural Network (CNN). Some authors used Conditional GAN (CGAN), a conditional version of GAN, in which auxiliary information is fed to both the discriminator and the generator as an additional input layer [20]. This version was used to increase the dataset made up of polycrystalline iron images [15], where they also presented the transfer learning application with data fusion simulations obtained with the Monte Carlo Potts model and the image style information obtained from real images. CGAN was also used to increase the dataset of microscopic images of red blood cells [17]. The architecture that was proposed in [16], for the generation of the nuclei cell image-mask pair, consists of 2 stages where they first use a GAN to learn the data distribution of the masks and generate a synthesized binary mask and then incorporate this mask synthesized in the second GAN which also learns a mapping of the random noise vector to perform a conditional generation of the synthesized image.
On the other hand, Deep Convolutional GAN (DCGAN) has also been considered for data augmentation. DCGAN, which is a variation of GAN that uses convolutional layers in the discriminator and convolutional-transpose in the generator, where also the discriminator is composed of stridden convolution layers, batch norm layers, and LeakyReLU activations, and the generator is composed of convolutional-transpose layers, batch norm layers, and ReLU activations, [21].
R. Verma et al., present in [18], use DCGAN to generate synthetic samples of 5 classes of proteins, which were used in the classification task both before and after the increase of SD, comparing DCGAN results with those of traditional methods. In search of better results, some authors have modified the original structure of the GANs by including two discriminators [14]; it has also been considered to include U-net structural elements in their GANs [14], [19].
It has also tried to improve the quality of microscopic im-ages as preprocessing before data augmentation, such as contrast enhancement with Histogram Equalization (HE), Adaptive Histogram Equalization (AHE), and Contrast Limited Adaptive Histogram Equalization (CLAHE) [18].
Some of the resulting augmented datasets have been evaluated in pre-trained deep learning models under a transfer learning approach, such as VGG, Resnet, NasNet, Inception, MobileNet. Because these have become popular in medical image classification and segmentation work [11], [13], [18].
The review of the related works shows that the use of GANs for data augmentation is competitive, performs well, or even outperforms traditional augmentation methods.
This work's contribution is a) the improvement of the quality of the dataset of microscopy images of eight species of gastrointestinal parasites with the Wiener and Wavelet filters, b) the use of DCGAN to augment the dataset by generating SD, and c) the resulting datasets for the training of deep learning pre-trained classification models by transfer learning and finally the comparison of the results obtained.

III. MATERIALS AND METHODS
For the development of this experimental research, a process that is applied in steps was defined. The proposed methodology consists of image preprocessing with improvement techniques, use of DCGAN for data augmentation, and evaluating synthetic datasets generated by classifying images with previously trained models using the transfer-based learning approach. In Fig. 1, the methodology of the approach for this work is detailed.

A. Dataset
The dataset consists of a vector of characteristics of each image to be trained. Microscopy images of parasites were used. There are a total of 954 images: • Ascaris.
Each image from ground truth has 1200 x 1600 (height by width) and has three channels. A zoomed sample of each species of these parasites is presented in Fig. 2.

B. Image Enhancement
Two techniques were applied independently, Wiener filter and Wavelet denoising to improve the set of images.
1) Wiener filter: Wiener filter has been applied for image enhancement to reduce the additive noise and add variations in images. Wiener filter is one of the most known filters used for image enhancement [22]. 2) Wavelet denoising: Wavelet denoising has been applied with the purpose to vary characteristics in the images [23].

C. Generative Adversarial Network
CNNs are designed for data with spatial structures, and they are composed of many filters, which convolve or slide through the data and produce an activation at each slide position. These activations produce a feature map representing how much the data in that region activated the filter.
On the other hand, GANs are a type of generative model because they learn to copy the data distribution of the data they give them. Therefore, they can generate novel images that look alike. A GAN is called an "adversary" because it involves two competing networks (adversaries) trying to outwit each other.
The generator (G) is a neural network, which takes a vector of random variables (Latent Space), and produces an image igenerator.
The discriminator (D) is also a neural network, which takes an image, I, and produces a single output p, deciding Fig. 1. Methodology. Top images should correspond to a specific species of parasite; then, it could be applied filter wiener or wavelet denoising as a preprocessing technique. After this, a DCGAN is able to generate images with one generator and one discriminator. Finally, ground truth and generated images are evaluated with classifiers Resnet34, Resnet50, and VGG. The process of data augmentation is applied independently for each parasite species. Fig. 2. Parasite species: A sample of each parasite species that is addressed in this work is presented, and special characteristics of the edges of these are highlighted in the red boxes. Hymenolepis nana has (from outside to inside) a wide rim, a semitransparent middle part, and an inner part with a texture similar to the outer ring. Trichiuris trichiura has different color intensities on edge. Hookworms have a semitransparent membrane with an irregular internal shape. Enterobius vermicularis has a semitransparent membrane with an internal oval shape. the probability that the image is real. When p = 1p = 1, the discriminator strongly believes that the image is real, and when p = 0p = 0, the discriminator strongly believes that the image is false.
The discriminator (D) receives igenerator, and is taught that the image is false. In more concrete terms, the discriminator maximizes log(1−pgenerator). The discriminator receives a real image, ireal, and is taught that the image is real, or maximizes log(preal).
The generator tries to do the exact opposite; it also tries to make the discriminator maximize the probability that it believes that the false image is real, so the generator will be trying to maximize log(pgenerator) [5].
As mentioned in Section II, a DCGAN uses convolutional layers in the discriminator (D) and convolutional-transpose layers in the generator (G). The discriminator, composed of stridden convolution layers, batch norm layers, and LeakyReLU activations, receives an image and returns a scalar probability that it is from the distribution of real data.
The generator, consisting of convolutional-transpose layers, batch norm layers, and ReLU activations, receives a latent vector, z, which is extracted from a standard normal distribution and returns an RGB image [21].

D. Data Augmentation
DCGAN was used as part of the proposed methodology for the generation of synthetic images for data augmentation. For the DCGAN, binary cross-entropy is used as a loss function. And for discriminator and generator, Adam optimizers are applied with a learning rate of 0.0002. In Table I, DCGAN structure used for this work is detailed. A class called GAN is created. It imports the relevant classes and initializes the variables. A generator model was created with the following layers: • Convolutional transpose 2D layer with an input of 100x100 image with 3 channels.
These last three layers are repeated and make a block of four CBR (Convolutional Transposed 2D -Batch Normalization -ReLU) Finally, the following layers are applied: • Convolutional transpose 2D • Hyperbolic Tangent A discriminator can also become a sequential model by going in the opposite direction. The discriminator was built as a model that is governed by the following directives: • The first layer is for applying a convolution to a 64x64 image with 3 channels.
• Add a Leaky ReLU activation feature.
Finally, the following layers are applied to get the output decision: • Convolution 2D • Sigmoid

E. Evaluation
Classification task is defined to evaluate the synthetic microscopy image datasets generated by DCGAN. For this, the pre-trained deep learning models Resnet34, Resnet50, VGG16, Densenet121, and Inceptionv3 are used under a transfer learning approach.

1) Accuracy:
The metric that was chosen to evaluate the models is Accuracy1.
Applies a 2D transposed convolution operator over the image.

BatchNorm2d
Applies Batch Normalization over a 4D input.

ReLU
Applies the rectified linear unit function elementwise.

Tanh
Applies hyperbolic tangent function element-wise.

Conv2d
Applies a 2D convolution over an input signal composed of several input planes.

LeakyReLU
Applies leaky rectified linear unit function element-wise.

A. Tools and technological infrastructure
For the experimentation, the following software tools were used: Python (libraries such as Pytorch, Numpy, Scipy, Scikit Image) and Cuda. The preprocessing, training and classification tasks were performed in a workstation with a processor Intel Xeon Gold 5115 CPU, Memory 128 GB, and a Video card Quadro P5000 16GB.

B. Data Augmentation Results
DCGAN was trained separately in isolation for each of the image sets for each mentioned parasite species. The average execution time for the datasets without any image enhancement considering 15000 epochs was 11 hours; the average execution time for the datasets improved with the Wiener filter, considering 15000 epochs was 8 hours. As for the data sets improved with the Wavelet denoising. Initially, 15000 epochs were considered. However, it had to be reduced to only 3000 epochs due to the long execution time that represented a high computational cost and the small number of images generated, obtaining an average of 7 hours, Fig. 4.
The numbers of synthetic images obtained in these runs were 612 for the datasets without image enhancement, 470 for the datasets enhanced with the Wiener filter, and 159 for the datasets enhanced with Wavelet denoising. These results (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 11, 2020 represent an increase of 65.88%, 50.59%, and 17.12%, over the original dataset, respectively. Fig. 5, shows the most significant amounts of synthetic images generated for each species of parasite.
According to [16], large-scale GAN imaging and training stability is challenging. The original size of the images 1200 x 1600 was kept for the training in DCGAN; the synthetic images obtained have allowed magnifying the domain, providing a greater training ground for the classification of parasites' species. Fig. 6, shows a data grid with 64 generates synthetic images.

C. Results and Discussion
It was decided to train model using Resnet34, Resnet50, VGG16, Densenet121, and Inceptionv3, independently, resizing the images from 1200 x 1600 to 64 x 64 to improve the results and to evaluate the datasets and get a comparative view of the accuracy metric, considering only 50 epochs, with the datasets: First, only with the original RD without any preprocessing or image enhancement applied. Second, with the original RD without any preprocessing or image enhancement combined with the SD generated. Third, only with the RD obtained after applying the Wiener filter. Fourth, with the RD obtained after applying the Wiener filter combined with the SD generated from it. Fifth, only with the RD obtained after applying the Wavelet denoising and sixth, with the RD obtained after applying the Wavelet denoising combined with the SD generated from it.
The results can be seen in Table II. The best accuracy: 0.992 was obtained with the Resnet50 model, and the dataset: SD obtained after applying the Wiener filter + the RD. This shows that using SD in the image classification task improves the accuracy results.
According to the literature, no data augmentation works have been found for classification of microscopy images of the eight species of gastrointestinal parasites using DCGAN. However, the use of different techniques was found, for objectives similar to those that have been raised in the present work. M. Roder et. al, present in [24], the use of Restricted Boltzmann Machines for data augmentation and the classification of helminth eggs using Deep Belief Networks, obtaining a balanced accuracy of 92.09%, the authors worked with grayscale microscopy images , while in this work RGB scale images were used.
The work of R. Verma et al. [18] is considered a similar methodology to that described in the present work. Verma used DCGAN for the generation of SD of 5 classes of proteins and also classification models based on transfer learning with which they obtained a result of 0.924 for the accuracy measure in VGG16 training. The best result in classification was obtained with the Resnet50 model with 0.992 for the accuracy measure in this work. It should be noted that in their work, the authors used different preprocessing techniques and datasets.

V. CONCLUSIONS
DCGAN was used to increase synthetic data, and the results generated were compared through the classification www.ijacsa.thesai.org task so that greater precision was obtained with the Resnet50 model, with an accuracy of 0.992, and the dataset: RD + SD obtained after applying the Wiener filter. Other pr-trained models also showed similar results, such as Resnet34 and In-ceptionv3, with an accuracy of 0.990, both with the dataset: RD + SD obtained after applying Wavelet denoising. Therefore, it is shown that the use of RD + SD provides greater accuracy in the classification compared to using only the RD.
The combinations of datasets that gave the best results with an average accuracy of 0.961 were: RD + SD obtained from the set of images without improvements and RD + SD obtained from the set of images improved with the Wiener filter.
The highest amount of SD generated from RD was obtained without improvements (612). On the other hand, the amount of SD obtained after applying both the Wiener filter (470) and the Wavelet denoising (159) was lower due to the characteristics of the images as it highlights impurities present in the samples.
Despite the complexity and computational cost of the DCGAN training stage, an accuracy of 99.2% was achieved. However, there is still room for improvement. In the future, it is intended to find preprocessing techniques that allow improving all image sets in order to generate quality synthetic images for the eight species of parasites. It is recommended to use techniques other than Wiener filter and Wavelet denoising for Uncinaria, Trichiuris trichiura, and Enterobius vermicularis parasites that highlight their morphological characteristics to obtain better samples of synthetic data.