Due to the imbalanced dataset between non-pneumothorax and pneumothorax images, instead of using original dataset, positive and negative samples are re-sampled ahead of each epoch such that positive images accounts for k%
and the remaining percentage is used for negative ones. The optimal k
based on other research is 80%
Based on training part of other teams, our study proposed three models:
- U-Net with backbone ResNet-34
- U-Net with backbone ResNet-50
- U-Net with backbone SE-ResNeXt-50
To threshold the probability mask that model returns, three threshold values are used and searched the optimal one during training process. In general, our thresholds are(upper bound threshold, lower bound threshold, minimum positive area). Mechanism of our thresholding method is to firstly check how many pixel on the output mask have the value larger than upper bound threshold. Then, if the figure is less than minimum positive area, the mask is non-pneumothorax; otherwise, the pixel greater than lower bound threshold is positive pixel
Model | Validation accuracy | Test accuracy | Thresholds |
---|---|---|---|
U-Net with ResNet-34 | 78.6% | 60% | (0.75, 1000, 0.3) |
U-Net with ResNet-50 | 86.8% | 88.2% | (0.75, 2000, 0.4) |
U-Net with SE-ResNeXt-50 | 87.2% | 89.4% | (0.6, 3000, 0.4) |
Our top score is much greater than that of winning solution
pip install -r requirements.txt
You can download the raw data here due to the termination of dataset on Kaggle
Set your own data path, here our data paths are siim/dicom-images-train/
, siim/dicom-images-test/
and siim/train-rle.csv
python convert2png.py --train-path siim/dicom-images-train/ --test-path siim/dicom-images-test/ --rle-path siim/train-rle.csv --output-path input/dataset1024 --image-size 1024
python train.py --train-config experiments/albunet_valid/train_config_part0.yaml
python inference.py --config experiments/albunet_valid/2nd_stage_inference.yaml
To submit
python triplet_submit.py --config experiments/albunet_valid/2nd_stage_submit.yaml
python train.py --train-config experiments/resnet50/train_config_part0.yaml
python inference.py --config experiments/resnet50/2nd_stage_inference.yaml
To submit
python triplet_submit.py --config experiments/resnet50/2nd_stage_submit.yaml
python train.py --train-config experiments/seunet/train_config_part0.yaml
python inference.py --config experiments/seunet/2nd_stage_inference.yaml
To submit
python triplet_submit.py --config experiments/seunet/2nd_stage_submit.yaml
Visit the branch Thanh
to launch our demo