‘Robot Physician’: Is That The Future?

Pari Vansjalia
6 min readNov 11, 2021

Applications of convolutional neural networks in medical diagnosis

You’re at a doctor’s office for a lingering cough. You might feel a little anxious and nervous, but it’s also a place of security, a place you can trust. You trust the doctor’s with making the right decision and diagnosing correctly; however, according to recent studies, that is not always the case. Millions of people each year are affected by preventable medical errors, specifically misdiagnosis.

Lost lives, medical trauma from an injury or disease can be prevented through a timely diagnosis of medical anomalies, and yet there are still many flaws in the diagnosis of patients. The scarcity of human experts in countries of poverty, the high consultation charges of experts, and the rough estimate procedures all contribute to a lower success rate in identifying the correct abnormality.

While this all may seem disheartening, many solutions are being implemented into the healthcare system — one of them being artificial intelligence.

You may have heard about AI before, short for artificial intelligence. We are surrounded by AI every day as it is used across industries globally; from the moment one wakes up to the moment they sleep, AI plays a large role in many people’s daily life. Whenever you ask Siri “What’s the weather?” or click on youtube to watch a funny cat video, AI aids in answering your question or recommending a video.

Inspiration for Artificial Intelligence

One of the major subdivisions in AI are neural networks; neural networks work towards finding patterns within data using mathematical algorithms. Neural networks are meant to mimic how our brains function through interconnected nodes that work similarly to neurons in the human brain, think of it like inspiration . They can recognize patterns, hidden correlations in data and cluster and classify the information: over time, they can continuously learn and improve.

source: https://towardsdatascience.com

Neural networks consist of lays of neurons and are the core processing unit. First, there is the input layer which receives the input, while the output layer predicts the final output: as one might assume. In between, there are hidden layers that complete a lot of requirements by the network.

** 📣 something important to note here is that there are different types of neural networks, each being specialized in determining specific patterns for specific data sets

Taking a trip back to the 1990s, Machine Learning specialists were able to make breakthroughs and created a neural network that allows computers to classify images and detect patterns in an organized and efficient manner. In the present day, the algorithm most widely used are convolutional networks or CNNs, and it also happens to be the specific neural network used for diagnosing in healthcare.

What are Convolutional Neural Networks?

You can compare how a computer processes an image to a human, both try to find distinctive features and use that to classify the object: the only difference is that computers don’t have an understanding of what the image is. This makes it a lot harder for computers to analyze and understand similarities between images as computers are very literal; they look at images pixel by pixel to decide if they are the same. Using a convolutional neural network, however, it can pick up small patterns and in turn, is better at image recognition.

How do Convolutional Neural Networks Work?

Let’s dive into how the convolutional networks — a type of deep learning algorithm — analyze images and produce an output.

Referencing back to earlier in the article, remember how neural networks have hidden layers that complete most of the computational work? Well, CNNs have those hidden layers as well and they are called convolutional layers. Each convolutional layer has its own filter which is meant to detect certain patterns. A pattern could be certain edges or objects within an image; furthermore, as you go deeper into the network, the more sophisticated the patterns become. This means you might see geometric shapes for the first layers, and have detailed objects such as feathers being detected in later layers.

When a computer sees an image, all it really can understand is a two-dimensional array of pixels which are further described using RGB values. In a CNN, it uses filters to learn patterns and create an output, but what are these filters?

Convoluting a 5x5x1 image with a 3x3x1 kernel to get a 3x3x1 convolved feature

The filters are usually much smaller than the original image; for example, for a 400 x 400 pixel image, the filter would cover 5 x 5 pixels at a time. To better understand the process of the filters, imagine a flashlight shining at a wall that is 400 cm by 400 cm. The flashlight can only light up 5 cm by 5 cm at a time, so you slide the flashlight across the picture; the flashlight acting as the filter, and the parts being lit up acting as the receptive field. Now going back to CNNs, the filter is a matrix of numbers that carry a certain weight. The input pixels with the dot product of the filter will be stored and used for the next layer; the new image will be (k-1) times smaller––where k represents the dimensions of the filter––than the original image horizontally and vertically. Remember, as you go deeper into the layers it begins to describe more complex objects and patterns.

Convolution Operation

Other than the filters (that are random at first), how does the neural network learn to differentiate between images? 🤔 As stated earlier, the original filter is random so the neural network does not know what it’s computing; however, through training and validation, the neural network learns over time. Training is usually done with a large set of images with correct labeling. When an image passes through a neural network, it uses the loss function to calculate if the model did badly. Afterward, depending on the results it will tweak the filters to make them more accurate. As seen in the graph, the neural network reduces the loss function and becomes more precise.

Epochs (# of trials)

The output layer is essential to the neural network, so let’s take a look at how it works.

Credit: superdatascience.com

Your output layer will be based on the number of classes — the number of classes being how many different groups/objects are being identified. The output is a vector-based on probabilities; hence, one of the outputs should be significantly higher than the other. The higher output dictates which group the image falls into.

And… we’re done! 🥳

CNNs in Healthcare

Now that we have an understanding of how CNNs work, you may be able to guess how it is used for medical diagnosis. They detect abnormalities and classify them, helping doctors get a second opinion and allowing those in areas of poverty to get medical attention and diagnoses. Currently, researchers have successfully applied CNNs for specific case uses such as the detection of tumors and their classification into benign and malignant, detections of skin lesions, colon cancer, blood cancer, anomalies of the heart, breast, chest and much more. CNNs will allow the best doctors to create the training material; in turn, creating accurate models other doctors can get a second opinion from. While there are still many problems CNNs will have to overcome, the future in the medical diagnosing sector looks promising.

Hello there! Thanks for reading through my article, hope it provided you some new insights.

If you would like to read more articles like this make sure to subscribe to my Medium. If you would like to learn more about me, talk about a new discovery in healthcare or chat over some coffee, feel free to connect with me on LinkedIn or follow me on Twitter!

--

--

Pari Vansjalia

17 y/o student based in Toronto, trying to learn how to cross the road.