Closed PrateekMunjal closed 4 years ago
# detps = [-1.5, -1.5, -1.5, -1.5, -2, -2, -1.5, -1.5, -1.5, -1.5]
epoch_nums = [8,49,20,6,143,97,28,24,14,20]
folds = [i for i in range(10)]
detps = [-2 for i in range(10)]
It seems you use detection probability as -2 for all the folds. Maybe you can have a try to see whether it is the issue.
Thanks for your quick reply!
I don't think that to be an issue, because even if I narrow down to match the performance for only fold 2 and fold 6 as they have the most difference.
For fold 2,
For fold 6,
So changing value from -2 won't make any difference.
Also just to be clear that in the above 2 it shows exactly same performance does not mean it gives same everytime. For example, check following where best is -2.
Other than detps = [-2 for i in range(10)], do you see any other step I understood or done wrong?
How about trying more detection probability [-3, -2.5, -2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]? Your performances on other folds are better than mine. So the procedure should be correct. The difference probably is the hyper-parameter of the detection probability.
Hi, thanks for sharing your work!
I have been trying to work on your pre-trained models shared for 3d res and 3d dpn. To begin I started with resnet models and as of now, I am not able to get the performance match for each of the folds mentioned in the supplementary section of your paper. I will now enlist the steps which I made inorder to make your codebase run and end with the performance I achieve, kindly let me know if I made a mistake at any of the steps.
python prepare.py
lr & weight decay values taken from paper experimental section -- for testing ignore them
cd detector maxeps=150
model_name=res18
f=3 i=6
echo "process $i epoch" echo "loading resmodel/res18fd${f}00$i.ckpt" echo ${PWD}
if [ $i -lt 10 ]; then CUDA_VISIBLE_DEVICES=5,6 python main.py --lr 0.01 --wd 1e-4 --model $model_name -b 32 --resume resmodel/res18fd${f}00$i.ckpt --test 1 --save-dir resmodel/res18fd$f/ --config config_training$f elif [ $i -lt 100 ]; then CUDA_VISIBLE_DEVICES=5,6 python main.py --lr 0.001 --wd 1e-4 --model $model_name -b 32 --resume resmodel/res18fd${f}0$i.ckpt --test 1 --save-dir resmodel/res18fd$f/ --config config_training$f elif [ $i -lt 1000 ]; then CUDA_VISIBLE_DEVICES=5,6 python main.py --lr 0.0001 --wd 1e-4 --model $model_name -b 32 --resume resmodel/res18fd${f}$i.ckpt --test 1 --save-dir resmodel/res18fd$f/ --config config_training$f else echo "Unhandled case" fi
echo "i: $i" if [ ! -d "results/resmodel/res18fd$f/val$i/" ]; then echo "Creating directory.." mkdir -p results/resmodel/res18fd$f/val$i/ fi mv results/resmodel/res18fd$f/bbox/*.npy results/resmodel/res18fd$f/val$i/
all_exclude_fpath = '/raid/shadab/prateek/dgx30/prateek/DeepLung/evaluationScript/annotations/annotations_excluded.csv'
original_annots_fpath = '/raid/shadab/prateek/dgx30/prateek/DeepLung/luna16/CSVFILES/annotations.csv'
ex_csv_rdr = csv.reader(open(all_exclude_fpath), delimiter=',')
orig_csv_rdr = csv.reader(open(original_annots_fpath), delimiter=',')
all_excluded_annots = None
all_original_annotations = None
get all excluded annotations
for row in ex_csv_rdr:
if all_excluded_annots == None:
all_excluded_annots = [row[0]]
else:
if row[0] not in all_excluded_annots:
all_excluded_annots.append(row[0])
fold=0
for fold in range(10):
To combine best-csv files from each fold
startline = ["seriesuid,coordX,coordY,coordZ,probability"]
par_fpath = '/raid/shadab/prateek/dgx30/prateek/DeepLung/evaluationScript/annotations' fname = 'my3DRes18_annotations.csv' annot_writer = csv.writer(open(os.path.join(par_fpath, fname),'w'), delimiter='\n') annot_content = [] annot_writer.writerow(startline)
detps = [-1.5, -1.5, -1.5, -1.5, -2, -2, -1.5, -1.5, -1.5, -1.5]
epoch_nums = [8,49,20,6,143,97,28,24,14,20] folds = [i for i in range(10)] detps = [-2 for i in range(10)]
fold_annot_fpath = '/raid/shadab/prateek/dgx30/prateek/DeepLung/detector/results/resmodel/res18fd' #0/val8'
for fold,ep,detp in zip(folds, epoch_nums, detps): temp_annot_fpath = fold_annot_fpath + str(fold) + '/val'+str(ep)
annot_writer.writerow(annot_content)