The challenge

Before we deep-dive into the code, remember how most machine learning efforts involve one of two simple goals—classification or ranking. In many cases, the classification is itself a ranking because we end up choosing the classification with the greatest rank (often a probability). Our foray into medical imaging will be no different—we will be classifying images into either of these binary categories:

  • Disease state/positive
  • Normal state/negative

Or, we will classify them into multiple classes or rank them. In the case of the diabetic retinopathy, we'll rank them as follows:

  • Class 0: No Diabetic Retinopathy
  • Class 1: Mild
  • Class 2: Moderate
  • Class 3: Severe
  • Class 4: Widespread Diabetic Retinopathy

Often, this is called scoring. Kaggle kindly provides participants over 32 GB of training data, which includes over 35,000 images. The test data is even larger—49 GB. The goal is to train on the 35,000+ images using the known scores and propose scores for the test set. The training labels look like this:

Image

Level

10_left

0

10_right

0

13_left

0

13_right

0

15_left

1

15_right

2

16_left

4

16_right

4

17_left

0

17_right

1

Some context here—diabetic retinopathy is a disease of the retina, inside the eye, so we have scores for the left and right eye. We can treat them as independent training data, or we can get creative later and consider them in the larger context of a single patient. Let's start simple and iterate.

By now, you are probably familiar with taking a set of data and segmenting out chunks for training, validation, and testing. That worked well for some of the standard datasets we've used, but this dataset is part of a competition and one that is publicly audited, so we don't know the answers! This is a pretty good reflection of real life. There is one wrinkle—most Kaggle competitions let you propose an answer and tell you your aggregate score, which helps with learning and direction-setting. It also helps them and the community know which users are doing well.

Since the test labels are blinded, we'll need to change two things we've done before:

  • We will need to have one procedure for internal development and iteration (we'll likely chunk our training set into a training, validation, and test set). We will need another procedure for external testing (we may settle upon a promising setup that works well, and then we may either run it on the blind test set or we may retrain on the entire training set first).
  • We will need to make a formal proposal in a very specific format, submit it to the independent auditor (Kaggle, in this case), and gauge the progress accordingly. Here is what a sample submission may look like:

Image

Level

44342_left

0

44342_right

1

44344_left

2

44344_right

2

44345_left

0

44345_right

0

44346_left

4

44346_right

3

44350_left

1

44350_right

1

44351_left

4

44351_right

4

Not surprisingly, it looks very much like the training label file. You can make your submission here:

https://www.kaggle.com/c/diabetic-retinopathy-detection/submithttps://www.kaggle.com/c/diabetic-retinopathy-detection/submit

You need to login in order to open the preceding link.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.126.211