Whether you are a senior AI engineer or a first-year biology student, you will come across the Python programming language at some point. First released in 1991, Python has quickly become the favorite language used by programmers and technologists. Based on Stack Overflow question views in high-income countries, Python is found to be rapidly becoming the most popular language of choice.

The Incredible Growth of Python- David Robinson

Being a high-level, interpreted language with a relatively easy syntax, Python is perfect even for those who don’t have prior programming experience. Popular Python libraries are well integrated and used in diverse fields such as bioinformatics (biopython), data science…

It’s not as hard as you think!

Tl;dr if you want to skip the tutorial. Here is the notebook I created.

Adam is algorithm the optimizes stochastic objective functions based on adaptive estimates of moments. The update rule of Adam is a combination of momentum and the RMSProp optimizer.

The rules are simple. Code Adam from scratch without the help of any external ML libraries such as PyTorch, Keras, Chainer or Tensorflow. Only libraries we are allowed to use arenumpy and math .


Step 1: Understand how Adam works

The easiest way to learn how Adam’s works is to watch Andrew Ng’s video. Alternatively, you…

PyTorch is a powerful open-source machine learning library written in Python. Unlike Keras’s tf.keras.metrics, however, PyTorch does not have an out-of-the-box library for model evaluation metrics as illustrated in this github issue.

Photo by Aziz Acharki on Unsplash

torch-metrics is a library written for PyTorch model evaluation. To install torch-metrics , simply run pip install --upgrade torch-metrics and the latest version will be installed.

Available Metrics

At the time of writing, the following metrics are available:

  • Accuracy
  • R-squared
  • Mean Absolute Error (MAE)
  • Mean Squared Error (MSE)
  • Root Mean Squared Error (RMSE)
  • Precision
  • Recall
  • F1
  • Mean IoU (Intersection over Union)
  • Dice Similarity Coefficient (DSC)
  • Hinge
  • Structural Similarity (SSIM)



How to implement a 3D volumetric generative adversarial network for CT/ MRI segmentation

If you are familiar with generative adversarial networks (GANs) and their popular variants, the term Pix2Pix should not be an unfamiliar at all. Pix2Pix is a type of conditional GAN (cGAN) that performs image-to-image translation. In the medical field, they are typically used to perform modality translation and in some cases organ segmentation.

“Voxels on My Mind”- Don Backos

Pix2Pix, the Basics

Similar to most GANs, Pix2Pix consists of a single generator network and a single discriminator network. The generator network is nothing but a U-Net, which is a type of deep convolutional neural network originally proposed to perform biomedical image segmentation. U-Net has the following architecture:

How to efficiently preprocess CT images for deep learning

Let’s face it, medical image processing is challenging. Today’s medical imaging machines are capable of producing large amounts of images with lots of information. However, extracting this information from the images requires an in-depth understanding of imaging techniques. As a graduate student studying medical image processing and machine learning, I find a lack of good prepreprocessing libraries for medical images other than the well-known pydicom and NiBabel. My recent participation in the RSNA Intracranial Hemorrhage Detection Competition has reminded me the importance of the quality of image preprocessing.

Photo by Harlie Raethel on Unsplash

Here is an example of a normal brain CT image without any…

How evolutionary algorithms can speed up optimization of deep neural networks

This paper proposes a new evolutionary version of stochastic gradient descent in deep neural networks. Stochastic gradient descent (abbreviated as SGD) was first proposed by Robins and Monro in their paper “A Stochastic Approximation Method.” It is essentially an iterative optimization method which randomly draws a single sample during iteration k, and uses it to compute its gradient. The resulting stochastic gradient is then used to update the deep network’s weights given a step size (or learning rate.) These weights being updated are considered as a single parameter vector θ in the original SGD algorithm.

Photo by timJ on Unsplash

In their introduction, the authors…

Photo by Ben White on Unsplash

Why positivity matters and how it can change your life

Positivity is without doubt one of the most powerful forces in the world. In the words of Dalai Lama:

In order to carry a positive action we must develop here a positive vision

Thinking positively will not only improve our overall mental and physical health, but also empower our minds to see new opportunities and ideas.

On the contrary, negative thoughts have been proven scientifically to limit our vision and creativity. Getting stuck in endless cycles of ruminative, negative thoughts can drastically decrease one’s motivation to step up and solve problems.

How to Help Developing Countries with Artificial Intelligence

Recently, I have come across quite a few articles stating how artificial intelligence may threaten the developing world by eliminating the need for repetitive, labor-intensive manufacturing roles. Automation of factories can potentially lead to higher unemployment rates in poorer nations, thereby disrupting local economies and causing other social issues. Is AI nothing but a huge threat to the developing world?

One simply cannot deny the potential of AI to transform lives and reshape the way humans live. In well-developed countries such as the United States, AI has rapidly taken over most people’s lives within the past decade. From search engines…

A brief introduction to the basic building blocks of machine learning

Tensorflow, Tensorlab, Deep Tensorized Networks, Tensorized LSTMs… it’s no surprise that the word “tensor” is embedded in the names of many machine learning technologies. But what are tensors? And how do they relate to machine learning? In part one of Quick ML Concepts, I aim to provide a short yet concise summary of what tensors are.

Don’t let the word “tensor” scare you. It is nothing more than a simple mathematical concept. Tensors are mathematical objects that generalize scalars, vectors and matrices to higher dimensions. If you are familiar with basic linear algebra, you should have no trouble understanding what…

For decades, researchers and developers have been debating whether Python or R is a better language for data science and analytics. Data science has rapidly grown across a variety of industries including biotech, finance and social media. Its importance is being recognized not only by the people working in the industries, but also by academic institutions that are now beginning to offer data science degrees. With the adoption of open source technologies rapidly taking over traditional, closed-source commercial technologies, Python and R have become extremely popular amongst data scientists and analysts.

Enoch Kan

Make AI Generalizable Again

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store