# DchLymphNodeModule **Repository Path**: chencancan1018/dch-lymph-node-module ## Basic Information - **Project Name**: DchLymphNodeModule - **Description**: Open source code referred to our paper - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-05-06 - **Last Updated**: 2021-08-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Introduction This repository contains the code to reproduce the main results from our paper: Shan Zheng, Cancan Chen, Fenglong Sun, etc. Identification of Misdiagnoses by Deep Neural Networks on a Histopathologic Review of Breast Cancer Lymph Node Metastases. If you have any quesions, please post it on gitee issues. Prerequisites
Cudnn(7.1.3) Cuda(8.0_0) Python(3.6) Numpy(1.15.4) Scipy(1.1.0) Scikit-learn(0.20.2) Scikit-image(0.15.0) Tensorflow-gpu(1.8.0) Tensorboard(1.8.0) Openslide-python(1.1.1) Opencv-python(4.1.0.25) Matplotlib(3.0.3) Pillow(5.4.1) Pandas(0.23.0) Most of the dependencies can be installed through conda and pip install with version number, e.g. pip install numpy==1.15.4 conda install numpy==1.15.4 Or just pip install numpy conda install numpy For openslide please search the net(https://openslide.org/download/) for matching own environment. Whole slide images Our research was a part of a series of studies approved by the National Cancer Center (NCC) Ethics Committee/ institution review board (IRB) (20/209-2405). In this part of the series, patient consent was not required, as no risk to the participants was anticipated. All the information on the 499 patients was represented on our paper (WSIs are to be published). We collected FSs of sentinel lymph nodes from breast cancer patients from the Department of Pathology, Cancer Institute & Hospital, Chinese Academy of Medical Sciences (CICAMS), China, from January 2017 to November 2019, The 8-10 µm FSs were hematoxylin and eosin stained. The final dataset consisted of 2,362 patient-exclusive WSIs (129 micrometastases, 353 macrometastases and 1,879 normal WSIs). We scanned the glass slides containing these sections with a Nano Zoomer S210 scanner at 40X equivalent magnification. We collected paraffin sections of sentinel lymph nodes from breast cancer patients from CAMELYON16 (https://camelyon16.grand-challenge.org/) and CAMELYON17 (https://camelyon17.grand-challenge.org/) (CAMELYON16/17). Annotations All metastatic lesions in our dataset from positive FS WSIs were first annotated manually by 2 residents with 2-3 years of work experience using the open-source tool ASAP 1.8 (https://github.com/computationalpathologygroup/ASAP/releases), and then each annotated WSI was reviewed in detail by a pathology review group composed of 3 pathology experts (at least at the level of attending doctor) with a mean working experience of 14.3 years (9-18 years). All of them were breast specialists. The Camelyon16 organizers also provides annotations of tumor regions for each tumor slide in xml format. Patch images Due to the large size of the WSIs (100,000 × 100,000 pixels at 40X equivalent magnification), we used Otsu’s method(Otsu, N. A threshold selection method from gray level histograms. IEEE Trans.syst.man Cybern 9 (1979).) to efficiently discard all background and fat patches in each WSI, and obtained ROI region of each slides, which was split into patches with 256 X 256 pixels. Next, run the following command to generate patches: python DchLymphModule/univ/script/dch_extract_patch.py -rd 16 -i wsi -t tumor -a $anno -o outdir -pd 1
or sh DchLymphModule/project/dch_extract_patch.sh DNN model In this work, inceptionv3, xception71 and resnet-v2-101 were refered. Training In models training, the parameters were listed as
{
"model": "inceptionv3", "xception71", "resnet-v2-101",
"batch_size": 32,
"image_size": 256,
"patch_downsample": 1,
"heatmap_downsample":256,
"lr": 0.001,
"decay_steps":7000000.0,
"learning_rate_decay_factor":0.1,
"optimizer_type":"Gradient",
"slide": "/DchLymphModule/project/test/slide/",
"train_patches": "/DchLymphModule/project/test/patches/",
"valid_patches": "/DchLymphModule/project/test/patches/",
"train_tfrecord": "/DchLymphModule/project/test/tfrecord/",
"valid_tfrecord": "/DchLymphModule/project/test/tfrecord/",
"epoch": 20,
"model":"/DchLymphModule/project/test/model/",
"output":"/DchLymphModule/project/test/heatmap/"
} We train inceptionv3, xception71 and resnet101 models by the following commands python DchLymphModule/univ/script/dch_build_tfrecord.py -i train_patches -o train_tfrecord -s coordinate -mode train -pd 1 python DchLymphModule/univ/script/dch_build_tfrecord.py -i valid_patches -o valid_tfrecord -s coordinate -mode train -pd 1 python DchLymphModule/univ/script/dch_operate.py -mode train -nt INCEPTIONV3 -i train_tfrecord -o model -vi valid_tfrecord python DchLymphModule/univ/script/dch_operate.py -mode train -nt XCEPTION71 -i train_tfrecord -o model -vi valid_tfrecord python DchLymphModule/univ/script/dch_operate.py -mode train -nt RESNET_V2_101 -i train_tfrecord -o model} -vi valid_tfrecord Infering Same as above part, we firstly used Otsu’s method(Otsu, N. A threshold selection method from gray level histograms. IEEE Trans.syst.man Cybern 9 (1979).) to efficiently discard all background and fat patches of each WSI, which were split into patches by tiled method. And then, we obtained the heatmap of each WSI by the following command python DchLymphModule/univ/script/dch_operate.py -mode predict -nt RESNET_V2_101 -i wsi -o output -pd 1 -hd 256 -m model AUC evaluation As for the heatmap for each test WSI, we can finally evaluate the AUC value of test WSIs. sh DchLymphModule/project/dch_make_auc.sh RRCART We obtained all heatmap features and the high/low belief slides index from the following command. python DchLymphModule/univ/script/dch_make_auc.py -d features -hd 256 -a anno_file -p test_slides -ht heatmap_path -s _heatmap.jpg -o auc -f test_features.csv -ws tif python DchLymphModule/ml/ensemble/CARTRelativeRisk.py CAMELYON17 annotations The WSIs of CAMELYON17 are annotated by a breast subspecialist pathology review group composed of 3 pathology experts (attending doctor and above) with a mean working experience of 14.3 years. The experts are all from the Department of Pathology, Cancer Institute & Hospital, Chinese Academy of Medical Sciences (CICAMS), China Our statistical analysis work was based on all results from above codes and methods, and represented in our paper.