Bone Suppression from Chest Radiographs

The project is a tool to build Bone Suppression model, written in tensorflow

CAM example image

##AutoEncoding paper

This code is based off of two models described in this paper. The first is an autoencoder-like model of CNNs that shrinks the image down before deconding it with mirrored weights. The second is a family of CNN's that keeps the image size the same.

##Data Set I trained the model on the JRT dataset and the associated bone free images in the BJRT data set.

In this project you can

  1. Preprocessing data, including registration and augmentation.
  2. Train/test by following the quickstart. You can get a model with performance close to the paper.
  3. Visualize your training result with tensorboard

Requirements

The project requires Python>=3.5.

TRAIN

  1. source_folder and target_folder are folders to load training images.
  2. If you want to continue training from your last model, set use_trained_model to true and trained_model to your model path.
  3. output_model is where you save your model during training and output_log is where you save the tensorboard checkpoints.
  4. The other parameters is set following the published paper

Pretrained model

If you want to start testing without training from scratch, you can use the model I have trained. The model has loss value: 0.01409, MSE: 7.1687e-4, MS-SSIM: 0.01517

Quickstart

Note that currently this project can only be executed in Linux and macOS. You might run into some issues in Windows.

  1. Create & activate a new python3 virtualenv. (optional)
  2. Install dependencies by running pip install -r requirements.txt.
  3. Run python preprocessing.py to preprocess dataset. If you want to change your config path:
python preprocessing.py --config <config path>
  1. Run python train.py to train a new model. If you want to change your config path:
python train.py --config <config path>

During training, you can use Tensorboard to visualize the results:

tensorboard --logdir=<output_log in train.cfg>
  1. Run python master.py to augment the data set, split the set into test and training sets, train the model and test the model. To change default parameters, you can use: