avatarDr. Alessandro Crimi

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

4641

Abstract

fno3Bj7W7Nx70p-8WSCnnmyiS4P8f8KpqJ3M">Das et al. 2013</a>). In the deep learning era, several architectures have been investigated (<a href="https://ieeexplore.ieee.org/abstract/document/7897215">Dong et al. 2017)</a></p><p id="4769">Indeed, as we show below, by using deep learning libraries as Tensorflow and a re-trained VGG it is possible to obtain good results as Area-Under-the-Curve of 0.9 even using just 10 samples for training:</p><figure id="8fc3"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*K2s75CmL0sPiJcCpnIEoyg.png"><figcaption>Thick smear image from Makere University, segmented by Rija Ramarolahy (see Ramarolahy & Crimi)</figcaption></figure><p id="c5d0"><a href="http://papers.nips.cc/paper/5423-generative-adversarial-nets.pdf">Generative adversial networks</a> (GANs) are a particular architecture which can generate data and not just classify them. The simplest way to explain them is to consider two systems which compete each other: a <i>generator</i> and a <i>discriminator. </i>They can be seen as crook printing fake money and a bank clerk checking verifying money, the first trying to create the most realistic fake money and the latter becoming better at distinguishing fake from real money. GANs architecture have reached incredible level of accuracy (where the crock definitely wins). The picture below shows the results of a GAN architecture called <a href="https://arxiv.org/abs/1809.11096">BigGAN</a> which achieved an Inception Score (IS) of 166.3.</p><figure id="4991"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*FeLN7hKJ_D3dLXelZY7WIg.png"><figcaption><a href="https://arxiv.org/abs/1809.11096">Synthetic pictures generated by BiGGan</a></figcaption></figure><p id="42dd">The use of GANs in pathology is motivated by two major factors related to data augmentation 1) to offer variability to a pathologist learning possible variation of the images in study, 2) to allow better transfer learning increasing more images. Therefore, a complete deep learning tool should include both discriminator and a generator part to benefit also the discriminator (<a href="https://www.frontiersin.org/articles/10.3389/fmed.2019.00222/full">van Eyke et al. 2019</a>).</p><p id="7a1e">We used a traditional deep convolutional architecture as the following.</p><figure id="98e9"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*MCeqqdZMC3v0bZgcBerjbA.png"><figcaption>Typical DCGAN architecture <a href="https://arxiv.org/abs/1511.06434">https://arxiv.org/abs/1511.06434</a></figcaption></figure><p id="e09f">Those are the 1000 iterations of the generator creating similar images as the real on top (with output 256x256 pixels)</p> <figure id="bba0"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F415732991%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F415732991&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F889302778_200x150.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" allowfullscreen="" frameborder="0" height="240" width="240"> </div> </div> </figure></iframe></div></div></figure><p id="ba2c">We encountered the typical difficulties of GAN generated images. First, there is a generally difficulties in creating realistic images as the discriminator is faster than the generator in converging. A solution is to give smaller learning rate e.g. (learning rate discriminator 0.00001 and generator 0.0002), alternative tricks include using soft-labels to favor the convergence of the generator.</p> <figure id="5a07"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F415733029%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F415733029&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F889303104_100x75.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" allowfullscreen="" frameborder="0" height="128" width="128"> </div> </div> </figure></iframe></div></div></figure><p id="11ed">A further important detail is represented by how the expansion steps are carried out, as the typical checkboard artifacts can appear. The adopted solution is to simply switc

Options

