├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── breastnet.py ├── requirements.txt └── research ├── 100X ├── 100X - confusion matrix - 4. FOLD.jpg └── BreastNet_100X.ipynb ├── 200X ├── 200X - confusion matrix - 3. FOLD.jpg └── BreastNet_200X.ipynb ├── 400X ├── 400X - confusion matrix - 4. FOLD.jpg └── BreastNet_400X.ipynb ├── 40X ├── 40X - confusion matrix - 4. FOLD.jpg └── BreastNet_40X.ipynb ├── ALL_DATA_TOGETHER-CLASSIFICATION WITH 4 CLASSES ├── benign │ ├── ALL_DATA_4_CLASS_BENIGN - confusion matrix - 5. FOLD.jpg │ └── BreastNet_ALL_DATA_4CLASS_BENIGN.ipynb └── malignant │ ├── ALL_DATA_4_CLASS_MALIGNANT - confusion matrix - 3. FOLD.jpg │ └── BreastNet_ALL_DATA_4CLASS_MALIGNANT.ipynb ├── ALL_DATA_TOGETHER ├── ALL_DATA - confusion matrix - 5. FOLD.jpg └── BreastNet_ALL_DATA.ipynb ├── README.md ├── data └── download_data_here.txt └── tmp ├── 100X - 4. FOLD - MODEL ACCURACY.jpg ├── 100X - 4. FOLD - MODEL LOSS.jpg ├── 100X - ROC - 4. FOLD.jpg ├── 100X - confusion matrix - 4. FOLD.jpg ├── 200X - 3. FOLD - MODEL ACCURACY.jpg ├── 200X - 3. FOLD - MODEL LOSS.jpg ├── 200X - ROC - 3. FOLD.jpg ├── 200X - confusion matrix - 3. FOLD.jpg ├── 400X - 4. FOLD - MODEL ACCURACY.jpg ├── 400X - 4. FOLD - MODEL LOSS.jpg ├── 400X - ROC - 4. FOLD.jpg ├── 400X - confusion matrix - 4. FOLD.jpg ├── 40X - 4. FOLD - MODEL ACCURACY.jpg ├── 40X - 4. FOLD - MODEL LOSS.jpg ├── 40X - ROC - 4. FOLD.jpg ├── 40X - confusion matrix - 4. FOLD.jpg ├── ALL_DATA - confusion matrix - 5. FOLD.jpg ├── ALL_DATA_4_CLASS_BENIGN - confusion matrix - 5. FOLD.jpg ├── ALL_DATA_4_CLASS_MALIGNANT - confusion matrix - 3. FOLD.jpg ├── ALL_DATA_TOGETHER - 5. FOLD - MODEL ACCURACY.jpg ├── ALL_DATA_TOGETHER - 5. FOLD - MODEL LOSS.jpg ├── ALL_DATA_TOGETHER_BENIGN - 5. FOLD - MODEL ACCURACY.jpg ├── ALL_DATA_TOGETHER_BENIGN - 5. FOLD - MODEL LOSS.jpg ├── ALL_DATA_TOGETHER_MALIGNANT - 3. FOLD - MODEL ACCURACY.jpg ├── ALL_DATA_TOGETHER_MALIGNANT - 3. FOLD - MODEL LOSS.jpg ├── All_Data - ROC - 5. FOLD.jpg ├── BreastNet_arch.png ├── attention_modules_1.png ├── attention_modules_2.png ├── base_blocks.png └── residual_block.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | 62 | # Flask stuff: 63 | instance/ 64 | .webassets-cache 65 | 66 | # Scrapy stuff: 67 | .scrapy 68 | 69 | # Sphinx documentation 70 | docs/_build/ 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints 77 | 78 | # IPython 79 | profile_default/ 80 | ipython_config.py 81 | 82 | # pyenv 83 | .python-version 84 | 85 | # pipenv 86 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 87 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 88 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 89 | # install all needed dependencies. 90 | #Pipfile.lock 91 | 92 | # celery beat schedule file 93 | celerybeat-schedule 94 | 95 | # SageMath parsed files 96 | *.sage.py 97 | 98 | # Environments 99 | .env 100 | .venv 101 | env/ 102 | venv/ 103 | ENV/ 104 | env.bak/ 105 | venv.bak/ 106 | 107 | # Spyder project settings 108 | .spyderproject 109 | .spyproject 110 | 111 | # Rope project settings 112 | .ropeproject 113 | 114 | # mkdocs documentation 115 | /site 116 | 117 | # mypy 118 | .mypy_cache/ 119 | .dmypy.json 120 | dmypy.json 121 | 122 | # Pyre type checker 123 | .pyre/ 124 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Goodsea 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BreastNet 2 | A novel convolutional neural network model through histopathological images for the diagnosis of breast cancer 3 | 4 | ```using BreakHis data``` 5 | - Benign/Malignant Classification with ```98.8%``` accuracy. 6 | - Sub-Benign Disease Classification with ```95.5%``` accuracy. 7 | - Sub-Malignant Disease Classification with ```92.8%``` accuracy. 8 | 9 | # Usage 10 | ``` python 11 | # Typical tf.keras API usage 12 | from breastnet import BreastNet 13 | 14 | model = BreastNet(input_shape=..., n_classes=...) 15 | model.compile(...) 16 | history = model.fit(...) 17 | ``` 18 | 19 | # Further information 20 | - ```All training codes and history``` 21 | - ```Evaluation Results in Accuracy, F1-Macro, ROC-AUC.. metrics``` 22 | - - *see research folder for details.* 23 | 24 | # Citation 25 | ``` 26 | M. Togaçar, K.B. Özkurt, B. Ergen et al., BreastNet: A novel ˘ 27 | convolutional neural network model through histopathological images for the diagnosis of breast 28 | cancer, Physica A (2019), doi: https://doi.org/10.1016/j.physa.2019.123592 . 29 | ``` 30 | 31 | # Contact 32 | If you have any questions about the research, feel free to ask! 33 |
34 | 35 | ``` 36 | E-mail: kutsal_baran@hotmail.com 37 | ``` 38 | 39 | # License 40 | This project is licensed under the MIT LICENSE - see the LICENSE file for details. 41 | -------------------------------------------------------------------------------- /breastnet.py: -------------------------------------------------------------------------------- 1 | import tensorflow.keras.backend as K 2 | from tensorflow.keras.models import Model 3 | from tensorflow.keras.layers import Activation, Add, BatchNormalization, Concatenate, Conv2D, Dense, \ 4 | Dropout, GlobalAveragePooling2D, GlobalMaxPooling2D, Input, Lambda, \ 5 | LeakyReLU, MaxPooling2D, Multiply, Permute, Reshape, UpSampling2D \ 6 | 7 | def cbam_block(cbam_feature, ratio=8): 8 | # Author: @kobiso (https://github.com/kobiso) 9 | 10 | """Contains the implementation of Convolutional Block Attention Module(CBAM) block. 11 | As described in https://arxiv.org/abs/1807.06521. 12 | """ 13 | 14 | cbam_feature = channel_attention(cbam_feature, ratio) 15 | cbam_feature = spatial_attention(cbam_feature) 16 | return cbam_feature 17 | 18 | def channel_attention(input_feature, ratio=8): 19 | channel_axis = 1 if K.image_data_format() == "channels_first" else -1 20 | channel = input_feature.shape[channel_axis] 21 | 22 | shared_layer_one = Dense(channel//ratio, 23 | activation='relu', 24 | kernel_initializer='he_normal', 25 | use_bias=True, 26 | bias_initializer='zeros') 27 | shared_layer_two = Dense(channel, 28 | kernel_initializer='he_normal', 29 | use_bias=True, 30 | bias_initializer='zeros') 31 | 32 | avg_pool = GlobalAveragePooling2D()(input_feature) 33 | avg_pool = Reshape((1,1,channel))(avg_pool) 34 | assert avg_pool.shape[1:] == (1,1,channel) 35 | avg_pool = shared_layer_one(avg_pool) 36 | assert avg_pool.shape[1:] == (1,1,channel//ratio) 37 | avg_pool = shared_layer_two(avg_pool) 38 | assert avg_pool.shape[1:] == (1,1,channel) 39 | 40 | max_pool = GlobalMaxPooling2D()(input_feature) 41 | max_pool = Reshape((1,1,channel))(max_pool) 42 | assert max_pool.shape[1:] == (1,1,channel) 43 | max_pool = shared_layer_one(max_pool) 44 | assert max_pool.shape[1:] == (1,1,channel//ratio) 45 | max_pool = shared_layer_two(max_pool) 46 | assert max_pool.shape[1:] == (1,1,channel) 47 | 48 | cbam_feature = Add()([avg_pool,max_pool]) 49 | cbam_feature = Activation('sigmoid')(cbam_feature) 50 | 51 | if K.image_data_format() == "channels_first": 52 | cbam_feature = Permute((3, 1, 2))(cbam_feature) 53 | 54 | return Multiply()([input_feature, cbam_feature]) 55 | 56 | def spatial_attention(input_feature): 57 | kernel_size = 7 58 | 59 | if K.image_data_format() == "channels_first": 60 | channel = input_feature.shape[1] 61 | cbam_feature = Permute((2,3,1))(input_feature) 62 | else: 63 | channel = input_feature.shape[-1] 64 | cbam_feature = input_feature 65 | 66 | avg_pool = Lambda(lambda x: K.mean(x, axis=3, keepdims=True))(cbam_feature) 67 | assert avg_pool.shape[-1] == 1 68 | max_pool = Lambda(lambda x: K.max(x, axis=3, keepdims=True))(cbam_feature) 69 | assert max_pool.shape[-1] == 1 70 | concat = Concatenate(axis=3)([avg_pool, max_pool]) 71 | assert concat.shape[-1] == 2 72 | cbam_feature = Conv2D(filters = 1, 73 | kernel_size=kernel_size, 74 | strides=1, 75 | padding='same', 76 | activation='sigmoid', 77 | kernel_initializer='he_normal', 78 | use_bias=False)(concat) 79 | assert cbam_feature.shape[-1] == 1 80 | 81 | if K.image_data_format() == "channels_first": 82 | cbam_feature = Permute((3, 1, 2))(cbam_feature) 83 | 84 | return Multiply()([input_feature, cbam_feature]) 85 | 86 | 87 | def residual_block(y, nb_channels, _strides=(1, 1), _project_shortcut=False): 88 | # Author: @mjdietzx (https://gist.github.com/mjdietzx) 89 | 90 | shortcut = y 91 | 92 | y = Conv2D(nb_channels, kernel_size=(3, 3), strides=_strides, padding='same')(y) 93 | y = BatchNormalization()(y) 94 | y = LeakyReLU()(y) 95 | 96 | y = Conv2D(nb_channels, kernel_size=(3, 3), strides=(1, 1), padding='same')(y) 97 | y = BatchNormalization()(y) 98 | 99 | if _project_shortcut or _strides != (1, 1): 100 | shortcut = Conv2D(nb_channels, kernel_size=(1, 1), strides=_strides, padding='same')(shortcut) 101 | shortcut = BatchNormalization()(shortcut) 102 | 103 | y = Add()([shortcut, y]) 104 | y = LeakyReLU()(y) 105 | 106 | return y 107 | 108 | 109 | def BreastNet(input_shape=(224,224,3), n_classes=4): 110 | """ 111 | M. Togaçar, K.B. Özkurt, B. Ergen et al., BreastNet: A novel ˘ 112 | convolutional neural network model through histopathological images for the diagnosis of breast 113 | cancer, Physica A (2019), doi: https://doi.org/10.1016/j.physa.2019.123592 . 114 | """ 115 | 116 | dropRate = 0.3 117 | 118 | init = Input(input_shape) 119 | x = Conv2D(32, (3, 3), activation=None, padding='same')(init) 120 | x = BatchNormalization()(x) 121 | x = Activation('relu')(x) 122 | x = Conv2D(32, (3, 3), activation=None, padding='same')(x) 123 | x = BatchNormalization()(x) 124 | x = Activation('relu')(x) 125 | x1 = MaxPooling2D((2,2))(x) 126 | 127 | x = Conv2D(64, (3, 3), activation=None, padding='same')(x1) 128 | x = BatchNormalization()(x) 129 | x = Activation('relu')(x) 130 | x = cbam_block(x) 131 | x = residual_block(x, 64) 132 | x2 = MaxPooling2D((2,2))(x) 133 | 134 | x = Conv2D(128, (3, 3), activation=None, padding='same')(x2) 135 | x = BatchNormalization()(x) 136 | x = Activation('relu')(x) 137 | x = cbam_block(x) 138 | x = residual_block(x, 128) 139 | x3 = MaxPooling2D((2,2))(x) 140 | 141 | ginp1 = UpSampling2D(size=(2, 2), interpolation='bilinear')(x1) 142 | ginp2 = UpSampling2D(size=(4, 4), interpolation='bilinear')(x2) 143 | ginp3 = UpSampling2D(size=(8, 8), interpolation='bilinear')(x3) 144 | 145 | hypercolumn = Concatenate()([ginp1, ginp2, ginp3]) 146 | gap = GlobalAveragePooling2D()(hypercolumn) 147 | 148 | x = Dense(256, activation=None)(gap) 149 | x = BatchNormalization()(x) 150 | x = Activation('relu')(x) 151 | x = Dropout(dropRate)(x) 152 | 153 | x = Dense(256, activation=None)(x) 154 | x = BatchNormalization()(x) 155 | x = Activation('relu')(x) 156 | 157 | y = Dense(n_classes, activation="softmax", name="BreastNet")(x) 158 | 159 | model = Model(init, y) 160 | return model -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | tensorflow-gpu 2 | tqdm 3 | matplotlib 4 | Pillow 5 | albumentations 6 | scikit-image 7 | scikit-learn -------------------------------------------------------------------------------- /research/100X/100X - confusion matrix - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/100X/100X - confusion matrix - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/200X/200X - confusion matrix - 3. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/200X/200X - confusion matrix - 3. FOLD.jpg -------------------------------------------------------------------------------- /research/400X/400X - confusion matrix - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/400X/400X - confusion matrix - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/40X/40X - confusion matrix - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/40X/40X - confusion matrix - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/ALL_DATA_TOGETHER-CLASSIFICATION WITH 4 CLASSES/benign/ALL_DATA_4_CLASS_BENIGN - confusion matrix - 5. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/ALL_DATA_TOGETHER-CLASSIFICATION WITH 4 CLASSES/benign/ALL_DATA_4_CLASS_BENIGN - confusion matrix - 5. FOLD.jpg -------------------------------------------------------------------------------- /research/ALL_DATA_TOGETHER-CLASSIFICATION WITH 4 CLASSES/malignant/ALL_DATA_4_CLASS_MALIGNANT - confusion matrix - 3. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/ALL_DATA_TOGETHER-CLASSIFICATION WITH 4 CLASSES/malignant/ALL_DATA_4_CLASS_MALIGNANT - confusion matrix - 3. FOLD.jpg -------------------------------------------------------------------------------- /research/ALL_DATA_TOGETHER/ALL_DATA - confusion matrix - 5. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/ALL_DATA_TOGETHER/ALL_DATA - confusion matrix - 5. FOLD.jpg -------------------------------------------------------------------------------- /research/README.md: -------------------------------------------------------------------------------- 1 | # BreastNet 2 | 3 | # Table of Contents 4 | 5 | - [Model Architecture ](#model-architecture) 6 | - [Sub-Modules](#sub-modules) 7 | - [General Architecture](#general-architecture) 8 | - [Results](#results) 9 | - [Training Graphs](#training-graphs) 10 | - [40X Data [Best Model - Graph]](#40x-data-best-model-graph) 11 | - [100X Data [Best Model - Graph]](#100x-data-best-model-graph) 12 | - [200X Data [Best Model - Graph]](#200x-data-best-model-graph) 13 | - [400X Data [Best Model - Graph]](#400x-data-best-model-graph) 14 | - [Combined Data - Benign/Malignant Classification [Best Model Graph]](#combined-data---benignmalignant-classification-best-model-graph) 15 | - [Combined Data - Sub-Benign Diseases Classification [Best Model Graph]](#combined-data---sub-benign-diseases-classification-best-model-graph) 16 | - [Combined Data - Sub-Malignant Diseases Classification [Best Model Graph]](#combined-data---sub-malignant-diseases-classification-best-model-graph) 17 | - [Confusion Matrixes](#confusion-matrixes) 18 | - [40X Data [Best Model Confusion Matrix & ROC Curve]](#40x-data-best-model-confusion-matrix--roc-curve) 19 | - [100X Data [Best Model Confusion Matrix & ROC Curve]](#100x-data-best-model-confusion-matrix--roc-curve) 20 | - [200X Data [Best Model Confusion Matrix & ROC Curve]](#200x-data-best-model-confusion-matrix--roc-curve) 21 | - [400X Data [Best Model Confusion Matrix & ROC Curve]](#400x-data-best-model-confusion-matrix--roc-curve) 22 | - [Combined Data - Benign/Malignant Classification [Best Model Confusion Matrix & ROC Curve]](#combined-data---benignmalignant-classification-best-model-confusion-matrix--roc-curve) 23 | - [Combined Data - Sub-Benign || Sub-Malignant Diseases Classification [Best Model Confusion Matrix]](#combined-data---sub-benign--sub-malignant-diseases-classification-best-model-confusion-matrix) 24 | - [Best Pretrained Weights](#best-pretrained-weights) 25 | - [Requirements](#requirements) 26 | - [Training](#training) 27 | - [Citation](#citation) 28 | 29 | # Model Architecture 30 | ## Sub-Modules 31 | 32 | 33 | 34 | 35 | 36 |
37 |
38 | 39 | 40 | 41 | 42 | 43 |
44 |
45 | 46 | ## General Architecture 47 |

