How Convolutional Neural Networks Are Helping Find Gastrointestinal Bleeding In Time

Medical advancements in today’s world have progressed more than ever. If we look back a few decades ago, medical applications to cure diseases were limited in number and the sector has seen a marked revolution. The reason for these advancements can be attributed to the innovative technology which has risen parallelly.

Now, disruptive technologies such as artificial intelligence and machine learning are embarking on a path to support medical innovations. Over the last few years, these areas have witnessed applications that could make a strong impact in the field of medicine. From medical diagnosis to prediction, the possibilities are numerous. In this article, we will explore how convolutional neural networks (CNN) helps identify angiodysplasia, a gastrointestinal (GI) disorder.

AIM Daily XO

Join our editors every weekday evening as they steer you through the most significant news of the day, introduce you to fresh perspectives, and provide unexpected moments of joy
Your newsletter subscriptions are subject to AIM Privacy Policy and Terms and Conditions.

What is Angiodysplasia?

Angiodysplasia is a condition occurring in blood vessels lining the GI tract, which causes vascular lesions and consequently, leads to internal bleeding. The disorder shows no symptoms initially, and if left undiagnosed can worsen the condition. Angiodysplasia is categorised according to the GI region in which they occur, such as colonic angiodysplasia (at the colon) stomach angiodysplasia (at the stomach and intestines), cecal angiodysplasia (at the cecum) and duodenal angiodysplasia (at the duodenum).

The primary cause of this disorder is yet to be ascertained. It is believed that spasms, which cause swollen blood vessels, lead to ruptures filled with blood. On the other hand, heart diseases and age-related disorders are also attributed to the cause.

Download our Mobile App

Diagnosis With Convolutional Neural Networks

The most common method for detecting GI disorders is the use of wireless capsule endoscopy. It has proven results in detecting special cases such as GI bleeding. This technique of endoscopy generally produces thousands of high resolution images in one single passing of the GI tract. With the help of this technique, a group of researchers from Massachusetts Institute of Technology and University of Michigan in collaboration with Lyft and Neuromation, have devised a novel method of incorporating CNNs in detecting angiodysplasia by analysing images obtained from wireless capsule endoscopy (WCE).

The dataset for creating the neural network architecture comes from the images captured by the endoscope capsule. A total of 1,200 images with a 576 x 576 pixel resolution in 24-bit PNG format is collected for the dataset. The dataset is segregated equally into two parts, one for training and the other for evaluation. Again, among the 600 images from one part, it is separated into two groups, one containing 300 images of noticeable angiodysplasia and the other with 300 images showing no pathology. Now, the lesions evident in angiodysplasia are analysed by experts and are marked separately as ‘binary masks’ in white.

Sample images of the training dataset. The top row represents images from healthy patients. The middle row corresponds to patients with angiodysplasia and the bottom row corresponds to ‘binary masks’ in white. (Image credits : Alexey Shvets et al.)

The study uses four deep learning architectures (CNNs) for image segmentation — U-Net, TernausNet (two variants) and AlbuNet34. All of these architectures rely on features from convolutional network models such as VGG11, which also acts as an encoder. VGG11 has seven convolutional neural layers interspersed with features such as ReLU activation function, max pooling and map feature reduction. Each of these layers has a 3 x 3 kernel. Only TernausNet uses another network variant called VGG16.

Now, for training using these architectures, they use the Jaccard Index to establish similarities. In the words of the author, the reason for choosing this is mentioned below:

“Since image segmentation task can also be considered as a pixel classification problem, we additionally use common classification loss functions, denoted as H. For a binary segmentation problem H is a binary cross entropy, while for a multi-class segmentation problem H is a categorical cross entropy.

L = H – log J

As an output of a model, we obtain an image, in which each pixel value corresponds to a probability of belonging to the area of interest or a class. The size of the output image matches the input image size. For binary segmentation, we use 0.3 as a threshold value (chosen using validation dataset) to binarize pixel probabilities. All pixel values below the speci ed threshold are set to 0, while all values above the threshold are set to 255 to produce final prediction mask.”

Outcomes from the study

The network calculations were done for an image picked from the validation set. Since CNN requires powerful processing power, NVIDIA GTX 1080Ti GPU was considered for the study. The CNNs perform very good in detecting lesions trained from the images. The architecture AlbuNet34 (21 milliseconds in inference) fared well among the others due to less encoding. In the case of lesions coinciding with each other, the accuracy was not up to the mark, but the authors suggest that it could be improved with opting for more hyperparameters in the model.


Technology has improved medical systems to a large extent, and has provided a better reach to people. With techniques such as deep learning, the capabilities can be largely improved instead of focusing just on procedures. This article has highlighted of one instance where CNNs can make a profound impact of the widespread medical field. Other diagnosis issues can also be improved by applying deep learning.

Sign up for The Deep Learning Podcast

by Vijayalakshmi Anandan

The Deep Learning Curve is a technology-based podcast hosted by Vijayalakshmi Anandan - Video Presenter and Podcaster at Analytics India Magazine. This podcast is the narrator's journey of curiosity and discovery in the world of technology.

Abhishek Sharma
I research and cover latest happenings in data science. My fervent interests are in latest technology and humor/comedy (an odd combination!). When I'm not busy reading on these subjects, you'll find me watching movies or playing badminton.

Our Upcoming Events

27-28th Apr, 2023 I Bangalore
Data Engineering Summit (DES) 2023

23 Jun, 2023 | Bangalore
MachineCon India 2023

21 Jul, 2023 | New York
MachineCon USA 2023

3 Ways to Join our Community

Telegram group

Discover special offers, top stories, upcoming events, and more.

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Subscribe to our Daily newsletter

Get our daily awesome stories & videos in your inbox

The Great Indian IT Reshuffling

While both the top guns of TCS and Tech Mahindra are reflecting rather positive signs to the media, the reason behind the resignations is far more grave.

OpenAI, a Data Scavenging Company for Microsoft

While it might be true that the investment was for furthering AI research, this partnership is also providing Microsoft with one of the greatest assets of this digital age, data​​, and—perhaps to make it worse—that data might be yours.