h out the standard deconvolutional layers for nearest-neighbor resize followed by convolution causing artifacts of different frequencies to disappear (<a href="http://papers.nips.cc/paper/6125-improved-techniques-for-training-gans.pdf">Salimans et al. 2016</a>).</p><p id="89aa">Those video represent the results by using GAN with</p> <figure id="0988"> <div> <div> <img class="ratio" src="http://placehold.it/16x9"> <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F416530017%3Fapp_id%3D122963&amp;dntp=1&amp;display_name=Vimeo&amp;url=https%3A%2F%2Fvimeo.com%2F416530017&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F890401913_100x75.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" allowfullscreen="" frameborder="0" height="128" width="128"> </div> </div> </figure></iframe></div></div></figure><p id="c28c">deconvolution (top) and nearest-neighbor resize (down) generating a single cell infected by malaria plasmoid. The nearest-neighbor resizing has qualitatively a clear impact on the quality.</p><p id="b34e">Moreover, the proposed architecture was implemented using <a href="https://tensorlayer.readthedocs.io/en/latest/">TensorLayer</a> as an alternative to Keras. Keras is a high-level library that’s built on top of Theano or TensorFlow. The key idea is to facilitate experimentation by fast prototyping, without particular preference on specific libraries, it has been recognized as a reliable abstraction for TensorFlow. Therefore, Keras might be the easy choice. However, the relatively some lower performance of Keras in TensorFlow backend has been mentioned from time to time by its users and might be related to the original design of Keras for Theano.</p><p id="a968">Hence, TensorLayer is more transparent compared with Keras though released recently (2016) as it is built straightforwardly for TensorFlow, its community is relatively small at the moment though. Below a code snipt using TensorLayer is shown</p> <figure id="4a05"> <div> <div>

            <iframe class="gist-iframe" src="/gist/alecrimi/0578fcd566c6138630ebc1b4f3eed852.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
          </div>
        </div>
    </figure></iframe></div></div></figure><p id="ee21">The full used code is available on <a href="https://github.com/alecrimi/malaria_detection_and_generation">https://github.com/alecrimi/malaria_detection_and_generation</a></p><p id="a020">In summary, digital pathology is an emerging field strongly using deep learning and artificial neural networks are useful to detect plasmoids in blood smear. In this article, it was also shown that GANs can be used to generate synthetic infected blood smears which look realistic, and can be used to increase human training on how differently a pathogen can appear and for data augmentation to further data analysis. Moreover, it is possible that in the future GANs will teach us something we do not know from histology/pathology. We are working on making this accessible to low-income countries. Here is a video presentation:</p>
    <figure id="32c5">
        <div>
          <div>
            <img class="ratio" src="http://placehold.it/16x9">
            <iframe class="" src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6ShW_CAeT2o&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6ShW_CAeT2o&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2F6ShW_CAeT2o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" allowfullscreen="" frameborder="0" height="480" width="854">
          </div>
        </div>
    </figure></iframe></div></div></figure><h1 id="e860">Connect if you want</h1><figure id="5223"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*scQHLZ3ReFqUt_n8"><figcaption><a href="https://twitter.com/Dr_Alex_Crimi">@Dr_Alex_Crimi</a></figcaption></figure><figure id="87b2"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*PIEBJkG9cu83RhTi"><figcaption><a href="https://www.instagram.com/dr.alecrimi/">@dr.alecrimi</a></figcaption></figure><figure id="addd"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/0*DgU3nXuVHXoSf-VY"><figcaption><a href="https://www.linkedin.com/in/alecrimi/">https://www.linkedin.com/in/alecrimi/</a></figcaption></figure></article></body>

Neural Networks and Malaria

What Generative Adversial Networks have to do with mosquitos

Credits PixelaBay

In this article after a brief review on malaria and Generative Neural Networks (GANs). We delve on possible application of neural networks to detect malaria plasmoids in blood smear, and how to use GANs to generate synthetic blood smear images for human training and data augmentation. In particular, details of the used architecture are discussed as upsampling and the use of TensorLayer rather than Keras.

This year has been characterized by the COVID-19 pandemic. However, in the Southern Hemisphere malaria is killing more than COVID-19, and even if it is not killing, it represents a burden for the people becoming ill in terms of lost days of work or other opportunities (WHO 2018–2020).

Malaria is a mosquito-born disease which can cause fever, tiredness, headaches and ultimately death if untreated. Eradicating malaria has been possible in some countries but cumbersome in most low-income countries. It can be compared to losing weight for a person. A general paradigm does not exist, and each country has its own issues, what worked in one country might not work in another due to infrastructures, environment and other factors. Among approaches to cope with malaria, early diagnosis fulfil a critical role. The most common method for diagnosis is still microscope inspection, which is limited to the experience of the investigator, and covariability among investigators also exist (Zimmerman et al. 2015). Other methods are rapid tests (RDT) and polymerase chain reaction (PCR). RDTs are inexpensive but can detect the diseases when the parasite count is higher than 50,000–200,000/mL of the whole blood. PCR based tests are the most accurate as they can diagnose the condition even with less than 1000 parasites/mL in blood, but it requires highly experienced personnel. Hence, in low-income countries the major practical use is still microscopy blood smear analysis. Blood smears are obtained by performing a small cut at the finger and then using a stain on a slide to characterize the presence of plasmoids. The smear can also be “thick” or “thin”, depending on whether the blood drop has been spread across the slide. Thick blood smears are mostly used to detect the presence of parasites, because they examine a larger sample of blood. Thin smears being blood spread across the slide allow the analysis of less blood, but lead higher accuracy and allow differentiation of parasite strains.

