lindawangg / COVID-Net

COVID-Net Open Source Initiative
Other
1.15k stars 480 forks source link

How to train from scratch #92

Open Electro1111 opened 4 years ago

Electro1111 commented 4 years ago

Hello,

I noticed there is no model definition in this repository. I also noticed that this was pre-trained on image-net dataset. I was wondering if it would be possible to get the image-net pre-trained weights so that I could retrain this network on the dataset.

haydengunraj commented 4 years ago

Hi there,

With respect to the model definition, while we do not provide code for constructing the model, we do provide the model's metagraph file and trained weights. You can train the model from scratch by simply commenting out the lines in the training script where the weights are loaded.

To answer your question about ImageNet weights, unfortunately providing them will not be possible. Quoting the COVID-Net paper:

"The initial COVID-Net prototype was built and evaluated using the Keras deep learning library with a TensorFlow backend. The proposed COVID-Net architecture was built using generative synthesis, as described in Section 3.3."

What this means is that the prototype network was trained on ImageNet and COVIDx, but was then heavily modified during the generative synthesis process. As such, ImageNet weights for the final COVID-Net model do not exist - only the prototype network has ImageNet weights.

Electro1111 commented 4 years ago

ok so to train from scratch would it just be a matter of commenting out this line in the code?

saver.restore(sess, os.path.join(args.weightspath, args.ckptname))

haydengunraj commented 4 years ago

Yes, that's correct.

Electro1111 commented 4 years ago

also from what I understand, this is the portion of the code that loads the metagraph, correct?:

tf.get_default_graph() saver = tf.train.import_meta_graph(os.path.join(args.weightspath, args.metaname)) graph = tf.get_default_graph()

haydengunraj commented 4 years ago

That's right - tf.train.import_meta_graph() loads the metagraph into the default graph.

Electro1111 commented 4 years ago

Ok, thank you

are there any plans to release the scripts used to do the generative synthesis from the prototype model?

haydengunraj commented 4 years ago

Generative synthesis is part of the GenSynth deep learning development platform provided by DarwinAI, and so we will not be able to release any code for this.

Electro1111 commented 4 years ago

ahh ok. Has there been any experimentation with training the developed model from scratch and seeing how it performs with just simple training?

haydengunraj commented 4 years ago

As far as I know this has not been explored - if you do so, we'd love to hear the results you achieve and settings you use!

Electro1111 commented 4 years ago

One final question, was your model pretrained using a black and white version of Imagenet since these images are single channel?