48 | 49 |

50 |
51 | 52 | # Results 53 | ## Training Graphs 54 | 55 | #### 40X Data [Best Model Graph] 56 | 57 | 58 | 59 | 60 | 61 |
62 | 63 | #### 100X Data [Best Model Graph] 64 | 65 | 66 | 67 | 68 | 69 |
70 | 71 | #### 200X Data [Best Model Graph] 72 | 73 | 74 | 75 | 76 | 77 |
78 | 79 | #### 400X Data [Best Model Graph] 80 | 81 | 82 | 83 | 84 | 85 |
86 | 87 | #### Combined Data - Benign/Malignant Classification [Best Model Graph] 88 | 89 | 90 | 91 | 92 | 93 |
94 | 95 | #### Combined Data - Sub-Benign Diseases Classification [Best Model Graph] 96 | 97 | 98 | 99 | 100 | 101 |
102 | 103 | #### Combined Data - Sub-Malignant Diseases Classification [Best Model Graph] 104 | 105 | 106 | 107 | 108 | 109 |
110 |
111 | 112 | ## Confusion Matrixes 113 | #### 40X Data [Best Model Confusion Matrix & ROC Curve] 114 | 115 | 116 | 117 | 118 | 119 |
120 | 121 | #### 100X Data [Best Model Confusion Matrix & ROC Curve] 122 | 123 | 124 | 125 | 126 | 127 |
128 | 129 | #### 200X Data [Best Model Confusion Matrix & ROC Curve] 130 | 131 | 132 | 133 | 134 | 135 |
136 | 137 | #### 400X Data [Best Model Confusion Matrix & ROC Curve] 138 | 139 | 140 | 141 | 142 | 143 |
144 | 145 | #### Combined Data - Benign/Malignant Classification [Best Model Confusion Matrix & ROC Curve] 146 | 147 | 148 | 149 | 150 | 151 |
152 | 153 | #### Combined Data - Sub-Benign || Sub-Malignant Diseases Classification [Best Model Confusion Matrix] 154 | 155 | 156 | 157 | 158 | 159 |
160 | 161 | 162 | # Best Pretrained Weights 163 | | Data Type | Fold | Accuracy | F1-Score | Pretrained Model Link | 164 | | --- | --- | --- | --- | --- | 165 | | 40X | 4/5 | 0.979 | 0.976 | GDrive[Best Model] | 166 | | 100X | 4/5 | 0.978 | 0.975 | GDrive[Best Model] | 167 | | 200X | 3/5 | 0.985 | 0.982 | GDrive[Best Model] | 168 | | 400X | 4/5 | 0.958 | 0.952 | GDrive[Best Model] | 169 | | Combined Benign/Malignant | 5/5 | 0.988 | 0.985 | GDrive[Best Model] | 170 | | Combined Sub-Benign | 5/5 | 0.955 | 0.950 | GDrive[Best Model] | 171 | | Combined Sub-Malignant | 3/5 | 0.928 | 0.920 | GDrive[Best Model] | 172 | 173 | # Requirements 174 | - keras 175 | - tensorflow 176 | - albumentations 177 | - matplotlib 178 | - numpy 179 | - Pillow 180 | - scikit-image 181 | - scikit-learn 182 | - tqdm 183 | 184 | # Training 185 | Download and extract Breast Cancer Histopathological Database (BreakHis) into "data" folder. Then choose the IPython Notebook to train and test the model. 186 | 187 | # Citation 188 | ``` 189 | M. Togaçar, K.B. Özkurt, B. Ergen et al., BreastNet: A novel ˘ 190 | convolutional neural network model through histopathological images for the diagnosis of breast 191 | cancer, Physica A (2019), doi: https://doi.org/10.1016/j.physa.2019.123592 . 192 | ``` 193 | # Contact 194 | If you have any questions about the research, feel free to ask! 195 |
196 | 197 | 198 | ``` 199 | E-mail: kutsal_baran@hotmail.com 200 | ``` 201 | -------------------------------------------------------------------------------- /research/data/download_data_here.txt: -------------------------------------------------------------------------------- 1 | BreaKHis_v1.tar.gz -------------------------------------------------------------------------------- /research/tmp/100X - 4. FOLD - MODEL ACCURACY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/100X - 4. FOLD - MODEL ACCURACY.jpg -------------------------------------------------------------------------------- /research/tmp/100X - 4. FOLD - MODEL LOSS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/100X - 4. FOLD - MODEL LOSS.jpg -------------------------------------------------------------------------------- /research/tmp/100X - ROC - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/100X - ROC - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/100X - confusion matrix - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/100X - confusion matrix - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/200X - 3. FOLD - MODEL ACCURACY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/200X - 3. FOLD - MODEL ACCURACY.jpg -------------------------------------------------------------------------------- /research/tmp/200X - 3. FOLD - MODEL LOSS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/200X - 3. FOLD - MODEL LOSS.jpg -------------------------------------------------------------------------------- /research/tmp/200X - ROC - 3. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/200X - ROC - 3. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/200X - confusion matrix - 3. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/200X - confusion matrix - 3. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/400X - 4. FOLD - MODEL ACCURACY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/400X - 4. FOLD - MODEL ACCURACY.jpg -------------------------------------------------------------------------------- /research/tmp/400X - 4. FOLD - MODEL LOSS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/400X - 4. FOLD - MODEL LOSS.jpg -------------------------------------------------------------------------------- /research/tmp/400X - ROC - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/400X - ROC - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/400X - confusion matrix - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/400X - confusion matrix - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/40X - 4. FOLD - MODEL ACCURACY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/40X - 4. FOLD - MODEL ACCURACY.jpg -------------------------------------------------------------------------------- /research/tmp/40X - 4. FOLD - MODEL LOSS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/40X - 4. FOLD - MODEL LOSS.jpg -------------------------------------------------------------------------------- /research/tmp/40X - ROC - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/40X - ROC - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/40X - confusion matrix - 4. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/40X - confusion matrix - 4. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA - confusion matrix - 5. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA - confusion matrix - 5. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_4_CLASS_BENIGN - confusion matrix - 5. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_4_CLASS_BENIGN - confusion matrix - 5. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_4_CLASS_MALIGNANT - confusion matrix - 3. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_4_CLASS_MALIGNANT - confusion matrix - 3. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_TOGETHER - 5. FOLD - MODEL ACCURACY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_TOGETHER - 5. FOLD - MODEL ACCURACY.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_TOGETHER - 5. FOLD - MODEL LOSS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_TOGETHER - 5. FOLD - MODEL LOSS.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_TOGETHER_BENIGN - 5. FOLD - MODEL ACCURACY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_TOGETHER_BENIGN - 5. FOLD - MODEL ACCURACY.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_TOGETHER_BENIGN - 5. FOLD - MODEL LOSS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_TOGETHER_BENIGN - 5. FOLD - MODEL LOSS.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_TOGETHER_MALIGNANT - 3. FOLD - MODEL ACCURACY.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_TOGETHER_MALIGNANT - 3. FOLD - MODEL ACCURACY.jpg -------------------------------------------------------------------------------- /research/tmp/ALL_DATA_TOGETHER_MALIGNANT - 3. FOLD - MODEL LOSS.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/ALL_DATA_TOGETHER_MALIGNANT - 3. FOLD - MODEL LOSS.jpg -------------------------------------------------------------------------------- /research/tmp/All_Data - ROC - 5. FOLD.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/All_Data - ROC - 5. FOLD.jpg -------------------------------------------------------------------------------- /research/tmp/BreastNet_arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/BreastNet_arch.png -------------------------------------------------------------------------------- /research/tmp/attention_modules_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/attention_modules_1.png -------------------------------------------------------------------------------- /research/tmp/attention_modules_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/attention_modules_2.png -------------------------------------------------------------------------------- /research/tmp/base_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/base_blocks.png -------------------------------------------------------------------------------- /research/tmp/residual_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Goodsea/BreastNet/1ff5035f3cdcc8a46f702115fac623621d6bda69/research/tmp/residual_block.png --------------------------------------------------------------------------------