Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Covid-net model? #2

Closed
fcakyon opened this issue Mar 25, 2020 · 23 comments
Closed

Covid-net model? #2

fcakyon opened this issue Mar 25, 2020 · 23 comments
Labels
enhancement New feature or request

Comments

@fcakyon
Copy link

fcakyon commented Mar 25, 2020

Paper mentions that code for covid-net architecture is available at repo but it is not present atm.

@Vikramank
Copy link

she has mentioned in the repo that she will be uploading them soon.

@lindawangg
Copy link
Owner

This is the link to the tensorflow model: https://drive.google.com/file/d/1FyfcAkRf-0gQ1nOrDJ9ccGVSZAO9VFP1/view?usp=sharing. I shared the input and output tensors in the training and evaluation section of the readme

@Vikramank
Copy link

hi, I'm unable to load the model, since I don't know the model definition. TensorFlow is expecting to define the model before loading the weights from the checkpoint file. It would be great if you could share a helper function (like create_model) that would return the model

@alext234
Copy link

I’ll be interested too to load the model

@Vikramank
Copy link

The training data is available in .npy format which is great. I used transfer learning (Inception V3) to make a model. I got a validation accuracy of 81%. However, my precision for Covid class is 67%. Also testing images out of this dataset is leading to low performance. I wish clinicians share more Chest Xrays so that we can train better models and boost the reliability of ML predictions.

@shahdghorsi
Copy link

shahdghorsi commented Mar 27, 2020

@Vikramank have you tried to test the model on an image ?
are you able to share the model :)

@Vikramank
Copy link

@shahdghorsi I created a web app using flask and was about to deploy in Heroku. However, while testing in some in new images, my model gave poor predictions. I'm working on it, will share it I'm getting decent accuracy. The author (Linda) has achieved better accuracy, sensitivity and specificity with new architecture specified in the paper. I hope she shares with us soon.

@SuryaKalia
Copy link

SuryaKalia commented Mar 27, 2020

hi, I'm unable to load the model, since I don't know the model definition. TensorFlow is expecting to define the model before loading the weights from the checkpoint file. It would be great if you could share a helper function (like create_model) that would return the model

@Vikramank Model definition is not required since these weights are saved using the Saver class. Here, our meta file will incorporate the graph which is loaded first, followed by the network weights. You can try the following:

new_graph = tf.Graph()
with tf.Session(graph=new_graph) as sess:
saver = tf.train.import_meta_graph('./model.meta')
saver.restore(sess, "./")

At the moment, you'd encounter the following error when loading the model:

The passed save_path is not a valid checkpoint: ./

Ref. #5

@shahdghorsi
Copy link

@shahdghorsi I created a web app using flask and was about to deploy in Heroku. However, while testing in some in new images, my model gave poor predictions. I'm working on it, will share it I'm getting decent accuracy. The author (Linda) has achieved better accuracy, sensitivity and specificity with new architecture specified in the paper. I hope she shares with us soon.

Okay thank you so much I am searching as well if I get somthing usefull I will share it as will

@josephius
Copy link
Collaborator

new_graph = tf.Graph()
with tf.Session(graph=new_graph) as sess:
saver = tf.train.import_meta_graph('./model.meta')
saver.restore(sess, "./")

Try changing the last line to:

saver.restore(sess, "./model")

@Vikramank
Copy link

@josephius @SuryaKalia , thanks, guys!

@josephius
Copy link
Collaborator

Note that there is an issue with the pretrained model. I tested it earlier and got a slightly different confusion matrix. Linda told me that she'd seen this discrepancy as well and believes it's because the model was trained within DarwinAI's proprietary library called GenSynth. Apparently the results when tested within GenSynth are better than with the exported model.

@Vikramank
Copy link

@SuryaKalia after using the method suggested by @josephius I'm able to load the model.
@josephius I am facing some discrepancies related to the dataset. The number of COVID samples is not matching the number in the confusion matrix

@josephius
Copy link
Collaborator

See: #1

@josephius
Copy link
Collaborator

So, to clarify, the results on the confusion matrix are from the model trained on the first version of the dataset. The dataset has already been partially updated with new samples in the raw image dataset, but as of a few days ago when I downloaded them last, the numpy arrays have not been updated yet.

In discussion with the authors, they made it clear that they would prefer that new contributions wait until the next iteration of the dataset, which is meant to be a significant update that deals with a concern that certain institutions have discussed with them, namely that the non-COVID-19 pneumonia data is from a pediatric dataset (as in, of child patients). That could be confounding, as I believe it could lead to the model learning to differentiate the samples based on the size of the lungs rather than the actual COVID-19 specific details.

So, I recommend holding off on further efforts until the new dataset is presented, which should hopefully be later today.

@SuryaKalia
Copy link

Thanks @josephius @Vikramank

@lindawangg
Copy link
Owner

We just released new models, which can be found at the bottom of the readme, along with an evaluation script which includes how to load the model.

@PaulMcInnis PaulMcInnis added the enhancement New feature or request label Mar 30, 2020
@busyyang
Copy link

busyyang commented Mar 31, 2020

I just implement this model in Keras(tf2.keras). I trained this model in 100 epoch with result of 100% accuracy and recall in training set, but ~65% in test set. It is overfited obviously. If someone is interested in it, please check :https://github.com/busyyang/COVID-19.

@bfreskura
Copy link

We have released a Pytorch model that was trained on this dataset. The architecture is not the same as the COVID-Net, but it achieves comparable performance and the model code is available.

Hope you find it useful!
https://github.com/velebit-ai/COVID-Next-Pytorch

@jchilela
Copy link

This is the link to the tensorflow model: https://drive.google.com/file/d/1FyfcAkRf-0gQ1nOrDJ9ccGVSZAO9VFP1/view?usp=sharing. I shared the input and output tensors in the training and evaluation section of the readme

This link does not exists. Can you update it Linda?

@mariamma
Copy link

mariamma commented Nov 12, 2021

This is the link to the tensorflow model: https://drive.google.com/file/d/1FyfcAkRf-0gQ1nOrDJ9ccGVSZAO9VFP1/view?usp=sharing. I shared the input and output tensors in the training and evaluation section of the readme

@lindawangg This link does not exist. Can you please update it Linda?

@haydengunraj
Copy link
Collaborator

haydengunraj commented Nov 12, 2021

@mariamma , official model links are available in docs/models.md. If you're looking for the model described in the original paper, I believe the one you want is COVIDNet-CXR3-B.

However, it would be better to use one of the more recent models, as they were trained using significantly more data and may generalize more effectively.

@mariamma
Copy link

mariamma commented Nov 15, 2021

@haydengunraj Thank you for providing me with the information. I want to integrate Grad-CAM with Covidnet Model. For that purpose, could you please provide the name of the last convolution output tensor of the pre-trained models - COVIDNet-CXR4-C, COVIDNet-CXR4-A, and COVIDNet-CXR3-B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests