Machine learning (ML) has the potential for numerous applications in the health care field. One promising application is in the area of anatomic pathology. ML allows representative images to be used to train a computer to recognize patterns from labeled photographs. Based on a set of images selected to represent a specific tissue or disease process, the computer can be trained to evaluate and recognize new and unique images from patients and render a diagnosis.

Lung and colon adenocarcinoma are some of the most common cancers affecting numerous patients throughout the world. They frequently spread to other sites of the body. It is not uncommon that the pathologist is faced with the question if biopsy showing adenocarcinoma originated from lung or colon primary site. Pathologists are often forced to use special stains to help them make this determination. In this post, I used two different machine learning libraries (fastai and Keras) to solve the origin of metastatic adenocarcinoma.

For this project, I used an image dataset containing 5000 color images of lung adenocarcinoma and 5000 color images of colon adenocarcinoma from the LC25000 dataset, which is freely available for ML researchers. I created a data folder with two subfolders for each class, lung adenocarcinoma class, and colon adenocarcinoma class.

My goal was not only to solve the metastatic adenocarcinoma classification problem but also to compare two deep learning libraries : Keras and fastai.

Both fastai and Keras are high-level APIs build on the top of PyTorch and TensorFlow, respectively. Keras was fully integrated into version 2 of TensorFlow.

Following seven coding steps were used to solve the problem of metastatic adenocarcinoma classification:

  1. Importing relevant libraries
  2. Specifying the path to the data directory
  3. Preparing batches of tensor image data for ML model
  4. Visualizing samples of training images (optional)
  5. Creating ML model
  6. Fitting ML model
  7. Visualizing results with confusion matrix

The Jupyter Notebooks for this post are available on my GitHub website.

#machine-learning #fastai #pathology #keras #ai

Metastatic Adenocarcinoma Classification Using Convolutional Neural Networks
1.15 GEEK