The Tensorflow implementation of our pricai18 paper Multiple Visual Fields Cascaded Convolutional Neural Network for Breast Cancer Detection.
Python 2.7, Tensorflow 1.1.0, Openslide-python 1.1.1, Scikit-image 0.13.0, Scipy 1.1.0, Numpy 1.13.1, and Matplotlib 2.0.2.
Our benchmark dataset is from Camelyon16 Challenge. You can download the dataset from this link.
This code is mainly for testing. You can run the inference on testing dataset as follows:
-
We firstly utilize LVF-CNN (large visual field CNN) to coarsely locate the possible lesion areas. So to obtain LVF patches, please run pathology_divide_test40X1196.py to preprocess testing slides and divide them into patches.
-
Please run pathology_test_tfrecords.py to convert image patches to tfrecord format. You may find more useful information from this link.
-
Please run pathology_test_test.py to create the initial LVF heatmaps. Meanwhile, don't forget to set your own paths in pathology_test_preprocessing.py and pathology_test_eval.py. The trained LVF-CNN model can be downloaded here.
-
To get the final LVF heatmaps, please run UpsampleLVFHeatmap.py.
-
Subsequently, we leverage these LVF heatmaps to generate small visual field patches. Please run pathology_generate_tumor_candidate.py to sample SVF patches from tumor candidate areas.
-
Then, use pathology_test_tfrecords.py to convert these patches to tfrecord format and run pathology_test_test.py to produce the final MVF-CNN heatmaps by SVF-CNN. The trained SVF-CNN model can be downloaded here. Also, remember to set your own paths in pathology_test_preprocessing.py and pathology_test_eval.py. You can adopt SaveHeatmapToFig.py to visualize these heatmaps.
-
Finally, please utilize Evaluating_AUC.py and Evaluating_FROC.py to measure the performance. Both our final MVF-CNN heatmaps and Ensemble MVF-CNN heatmaps are available online. You can directly justify the effectiveness of our methods by them.
We directly employ Inception in Tensorflow to train our large visual field model and small visual field network. But note that this version of Inception doesn't provide parameters for slimming down the model. So to get the slimmed-down Inception V3, you can replace its inception/slim/inception_model.py with ours. Or you can choose to train the model using the newer version of Inception. For more details about training process, please read our paper.
If you find our approaches useful in your research, please consider citing:
@inproceedings{ni2018multiple,
title={Multiple Visual Fields Cascaded Convolutional Neural Network for Breast Cancer Detection},
author={Ni, Haomiao and Liu, Hong and Guo, Zichao and Wang, Xiangdong and Jiang, Taijiao and Wang, Kuansong and Qian, Yueliang},
booktitle={Pacific Rim International Conference on Artificial Intelligence},
pages={531--544},
year={2018},
organization={Springer}
}
For any problems with the code, please feel free to contact me: [email protected]
Our MVF-CasCNN borrowed some functions from Inception in Tensorflow.