Applications of deep learning to histopathology image analysis are revolutionizing the field providing quantitative models which are effective in several fields from cancer analysis, to immunological diseases (Niazi et al. 2019), by evaluating disease progression with high accuracy. Moreover, it is believed that they AI will expand digital pathology to points far beyond what is possible today. About malaria and light sheet microscopy, several approaches have been made in the past. Generally, they were focused on background-foreground subtraction, feature extraction, and further classification via support vector machine (SVM) or random forest (Das et al. 2013). In the deep learning era, several architectures have been investigated (Dong et al. 2017)

Indeed, as we show below, by using deep learning libraries as Tensorflow and a re-trained VGG it is possible to obtain good results as Area-Under-the-Curve of 0.9 even using just 10 samples for training:

Thick smear image from Makere University, segmented by Rija Ramarolahy (see Ramarolahy & Crimi)

Generative adversial networks (GANs) are a particular architecture which can generate data and not just classify them. The simplest way to explain them is to consider two systems which compete each other: a generator and a discriminator. They can be seen as crook printing fake money and a bank clerk checking verifying money, the first trying to create the most realistic fake money and the latter becoming better at distinguishing fake from real money. GANs architecture have reached incredible level of accuracy (where the crock definitely wins). The picture below shows the results of a GAN architecture called BigGAN which achieved an Inception Score (IS) of 166.3.

Synthetic pictures generated by BiGGan

The use of GANs in pathology is motivated by two major factors related to data augmentation 1) to offer variability to a pathologist learning possible variation of the images in study, 2) to allow better transfer learning increasing more images. Therefore, a complete deep learning tool should include both discriminator and a generator part to benefit also the discriminator (van Eyke et al. 2019).

We used a traditional deep convolutional architecture as the following.

Typical DCGAN architecture https://arxiv.org/abs/1511.06434

Those are the 1000 iterations of the generator creating similar images as the real on top (with output 256x256 pixels)

We encountered the typical difficulties of GAN generated images. First, there is a generally difficulties in creating realistic images as the discriminator is faster than the generator in converging. A solution is to give smaller learning rate e.g. (learning rate discriminator 0.00001 and generator 0.0002), alternative tricks include using soft-labels to favor the convergence of the generator.

A further important detail is represented by how the expansion steps are carried out, as the typical checkboard artifacts can appear. The adopted solution is to simply switch out the standard deconvolutional layers for nearest-neighbor resize followed by convolution causing artifacts of different frequencies to disappear (Salimans et al. 2016).

Those video represent the results by using GAN with

deconvolution (top) and nearest-neighbor resize (down) generating a single cell infected by malaria plasmoid. The nearest-neighbor resizing has qualitatively a clear impact on the quality.

Moreover, the proposed architecture was implemented using TensorLayer as an alternative to Keras. Keras is a high-level library that’s built on top of Theano or TensorFlow. The key idea is to facilitate experimentation by fast prototyping, without particular preference on specific libraries, it has been recognized as a reliable abstraction for TensorFlow. Therefore, Keras might be the easy choice. However, the relatively some lower performance of Keras in TensorFlow backend has been mentioned from time to time by its users and might be related to the original design of Keras for Theano.

Hence, TensorLayer is more transparent compared with Keras though released recently (2016) as it is built straightforwardly for TensorFlow, its community is relatively small at the moment though. Below a code snipt using TensorLayer is shown

The full used code is available on https://github.com/alecrimi/malaria_detection_and_generation

In summary, digital pathology is an emerging field strongly using deep learning and artificial neural networks are useful to detect plasmoids in blood smear. In this article, it was also shown that GANs can be used to generate synthetic infected blood smears which look realistic, and can be used to increase human training on how differently a pathogen can appear and for data augmentation to further data analysis. Moreover, it is possible that in the future GANs will teach us something we do not know from histology/pathology. We are working on making this accessible to low-income countries. Here is a video presentation:

Connect if you want

@Dr_Alex_Crimi
@dr.alecrimi
https://www.linkedin.com/in/alecrimi/
Malaria
Gans
Machine Learning
Data Science
Microscopy
Recommended from ReadMedium