Posts

Simple GUI for Model Inferences

Image
Running inferences by loading models via scripts is cool but the end user may not be familiar with these methods of obtaining predictions.  If deep learning is to be useful as a tool to the user, then it should be available in the form of a GUI, either web based or desktop based.  Keeping that in mind I decided to see what tools are available for me to create a GUI on the desktop that will allow me to: 1) Load a model 2) Feed that model inputs via a file explorer 3) Obtain inference results and display it via labels. Display any additional data as required. Since I was programming on the Windows Desktop, I decided to check out the machine learning offerings available via the Visual C# IDE. I found out that Microsoft's CNTK was available on C# so I decided to give that a go. I already had a pretrained model that I'd used for pneumonia detection (I trained and tested it in my previous post). I now needed a way to use that model in C# via CNTK. Luckily, there ...

Densenet, Pneumonia Detection, Activation Maps and AUROC

Image
I came across C hexNe t when I was implementing the Pneumonia Detection model for the RSNA Kaggle challenge. Although I didn't implement Chexnet for the challenge, I was interested in doing that in the future. Once I was done with the Protein Detection challenge, I started looking into that. Chexnet is basically Densenet, implemented for detecting various pathologies in Chest X-rays. Hence the name Chexnet. Densenet is a popular neural network architecture, along the lines of ResNet, Inception etc. The dataset used for Chexnet was the NIH dataset .  The paper implementing Chexnet tested their model specifically on detecting Pneumonia like features. They compared the model's performance against some radiologists, the F1 score being the determinant of performance. Going by the F1 score alone, it seemed as though the model performed better than the radiologists. But the devil's is in the details. I came across this excellent post by a radiologist/ml engineer. H...

Flask, Docker and inferences via a server/cloud

While my Protein Classification model was churning in the background, I focused on learning skills and technologies that would help 'production-ize' ML models for inference. This would mean that I could host my ML models on a server which would mean that a useful model would be available to more people than just me. I learnt about the Flask framework through which one could expose python functions and have it return some data. In the ML case, this would mean having Flask expose a function where inference is performed and then send the results back to the user. I also learnt about Docker and how I could build and run an image with the ML model inference being served by an Apache server, with the help of Flask and WSGI (a bridge between Flask and Apache). Ill update this post when I have something working. UPDATE 1: I obtained a free $300 credit to play with Google's cloud services and they did have an ML Engine to work with so I decided to give it a shot be...

The Human Protein Atlas Image Competition on Kaggle

Just before the RSNA Penumonia Competition drew to a close, another interesting competition opened up, namely the Human Protein Atlas image classification challenge. Link:  kaggle.com/c/human-protein-atlas-image-classification The goal of the competition is to detect cell features from an image taken by a microscope. Around 30,000 512x512 images are provided which is the training set and around 11,000 images are provided as a test set. The labeled data is provided in a csv file. I started off with the data exploration kernel to have a feel for the data. Then through the discussion forums I found a useful starter code that used transfer learning. Link:  https://www.kaggle.com/mathormad/inceptionv3-baseline-lb-0-379 Instead of inception network, I decided to use ResNet50 network with the imagenet weights. I also tested results on both augmented data and the original one. The augmented data was giving me a boost of at least 0.05-0.06 on the public leaderboard. ...

First ever Kaggle competition - Pneumonia Detection

Image
Github here:  https://github.com/varunvprabhu/pneumonia_detection I'd never participated in a Kaggle competition before. So I decided to join one, namely, the RSNA Pneumonia Detection challenge . Briefly, the competition was about developing an AI algorithm that would assist radiologists in pneumonia detection. The dataset training and test images were provided by the competition organizers through Kaggle. Approximately 28000 training images and 1000 test images were provided. Some of the 28000 images had bounding boxes of the locations of pneumonia detections in chest x-rays.(Specifically 8964 images) The 1000 images were un-labeled and one had to post the results of the algorithm after the images were run through that. A score is calculated using the mean taken over the individual average precision of each image in the test dataset. There were 2 ways to go about this. One was through object detection and the other was through segmenta...

Simple Pose Estimation with Hourglass Model

Image
Pose Estimation seemed an interesting idea for me to explore and implement after my previous project, which was fast style transfer. I searched around for the latest literature regarding this and came across the Hourglass model, implemented by Alejandro Newell et al.  I read the paper and found the results fascinating since it managed to do a pretty job of detecting different joints in the human body. Then I searched for a Tensorflow implementation and came across Walid Benbihi's Github implementation . The dataset text file available in his project was especially useful since it was a dictionary of the MPII image dataset . This dictionary contained image names along with the other useful coordinate data for the joints in an easy-to-parse format. MPII does provide this data on their website but this dictionary was easier to work with. I was definitely interested now but the hourglass model seemed a bit complex and wondered if there was a simpler way to detect pose. I wond...

Fast Style Transfer Implementation

Image
After finishing up the Deep Learning course from Coursera, I wanted to explore more work that was done in the area of style transfer (Gatys et al), which was an assignment for us in that course. I firstly wanted to implement the style transfer algorithm outside the confines of the assignment. This was a useful exercise and I learnt some new things like using the vgg network and some associated helper functions. I also learnt how important tuning is and that it is an iterative process. While the method is cool, it was too slow compared to be deployed as a program/app. There had to be a faster way of getting stylized images. Turns out that a faster, better method based on training a feedforward network existed so I was interested in seeing how it works. I came across the work of Logan Engstrom here:  https://github.com/lengstrom/fast-style-transfer I looked over the code and implemented it a version of it in Jupyter notebooks. One notebook contains the code for tra...