mr7495 / Sperm_detection_and_tracking

Sperm detection and tracking methods from this paper: https://arxiv.org/abs/2002.04034
19 stars 10 forks source link

The structure of the model you share seems to be different from the structure of the code you provided #1

Closed qiangsir closed 4 years ago

qiangsir commented 4 years ago

hi, I found that the structure of the model I trained with the script is different from the structure of the model you share.

I used this line of code to train: python3 keras_retinanet/bin/train.py --epoch=1 --step=500 --batch-size=5 --random-transform csv 'annotation_sample.csv' 'classes.csv'

mr7495 commented 4 years ago

Hello @qiangsir I trained RetinaNet on ResNet50 backbone with this line of code. The only difference is that we implemented a method for concatenating some consecutive frames to improve the detection accuracy, so if you choose to concatenate 5 frames, the input layer would be None,None,None,5 instead of None,None,None,3. Please explain more about the differences between the structure you found and what we reported.

qiangsir commented 4 years ago

@mr7495 I trained the model with 3 frames too.I have saved the structure of the model I trained and the structure of the model you shared with the keras.utils.plot_model function. I uploaded them to my github repository, the address is listed below:

https://github.com/qiangsir/sperm_detection/blob/master/model1.png https://github.com/qiangsir/sperm_detection/blob/master/model2.png

model1 is the structure of final_retinanet_sperm_detection_3frames.h5 that you shared. model2 is the structure of the model I trained with the code.

Obviously, the two models are different in the last few layers.

mr7495 commented 4 years ago

@qiangsir The network we shared is the inference version of the RetinaNet model. The inference model has some differences with the training model. We convert the training model to the inference model for testing and using the network after the training is finished. You can read more about the inference and training models in https://github.com/fizyr/keras-retinanet You can also use our final training model by: https://drive.google.com/file/d/14ufFO8GKbE5Qlrm3wloHKQcsnudwHeSR/view?usp=sharing If you compare this model with your own model, you will see that there are no differences.

qiangsir commented 4 years ago

@mr7495 I got it,than you.