Breast cancer is both the most prevalent type of cancer across the world and a malignant disease with the highest rate of cancer-related mortality among women. Breast cancer comes first among the most prevalent types of cancer in TÜRKİYE.
As the Digital Transformation Office of the Presidency of the Republic of Türkiye, we are carrying out the Digital Eye Project (Breast Cancer Detection with Artificial Intelligence) in order to assist radiologists in screenings with mammography applied for the early diagnosis of breast cancer and to reduce their workload.
Key features:
Powered by Carefully Prepared Data: This project is built on meticulously prepared and labeled KETEM dataset.
Transfer Learning Made Easy: You can use this repository as a source for transfer learning, making it easier to leverage pre-trained models and adapt them to new tasks.
Boost Performance with Ensemble Models: With various strategies, this project allows you to combine outputs from different deep learning architectures, enhancing the overall performance.
Compatible with MMDetection: This project plays well with MMdetection, making it effortless to use and open to developers for adding new features.
Visualize and Compare Model Results: Get a visual representation of your model's performance and generate detailed comparison reports. Calculate scientific metrics like True Positive Rate (TPR), Average Precision (AP) for each class, and mean Average Precision (mAP).
Open-Source and Accessible: This toolkit is available as an open-source project, fostering collaboration and enabling developers to contribute and benefit from its features.
Results and models are available in the below. Models will be automatically downloaded according to the selected model when running.
Models can also be downloaded from the releases.
Model | Class | TPR | FPPI | AP | mAP | Checkpoints |
---|---|---|---|---|---|---|
Faster R-CNN | BI-RADS 4-5 BI-RADS 1-2 |
0.948 0.958 |
0.55 0.872 |
0.908 0.892 |
0.9 | checkpoint |
DoubleHead R-CNN | BI-RADS 4-5 BI-RADS 1-2 |
0.944 0.953 |
0.499 0.848 |
0.903 0.883 |
0.893 | checkpoint |
Dynamic R-CNN | BI-RADS 4-5 BI-RADS 1-2 |
0.943 0.958 |
0.519 0.791 |
0.898 0.882 |
0.89 | checkpoint |
Cascade R-CNN | BI-RADS 4-5 BI-RADS 1-2 |
0.948 0.96 |
0.516 0.865 |
0.9 0.884 |
0.892 | checkpoint |
YOLOv3 | BI-RADS 4-5 BI-RADS 1-2 |
0.918 0.925 |
0.136 0.514 |
0.891 0.842 |
0.867 | checkpoint |
RetinaNET | BI-RADS 4-5 BI-RADS 1-2 |
0.966 0.967 |
1.801 3.152 |
0.916 0.89 |
0.903 | checkpoint |
FCOS | BI-RADS 4-5 BI-RADS 1-2 |
0.96 0.961 |
0.467 1.049 |
0.93 0.906 |
0.918 | checkpoint |
VarifocalNET | BI-RADS 4-5 BI-RADS 1-2 |
0.961 0.976 |
1.859 3.104 |
0.915 0.908 |
0.911 | checkpoint |
ATSS | BI-RADS 4-5 BI-RADS 1-2 |
0.954 0.965 |
0.941 1.259 |
0.916 0.906 |
0.911 | checkpoint |
DETR | BI-RADS 4-5 BI-RADS 1-2 |
0.941 0.969 |
0.493 1.025 |
0.913 0.899 |
0.906 | checkpoint |
DEDETR | BI-RADS 4-5 BI-RADS 1-2 |
0.966 0.967 |
1.235 1.797 |
0.941 0.914 |
0.927 | checkpoint |
ENSEMBLE of BEST 3 MODELS ATSS, DEDETR, FCOS |
BI-RADS 4-5 BI-RADS 1-2 |
0.958 0.968 |
0.575 1.020 |
0.937 0.922 |
0.929 | --- |
ENSEMBLE of ALL MODELS | BI-RADS 4-5 BI-RADS 1-2 |
0.953 0.971 |
0.573 1.033 |
0.928 0.918 |
0.923 | --- |
This application works torch 1.12.x and 10.2 <= cuda <= 11.6 between versions.
Step 1. Clone repo
git clone https://github.com/cbddobvyz/digitaleye-mammography.git
Step 2. Install requirements and mmcv-full version.
pip install -r requirements.txt
mim install mmcv_full==1.7.1
Note: To perform install using Docker, please review the docker readme file
The parameters for running the toolkit in the terminal are provided below.
--model_enum:
represents the user's model selection (Required Parameter)
{0: 'ATSS'
1: 'CASCADE R-CNN'
2: 'DEFORMABLE DETR'
3: 'DETR'
4: 'DOUBLEHEAD R-CNN'
5: 'DYNAMIC R-CNN'
6: 'FASTER R-CNN'
7: 'FCOS'
8: 'RETINANET'
9: 'VARIFOCALNET'
10: 'YOLOv3'
}
--img_path:
folder path for test images (Required Parameter)
--device:
running device (Optional Parameter, Default: 'cpu')
--classify_mass:
mass classification flag, if True it classifies mass as benign or malignant otherwise only mass detection performs (Optional Parameter, Default: True)
--segment_breast:
breast segmentation for pre-processing (Optional Parameter, Default: True) Download link for breast segmentation model
--enable_ensemble:
applies ensemble (Optional Parameter, Default: False)
--annotation_path:
annotation path for test images (Optional Parameter, Default: None) Annotation file format from MMDetection
--nms_iou_threshold:
applies nms threshold to model results for post-processing (Optional Parameter, Default: 0.1)*
--confidence_threshold:
applies confidence threshold to model results for post-processing (Optional Parameter, Default: 0.05)*
--ap_threshold:
IoU threshold for determining prediction as TP (True Positive) (Optional Parameter, Default: 0.1)
Some of the usage examples are shown below.
python mass_inference.py --model_enum 3 8 10 --img_path test/img_paths/ --classify_mass False
python mass_inference.py --model_enum 0 6 1 --img_path test/imgs_path/ --segment_breast False --annotation_path test/annot_path.txt --nms_iou_threshold 0.25 --confidence_threshold 0.5 --ap_threshold 0.1
python mass_inference.py --model_enum 2 4 5 7 9 --img_path test/imgs_path/ --enable_ensemble --nms_iou_threshold 0.1 --confidence_threshold 0.33 --ap_threshold 0.5
This work was supported by Digital Transformation Office of the Presidency of Republic of Türkiye. We would like to thanks Republic of Türkiye Ministry of Health for sharing anonymized KETEM dataset and their valuable support.
This project is released under the GNU/GPLv3
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
THIS REPOSITORY DOES NOT PROVIDE MEDICAL ADVICE. THE INFORMATION, INCLUDING BUT NOT LIMITED TO, TEXT, GRAPHICS, IMAGES, AND OTHER MATERIAL CONTAINED ON THIS REPOSITORY ARE FOR INFORMATIONAL PURPOSES ONLY. NO MATERIAL ON THIS REPOSITORY IS INTENDED TO BE A SUBSTITUTE FOR PROFESSIONAL MEDICAL ADVICE, DIAGNOSIS, OR TREATMENT. ALWAYS SEEK THE ADVICE OF YOUR PHYSICIAN OR OTHER QUALIFIED HEALTH CARE PROVIDER WITH ANY QUESTIONS YOU MAY HAVE REGARDING A MEDICAL CONDITION OR TREATMENT, AND NEVER DISREGARD PROFESSIONAL MEDICAL ADVICE OR DELAY IN SEEKING IT BECAUSE OF SOMETHING YOU HAVE READ ON THIS REPOSITORY.
THE CONTENT OF REPOSITORY IS PROVIDED FOR INFORMATION PURPOSES ONLY. NO CLAIM IS MADE AS TO THE ACCURACY OR CURRENCY OF THE CONTENT ON THIS REPOSITORY AT ANY TIME. THE DIGITAL TRANSFORMATION OFFICE DOES NOT ACCEPT ANY LIABILITY TO ANY PERSON/INSTITUTION/ORGANIZATION FOR THE INFORMATION OR MODEL (OR THE USE OF SUCH INFORMATION OR MODEL) WHICH IS PROVIDED ON THIS REPOSITORY OR INCORPORATED INTO IT BY REFERENCE.
To be added...