Bone Suppression from Chest Radiographs
The project is a tool to build Bone Suppression model, written in tensorflow
##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
- Preprocessing data, including registration and augmentation.
- Train/test by following the quickstart. You can get a model with performance close to the paper.
- Visualize your training result with tensorboard
Requirements
The project requires Python>=3.5
.
TRAIN
source_folder
andtarget_folder
are folders to load training images.- If you want to continue training from your last model, set
use_trained_model
to true andtrained_model
to your model path. output_model
is where you save your model during training andoutput_log
is where you save the tensorboard checkpoints.- 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.
- Create & activate a new python3 virtualenv. (optional)
- Install dependencies by running
pip install -r requirements.txt
. - Run
python preprocessing.py
to preprocess dataset. If you want to change your config path:
python preprocessing.py --config <config path>
- 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>
- 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: