The model detect the abnormalities in chest-Xray image by using RetinaNet
This project is currently version 1 by using transfer learning from fizyr
This project used the dataset form VinBigData to classify and localize 14 diseases in chest-Xray.
But after experiments, we decided to choose 5/14 diseases from that dataset (the reason, we have described in detail in Data_Preprocessing).
Our result after 85 epochs:
Disease | Aortic enlargement | Cardiomegaly | ILD | Pleural thickening | Pulmonary fibrosis |
---|---|---|---|---|---|
AP | 0.9751 | 0.9478 | 0.9478 | 0.6561 | 0.7104 |
mAP (Training): 0.8044 for 5 diseases
- Create virtual environment
conda create -n myenv python=3.8
conda activate myenv
- clone this repository
- Install required packages
pip install Keras_retinanet/.
pip install -r Keras_retinanet/requirements.txt
-
In the repository, execute
bash setup_data.sh
for create folder and download small dataset. -
Download pretrain model
python config/download_model.py --dest Keras_retinanet/snapshots/pretrain_model.h5
- Setup
cd Keras_retinanet
python setup.py build_ext --inplace
- Convert dataset to standard format
python config/convert_data.py --Dataset_small/dataset_after_processing_small.csv --dest Keras_retinanet
- Change directory in the Keras_retinanet folder and training
cd Keras_retinanet
python keras_retinanet/bin/train.py --freeze-backbone --workers 0 --weights snapshots/pretrain_model.h5 --backbone "resnet101" --lr 0.00002 --batch-size 6 --steps 20 --image-min-side 900 --image-max-side 900 --epochs 2 csv annotation_5_classes.csv classes_5.csv --val-annotations annotation_5_classes.csv
- Run streamlit
streamlit run streamlit.py
Start to enjoy